clitrigger 0.1.1 → 0.1.3

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 (72) hide show
  1. package/.env.example +1 -1
  2. package/README.md +34 -1
  3. package/bin/clitrigger.js +146 -12
  4. package/bin/postuninstall.js +19 -0
  5. package/dist/client/assets/index-B4peRpUi.js +134 -0
  6. package/dist/client/assets/index-Bjyoy6lB.css +1 -0
  7. package/dist/client/index.html +3 -2
  8. package/dist/client/logo-icon.svg +15 -0
  9. package/dist/client/logo.svg +17 -0
  10. package/dist/server/db/queries.d.ts +7 -3
  11. package/dist/server/db/queries.d.ts.map +1 -1
  12. package/dist/server/db/queries.js +15 -3
  13. package/dist/server/db/queries.js.map +1 -1
  14. package/dist/server/db/schema.d.ts.map +1 -1
  15. package/dist/server/db/schema.js +4 -0
  16. package/dist/server/db/schema.js.map +1 -1
  17. package/dist/server/index.d.ts.map +1 -1
  18. package/dist/server/index.js +30 -4
  19. package/dist/server/index.js.map +1 -1
  20. package/dist/server/middleware/auth.d.ts.map +1 -1
  21. package/dist/server/middleware/auth.js +0 -4
  22. package/dist/server/middleware/auth.js.map +1 -1
  23. package/dist/server/routes/auth.d.ts.map +1 -1
  24. package/dist/server/routes/auth.js +1 -2
  25. package/dist/server/routes/auth.js.map +1 -1
  26. package/dist/server/routes/execution.d.ts.map +1 -1
  27. package/dist/server/routes/execution.js +65 -5
  28. package/dist/server/routes/execution.js.map +1 -1
  29. package/dist/server/routes/projects.d.ts.map +1 -1
  30. package/dist/server/routes/projects.js +82 -5
  31. package/dist/server/routes/projects.js.map +1 -1
  32. package/dist/server/services/claude-manager.d.ts +1 -1
  33. package/dist/server/services/claude-manager.d.ts.map +1 -1
  34. package/dist/server/services/claude-manager.js +46 -17
  35. package/dist/server/services/claude-manager.js.map +1 -1
  36. package/dist/server/services/cli-adapters.d.ts +4 -0
  37. package/dist/server/services/cli-adapters.d.ts.map +1 -1
  38. package/dist/server/services/cli-adapters.js +12 -3
  39. package/dist/server/services/cli-adapters.js.map +1 -1
  40. package/dist/server/services/debug-logger.d.ts +1 -0
  41. package/dist/server/services/debug-logger.d.ts.map +1 -1
  42. package/dist/server/services/debug-logger.js +15 -0
  43. package/dist/server/services/debug-logger.js.map +1 -1
  44. package/dist/server/services/log-streamer.d.ts +7 -0
  45. package/dist/server/services/log-streamer.d.ts.map +1 -1
  46. package/dist/server/services/log-streamer.js +26 -13
  47. package/dist/server/services/log-streamer.js.map +1 -1
  48. package/dist/server/services/orchestrator.d.ts +8 -0
  49. package/dist/server/services/orchestrator.d.ts.map +1 -1
  50. package/dist/server/services/orchestrator.js +142 -39
  51. package/dist/server/services/orchestrator.js.map +1 -1
  52. package/dist/server/services/pty-output-filter.d.ts +18 -0
  53. package/dist/server/services/pty-output-filter.d.ts.map +1 -0
  54. package/dist/server/services/pty-output-filter.js +125 -0
  55. package/dist/server/services/pty-output-filter.js.map +1 -0
  56. package/dist/server/services/task-intent.d.ts +6 -0
  57. package/dist/server/services/task-intent.d.ts.map +1 -0
  58. package/dist/server/services/task-intent.js +4 -0
  59. package/dist/server/services/task-intent.js.map +1 -0
  60. package/dist/server/services/tunnel-manager.d.ts +2 -2
  61. package/dist/server/services/tunnel-manager.d.ts.map +1 -1
  62. package/dist/server/services/tunnel-manager.js +20 -7
  63. package/dist/server/services/tunnel-manager.js.map +1 -1
  64. package/dist/server/services/worktree-manager.d.ts +5 -0
  65. package/dist/server/services/worktree-manager.d.ts.map +1 -1
  66. package/dist/server/services/worktree-manager.js +40 -13
  67. package/dist/server/services/worktree-manager.js.map +1 -1
  68. package/dist/server/websocket/index.js +2 -2
  69. package/dist/server/websocket/index.js.map +1 -1
  70. package/package.json +4 -2
  71. package/dist/client/assets/index-BkOCv65b.css +0 -1
  72. package/dist/client/assets/index-Fbf16Lh1.js +0 -129
@@ -0,0 +1,134 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&a(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();var Wu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ds(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Th={exports:{}},zl={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and 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 sj;function $R(){if(sj)return zl;sj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,s,l){var o=null;if(l!==void 0&&(o=""+l),s.key!==void 0&&(o=""+s.key),"key"in s){l={};for(var c in s)c!=="key"&&(l[c]=s[c])}else l=s;return s=l.ref,{$$typeof:e,type:a,key:o,ref:s!==void 0?s:null,props:l}}return zl.Fragment=t,zl.jsx=n,zl.jsxs=n,zl}var lj;function GR(){return lj||(lj=1,Th.exports=$R()),Th.exports}var d=GR(),Ah={exports:{}},$e={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and 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 oj;function VR(){if(oj)return $e;oj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),x=Symbol.iterator;function y($){return $===null||typeof $!="object"?null:($=x&&$[x]||$["@@iterator"],typeof $=="function"?$:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,S={};function k($,Q,I){this.props=$,this.context=Q,this.refs=S,this.updater=I||w}k.prototype.isReactComponent={},k.prototype.setState=function($,Q){if(typeof $!="object"&&typeof $!="function"&&$!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,$,Q,"setState")},k.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function N(){}N.prototype=k.prototype;function _($,Q,I){this.props=$,this.context=Q,this.refs=S,this.updater=I||w}var E=_.prototype=new N;E.constructor=_,j(E,k.prototype),E.isPureReactComponent=!0;var M=Array.isArray;function T(){}var R={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function P($,Q,I){var V=I.ref;return{$$typeof:e,type:$,key:Q,ref:V!==void 0?V:null,props:I}}function L($,Q){return P($.type,Q,$.props)}function H($){return typeof $=="object"&&$!==null&&$.$$typeof===e}function F($){var Q={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(I){return Q[I]})}var G=/\/+/g;function q($,Q){return typeof $=="object"&&$!==null&&$.key!=null?F(""+$.key):Q.toString(36)}function O($){switch($.status){case"fulfilled":return $.value;case"rejected":throw $.reason;default:switch(typeof $.status=="string"?$.then(T,T):($.status="pending",$.then(function(Q){$.status==="pending"&&($.status="fulfilled",$.value=Q)},function(Q){$.status==="pending"&&($.status="rejected",$.reason=Q)})),$.status){case"fulfilled":return $.value;case"rejected":throw $.reason}}throw $}function D($,Q,I,V,te){var ne=typeof $;(ne==="undefined"||ne==="boolean")&&($=null);var W=!1;if($===null)W=!0;else switch(ne){case"bigint":case"string":case"number":W=!0;break;case"object":switch($.$$typeof){case e:case t:W=!0;break;case g:return W=$._init,D(W($._payload),Q,I,V,te)}}if(W)return te=te($),W=V===""?"."+q($,0):V,M(te)?(I="",W!=null&&(I=W.replace(G,"$&/")+"/"),D(te,Q,I,"",function(he){return he})):te!=null&&(H(te)&&(te=L(te,I+(te.key==null||$&&$.key===te.key?"":(""+te.key).replace(G,"$&/")+"/")+W)),Q.push(te)),1;W=0;var Y=V===""?".":V+":";if(M($))for(var ae=0;ae<$.length;ae++)V=$[ae],ne=Y+q(V,ae),W+=D(V,Q,I,ne,te);else if(ae=y($),typeof ae=="function")for($=ae.call($),ae=0;!(V=$.next()).done;)V=V.value,ne=Y+q(V,ae++),W+=D(V,Q,I,ne,te);else if(ne==="object"){if(typeof $.then=="function")return D(O($),Q,I,V,te);throw Q=String($),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return W}function X($,Q,I){if($==null)return $;var V=[],te=0;return D($,V,"","",function(ne){return Q.call(I,ne,te++)}),V}function K($){if($._status===-1){var Q=$._result;Q=Q(),Q.then(function(I){($._status===0||$._status===-1)&&($._status=1,$._result=I)},function(I){($._status===0||$._status===-1)&&($._status=2,$._result=I)}),$._status===-1&&($._status=0,$._result=Q)}if($._status===1)return $._result.default;throw $._result}var Z=typeof reportError=="function"?reportError:function($){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof $=="object"&&$!==null&&typeof $.message=="string"?String($.message):String($),error:$});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",$);return}console.error($)},z={map:X,forEach:function($,Q,I){X($,function(){Q.apply(this,arguments)},I)},count:function($){var Q=0;return X($,function(){Q++}),Q},toArray:function($){return X($,function(Q){return Q})||[]},only:function($){if(!H($))throw Error("React.Children.only expected to receive a single React element child.");return $}};return $e.Activity=p,$e.Children=z,$e.Component=k,$e.Fragment=n,$e.Profiler=s,$e.PureComponent=_,$e.StrictMode=a,$e.Suspense=f,$e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,$e.__COMPILER_RUNTIME={__proto__:null,c:function($){return R.H.useMemoCache($)}},$e.cache=function($){return function(){return $.apply(null,arguments)}},$e.cacheSignal=function(){return null},$e.cloneElement=function($,Q,I){if($==null)throw Error("The argument must be a React element, but you passed "+$+".");var V=j({},$.props),te=$.key;if(Q!=null)for(ne in Q.key!==void 0&&(te=""+Q.key),Q)!B.call(Q,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&Q.ref===void 0||(V[ne]=Q[ne]);var ne=arguments.length-2;if(ne===1)V.children=I;else if(1<ne){for(var W=Array(ne),Y=0;Y<ne;Y++)W[Y]=arguments[Y+2];V.children=W}return P($.type,te,V)},$e.createContext=function($){return $={$$typeof:o,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null},$.Provider=$,$.Consumer={$$typeof:l,_context:$},$},$e.createElement=function($,Q,I){var V,te={},ne=null;if(Q!=null)for(V in Q.key!==void 0&&(ne=""+Q.key),Q)B.call(Q,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(te[V]=Q[V]);var W=arguments.length-2;if(W===1)te.children=I;else if(1<W){for(var Y=Array(W),ae=0;ae<W;ae++)Y[ae]=arguments[ae+2];te.children=Y}if($&&$.defaultProps)for(V in W=$.defaultProps,W)te[V]===void 0&&(te[V]=W[V]);return P($,ne,te)},$e.createRef=function(){return{current:null}},$e.forwardRef=function($){return{$$typeof:c,render:$}},$e.isValidElement=H,$e.lazy=function($){return{$$typeof:g,_payload:{_status:-1,_result:$},_init:K}},$e.memo=function($,Q){return{$$typeof:h,type:$,compare:Q===void 0?null:Q}},$e.startTransition=function($){var Q=R.T,I={};R.T=I;try{var V=$(),te=R.S;te!==null&&te(I,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(T,Z)}catch(ne){Z(ne)}finally{Q!==null&&I.types!==null&&(Q.types=I.types),R.T=Q}},$e.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},$e.use=function($){return R.H.use($)},$e.useActionState=function($,Q,I){return R.H.useActionState($,Q,I)},$e.useCallback=function($,Q){return R.H.useCallback($,Q)},$e.useContext=function($){return R.H.useContext($)},$e.useDebugValue=function(){},$e.useDeferredValue=function($,Q){return R.H.useDeferredValue($,Q)},$e.useEffect=function($,Q){return R.H.useEffect($,Q)},$e.useEffectEvent=function($){return R.H.useEffectEvent($)},$e.useId=function(){return R.H.useId()},$e.useImperativeHandle=function($,Q,I){return R.H.useImperativeHandle($,Q,I)},$e.useInsertionEffect=function($,Q){return R.H.useInsertionEffect($,Q)},$e.useLayoutEffect=function($,Q){return R.H.useLayoutEffect($,Q)},$e.useMemo=function($,Q){return R.H.useMemo($,Q)},$e.useOptimistic=function($,Q){return R.H.useOptimistic($,Q)},$e.useReducer=function($,Q,I){return R.H.useReducer($,Q,I)},$e.useRef=function($){return R.H.useRef($)},$e.useState=function($){return R.H.useState($)},$e.useSyncExternalStore=function($,Q,I){return R.H.useSyncExternalStore($,Q,I)},$e.useTransition=function(){return R.H.useTransition()},$e.version="19.2.4",$e}var uj;function bo(){return uj||(uj=1,Ah.exports=VR()),Ah.exports}var C=bo();const uE=Ds(C);var Mh={exports:{}},ql={},Rh={exports:{}},Lh={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and 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 cj;function YR(){return cj||(cj=1,(function(e){function t(D,X){var K=D.length;D.push(X);e:for(;0<K;){var Z=K-1>>>1,z=D[Z];if(0<s(z,X))D[Z]=X,D[K]=z,K=Z;else break e}}function n(D){return D.length===0?null:D[0]}function a(D){if(D.length===0)return null;var X=D[0],K=D.pop();if(K!==X){D[0]=K;e:for(var Z=0,z=D.length,$=z>>>1;Z<$;){var Q=2*(Z+1)-1,I=D[Q],V=Q+1,te=D[V];if(0>s(I,K))V<z&&0>s(te,I)?(D[Z]=te,D[V]=K,Z=V):(D[Z]=I,D[Q]=K,Z=Q);else if(V<z&&0>s(te,K))D[Z]=te,D[V]=K,Z=V;else break e}}return X}function s(D,X){var K=D.sortIndex-X.sortIndex;return K!==0?K:D.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var o=Date,c=o.now();e.unstable_now=function(){return o.now()-c}}var f=[],h=[],g=1,p=null,x=3,y=!1,w=!1,j=!1,S=!1,k=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function E(D){for(var X=n(h);X!==null;){if(X.callback===null)a(h);else if(X.startTime<=D)a(h),X.sortIndex=X.expirationTime,t(f,X);else break;X=n(h)}}function M(D){if(j=!1,E(D),!w)if(n(f)!==null)w=!0,T||(T=!0,F());else{var X=n(h);X!==null&&O(M,X.startTime-D)}}var T=!1,R=-1,B=5,P=-1;function L(){return S?!0:!(e.unstable_now()-P<B)}function H(){if(S=!1,T){var D=e.unstable_now();P=D;var X=!0;try{e:{w=!1,j&&(j=!1,N(R),R=-1),y=!0;var K=x;try{t:{for(E(D),p=n(f);p!==null&&!(p.expirationTime>D&&L());){var Z=p.callback;if(typeof Z=="function"){p.callback=null,x=p.priorityLevel;var z=Z(p.expirationTime<=D);if(D=e.unstable_now(),typeof z=="function"){p.callback=z,E(D),X=!0;break t}p===n(f)&&a(f),E(D)}else a(f);p=n(f)}if(p!==null)X=!0;else{var $=n(h);$!==null&&O(M,$.startTime-D),X=!1}}break e}finally{p=null,x=K,y=!1}X=void 0}}finally{X?F():T=!1}}}var F;if(typeof _=="function")F=function(){_(H)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,q=G.port2;G.port1.onmessage=H,F=function(){q.postMessage(null)}}else F=function(){k(H,0)};function O(D,X){R=k(function(){D(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(D){switch(x){case 1:case 2:case 3:var X=3;break;default:X=x}var K=x;x=X;try{return D()}finally{x=K}},e.unstable_requestPaint=function(){S=!0},e.unstable_runWithPriority=function(D,X){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var K=x;x=D;try{return X()}finally{x=K}},e.unstable_scheduleCallback=function(D,X,K){var Z=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?Z+K:Z):K=Z,D){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=K+z,D={id:g++,callback:X,priorityLevel:D,startTime:K,expirationTime:z,sortIndex:-1},K>Z?(D.sortIndex=K,t(h,D),n(f)===null&&D===n(h)&&(j?(N(R),R=-1):j=!0,O(M,K-Z))):(D.sortIndex=z,t(f,D),w||y||(w=!0,T||(T=!0,F()))),D},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(D){var X=x;return function(){var K=x;x=X;try{return D.apply(this,arguments)}finally{x=K}}}})(Lh)),Lh}var dj;function XR(){return dj||(dj=1,Rh.exports=YR()),Rh.exports}var Dh={exports:{}},Zt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and 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 fj;function KR(){if(fj)return Zt;fj=1;var e=bo();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function l(f,h,g){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:f,containerInfo:h,implementation:g}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Zt.createPortal=function(f,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return l(f,h,null,g)},Zt.flushSync=function(f){var h=o.T,g=a.p;try{if(o.T=null,a.p=2,f)return f()}finally{o.T=h,a.p=g,a.d.f()}},Zt.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(f,h))},Zt.prefetchDNS=function(f){typeof f=="string"&&a.d.D(f)},Zt.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var g=h.as,p=c(g,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,y=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?a.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:x,fetchPriority:y}):g==="script"&&a.d.X(f,{crossOrigin:p,integrity:x,fetchPriority:y,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Zt.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=c(h.as,h.crossOrigin);a.d.M(f,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&a.d.M(f)},Zt.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,p=c(g,h.crossOrigin);a.d.L(f,g,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Zt.preloadModule=function(f,h){if(typeof f=="string")if(h){var g=c(h.as,h.crossOrigin);a.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(f)},Zt.requestFormReset=function(f){a.d.r(f)},Zt.unstable_batchedUpdates=function(f,h){return f(h)},Zt.useFormState=function(f,h,g){return o.H.useFormState(f,h,g)},Zt.useFormStatus=function(){return o.H.useHostTransitionStatus()},Zt.version="19.2.4",Zt}var hj;function cE(){if(hj)return Dh.exports;hj=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Dh.exports=KR(),Dh.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var mj;function WR(){if(mj)return ql;mj=1;var e=XR(),t=bo(),n=cE();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function l(r){var i=r,u=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(u=i.return),r=i.return;while(r)}return i.tag===3?u:null}function o(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function c(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function f(r){if(l(r)!==r)throw Error(a(188))}function h(r){var i=r.alternate;if(!i){if(i=l(r),i===null)throw Error(a(188));return i!==r?null:r}for(var u=r,m=i;;){var b=u.return;if(b===null)break;var v=b.alternate;if(v===null){if(m=b.return,m!==null){u=m;continue}break}if(b.child===v.child){for(v=b.child;v;){if(v===u)return f(b),r;if(v===m)return f(b),i;v=v.sibling}throw Error(a(188))}if(u.return!==m.return)u=b,m=v;else{for(var A=!1,U=b.child;U;){if(U===u){A=!0,u=b,m=v;break}if(U===m){A=!0,m=b,u=v;break}U=U.sibling}if(!A){for(U=v.child;U;){if(U===u){A=!0,u=v,m=b;break}if(U===m){A=!0,m=v,u=b;break}U=U.sibling}if(!A)throw Error(a(189))}}if(u.alternate!==m)throw Error(a(190))}if(u.tag!==3)throw Error(a(188));return u.stateNode.current===u?r:i}function g(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=g(r),i!==null)return i;r=r.sibling}return null}var p=Object.assign,x=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),_=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function F(r){return r===null||typeof r!="object"?null:(r=H&&r[H]||r["@@iterator"],typeof r=="function"?r:null)}var G=Symbol.for("react.client.reference");function q(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===G?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case j:return"Fragment";case k:return"Profiler";case S:return"StrictMode";case M:return"Suspense";case T:return"SuspenseList";case P:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case w:return"Portal";case _:return r.displayName||"Context";case N:return(r._context.displayName||"Context")+".Consumer";case E:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case R:return i=r.displayName||null,i!==null?i:q(r.type)||"Memo";case B:i=r._payload,r=r._init;try{return q(r(i))}catch{}}return null}var O=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},Z=[],z=-1;function $(r){return{current:r}}function Q(r){0>z||(r.current=Z[z],Z[z]=null,z--)}function I(r,i){z++,Z[z]=r.current,r.current=i}var V=$(null),te=$(null),ne=$(null),W=$(null);function Y(r,i){switch(I(ne,i),I(te,r),I(V,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?T2(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=T2(i),r=A2(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}Q(V),I(V,r)}function ae(){Q(V),Q(te),Q(ne)}function he(r){r.memoizedState!==null&&I(W,r);var i=V.current,u=A2(i,r.type);i!==u&&(I(te,r),I(V,u))}function ke(r){te.current===r&&(Q(V),Q(te)),W.current===r&&(Q(W),Rl._currentValue=K)}var _e,oe;function je(r){if(_e===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);_e=i&&i[1]||"",oe=-1<u.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+_e+r+oe}var Se=!1;function Ae(r,i){if(!r||Se)return"";Se=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(i){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(me){var de=me}Reflect.construct(r,[],ve)}else{try{ve.call()}catch(me){de=me}r.call(ve.prototype)}}else{try{throw Error()}catch(me){de=me}(ve=r())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(me){if(me&&de&&typeof me.stack=="string")return[me.stack,de.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=m.DetermineComponentFrameRoot(),A=v[0],U=v[1];if(A&&U){var ee=A.split(`
44
+ `),ce=U.split(`
45
+ `);for(b=m=0;m<ee.length&&!ee[m].includes("DetermineComponentFrameRoot");)m++;for(;b<ce.length&&!ce[b].includes("DetermineComponentFrameRoot");)b++;if(m===ee.length||b===ce.length)for(m=ee.length-1,b=ce.length-1;1<=m&&0<=b&&ee[m]!==ce[b];)b--;for(;1<=m&&0<=b;m--,b--)if(ee[m]!==ce[b]){if(m!==1||b!==1)do if(m--,b--,0>b||ee[m]!==ce[b]){var ge=`
46
+ `+ee[m].replace(" at new "," at ");return r.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",r.displayName)),ge}while(1<=m&&0<=b);break}}}finally{Se=!1,Error.prepareStackTrace=u}return(u=r?r.displayName||r.name:"")?je(u):""}function se(r,i){switch(r.tag){case 26:case 27:case 5:return je(r.type);case 16:return je("Lazy");case 13:return r.child!==i&&i!==null?je("Suspense Fallback"):je("Suspense");case 19:return je("SuspenseList");case 0:case 15:return Ae(r.type,!1);case 11:return Ae(r.type.render,!1);case 1:return Ae(r.type,!0);case 31:return je("Activity");default:return""}}function Ee(r){try{var i="",u=null;do i+=se(r,u),u=r,r=r.return;while(r);return i}catch(m){return`
47
+ Error generating stack: `+m.message+`
48
+ `+m.stack}}var Te=Object.prototype.hasOwnProperty,Me=e.unstable_scheduleCallback,we=e.unstable_cancelCallback,De=e.unstable_shouldYield,Be=e.unstable_requestPaint,ie=e.unstable_now,xe=e.unstable_getCurrentPriorityLevel,J=e.unstable_ImmediatePriority,fe=e.unstable_UserBlockingPriority,be=e.unstable_NormalPriority,Ne=e.unstable_LowPriority,Oe=e.unstable_IdlePriority,ht=e.log,yt=e.unstable_setDisableYieldValue,tt=null,st=null;function Ft(r){if(typeof ht=="function"&&yt(r),st&&typeof st.setStrictMode=="function")try{st.setStrictMode(tt,r)}catch{}}var ut=Math.clz32?Math.clz32:Ci,tn=Math.log,nn=Math.LN2;function Ci(r){return r>>>=0,r===0?32:31-(tn(r)/nn|0)|0}var jr=256,Re=262144,na=4194304;function $n(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function ra(r,i,u){var m=r.pendingLanes;if(m===0)return 0;var b=0,v=r.suspendedLanes,A=r.pingedLanes;r=r.warmLanes;var U=m&134217727;return U!==0?(m=U&~v,m!==0?b=$n(m):(A&=U,A!==0?b=$n(A):u||(u=U&~r,u!==0&&(b=$n(u))))):(U=m&~v,U!==0?b=$n(U):A!==0?b=$n(A):u||(u=m&~r,u!==0&&(b=$n(u)))),b===0?0:i!==0&&i!==b&&(i&v)===0&&(v=b&-b,u=i&-i,v>=u||v===32&&(u&4194048)!==0)?i:b}function kr(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function Gs(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ei(){var r=na;return na<<=1,(na&62914560)===0&&(na=4194304),r}function Ha(r){for(var i=[],u=0;31>u;u++)i.push(r);return i}function Sr(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function aa(r,i,u,m,b,v){var A=r.pendingLanes;r.pendingLanes=u,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=u,r.entangledLanes&=u,r.errorRecoveryDisabledLanes&=u,r.shellSuspendCounter=0;var U=r.entanglements,ee=r.expirationTimes,ce=r.hiddenUpdates;for(u=A&~u;0<u;){var ge=31-ut(u),ve=1<<ge;U[ge]=0,ee[ge]=-1;var de=ce[ge];if(de!==null)for(ce[ge]=null,ge=0;ge<de.length;ge++){var me=de[ge];me!==null&&(me.lane&=-536870913)}u&=~ve}m!==0&&Ti(r,m,0),v!==0&&b===0&&r.tag!==0&&(r.suspendedLanes|=v&~(A&~i))}function Ti(r,i,u){r.pendingLanes|=i,r.suspendedLanes&=~i;var m=31-ut(i);r.entangledLanes|=i,r.entanglements[m]=r.entanglements[m]|1073741824|u&261930}function Ai(r,i){var u=r.entangledLanes|=i;for(r=r.entanglements;u;){var m=31-ut(u),b=1<<m;b&i|r[m]&i&&(r[m]|=i),u&=~b}}function Mi(r,i){var u=i&-i;return u=(u&42)!==0?1:Pa(u),(u&(r.suspendedLanes|i))!==0?0:u}function Pa(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Fa(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Ri(){var r=X.p;return r!==0?r:(r=window.event,r===void 0?32:J2(r.type))}function Li(r,i){var u=X.p;try{return X.p=r,i()}finally{X.p=u}}var An=Math.random().toString(36).slice(2),At="__reactFiber$"+An,Gt="__reactProps$"+An,Qt="__reactContainer$"+An,sn="__reactEvents$"+An,_r="__reactListeners$"+An,Vs="__reactHandles$"+An,Di="__reactResources$"+An,Nr="__reactMarker$"+An;function Ua(r){delete r[At],delete r[Gt],delete r[sn],delete r[_r],delete r[Vs]}function ar(r){var i=r[At];if(i)return i;for(var u=r.parentNode;u;){if(i=u[Qt]||u[At]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(r=q2(r);r!==null;){if(u=r[At])return u;r=q2(r)}return i}r=u,u=r.parentNode}return null}function ir(r){if(r=r[At]||r[Qt]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function sr(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function lr(r){var i=r[Di];return i||(i=r[Di]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Et(r){r[Nr]=!0}var $a=new Set,pe={};function Ge(r,i){Ke(r,i),Ke(r+"Capture",i)}function Ke(r,i){for(pe[r]=i,r=0;r<i.length;r++)$a.add(i[r])}var Ut=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),mt={},ia={};function Ys(r){return Te.call(ia,r)?!0:Te.call(mt,r)?!1:Ut.test(r)?ia[r]=!0:(mt[r]=!0,!1)}function Cr(r,i,u){if(Ys(i))if(u===null)r.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var m=i.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+u)}}function Oi(r,i,u){if(u===null)r.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+u)}}function Gn(r,i,u,m){if(m===null)r.removeAttribute(u);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(u);return}r.setAttributeNS(i,u,""+m)}}function ln(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Io(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function jd(r,i,u){var m=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var b=m.get,v=m.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return b.call(this)},set:function(A){u=""+A,v.call(this,A)}}),Object.defineProperty(r,i,{enumerable:m.enumerable}),{getValue:function(){return u},setValue:function(A){u=""+A},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function sa(r){if(!r._valueTracker){var i=Io(r)?"checked":"value";r._valueTracker=jd(r,i,""+r[i])}}function Bo(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var u=i.getValue(),m="";return r&&(m=Io(r)?r.checked?"true":"false":r.value),r=m,r!==u?(i.setValue(r),!0):!1}function Ga(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var kd=/[\n"\\]/g;function on(r){return r.replace(kd,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Va(r,i,u,m,b,v,A,U){r.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?r.type=A:r.removeAttribute("type"),i!=null?A==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+ln(i)):r.value!==""+ln(i)&&(r.value=""+ln(i)):A!=="submit"&&A!=="reset"||r.removeAttribute("value"),i!=null?Xs(r,A,ln(i)):u!=null?Xs(r,A,ln(u)):m!=null&&r.removeAttribute("value"),b==null&&v!=null&&(r.defaultChecked=!!v),b!=null&&(r.checked=b&&typeof b!="function"&&typeof b!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?r.name=""+ln(U):r.removeAttribute("name")}function Ho(r,i,u,m,b,v,A,U){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||u!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){sa(r);return}u=u!=null?""+ln(u):"",i=i!=null?""+ln(i):u,U||i===r.value||(r.value=i),r.defaultValue=i}m=m??b,m=typeof m!="function"&&typeof m!="symbol"&&!!m,r.checked=U?r.checked:!!m,r.defaultChecked=!!m,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(r.name=A),sa(r)}function Xs(r,i,u){i==="number"&&Ga(r.ownerDocument)===r||r.defaultValue===""+u||(r.defaultValue=""+u)}function Er(r,i,u,m){if(r=r.options,i){i={};for(var b=0;b<u.length;b++)i["$"+u[b]]=!0;for(u=0;u<r.length;u++)b=i.hasOwnProperty("$"+r[u].value),r[u].selected!==b&&(r[u].selected=b),b&&m&&(r[u].defaultSelected=!0)}else{for(u=""+ln(u),i=null,b=0;b<r.length;b++){if(r[b].value===u){r[b].selected=!0,m&&(r[b].defaultSelected=!0);return}i!==null||r[b].disabled||(i=r[b])}i!==null&&(i.selected=!0)}}function Sv(r,i,u){if(i!=null&&(i=""+ln(i),i!==r.value&&(r.value=i),u==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=u!=null?""+ln(u):""}function _v(r,i,u,m){if(i==null){if(m!=null){if(u!=null)throw Error(a(92));if(O(m)){if(1<m.length)throw Error(a(93));m=m[0]}u=m}u==null&&(u=""),i=u}u=ln(i),r.defaultValue=u,m=r.textContent,m===u&&m!==""&&m!==null&&(r.value=m),sa(r)}function zi(r,i){if(i){var u=r.firstChild;if(u&&u===r.lastChild&&u.nodeType===3){u.nodeValue=i;return}}r.textContent=i}var BM=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Nv(r,i,u){var m=i.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?m?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":m?r.setProperty(i,u):typeof u!="number"||u===0||BM.has(i)?i==="float"?r.cssFloat=u:r[i]=(""+u).trim():r[i]=u+"px"}function Cv(r,i,u){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,u!=null){for(var m in u)!u.hasOwnProperty(m)||i!=null&&i.hasOwnProperty(m)||(m.indexOf("--")===0?r.setProperty(m,""):m==="float"?r.cssFloat="":r[m]="");for(var b in i)m=i[b],i.hasOwnProperty(b)&&u[b]!==m&&Nv(r,b,m)}else for(var v in i)i.hasOwnProperty(v)&&Nv(r,v,i[v])}function Sd(r){if(r.indexOf("-")===-1)return!1;switch(r){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 HM=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),PM=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Po(r){return PM.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Tr(){}var _d=null;function Nd(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var qi=null,Ii=null;function Ev(r){var i=ir(r);if(i&&(r=i.stateNode)){var u=r[Gt]||null;e:switch(r=i.stateNode,i.type){case"input":if(Va(r,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),i=u.name,u.type==="radio"&&i!=null){for(u=r;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+on(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var m=u[i];if(m!==r&&m.form===r.form){var b=m[Gt]||null;if(!b)throw Error(a(90));Va(m,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(i=0;i<u.length;i++)m=u[i],m.form===r.form&&Bo(m)}break e;case"textarea":Sv(r,u.value,u.defaultValue);break e;case"select":i=u.value,i!=null&&Er(r,!!u.multiple,i,!1)}}}var Cd=!1;function Tv(r,i,u){if(Cd)return r(i,u);Cd=!0;try{var m=r(i);return m}finally{if(Cd=!1,(qi!==null||Ii!==null)&&(Eu(),qi&&(i=qi,r=Ii,Ii=qi=null,Ev(i),r)))for(i=0;i<r.length;i++)Ev(r[i])}}function Ks(r,i){var u=r.stateNode;if(u===null)return null;var m=u[Gt]||null;if(m===null)return null;u=m[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(r=r.type,m=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!m;break e;default:r=!1}if(r)return null;if(u&&typeof u!="function")throw Error(a(231,i,typeof u));return u}var Ar=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ed=!1;if(Ar)try{var Ws={};Object.defineProperty(Ws,"passive",{get:function(){Ed=!0}}),window.addEventListener("test",Ws,Ws),window.removeEventListener("test",Ws,Ws)}catch{Ed=!1}var la=null,Td=null,Fo=null;function Av(){if(Fo)return Fo;var r,i=Td,u=i.length,m,b="value"in la?la.value:la.textContent,v=b.length;for(r=0;r<u&&i[r]===b[r];r++);var A=u-r;for(m=1;m<=A&&i[u-m]===b[v-m];m++);return Fo=b.slice(r,1<m?1-m:void 0)}function Uo(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function $o(){return!0}function Mv(){return!1}function un(r){function i(u,m,b,v,A){this._reactName=u,this._targetInst=b,this.type=m,this.nativeEvent=v,this.target=A,this.currentTarget=null;for(var U in r)r.hasOwnProperty(U)&&(u=r[U],this[U]=u?u(v):v[U]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?$o:Mv,this.isPropagationStopped=Mv,this}return p(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=$o)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=$o)},persist:function(){},isPersistent:$o}),i}var Ya={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Go=un(Ya),Qs=p({},Ya,{view:0,detail:0}),FM=un(Qs),Ad,Md,Zs,Vo=p({},Qs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ld,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Zs&&(Zs&&r.type==="mousemove"?(Ad=r.screenX-Zs.screenX,Md=r.screenY-Zs.screenY):Md=Ad=0,Zs=r),Ad)},movementY:function(r){return"movementY"in r?r.movementY:Md}}),Rv=un(Vo),UM=p({},Vo,{dataTransfer:0}),$M=un(UM),GM=p({},Qs,{relatedTarget:0}),Rd=un(GM),VM=p({},Ya,{animationName:0,elapsedTime:0,pseudoElement:0}),YM=un(VM),XM=p({},Ya,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),KM=un(XM),WM=p({},Ya,{data:0}),Lv=un(WM),QM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ZM={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"},JM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function e6(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=JM[r])?!!i[r]:!1}function Ld(){return e6}var t6=p({},Qs,{key:function(r){if(r.key){var i=QM[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=Uo(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?ZM[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ld,charCode:function(r){return r.type==="keypress"?Uo(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Uo(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),n6=un(t6),r6=p({},Vo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dv=un(r6),a6=p({},Qs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ld}),i6=un(a6),s6=p({},Ya,{propertyName:0,elapsedTime:0,pseudoElement:0}),l6=un(s6),o6=p({},Vo,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),u6=un(o6),c6=p({},Ya,{newState:0,oldState:0}),d6=un(c6),f6=[9,13,27,32],Dd=Ar&&"CompositionEvent"in window,Js=null;Ar&&"documentMode"in document&&(Js=document.documentMode);var h6=Ar&&"TextEvent"in window&&!Js,Ov=Ar&&(!Dd||Js&&8<Js&&11>=Js),zv=" ",qv=!1;function Iv(r,i){switch(r){case"keyup":return f6.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bv(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Bi=!1;function m6(r,i){switch(r){case"compositionend":return Bv(i);case"keypress":return i.which!==32?null:(qv=!0,zv);case"textInput":return r=i.data,r===zv&&qv?null:r;default:return null}}function p6(r,i){if(Bi)return r==="compositionend"||!Dd&&Iv(r,i)?(r=Av(),Fo=Td=la=null,Bi=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Ov&&i.locale!=="ko"?null:i.data;default:return null}}var g6={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 Hv(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!g6[r.type]:i==="textarea"}function Pv(r,i,u,m){qi?Ii?Ii.push(m):Ii=[m]:qi=m,i=Ou(i,"onChange"),0<i.length&&(u=new Go("onChange","change",null,u,m),r.push({event:u,listeners:i}))}var el=null,tl=null;function x6(r){k2(r,0)}function Yo(r){var i=sr(r);if(Bo(i))return r}function Fv(r,i){if(r==="change")return i}var Uv=!1;if(Ar){var Od;if(Ar){var zd="oninput"in document;if(!zd){var $v=document.createElement("div");$v.setAttribute("oninput","return;"),zd=typeof $v.oninput=="function"}Od=zd}else Od=!1;Uv=Od&&(!document.documentMode||9<document.documentMode)}function Gv(){el&&(el.detachEvent("onpropertychange",Vv),tl=el=null)}function Vv(r){if(r.propertyName==="value"&&Yo(tl)){var i=[];Pv(i,tl,r,Nd(r)),Tv(x6,i)}}function y6(r,i,u){r==="focusin"?(Gv(),el=i,tl=u,el.attachEvent("onpropertychange",Vv)):r==="focusout"&&Gv()}function b6(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Yo(tl)}function v6(r,i){if(r==="click")return Yo(i)}function w6(r,i){if(r==="input"||r==="change")return Yo(i)}function j6(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var bn=typeof Object.is=="function"?Object.is:j6;function nl(r,i){if(bn(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var u=Object.keys(r),m=Object.keys(i);if(u.length!==m.length)return!1;for(m=0;m<u.length;m++){var b=u[m];if(!Te.call(i,b)||!bn(r[b],i[b]))return!1}return!0}function Yv(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Xv(r,i){var u=Yv(r);r=0;for(var m;u;){if(u.nodeType===3){if(m=r+u.textContent.length,r<=i&&m>=i)return{node:u,offset:i-r};r=m}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=Yv(u)}}function Kv(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Kv(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Wv(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Ga(r.document);i instanceof r.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)r=i.contentWindow;else break;i=Ga(r.document)}return i}function qd(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var k6=Ar&&"documentMode"in document&&11>=document.documentMode,Hi=null,Id=null,rl=null,Bd=!1;function Qv(r,i,u){var m=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Bd||Hi==null||Hi!==Ga(m)||(m=Hi,"selectionStart"in m&&qd(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),rl&&nl(rl,m)||(rl=m,m=Ou(Id,"onSelect"),0<m.length&&(i=new Go("onSelect","select",null,i,u),r.push({event:i,listeners:m}),i.target=Hi)))}function Xa(r,i){var u={};return u[r.toLowerCase()]=i.toLowerCase(),u["Webkit"+r]="webkit"+i,u["Moz"+r]="moz"+i,u}var Pi={animationend:Xa("Animation","AnimationEnd"),animationiteration:Xa("Animation","AnimationIteration"),animationstart:Xa("Animation","AnimationStart"),transitionrun:Xa("Transition","TransitionRun"),transitionstart:Xa("Transition","TransitionStart"),transitioncancel:Xa("Transition","TransitionCancel"),transitionend:Xa("Transition","TransitionEnd")},Hd={},Zv={};Ar&&(Zv=document.createElement("div").style,"AnimationEvent"in window||(delete Pi.animationend.animation,delete Pi.animationiteration.animation,delete Pi.animationstart.animation),"TransitionEvent"in window||delete Pi.transitionend.transition);function Ka(r){if(Hd[r])return Hd[r];if(!Pi[r])return r;var i=Pi[r],u;for(u in i)if(i.hasOwnProperty(u)&&u in Zv)return Hd[r]=i[u];return r}var Jv=Ka("animationend"),e1=Ka("animationiteration"),t1=Ka("animationstart"),S6=Ka("transitionrun"),_6=Ka("transitionstart"),N6=Ka("transitioncancel"),n1=Ka("transitionend"),r1=new Map,Pd="abort auxClick beforeToggle 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(" ");Pd.push("scrollEnd");function Vn(r,i){r1.set(r,i),Ge(i,[r])}var Xo=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Mn=[],Fi=0,Fd=0;function Ko(){for(var r=Fi,i=Fd=Fi=0;i<r;){var u=Mn[i];Mn[i++]=null;var m=Mn[i];Mn[i++]=null;var b=Mn[i];Mn[i++]=null;var v=Mn[i];if(Mn[i++]=null,m!==null&&b!==null){var A=m.pending;A===null?b.next=b:(b.next=A.next,A.next=b),m.pending=b}v!==0&&a1(u,b,v)}}function Wo(r,i,u,m){Mn[Fi++]=r,Mn[Fi++]=i,Mn[Fi++]=u,Mn[Fi++]=m,Fd|=m,r.lanes|=m,r=r.alternate,r!==null&&(r.lanes|=m)}function Ud(r,i,u,m){return Wo(r,i,u,m),Qo(r)}function Wa(r,i){return Wo(r,null,null,i),Qo(r)}function a1(r,i,u){r.lanes|=u;var m=r.alternate;m!==null&&(m.lanes|=u);for(var b=!1,v=r.return;v!==null;)v.childLanes|=u,m=v.alternate,m!==null&&(m.childLanes|=u),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(b=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,b&&i!==null&&(b=31-ut(u),r=v.hiddenUpdates,m=r[b],m===null?r[b]=[i]:m.push(i),i.lane=u|536870912),v):null}function Qo(r){if(50<_l)throw _l=0,Jf=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var Ui={};function C6(r,i,u,m){this.tag=r,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vn(r,i,u,m){return new C6(r,i,u,m)}function $d(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Mr(r,i){var u=r.alternate;return u===null?(u=vn(r.tag,i,r.key,r.mode),u.elementType=r.elementType,u.type=r.type,u.stateNode=r.stateNode,u.alternate=r,r.alternate=u):(u.pendingProps=i,u.type=r.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=r.flags&65011712,u.childLanes=r.childLanes,u.lanes=r.lanes,u.child=r.child,u.memoizedProps=r.memoizedProps,u.memoizedState=r.memoizedState,u.updateQueue=r.updateQueue,i=r.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=r.sibling,u.index=r.index,u.ref=r.ref,u.refCleanup=r.refCleanup,u}function i1(r,i){r.flags&=65011714;var u=r.alternate;return u===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=u.childLanes,r.lanes=u.lanes,r.child=u.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=u.memoizedProps,r.memoizedState=u.memoizedState,r.updateQueue=u.updateQueue,r.type=u.type,i=u.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function Zo(r,i,u,m,b,v){var A=0;if(m=r,typeof r=="function")$d(r)&&(A=1);else if(typeof r=="string")A=RR(r,u,V.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case P:return r=vn(31,u,i,b),r.elementType=P,r.lanes=v,r;case j:return Qa(u.children,b,v,i);case S:A=8,b|=24;break;case k:return r=vn(12,u,i,b|2),r.elementType=k,r.lanes=v,r;case M:return r=vn(13,u,i,b),r.elementType=M,r.lanes=v,r;case T:return r=vn(19,u,i,b),r.elementType=T,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case _:A=10;break e;case N:A=9;break e;case E:A=11;break e;case R:A=14;break e;case B:A=16,m=null;break e}A=29,u=Error(a(130,r===null?"null":typeof r,"")),m=null}return i=vn(A,u,i,b),i.elementType=r,i.type=m,i.lanes=v,i}function Qa(r,i,u,m){return r=vn(7,r,m,i),r.lanes=u,r}function Gd(r,i,u){return r=vn(6,r,null,i),r.lanes=u,r}function s1(r){var i=vn(18,null,null,0);return i.stateNode=r,i}function Vd(r,i,u){return i=vn(4,r.children!==null?r.children:[],r.key,i),i.lanes=u,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var l1=new WeakMap;function Rn(r,i){if(typeof r=="object"&&r!==null){var u=l1.get(r);return u!==void 0?u:(i={value:r,source:i,stack:Ee(i)},l1.set(r,i),i)}return{value:r,source:i,stack:Ee(i)}}var $i=[],Gi=0,Jo=null,al=0,Ln=[],Dn=0,oa=null,or=1,ur="";function Rr(r,i){$i[Gi++]=al,$i[Gi++]=Jo,Jo=r,al=i}function o1(r,i,u){Ln[Dn++]=or,Ln[Dn++]=ur,Ln[Dn++]=oa,oa=r;var m=or;r=ur;var b=32-ut(m)-1;m&=~(1<<b),u+=1;var v=32-ut(i)+b;if(30<v){var A=b-b%5;v=(m&(1<<A)-1).toString(32),m>>=A,b-=A,or=1<<32-ut(i)+b|u<<b|m,ur=v+r}else or=1<<v|u<<b|m,ur=r}function Yd(r){r.return!==null&&(Rr(r,1),o1(r,1,0))}function Xd(r){for(;r===Jo;)Jo=$i[--Gi],$i[Gi]=null,al=$i[--Gi],$i[Gi]=null;for(;r===oa;)oa=Ln[--Dn],Ln[Dn]=null,ur=Ln[--Dn],Ln[Dn]=null,or=Ln[--Dn],Ln[Dn]=null}function u1(r,i){Ln[Dn++]=or,Ln[Dn++]=ur,Ln[Dn++]=oa,or=i.id,ur=i.overflow,oa=r}var Yt=null,jt=null,nt=!1,ua=null,On=!1,Kd=Error(a(519));function ca(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw il(Rn(i,r)),Kd}function c1(r){var i=r.stateNode,u=r.type,m=r.memoizedProps;switch(i[At]=r,i[Gt]=m,u){case"dialog":Qe("cancel",i),Qe("close",i);break;case"iframe":case"object":case"embed":Qe("load",i);break;case"video":case"audio":for(u=0;u<Cl.length;u++)Qe(Cl[u],i);break;case"source":Qe("error",i);break;case"img":case"image":case"link":Qe("error",i),Qe("load",i);break;case"details":Qe("toggle",i);break;case"input":Qe("invalid",i),Ho(i,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Qe("invalid",i);break;case"textarea":Qe("invalid",i),_v(i,m.value,m.defaultValue,m.children)}u=m.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||i.textContent===""+u||m.suppressHydrationWarning===!0||C2(i.textContent,u)?(m.popover!=null&&(Qe("beforetoggle",i),Qe("toggle",i)),m.onScroll!=null&&Qe("scroll",i),m.onScrollEnd!=null&&Qe("scrollend",i),m.onClick!=null&&(i.onclick=Tr),i=!0):i=!1,i||ca(r,!0)}function d1(r){for(Yt=r.return;Yt;)switch(Yt.tag){case 5:case 31:case 13:On=!1;return;case 27:case 3:On=!0;return;default:Yt=Yt.return}}function Vi(r){if(r!==Yt)return!1;if(!nt)return d1(r),nt=!0,!1;var i=r.tag,u;if((u=i!==3&&i!==27)&&((u=i===5)&&(u=r.type,u=!(u!=="form"&&u!=="button")||mh(r.type,r.memoizedProps)),u=!u),u&&jt&&ca(r),d1(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));jt=z2(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));jt=z2(r)}else i===27?(i=jt,Sa(r.type)?(r=bh,bh=null,jt=r):jt=i):jt=Yt?qn(r.stateNode.nextSibling):null;return!0}function Za(){jt=Yt=null,nt=!1}function Wd(){var r=ua;return r!==null&&(hn===null?hn=r:hn.push.apply(hn,r),ua=null),r}function il(r){ua===null?ua=[r]:ua.push(r)}var Qd=$(null),Ja=null,Lr=null;function da(r,i,u){I(Qd,i._currentValue),i._currentValue=u}function Dr(r){r._currentValue=Qd.current,Q(Qd)}function Zd(r,i,u){for(;r!==null;){var m=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,m!==null&&(m.childLanes|=i)):m!==null&&(m.childLanes&i)!==i&&(m.childLanes|=i),r===u)break;r=r.return}}function Jd(r,i,u,m){var b=r.child;for(b!==null&&(b.return=r);b!==null;){var v=b.dependencies;if(v!==null){var A=b.child;v=v.firstContext;e:for(;v!==null;){var U=v;v=b;for(var ee=0;ee<i.length;ee++)if(U.context===i[ee]){v.lanes|=u,U=v.alternate,U!==null&&(U.lanes|=u),Zd(v.return,u,r),m||(A=null);break e}v=U.next}}else if(b.tag===18){if(A=b.return,A===null)throw Error(a(341));A.lanes|=u,v=A.alternate,v!==null&&(v.lanes|=u),Zd(A,u,r),A=null}else A=b.child;if(A!==null)A.return=b;else for(A=b;A!==null;){if(A===r){A=null;break}if(b=A.sibling,b!==null){b.return=A.return,A=b;break}A=A.return}b=A}}function Yi(r,i,u,m){r=null;for(var b=i,v=!1;b!==null;){if(!v){if((b.flags&524288)!==0)v=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var A=b.alternate;if(A===null)throw Error(a(387));if(A=A.memoizedProps,A!==null){var U=b.type;bn(b.pendingProps.value,A.value)||(r!==null?r.push(U):r=[U])}}else if(b===W.current){if(A=b.alternate,A===null)throw Error(a(387));A.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(r!==null?r.push(Rl):r=[Rl])}b=b.return}r!==null&&Jd(i,r,u,m),i.flags|=262144}function eu(r){for(r=r.firstContext;r!==null;){if(!bn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function ei(r){Ja=r,Lr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Xt(r){return f1(Ja,r)}function tu(r,i){return Ja===null&&ei(r),f1(r,i)}function f1(r,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},Lr===null){if(r===null)throw Error(a(308));Lr=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Lr=Lr.next=i;return u}var E6=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(u,m){r.push(m)}};this.abort=function(){i.aborted=!0,r.forEach(function(u){return u()})}},T6=e.unstable_scheduleCallback,A6=e.unstable_NormalPriority,Ot={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ef(){return{controller:new E6,data:new Map,refCount:0}}function sl(r){r.refCount--,r.refCount===0&&T6(A6,function(){r.controller.abort()})}var ll=null,tf=0,Xi=0,Ki=null;function M6(r,i){if(ll===null){var u=ll=[];tf=0,Xi=ih(),Ki={status:"pending",value:void 0,then:function(m){u.push(m)}}}return tf++,i.then(h1,h1),i}function h1(){if(--tf===0&&ll!==null){Ki!==null&&(Ki.status="fulfilled");var r=ll;ll=null,Xi=0,Ki=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function R6(r,i){var u=[],m={status:"pending",value:null,reason:null,then:function(b){u.push(b)}};return r.then(function(){m.status="fulfilled",m.value=i;for(var b=0;b<u.length;b++)(0,u[b])(i)},function(b){for(m.status="rejected",m.reason=b,b=0;b<u.length;b++)(0,u[b])(void 0)}),m}var m1=D.S;D.S=function(r,i){Qw=ie(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&M6(r,i),m1!==null&&m1(r,i)};var ti=$(null);function nf(){var r=ti.current;return r!==null?r:bt.pooledCache}function nu(r,i){i===null?I(ti,ti.current):I(ti,i.pool)}function p1(){var r=nf();return r===null?null:{parent:Ot._currentValue,pool:r}}var Wi=Error(a(460)),rf=Error(a(474)),ru=Error(a(542)),au={then:function(){}};function g1(r){return r=r.status,r==="fulfilled"||r==="rejected"}function x1(r,i,u){switch(u=r[u],u===void 0?r.push(i):u!==i&&(i.then(Tr,Tr),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,b1(r),r;default:if(typeof i.status=="string")i.then(Tr,Tr);else{if(r=bt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(m){if(i.status==="pending"){var b=i;b.status="fulfilled",b.value=m}},function(m){if(i.status==="pending"){var b=i;b.status="rejected",b.reason=m}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,b1(r),r}throw ri=i,Wi}}function ni(r){try{var i=r._init;return i(r._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(ri=u,Wi):u}}var ri=null;function y1(){if(ri===null)throw Error(a(459));var r=ri;return ri=null,r}function b1(r){if(r===Wi||r===ru)throw Error(a(483))}var Qi=null,ol=0;function iu(r){var i=ol;return ol+=1,Qi===null&&(Qi=[]),x1(Qi,r,i)}function ul(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function su(r,i){throw i.$$typeof===x?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function v1(r){function i(le,re){if(r){var ue=le.deletions;ue===null?(le.deletions=[re],le.flags|=16):ue.push(re)}}function u(le,re){if(!r)return null;for(;re!==null;)i(le,re),re=re.sibling;return null}function m(le){for(var re=new Map;le!==null;)le.key!==null?re.set(le.key,le):re.set(le.index,le),le=le.sibling;return re}function b(le,re){return le=Mr(le,re),le.index=0,le.sibling=null,le}function v(le,re,ue){return le.index=ue,r?(ue=le.alternate,ue!==null?(ue=ue.index,ue<re?(le.flags|=67108866,re):ue):(le.flags|=67108866,re)):(le.flags|=1048576,re)}function A(le){return r&&le.alternate===null&&(le.flags|=67108866),le}function U(le,re,ue,ye){return re===null||re.tag!==6?(re=Gd(ue,le.mode,ye),re.return=le,re):(re=b(re,ue),re.return=le,re)}function ee(le,re,ue,ye){var He=ue.type;return He===j?ge(le,re,ue.props.children,ye,ue.key):re!==null&&(re.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===B&&ni(He)===re.type)?(re=b(re,ue.props),ul(re,ue),re.return=le,re):(re=Zo(ue.type,ue.key,ue.props,null,le.mode,ye),ul(re,ue),re.return=le,re)}function ce(le,re,ue,ye){return re===null||re.tag!==4||re.stateNode.containerInfo!==ue.containerInfo||re.stateNode.implementation!==ue.implementation?(re=Vd(ue,le.mode,ye),re.return=le,re):(re=b(re,ue.children||[]),re.return=le,re)}function ge(le,re,ue,ye,He){return re===null||re.tag!==7?(re=Qa(ue,le.mode,ye,He),re.return=le,re):(re=b(re,ue),re.return=le,re)}function ve(le,re,ue){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return re=Gd(""+re,le.mode,ue),re.return=le,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case y:return ue=Zo(re.type,re.key,re.props,null,le.mode,ue),ul(ue,re),ue.return=le,ue;case w:return re=Vd(re,le.mode,ue),re.return=le,re;case B:return re=ni(re),ve(le,re,ue)}if(O(re)||F(re))return re=Qa(re,le.mode,ue,null),re.return=le,re;if(typeof re.then=="function")return ve(le,iu(re),ue);if(re.$$typeof===_)return ve(le,tu(le,re),ue);su(le,re)}return null}function de(le,re,ue,ye){var He=re!==null?re.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return He!==null?null:U(le,re,""+ue,ye);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:return ue.key===He?ee(le,re,ue,ye):null;case w:return ue.key===He?ce(le,re,ue,ye):null;case B:return ue=ni(ue),de(le,re,ue,ye)}if(O(ue)||F(ue))return He!==null?null:ge(le,re,ue,ye,null);if(typeof ue.then=="function")return de(le,re,iu(ue),ye);if(ue.$$typeof===_)return de(le,re,tu(le,ue),ye);su(le,ue)}return null}function me(le,re,ue,ye,He){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return le=le.get(ue)||null,U(re,le,""+ye,He);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case y:return le=le.get(ye.key===null?ue:ye.key)||null,ee(re,le,ye,He);case w:return le=le.get(ye.key===null?ue:ye.key)||null,ce(re,le,ye,He);case B:return ye=ni(ye),me(le,re,ue,ye,He)}if(O(ye)||F(ye))return le=le.get(ue)||null,ge(re,le,ye,He,null);if(typeof ye.then=="function")return me(le,re,ue,iu(ye),He);if(ye.$$typeof===_)return me(le,re,ue,tu(re,ye),He);su(re,ye)}return null}function Le(le,re,ue,ye){for(var He=null,lt=null,ze=re,Ye=re=0,et=null;ze!==null&&Ye<ue.length;Ye++){ze.index>Ye?(et=ze,ze=null):et=ze.sibling;var ot=de(le,ze,ue[Ye],ye);if(ot===null){ze===null&&(ze=et);break}r&&ze&&ot.alternate===null&&i(le,ze),re=v(ot,re,Ye),lt===null?He=ot:lt.sibling=ot,lt=ot,ze=et}if(Ye===ue.length)return u(le,ze),nt&&Rr(le,Ye),He;if(ze===null){for(;Ye<ue.length;Ye++)ze=ve(le,ue[Ye],ye),ze!==null&&(re=v(ze,re,Ye),lt===null?He=ze:lt.sibling=ze,lt=ze);return nt&&Rr(le,Ye),He}for(ze=m(ze);Ye<ue.length;Ye++)et=me(ze,le,Ye,ue[Ye],ye),et!==null&&(r&&et.alternate!==null&&ze.delete(et.key===null?Ye:et.key),re=v(et,re,Ye),lt===null?He=et:lt.sibling=et,lt=et);return r&&ze.forEach(function(Ta){return i(le,Ta)}),nt&&Rr(le,Ye),He}function Fe(le,re,ue,ye){if(ue==null)throw Error(a(151));for(var He=null,lt=null,ze=re,Ye=re=0,et=null,ot=ue.next();ze!==null&&!ot.done;Ye++,ot=ue.next()){ze.index>Ye?(et=ze,ze=null):et=ze.sibling;var Ta=de(le,ze,ot.value,ye);if(Ta===null){ze===null&&(ze=et);break}r&&ze&&Ta.alternate===null&&i(le,ze),re=v(Ta,re,Ye),lt===null?He=Ta:lt.sibling=Ta,lt=Ta,ze=et}if(ot.done)return u(le,ze),nt&&Rr(le,Ye),He;if(ze===null){for(;!ot.done;Ye++,ot=ue.next())ot=ve(le,ot.value,ye),ot!==null&&(re=v(ot,re,Ye),lt===null?He=ot:lt.sibling=ot,lt=ot);return nt&&Rr(le,Ye),He}for(ze=m(ze);!ot.done;Ye++,ot=ue.next())ot=me(ze,le,Ye,ot.value,ye),ot!==null&&(r&&ot.alternate!==null&&ze.delete(ot.key===null?Ye:ot.key),re=v(ot,re,Ye),lt===null?He=ot:lt.sibling=ot,lt=ot);return r&&ze.forEach(function(UR){return i(le,UR)}),nt&&Rr(le,Ye),He}function xt(le,re,ue,ye){if(typeof ue=="object"&&ue!==null&&ue.type===j&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:e:{for(var He=ue.key;re!==null;){if(re.key===He){if(He=ue.type,He===j){if(re.tag===7){u(le,re.sibling),ye=b(re,ue.props.children),ye.return=le,le=ye;break e}}else if(re.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===B&&ni(He)===re.type){u(le,re.sibling),ye=b(re,ue.props),ul(ye,ue),ye.return=le,le=ye;break e}u(le,re);break}else i(le,re);re=re.sibling}ue.type===j?(ye=Qa(ue.props.children,le.mode,ye,ue.key),ye.return=le,le=ye):(ye=Zo(ue.type,ue.key,ue.props,null,le.mode,ye),ul(ye,ue),ye.return=le,le=ye)}return A(le);case w:e:{for(He=ue.key;re!==null;){if(re.key===He)if(re.tag===4&&re.stateNode.containerInfo===ue.containerInfo&&re.stateNode.implementation===ue.implementation){u(le,re.sibling),ye=b(re,ue.children||[]),ye.return=le,le=ye;break e}else{u(le,re);break}else i(le,re);re=re.sibling}ye=Vd(ue,le.mode,ye),ye.return=le,le=ye}return A(le);case B:return ue=ni(ue),xt(le,re,ue,ye)}if(O(ue))return Le(le,re,ue,ye);if(F(ue)){if(He=F(ue),typeof He!="function")throw Error(a(150));return ue=He.call(ue),Fe(le,re,ue,ye)}if(typeof ue.then=="function")return xt(le,re,iu(ue),ye);if(ue.$$typeof===_)return xt(le,re,tu(le,ue),ye);su(le,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,re!==null&&re.tag===6?(u(le,re.sibling),ye=b(re,ue),ye.return=le,le=ye):(u(le,re),ye=Gd(ue,le.mode,ye),ye.return=le,le=ye),A(le)):u(le,re)}return function(le,re,ue,ye){try{ol=0;var He=xt(le,re,ue,ye);return Qi=null,He}catch(ze){if(ze===Wi||ze===ru)throw ze;var lt=vn(29,ze,null,le.mode);return lt.lanes=ye,lt.return=le,lt}finally{}}}var ai=v1(!0),w1=v1(!1),fa=!1;function af(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sf(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function ha(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function ma(r,i,u){var m=r.updateQueue;if(m===null)return null;if(m=m.shared,(ct&2)!==0){var b=m.pending;return b===null?i.next=i:(i.next=b.next,b.next=i),m.pending=i,i=Qo(r),a1(r,null,u),i}return Wo(r,m,i,u),Qo(r)}function cl(r,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var m=i.lanes;m&=r.pendingLanes,u|=m,i.lanes=u,Ai(r,u)}}function lf(r,i){var u=r.updateQueue,m=r.alternate;if(m!==null&&(m=m.updateQueue,u===m)){var b=null,v=null;if(u=u.firstBaseUpdate,u!==null){do{var A={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};v===null?b=v=A:v=v.next=A,u=u.next}while(u!==null);v===null?b=v=i:v=v.next=i}else b=v=i;u={baseState:m.baseState,firstBaseUpdate:b,lastBaseUpdate:v,shared:m.shared,callbacks:m.callbacks},r.updateQueue=u;return}r=u.lastBaseUpdate,r===null?u.firstBaseUpdate=i:r.next=i,u.lastBaseUpdate=i}var of=!1;function dl(){if(of){var r=Ki;if(r!==null)throw r}}function fl(r,i,u,m){of=!1;var b=r.updateQueue;fa=!1;var v=b.firstBaseUpdate,A=b.lastBaseUpdate,U=b.shared.pending;if(U!==null){b.shared.pending=null;var ee=U,ce=ee.next;ee.next=null,A===null?v=ce:A.next=ce,A=ee;var ge=r.alternate;ge!==null&&(ge=ge.updateQueue,U=ge.lastBaseUpdate,U!==A&&(U===null?ge.firstBaseUpdate=ce:U.next=ce,ge.lastBaseUpdate=ee))}if(v!==null){var ve=b.baseState;A=0,ge=ce=ee=null,U=v;do{var de=U.lane&-536870913,me=de!==U.lane;if(me?(Je&de)===de:(m&de)===de){de!==0&&de===Xi&&(of=!0),ge!==null&&(ge=ge.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var Le=r,Fe=U;de=i;var xt=u;switch(Fe.tag){case 1:if(Le=Fe.payload,typeof Le=="function"){ve=Le.call(xt,ve,de);break e}ve=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=Fe.payload,de=typeof Le=="function"?Le.call(xt,ve,de):Le,de==null)break e;ve=p({},ve,de);break e;case 2:fa=!0}}de=U.callback,de!==null&&(r.flags|=64,me&&(r.flags|=8192),me=b.callbacks,me===null?b.callbacks=[de]:me.push(de))}else me={lane:de,tag:U.tag,payload:U.payload,callback:U.callback,next:null},ge===null?(ce=ge=me,ee=ve):ge=ge.next=me,A|=de;if(U=U.next,U===null){if(U=b.shared.pending,U===null)break;me=U,U=me.next,me.next=null,b.lastBaseUpdate=me,b.shared.pending=null}}while(!0);ge===null&&(ee=ve),b.baseState=ee,b.firstBaseUpdate=ce,b.lastBaseUpdate=ge,v===null&&(b.shared.lanes=0),ba|=A,r.lanes=A,r.memoizedState=ve}}function j1(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function k1(r,i){var u=r.callbacks;if(u!==null)for(r.callbacks=null,r=0;r<u.length;r++)j1(u[r],i)}var Zi=$(null),lu=$(0);function S1(r,i){r=Ur,I(lu,r),I(Zi,i),Ur=r|i.baseLanes}function uf(){I(lu,Ur),I(Zi,Zi.current)}function cf(){Ur=lu.current,Q(Zi),Q(lu)}var wn=$(null),zn=null;function pa(r){var i=r.alternate;I(Lt,Lt.current&1),I(wn,r),zn===null&&(i===null||Zi.current!==null||i.memoizedState!==null)&&(zn=r)}function df(r){I(Lt,Lt.current),I(wn,r),zn===null&&(zn=r)}function _1(r){r.tag===22?(I(Lt,Lt.current),I(wn,r),zn===null&&(zn=r)):ga()}function ga(){I(Lt,Lt.current),I(wn,wn.current)}function jn(r){Q(wn),zn===r&&(zn=null),Q(Lt)}var Lt=$(0);function ou(r){for(var i=r;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||xh(u)||yh(u)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Or=0,Ve=null,pt=null,zt=null,uu=!1,Ji=!1,ii=!1,cu=0,hl=0,es=null,L6=0;function Mt(){throw Error(a(321))}function ff(r,i){if(i===null)return!1;for(var u=0;u<i.length&&u<r.length;u++)if(!bn(r[u],i[u]))return!1;return!0}function hf(r,i,u,m,b,v){return Or=v,Ve=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,D.H=r===null||r.memoizedState===null?ow:Ef,ii=!1,v=u(m,b),ii=!1,Ji&&(v=C1(i,u,m,b)),N1(r),v}function N1(r){D.H=gl;var i=pt!==null&&pt.next!==null;if(Or=0,zt=pt=Ve=null,uu=!1,hl=0,es=null,i)throw Error(a(300));r===null||qt||(r=r.dependencies,r!==null&&eu(r)&&(qt=!0))}function C1(r,i,u,m){Ve=r;var b=0;do{if(Ji&&(es=null),hl=0,Ji=!1,25<=b)throw Error(a(301));if(b+=1,zt=pt=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}D.H=uw,v=i(u,m)}while(Ji);return v}function D6(){var r=D.H,i=r.useState()[0];return i=typeof i.then=="function"?ml(i):i,r=r.useState()[0],(pt!==null?pt.memoizedState:null)!==r&&(Ve.flags|=1024),i}function mf(){var r=cu!==0;return cu=0,r}function pf(r,i,u){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~u}function gf(r){if(uu){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}uu=!1}Or=0,zt=pt=Ve=null,Ji=!1,hl=cu=0,es=null}function rn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zt===null?Ve.memoizedState=zt=r:zt=zt.next=r,zt}function Dt(){if(pt===null){var r=Ve.alternate;r=r!==null?r.memoizedState:null}else r=pt.next;var i=zt===null?Ve.memoizedState:zt.next;if(i!==null)zt=i,pt=r;else{if(r===null)throw Ve.alternate===null?Error(a(467)):Error(a(310));pt=r,r={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},zt===null?Ve.memoizedState=zt=r:zt=zt.next=r}return zt}function du(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ml(r){var i=hl;return hl+=1,es===null&&(es=[]),r=x1(es,r,i),i=Ve,(zt===null?i.memoizedState:zt.next)===null&&(i=i.alternate,D.H=i===null||i.memoizedState===null?ow:Ef),r}function fu(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return ml(r);if(r.$$typeof===_)return Xt(r)}throw Error(a(438,String(r)))}function xf(r){var i=null,u=Ve.updateQueue;if(u!==null&&(i=u.memoCache),i==null){var m=Ve.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(i={data:m.data.map(function(b){return b.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),u===null&&(u=du(),Ve.updateQueue=u),u.memoCache=i,u=i.data[i.index],u===void 0)for(u=i.data[i.index]=Array(r),m=0;m<r;m++)u[m]=L;return i.index++,u}function zr(r,i){return typeof i=="function"?i(r):i}function hu(r){var i=Dt();return yf(i,pt,r)}function yf(r,i,u){var m=r.queue;if(m===null)throw Error(a(311));m.lastRenderedReducer=u;var b=r.baseQueue,v=m.pending;if(v!==null){if(b!==null){var A=b.next;b.next=v.next,v.next=A}i.baseQueue=b=v,m.pending=null}if(v=r.baseState,b===null)r.memoizedState=v;else{i=b.next;var U=A=null,ee=null,ce=i,ge=!1;do{var ve=ce.lane&-536870913;if(ve!==ce.lane?(Je&ve)===ve:(Or&ve)===ve){var de=ce.revertLane;if(de===0)ee!==null&&(ee=ee.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),ve===Xi&&(ge=!0);else if((Or&de)===de){ce=ce.next,de===Xi&&(ge=!0);continue}else ve={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},ee===null?(U=ee=ve,A=v):ee=ee.next=ve,Ve.lanes|=de,ba|=de;ve=ce.action,ii&&u(v,ve),v=ce.hasEagerState?ce.eagerState:u(v,ve)}else de={lane:ve,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},ee===null?(U=ee=de,A=v):ee=ee.next=de,Ve.lanes|=ve,ba|=ve;ce=ce.next}while(ce!==null&&ce!==i);if(ee===null?A=v:ee.next=U,!bn(v,r.memoizedState)&&(qt=!0,ge&&(u=Ki,u!==null)))throw u;r.memoizedState=v,r.baseState=A,r.baseQueue=ee,m.lastRenderedState=v}return b===null&&(m.lanes=0),[r.memoizedState,m.dispatch]}function bf(r){var i=Dt(),u=i.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=r;var m=u.dispatch,b=u.pending,v=i.memoizedState;if(b!==null){u.pending=null;var A=b=b.next;do v=r(v,A.action),A=A.next;while(A!==b);bn(v,i.memoizedState)||(qt=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),u.lastRenderedState=v}return[v,m]}function E1(r,i,u){var m=Ve,b=Dt(),v=nt;if(v){if(u===void 0)throw Error(a(407));u=u()}else u=i();var A=!bn((pt||b).memoizedState,u);if(A&&(b.memoizedState=u,qt=!0),b=b.queue,jf(M1.bind(null,m,b,r),[r]),b.getSnapshot!==i||A||zt!==null&&zt.memoizedState.tag&1){if(m.flags|=2048,ts(9,{destroy:void 0},A1.bind(null,m,b,u,i),null),bt===null)throw Error(a(349));v||(Or&127)!==0||T1(m,i,u)}return u}function T1(r,i,u){r.flags|=16384,r={getSnapshot:i,value:u},i=Ve.updateQueue,i===null?(i=du(),Ve.updateQueue=i,i.stores=[r]):(u=i.stores,u===null?i.stores=[r]:u.push(r))}function A1(r,i,u,m){i.value=u,i.getSnapshot=m,R1(i)&&L1(r)}function M1(r,i,u){return u(function(){R1(i)&&L1(r)})}function R1(r){var i=r.getSnapshot;r=r.value;try{var u=i();return!bn(r,u)}catch{return!0}}function L1(r){var i=Wa(r,2);i!==null&&mn(i,r,2)}function vf(r){var i=rn();if(typeof r=="function"){var u=r;if(r=u(),ii){Ft(!0);try{u()}finally{Ft(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zr,lastRenderedState:r},i}function D1(r,i,u,m){return r.baseState=u,yf(r,pt,typeof m=="function"?m:zr)}function O6(r,i,u,m,b){if(gu(r))throw Error(a(485));if(r=i.action,r!==null){var v={payload:b,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){v.listeners.push(A)}};D.T!==null?u(!0):v.isTransition=!1,m(v),u=i.pending,u===null?(v.next=i.pending=v,O1(i,v)):(v.next=u.next,i.pending=u.next=v)}}function O1(r,i){var u=i.action,m=i.payload,b=r.state;if(i.isTransition){var v=D.T,A={};D.T=A;try{var U=u(b,m),ee=D.S;ee!==null&&ee(A,U),z1(r,i,U)}catch(ce){wf(r,i,ce)}finally{v!==null&&A.types!==null&&(v.types=A.types),D.T=v}}else try{v=u(b,m),z1(r,i,v)}catch(ce){wf(r,i,ce)}}function z1(r,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(m){q1(r,i,m)},function(m){return wf(r,i,m)}):q1(r,i,u)}function q1(r,i,u){i.status="fulfilled",i.value=u,I1(i),r.state=u,i=r.pending,i!==null&&(u=i.next,u===i?r.pending=null:(u=u.next,i.next=u,O1(r,u)))}function wf(r,i,u){var m=r.pending;if(r.pending=null,m!==null){m=m.next;do i.status="rejected",i.reason=u,I1(i),i=i.next;while(i!==m)}r.action=null}function I1(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function B1(r,i){return i}function H1(r,i){if(nt){var u=bt.formState;if(u!==null){e:{var m=Ve;if(nt){if(jt){t:{for(var b=jt,v=On;b.nodeType!==8;){if(!v){b=null;break t}if(b=qn(b.nextSibling),b===null){b=null;break t}}v=b.data,b=v==="F!"||v==="F"?b:null}if(b){jt=qn(b.nextSibling),m=b.data==="F!";break e}}ca(m)}m=!1}m&&(i=u[0])}}return u=rn(),u.memoizedState=u.baseState=i,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:B1,lastRenderedState:i},u.queue=m,u=iw.bind(null,Ve,m),m.dispatch=u,m=vf(!1),v=Cf.bind(null,Ve,!1,m.queue),m=rn(),b={state:i,dispatch:null,action:r,pending:null},m.queue=b,u=O6.bind(null,Ve,b,v,u),b.dispatch=u,m.memoizedState=r,[i,u,!1]}function P1(r){var i=Dt();return F1(i,pt,r)}function F1(r,i,u){if(i=yf(r,i,B1)[0],r=hu(zr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var m=ml(i)}catch(A){throw A===Wi?ru:A}else m=i;i=Dt();var b=i.queue,v=b.dispatch;return u!==i.memoizedState&&(Ve.flags|=2048,ts(9,{destroy:void 0},z6.bind(null,b,u),null)),[m,v,r]}function z6(r,i){r.action=i}function U1(r){var i=Dt(),u=pt;if(u!==null)return F1(i,u,r);Dt(),i=i.memoizedState,u=Dt();var m=u.queue.dispatch;return u.memoizedState=r,[i,m,!1]}function ts(r,i,u,m){return r={tag:r,create:u,deps:m,inst:i,next:null},i=Ve.updateQueue,i===null&&(i=du(),Ve.updateQueue=i),u=i.lastEffect,u===null?i.lastEffect=r.next=r:(m=u.next,u.next=r,r.next=m,i.lastEffect=r),r}function $1(){return Dt().memoizedState}function mu(r,i,u,m){var b=rn();Ve.flags|=r,b.memoizedState=ts(1|i,{destroy:void 0},u,m===void 0?null:m)}function pu(r,i,u,m){var b=Dt();m=m===void 0?null:m;var v=b.memoizedState.inst;pt!==null&&m!==null&&ff(m,pt.memoizedState.deps)?b.memoizedState=ts(i,v,u,m):(Ve.flags|=r,b.memoizedState=ts(1|i,v,u,m))}function G1(r,i){mu(8390656,8,r,i)}function jf(r,i){pu(2048,8,r,i)}function q6(r){Ve.flags|=4;var i=Ve.updateQueue;if(i===null)i=du(),Ve.updateQueue=i,i.events=[r];else{var u=i.events;u===null?i.events=[r]:u.push(r)}}function V1(r){var i=Dt().memoizedState;return q6({ref:i,nextImpl:r}),function(){if((ct&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Y1(r,i){return pu(4,2,r,i)}function X1(r,i){return pu(4,4,r,i)}function K1(r,i){if(typeof i=="function"){r=r();var u=i(r);return function(){typeof u=="function"?u():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function W1(r,i,u){u=u!=null?u.concat([r]):null,pu(4,4,K1.bind(null,i,r),u)}function kf(){}function Q1(r,i){var u=Dt();i=i===void 0?null:i;var m=u.memoizedState;return i!==null&&ff(i,m[1])?m[0]:(u.memoizedState=[r,i],r)}function Z1(r,i){var u=Dt();i=i===void 0?null:i;var m=u.memoizedState;if(i!==null&&ff(i,m[1]))return m[0];if(m=r(),ii){Ft(!0);try{r()}finally{Ft(!1)}}return u.memoizedState=[m,i],m}function Sf(r,i,u){return u===void 0||(Or&1073741824)!==0&&(Je&261930)===0?r.memoizedState=i:(r.memoizedState=u,r=Jw(),Ve.lanes|=r,ba|=r,u)}function J1(r,i,u,m){return bn(u,i)?u:Zi.current!==null?(r=Sf(r,u,m),bn(r,i)||(qt=!0),r):(Or&42)===0||(Or&1073741824)!==0&&(Je&261930)===0?(qt=!0,r.memoizedState=u):(r=Jw(),Ve.lanes|=r,ba|=r,i)}function ew(r,i,u,m,b){var v=X.p;X.p=v!==0&&8>v?v:8;var A=D.T,U={};D.T=U,Cf(r,!1,i,u);try{var ee=b(),ce=D.S;if(ce!==null&&ce(U,ee),ee!==null&&typeof ee=="object"&&typeof ee.then=="function"){var ge=R6(ee,m);pl(r,i,ge,_n(r))}else pl(r,i,m,_n(r))}catch(ve){pl(r,i,{then:function(){},status:"rejected",reason:ve},_n())}finally{X.p=v,A!==null&&U.types!==null&&(A.types=U.types),D.T=A}}function I6(){}function _f(r,i,u,m){if(r.tag!==5)throw Error(a(476));var b=tw(r).queue;ew(r,b,i,K,u===null?I6:function(){return nw(r),u(m)})}function tw(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zr,lastRenderedState:K},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zr,lastRenderedState:u},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function nw(r){var i=tw(r);i.next===null&&(i=r.alternate.memoizedState),pl(r,i.next.queue,{},_n())}function Nf(){return Xt(Rl)}function rw(){return Dt().memoizedState}function aw(){return Dt().memoizedState}function B6(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var u=_n();r=ha(u);var m=ma(i,r,u);m!==null&&(mn(m,i,u),cl(m,i,u)),i={cache:ef()},r.payload=i;return}i=i.return}}function H6(r,i,u){var m=_n();u={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},gu(r)?sw(i,u):(u=Ud(r,i,u,m),u!==null&&(mn(u,r,m),lw(u,i,m)))}function iw(r,i,u){var m=_n();pl(r,i,u,m)}function pl(r,i,u,m){var b={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(gu(r))sw(i,b);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var A=i.lastRenderedState,U=v(A,u);if(b.hasEagerState=!0,b.eagerState=U,bn(U,A))return Wo(r,i,b,0),bt===null&&Ko(),!1}catch{}finally{}if(u=Ud(r,i,b,m),u!==null)return mn(u,r,m),lw(u,i,m),!0}return!1}function Cf(r,i,u,m){if(m={lane:2,revertLane:ih(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},gu(r)){if(i)throw Error(a(479))}else i=Ud(r,u,m,2),i!==null&&mn(i,r,2)}function gu(r){var i=r.alternate;return r===Ve||i!==null&&i===Ve}function sw(r,i){Ji=uu=!0;var u=r.pending;u===null?i.next=i:(i.next=u.next,u.next=i),r.pending=i}function lw(r,i,u){if((u&4194048)!==0){var m=i.lanes;m&=r.pendingLanes,u|=m,i.lanes=u,Ai(r,u)}}var gl={readContext:Xt,use:fu,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useLayoutEffect:Mt,useInsertionEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useSyncExternalStore:Mt,useId:Mt,useHostTransitionStatus:Mt,useFormState:Mt,useActionState:Mt,useOptimistic:Mt,useMemoCache:Mt,useCacheRefresh:Mt};gl.useEffectEvent=Mt;var ow={readContext:Xt,use:fu,useCallback:function(r,i){return rn().memoizedState=[r,i===void 0?null:i],r},useContext:Xt,useEffect:G1,useImperativeHandle:function(r,i,u){u=u!=null?u.concat([r]):null,mu(4194308,4,K1.bind(null,i,r),u)},useLayoutEffect:function(r,i){return mu(4194308,4,r,i)},useInsertionEffect:function(r,i){mu(4,2,r,i)},useMemo:function(r,i){var u=rn();i=i===void 0?null:i;var m=r();if(ii){Ft(!0);try{r()}finally{Ft(!1)}}return u.memoizedState=[m,i],m},useReducer:function(r,i,u){var m=rn();if(u!==void 0){var b=u(i);if(ii){Ft(!0);try{u(i)}finally{Ft(!1)}}}else b=i;return m.memoizedState=m.baseState=b,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:b},m.queue=r,r=r.dispatch=H6.bind(null,Ve,r),[m.memoizedState,r]},useRef:function(r){var i=rn();return r={current:r},i.memoizedState=r},useState:function(r){r=vf(r);var i=r.queue,u=iw.bind(null,Ve,i);return i.dispatch=u,[r.memoizedState,u]},useDebugValue:kf,useDeferredValue:function(r,i){var u=rn();return Sf(u,r,i)},useTransition:function(){var r=vf(!1);return r=ew.bind(null,Ve,r.queue,!0,!1),rn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,u){var m=Ve,b=rn();if(nt){if(u===void 0)throw Error(a(407));u=u()}else{if(u=i(),bt===null)throw Error(a(349));(Je&127)!==0||T1(m,i,u)}b.memoizedState=u;var v={value:u,getSnapshot:i};return b.queue=v,G1(M1.bind(null,m,v,r),[r]),m.flags|=2048,ts(9,{destroy:void 0},A1.bind(null,m,v,u,i),null),u},useId:function(){var r=rn(),i=bt.identifierPrefix;if(nt){var u=ur,m=or;u=(m&~(1<<32-ut(m)-1)).toString(32)+u,i="_"+i+"R_"+u,u=cu++,0<u&&(i+="H"+u.toString(32)),i+="_"}else u=L6++,i="_"+i+"r_"+u.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:Nf,useFormState:H1,useActionState:H1,useOptimistic:function(r){var i=rn();i.memoizedState=i.baseState=r;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=Cf.bind(null,Ve,!0,u),u.dispatch=i,[r,i]},useMemoCache:xf,useCacheRefresh:function(){return rn().memoizedState=B6.bind(null,Ve)},useEffectEvent:function(r){var i=rn(),u={impl:r};return i.memoizedState=u,function(){if((ct&2)!==0)throw Error(a(440));return u.impl.apply(void 0,arguments)}}},Ef={readContext:Xt,use:fu,useCallback:Q1,useContext:Xt,useEffect:jf,useImperativeHandle:W1,useInsertionEffect:Y1,useLayoutEffect:X1,useMemo:Z1,useReducer:hu,useRef:$1,useState:function(){return hu(zr)},useDebugValue:kf,useDeferredValue:function(r,i){var u=Dt();return J1(u,pt.memoizedState,r,i)},useTransition:function(){var r=hu(zr)[0],i=Dt().memoizedState;return[typeof r=="boolean"?r:ml(r),i]},useSyncExternalStore:E1,useId:rw,useHostTransitionStatus:Nf,useFormState:P1,useActionState:P1,useOptimistic:function(r,i){var u=Dt();return D1(u,pt,r,i)},useMemoCache:xf,useCacheRefresh:aw};Ef.useEffectEvent=V1;var uw={readContext:Xt,use:fu,useCallback:Q1,useContext:Xt,useEffect:jf,useImperativeHandle:W1,useInsertionEffect:Y1,useLayoutEffect:X1,useMemo:Z1,useReducer:bf,useRef:$1,useState:function(){return bf(zr)},useDebugValue:kf,useDeferredValue:function(r,i){var u=Dt();return pt===null?Sf(u,r,i):J1(u,pt.memoizedState,r,i)},useTransition:function(){var r=bf(zr)[0],i=Dt().memoizedState;return[typeof r=="boolean"?r:ml(r),i]},useSyncExternalStore:E1,useId:rw,useHostTransitionStatus:Nf,useFormState:U1,useActionState:U1,useOptimistic:function(r,i){var u=Dt();return pt!==null?D1(u,pt,r,i):(u.baseState=r,[r,u.queue.dispatch])},useMemoCache:xf,useCacheRefresh:aw};uw.useEffectEvent=V1;function Tf(r,i,u,m){i=r.memoizedState,u=u(m,i),u=u==null?i:p({},i,u),r.memoizedState=u,r.lanes===0&&(r.updateQueue.baseState=u)}var Af={enqueueSetState:function(r,i,u){r=r._reactInternals;var m=_n(),b=ha(m);b.payload=i,u!=null&&(b.callback=u),i=ma(r,b,m),i!==null&&(mn(i,r,m),cl(i,r,m))},enqueueReplaceState:function(r,i,u){r=r._reactInternals;var m=_n(),b=ha(m);b.tag=1,b.payload=i,u!=null&&(b.callback=u),i=ma(r,b,m),i!==null&&(mn(i,r,m),cl(i,r,m))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var u=_n(),m=ha(u);m.tag=2,i!=null&&(m.callback=i),i=ma(r,m,u),i!==null&&(mn(i,r,u),cl(i,r,u))}};function cw(r,i,u,m,b,v,A){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(m,v,A):i.prototype&&i.prototype.isPureReactComponent?!nl(u,m)||!nl(b,v):!0}function dw(r,i,u,m){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,m),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,m),i.state!==r&&Af.enqueueReplaceState(i,i.state,null)}function si(r,i){var u=i;if("ref"in i){u={};for(var m in i)m!=="ref"&&(u[m]=i[m])}if(r=r.defaultProps){u===i&&(u=p({},u));for(var b in r)u[b]===void 0&&(u[b]=r[b])}return u}function fw(r){Xo(r)}function hw(r){console.error(r)}function mw(r){Xo(r)}function xu(r,i){try{var u=r.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(m){setTimeout(function(){throw m})}}function pw(r,i,u){try{var m=r.onCaughtError;m(u.value,{componentStack:u.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Mf(r,i,u){return u=ha(u),u.tag=3,u.payload={element:null},u.callback=function(){xu(r,i)},u}function gw(r){return r=ha(r),r.tag=3,r}function xw(r,i,u,m){var b=u.type.getDerivedStateFromError;if(typeof b=="function"){var v=m.value;r.payload=function(){return b(v)},r.callback=function(){pw(i,u,m)}}var A=u.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(r.callback=function(){pw(i,u,m),typeof b!="function"&&(va===null?va=new Set([this]):va.add(this));var U=m.stack;this.componentDidCatch(m.value,{componentStack:U!==null?U:""})})}function P6(r,i,u,m,b){if(u.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(i=u.alternate,i!==null&&Yi(i,u,b,!0),u=wn.current,u!==null){switch(u.tag){case 31:case 13:return zn===null?Tu():u.alternate===null&&Rt===0&&(Rt=3),u.flags&=-257,u.flags|=65536,u.lanes=b,m===au?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([m]):i.add(m),nh(r,m,b)),!1;case 22:return u.flags|=65536,m===au?u.flags|=16384:(i=u.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([m])},u.updateQueue=i):(u=i.retryQueue,u===null?i.retryQueue=new Set([m]):u.add(m)),nh(r,m,b)),!1}throw Error(a(435,u.tag))}return nh(r,m,b),Tu(),!1}if(nt)return i=wn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=b,m!==Kd&&(r=Error(a(422),{cause:m}),il(Rn(r,u)))):(m!==Kd&&(i=Error(a(423),{cause:m}),il(Rn(i,u))),r=r.current.alternate,r.flags|=65536,b&=-b,r.lanes|=b,m=Rn(m,u),b=Mf(r.stateNode,m,b),lf(r,b),Rt!==4&&(Rt=2)),!1;var v=Error(a(520),{cause:m});if(v=Rn(v,u),Sl===null?Sl=[v]:Sl.push(v),Rt!==4&&(Rt=2),i===null)return!0;m=Rn(m,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,r=b&-b,u.lanes|=r,r=Mf(u.stateNode,m,r),lf(u,r),!1;case 1:if(i=u.type,v=u.stateNode,(u.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(va===null||!va.has(v))))return u.flags|=65536,b&=-b,u.lanes|=b,b=gw(b),xw(b,r,u,m),lf(u,b),!1}u=u.return}while(u!==null);return!1}var Rf=Error(a(461)),qt=!1;function Kt(r,i,u,m){i.child=r===null?w1(i,null,u,m):ai(i,r.child,u,m)}function yw(r,i,u,m,b){u=u.render;var v=i.ref;if("ref"in m){var A={};for(var U in m)U!=="ref"&&(A[U]=m[U])}else A=m;return ei(i),m=hf(r,i,u,A,v,b),U=mf(),r!==null&&!qt?(pf(r,i,b),qr(r,i,b)):(nt&&U&&Yd(i),i.flags|=1,Kt(r,i,m,b),i.child)}function bw(r,i,u,m,b){if(r===null){var v=u.type;return typeof v=="function"&&!$d(v)&&v.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=v,vw(r,i,v,m,b)):(r=Zo(u.type,null,m,i,i.mode,b),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!Hf(r,b)){var A=v.memoizedProps;if(u=u.compare,u=u!==null?u:nl,u(A,m)&&r.ref===i.ref)return qr(r,i,b)}return i.flags|=1,r=Mr(v,m),r.ref=i.ref,r.return=i,i.child=r}function vw(r,i,u,m,b){if(r!==null){var v=r.memoizedProps;if(nl(v,m)&&r.ref===i.ref)if(qt=!1,i.pendingProps=m=v,Hf(r,b))(r.flags&131072)!==0&&(qt=!0);else return i.lanes=r.lanes,qr(r,i,b)}return Lf(r,i,u,m,b)}function ww(r,i,u,m){var b=m.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|u:u,r!==null){for(m=i.child=r.child,b=0;m!==null;)b=b|m.lanes|m.childLanes,m=m.sibling;m=b&~v}else m=0,i.child=null;return jw(r,i,v,u,m)}if((u&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&nu(i,v!==null?v.cachePool:null),v!==null?S1(i,v):uf(),_1(i);else return m=i.lanes=536870912,jw(r,i,v!==null?v.baseLanes|u:u,u,m)}else v!==null?(nu(i,v.cachePool),S1(i,v),ga(),i.memoizedState=null):(r!==null&&nu(i,null),uf(),ga());return Kt(r,i,b,u),i.child}function xl(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function jw(r,i,u,m,b){var v=nf();return v=v===null?null:{parent:Ot._currentValue,pool:v},i.memoizedState={baseLanes:u,cachePool:v},r!==null&&nu(i,null),uf(),_1(i),r!==null&&Yi(r,i,m,!0),i.childLanes=b,null}function yu(r,i){return i=vu({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function kw(r,i,u){return ai(i,r.child,null,u),r=yu(i,i.pendingProps),r.flags|=2,jn(i),i.memoizedState=null,r}function F6(r,i,u){var m=i.pendingProps,b=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(nt){if(m.mode==="hidden")return r=yu(i,m),i.lanes=536870912,xl(null,r);if(df(i),(r=jt)?(r=O2(r,On),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:oa!==null?{id:or,overflow:ur}:null,retryLane:536870912,hydrationErrors:null},u=s1(r),u.return=i,i.child=u,Yt=i,jt=null)):r=null,r===null)throw ca(i);return i.lanes=536870912,null}return yu(i,m)}var v=r.memoizedState;if(v!==null){var A=v.dehydrated;if(df(i),b)if(i.flags&256)i.flags&=-257,i=kw(r,i,u);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(qt||Yi(r,i,u,!1),b=(u&r.childLanes)!==0,qt||b){if(m=bt,m!==null&&(A=Mi(m,u),A!==0&&A!==v.retryLane))throw v.retryLane=A,Wa(r,A),mn(m,r,A),Rf;Tu(),i=kw(r,i,u)}else r=v.treeContext,jt=qn(A.nextSibling),Yt=i,nt=!0,ua=null,On=!1,r!==null&&u1(i,r),i=yu(i,m),i.flags|=4096;return i}return r=Mr(r.child,{mode:m.mode,children:m.children}),r.ref=i.ref,i.child=r,r.return=i,r}function bu(r,i){var u=i.ref;if(u===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(a(284));(r===null||r.ref!==u)&&(i.flags|=4194816)}}function Lf(r,i,u,m,b){return ei(i),u=hf(r,i,u,m,void 0,b),m=mf(),r!==null&&!qt?(pf(r,i,b),qr(r,i,b)):(nt&&m&&Yd(i),i.flags|=1,Kt(r,i,u,b),i.child)}function Sw(r,i,u,m,b,v){return ei(i),i.updateQueue=null,u=C1(i,m,u,b),N1(r),m=mf(),r!==null&&!qt?(pf(r,i,v),qr(r,i,v)):(nt&&m&&Yd(i),i.flags|=1,Kt(r,i,u,v),i.child)}function _w(r,i,u,m,b){if(ei(i),i.stateNode===null){var v=Ui,A=u.contextType;typeof A=="object"&&A!==null&&(v=Xt(A)),v=new u(m,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Af,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=m,v.state=i.memoizedState,v.refs={},af(i),A=u.contextType,v.context=typeof A=="object"&&A!==null?Xt(A):Ui,v.state=i.memoizedState,A=u.getDerivedStateFromProps,typeof A=="function"&&(Tf(i,u,A,m),v.state=i.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(A=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),A!==v.state&&Af.enqueueReplaceState(v,v.state,null),fl(i,m,v,b),dl(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),m=!0}else if(r===null){v=i.stateNode;var U=i.memoizedProps,ee=si(u,U);v.props=ee;var ce=v.context,ge=u.contextType;A=Ui,typeof ge=="object"&&ge!==null&&(A=Xt(ge));var ve=u.getDerivedStateFromProps;ge=typeof ve=="function"||typeof v.getSnapshotBeforeUpdate=="function",U=i.pendingProps!==U,ge||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(U||ce!==A)&&dw(i,v,m,A),fa=!1;var de=i.memoizedState;v.state=de,fl(i,m,v,b),dl(),ce=i.memoizedState,U||de!==ce||fa?(typeof ve=="function"&&(Tf(i,u,ve,m),ce=i.memoizedState),(ee=fa||cw(i,u,ee,m,de,ce,A))?(ge||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=m,i.memoizedState=ce),v.props=m,v.state=ce,v.context=A,m=ee):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),m=!1)}else{v=i.stateNode,sf(r,i),A=i.memoizedProps,ge=si(u,A),v.props=ge,ve=i.pendingProps,de=v.context,ce=u.contextType,ee=Ui,typeof ce=="object"&&ce!==null&&(ee=Xt(ce)),U=u.getDerivedStateFromProps,(ce=typeof U=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(A!==ve||de!==ee)&&dw(i,v,m,ee),fa=!1,de=i.memoizedState,v.state=de,fl(i,m,v,b),dl();var me=i.memoizedState;A!==ve||de!==me||fa||r!==null&&r.dependencies!==null&&eu(r.dependencies)?(typeof U=="function"&&(Tf(i,u,U,m),me=i.memoizedState),(ge=fa||cw(i,u,ge,m,de,me,ee)||r!==null&&r.dependencies!==null&&eu(r.dependencies))?(ce||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(m,me,ee),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(m,me,ee)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||A===r.memoizedProps&&de===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||A===r.memoizedProps&&de===r.memoizedState||(i.flags|=1024),i.memoizedProps=m,i.memoizedState=me),v.props=m,v.state=me,v.context=ee,m=ge):(typeof v.componentDidUpdate!="function"||A===r.memoizedProps&&de===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||A===r.memoizedProps&&de===r.memoizedState||(i.flags|=1024),m=!1)}return v=m,bu(r,i),m=(i.flags&128)!==0,v||m?(v=i.stateNode,u=m&&typeof u.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&m?(i.child=ai(i,r.child,null,b),i.child=ai(i,null,u,b)):Kt(r,i,u,b),i.memoizedState=v.state,r=i.child):r=qr(r,i,b),r}function Nw(r,i,u,m){return Za(),i.flags|=256,Kt(r,i,u,m),i.child}var Df={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Of(r){return{baseLanes:r,cachePool:p1()}}function zf(r,i,u){return r=r!==null?r.childLanes&~u:0,i&&(r|=Sn),r}function Cw(r,i,u){var m=i.pendingProps,b=!1,v=(i.flags&128)!==0,A;if((A=v)||(A=r!==null&&r.memoizedState===null?!1:(Lt.current&2)!==0),A&&(b=!0,i.flags&=-129),A=(i.flags&32)!==0,i.flags&=-33,r===null){if(nt){if(b?pa(i):ga(),(r=jt)?(r=O2(r,On),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:oa!==null?{id:or,overflow:ur}:null,retryLane:536870912,hydrationErrors:null},u=s1(r),u.return=i,i.child=u,Yt=i,jt=null)):r=null,r===null)throw ca(i);return yh(r)?i.lanes=32:i.lanes=536870912,null}var U=m.children;return m=m.fallback,b?(ga(),b=i.mode,U=vu({mode:"hidden",children:U},b),m=Qa(m,b,u,null),U.return=i,m.return=i,U.sibling=m,i.child=U,m=i.child,m.memoizedState=Of(u),m.childLanes=zf(r,A,u),i.memoizedState=Df,xl(null,m)):(pa(i),qf(i,U))}var ee=r.memoizedState;if(ee!==null&&(U=ee.dehydrated,U!==null)){if(v)i.flags&256?(pa(i),i.flags&=-257,i=If(r,i,u)):i.memoizedState!==null?(ga(),i.child=r.child,i.flags|=128,i=null):(ga(),U=m.fallback,b=i.mode,m=vu({mode:"visible",children:m.children},b),U=Qa(U,b,u,null),U.flags|=2,m.return=i,U.return=i,m.sibling=U,i.child=m,ai(i,r.child,null,u),m=i.child,m.memoizedState=Of(u),m.childLanes=zf(r,A,u),i.memoizedState=Df,i=xl(null,m));else if(pa(i),yh(U)){if(A=U.nextSibling&&U.nextSibling.dataset,A)var ce=A.dgst;A=ce,m=Error(a(419)),m.stack="",m.digest=A,il({value:m,source:null,stack:null}),i=If(r,i,u)}else if(qt||Yi(r,i,u,!1),A=(u&r.childLanes)!==0,qt||A){if(A=bt,A!==null&&(m=Mi(A,u),m!==0&&m!==ee.retryLane))throw ee.retryLane=m,Wa(r,m),mn(A,r,m),Rf;xh(U)||Tu(),i=If(r,i,u)}else xh(U)?(i.flags|=192,i.child=r.child,i=null):(r=ee.treeContext,jt=qn(U.nextSibling),Yt=i,nt=!0,ua=null,On=!1,r!==null&&u1(i,r),i=qf(i,m.children),i.flags|=4096);return i}return b?(ga(),U=m.fallback,b=i.mode,ee=r.child,ce=ee.sibling,m=Mr(ee,{mode:"hidden",children:m.children}),m.subtreeFlags=ee.subtreeFlags&65011712,ce!==null?U=Mr(ce,U):(U=Qa(U,b,u,null),U.flags|=2),U.return=i,m.return=i,m.sibling=U,i.child=m,xl(null,m),m=i.child,U=r.child.memoizedState,U===null?U=Of(u):(b=U.cachePool,b!==null?(ee=Ot._currentValue,b=b.parent!==ee?{parent:ee,pool:ee}:b):b=p1(),U={baseLanes:U.baseLanes|u,cachePool:b}),m.memoizedState=U,m.childLanes=zf(r,A,u),i.memoizedState=Df,xl(r.child,m)):(pa(i),u=r.child,r=u.sibling,u=Mr(u,{mode:"visible",children:m.children}),u.return=i,u.sibling=null,r!==null&&(A=i.deletions,A===null?(i.deletions=[r],i.flags|=16):A.push(r)),i.child=u,i.memoizedState=null,u)}function qf(r,i){return i=vu({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function vu(r,i){return r=vn(22,r,null,i),r.lanes=0,r}function If(r,i,u){return ai(i,r.child,null,u),r=qf(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function Ew(r,i,u){r.lanes|=i;var m=r.alternate;m!==null&&(m.lanes|=i),Zd(r.return,i,u)}function Bf(r,i,u,m,b,v){var A=r.memoizedState;A===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:m,tail:u,tailMode:b,treeForkCount:v}:(A.isBackwards=i,A.rendering=null,A.renderingStartTime=0,A.last=m,A.tail=u,A.tailMode=b,A.treeForkCount=v)}function Tw(r,i,u){var m=i.pendingProps,b=m.revealOrder,v=m.tail;m=m.children;var A=Lt.current,U=(A&2)!==0;if(U?(A=A&1|2,i.flags|=128):A&=1,I(Lt,A),Kt(r,i,m,u),m=nt?al:0,!U&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Ew(r,u,i);else if(r.tag===19)Ew(r,u,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(b){case"forwards":for(u=i.child,b=null;u!==null;)r=u.alternate,r!==null&&ou(r)===null&&(b=u),u=u.sibling;u=b,u===null?(b=i.child,i.child=null):(b=u.sibling,u.sibling=null),Bf(i,!1,b,u,v,m);break;case"backwards":case"unstable_legacy-backwards":for(u=null,b=i.child,i.child=null;b!==null;){if(r=b.alternate,r!==null&&ou(r)===null){i.child=b;break}r=b.sibling,b.sibling=u,u=b,b=r}Bf(i,!0,u,null,v,m);break;case"together":Bf(i,!1,null,null,void 0,m);break;default:i.memoizedState=null}return i.child}function qr(r,i,u){if(r!==null&&(i.dependencies=r.dependencies),ba|=i.lanes,(u&i.childLanes)===0)if(r!==null){if(Yi(r,i,u,!1),(u&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(a(153));if(i.child!==null){for(r=i.child,u=Mr(r,r.pendingProps),i.child=u,u.return=i;r.sibling!==null;)r=r.sibling,u=u.sibling=Mr(r,r.pendingProps),u.return=i;u.sibling=null}return i.child}function Hf(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&eu(r)))}function U6(r,i,u){switch(i.tag){case 3:Y(i,i.stateNode.containerInfo),da(i,Ot,r.memoizedState.cache),Za();break;case 27:case 5:he(i);break;case 4:Y(i,i.stateNode.containerInfo);break;case 10:da(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,df(i),null;break;case 13:var m=i.memoizedState;if(m!==null)return m.dehydrated!==null?(pa(i),i.flags|=128,null):(u&i.child.childLanes)!==0?Cw(r,i,u):(pa(i),r=qr(r,i,u),r!==null?r.sibling:null);pa(i);break;case 19:var b=(r.flags&128)!==0;if(m=(u&i.childLanes)!==0,m||(Yi(r,i,u,!1),m=(u&i.childLanes)!==0),b){if(m)return Tw(r,i,u);i.flags|=128}if(b=i.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),I(Lt,Lt.current),m)break;return null;case 22:return i.lanes=0,ww(r,i,u,i.pendingProps);case 24:da(i,Ot,r.memoizedState.cache)}return qr(r,i,u)}function Aw(r,i,u){if(r!==null)if(r.memoizedProps!==i.pendingProps)qt=!0;else{if(!Hf(r,u)&&(i.flags&128)===0)return qt=!1,U6(r,i,u);qt=(r.flags&131072)!==0}else qt=!1,nt&&(i.flags&1048576)!==0&&o1(i,al,i.index);switch(i.lanes=0,i.tag){case 16:e:{var m=i.pendingProps;if(r=ni(i.elementType),i.type=r,typeof r=="function")$d(r)?(m=si(r,m),i.tag=1,i=_w(null,i,r,m,u)):(i.tag=0,i=Lf(null,i,r,m,u));else{if(r!=null){var b=r.$$typeof;if(b===E){i.tag=11,i=yw(null,i,r,m,u);break e}else if(b===R){i.tag=14,i=bw(null,i,r,m,u);break e}}throw i=q(r)||r,Error(a(306,i,""))}}return i;case 0:return Lf(r,i,i.type,i.pendingProps,u);case 1:return m=i.type,b=si(m,i.pendingProps),_w(r,i,m,b,u);case 3:e:{if(Y(i,i.stateNode.containerInfo),r===null)throw Error(a(387));m=i.pendingProps;var v=i.memoizedState;b=v.element,sf(r,i),fl(i,m,null,u);var A=i.memoizedState;if(m=A.cache,da(i,Ot,m),m!==v.cache&&Jd(i,[Ot],u,!0),dl(),m=A.element,v.isDehydrated)if(v={element:m,isDehydrated:!1,cache:A.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=Nw(r,i,m,u);break e}else if(m!==b){b=Rn(Error(a(424)),i),il(b),i=Nw(r,i,m,u);break e}else{switch(r=i.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(jt=qn(r.firstChild),Yt=i,nt=!0,ua=null,On=!0,u=w1(i,null,m,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Za(),m===b){i=qr(r,i,u);break e}Kt(r,i,m,u)}i=i.child}return i;case 26:return bu(r,i),r===null?(u=P2(i.type,null,i.pendingProps,null))?i.memoizedState=u:nt||(u=i.type,r=i.pendingProps,m=zu(ne.current).createElement(u),m[At]=i,m[Gt]=r,Wt(m,u,r),Et(m),i.stateNode=m):i.memoizedState=P2(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return he(i),r===null&&nt&&(m=i.stateNode=I2(i.type,i.pendingProps,ne.current),Yt=i,On=!0,b=jt,Sa(i.type)?(bh=b,jt=qn(m.firstChild)):jt=b),Kt(r,i,i.pendingProps.children,u),bu(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&nt&&((b=m=jt)&&(m=bR(m,i.type,i.pendingProps,On),m!==null?(i.stateNode=m,Yt=i,jt=qn(m.firstChild),On=!1,b=!0):b=!1),b||ca(i)),he(i),b=i.type,v=i.pendingProps,A=r!==null?r.memoizedProps:null,m=v.children,mh(b,v)?m=null:A!==null&&mh(b,A)&&(i.flags|=32),i.memoizedState!==null&&(b=hf(r,i,D6,null,null,u),Rl._currentValue=b),bu(r,i),Kt(r,i,m,u),i.child;case 6:return r===null&&nt&&((r=u=jt)&&(u=vR(u,i.pendingProps,On),u!==null?(i.stateNode=u,Yt=i,jt=null,r=!0):r=!1),r||ca(i)),null;case 13:return Cw(r,i,u);case 4:return Y(i,i.stateNode.containerInfo),m=i.pendingProps,r===null?i.child=ai(i,null,m,u):Kt(r,i,m,u),i.child;case 11:return yw(r,i,i.type,i.pendingProps,u);case 7:return Kt(r,i,i.pendingProps,u),i.child;case 8:return Kt(r,i,i.pendingProps.children,u),i.child;case 12:return Kt(r,i,i.pendingProps.children,u),i.child;case 10:return m=i.pendingProps,da(i,i.type,m.value),Kt(r,i,m.children,u),i.child;case 9:return b=i.type._context,m=i.pendingProps.children,ei(i),b=Xt(b),m=m(b),i.flags|=1,Kt(r,i,m,u),i.child;case 14:return bw(r,i,i.type,i.pendingProps,u);case 15:return vw(r,i,i.type,i.pendingProps,u);case 19:return Tw(r,i,u);case 31:return F6(r,i,u);case 22:return ww(r,i,u,i.pendingProps);case 24:return ei(i),m=Xt(Ot),r===null?(b=nf(),b===null&&(b=bt,v=ef(),b.pooledCache=v,v.refCount++,v!==null&&(b.pooledCacheLanes|=u),b=v),i.memoizedState={parent:m,cache:b},af(i),da(i,Ot,b)):((r.lanes&u)!==0&&(sf(r,i),fl(i,null,null,u),dl()),b=r.memoizedState,v=i.memoizedState,b.parent!==m?(b={parent:m,cache:m},i.memoizedState=b,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=b),da(i,Ot,m)):(m=v.cache,da(i,Ot,m),m!==b.cache&&Jd(i,[Ot],u,!0))),Kt(r,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Ir(r){r.flags|=4}function Pf(r,i,u,m,b){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(b&335544128)===b)if(r.stateNode.complete)r.flags|=8192;else if(r2())r.flags|=8192;else throw ri=au,rf}else r.flags&=-16777217}function Mw(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!V2(i))if(r2())r.flags|=8192;else throw ri=au,rf}function wu(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?Ei():536870912,r.lanes|=i,is|=i)}function yl(r,i){if(!nt)switch(r.tailMode){case"hidden":i=r.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?r.tail=null:u.sibling=null;break;case"collapsed":u=r.tail;for(var m=null;u!==null;)u.alternate!==null&&(m=u),u=u.sibling;m===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:m.sibling=null}}function kt(r){var i=r.alternate!==null&&r.alternate.child===r.child,u=0,m=0;if(i)for(var b=r.child;b!==null;)u|=b.lanes|b.childLanes,m|=b.subtreeFlags&65011712,m|=b.flags&65011712,b.return=r,b=b.sibling;else for(b=r.child;b!==null;)u|=b.lanes|b.childLanes,m|=b.subtreeFlags,m|=b.flags,b.return=r,b=b.sibling;return r.subtreeFlags|=m,r.childLanes=u,i}function $6(r,i,u){var m=i.pendingProps;switch(Xd(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kt(i),null;case 1:return kt(i),null;case 3:return u=i.stateNode,m=null,r!==null&&(m=r.memoizedState.cache),i.memoizedState.cache!==m&&(i.flags|=2048),Dr(Ot),ae(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(Vi(i)?Ir(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Wd())),kt(i),null;case 26:var b=i.type,v=i.memoizedState;return r===null?(Ir(i),v!==null?(kt(i),Mw(i,v)):(kt(i),Pf(i,b,null,m,u))):v?v!==r.memoizedState?(Ir(i),kt(i),Mw(i,v)):(kt(i),i.flags&=-16777217):(r=r.memoizedProps,r!==m&&Ir(i),kt(i),Pf(i,b,r,m,u)),null;case 27:if(ke(i),u=ne.current,b=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==m&&Ir(i);else{if(!m){if(i.stateNode===null)throw Error(a(166));return kt(i),null}r=V.current,Vi(i)?c1(i):(r=I2(b,m,u),i.stateNode=r,Ir(i))}return kt(i),null;case 5:if(ke(i),b=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==m&&Ir(i);else{if(!m){if(i.stateNode===null)throw Error(a(166));return kt(i),null}if(v=V.current,Vi(i))c1(i);else{var A=zu(ne.current);switch(v){case 1:v=A.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:v=A.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":v=A.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":v=A.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":v=A.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof m.is=="string"?A.createElement("select",{is:m.is}):A.createElement("select"),m.multiple?v.multiple=!0:m.size&&(v.size=m.size);break;default:v=typeof m.is=="string"?A.createElement(b,{is:m.is}):A.createElement(b)}}v[At]=i,v[Gt]=m;e:for(A=i.child;A!==null;){if(A.tag===5||A.tag===6)v.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===i)break e;for(;A.sibling===null;){if(A.return===null||A.return===i)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}i.stateNode=v;e:switch(Wt(v,b,m),b){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Ir(i)}}return kt(i),Pf(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,u),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==m&&Ir(i);else{if(typeof m!="string"&&i.stateNode===null)throw Error(a(166));if(r=ne.current,Vi(i)){if(r=i.stateNode,u=i.memoizedProps,m=null,b=Yt,b!==null)switch(b.tag){case 27:case 5:m=b.memoizedProps}r[At]=i,r=!!(r.nodeValue===u||m!==null&&m.suppressHydrationWarning===!0||C2(r.nodeValue,u)),r||ca(i,!0)}else r=zu(r).createTextNode(m),r[At]=i,i.stateNode=r}return kt(i),null;case 31:if(u=i.memoizedState,r===null||r.memoizedState!==null){if(m=Vi(i),u!==null){if(r===null){if(!m)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[At]=i}else Za(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;kt(i),r=!1}else u=Wd(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=u),r=!0;if(!r)return i.flags&256?(jn(i),i):(jn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return kt(i),null;case 13:if(m=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(b=Vi(i),m!==null&&m.dehydrated!==null){if(r===null){if(!b)throw Error(a(318));if(b=i.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(a(317));b[At]=i}else Za(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;kt(i),b=!1}else b=Wd(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=b),b=!0;if(!b)return i.flags&256?(jn(i),i):(jn(i),null)}return jn(i),(i.flags&128)!==0?(i.lanes=u,i):(u=m!==null,r=r!==null&&r.memoizedState!==null,u&&(m=i.child,b=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(b=m.alternate.memoizedState.cachePool.pool),v=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(v=m.memoizedState.cachePool.pool),v!==b&&(m.flags|=2048)),u!==r&&u&&(i.child.flags|=8192),wu(i,i.updateQueue),kt(i),null);case 4:return ae(),r===null&&uh(i.stateNode.containerInfo),kt(i),null;case 10:return Dr(i.type),kt(i),null;case 19:if(Q(Lt),m=i.memoizedState,m===null)return kt(i),null;if(b=(i.flags&128)!==0,v=m.rendering,v===null)if(b)yl(m,!1);else{if(Rt!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=ou(r),v!==null){for(i.flags|=128,yl(m,!1),r=v.updateQueue,i.updateQueue=r,wu(i,r),i.subtreeFlags=0,r=u,u=i.child;u!==null;)i1(u,r),u=u.sibling;return I(Lt,Lt.current&1|2),nt&&Rr(i,m.treeForkCount),i.child}r=r.sibling}m.tail!==null&&ie()>Nu&&(i.flags|=128,b=!0,yl(m,!1),i.lanes=4194304)}else{if(!b)if(r=ou(v),r!==null){if(i.flags|=128,b=!0,r=r.updateQueue,i.updateQueue=r,wu(i,r),yl(m,!0),m.tail===null&&m.tailMode==="hidden"&&!v.alternate&&!nt)return kt(i),null}else 2*ie()-m.renderingStartTime>Nu&&u!==536870912&&(i.flags|=128,b=!0,yl(m,!1),i.lanes=4194304);m.isBackwards?(v.sibling=i.child,i.child=v):(r=m.last,r!==null?r.sibling=v:i.child=v,m.last=v)}return m.tail!==null?(r=m.tail,m.rendering=r,m.tail=r.sibling,m.renderingStartTime=ie(),r.sibling=null,u=Lt.current,I(Lt,b?u&1|2:u&1),nt&&Rr(i,m.treeForkCount),r):(kt(i),null);case 22:case 23:return jn(i),cf(),m=i.memoizedState!==null,r!==null?r.memoizedState!==null!==m&&(i.flags|=8192):m&&(i.flags|=8192),m?(u&536870912)!==0&&(i.flags&128)===0&&(kt(i),i.subtreeFlags&6&&(i.flags|=8192)):kt(i),u=i.updateQueue,u!==null&&wu(i,u.retryQueue),u=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==u&&(i.flags|=2048),r!==null&&Q(ti),null;case 24:return u=null,r!==null&&(u=r.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Dr(Ot),kt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function G6(r,i){switch(Xd(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Dr(Ot),ae(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return ke(i),null;case 31:if(i.memoizedState!==null){if(jn(i),i.alternate===null)throw Error(a(340));Za()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(jn(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Za()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return Q(Lt),null;case 4:return ae(),null;case 10:return Dr(i.type),null;case 22:case 23:return jn(i),cf(),r!==null&&Q(ti),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Dr(Ot),null;case 25:return null;default:return null}}function Rw(r,i){switch(Xd(i),i.tag){case 3:Dr(Ot),ae();break;case 26:case 27:case 5:ke(i);break;case 4:ae();break;case 31:i.memoizedState!==null&&jn(i);break;case 13:jn(i);break;case 19:Q(Lt);break;case 10:Dr(i.type);break;case 22:case 23:jn(i),cf(),r!==null&&Q(ti);break;case 24:Dr(Ot)}}function bl(r,i){try{var u=i.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var b=m.next;u=b;do{if((u.tag&r)===r){m=void 0;var v=u.create,A=u.inst;m=v(),A.destroy=m}u=u.next}while(u!==b)}}catch(U){ft(i,i.return,U)}}function xa(r,i,u){try{var m=i.updateQueue,b=m!==null?m.lastEffect:null;if(b!==null){var v=b.next;m=v;do{if((m.tag&r)===r){var A=m.inst,U=A.destroy;if(U!==void 0){A.destroy=void 0,b=i;var ee=u,ce=U;try{ce()}catch(ge){ft(b,ee,ge)}}}m=m.next}while(m!==v)}}catch(ge){ft(i,i.return,ge)}}function Lw(r){var i=r.updateQueue;if(i!==null){var u=r.stateNode;try{k1(i,u)}catch(m){ft(r,r.return,m)}}}function Dw(r,i,u){u.props=si(r.type,r.memoizedProps),u.state=r.memoizedState;try{u.componentWillUnmount()}catch(m){ft(r,i,m)}}function vl(r,i){try{var u=r.ref;if(u!==null){switch(r.tag){case 26:case 27:case 5:var m=r.stateNode;break;case 30:m=r.stateNode;break;default:m=r.stateNode}typeof u=="function"?r.refCleanup=u(m):u.current=m}}catch(b){ft(r,i,b)}}function cr(r,i){var u=r.ref,m=r.refCleanup;if(u!==null)if(typeof m=="function")try{m()}catch(b){ft(r,i,b)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(b){ft(r,i,b)}else u.current=null}function Ow(r){var i=r.type,u=r.memoizedProps,m=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&m.focus();break e;case"img":u.src?m.src=u.src:u.srcSet&&(m.srcset=u.srcSet)}}catch(b){ft(r,r.return,b)}}function Ff(r,i,u){try{var m=r.stateNode;hR(m,r.type,u,i),m[Gt]=i}catch(b){ft(r,r.return,b)}}function zw(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Sa(r.type)||r.tag===4}function Uf(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||zw(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Sa(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function $f(r,i,u){var m=r.tag;if(m===5||m===6)r=r.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(r,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(r),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=Tr));else if(m!==4&&(m===27&&Sa(r.type)&&(u=r.stateNode,i=null),r=r.child,r!==null))for($f(r,i,u),r=r.sibling;r!==null;)$f(r,i,u),r=r.sibling}function ju(r,i,u){var m=r.tag;if(m===5||m===6)r=r.stateNode,i?u.insertBefore(r,i):u.appendChild(r);else if(m!==4&&(m===27&&Sa(r.type)&&(u=r.stateNode),r=r.child,r!==null))for(ju(r,i,u),r=r.sibling;r!==null;)ju(r,i,u),r=r.sibling}function qw(r){var i=r.stateNode,u=r.memoizedProps;try{for(var m=r.type,b=i.attributes;b.length;)i.removeAttributeNode(b[0]);Wt(i,m,u),i[At]=r,i[Gt]=u}catch(v){ft(r,r.return,v)}}var Br=!1,It=!1,Gf=!1,Iw=typeof WeakSet=="function"?WeakSet:Set,Vt=null;function V6(r,i){if(r=r.containerInfo,fh=Uu,r=Wv(r),qd(r)){if("selectionStart"in r)var u={start:r.selectionStart,end:r.selectionEnd};else e:{u=(u=r.ownerDocument)&&u.defaultView||window;var m=u.getSelection&&u.getSelection();if(m&&m.rangeCount!==0){u=m.anchorNode;var b=m.anchorOffset,v=m.focusNode;m=m.focusOffset;try{u.nodeType,v.nodeType}catch{u=null;break e}var A=0,U=-1,ee=-1,ce=0,ge=0,ve=r,de=null;t:for(;;){for(var me;ve!==u||b!==0&&ve.nodeType!==3||(U=A+b),ve!==v||m!==0&&ve.nodeType!==3||(ee=A+m),ve.nodeType===3&&(A+=ve.nodeValue.length),(me=ve.firstChild)!==null;)de=ve,ve=me;for(;;){if(ve===r)break t;if(de===u&&++ce===b&&(U=A),de===v&&++ge===m&&(ee=A),(me=ve.nextSibling)!==null)break;ve=de,de=ve.parentNode}ve=me}u=U===-1||ee===-1?null:{start:U,end:ee}}else u=null}u=u||{start:0,end:0}}else u=null;for(hh={focusedElem:r,selectionRange:u},Uu=!1,Vt=i;Vt!==null;)if(i=Vt,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Vt=r;else for(;Vt!==null;){switch(i=Vt,v=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(u=0;u<r.length;u++)b=r[u],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,u=i,b=v.memoizedProps,v=v.memoizedState,m=u.stateNode;try{var Le=si(u.type,b);r=m.getSnapshotBeforeUpdate(Le,v),m.__reactInternalSnapshotBeforeUpdate=r}catch(Fe){ft(u,u.return,Fe)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,u=r.nodeType,u===9)gh(r);else if(u===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":gh(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=i.sibling,r!==null){r.return=i.return,Vt=r;break}Vt=i.return}}function Bw(r,i,u){var m=u.flags;switch(u.tag){case 0:case 11:case 15:Pr(r,u),m&4&&bl(5,u);break;case 1:if(Pr(r,u),m&4)if(r=u.stateNode,i===null)try{r.componentDidMount()}catch(A){ft(u,u.return,A)}else{var b=si(u.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(b,i,r.__reactInternalSnapshotBeforeUpdate)}catch(A){ft(u,u.return,A)}}m&64&&Lw(u),m&512&&vl(u,u.return);break;case 3:if(Pr(r,u),m&64&&(r=u.updateQueue,r!==null)){if(i=null,u.child!==null)switch(u.child.tag){case 27:case 5:i=u.child.stateNode;break;case 1:i=u.child.stateNode}try{k1(r,i)}catch(A){ft(u,u.return,A)}}break;case 27:i===null&&m&4&&qw(u);case 26:case 5:Pr(r,u),i===null&&m&4&&Ow(u),m&512&&vl(u,u.return);break;case 12:Pr(r,u);break;case 31:Pr(r,u),m&4&&Fw(r,u);break;case 13:Pr(r,u),m&4&&Uw(r,u),m&64&&(r=u.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(u=tR.bind(null,u),wR(r,u))));break;case 22:if(m=u.memoizedState!==null||Br,!m){i=i!==null&&i.memoizedState!==null||It,b=Br;var v=It;Br=m,(It=i)&&!v?Fr(r,u,(u.subtreeFlags&8772)!==0):Pr(r,u),Br=b,It=v}break;case 30:break;default:Pr(r,u)}}function Hw(r){var i=r.alternate;i!==null&&(r.alternate=null,Hw(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Ua(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var St=null,cn=!1;function Hr(r,i,u){for(u=u.child;u!==null;)Pw(r,i,u),u=u.sibling}function Pw(r,i,u){if(st&&typeof st.onCommitFiberUnmount=="function")try{st.onCommitFiberUnmount(tt,u)}catch{}switch(u.tag){case 26:It||cr(u,i),Hr(r,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:It||cr(u,i);var m=St,b=cn;Sa(u.type)&&(St=u.stateNode,cn=!1),Hr(r,i,u),Tl(u.stateNode),St=m,cn=b;break;case 5:It||cr(u,i);case 6:if(m=St,b=cn,St=null,Hr(r,i,u),St=m,cn=b,St!==null)if(cn)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(u.stateNode)}catch(v){ft(u,i,v)}else try{St.removeChild(u.stateNode)}catch(v){ft(u,i,v)}break;case 18:St!==null&&(cn?(r=St,L2(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,u.stateNode),hs(r)):L2(St,u.stateNode));break;case 4:m=St,b=cn,St=u.stateNode.containerInfo,cn=!0,Hr(r,i,u),St=m,cn=b;break;case 0:case 11:case 14:case 15:xa(2,u,i),It||xa(4,u,i),Hr(r,i,u);break;case 1:It||(cr(u,i),m=u.stateNode,typeof m.componentWillUnmount=="function"&&Dw(u,i,m)),Hr(r,i,u);break;case 21:Hr(r,i,u);break;case 22:It=(m=It)||u.memoizedState!==null,Hr(r,i,u),It=m;break;default:Hr(r,i,u)}}function Fw(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{hs(r)}catch(u){ft(i,i.return,u)}}}function Uw(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{hs(r)}catch(u){ft(i,i.return,u)}}function Y6(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new Iw),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new Iw),i;default:throw Error(a(435,r.tag))}}function ku(r,i){var u=Y6(r);i.forEach(function(m){if(!u.has(m)){u.add(m);var b=nR.bind(null,r,m);m.then(b,b)}})}function dn(r,i){var u=i.deletions;if(u!==null)for(var m=0;m<u.length;m++){var b=u[m],v=r,A=i,U=A;e:for(;U!==null;){switch(U.tag){case 27:if(Sa(U.type)){St=U.stateNode,cn=!1;break e}break;case 5:St=U.stateNode,cn=!1;break e;case 3:case 4:St=U.stateNode.containerInfo,cn=!0;break e}U=U.return}if(St===null)throw Error(a(160));Pw(v,A,b),St=null,cn=!1,v=b.alternate,v!==null&&(v.return=null),b.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)$w(i,r),i=i.sibling}var Yn=null;function $w(r,i){var u=r.alternate,m=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:dn(i,r),fn(r),m&4&&(xa(3,r,r.return),bl(3,r),xa(5,r,r.return));break;case 1:dn(i,r),fn(r),m&512&&(It||u===null||cr(u,u.return)),m&64&&Br&&(r=r.updateQueue,r!==null&&(m=r.callbacks,m!==null&&(u=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=u===null?m:u.concat(m))));break;case 26:var b=Yn;if(dn(i,r),fn(r),m&512&&(It||u===null||cr(u,u.return)),m&4){var v=u!==null?u.memoizedState:null;if(m=r.memoizedState,u===null)if(m===null)if(r.stateNode===null){e:{m=r.type,u=r.memoizedProps,b=b.ownerDocument||b;t:switch(m){case"title":v=b.getElementsByTagName("title")[0],(!v||v[Nr]||v[At]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=b.createElement(m),b.head.insertBefore(v,b.querySelector("head > title"))),Wt(v,m,u),v[At]=r,Et(v),m=v;break e;case"link":var A=$2("link","href",b).get(m+(u.href||""));if(A){for(var U=0;U<A.length;U++)if(v=A[U],v.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&v.getAttribute("rel")===(u.rel==null?null:u.rel)&&v.getAttribute("title")===(u.title==null?null:u.title)&&v.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){A.splice(U,1);break t}}v=b.createElement(m),Wt(v,m,u),b.head.appendChild(v);break;case"meta":if(A=$2("meta","content",b).get(m+(u.content||""))){for(U=0;U<A.length;U++)if(v=A[U],v.getAttribute("content")===(u.content==null?null:""+u.content)&&v.getAttribute("name")===(u.name==null?null:u.name)&&v.getAttribute("property")===(u.property==null?null:u.property)&&v.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&v.getAttribute("charset")===(u.charSet==null?null:u.charSet)){A.splice(U,1);break t}}v=b.createElement(m),Wt(v,m,u),b.head.appendChild(v);break;default:throw Error(a(468,m))}v[At]=r,Et(v),m=v}r.stateNode=m}else G2(b,r.type,r.stateNode);else r.stateNode=U2(b,m,r.memoizedProps);else v!==m?(v===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):v.count--,m===null?G2(b,r.type,r.stateNode):U2(b,m,r.memoizedProps)):m===null&&r.stateNode!==null&&Ff(r,r.memoizedProps,u.memoizedProps)}break;case 27:dn(i,r),fn(r),m&512&&(It||u===null||cr(u,u.return)),u!==null&&m&4&&Ff(r,r.memoizedProps,u.memoizedProps);break;case 5:if(dn(i,r),fn(r),m&512&&(It||u===null||cr(u,u.return)),r.flags&32){b=r.stateNode;try{zi(b,"")}catch(Le){ft(r,r.return,Le)}}m&4&&r.stateNode!=null&&(b=r.memoizedProps,Ff(r,b,u!==null?u.memoizedProps:b)),m&1024&&(Gf=!0);break;case 6:if(dn(i,r),fn(r),m&4){if(r.stateNode===null)throw Error(a(162));m=r.memoizedProps,u=r.stateNode;try{u.nodeValue=m}catch(Le){ft(r,r.return,Le)}}break;case 3:if(Bu=null,b=Yn,Yn=qu(i.containerInfo),dn(i,r),Yn=b,fn(r),m&4&&u!==null&&u.memoizedState.isDehydrated)try{hs(i.containerInfo)}catch(Le){ft(r,r.return,Le)}Gf&&(Gf=!1,Gw(r));break;case 4:m=Yn,Yn=qu(r.stateNode.containerInfo),dn(i,r),fn(r),Yn=m;break;case 12:dn(i,r),fn(r);break;case 31:dn(i,r),fn(r),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,ku(r,m)));break;case 13:dn(i,r),fn(r),r.child.flags&8192&&r.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(_u=ie()),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,ku(r,m)));break;case 22:b=r.memoizedState!==null;var ee=u!==null&&u.memoizedState!==null,ce=Br,ge=It;if(Br=ce||b,It=ge||ee,dn(i,r),It=ge,Br=ce,fn(r),m&8192)e:for(i=r.stateNode,i._visibility=b?i._visibility&-2:i._visibility|1,b&&(u===null||ee||Br||It||li(r)),u=null,i=r;;){if(i.tag===5||i.tag===26){if(u===null){ee=u=i;try{if(v=ee.stateNode,b)A=v.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{U=ee.stateNode;var ve=ee.memoizedProps.style,de=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;U.style.display=de==null||typeof de=="boolean"?"":(""+de).trim()}}catch(Le){ft(ee,ee.return,Le)}}}else if(i.tag===6){if(u===null){ee=i;try{ee.stateNode.nodeValue=b?"":ee.memoizedProps}catch(Le){ft(ee,ee.return,Le)}}}else if(i.tag===18){if(u===null){ee=i;try{var me=ee.stateNode;b?D2(me,!0):D2(ee.stateNode,!1)}catch(Le){ft(ee,ee.return,Le)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;u===i&&(u=null),i=i.return}u===i&&(u=null),i.sibling.return=i.return,i=i.sibling}m&4&&(m=r.updateQueue,m!==null&&(u=m.retryQueue,u!==null&&(m.retryQueue=null,ku(r,u))));break;case 19:dn(i,r),fn(r),m&4&&(m=r.updateQueue,m!==null&&(r.updateQueue=null,ku(r,m)));break;case 30:break;case 21:break;default:dn(i,r),fn(r)}}function fn(r){var i=r.flags;if(i&2){try{for(var u,m=r.return;m!==null;){if(zw(m)){u=m;break}m=m.return}if(u==null)throw Error(a(160));switch(u.tag){case 27:var b=u.stateNode,v=Uf(r);ju(r,v,b);break;case 5:var A=u.stateNode;u.flags&32&&(zi(A,""),u.flags&=-33);var U=Uf(r);ju(r,U,A);break;case 3:case 4:var ee=u.stateNode.containerInfo,ce=Uf(r);$f(r,ce,ee);break;default:throw Error(a(161))}}catch(ge){ft(r,r.return,ge)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Gw(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Gw(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function Pr(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Bw(r,i.alternate,i),i=i.sibling}function li(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:xa(4,i,i.return),li(i);break;case 1:cr(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&Dw(i,i.return,u),li(i);break;case 27:Tl(i.stateNode);case 26:case 5:cr(i,i.return),li(i);break;case 22:i.memoizedState===null&&li(i);break;case 30:li(i);break;default:li(i)}r=r.sibling}}function Fr(r,i,u){for(u=u&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var m=i.alternate,b=r,v=i,A=v.flags;switch(v.tag){case 0:case 11:case 15:Fr(b,v,u),bl(4,v);break;case 1:if(Fr(b,v,u),m=v,b=m.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ce){ft(m,m.return,ce)}if(m=v,b=m.updateQueue,b!==null){var U=m.stateNode;try{var ee=b.shared.hiddenCallbacks;if(ee!==null)for(b.shared.hiddenCallbacks=null,b=0;b<ee.length;b++)j1(ee[b],U)}catch(ce){ft(m,m.return,ce)}}u&&A&64&&Lw(v),vl(v,v.return);break;case 27:qw(v);case 26:case 5:Fr(b,v,u),u&&m===null&&A&4&&Ow(v),vl(v,v.return);break;case 12:Fr(b,v,u);break;case 31:Fr(b,v,u),u&&A&4&&Fw(b,v);break;case 13:Fr(b,v,u),u&&A&4&&Uw(b,v);break;case 22:v.memoizedState===null&&Fr(b,v,u),vl(v,v.return);break;case 30:break;default:Fr(b,v,u)}i=i.sibling}}function Vf(r,i){var u=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==u&&(r!=null&&r.refCount++,u!=null&&sl(u))}function Yf(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&sl(r))}function Xn(r,i,u,m){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Vw(r,i,u,m),i=i.sibling}function Vw(r,i,u,m){var b=i.flags;switch(i.tag){case 0:case 11:case 15:Xn(r,i,u,m),b&2048&&bl(9,i);break;case 1:Xn(r,i,u,m);break;case 3:Xn(r,i,u,m),b&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&sl(r)));break;case 12:if(b&2048){Xn(r,i,u,m),r=i.stateNode;try{var v=i.memoizedProps,A=v.id,U=v.onPostCommit;typeof U=="function"&&U(A,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(ee){ft(i,i.return,ee)}}else Xn(r,i,u,m);break;case 31:Xn(r,i,u,m);break;case 13:Xn(r,i,u,m);break;case 23:break;case 22:v=i.stateNode,A=i.alternate,i.memoizedState!==null?v._visibility&2?Xn(r,i,u,m):wl(r,i):v._visibility&2?Xn(r,i,u,m):(v._visibility|=2,ns(r,i,u,m,(i.subtreeFlags&10256)!==0||!1)),b&2048&&Vf(A,i);break;case 24:Xn(r,i,u,m),b&2048&&Yf(i.alternate,i);break;default:Xn(r,i,u,m)}}function ns(r,i,u,m,b){for(b=b&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,A=i,U=u,ee=m,ce=A.flags;switch(A.tag){case 0:case 11:case 15:ns(v,A,U,ee,b),bl(8,A);break;case 23:break;case 22:var ge=A.stateNode;A.memoizedState!==null?ge._visibility&2?ns(v,A,U,ee,b):wl(v,A):(ge._visibility|=2,ns(v,A,U,ee,b)),b&&ce&2048&&Vf(A.alternate,A);break;case 24:ns(v,A,U,ee,b),b&&ce&2048&&Yf(A.alternate,A);break;default:ns(v,A,U,ee,b)}i=i.sibling}}function wl(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var u=r,m=i,b=m.flags;switch(m.tag){case 22:wl(u,m),b&2048&&Vf(m.alternate,m);break;case 24:wl(u,m),b&2048&&Yf(m.alternate,m);break;default:wl(u,m)}i=i.sibling}}var jl=8192;function rs(r,i,u){if(r.subtreeFlags&jl)for(r=r.child;r!==null;)Yw(r,i,u),r=r.sibling}function Yw(r,i,u){switch(r.tag){case 26:rs(r,i,u),r.flags&jl&&r.memoizedState!==null&&LR(u,Yn,r.memoizedState,r.memoizedProps);break;case 5:rs(r,i,u);break;case 3:case 4:var m=Yn;Yn=qu(r.stateNode.containerInfo),rs(r,i,u),Yn=m;break;case 22:r.memoizedState===null&&(m=r.alternate,m!==null&&m.memoizedState!==null?(m=jl,jl=16777216,rs(r,i,u),jl=m):rs(r,i,u));break;default:rs(r,i,u)}}function Xw(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function kl(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var m=i[u];Vt=m,Ww(m,r)}Xw(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Kw(r),r=r.sibling}function Kw(r){switch(r.tag){case 0:case 11:case 15:kl(r),r.flags&2048&&xa(9,r,r.return);break;case 3:kl(r);break;case 12:kl(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Su(r)):kl(r);break;default:kl(r)}}function Su(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var m=i[u];Vt=m,Ww(m,r)}Xw(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:xa(8,i,i.return),Su(i);break;case 22:u=i.stateNode,u._visibility&2&&(u._visibility&=-3,Su(i));break;default:Su(i)}r=r.sibling}}function Ww(r,i){for(;Vt!==null;){var u=Vt;switch(u.tag){case 0:case 11:case 15:xa(8,u,i);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var m=u.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:sl(u.memoizedState.cache)}if(m=u.child,m!==null)m.return=u,Vt=m;else e:for(u=r;Vt!==null;){m=Vt;var b=m.sibling,v=m.return;if(Hw(m),m===u){Vt=null;break e}if(b!==null){b.return=v,Vt=b;break e}Vt=v}}}var X6={getCacheForType:function(r){var i=Xt(Ot),u=i.data.get(r);return u===void 0&&(u=r(),i.data.set(r,u)),u},cacheSignal:function(){return Xt(Ot).controller.signal}},K6=typeof WeakMap=="function"?WeakMap:Map,ct=0,bt=null,We=null,Je=0,dt=0,kn=null,ya=!1,as=!1,Xf=!1,Ur=0,Rt=0,ba=0,oi=0,Kf=0,Sn=0,is=0,Sl=null,hn=null,Wf=!1,_u=0,Qw=0,Nu=1/0,Cu=null,va=null,$t=0,wa=null,ss=null,$r=0,Qf=0,Zf=null,Zw=null,_l=0,Jf=null;function _n(){return(ct&2)!==0&&Je!==0?Je&-Je:D.T!==null?ih():Ri()}function Jw(){if(Sn===0)if((Je&536870912)===0||nt){var r=Re;Re<<=1,(Re&3932160)===0&&(Re=262144),Sn=r}else Sn=536870912;return r=wn.current,r!==null&&(r.flags|=32),Sn}function mn(r,i,u){(r===bt&&(dt===2||dt===9)||r.cancelPendingCommit!==null)&&(ls(r,0),ja(r,Je,Sn,!1)),Sr(r,u),((ct&2)===0||r!==bt)&&(r===bt&&((ct&2)===0&&(oi|=u),Rt===4&&ja(r,Je,Sn,!1)),dr(r))}function e2(r,i,u){if((ct&6)!==0)throw Error(a(327));var m=!u&&(i&127)===0&&(i&r.expiredLanes)===0||kr(r,i),b=m?Z6(r,i):th(r,i,!0),v=m;do{if(b===0){as&&!m&&ja(r,i,0,!1);break}else{if(u=r.current.alternate,v&&!W6(u)){b=th(r,i,!1),v=!1;continue}if(b===2){if(v=i,r.errorRecoveryDisabledLanes&v)var A=0;else A=r.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){i=A;e:{var U=r;b=Sl;var ee=U.current.memoizedState.isDehydrated;if(ee&&(ls(U,A).flags|=256),A=th(U,A,!1),A!==2){if(Xf&&!ee){U.errorRecoveryDisabledLanes|=v,oi|=v,b=4;break e}v=hn,hn=b,v!==null&&(hn===null?hn=v:hn.push.apply(hn,v))}b=A}if(v=!1,b!==2)continue}}if(b===1){ls(r,0),ja(r,i,0,!0);break}e:{switch(m=r,v=b,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:ja(m,i,Sn,!ya);break e;case 2:hn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(b=_u+300-ie(),10<b)){if(ja(m,i,Sn,!ya),ra(m,0,!0)!==0)break e;$r=i,m.timeoutHandle=M2(t2.bind(null,m,u,hn,Cu,Wf,i,Sn,oi,is,ya,v,"Throttled",-0,0),b);break e}t2(m,u,hn,Cu,Wf,i,Sn,oi,is,ya,v,null,-0,0)}}break}while(!0);dr(r)}function t2(r,i,u,m,b,v,A,U,ee,ce,ge,ve,de,me){if(r.timeoutHandle=-1,ve=i.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Tr},Yw(i,v,ve);var Le=(v&62914560)===v?_u-ie():(v&4194048)===v?Qw-ie():0;if(Le=DR(ve,Le),Le!==null){$r=v,r.cancelPendingCommit=Le(u2.bind(null,r,i,v,u,m,b,A,U,ee,ge,ve,null,de,me)),ja(r,v,A,!ce);return}}u2(r,i,v,u,m,b,A,U,ee)}function W6(r){for(var i=r;;){var u=i.tag;if((u===0||u===11||u===15)&&i.flags&16384&&(u=i.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var m=0;m<u.length;m++){var b=u[m],v=b.getSnapshot;b=b.value;try{if(!bn(v(),b))return!1}catch{return!1}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ja(r,i,u,m){i&=~Kf,i&=~oi,r.suspendedLanes|=i,r.pingedLanes&=~i,m&&(r.warmLanes|=i),m=r.expirationTimes;for(var b=i;0<b;){var v=31-ut(b),A=1<<v;m[v]=-1,b&=~A}u!==0&&Ti(r,u,i)}function Eu(){return(ct&6)===0?(Nl(0),!1):!0}function eh(){if(We!==null){if(dt===0)var r=We.return;else r=We,Lr=Ja=null,gf(r),Qi=null,ol=0,r=We;for(;r!==null;)Rw(r.alternate,r),r=r.return;We=null}}function ls(r,i){var u=r.timeoutHandle;u!==-1&&(r.timeoutHandle=-1,gR(u)),u=r.cancelPendingCommit,u!==null&&(r.cancelPendingCommit=null,u()),$r=0,eh(),bt=r,We=u=Mr(r.current,null),Je=i,dt=0,kn=null,ya=!1,as=kr(r,i),Xf=!1,is=Sn=Kf=oi=ba=Rt=0,hn=Sl=null,Wf=!1,(i&8)!==0&&(i|=i&32);var m=r.entangledLanes;if(m!==0)for(r=r.entanglements,m&=i;0<m;){var b=31-ut(m),v=1<<b;i|=r[b],m&=~v}return Ur=i,Ko(),u}function n2(r,i){Ve=null,D.H=gl,i===Wi||i===ru?(i=y1(),dt=3):i===rf?(i=y1(),dt=4):dt=i===Rf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,kn=i,We===null&&(Rt=1,xu(r,Rn(i,r.current)))}function r2(){var r=wn.current;return r===null?!0:(Je&4194048)===Je?zn===null:(Je&62914560)===Je||(Je&536870912)!==0?r===zn:!1}function a2(){var r=D.H;return D.H=gl,r===null?gl:r}function i2(){var r=D.A;return D.A=X6,r}function Tu(){Rt=4,ya||(Je&4194048)!==Je&&wn.current!==null||(as=!0),(ba&134217727)===0&&(oi&134217727)===0||bt===null||ja(bt,Je,Sn,!1)}function th(r,i,u){var m=ct;ct|=2;var b=a2(),v=i2();(bt!==r||Je!==i)&&(Cu=null,ls(r,i)),i=!1;var A=Rt;e:do try{if(dt!==0&&We!==null){var U=We,ee=kn;switch(dt){case 8:eh(),A=6;break e;case 3:case 2:case 9:case 6:wn.current===null&&(i=!0);var ce=dt;if(dt=0,kn=null,os(r,U,ee,ce),u&&as){A=0;break e}break;default:ce=dt,dt=0,kn=null,os(r,U,ee,ce)}}Q6(),A=Rt;break}catch(ge){n2(r,ge)}while(!0);return i&&r.shellSuspendCounter++,Lr=Ja=null,ct=m,D.H=b,D.A=v,We===null&&(bt=null,Je=0,Ko()),A}function Q6(){for(;We!==null;)s2(We)}function Z6(r,i){var u=ct;ct|=2;var m=a2(),b=i2();bt!==r||Je!==i?(Cu=null,Nu=ie()+500,ls(r,i)):as=kr(r,i);e:do try{if(dt!==0&&We!==null){i=We;var v=kn;t:switch(dt){case 1:dt=0,kn=null,os(r,i,v,1);break;case 2:case 9:if(g1(v)){dt=0,kn=null,l2(i);break}i=function(){dt!==2&&dt!==9||bt!==r||(dt=7),dr(r)},v.then(i,i);break e;case 3:dt=7;break e;case 4:dt=5;break e;case 7:g1(v)?(dt=0,kn=null,l2(i)):(dt=0,kn=null,os(r,i,v,7));break;case 5:var A=null;switch(We.tag){case 26:A=We.memoizedState;case 5:case 27:var U=We;if(A?V2(A):U.stateNode.complete){dt=0,kn=null;var ee=U.sibling;if(ee!==null)We=ee;else{var ce=U.return;ce!==null?(We=ce,Au(ce)):We=null}break t}}dt=0,kn=null,os(r,i,v,5);break;case 6:dt=0,kn=null,os(r,i,v,6);break;case 8:eh(),Rt=6;break e;default:throw Error(a(462))}}J6();break}catch(ge){n2(r,ge)}while(!0);return Lr=Ja=null,D.H=m,D.A=b,ct=u,We!==null?0:(bt=null,Je=0,Ko(),Rt)}function J6(){for(;We!==null&&!De();)s2(We)}function s2(r){var i=Aw(r.alternate,r,Ur);r.memoizedProps=r.pendingProps,i===null?Au(r):We=i}function l2(r){var i=r,u=i.alternate;switch(i.tag){case 15:case 0:i=Sw(u,i,i.pendingProps,i.type,void 0,Je);break;case 11:i=Sw(u,i,i.pendingProps,i.type.render,i.ref,Je);break;case 5:gf(i);default:Rw(u,i),i=We=i1(i,Ur),i=Aw(u,i,Ur)}r.memoizedProps=r.pendingProps,i===null?Au(r):We=i}function os(r,i,u,m){Lr=Ja=null,gf(i),Qi=null,ol=0;var b=i.return;try{if(P6(r,b,i,u,Je)){Rt=1,xu(r,Rn(u,r.current)),We=null;return}}catch(v){if(b!==null)throw We=b,v;Rt=1,xu(r,Rn(u,r.current)),We=null;return}i.flags&32768?(nt||m===1?r=!0:as||(Je&536870912)!==0?r=!1:(ya=r=!0,(m===2||m===9||m===3||m===6)&&(m=wn.current,m!==null&&m.tag===13&&(m.flags|=16384))),o2(i,r)):Au(i)}function Au(r){var i=r;do{if((i.flags&32768)!==0){o2(i,ya);return}r=i.return;var u=$6(i.alternate,i,Ur);if(u!==null){We=u;return}if(i=i.sibling,i!==null){We=i;return}We=i=r}while(i!==null);Rt===0&&(Rt=5)}function o2(r,i){do{var u=G6(r.alternate,r);if(u!==null){u.flags&=32767,We=u;return}if(u=r.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!i&&(r=r.sibling,r!==null)){We=r;return}We=r=u}while(r!==null);Rt=6,We=null}function u2(r,i,u,m,b,v,A,U,ee){r.cancelPendingCommit=null;do Mu();while($t!==0);if((ct&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=Fd,aa(r,u,v,A,U,ee),r===bt&&(We=bt=null,Je=0),ss=i,wa=r,$r=u,Qf=v,Zf=b,Zw=m,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,rR(be,function(){return m2(),null})):(r.callbackNode=null,r.callbackPriority=0),m=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||m){m=D.T,D.T=null,b=X.p,X.p=2,A=ct,ct|=4;try{V6(r,i,u)}finally{ct=A,X.p=b,D.T=m}}$t=1,c2(),d2(),f2()}}function c2(){if($t===1){$t=0;var r=wa,i=ss,u=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||u){u=D.T,D.T=null;var m=X.p;X.p=2;var b=ct;ct|=4;try{$w(i,r);var v=hh,A=Wv(r.containerInfo),U=v.focusedElem,ee=v.selectionRange;if(A!==U&&U&&U.ownerDocument&&Kv(U.ownerDocument.documentElement,U)){if(ee!==null&&qd(U)){var ce=ee.start,ge=ee.end;if(ge===void 0&&(ge=ce),"selectionStart"in U)U.selectionStart=ce,U.selectionEnd=Math.min(ge,U.value.length);else{var ve=U.ownerDocument||document,de=ve&&ve.defaultView||window;if(de.getSelection){var me=de.getSelection(),Le=U.textContent.length,Fe=Math.min(ee.start,Le),xt=ee.end===void 0?Fe:Math.min(ee.end,Le);!me.extend&&Fe>xt&&(A=xt,xt=Fe,Fe=A);var le=Xv(U,Fe),re=Xv(U,xt);if(le&&re&&(me.rangeCount!==1||me.anchorNode!==le.node||me.anchorOffset!==le.offset||me.focusNode!==re.node||me.focusOffset!==re.offset)){var ue=ve.createRange();ue.setStart(le.node,le.offset),me.removeAllRanges(),Fe>xt?(me.addRange(ue),me.extend(re.node,re.offset)):(ue.setEnd(re.node,re.offset),me.addRange(ue))}}}}for(ve=[],me=U;me=me.parentNode;)me.nodeType===1&&ve.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<ve.length;U++){var ye=ve[U];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}Uu=!!fh,hh=fh=null}finally{ct=b,X.p=m,D.T=u}}r.current=i,$t=2}}function d2(){if($t===2){$t=0;var r=wa,i=ss,u=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||u){u=D.T,D.T=null;var m=X.p;X.p=2;var b=ct;ct|=4;try{Bw(r,i.alternate,i)}finally{ct=b,X.p=m,D.T=u}}$t=3}}function f2(){if($t===4||$t===3){$t=0,Be();var r=wa,i=ss,u=$r,m=Zw;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?$t=5:($t=0,ss=wa=null,h2(r,r.pendingLanes));var b=r.pendingLanes;if(b===0&&(va=null),Fa(u),i=i.stateNode,st&&typeof st.onCommitFiberRoot=="function")try{st.onCommitFiberRoot(tt,i,void 0,(i.current.flags&128)===128)}catch{}if(m!==null){i=D.T,b=X.p,X.p=2,D.T=null;try{for(var v=r.onRecoverableError,A=0;A<m.length;A++){var U=m[A];v(U.value,{componentStack:U.stack})}}finally{D.T=i,X.p=b}}($r&3)!==0&&Mu(),dr(r),b=r.pendingLanes,(u&261930)!==0&&(b&42)!==0?r===Jf?_l++:(_l=0,Jf=r):_l=0,Nl(0)}}function h2(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,sl(i)))}function Mu(){return c2(),d2(),f2(),m2()}function m2(){if($t!==5)return!1;var r=wa,i=Qf;Qf=0;var u=Fa($r),m=D.T,b=X.p;try{X.p=32>u?32:u,D.T=null,u=Zf,Zf=null;var v=wa,A=$r;if($t=0,ss=wa=null,$r=0,(ct&6)!==0)throw Error(a(331));var U=ct;if(ct|=4,Kw(v.current),Vw(v,v.current,A,u),ct=U,Nl(0,!1),st&&typeof st.onPostCommitFiberRoot=="function")try{st.onPostCommitFiberRoot(tt,v)}catch{}return!0}finally{X.p=b,D.T=m,h2(r,i)}}function p2(r,i,u){i=Rn(u,i),i=Mf(r.stateNode,i,2),r=ma(r,i,2),r!==null&&(Sr(r,2),dr(r))}function ft(r,i,u){if(r.tag===3)p2(r,r,u);else for(;i!==null;){if(i.tag===3){p2(i,r,u);break}else if(i.tag===1){var m=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(va===null||!va.has(m))){r=Rn(u,r),u=gw(2),m=ma(i,u,2),m!==null&&(xw(u,m,i,r),Sr(m,2),dr(m));break}}i=i.return}}function nh(r,i,u){var m=r.pingCache;if(m===null){m=r.pingCache=new K6;var b=new Set;m.set(i,b)}else b=m.get(i),b===void 0&&(b=new Set,m.set(i,b));b.has(u)||(Xf=!0,b.add(u),r=eR.bind(null,r,i,u),i.then(r,r))}function eR(r,i,u){var m=r.pingCache;m!==null&&m.delete(i),r.pingedLanes|=r.suspendedLanes&u,r.warmLanes&=~u,bt===r&&(Je&u)===u&&(Rt===4||Rt===3&&(Je&62914560)===Je&&300>ie()-_u?(ct&2)===0&&ls(r,0):Kf|=u,is===Je&&(is=0)),dr(r)}function g2(r,i){i===0&&(i=Ei()),r=Wa(r,i),r!==null&&(Sr(r,i),dr(r))}function tR(r){var i=r.memoizedState,u=0;i!==null&&(u=i.retryLane),g2(r,u)}function nR(r,i){var u=0;switch(r.tag){case 31:case 13:var m=r.stateNode,b=r.memoizedState;b!==null&&(u=b.retryLane);break;case 19:m=r.stateNode;break;case 22:m=r.stateNode._retryCache;break;default:throw Error(a(314))}m!==null&&m.delete(i),g2(r,u)}function rR(r,i){return Me(r,i)}var Ru=null,us=null,rh=!1,Lu=!1,ah=!1,ka=0;function dr(r){r!==us&&r.next===null&&(us===null?Ru=us=r:us=us.next=r),Lu=!0,rh||(rh=!0,iR())}function Nl(r,i){if(!ah&&Lu){ah=!0;do for(var u=!1,m=Ru;m!==null;){if(r!==0){var b=m.pendingLanes;if(b===0)var v=0;else{var A=m.suspendedLanes,U=m.pingedLanes;v=(1<<31-ut(42|r)+1)-1,v&=b&~(A&~U),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(u=!0,v2(m,v))}else v=Je,v=ra(m,m===bt?v:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(v&3)===0||kr(m,v)||(u=!0,v2(m,v));m=m.next}while(u);ah=!1}}function aR(){x2()}function x2(){Lu=rh=!1;var r=0;ka!==0&&pR()&&(r=ka);for(var i=ie(),u=null,m=Ru;m!==null;){var b=m.next,v=y2(m,i);v===0?(m.next=null,u===null?Ru=b:u.next=b,b===null&&(us=u)):(u=m,(r!==0||(v&3)!==0)&&(Lu=!0)),m=b}$t!==0&&$t!==5||Nl(r),ka!==0&&(ka=0)}function y2(r,i){for(var u=r.suspendedLanes,m=r.pingedLanes,b=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var A=31-ut(v),U=1<<A,ee=b[A];ee===-1?((U&u)===0||(U&m)!==0)&&(b[A]=Gs(U,i)):ee<=i&&(r.expiredLanes|=U),v&=~U}if(i=bt,u=Je,u=ra(r,r===i?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),m=r.callbackNode,u===0||r===i&&(dt===2||dt===9)||r.cancelPendingCommit!==null)return m!==null&&m!==null&&we(m),r.callbackNode=null,r.callbackPriority=0;if((u&3)===0||kr(r,u)){if(i=u&-u,i===r.callbackPriority)return i;switch(m!==null&&we(m),Fa(u)){case 2:case 8:u=fe;break;case 32:u=be;break;case 268435456:u=Oe;break;default:u=be}return m=b2.bind(null,r),u=Me(u,m),r.callbackPriority=i,r.callbackNode=u,i}return m!==null&&m!==null&&we(m),r.callbackPriority=2,r.callbackNode=null,2}function b2(r,i){if($t!==0&&$t!==5)return r.callbackNode=null,r.callbackPriority=0,null;var u=r.callbackNode;if(Mu()&&r.callbackNode!==u)return null;var m=Je;return m=ra(r,r===bt?m:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),m===0?null:(e2(r,m,i),y2(r,ie()),r.callbackNode!=null&&r.callbackNode===u?b2.bind(null,r):null)}function v2(r,i){if(Mu())return null;e2(r,i,!0)}function iR(){xR(function(){(ct&6)!==0?Me(J,aR):x2()})}function ih(){if(ka===0){var r=Xi;r===0&&(r=jr,jr<<=1,(jr&261888)===0&&(jr=256)),ka=r}return ka}function w2(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Po(""+r)}function j2(r,i){var u=i.ownerDocument.createElement("input");return u.name=i.name,u.value=i.value,r.id&&u.setAttribute("form",r.id),i.parentNode.insertBefore(u,i),r=new FormData(r),u.parentNode.removeChild(u),r}function sR(r,i,u,m,b){if(i==="submit"&&u&&u.stateNode===b){var v=w2((b[Gt]||null).action),A=m.submitter;A&&(i=(i=A[Gt]||null)?w2(i.formAction):A.getAttribute("formAction"),i!==null&&(v=i,A=null));var U=new Go("action","action",null,m,b);r.push({event:U,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(ka!==0){var ee=A?j2(b,A):new FormData(b);_f(u,{pending:!0,data:ee,method:b.method,action:v},null,ee)}}else typeof v=="function"&&(U.preventDefault(),ee=A?j2(b,A):new FormData(b),_f(u,{pending:!0,data:ee,method:b.method,action:v},v,ee))},currentTarget:b}]})}}for(var sh=0;sh<Pd.length;sh++){var lh=Pd[sh],lR=lh.toLowerCase(),oR=lh[0].toUpperCase()+lh.slice(1);Vn(lR,"on"+oR)}Vn(Jv,"onAnimationEnd"),Vn(e1,"onAnimationIteration"),Vn(t1,"onAnimationStart"),Vn("dblclick","onDoubleClick"),Vn("focusin","onFocus"),Vn("focusout","onBlur"),Vn(S6,"onTransitionRun"),Vn(_6,"onTransitionStart"),Vn(N6,"onTransitionCancel"),Vn(n1,"onTransitionEnd"),Ke("onMouseEnter",["mouseout","mouseover"]),Ke("onMouseLeave",["mouseout","mouseover"]),Ke("onPointerEnter",["pointerout","pointerover"]),Ke("onPointerLeave",["pointerout","pointerover"]),Ge("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ge("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ge("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ge("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ge("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ge("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Cl="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(" "),uR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Cl));function k2(r,i){i=(i&4)!==0;for(var u=0;u<r.length;u++){var m=r[u],b=m.event;m=m.listeners;e:{var v=void 0;if(i)for(var A=m.length-1;0<=A;A--){var U=m[A],ee=U.instance,ce=U.currentTarget;if(U=U.listener,ee!==v&&b.isPropagationStopped())break e;v=U,b.currentTarget=ce;try{v(b)}catch(ge){Xo(ge)}b.currentTarget=null,v=ee}else for(A=0;A<m.length;A++){if(U=m[A],ee=U.instance,ce=U.currentTarget,U=U.listener,ee!==v&&b.isPropagationStopped())break e;v=U,b.currentTarget=ce;try{v(b)}catch(ge){Xo(ge)}b.currentTarget=null,v=ee}}}}function Qe(r,i){var u=i[sn];u===void 0&&(u=i[sn]=new Set);var m=r+"__bubble";u.has(m)||(S2(i,r,2,!1),u.add(m))}function oh(r,i,u){var m=0;i&&(m|=4),S2(u,r,m,i)}var Du="_reactListening"+Math.random().toString(36).slice(2);function uh(r){if(!r[Du]){r[Du]=!0,$a.forEach(function(u){u!=="selectionchange"&&(uR.has(u)||oh(u,!1,r),oh(u,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[Du]||(i[Du]=!0,oh("selectionchange",!1,i))}}function S2(r,i,u,m){switch(J2(i)){case 2:var b=qR;break;case 8:b=IR;break;default:b=Sh}u=b.bind(null,i,u,r),b=void 0,!Ed||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(b=!0),m?b!==void 0?r.addEventListener(i,u,{capture:!0,passive:b}):r.addEventListener(i,u,!0):b!==void 0?r.addEventListener(i,u,{passive:b}):r.addEventListener(i,u,!1)}function ch(r,i,u,m,b){var v=m;if((i&1)===0&&(i&2)===0&&m!==null)e:for(;;){if(m===null)return;var A=m.tag;if(A===3||A===4){var U=m.stateNode.containerInfo;if(U===b)break;if(A===4)for(A=m.return;A!==null;){var ee=A.tag;if((ee===3||ee===4)&&A.stateNode.containerInfo===b)return;A=A.return}for(;U!==null;){if(A=ar(U),A===null)return;if(ee=A.tag,ee===5||ee===6||ee===26||ee===27){m=v=A;continue e}U=U.parentNode}}m=m.return}Tv(function(){var ce=v,ge=Nd(u),ve=[];e:{var de=r1.get(r);if(de!==void 0){var me=Go,Le=r;switch(r){case"keypress":if(Uo(u)===0)break e;case"keydown":case"keyup":me=n6;break;case"focusin":Le="focus",me=Rd;break;case"focusout":Le="blur",me=Rd;break;case"beforeblur":case"afterblur":me=Rd;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=Rv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=$M;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=i6;break;case Jv:case e1:case t1:me=YM;break;case n1:me=l6;break;case"scroll":case"scrollend":me=FM;break;case"wheel":me=u6;break;case"copy":case"cut":case"paste":me=KM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Dv;break;case"toggle":case"beforetoggle":me=d6}var Fe=(i&4)!==0,xt=!Fe&&(r==="scroll"||r==="scrollend"),le=Fe?de!==null?de+"Capture":null:de;Fe=[];for(var re=ce,ue;re!==null;){var ye=re;if(ue=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||ue===null||le===null||(ye=Ks(re,le),ye!=null&&Fe.push(El(re,ye,ue))),xt)break;re=re.return}0<Fe.length&&(de=new me(de,Le,null,u,ge),ve.push({event:de,listeners:Fe}))}}if((i&7)===0){e:{if(de=r==="mouseover"||r==="pointerover",me=r==="mouseout"||r==="pointerout",de&&u!==_d&&(Le=u.relatedTarget||u.fromElement)&&(ar(Le)||Le[Qt]))break e;if((me||de)&&(de=ge.window===ge?ge:(de=ge.ownerDocument)?de.defaultView||de.parentWindow:window,me?(Le=u.relatedTarget||u.toElement,me=ce,Le=Le?ar(Le):null,Le!==null&&(xt=l(Le),Fe=Le.tag,Le!==xt||Fe!==5&&Fe!==27&&Fe!==6)&&(Le=null)):(me=null,Le=ce),me!==Le)){if(Fe=Rv,ye="onMouseLeave",le="onMouseEnter",re="mouse",(r==="pointerout"||r==="pointerover")&&(Fe=Dv,ye="onPointerLeave",le="onPointerEnter",re="pointer"),xt=me==null?de:sr(me),ue=Le==null?de:sr(Le),de=new Fe(ye,re+"leave",me,u,ge),de.target=xt,de.relatedTarget=ue,ye=null,ar(ge)===ce&&(Fe=new Fe(le,re+"enter",Le,u,ge),Fe.target=ue,Fe.relatedTarget=xt,ye=Fe),xt=ye,me&&Le)t:{for(Fe=cR,le=me,re=Le,ue=0,ye=le;ye;ye=Fe(ye))ue++;ye=0;for(var He=re;He;He=Fe(He))ye++;for(;0<ue-ye;)le=Fe(le),ue--;for(;0<ye-ue;)re=Fe(re),ye--;for(;ue--;){if(le===re||re!==null&&le===re.alternate){Fe=le;break t}le=Fe(le),re=Fe(re)}Fe=null}else Fe=null;me!==null&&_2(ve,de,me,Fe,!1),Le!==null&&xt!==null&&_2(ve,xt,Le,Fe,!0)}}e:{if(de=ce?sr(ce):window,me=de.nodeName&&de.nodeName.toLowerCase(),me==="select"||me==="input"&&de.type==="file")var lt=Fv;else if(Hv(de))if(Uv)lt=w6;else{lt=b6;var ze=y6}else me=de.nodeName,!me||me.toLowerCase()!=="input"||de.type!=="checkbox"&&de.type!=="radio"?ce&&Sd(ce.elementType)&&(lt=Fv):lt=v6;if(lt&&(lt=lt(r,ce))){Pv(ve,lt,u,ge);break e}ze&&ze(r,de,ce),r==="focusout"&&ce&&de.type==="number"&&ce.memoizedProps.value!=null&&Xs(de,"number",de.value)}switch(ze=ce?sr(ce):window,r){case"focusin":(Hv(ze)||ze.contentEditable==="true")&&(Hi=ze,Id=ce,rl=null);break;case"focusout":rl=Id=Hi=null;break;case"mousedown":Bd=!0;break;case"contextmenu":case"mouseup":case"dragend":Bd=!1,Qv(ve,u,ge);break;case"selectionchange":if(k6)break;case"keydown":case"keyup":Qv(ve,u,ge)}var Ye;if(Dd)e:{switch(r){case"compositionstart":var et="onCompositionStart";break e;case"compositionend":et="onCompositionEnd";break e;case"compositionupdate":et="onCompositionUpdate";break e}et=void 0}else Bi?Iv(r,u)&&(et="onCompositionEnd"):r==="keydown"&&u.keyCode===229&&(et="onCompositionStart");et&&(Ov&&u.locale!=="ko"&&(Bi||et!=="onCompositionStart"?et==="onCompositionEnd"&&Bi&&(Ye=Av()):(la=ge,Td="value"in la?la.value:la.textContent,Bi=!0)),ze=Ou(ce,et),0<ze.length&&(et=new Lv(et,r,null,u,ge),ve.push({event:et,listeners:ze}),Ye?et.data=Ye:(Ye=Bv(u),Ye!==null&&(et.data=Ye)))),(Ye=h6?m6(r,u):p6(r,u))&&(et=Ou(ce,"onBeforeInput"),0<et.length&&(ze=new Lv("onBeforeInput","beforeinput",null,u,ge),ve.push({event:ze,listeners:et}),ze.data=Ye)),sR(ve,r,ce,u,ge)}k2(ve,i)})}function El(r,i,u){return{instance:r,listener:i,currentTarget:u}}function Ou(r,i){for(var u=i+"Capture",m=[];r!==null;){var b=r,v=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||v===null||(b=Ks(r,u),b!=null&&m.unshift(El(r,b,v)),b=Ks(r,i),b!=null&&m.push(El(r,b,v))),r.tag===3)return m;r=r.return}return[]}function cR(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function _2(r,i,u,m,b){for(var v=i._reactName,A=[];u!==null&&u!==m;){var U=u,ee=U.alternate,ce=U.stateNode;if(U=U.tag,ee!==null&&ee===m)break;U!==5&&U!==26&&U!==27||ce===null||(ee=ce,b?(ce=Ks(u,v),ce!=null&&A.unshift(El(u,ce,ee))):b||(ce=Ks(u,v),ce!=null&&A.push(El(u,ce,ee)))),u=u.return}A.length!==0&&r.push({event:i,listeners:A})}var dR=/\r\n?/g,fR=/\u0000|\uFFFD/g;function N2(r){return(typeof r=="string"?r:""+r).replace(dR,`
49
+ `).replace(fR,"")}function C2(r,i){return i=N2(i),N2(r)===i}function gt(r,i,u,m,b,v){switch(u){case"children":typeof m=="string"?i==="body"||i==="textarea"&&m===""||zi(r,m):(typeof m=="number"||typeof m=="bigint")&&i!=="body"&&zi(r,""+m);break;case"className":Oi(r,"class",m);break;case"tabIndex":Oi(r,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Oi(r,u,m);break;case"style":Cv(r,m,v);break;case"data":if(i!=="object"){Oi(r,"data",m);break}case"src":case"href":if(m===""&&(i!=="a"||u!=="href")){r.removeAttribute(u);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){r.removeAttribute(u);break}m=Po(""+m),r.setAttribute(u,m);break;case"action":case"formAction":if(typeof m=="function"){r.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(u==="formAction"?(i!=="input"&&gt(r,i,"name",b.name,b,null),gt(r,i,"formEncType",b.formEncType,b,null),gt(r,i,"formMethod",b.formMethod,b,null),gt(r,i,"formTarget",b.formTarget,b,null)):(gt(r,i,"encType",b.encType,b,null),gt(r,i,"method",b.method,b,null),gt(r,i,"target",b.target,b,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){r.removeAttribute(u);break}m=Po(""+m),r.setAttribute(u,m);break;case"onClick":m!=null&&(r.onclick=Tr);break;case"onScroll":m!=null&&Qe("scroll",r);break;case"onScrollEnd":m!=null&&Qe("scrollend",r);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(a(61));if(u=m.__html,u!=null){if(b.children!=null)throw Error(a(60));r.innerHTML=u}}break;case"multiple":r.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":r.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){r.removeAttribute("xlink:href");break}u=Po(""+m),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(u,""+m):r.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(u,""):r.removeAttribute(u);break;case"capture":case"download":m===!0?r.setAttribute(u,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?r.setAttribute(u,m):r.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?r.setAttribute(u,m):r.removeAttribute(u);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?r.removeAttribute(u):r.setAttribute(u,m);break;case"popover":Qe("beforetoggle",r),Qe("toggle",r),Cr(r,"popover",m);break;case"xlinkActuate":Gn(r,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":Gn(r,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":Gn(r,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":Gn(r,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":Gn(r,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":Gn(r,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":Gn(r,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":Gn(r,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":Gn(r,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Cr(r,"is",m);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=HM.get(u)||u,Cr(r,u,m))}}function dh(r,i,u,m,b,v){switch(u){case"style":Cv(r,m,v);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(a(61));if(u=m.__html,u!=null){if(b.children!=null)throw Error(a(60));r.innerHTML=u}}break;case"children":typeof m=="string"?zi(r,m):(typeof m=="number"||typeof m=="bigint")&&zi(r,""+m);break;case"onScroll":m!=null&&Qe("scroll",r);break;case"onScrollEnd":m!=null&&Qe("scrollend",r);break;case"onClick":m!=null&&(r.onclick=Tr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!pe.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(b=u.endsWith("Capture"),i=u.slice(2,b?u.length-7:void 0),v=r[Gt]||null,v=v!=null?v[u]:null,typeof v=="function"&&r.removeEventListener(i,v,b),typeof m=="function")){typeof v!="function"&&v!==null&&(u in r?r[u]=null:r.hasAttribute(u)&&r.removeAttribute(u)),r.addEventListener(i,m,b);break e}u in r?r[u]=m:m===!0?r.setAttribute(u,""):Cr(r,u,m)}}}function Wt(r,i,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",r),Qe("load",r);var m=!1,b=!1,v;for(v in u)if(u.hasOwnProperty(v)){var A=u[v];if(A!=null)switch(v){case"src":m=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:gt(r,i,v,A,u,null)}}b&&gt(r,i,"srcSet",u.srcSet,u,null),m&&gt(r,i,"src",u.src,u,null);return;case"input":Qe("invalid",r);var U=v=A=b=null,ee=null,ce=null;for(m in u)if(u.hasOwnProperty(m)){var ge=u[m];if(ge!=null)switch(m){case"name":b=ge;break;case"type":A=ge;break;case"checked":ee=ge;break;case"defaultChecked":ce=ge;break;case"value":v=ge;break;case"defaultValue":U=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(a(137,i));break;default:gt(r,i,m,ge,u,null)}}Ho(r,v,U,ee,ce,A,b,!1);return;case"select":Qe("invalid",r),m=A=v=null;for(b in u)if(u.hasOwnProperty(b)&&(U=u[b],U!=null))switch(b){case"value":v=U;break;case"defaultValue":A=U;break;case"multiple":m=U;default:gt(r,i,b,U,u,null)}i=v,u=A,r.multiple=!!m,i!=null?Er(r,!!m,i,!1):u!=null&&Er(r,!!m,u,!0);return;case"textarea":Qe("invalid",r),v=b=m=null;for(A in u)if(u.hasOwnProperty(A)&&(U=u[A],U!=null))switch(A){case"value":m=U;break;case"defaultValue":b=U;break;case"children":v=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(a(91));break;default:gt(r,i,A,U,u,null)}_v(r,m,b,v);return;case"option":for(ee in u)if(u.hasOwnProperty(ee)&&(m=u[ee],m!=null))switch(ee){case"selected":r.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:gt(r,i,ee,m,u,null)}return;case"dialog":Qe("beforetoggle",r),Qe("toggle",r),Qe("cancel",r),Qe("close",r);break;case"iframe":case"object":Qe("load",r);break;case"video":case"audio":for(m=0;m<Cl.length;m++)Qe(Cl[m],r);break;case"image":Qe("error",r),Qe("load",r);break;case"details":Qe("toggle",r);break;case"embed":case"source":case"link":Qe("error",r),Qe("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ce in u)if(u.hasOwnProperty(ce)&&(m=u[ce],m!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:gt(r,i,ce,m,u,null)}return;default:if(Sd(i)){for(ge in u)u.hasOwnProperty(ge)&&(m=u[ge],m!==void 0&&dh(r,i,ge,m,u,void 0));return}}for(U in u)u.hasOwnProperty(U)&&(m=u[U],m!=null&&gt(r,i,U,m,u,null))}function hR(r,i,u,m){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,v=null,A=null,U=null,ee=null,ce=null,ge=null;for(me in u){var ve=u[me];if(u.hasOwnProperty(me)&&ve!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":ee=ve;default:m.hasOwnProperty(me)||gt(r,i,me,null,m,ve)}}for(var de in m){var me=m[de];if(ve=u[de],m.hasOwnProperty(de)&&(me!=null||ve!=null))switch(de){case"type":v=me;break;case"name":b=me;break;case"checked":ce=me;break;case"defaultChecked":ge=me;break;case"value":A=me;break;case"defaultValue":U=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(a(137,i));break;default:me!==ve&&gt(r,i,de,me,m,ve)}}Va(r,A,U,ee,ce,ge,v,b);return;case"select":me=A=U=de=null;for(v in u)if(ee=u[v],u.hasOwnProperty(v)&&ee!=null)switch(v){case"value":break;case"multiple":me=ee;default:m.hasOwnProperty(v)||gt(r,i,v,null,m,ee)}for(b in m)if(v=m[b],ee=u[b],m.hasOwnProperty(b)&&(v!=null||ee!=null))switch(b){case"value":de=v;break;case"defaultValue":U=v;break;case"multiple":A=v;default:v!==ee&&gt(r,i,b,v,m,ee)}i=U,u=A,m=me,de!=null?Er(r,!!u,de,!1):!!m!=!!u&&(i!=null?Er(r,!!u,i,!0):Er(r,!!u,u?[]:"",!1));return;case"textarea":me=de=null;for(U in u)if(b=u[U],u.hasOwnProperty(U)&&b!=null&&!m.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:gt(r,i,U,null,m,b)}for(A in m)if(b=m[A],v=u[A],m.hasOwnProperty(A)&&(b!=null||v!=null))switch(A){case"value":de=b;break;case"defaultValue":me=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(a(91));break;default:b!==v&&gt(r,i,A,b,m,v)}Sv(r,de,me);return;case"option":for(var Le in u)if(de=u[Le],u.hasOwnProperty(Le)&&de!=null&&!m.hasOwnProperty(Le))switch(Le){case"selected":r.selected=!1;break;default:gt(r,i,Le,null,m,de)}for(ee in m)if(de=m[ee],me=u[ee],m.hasOwnProperty(ee)&&de!==me&&(de!=null||me!=null))switch(ee){case"selected":r.selected=de&&typeof de!="function"&&typeof de!="symbol";break;default:gt(r,i,ee,de,m,me)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Fe in u)de=u[Fe],u.hasOwnProperty(Fe)&&de!=null&&!m.hasOwnProperty(Fe)&&gt(r,i,Fe,null,m,de);for(ce in m)if(de=m[ce],me=u[ce],m.hasOwnProperty(ce)&&de!==me&&(de!=null||me!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(a(137,i));break;default:gt(r,i,ce,de,m,me)}return;default:if(Sd(i)){for(var xt in u)de=u[xt],u.hasOwnProperty(xt)&&de!==void 0&&!m.hasOwnProperty(xt)&&dh(r,i,xt,void 0,m,de);for(ge in m)de=m[ge],me=u[ge],!m.hasOwnProperty(ge)||de===me||de===void 0&&me===void 0||dh(r,i,ge,de,m,me);return}}for(var le in u)de=u[le],u.hasOwnProperty(le)&&de!=null&&!m.hasOwnProperty(le)&&gt(r,i,le,null,m,de);for(ve in m)de=m[ve],me=u[ve],!m.hasOwnProperty(ve)||de===me||de==null&&me==null||gt(r,i,ve,de,m,me)}function E2(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function mR(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,u=performance.getEntriesByType("resource"),m=0;m<u.length;m++){var b=u[m],v=b.transferSize,A=b.initiatorType,U=b.duration;if(v&&U&&E2(A)){for(A=0,U=b.responseEnd,m+=1;m<u.length;m++){var ee=u[m],ce=ee.startTime;if(ce>U)break;var ge=ee.transferSize,ve=ee.initiatorType;ge&&E2(ve)&&(ee=ee.responseEnd,A+=ge*(ee<U?1:(U-ce)/(ee-ce)))}if(--m,i+=8*(v+A)/(b.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var fh=null,hh=null;function zu(r){return r.nodeType===9?r:r.ownerDocument}function T2(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function A2(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function mh(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var ph=null;function pR(){var r=window.event;return r&&r.type==="popstate"?r===ph?!1:(ph=r,!0):(ph=null,!1)}var M2=typeof setTimeout=="function"?setTimeout:void 0,gR=typeof clearTimeout=="function"?clearTimeout:void 0,R2=typeof Promise=="function"?Promise:void 0,xR=typeof queueMicrotask=="function"?queueMicrotask:typeof R2<"u"?function(r){return R2.resolve(null).then(r).catch(yR)}:M2;function yR(r){setTimeout(function(){throw r})}function Sa(r){return r==="head"}function L2(r,i){var u=i,m=0;do{var b=u.nextSibling;if(r.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"||u==="/&"){if(m===0){r.removeChild(b),hs(i);return}m--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")m++;else if(u==="html")Tl(r.ownerDocument.documentElement);else if(u==="head"){u=r.ownerDocument.head,Tl(u);for(var v=u.firstChild;v;){var A=v.nextSibling,U=v.nodeName;v[Nr]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&v.rel.toLowerCase()==="stylesheet"||u.removeChild(v),v=A}}else u==="body"&&Tl(r.ownerDocument.body);u=b}while(u);hs(i)}function D2(r,i){var u=r;r=0;do{var m=u.nextSibling;if(u.nodeType===1?i?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(i?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),m&&m.nodeType===8)if(u=m.data,u==="/$"){if(r===0)break;r--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||r++;u=m}while(u)}function gh(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var u=i;switch(i=i.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":gh(u),Ua(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}r.removeChild(u)}}function bR(r,i,u,m){for(;r.nodeType===1;){var b=u;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!m&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(m){if(!r[Nr])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==b.rel||r.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||r.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||r.getAttribute("title")!==(b.title==null?null:b.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(b.src==null?null:b.src)||r.getAttribute("type")!==(b.type==null?null:b.type)||r.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var v=b.name==null?null:""+b.name;if(b.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=qn(r.nextSibling),r===null)break}return null}function vR(r,i,u){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!u||(r=qn(r.nextSibling),r===null))return null;return r}function O2(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=qn(r.nextSibling),r===null))return null;return r}function xh(r){return r.data==="$?"||r.data==="$~"}function yh(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function wR(r,i){var u=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||u.readyState!=="loading")i();else{var m=function(){i(),u.removeEventListener("DOMContentLoaded",m)};u.addEventListener("DOMContentLoaded",m),r._reactRetry=m}}function qn(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var bh=null;function z2(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var u=r.data;if(u==="/$"||u==="/&"){if(i===0)return qn(r.nextSibling);i--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||i++}r=r.nextSibling}return null}function q2(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var u=r.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(i===0)return r;i--}else u!=="/$"&&u!=="/&"||i++}r=r.previousSibling}return null}function I2(r,i,u){switch(i=zu(u),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function Tl(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Ua(r)}var In=new Map,B2=new Set;function qu(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Gr=X.d;X.d={f:jR,r:kR,D:SR,C:_R,L:NR,m:CR,X:TR,S:ER,M:AR};function jR(){var r=Gr.f(),i=Eu();return r||i}function kR(r){var i=ir(r);i!==null&&i.tag===5&&i.type==="form"?nw(i):Gr.r(r)}var cs=typeof document>"u"?null:document;function H2(r,i,u){var m=cs;if(m&&typeof i=="string"&&i){var b=on(i);b='link[rel="'+r+'"][href="'+b+'"]',typeof u=="string"&&(b+='[crossorigin="'+u+'"]'),B2.has(b)||(B2.add(b),r={rel:r,crossOrigin:u,href:i},m.querySelector(b)===null&&(i=m.createElement("link"),Wt(i,"link",r),Et(i),m.head.appendChild(i)))}}function SR(r){Gr.D(r),H2("dns-prefetch",r,null)}function _R(r,i){Gr.C(r,i),H2("preconnect",r,i)}function NR(r,i,u){Gr.L(r,i,u);var m=cs;if(m&&r&&i){var b='link[rel="preload"][as="'+on(i)+'"]';i==="image"&&u&&u.imageSrcSet?(b+='[imagesrcset="'+on(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(b+='[imagesizes="'+on(u.imageSizes)+'"]')):b+='[href="'+on(r)+'"]';var v=b;switch(i){case"style":v=ds(r);break;case"script":v=fs(r)}In.has(v)||(r=p({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:r,as:i},u),In.set(v,r),m.querySelector(b)!==null||i==="style"&&m.querySelector(Al(v))||i==="script"&&m.querySelector(Ml(v))||(i=m.createElement("link"),Wt(i,"link",r),Et(i),m.head.appendChild(i)))}}function CR(r,i){Gr.m(r,i);var u=cs;if(u&&r){var m=i&&typeof i.as=="string"?i.as:"script",b='link[rel="modulepreload"][as="'+on(m)+'"][href="'+on(r)+'"]',v=b;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=fs(r)}if(!In.has(v)&&(r=p({rel:"modulepreload",href:r},i),In.set(v,r),u.querySelector(b)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Ml(v)))return}m=u.createElement("link"),Wt(m,"link",r),Et(m),u.head.appendChild(m)}}}function ER(r,i,u){Gr.S(r,i,u);var m=cs;if(m&&r){var b=lr(m).hoistableStyles,v=ds(r);i=i||"default";var A=b.get(v);if(!A){var U={loading:0,preload:null};if(A=m.querySelector(Al(v)))U.loading=5;else{r=p({rel:"stylesheet",href:r,"data-precedence":i},u),(u=In.get(v))&&vh(r,u);var ee=A=m.createElement("link");Et(ee),Wt(ee,"link",r),ee._p=new Promise(function(ce,ge){ee.onload=ce,ee.onerror=ge}),ee.addEventListener("load",function(){U.loading|=1}),ee.addEventListener("error",function(){U.loading|=2}),U.loading|=4,Iu(A,i,m)}A={type:"stylesheet",instance:A,count:1,state:U},b.set(v,A)}}}function TR(r,i){Gr.X(r,i);var u=cs;if(u&&r){var m=lr(u).hoistableScripts,b=fs(r),v=m.get(b);v||(v=u.querySelector(Ml(b)),v||(r=p({src:r,async:!0},i),(i=In.get(b))&&wh(r,i),v=u.createElement("script"),Et(v),Wt(v,"link",r),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},m.set(b,v))}}function AR(r,i){Gr.M(r,i);var u=cs;if(u&&r){var m=lr(u).hoistableScripts,b=fs(r),v=m.get(b);v||(v=u.querySelector(Ml(b)),v||(r=p({src:r,async:!0,type:"module"},i),(i=In.get(b))&&wh(r,i),v=u.createElement("script"),Et(v),Wt(v,"link",r),u.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},m.set(b,v))}}function P2(r,i,u,m){var b=(b=ne.current)?qu(b):null;if(!b)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=ds(u.href),u=lr(b).hoistableStyles,m=u.get(i),m||(m={type:"style",instance:null,count:0,state:null},u.set(i,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){r=ds(u.href);var v=lr(b).hoistableStyles,A=v.get(r);if(A||(b=b.ownerDocument||b,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,A),(v=b.querySelector(Al(r)))&&!v._p&&(A.instance=v,A.state.loading=5),In.has(r)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},In.set(r,u),v||MR(b,r,u,A.state))),i&&m===null)throw Error(a(528,""));return A}if(i&&m!==null)throw Error(a(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=fs(u),u=lr(b).hoistableScripts,m=u.get(i),m||(m={type:"script",instance:null,count:0,state:null},u.set(i,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function ds(r){return'href="'+on(r)+'"'}function Al(r){return'link[rel="stylesheet"]['+r+"]"}function F2(r){return p({},r,{"data-precedence":r.precedence,precedence:null})}function MR(r,i,u,m){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?m.loading=1:(i=r.createElement("link"),m.preload=i,i.addEventListener("load",function(){return m.loading|=1}),i.addEventListener("error",function(){return m.loading|=2}),Wt(i,"link",u),Et(i),r.head.appendChild(i))}function fs(r){return'[src="'+on(r)+'"]'}function Ml(r){return"script[async]"+r}function U2(r,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var m=r.querySelector('style[data-href~="'+on(u.href)+'"]');if(m)return i.instance=m,Et(m),m;var b=p({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return m=(r.ownerDocument||r).createElement("style"),Et(m),Wt(m,"style",b),Iu(m,u.precedence,r),i.instance=m;case"stylesheet":b=ds(u.href);var v=r.querySelector(Al(b));if(v)return i.state.loading|=4,i.instance=v,Et(v),v;m=F2(u),(b=In.get(b))&&vh(m,b),v=(r.ownerDocument||r).createElement("link"),Et(v);var A=v;return A._p=new Promise(function(U,ee){A.onload=U,A.onerror=ee}),Wt(v,"link",m),i.state.loading|=4,Iu(v,u.precedence,r),i.instance=v;case"script":return v=fs(u.src),(b=r.querySelector(Ml(v)))?(i.instance=b,Et(b),b):(m=u,(b=In.get(v))&&(m=p({},u),wh(m,b)),r=r.ownerDocument||r,b=r.createElement("script"),Et(b),Wt(b,"link",m),r.head.appendChild(b),i.instance=b);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(m=i.instance,i.state.loading|=4,Iu(m,u.precedence,r));return i.instance}function Iu(r,i,u){for(var m=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=m.length?m[m.length-1]:null,v=b,A=0;A<m.length;A++){var U=m[A];if(U.dataset.precedence===i)v=U;else if(v!==b)break}v?v.parentNode.insertBefore(r,v.nextSibling):(i=u.nodeType===9?u.head:u,i.insertBefore(r,i.firstChild))}function vh(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function wh(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var Bu=null;function $2(r,i,u){if(Bu===null){var m=new Map,b=Bu=new Map;b.set(u,m)}else b=Bu,m=b.get(u),m||(m=new Map,b.set(u,m));if(m.has(r))return m;for(m.set(r,null),u=u.getElementsByTagName(r),b=0;b<u.length;b++){var v=u[b];if(!(v[Nr]||v[At]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var A=v.getAttribute(i)||"";A=r+A;var U=m.get(A);U?U.push(v):m.set(A,[v])}}return m}function G2(r,i,u){r=r.ownerDocument||r,r.head.insertBefore(u,i==="title"?r.querySelector("head > title"):null)}function RR(r,i,u){if(u===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return r=i.disabled,typeof i.precedence=="string"&&r==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function V2(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function LR(r,i,u,m){if(u.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var b=ds(m.href),v=i.querySelector(Al(b));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Hu.bind(r),i.then(r,r)),u.state.loading|=4,u.instance=v,Et(v);return}v=i.ownerDocument||i,m=F2(m),(b=In.get(b))&&vh(m,b),v=v.createElement("link"),Et(v);var A=v;A._p=new Promise(function(U,ee){A.onload=U,A.onerror=ee}),Wt(v,"link",m),u.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(r.count++,u=Hu.bind(r),i.addEventListener("load",u),i.addEventListener("error",u))}}var jh=0;function DR(r,i){return r.stylesheets&&r.count===0&&Fu(r,r.stylesheets),0<r.count||0<r.imgCount?function(u){var m=setTimeout(function(){if(r.stylesheets&&Fu(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&jh===0&&(jh=62500*mR());var b=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Fu(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>jh?50:800)+i);return r.unsuspend=u,function(){r.unsuspend=null,clearTimeout(m),clearTimeout(b)}}:null}function Hu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Fu(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Pu=null;function Fu(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Pu=new Map,i.forEach(OR,r),Pu=null,Hu.call(r))}function OR(r,i){if(!(i.state.loading&4)){var u=Pu.get(r);if(u)var m=u.get(null);else{u=new Map,Pu.set(r,u);for(var b=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<b.length;v++){var A=b[v];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(u.set(A.dataset.precedence,A),m=A)}m&&u.set(null,m)}b=i.instance,A=b.getAttribute("data-precedence"),v=u.get(A)||m,v===m&&u.set(null,b),u.set(A,b),this.count++,m=Hu.bind(this),b.addEventListener("load",m),b.addEventListener("error",m),v?v.parentNode.insertBefore(b,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(b,r.firstChild)),i.state.loading|=4}}var Rl={$$typeof:_,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function zR(r,i,u,m,b,v,A,U,ee){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ha(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ha(0),this.hiddenUpdates=Ha(null),this.identifierPrefix=m,this.onUncaughtError=b,this.onCaughtError=v,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ee,this.incompleteTransitions=new Map}function Y2(r,i,u,m,b,v,A,U,ee,ce,ge,ve){return r=new zR(r,i,u,A,ee,ce,ge,ve,U),i=1,v===!0&&(i|=24),v=vn(3,null,null,i),r.current=v,v.stateNode=r,i=ef(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:m,isDehydrated:u,cache:i},af(v),r}function X2(r){return r?(r=Ui,r):Ui}function K2(r,i,u,m,b,v){b=X2(b),m.context===null?m.context=b:m.pendingContext=b,m=ha(i),m.payload={element:u},v=v===void 0?null:v,v!==null&&(m.callback=v),u=ma(r,m,i),u!==null&&(mn(u,r,i),cl(u,r,i))}function W2(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var u=r.retryLane;r.retryLane=u!==0&&u<i?u:i}}function kh(r,i){W2(r,i),(r=r.alternate)&&W2(r,i)}function Q2(r){if(r.tag===13||r.tag===31){var i=Wa(r,67108864);i!==null&&mn(i,r,67108864),kh(r,67108864)}}function Z2(r){if(r.tag===13||r.tag===31){var i=_n();i=Pa(i);var u=Wa(r,i);u!==null&&mn(u,r,i),kh(r,i)}}var Uu=!0;function qR(r,i,u,m){var b=D.T;D.T=null;var v=X.p;try{X.p=2,Sh(r,i,u,m)}finally{X.p=v,D.T=b}}function IR(r,i,u,m){var b=D.T;D.T=null;var v=X.p;try{X.p=8,Sh(r,i,u,m)}finally{X.p=v,D.T=b}}function Sh(r,i,u,m){if(Uu){var b=_h(m);if(b===null)ch(r,i,m,$u,u),ej(r,m);else if(HR(b,r,i,u,m))m.stopPropagation();else if(ej(r,m),i&4&&-1<BR.indexOf(r)){for(;b!==null;){var v=ir(b);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var A=$n(v.pendingLanes);if(A!==0){var U=v;for(U.pendingLanes|=2,U.entangledLanes|=2;A;){var ee=1<<31-ut(A);U.entanglements[1]|=ee,A&=~ee}dr(v),(ct&6)===0&&(Nu=ie()+500,Nl(0))}}break;case 31:case 13:U=Wa(v,2),U!==null&&mn(U,v,2),Eu(),kh(v,2)}if(v=_h(m),v===null&&ch(r,i,m,$u,u),v===b)break;b=v}b!==null&&m.stopPropagation()}else ch(r,i,m,null,u)}}function _h(r){return r=Nd(r),Nh(r)}var $u=null;function Nh(r){if($u=null,r=ar(r),r!==null){var i=l(r);if(i===null)r=null;else{var u=i.tag;if(u===13){if(r=o(i),r!==null)return r;r=null}else if(u===31){if(r=c(i),r!==null)return r;r=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return $u=r,null}function J2(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(xe()){case J:return 2;case fe:return 8;case be:case Ne:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var Ch=!1,_a=null,Na=null,Ca=null,Ll=new Map,Dl=new Map,Ea=[],BR="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function ej(r,i){switch(r){case"focusin":case"focusout":_a=null;break;case"dragenter":case"dragleave":Na=null;break;case"mouseover":case"mouseout":Ca=null;break;case"pointerover":case"pointerout":Ll.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dl.delete(i.pointerId)}}function Ol(r,i,u,m,b,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:u,eventSystemFlags:m,nativeEvent:v,targetContainers:[b]},i!==null&&(i=ir(i),i!==null&&Q2(i)),r):(r.eventSystemFlags|=m,i=r.targetContainers,b!==null&&i.indexOf(b)===-1&&i.push(b),r)}function HR(r,i,u,m,b){switch(i){case"focusin":return _a=Ol(_a,r,i,u,m,b),!0;case"dragenter":return Na=Ol(Na,r,i,u,m,b),!0;case"mouseover":return Ca=Ol(Ca,r,i,u,m,b),!0;case"pointerover":var v=b.pointerId;return Ll.set(v,Ol(Ll.get(v)||null,r,i,u,m,b)),!0;case"gotpointercapture":return v=b.pointerId,Dl.set(v,Ol(Dl.get(v)||null,r,i,u,m,b)),!0}return!1}function tj(r){var i=ar(r.target);if(i!==null){var u=l(i);if(u!==null){if(i=u.tag,i===13){if(i=o(u),i!==null){r.blockedOn=i,Li(r.priority,function(){Z2(u)});return}}else if(i===31){if(i=c(u),i!==null){r.blockedOn=i,Li(r.priority,function(){Z2(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){r.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Gu(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var u=_h(r.nativeEvent);if(u===null){u=r.nativeEvent;var m=new u.constructor(u.type,u);_d=m,u.target.dispatchEvent(m),_d=null}else return i=ir(u),i!==null&&Q2(i),r.blockedOn=u,!1;i.shift()}return!0}function nj(r,i,u){Gu(r)&&u.delete(i)}function PR(){Ch=!1,_a!==null&&Gu(_a)&&(_a=null),Na!==null&&Gu(Na)&&(Na=null),Ca!==null&&Gu(Ca)&&(Ca=null),Ll.forEach(nj),Dl.forEach(nj)}function Vu(r,i){r.blockedOn===i&&(r.blockedOn=null,Ch||(Ch=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,PR)))}var Yu=null;function rj(r){Yu!==r&&(Yu=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Yu===r&&(Yu=null);for(var i=0;i<r.length;i+=3){var u=r[i],m=r[i+1],b=r[i+2];if(typeof m!="function"){if(Nh(m||u)===null)continue;break}var v=ir(u);v!==null&&(r.splice(i,3),i-=3,_f(v,{pending:!0,data:b,method:u.method,action:m},m,b))}}))}function hs(r){function i(ee){return Vu(ee,r)}_a!==null&&Vu(_a,r),Na!==null&&Vu(Na,r),Ca!==null&&Vu(Ca,r),Ll.forEach(i),Dl.forEach(i);for(var u=0;u<Ea.length;u++){var m=Ea[u];m.blockedOn===r&&(m.blockedOn=null)}for(;0<Ea.length&&(u=Ea[0],u.blockedOn===null);)tj(u),u.blockedOn===null&&Ea.shift();if(u=(r.ownerDocument||r).$$reactFormReplay,u!=null)for(m=0;m<u.length;m+=3){var b=u[m],v=u[m+1],A=b[Gt]||null;if(typeof v=="function")A||rj(u);else if(A){var U=null;if(v&&v.hasAttribute("formAction")){if(b=v,A=v[Gt]||null)U=A.formAction;else if(Nh(b)!==null)continue}else U=A.action;typeof U=="function"?u[m+1]=U:(u.splice(m,3),m-=3),rj(u)}}}function aj(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(A){return b=A})},focusReset:"manual",scroll:"manual"})}function i(){b!==null&&(b(),b=null),m||setTimeout(u,20)}function u(){if(!m&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,b=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(u,100),function(){m=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),b!==null&&(b(),b=null)}}}function Eh(r){this._internalRoot=r}Xu.prototype.render=Eh.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var u=i.current,m=_n();K2(u,m,r,i,null,null)},Xu.prototype.unmount=Eh.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;K2(r.current,2,null,r,null,null),Eu(),i[Qt]=null}};function Xu(r){this._internalRoot=r}Xu.prototype.unstable_scheduleHydration=function(r){if(r){var i=Ri();r={blockedOn:null,target:r,priority:i};for(var u=0;u<Ea.length&&i!==0&&i<Ea[u].priority;u++);Ea.splice(u,0,r),u===0&&tj(r)}};var ij=t.version;if(ij!=="19.2.4")throw Error(a(527,ij,"19.2.4"));X.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=h(i),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var FR={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ku=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ku.isDisabled&&Ku.supportsFiber)try{tt=Ku.inject(FR),st=Ku}catch{}}return ql.createRoot=function(r,i){if(!s(r))throw Error(a(299));var u=!1,m="",b=fw,v=hw,A=mw;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onUncaughtError!==void 0&&(b=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(A=i.onRecoverableError)),i=Y2(r,1,!1,null,null,u,m,null,b,v,A,aj),r[Qt]=i.current,uh(r),new Eh(i)},ql.hydrateRoot=function(r,i,u){if(!s(r))throw Error(a(299));var m=!1,b="",v=fw,A=hw,U=mw,ee=null;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onUncaughtError!==void 0&&(v=u.onUncaughtError),u.onCaughtError!==void 0&&(A=u.onCaughtError),u.onRecoverableError!==void 0&&(U=u.onRecoverableError),u.formState!==void 0&&(ee=u.formState)),i=Y2(r,1,!0,i,u??null,m,b,ee,v,A,U,aj),i.context=X2(null),u=i.current,m=_n(),m=Pa(m),b=ha(m),b.callback=null,ma(u,b,m),u=m,i.current.lanes=u,Sr(i,u),dr(i),r[Qt]=i.current,uh(r),new Xu(i)},ql.version="19.2.4",ql}var pj;function QR(){if(pj)return Mh.exports;pj=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Mh.exports=WR(),Mh.exports}var ZR=QR();const JR=Ds(ZR);/**
50
+ * react-router v7.13.2
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var gj="popstate";function xj(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function eL(e={}){function t(a,s){var h;let l=(h=s.state)==null?void 0:h.masked,{pathname:o,search:c,hash:f}=l||a.location;return zy("",{pathname:o,search:c,hash:f},s.state&&s.state.usr||null,s.state&&s.state.key||"default",l?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function n(a,s){return typeof s=="string"?s:ro(s)}return nL(t,n,null,e)}function Tt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function er(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function tL(){return Math.random().toString(36).substring(2,10)}function yj(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function zy(e,t,n=null,a,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Os(t):t,state:n,key:t&&t.key||a||tL(),unstable_mask:s}}function ro({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Os(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function nL(e,t,n,a={}){let{window:s=document.defaultView,v5Compat:l=!1}=a,o=s.history,c="POP",f=null,h=g();h==null&&(h=0,o.replaceState({...o.state,idx:h},""));function g(){return(o.state||{idx:null}).idx}function p(){c="POP";let S=g(),k=S==null?null:S-h;h=S,f&&f({action:c,location:j.location,delta:k})}function x(S,k){c="PUSH";let N=xj(S)?S:zy(j.location,S,k);h=g()+1;let _=yj(N,h),E=j.createHref(N.unstable_mask||N);try{o.pushState(_,"",E)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;s.location.assign(E)}l&&f&&f({action:c,location:j.location,delta:1})}function y(S,k){c="REPLACE";let N=xj(S)?S:zy(j.location,S,k);h=g();let _=yj(N,h),E=j.createHref(N.unstable_mask||N);o.replaceState(_,"",E),l&&f&&f({action:c,location:j.location,delta:0})}function w(S){return rL(S)}let j={get action(){return c},get location(){return e(s,o)},listen(S){if(f)throw new Error("A history only accepts one active listener");return s.addEventListener(gj,p),f=S,()=>{s.removeEventListener(gj,p),f=null}},createHref(S){return t(s,S)},createURL:w,encodeLocation(S){let k=w(S);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:x,replace:y,go(S){return o.go(S)}};return j}function rL(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Tt(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:ro(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}function dE(e,t,n="/"){return aL(e,t,n,!1)}function aL(e,t,n,a){let s=typeof t=="string"?Os(t):t,l=Wr(s.pathname||"/",n);if(l==null)return null;let o=fE(e);iL(o);let c=null;for(let f=0;c==null&&f<o.length;++f){let h=gL(l);c=mL(o[f],h,a)}return c}function fE(e,t=[],n=[],a="",s=!1){let l=(o,c,f=s,h)=>{let g={relativePath:h===void 0?o.path||"":h,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(a)&&f)return;Tt(g.relativePath.startsWith(a),`Absolute route path "${g.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(a.length)}let p=mr([a,g.relativePath]),x=n.concat(g);o.children&&o.children.length>0&&(Tt(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),fE(o.children,t,x,p,f)),!(o.path==null&&!o.index)&&t.push({path:p,score:fL(p,o.index),routesMeta:x})};return e.forEach((o,c)=>{var f;if(o.path===""||!((f=o.path)!=null&&f.includes("?")))l(o,c);else for(let h of hE(o.path))l(o,c,!0,h)}),t}function hE(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,s=n.endsWith("?"),l=n.replace(/\?$/,"");if(a.length===0)return s?[l,""]:[l];let o=hE(a.join("/")),c=[];return c.push(...o.map(f=>f===""?l:[l,f].join("/"))),s&&c.push(...o),c.map(f=>e.startsWith("/")&&f===""?"/":f)}function iL(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:hL(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var sL=/^:[\w-]+$/,lL=3,oL=2,uL=1,cL=10,dL=-2,bj=e=>e==="*";function fL(e,t){let n=e.split("/"),a=n.length;return n.some(bj)&&(a+=dL),t&&(a+=oL),n.filter(s=>!bj(s)).reduce((s,l)=>s+(sL.test(l)?lL:l===""?uL:cL),a)}function hL(e,t){return e.length===t.length&&e.slice(0,-1).every((a,s)=>a===t[s])?e[e.length-1]-t[t.length-1]:0}function mL(e,t,n=!1){let{routesMeta:a}=e,s={},l="/",o=[];for(let c=0;c<a.length;++c){let f=a[c],h=c===a.length-1,g=l==="/"?t:t.slice(l.length)||"/",p=jc({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},g),x=f.route;if(!p&&h&&n&&!a[a.length-1].route.index&&(p=jc({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},g)),!p)return null;Object.assign(s,p.params),o.push({params:s,pathname:mr([l,p.pathname]),pathnameBase:vL(mr([l,p.pathnameBase])),route:x}),p.pathnameBase!=="/"&&(l=mr([l,p.pathnameBase]))}return o}function jc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=pL(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let l=s[0],o=l.replace(/(.)\/+$/,"$1"),c=s.slice(1);return{params:a.reduce((h,{paramName:g,isOptional:p},x)=>{if(g==="*"){let w=c[x]||"";o=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const y=c[x];return p&&!y?h[g]=void 0:h[g]=(y||"").replace(/%2F/g,"/"),h},{}),pathname:l,pathnameBase:o,pattern:e}}function pL(e,t=!1,n=!0){er(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,c,f,h,g)=>{if(a.push({paramName:c,isOptional:f!=null}),f){let p=g.charAt(h+o.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),a]}function gL(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return er(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Wr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}var xL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function yL(e,t="/"){let{pathname:n,search:a="",hash:s=""}=typeof e=="string"?Os(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=vj(n.substring(1),"/"):l=vj(n,t)):l=t,{pathname:l,search:wL(a),hash:jL(s)}}function vj(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Oh(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function bL(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function mE(e){let t=bL(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function hb(e,t,n,a=!1){let s;typeof e=="string"?s=Os(e):(s={...e},Tt(!s.pathname||!s.pathname.includes("?"),Oh("?","pathname","search",s)),Tt(!s.pathname||!s.pathname.includes("#"),Oh("#","pathname","hash",s)),Tt(!s.search||!s.search.includes("#"),Oh("#","search","hash",s)));let l=e===""||s.pathname==="",o=l?"/":s.pathname,c;if(o==null)c=n;else{let p=t.length-1;if(!a&&o.startsWith("..")){let x=o.split("/");for(;x[0]==="..";)x.shift(),p-=1;s.pathname=x.join("/")}c=p>=0?t[p]:"/"}let f=yL(s,c),h=o&&o!=="/"&&o.endsWith("/"),g=(l||o===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||g)&&(f.pathname+="/"),f}var mr=e=>e.join("/").replace(/\/\/+/g,"/"),vL=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),wL=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,jL=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,kL=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function SL(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function _L(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var pE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function gE(e,t){let n=e;if(typeof n!="string"||!xL.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,s=!1;if(pE)try{let l=new URL(window.location.href),o=n.startsWith("//")?new URL(l.protocol+n):new URL(n),c=Wr(o.pathname,t);o.origin===l.origin&&c!=null?n=c+o.search+o.hash:s=!0}catch{er(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var xE=["POST","PUT","PATCH","DELETE"];new Set(xE);var NL=["GET",...xE];new Set(NL);var zs=C.createContext(null);zs.displayName="DataRouter";var Ic=C.createContext(null);Ic.displayName="DataRouterState";var CL=C.createContext(!1),yE=C.createContext({isTransitioning:!1});yE.displayName="ViewTransition";var EL=C.createContext(new Map);EL.displayName="Fetchers";var TL=C.createContext(null);TL.displayName="Await";var Pn=C.createContext(null);Pn.displayName="Navigation";var vo=C.createContext(null);vo.displayName="Location";var xr=C.createContext({outlet:null,matches:[],isDataRoute:!1});xr.displayName="Route";var mb=C.createContext(null);mb.displayName="RouteError";var bE="REACT_ROUTER_ERROR",AL="REDIRECT",ML="ROUTE_ERROR_RESPONSE";function RL(e){if(e.startsWith(`${bE}:${AL}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function LL(e){if(e.startsWith(`${bE}:${ML}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new kL(t.status,t.statusText,t.data)}catch{}}function DL(e,{relative:t}={}){Tt(wo(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=C.useContext(Pn),{hash:s,pathname:l,search:o}=jo(e,{relative:t}),c=l;return n!=="/"&&(c=l==="/"?n:mr([n,l])),a.createHref({pathname:c,search:o,hash:s})}function wo(){return C.useContext(vo)!=null}function yr(){return Tt(wo(),"useLocation() may be used only in the context of a <Router> component."),C.useContext(vo).location}var vE="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function wE(e){C.useContext(Pn).static||C.useLayoutEffect(e)}function pb(){let{isDataRoute:e}=C.useContext(xr);return e?YL():OL()}function OL(){Tt(wo(),"useNavigate() may be used only in the context of a <Router> component.");let e=C.useContext(zs),{basename:t,navigator:n}=C.useContext(Pn),{matches:a}=C.useContext(xr),{pathname:s}=yr(),l=JSON.stringify(mE(a)),o=C.useRef(!1);return wE(()=>{o.current=!0}),C.useCallback((f,h={})=>{if(er(o.current,vE),!o.current)return;if(typeof f=="number"){n.go(f);return}let g=hb(f,JSON.parse(l),s,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:mr([t,g.pathname])),(h.replace?n.replace:n.push)(g,h.state,h)},[t,n,l,s,e])}C.createContext(null);function gb(){let{matches:e}=C.useContext(xr),t=e[e.length-1];return t?t.params:{}}function jo(e,{relative:t}={}){let{matches:n}=C.useContext(xr),{pathname:a}=yr(),s=JSON.stringify(mE(n));return C.useMemo(()=>hb(e,JSON.parse(s),a,t==="path"),[e,s,a,t])}function zL(e,t){return jE(e,t)}function jE(e,t,n){var S;Tt(wo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=C.useContext(Pn),{matches:s}=C.useContext(xr),l=s[s.length-1],o=l?l.params:{},c=l?l.pathname:"/",f=l?l.pathnameBase:"/",h=l&&l.route;{let k=h&&h.path||"";SE(c,!h||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+
60
+ Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let g=yr(),p;if(t){let k=typeof t=="string"?Os(t):t;Tt(f==="/"||((S=k.pathname)==null?void 0:S.startsWith(f)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${f}" but pathname "${k.pathname}" was given in the \`location\` prop.`),p=k}else p=g;let x=p.pathname||"/",y=x;if(f!=="/"){let k=f.replace(/^\//,"").split("/");y="/"+x.replace(/^\//,"").split("/").slice(k.length).join("/")}let w=dE(e,{pathname:y});er(h||w!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),er(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=PL(w&&w.map(k=>Object.assign({},k,{params:Object.assign({},o,k.params),pathname:mr([f,a.encodeLocation?a.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?f:mr([f,a.encodeLocation?a.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),s,n);return t&&j?C.createElement(vo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...p},navigationType:"POP"}},j):j}function qL(){let e=VL(),t=SL(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:a},l={padding:"2px 4px",backgroundColor:a},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=C.createElement(C.Fragment,null,C.createElement("p",null,"💿 Hey developer 👋"),C.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",C.createElement("code",{style:l},"ErrorBoundary")," or"," ",C.createElement("code",{style:l},"errorElement")," prop on your route.")),C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},t),n?C.createElement("pre",{style:s},n):null,o)}var IL=C.createElement(qL,null),kE=class extends C.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=LL(e.digest);n&&(e=n)}let t=e!==void 0?C.createElement(xr.Provider,{value:this.props.routeContext},C.createElement(mb.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?C.createElement(BL,{error:e},t):t}};kE.contextType=CL;var zh=new WeakMap;function BL({children:e,error:t}){let{basename:n}=C.useContext(Pn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=RL(t.digest);if(a){let s=zh.get(t);if(s)throw s;let l=gE(a.location,n);if(pE&&!zh.get(t))if(l.isExternal||a.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:a.replace}));throw zh.set(t,o),o}return C.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function HL({routeContext:e,match:t,children:n}){let a=C.useContext(zs);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),C.createElement(xr.Provider,{value:e},n)}function PL(e,t=[],n){let a=n==null?void 0:n.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let s=e,l=a==null?void 0:a.errors;if(l!=null){let g=s.findIndex(p=>p.route.id&&(l==null?void 0:l[p.route.id])!==void 0);Tt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),s=s.slice(0,Math.min(s.length,g+1))}let o=!1,c=-1;if(n&&a){o=a.renderFallback;for(let g=0;g<s.length;g++){let p=s[g];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(c=g),p.route.id){let{loaderData:x,errors:y}=a,w=p.route.loader&&!x.hasOwnProperty(p.route.id)&&(!y||y[p.route.id]===void 0);if(p.route.lazy||w){n.isStatic&&(o=!0),c>=0?s=s.slice(0,c+1):s=[s[0]];break}}}}let f=n==null?void 0:n.onError,h=a&&f?(g,p)=>{var x,y;f(g,{location:a.location,params:((y=(x=a.matches)==null?void 0:x[0])==null?void 0:y.params)??{},unstable_pattern:_L(a.matches),errorInfo:p})}:void 0;return s.reduceRight((g,p,x)=>{let y,w=!1,j=null,S=null;a&&(y=l&&p.route.id?l[p.route.id]:void 0,j=p.route.errorElement||IL,o&&(c<0&&x===0?(SE("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,S=null):c===x&&(w=!0,S=p.route.hydrateFallbackElement||null)));let k=t.concat(s.slice(0,x+1)),N=()=>{let _;return y?_=j:w?_=S:p.route.Component?_=C.createElement(p.route.Component,null):p.route.element?_=p.route.element:_=g,C.createElement(HL,{match:p,routeContext:{outlet:g,matches:k,isDataRoute:a!=null},children:_})};return a&&(p.route.ErrorBoundary||p.route.errorElement||x===0)?C.createElement(kE,{location:a.location,revalidation:a.revalidation,component:j,error:y,children:N(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:h}):N()},null)}function xb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function FL(e){let t=C.useContext(zs);return Tt(t,xb(e)),t}function UL(e){let t=C.useContext(Ic);return Tt(t,xb(e)),t}function $L(e){let t=C.useContext(xr);return Tt(t,xb(e)),t}function yb(e){let t=$L(e),n=t.matches[t.matches.length-1];return Tt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function GL(){return yb("useRouteId")}function VL(){var a;let e=C.useContext(mb),t=UL("useRouteError"),n=yb("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function YL(){let{router:e}=FL("useNavigate"),t=yb("useNavigate"),n=C.useRef(!1);return wE(()=>{n.current=!0}),C.useCallback(async(s,l={})=>{er(n.current,vE),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...l}))},[e,t])}var wj={};function SE(e,t,n){!t&&!wj[e]&&(wj[e]=!0,er(!1,n))}C.memo(XL);function XL({routes:e,future:t,state:n,isStatic:a,onError:s}){return jE(e,void 0,{state:n,isStatic:a,onError:s})}function Gl(e){Tt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function KL({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:s,static:l=!1,unstable_useTransitions:o}){Tt(!wo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),f=C.useMemo(()=>({basename:c,navigator:s,static:l,unstable_useTransitions:o,future:{}}),[c,s,l,o]);typeof n=="string"&&(n=Os(n));let{pathname:h="/",search:g="",hash:p="",state:x=null,key:y="default",unstable_mask:w}=n,j=C.useMemo(()=>{let S=Wr(h,c);return S==null?null:{location:{pathname:S,search:g,hash:p,state:x,key:y,unstable_mask:w},navigationType:a}},[c,h,g,p,x,y,a,w]);return er(j!=null,`<Router basename="${c}"> is not able to match the URL "${h}${g}${p}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:C.createElement(Pn.Provider,{value:f},C.createElement(vo.Provider,{children:t,value:j}))}function WL({children:e,location:t}){return zL(qy(e),t)}function qy(e,t=[]){let n=[];return C.Children.forEach(e,(a,s)=>{if(!C.isValidElement(a))return;let l=[...t,s];if(a.type===C.Fragment){n.push.apply(n,qy(a.props.children,l));return}Tt(a.type===Gl,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Tt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let o={id:a.props.id||l.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(o.children=qy(a.props.children,l)),n.push(o)}),n}var mc="get",pc="application/x-www-form-urlencoded";function Bc(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function QL(e){return Bc(e)&&e.tagName.toLowerCase()==="button"}function ZL(e){return Bc(e)&&e.tagName.toLowerCase()==="form"}function JL(e){return Bc(e)&&e.tagName.toLowerCase()==="input"}function eD(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function tD(e,t){return e.button===0&&(!t||t==="_self")&&!eD(e)}function Iy(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let a=e[n];return t.concat(Array.isArray(a)?a.map(s=>[n,s]):[[n,a]])},[]))}function nD(e,t){let n=Iy(e);return t&&t.forEach((a,s)=>{n.has(s)||t.getAll(s).forEach(l=>{n.append(s,l)})}),n}var Qu=null;function rD(){if(Qu===null)try{new FormData(document.createElement("form"),0),Qu=!1}catch{Qu=!0}return Qu}var aD=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function qh(e){return e!=null&&!aD.has(e)?(er(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${pc}"`),null):e}function iD(e,t){let n,a,s,l,o;if(ZL(e)){let c=e.getAttribute("action");a=c?Wr(c,t):null,n=e.getAttribute("method")||mc,s=qh(e.getAttribute("enctype"))||pc,l=new FormData(e)}else if(QL(e)||JL(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||c.getAttribute("action");if(a=f?Wr(f,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||mc,s=qh(e.getAttribute("formenctype"))||qh(c.getAttribute("enctype"))||pc,l=new FormData(c,e),!rD()){let{name:h,type:g,value:p}=e;if(g==="image"){let x=h?`${h}.`:"";l.append(`${x}x`,"0"),l.append(`${x}y`,"0")}else h&&l.append(h,p)}}else{if(Bc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=mc,a=null,s=pc,o=e}return l&&s==="text/plain"&&(o=l,l=void 0),{action:a,method:n.toLowerCase(),encType:s,formData:l,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function bb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function sD(e,t,n,a){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${a}`:s.pathname=`${s.pathname}.${a}`:s.pathname==="/"?s.pathname=`_root.${a}`:t&&Wr(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${a}`,s}async function lD(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function oD(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function uD(e,t,n){let a=await Promise.all(e.map(async s=>{let l=t.routes[s.route.id];if(l){let o=await lD(l,n);return o.links?o.links():[]}return[]}));return hD(a.flat(1).filter(oD).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function jj(e,t,n,a,s,l){let o=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,c=(f,h)=>{var g;return n[h].pathname!==f.pathname||((g=n[h].route.path)==null?void 0:g.endsWith("*"))&&n[h].params["*"]!==f.params["*"]};return l==="assets"?t.filter((f,h)=>o(f,h)||c(f,h)):l==="data"?t.filter((f,h)=>{var p;let g=a.routes[f.route.id];if(!g||!g.hasLoader)return!1;if(o(f,h)||c(f,h))return!0;if(f.route.shouldRevalidate){let x=f.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function cD(e,t,{includeHydrateFallback:n}={}){return dD(e.map(a=>{let s=t.routes[a.route.id];if(!s)return[];let l=[s.module];return s.clientActionModule&&(l=l.concat(s.clientActionModule)),s.clientLoaderModule&&(l=l.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(l=l.concat(s.hydrateFallbackModule)),s.imports&&(l=l.concat(s.imports)),l}).flat(1))}function dD(e){return[...new Set(e)]}function fD(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function hD(e,t){let n=new Set;return new Set(t),e.reduce((a,s)=>{let l=JSON.stringify(fD(s));return n.has(l)||(n.add(l),a.push({key:l,link:s})),a},[])}function _E(){let e=C.useContext(zs);return bb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function mD(){let e=C.useContext(Ic);return bb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var vb=C.createContext(void 0);vb.displayName="FrameworkContext";function NE(){let e=C.useContext(vb);return bb(e,"You must render this element inside a <HydratedRouter> element"),e}function pD(e,t){let n=C.useContext(vb),[a,s]=C.useState(!1),[l,o]=C.useState(!1),{onFocus:c,onBlur:f,onMouseEnter:h,onMouseLeave:g,onTouchStart:p}=t,x=C.useRef(null);C.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let j=k=>{k.forEach(N=>{o(N.isIntersecting)})},S=new IntersectionObserver(j,{threshold:.5});return x.current&&S.observe(x.current),()=>{S.disconnect()}}},[e]),C.useEffect(()=>{if(a){let j=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(j)}}},[a]);let y=()=>{s(!0)},w=()=>{s(!1),o(!1)};return n?e!=="intent"?[l,x,{}]:[l,x,{onFocus:Il(c,y),onBlur:Il(f,w),onMouseEnter:Il(h,y),onMouseLeave:Il(g,w),onTouchStart:Il(p,y)}]:[!1,x,{}]}function Il(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function gD({page:e,...t}){let{router:n}=_E(),a=C.useMemo(()=>dE(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?C.createElement(yD,{page:e,matches:a,...t}):null}function xD(e){let{manifest:t,routeModules:n}=NE(),[a,s]=C.useState([]);return C.useEffect(()=>{let l=!1;return uD(e,t,n).then(o=>{l||s(o)}),()=>{l=!0}},[e,t,n]),a}function yD({page:e,matches:t,...n}){let a=yr(),{future:s,manifest:l,routeModules:o}=NE(),{basename:c}=_E(),{loaderData:f,matches:h}=mD(),g=C.useMemo(()=>jj(e,t,h,l,a,"data"),[e,t,h,l,a]),p=C.useMemo(()=>jj(e,t,h,l,a,"assets"),[e,t,h,l,a]),x=C.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let j=new Set,S=!1;if(t.forEach(N=>{var E;let _=l.routes[N.route.id];!_||!_.hasLoader||(!g.some(M=>M.route.id===N.route.id)&&N.route.id in f&&((E=o[N.route.id])!=null&&E.shouldRevalidate)||_.hasClientLoader?S=!0:j.add(N.route.id))}),j.size===0)return[];let k=sD(e,c,s.unstable_trailingSlashAwareDataRequests,"data");return S&&j.size>0&&k.searchParams.set("_routes",t.filter(N=>j.has(N.route.id)).map(N=>N.route.id).join(",")),[k.pathname+k.search]},[c,s.unstable_trailingSlashAwareDataRequests,f,a,l,g,t,e,o]),y=C.useMemo(()=>cD(p,l),[p,l]),w=xD(p);return C.createElement(C.Fragment,null,x.map(j=>C.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),y.map(j=>C.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),w.map(({key:j,link:S})=>C.createElement("link",{key:j,nonce:n.nonce,...S,crossOrigin:S.crossOrigin??n.crossOrigin})))}function bD(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var vD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{vD&&(window.__reactRouterVersion="7.13.2")}catch{}function wD({basename:e,children:t,unstable_useTransitions:n,window:a}){let s=C.useRef();s.current==null&&(s.current=eL({window:a,v5Compat:!0}));let l=s.current,[o,c]=C.useState({action:l.action,location:l.location}),f=C.useCallback(h=>{n===!1?c(h):C.startTransition(()=>c(h))},[n]);return C.useLayoutEffect(()=>l.listen(f),[l,f]),C.createElement(KL,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:l,unstable_useTransitions:n})}var CE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hn=C.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:s,reloadDocument:l,replace:o,unstable_mask:c,state:f,target:h,to:g,preventScrollReset:p,viewTransition:x,unstable_defaultShouldRevalidate:y,...w},j){let{basename:S,navigator:k,unstable_useTransitions:N}=C.useContext(Pn),_=typeof g=="string"&&CE.test(g),E=gE(g,S);g=E.to;let M=DL(g,{relative:s}),T=yr(),R=null;if(c){let O=hb(c,[],T.unstable_mask?T.unstable_mask.pathname:"/",!0);S!=="/"&&(O.pathname=O.pathname==="/"?S:mr([S,O.pathname])),R=k.createHref(O)}let[B,P,L]=pD(a,w),H=_D(g,{replace:o,unstable_mask:c,state:f,target:h,preventScrollReset:p,relative:s,viewTransition:x,unstable_defaultShouldRevalidate:y,unstable_useTransitions:N});function F(O){t&&t(O),O.defaultPrevented||H(O)}let G=!(E.isExternal||l),q=C.createElement("a",{...w,...L,href:(G?R:void 0)||E.absoluteURL||M,onClick:G?F:t,ref:bD(j,P),target:h,"data-discover":!_&&n==="render"?"true":void 0});return B&&!_?C.createElement(C.Fragment,null,q,C.createElement(gD,{page:M})):q});Hn.displayName="Link";var jD=C.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:s=!1,style:l,to:o,viewTransition:c,children:f,...h},g){let p=jo(o,{relative:h.relative}),x=yr(),y=C.useContext(Ic),{navigator:w,basename:j}=C.useContext(Pn),S=y!=null&&MD(p)&&c===!0,k=w.encodeLocation?w.encodeLocation(p).pathname:p.pathname,N=x.pathname,_=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;n||(N=N.toLowerCase(),_=_?_.toLowerCase():null,k=k.toLowerCase()),_&&j&&(_=Wr(_,j)||_);const E=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let M=N===k||!s&&N.startsWith(k)&&N.charAt(E)==="/",T=_!=null&&(_===k||!s&&_.startsWith(k)&&_.charAt(k.length)==="/"),R={isActive:M,isPending:T,isTransitioning:S},B=M?t:void 0,P;typeof a=="function"?P=a(R):P=[a,M?"active":null,T?"pending":null,S?"transitioning":null].filter(Boolean).join(" ");let L=typeof l=="function"?l(R):l;return C.createElement(Hn,{...h,"aria-current":B,className:P,ref:g,style:L,to:o,viewTransition:c},typeof f=="function"?f(R):f)});jD.displayName="NavLink";var kD=C.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:s,state:l,method:o=mc,action:c,onSubmit:f,relative:h,preventScrollReset:g,viewTransition:p,unstable_defaultShouldRevalidate:x,...y},w)=>{let{unstable_useTransitions:j}=C.useContext(Pn),S=TD(),k=AD(c,{relative:h}),N=o.toLowerCase()==="get"?"get":"post",_=typeof c=="string"&&CE.test(c),E=M=>{if(f&&f(M),M.defaultPrevented)return;M.preventDefault();let T=M.nativeEvent.submitter,R=(T==null?void 0:T.getAttribute("formmethod"))||o,B=()=>S(T||M.currentTarget,{fetcherKey:t,method:R,navigate:n,replace:s,state:l,relative:h,preventScrollReset:g,viewTransition:p,unstable_defaultShouldRevalidate:x});j&&n!==!1?C.startTransition(()=>B()):B()};return C.createElement("form",{ref:w,method:N,action:k,onSubmit:a?f:E,...y,"data-discover":!_&&e==="render"?"true":void 0})});kD.displayName="Form";function SD(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function EE(e){let t=C.useContext(zs);return Tt(t,SD(e)),t}function _D(e,{target:t,replace:n,unstable_mask:a,state:s,preventScrollReset:l,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let g=pb(),p=yr(),x=jo(e,{relative:o});return C.useCallback(y=>{if(tD(y,t)){y.preventDefault();let w=n!==void 0?n:ro(p)===ro(x),j=()=>g(e,{replace:w,unstable_mask:a,state:s,preventScrollReset:l,relative:o,viewTransition:c,unstable_defaultShouldRevalidate:f});h?C.startTransition(()=>j()):j()}},[p,g,x,n,a,s,t,e,l,o,c,f,h])}function ND(e){er(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=C.useRef(Iy(e)),n=C.useRef(!1),a=yr(),s=C.useMemo(()=>nD(a.search,n.current?null:t.current),[a.search]),l=pb(),o=C.useCallback((c,f)=>{const h=Iy(typeof c=="function"?c(new URLSearchParams(s)):c);n.current=!0,l("?"+h,f)},[l,s]);return[s,o]}var CD=0,ED=()=>`__${String(++CD)}__`;function TD(){let{router:e}=EE("useSubmit"),{basename:t}=C.useContext(Pn),n=GL(),a=e.fetch,s=e.navigate;return C.useCallback(async(l,o={})=>{let{action:c,method:f,encType:h,formData:g,body:p}=iD(l,t);if(o.navigate===!1){let x=o.fetcherKey||ED();await a(x,n,o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:g,body:p,formMethod:o.method||f,formEncType:o.encType||h,flushSync:o.flushSync})}else await s(o.action||c,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:g,body:p,formMethod:o.method||f,formEncType:o.encType||h,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[a,s,t,n])}function AD(e,{relative:t}={}){let{basename:n}=C.useContext(Pn),a=C.useContext(xr);Tt(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),l={...jo(e||".",{relative:t})},o=yr();if(e==null){l.search=o.search;let c=new URLSearchParams(l.search),f=c.getAll("index");if(f.some(g=>g==="")){c.delete("index"),f.filter(p=>p).forEach(p=>c.append("index",p));let g=c.toString();l.search=g?`?${g}`:""}}return(!e||e===".")&&s.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:mr([n,l.pathname])),ro(l)}function MD(e,{relative:t}={}){let n=C.useContext(yE);Tt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=EE("useViewTransitionState"),s=jo(e,{relative:t});if(!n.isTransitioning)return!1;let l=Wr(n.currentLocation.pathname,a)||n.currentLocation.pathname,o=Wr(n.nextLocation.pathname,a)||n.nextLocation.pathname;return jc(s.pathname,o)!=null||jc(s.pathname,l)!=null}cE();class kj extends Error{constructor(t,n){super(n),this.status=t}}async function Hc(e,t,n){const a={method:e,credentials:"include",headers:{"Content-Type":"application/json"}};n!==void 0&&(a.body=JSON.stringify(n));const s=await fetch(t,a);if(s.status===401)throw window.dispatchEvent(new CustomEvent("auth:unauthorized")),new kj(401,"Unauthorized");if(!s.ok){const l=await s.text().catch(()=>s.statusText);throw new kj(s.status,l)}if(s.status!==204)return s.json()}function rt(e){return Hc("GET",e)}function qe(e,t){return Hc("POST",e,t)}function qs(e,t){return Hc("PUT",e,t)}function qa(e){return Hc("DELETE",e)}function RD(e){return qe("/api/auth/login",{password:e})}function LD(){return qe("/api/auth/logout")}function DD(){return rt("/api/auth/status")}function OD(){const[e,t]=C.useState(!1),[n,a]=C.useState(!0),[s,l]=C.useState(!0);C.useEffect(()=>{DD().then(f=>{t(f.authenticated),a(f.authRequired)}).catch(()=>t(!1)).finally(()=>l(!1))},[]),C.useEffect(()=>{const f=()=>t(!1);return window.addEventListener("auth:unauthorized",f),()=>window.removeEventListener("auth:unauthorized",f)},[]);const o=C.useCallback(async f=>{await RD(f),t(!0)},[]),c=C.useCallback(async()=>{await LD(),t(!1)},[]);return{authenticated:e,authRequired:n,loading:s,login:o,logout:c}}function zD(e){const[t,n]=C.useState(!1),a=C.useRef(null),s=C.useRef(new Set),l=C.useRef(void 0),o=C.useRef(0),c=C.useCallback(()=>{if(!e)return;const p=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`,x=new WebSocket(p);a.current=x,x.onopen=()=>{n(!0),o.current=0},x.onmessage=y=>{try{const w=JSON.parse(y.data);s.current.forEach(j=>j(w))}catch{}},x.onclose=()=>{n(!1),a.current=null;const y=Math.min(1e3*2**o.current,3e4);o.current++,l.current=setTimeout(c,y)},x.onerror=()=>{x.close()}},[e]);C.useEffect(()=>(c(),()=>{l.current&&clearTimeout(l.current),a.current&&a.current.close()}),[c]);const f=C.useCallback(g=>(s.current.add(g),()=>{s.current.delete(g)}),[]),h=C.useCallback(g=>{a.current&&a.current.readyState===WebSocket.OPEN&&a.current.send(JSON.stringify(g))},[]);return{connected:t,onEvent:f,sendMessage:h}}const wb=new Map;function Zu(e){wb.set(e.id,e)}function By(){return Array.from(wb.values())}function Sj(e){return By().filter(t=>t.hasTab&&t.isEnabled(e))}function qD(){const e={},t={};for(const n of wb.values())Object.assign(e,n.translations.en),Object.assign(t,n.translations.ko);return{en:e,ko:t}}const ID={en:{"login.title":"CLITrigger","login.subtitle":"Authentication Required","login.password":"Enter password","login.submit":"Sign In","login.loading":"Authenticating...","login.error":"Access denied. Please try again.","login.footer":"Secure Access","login.disclaimer":'This software is provided "as is" without any warranties. Users are solely responsible for all actions taken using this tool, including any costs incurred from AI CLI usage, data loss, or unintended code changes. The developers assume no liability for any direct, indirect, or consequential damages arising from use.',"sidebar.home":"Home","sidebar.workspaces":"Workspaces","projects.title":"All Projects","projects.subtitle":"Project Console","projects.new":"New Project","projects.logout":"Sign Out","projects.loading":"Loading projects...","projects.empty":"No projects yet","projects.emptyHint":"Create your first project to get started.","projects.tasks":"tasks","projects.active":"active","projects.done":"done","projects.search":"Search projects...","projects.delete":"Delete project","projects.deleteConfirm":"Are you sure you want to delete this project?","projects.pathMissing":"Path not found","projects.pathMissingConfirm":"The local folder for this project no longer exists. Delete it?","projects.noGit":"No Git","detail.back":"Projects","detail.loading":"Loading...","detail.notFound":"Project not found","detail.backToProjects":"Back to Projects","detail.live":"Connected","header.branch":"Branch","header.workers":"Workers","header.model":"Model","header.settings":"Settings","header.runAll":"Run All","header.stopAll":"Stop All","header.config":"Project Settings","header.maxWorkers":"Max Workers","settings.defaultMaxTurns":"Default Max Turns","settings.defaultMaxTurnsHint":"Default turn limit per task. Tasks can override individually.","header.cliTool":"CLI Tool","header.aiModel":"AI Model","header.cliFlags":"CLI Flags","header.cancel":"Cancel","header.save":"Save","header.saving":"Saving...","header.noGit":"No Git","header.noGitHint":'This project is not a git repository. Tasks will run directly without worktree isolation. Run "git init" in the project path, then re-check.',"header.recheckGit":"Re-check Git Status","header.fallbackChainTitle":"CLI Fallback Chain","header.fallbackChainHint":"When a CLI tool runs out of context, automatically switch to the next tool in the chain.","header.sandboxTitle":"Sandbox Mode","header.sandboxBadgeStrict":"Sandbox: Strict","header.sandboxBadgePermissive":"Sandbox: Permissive","header.sandboxStrict":"Strict (Recommended)","header.sandboxStrictDesc":"CLI tools can only access files within the worktree directory.","header.sandboxPermissive":"Permissive","header.sandboxPermissiveDesc":"CLI tools can access any file on the system.","header.sandboxWarning":"Warning: In permissive mode, CLI tools can access files outside the worktree. Use with caution.","header.worktreeTitle":"Worktree Isolation","header.worktreeEnabled":"Worktree (Recommended)","header.worktreeEnabledDesc":"Each task runs in its own branch. Safe for parallel tasks.","header.worktreeDisabled":"Direct (Main Branch)","header.worktreeDisabledDesc":"Tasks run on the main branch. Max workers forced to 1.","header.worktreeWarning":"Warning: Tasks will modify the main branch directly. Concurrent execution is disabled.","header.noWorktreeBadge":"No Worktree","header.debugBadge":"Debug Logs","header.showTokenUsageTitle":"Token Usage Display","header.showTokenUsageDesc":"Show token usage (input/output) after task completion.","header.showTokenUsageEnable":"Show token usage","header.debugLoggingTitle":"Debug Logging","header.debugLoggingDesc":"Save full CLI input/output to .debug-logs/ for each task execution.","header.debugLoggingEnable":"Enable debug log files","header.gstackTitle":"gstack Skills","header.gstackEnabled":"Enable gstack skill injection","header.gstackCredit":"Powered by gstack (MIT License, Garry Tan)","header.usageLimit":"Usage","header.gstackClaudeOnly":"gstack skills are only available with Claude CLI.","header.modelSettings":"AI Model Settings","header.modelValue":"Model ID","header.modelLabel":"Display Name","header.addModel":"Add","header.modelSettingsHint":"Add custom models here. They will appear in model dropdowns across all projects.","header.jiraTitle":"Jira Integration","header.jiraBaseUrl":"Jira URL","header.jiraBaseUrlPlaceholder":"https://yoursite.atlassian.net","header.jiraEmail":"Email","header.jiraEmailPlaceholder":"your@email.com","header.jiraApiToken":"API Token","header.jiraApiTokenPlaceholder":"Atlassian API token","header.jiraProjectKey":"Project Key","header.jiraProjectKeyPlaceholder":"e.g. PROJ","header.jiraTestConnection":"Test Connection","header.jiraTesting":"Testing...","header.jiraConnected":"Connected","header.jiraFailed":"Connection failed","header.jiraTokenHint":"Generate at id.atlassian.com > Security > API tokens","form.newProject":"New Project","form.projectName":"Project Name","form.folderPath":"Folder Path","form.cancel":"Cancel","form.create":"Create","browse.title":"Browse Folder","browse.select":"Select","browse.loading":"Loading...","browse.error":"Failed to load directory","browse.empty":"No folders found","todos.title":"Tasks","todos.add":"Add Task","todos.empty":"No tasks yet","todos.emptyHint":"Add a task to begin.","todos.merge":"Merge","todo.description":"Description","todo.noDescription":"No description provided.","todo.attachedImages":"Attached Images","todo.branch":"Branch","todo.path":"Path","todo.mergeFailed":"Merge failed","todo.diffError":"Diff error","todo.diffOutput":"Changes","todo.files":"files","todo.systemLog":"Activity Log","todo.start":"Start","todo.startHeadless":"Headless: Runs autonomously. All permissions auto-approved. No user input needed.","todo.startInteractive":"Interactive: Keeps stdin open so you can send messages during execution. All permissions auto-approved.","todo.startVerbose":"Verbose: Auto-approved with full raw log output. Shows all tool calls, inputs, results, and system events in real-time.","todo.sendPlaceholder":"Type a message...","todo.startWithDependency":"Start parent task first","todo.stop":"Stop","todo.viewDiff":"View Diff","todo.viewDebugLog":"Debug Log","todo.merge":"Merge","todo.mergeChain":"Merge Chain","todo.mergeChainDesc":"Merge all tasks in this chain to main branch","todo.chainComplete":"Chain Complete","todo.chainTasks":"{count} tasks","todo.edit":"Edit","todo.delete":"Delete","todo.cleanup":"Clean up worktree","todo.cleanupFailed":"Cleanup failed","todo.retry":"Retry from scratch: Cleans up previous worktree, clears logs, and re-runs the task from the beginning.","todo.retryFailed":"Retry failed","todo.continue":"Continue in worktree: Run a follow-up prompt in the same worktree/branch, preserving prior work (new round).","todo.continuing":"Continuing...","todo.confirmContinue":"Run follow-up","todo.continuePromptLabel":"Follow-up prompt","todo.continuePromptPlaceholder":"Describe the next step or fix to apply in this worktree...","todo.continuePromptRequired":"Follow-up prompt is required.","todo.roundLabel":"round","todo.dependsOn":"Depends on","todo.mergedFrom":"Inherited from","todo.transferredTo":"Transferred to","todo.schedule":"Schedule: Convert this task into a one-time scheduled run at a specific time.","todo.scheduleAt":"Run at","todo.scheduling":"Scheduling...","todo.confirmSchedule":"Schedule","todo.scheduleKeepOriginal":"Keep original task","todoForm.titlePlaceholder":"Task title...","todoForm.descPlaceholder":"Description (optional)...","todoForm.cliTool":"CLI Tool","todoForm.aiModel":"AI Model","todoForm.addImage":"Add Image","todoForm.pasteHint":"Ctrl+V to paste image","todoForm.images":"Images","todoForm.maxTurns":"Max Turns","todoForm.maxTurnsPlaceholder":"No limit","todoForm.maxTurnsHint":"Limit the number of agentic turns to prevent excessive token usage.","todoForm.dependsOn":"Depends On","todoForm.noDependency":"None (independent task)","todoForm.dependsOnHint":"This task will wait for the dependency to complete, then squash merge its changes into a new branch.","todoForm.cancel":"Cancel","todoForm.save":"Save","dnd.dropHint":"Run after this task","dnd.removeDep":"Remove dependency","dnd.dropToRemoveDep":"Drop here to remove dependency","dnd.cyclicWarning":"Cannot link: circular dependency","graph.autoLayout":"Auto Layout","graph.listView":"List View","graph.graphView":"Graph View","status.pending":"Idle","status.running":"Running","status.completed":"Done","status.failed":"Failed","status.stopped":"Stopped","status.merged":"Merged","progress.complete":"complete","progress.done":"Done","progress.live":"Running","progress.idle":"Idle","progress.fail":"Failed","progress.stop":"Stopped","progress.merged":"Merged","failure.title":"Failure Reason","failure.exitCode":"Exit code","failure.fix":"Fix This: Creates a new task that analyzes the failure and attempts to fix the issue.","failure.fixPrefix":"[Fix] ","result.duration":"Duration","result.commits":"commits","result.filesChanged":"files changed","result.commitHistory":"Commit History","result.changedFiles":"Changed Files","result.tokenUsage":"Token Usage","result.inputTokens":"input","result.outputTokens":"output","result.totalCost":"Cost","result.cacheTokens":"cache","result.turns":"turns","result.contextUsed":"ctx","result.levelLight":"Light","result.levelModerate":"Moderate","result.levelHigh":"High","result.levelHeavy":"Heavy","log.awaiting":"Awaiting output...","log.waitingResponse":"Waiting for response...","log.noChanges":"No changes detected.","log.copy":"Copy","log.copied":"Copied!","schedules.title":"Schedules","schedules.add":"New Schedule","schedules.empty":"No schedules yet","schedules.emptyHint":"Create a schedule to automate recurring tasks.","schedule.type":"Schedule Type","schedule.recurring":"Recurring","schedule.once":"One-time","schedule.runAtLabel":"Run at","schedule.cronExpression":"Frequency","schedule.cronHint":"e.g. */30 * * * * (every 30min), 0 9 * * * (daily 9am), 0 9 * * 1-5 (weekdays 9am)","cron.everyMinutes":"Minutes","cron.hourly":"Hourly","cron.daily":"Daily","cron.weekly":"Weekly","cron.monthly":"Monthly","cron.custom":"Custom","cron.every":"Every","cron.minutesLabel":"minutes","cron.everyHourAt":"Every hour at","cron.minutesPast":"min past","cron.everyDayAt":"Every day at","cron.at":"at","cron.everyMonthOn":"Every month on day","cron.dayAt":"at","cron.expression":"Cron","cron.mon":"Mon","cron.tue":"Tue","cron.wed":"Wed","cron.thu":"Thu","cron.fri":"Fri","cron.sat":"Sat","cron.sun":"Sun","schedule.skipIfRunning":"Skip if previous run still active","schedule.active":"Active","schedule.paused":"Paused","schedule.lastRun":"Last run","schedule.never":"Never","schedule.trigger":"Run Now","schedule.activate":"Activate","schedule.pause":"Pause","schedule.edit":"Edit","schedule.delete":"Delete","schedule.runs":"Run History","schedule.runTriggered":"Triggered","schedule.runSkipped":"Skipped","schedule.runCompleted":"Completed","schedule.runFailed":"Failed","schedule.noRuns":"No runs yet","scheduleForm.titlePlaceholder":"Schedule title...","scheduleForm.descPlaceholder":"Task description template...","scheduleForm.cliTool":"CLI Tool","scheduleForm.aiModel":"AI Model","scheduleForm.cancel":"Cancel","scheduleForm.save":"Save","pipelines.title":"Pipelines","pipelines.add":"New Pipeline","pipelines.empty":"No pipelines yet","pipelines.emptyHint":"Create a pipeline to automate multi-phase feature development with AI.","pipelines.emptyDesc":"A pipeline runs 5 AI phases in sequence: Planning, Implementation, Review, Feedback, and Documentation — all on an isolated branch.","pipeline.phase":"Phase","pipeline.phases":"Pipeline Phases","pipeline.start":"Start Pipeline","pipeline.resume":"Resume","pipeline.retry":"Retry","pipeline.pause":"Pause","pipeline.skipPhase":"Skip Phase","pipeline.retryPhase":"Retry Phase","pipeline.viewDiff":"View Diff","pipeline.hideDiff":"Hide Diff","pipeline.merge":"Merge","pipeline.merging":"Merging...","pipeline.cleanup":"Cleanup Worktree","pipeline.cleaning":"Cleaning...","pipeline.creating":"Creating...","pipeline.create":"Create Pipeline","pipeline.diffOutput":"Diff Output","pipeline.files":"files","pipeline.noChanges":"No changes detected.","pipeline.phaseOutput":"Phase Output (click to expand)","pipeline.loadingLogs":"Loading logs...","pipeline.awaitingOutput":"Awaiting output...","pipeline.notFound":"Pipeline not found","pipeline.backToProject":"Back to Project","pipeline.branch":"Branch","pipeline.featureTitle":"Feature Title","pipeline.featureDesc":"Feature Description","pipeline.featureDescHint":"Describe the feature in detail. This will be used as the AI prompt for each pipeline phase...","pipeline.featureTitleHint":"e.g. Add user authentication","pipeline.planning":"Planning","pipeline.implementation":"Implementation","pipeline.review":"Review","pipeline.feedback":"Feedback","pipeline.documentation":"Documentation","pipeline.planningFull":"Planning","pipeline.implementationFull":"Implementation","pipeline.reviewFull":"Review","pipeline.feedbackFull":"Feedback","pipeline.documentationFull":"Documentation","jira.title":"Jira Issues","jira.search":"Search issues...","jira.allStatuses":"All Statuses","jira.refresh":"Refresh","jira.import":"Import as Task","jira.importing":"Importing...","jira.imported":"Imported!","jira.noIssues":"No issues found","jira.noIssuesHint":"Try changing the filter or search query.","jira.loadMore":"Load More","jira.total":"total","jira.transition":"Change Status","jira.comment":"Comment","jira.commentPlaceholder":"Add a comment...","jira.commentSend":"Send","jira.createIssue":"Create Issue","jira.createSummary":"Summary","jira.createDesc":"Description","jira.createType":"Issue Type","jira.creating":"Creating...","jira.notConfigured":"Jira is not configured. Enable it in project settings.","jira.assignee":"Assignee","jira.unassigned":"Unassigned","jira.updated":"Updated","notion.title":"Notion Pages","notion.search":"Search pages...","notion.refresh":"Refresh","notion.import":"Import as Task","notion.importing":"Importing...","notion.imported":"Imported!","notion.noPages":"No pages found","notion.noPagesHint":"Try changing the search query.","notion.loadMore":"Load More","notion.createPage":"Create Page","notion.pageTitle":"Title","notion.creating":"Creating...","notion.notConfigured":"Notion is not configured. Enable it in project settings.","notion.loadingContent":"Loading content...","notion.noContent":"No content","header.notionTitle":"Notion Integration","header.notionApiKey":"Integration Token","header.notionApiKeyPlaceholder":"ntn_...","header.notionDatabaseId":"Database ID","header.notionDatabaseIdPlaceholder":"e.g. abc123def456...","header.notionTestConnection":"Test Connection","header.notionTesting":"Testing...","header.notionConnected":"Connected","header.notionFailed":"Connection failed","header.notionTokenHint":"Create an integration at notion.so/my-integrations and share the database with it","github.title":"GitHub Issues","github.search":"Search issues...","github.refresh":"Refresh","github.import":"Import as Task","github.importing":"Importing...","github.imported":"Imported!","github.noIssues":"No issues found","github.noIssuesHint":"Try changing the filter or search query.","github.loadMore":"Load More","github.createIssue":"Create Issue","github.issueTitle":"Title","github.issueBody":"Description","github.creating":"Creating...","github.notConfigured":"GitHub is not configured. Enable it in project settings.","github.loadingComments":"Loading comments...","github.comments":"Comments","github.noBody":"No description provided.","github.open":"Open","github.closed":"Closed","github.all":"All","header.githubTitle":"GitHub Integration","header.githubToken":"Personal Access Token","header.githubTokenPlaceholder":"ghp_...","header.githubOwner":"Repository Owner","header.githubOwnerPlaceholder":"username or org","header.githubRepo":"Repository Name","header.githubRepoPlaceholder":"repo-name","header.githubTestConnection":"Test Connection","header.githubTesting":"Testing...","header.githubConnected":"Connected","header.githubFailed":"Connection failed","header.githubTokenHint":"Create a token at github.com/settings/tokens with repo scope","tabs.tasks":"Tasks","tabs.pipelines":"Pipelines","tabs.discussions":"Discussions","tabs.schedules":"Schedules","tabs.jira":"Jira","tabs.notion":"Notion","tabs.github":"GitHub","tabs.git":"Git","discussions.title":"Discussions","discussions.add":"New Discussion","discussions.empty":"No discussions yet","discussions.emptyHint":"Create a discussion to have agents collaborate on a feature.","discussions.round":"Round","discussions.maxRounds":"Max Rounds","discussions.agents":"Agents","discussions.speaking":"Speaking...","discussions.inject":"Send Message","discussions.skipTurn":"Skip Turn","discussions.implement":"Start Implementation","discussions.implementHint":"Select an agent to implement the discussed feature.","discussions.selectAgent":"Select Implementer","discussions.notFound":"Discussion not found","discussions.back":"Back to Discussions","discussions.userMessage":"Your message...","discussions.implementation":"Implementation","discussions.resume":"Resume","discussions.retry":"Retry","discussions.failureTitle":"Discussion Failed","discussions.noErrorLogs":"No error details available","discussions.pause":"Pause","discussions.waiting":"Waiting...","discussions.roundExplain":"One round = each agent speaks once.","discussions.autoImplement":"Auto-implement after discussion","discussions.autoImplementHint":"Automatically start implementation when all rounds complete.","discussions.collapse":"Collapse","discussions.expand":"Expand","discussions.collapseAll":"Collapse All","discussions.expandAll":"Expand All","status.skipped":"Skipped","status.paused":"Paused","agents.title":"Agent Personas","agents.add":"Add Agent","agents.name":"Name","agents.role":"Role","agents.systemPrompt":"System Prompt","agents.cliTool":"CLI Tool","agents.cliModel":"Model","agents.color":"Color","agents.empty":"No agents yet. Create agent personas to start a discussion.","agents.manage":"Manage Agents","agents.presets":"Preset Templates","agents.roles.architect":"Architect","agents.roles.developer":"Developer","agents.roles.reviewer":"Reviewer","agents.roles.pm":"Product Manager","agents.roles.tester":"Tester","agents.roles.custom":"Custom","git.ahead":"ahead","git.behind":"behind","git.staged":"Staged","git.unstaged":"Unstaged","git.noChanges":"Working tree clean","git.refresh":"Refresh","git.files":"files","git.commitHistory":"Commit History","git.branches":"Branches","git.remotes":"Remotes","git.tags":"Tags","git.stashes":"Stashes","git.noCommits":"No commits yet","git.loadMore":"Loading more...","git.author":"Author","git.hash":"Hash","git.graph":"Graph","git.description":"Description","git.date":"Date","git.commit":"Commit","git.pull":"Pull","git.push":"Push","git.fetch":"Fetch","git.branch":"Branch","git.merge":"Merge","git.stash":"Stash","git.discard":"Discard","git.tag":"Tag","git.untracked":"Untracked","git.fileStatus":"File Status","git.stageAll":"Stage All","git.unstageAll":"Unstage All","git.stage":"Stage","git.unstage":"Unstage","git.commitMessage":"Commit message...","git.branchName":"Branch name...","git.tagName":"Tag name...","git.tagMessage":"Tag message (optional)...","git.stashMessage":"Stash message (optional)...","git.selectBranch":"Select branch...","git.discardAll":"Discard All","git.confirmDiscard":"Discard all changes? This cannot be undone.","git.confirmDiscardFile":"Discard changes to this file?","git.newBranch":"New Branch","git.deleteBranch":"Delete Branch","git.stashPop":"Pop","git.noStashes":"No stashes","git.actions":"Actions","git.close":"Close","git.create":"Create","git.delete":"Delete","git.modified":"Modified","git.added":"Added","git.deleted":"Deleted","git.renamed":"Renamed","git.copied":"Copied","lang.toggle":"KO","theme.light":"Light","theme.dark":"Dark"},ko:{"login.title":"CLITrigger","login.subtitle":"인증이 필요합니다","login.password":"비밀번호 입력","login.submit":"로그인","login.loading":"인증 중...","login.error":"접근이 거부되었습니다. 다시 시도해주세요.","login.footer":"보안 접속","login.disclaimer":'This software is provided "as is" without any warranties. Users are solely responsible for all actions taken using this tool, including any costs incurred from AI CLI usage, data loss, or unintended code changes. The developers assume no liability for any direct, indirect, or consequential damages arising from use.',"sidebar.home":"홈","sidebar.workspaces":"워크스페이스","projects.title":"전체 프로젝트","projects.subtitle":"프로젝트 콘솔","projects.new":"새 프로젝트","projects.logout":"로그아웃","projects.loading":"프로젝트 로딩 중...","projects.empty":"프로젝트가 없습니다","projects.emptyHint":"첫 번째 프로젝트를 만들어보세요.","projects.tasks":"작업","projects.active":"실행 중","projects.done":"완료","projects.search":"프로젝트 검색...","projects.delete":"프로젝트 삭제","projects.deleteConfirm":"이 프로젝트를 삭제하시겠습니까?","projects.pathMissing":"경로 없음","projects.pathMissingConfirm":"이 프로젝트의 로컬 폴더가 존재하지 않습니다. 삭제하시겠습니까?","projects.noGit":"Git 없음","detail.back":"프로젝트","detail.loading":"로딩 중...","detail.notFound":"프로젝트를 찾을 수 없습니다","detail.backToProjects":"프로젝트 목록으로","detail.live":"연결됨","header.branch":"브랜치","header.workers":"워커","header.model":"모델","header.settings":"설정","header.runAll":"전체 실행","header.stopAll":"전체 중지","header.config":"프로젝트 설정","header.maxWorkers":"최대 워커 수","settings.defaultMaxTurns":"기본 턴 제한","settings.defaultMaxTurnsHint":"작업별 기본 턴 제한. 개별 작업에서 재설정 가능.","header.cliTool":"CLI 도구","header.aiModel":"AI 모델","header.cliFlags":"CLI 플래그","header.cancel":"취소","header.save":"저장","header.saving":"저장 중...","header.noGit":"Git 없음","header.noGitHint":'이 프로젝트는 Git 저장소가 아닙니다. 작업은 워크트리 격리 없이 직접 실행됩니다. 프로젝트 경로에서 "git init" 실행 후 재확인하세요.',"header.recheckGit":"Git 상태 재확인","header.fallbackChainTitle":"CLI 폴백 체인","header.fallbackChainHint":"CLI 도구의 컨텍스트가 소진되면 체인의 다음 도구로 자동 전환합니다.","header.sandboxTitle":"샌드박스 모드","header.sandboxBadgeStrict":"샌드박스: 엄격","header.sandboxBadgePermissive":"샌드박스: 허용","header.sandboxStrict":"엄격 (권장)","header.sandboxStrictDesc":"CLI 도구가 워크트리 디렉토리 내 파일만 접근할 수 있습니다.","header.sandboxPermissive":"허용","header.sandboxPermissiveDesc":"CLI 도구가 시스템의 모든 파일에 접근할 수 있습니다.","header.sandboxWarning":"경고: 허용 모드에서는 CLI 도구가 워크트리 밖 파일에도 접근할 수 있습니다. 주의해서 사용하세요.","header.worktreeTitle":"워크트리 격리","header.worktreeEnabled":"워크트리 (권장)","header.worktreeEnabledDesc":"각 작업이 독립 브랜치에서 실행됩니다. 병렬 작업에 안전합니다.","header.worktreeDisabled":"직접 실행 (메인 브랜치)","header.worktreeDisabledDesc":"메인 브랜치에서 직접 실행합니다. 최대 워커 1개로 제한됩니다.","header.worktreeWarning":"경고: 메인 브랜치를 직접 수정합니다. 동시 실행이 비활성화됩니다.","header.noWorktreeBadge":"워크트리 없음","header.debugBadge":"디버그 로그","header.showTokenUsageTitle":"토큰 사용량 표시","header.showTokenUsageDesc":"작업 완료 후 토큰 사용량(입력/출력)을 표시합니다.","header.showTokenUsageEnable":"토큰 사용량 표시","header.debugLoggingTitle":"디버그 로깅","header.debugLoggingDesc":"각 태스크 실행 시 CLI 입출력 전체를 .debug-logs/ 파일로 저장합니다.","header.debugLoggingEnable":"디버그 로그 파일 활성화","header.gstackTitle":"gstack 스킬","header.gstackEnabled":"gstack 스킬 주입 활성화","header.gstackCredit":"gstack 기반 (MIT 라이선스, Garry Tan)","header.usageLimit":"사용량","header.gstackClaudeOnly":"gstack 스킬은 Claude CLI에서만 사용 가능합니다.","header.modelSettings":"AI 모델 설정","header.modelValue":"모델 ID","header.modelLabel":"표시 이름","header.addModel":"추가","header.modelSettingsHint":"커스텀 모델을 추가하세요. 모든 프로젝트의 모델 드롭다운에 표시됩니다.","header.jiraTitle":"Jira 연동","header.jiraBaseUrl":"Jira URL","header.jiraBaseUrlPlaceholder":"https://yoursite.atlassian.net","header.jiraEmail":"이메일","header.jiraEmailPlaceholder":"your@email.com","header.jiraApiToken":"API 토큰","header.jiraApiTokenPlaceholder":"Atlassian API 토큰","header.jiraProjectKey":"프로젝트 키","header.jiraProjectKeyPlaceholder":"예: PROJ","header.jiraTestConnection":"연결 테스트","header.jiraTesting":"테스트 중...","header.jiraConnected":"연결 성공","header.jiraFailed":"연결 실패","header.jiraTokenHint":"id.atlassian.com > 보안 > API 토큰에서 생성","form.newProject":"새 프로젝트","form.projectName":"프로젝트 이름","form.folderPath":"폴더 경로","form.cancel":"취소","form.create":"생성","browse.title":"폴더 찾아보기","browse.select":"선택","browse.loading":"불러오는 중...","browse.error":"디렉토리를 불러올 수 없습니다","browse.empty":"폴더가 없습니다","todos.title":"작업 목록","todos.add":"작업 추가","todos.empty":"작업이 없습니다","todos.emptyHint":"작업을 추가해보세요.","todos.merge":"병합","todo.description":"설명","todo.noDescription":"설명이 없습니다.","todo.attachedImages":"첨부 이미지","todo.branch":"브랜치","todo.path":"경로","todo.mergeFailed":"병합 실패","todo.diffError":"Diff 오류","todo.diffOutput":"변경사항","todo.files":"파일","todo.systemLog":"활동 로그","todo.start":"시작","todo.startHeadless":"Headless: 자율 실행. 모든 권한 자동 승인. 사용자 입력 불필요.","todo.startInteractive":"Interactive: stdin을 열어두고 실행 중 AI에게 메시지 전송 가능. 모든 권한 자동 승인.","todo.startVerbose":"Verbose: 자동 승인 + 모든 로그 출력. 도구 호출, 입력값, 결과, 시스템 이벤트를 실시간으로 표시.","todo.sendPlaceholder":"메시지 입력...","todo.startWithDependency":"선행 작업 먼저 시작","todo.stop":"중지","todo.viewDiff":"Diff 보기","todo.viewDebugLog":"디버그 로그","todo.merge":"병합","todo.mergeChain":"체인 병합","todo.mergeChainDesc":"이 체인의 모든 작업을 메인 브랜치에 병합","todo.chainComplete":"체인 완료","todo.chainTasks":"{count}개 작업","todo.edit":"편집","todo.delete":"삭제","todo.cleanup":"워크트리 삭제","todo.cleanupFailed":"정리 실패","todo.retry":"처음부터 다시: 이전 워크트리를 정리하고, 로그를 삭제한 후 작업을 처음부터 다시 실행합니다.","todo.retryFailed":"재시도 실패","todo.continue":"이어서: 같은 워크트리/브랜치에서 후속 프롬프트를 실행해 기존 작업을 이어갑니다 (새 라운드).","todo.continuing":"이어가는 중...","todo.confirmContinue":"이어서 실행","todo.continuePromptLabel":"후속 프롬프트","todo.continuePromptPlaceholder":"이 워크트리에 적용할 다음 지시사항을 입력하세요...","todo.continuePromptRequired":"후속 프롬프트를 입력해주세요.","todo.roundLabel":"라운드","todo.dependsOn":"선행 작업","todo.mergedFrom":"이전 작업에서 병합","todo.transferredTo":"작업 이전됨","todo.schedule":"예약: 이 작업을 특정 시간에 1회 실행되도록 스케줄로 변환합니다.","todo.scheduleAt":"실행 시각","todo.scheduling":"예약 중...","todo.confirmSchedule":"예약","todo.scheduleKeepOriginal":"원본 작업 유지","todoForm.titlePlaceholder":"작업 제목...","todoForm.descPlaceholder":"설명 (선택사항)...","todoForm.cliTool":"CLI 도구","todoForm.aiModel":"AI 모델","todoForm.addImage":"이미지 추가","todoForm.pasteHint":"Ctrl+V로 이미지 붙여넣기","todoForm.images":"이미지","todoForm.maxTurns":"최대 턴 수","todoForm.maxTurnsPlaceholder":"제한 없음","todoForm.maxTurnsHint":"에이전트 턴 수를 제한하여 과도한 토큰 사용을 방지합니다.","todoForm.dependsOn":"선행 작업","todoForm.noDependency":"없음 (독립 작업)","todoForm.dependsOnHint":"선행 작업이 완료되면 변경사항을 스쿼시 머지하고 새 브랜치에서 실행됩니다.","todoForm.cancel":"취소","todoForm.save":"저장","dnd.dropHint":"이 작업 이후에 실행","dnd.removeDep":"의존성 제거","dnd.dropToRemoveDep":"여기에 놓으면 의존성 제거","dnd.cyclicWarning":"순환 의존성으로 연결할 수 없습니다","graph.autoLayout":"자동 정렬","graph.listView":"리스트 보기","graph.graphView":"그래프 보기","status.pending":"대기","status.running":"실행 중","status.completed":"완료","status.failed":"실패","status.stopped":"중지","status.merged":"병합됨","progress.complete":"완료","progress.done":"완료","progress.live":"실행 중","progress.idle":"대기","progress.fail":"실패","progress.stop":"중지","progress.merged":"병합됨","failure.title":"실패 원인","failure.exitCode":"종료 코드","failure.fix":"수정하기: 실패 원인을 분석하고 문제를 수정하는 새 작업을 생성합니다.","failure.fixPrefix":"[수정] ","result.duration":"소요 시간","result.commits":"커밋","result.filesChanged":"파일 변경","result.commitHistory":"커밋 이력","result.changedFiles":"변경된 파일","result.tokenUsage":"토큰 사용량","result.inputTokens":"입력","result.outputTokens":"출력","result.totalCost":"비용","result.cacheTokens":"캐시","result.turns":"턴","result.contextUsed":"사용","result.levelLight":"가벼움","result.levelModerate":"보통","result.levelHigh":"많음","result.levelHeavy":"과다","log.awaiting":"출력 대기 중...","log.waitingResponse":"응답 대기 중...","log.noChanges":"변경사항이 없습니다.","log.copy":"복사","log.copied":"복사됨!","schedules.title":"스케줄","schedules.add":"새 스케줄","schedules.empty":"스케줄이 없습니다","schedules.emptyHint":"반복 작업을 자동화할 스케줄을 만들어보세요.","schedule.type":"스케줄 유형","schedule.recurring":"반복","schedule.once":"1회","schedule.runAtLabel":"실행 시각","schedule.cronExpression":"실행 주기","schedule.cronHint":"예: */30 * * * * (30분마다), 0 9 * * * (매일 9시), 0 9 * * 1-5 (평일 9시)","cron.everyMinutes":"분 간격","cron.hourly":"매시간","cron.daily":"매일","cron.weekly":"매주","cron.monthly":"매월","cron.custom":"직접 입력","cron.every":"매","cron.minutesLabel":"분마다","cron.everyHourAt":"매시간","cron.minutesPast":"분에","cron.everyDayAt":"매일","cron.at":"시간","cron.everyMonthOn":"매월","cron.dayAt":"일","cron.expression":"Cron","cron.mon":"월","cron.tue":"화","cron.wed":"수","cron.thu":"목","cron.fri":"금","cron.sat":"토","cron.sun":"일","schedule.skipIfRunning":"이전 실행이 진행 중이면 건너뛰기","schedule.active":"활성","schedule.paused":"일시정지","schedule.lastRun":"마지막 실행","schedule.never":"없음","schedule.trigger":"즉시 실행","schedule.activate":"활성화","schedule.pause":"일시정지","schedule.edit":"편집","schedule.delete":"삭제","schedule.runs":"실행 이력","schedule.runTriggered":"실행됨","schedule.runSkipped":"건너뜀","schedule.runCompleted":"완료","schedule.runFailed":"실패","schedule.noRuns":"실행 이력이 없습니다","scheduleForm.titlePlaceholder":"스케줄 제목...","scheduleForm.descPlaceholder":"작업 설명 템플릿...","scheduleForm.cliTool":"CLI 도구","scheduleForm.aiModel":"AI 모델","scheduleForm.cancel":"취소","scheduleForm.save":"저장","pipelines.title":"파이프라인","pipelines.add":"새 파이프라인","pipelines.empty":"파이프라인이 없습니다","pipelines.emptyHint":"파이프라인을 만들어 AI 기반 다단계 기능 개발을 자동화하세요.","pipelines.emptyDesc":"파이프라인은 5단계 AI 프로세스를 순차 실행합니다: 계획, 구현, 리뷰, 피드백 반영, 문서화 — 모두 격리된 브랜치에서 진행됩니다.","pipeline.phase":"단계","pipeline.phases":"파이프라인 단계","pipeline.start":"파이프라인 시작","pipeline.resume":"재개","pipeline.retry":"재시도","pipeline.pause":"일시정지","pipeline.skipPhase":"단계 건너뛰기","pipeline.retryPhase":"단계 재시도","pipeline.viewDiff":"Diff 보기","pipeline.hideDiff":"Diff 숨기기","pipeline.merge":"병합","pipeline.merging":"병합 중...","pipeline.cleanup":"워크트리 정리","pipeline.cleaning":"정리 중...","pipeline.creating":"생성 중...","pipeline.create":"파이프라인 생성","pipeline.diffOutput":"Diff 결과","pipeline.files":"파일","pipeline.noChanges":"변경사항이 없습니다.","pipeline.phaseOutput":"단계 출력 (클릭하여 펼치기)","pipeline.loadingLogs":"로그 로딩 중...","pipeline.awaitingOutput":"출력 대기 중...","pipeline.notFound":"파이프라인을 찾을 수 없습니다","pipeline.backToProject":"프로젝트로 돌아가기","pipeline.branch":"브랜치","pipeline.featureTitle":"기능 제목","pipeline.featureDesc":"기능 설명","pipeline.featureDescHint":"기능을 상세히 설명하세요. 이 내용이 각 파이프라인 단계의 AI 프롬프트로 사용됩니다...","pipeline.featureTitleHint":"예: 사용자 인증 추가","pipeline.planning":"계획","pipeline.implementation":"구현","pipeline.review":"리뷰","pipeline.feedback":"피드백","pipeline.documentation":"문서화","pipeline.planningFull":"계획 (Planning)","pipeline.implementationFull":"구현 (Implementation)","pipeline.reviewFull":"리뷰 (Review)","pipeline.feedbackFull":"피드백 반영 (Feedback)","pipeline.documentationFull":"문서화 (Documentation)","jira.title":"Jira 이슈","jira.search":"이슈 검색...","jira.allStatuses":"모든 상태","jira.refresh":"새로고침","jira.import":"작업으로 가져오기","jira.importing":"가져오는 중...","jira.imported":"가져옴!","jira.noIssues":"이슈가 없습니다","jira.noIssuesHint":"필터나 검색어를 변경해보세요.","jira.loadMore":"더 보기","jira.total":"건","jira.transition":"상태 변경","jira.comment":"댓글","jira.commentPlaceholder":"댓글 입력...","jira.commentSend":"전송","jira.createIssue":"이슈 생성","jira.createSummary":"제목","jira.createDesc":"설명","jira.createType":"이슈 유형","jira.creating":"생성 중...","jira.notConfigured":"Jira가 설정되지 않았습니다. 프로젝트 설정에서 활성화하세요.","jira.assignee":"담당자","jira.unassigned":"미배정","jira.updated":"업데이트","notion.title":"Notion 페이지","notion.search":"페이지 검색...","notion.refresh":"새로고침","notion.import":"작업으로 가져오기","notion.importing":"가져오는 중...","notion.imported":"가져옴!","notion.noPages":"페이지가 없습니다","notion.noPagesHint":"검색어를 변경해보세요.","notion.loadMore":"더 보기","notion.createPage":"페이지 생성","notion.pageTitle":"제목","notion.creating":"생성 중...","notion.notConfigured":"Notion이 설정되지 않았습니다. 프로젝트 설정에서 활성화하세요.","notion.loadingContent":"콘텐츠 로딩 중...","notion.noContent":"콘텐츠 없음","header.notionTitle":"Notion 연동","header.notionApiKey":"통합 토큰","header.notionApiKeyPlaceholder":"ntn_...","header.notionDatabaseId":"데이터베이스 ID","header.notionDatabaseIdPlaceholder":"예: abc123def456...","header.notionTestConnection":"연결 테스트","header.notionTesting":"테스트 중...","header.notionConnected":"연결 성공","header.notionFailed":"연결 실패","header.notionTokenHint":"notion.so/my-integrations에서 통합을 생성하고 데이터베이스를 공유하세요","github.title":"GitHub 이슈","github.search":"이슈 검색...","github.refresh":"새로고침","github.import":"작업으로 가져오기","github.importing":"가져오는 중...","github.imported":"가져옴!","github.noIssues":"이슈가 없습니다","github.noIssuesHint":"필터나 검색어를 변경해보세요.","github.loadMore":"더 보기","github.createIssue":"이슈 생성","github.issueTitle":"제목","github.issueBody":"설명","github.creating":"생성 중...","github.notConfigured":"GitHub이 설정되지 않았습니다. 프로젝트 설정에서 활성화하세요.","github.loadingComments":"댓글 로딩 중...","github.comments":"댓글","github.noBody":"설명이 없습니다.","github.open":"열림","github.closed":"닫힘","github.all":"전체","header.githubTitle":"GitHub 연동","header.githubToken":"개인 액세스 토큰","header.githubTokenPlaceholder":"ghp_...","header.githubOwner":"저장소 소유자","header.githubOwnerPlaceholder":"사용자명 또는 조직","header.githubRepo":"저장소 이름","header.githubRepoPlaceholder":"repo-name","header.githubTestConnection":"연결 테스트","header.githubTesting":"테스트 중...","header.githubConnected":"연결 성공","header.githubFailed":"연결 실패","header.githubTokenHint":"github.com/settings/tokens에서 repo 권한으로 토큰을 생성하세요","tabs.tasks":"작업","tabs.pipelines":"파이프라인","tabs.discussions":"토론","tabs.schedules":"스케줄","tabs.jira":"Jira","tabs.notion":"Notion","tabs.github":"GitHub","tabs.git":"Git","discussions.title":"에이전트 토론","discussions.add":"새 토론","discussions.empty":"아직 토론이 없습니다","discussions.emptyHint":"에이전트들이 피쳐를 함께 토론하도록 새 토론을 만드세요.","discussions.round":"라운드","discussions.maxRounds":"최대 라운드","discussions.agents":"에이전트","discussions.speaking":"발언 중...","discussions.inject":"메시지 전송","discussions.skipTurn":"턴 건너뛰기","discussions.implement":"구현 시작","discussions.implementHint":"토론된 기능을 구현할 에이전트를 선택하세요.","discussions.selectAgent":"구현 에이전트 선택","discussions.notFound":"토론을 찾을 수 없습니다","discussions.back":"토론 목록으로","discussions.userMessage":"메시지를 입력하세요...","discussions.implementation":"구현","discussions.resume":"재개","discussions.retry":"다시 실행","discussions.failureTitle":"토론 실패","discussions.noErrorLogs":"에러 상세 정보가 없습니다","discussions.pause":"일시 중지","discussions.waiting":"대기 중...","discussions.roundExplain":"에이전트 전원이 한 번씩 발언하는 단위입니다.","discussions.autoImplement":"토론 후 자동 구현","discussions.autoImplementHint":"모든 라운드 완료 후 자동으로 구현을 시작합니다.","discussions.collapse":"접기","discussions.expand":"펼치기","discussions.collapseAll":"전체 접기","discussions.expandAll":"전체 펼치기","status.skipped":"건너뜀","status.paused":"일시 중지","agents.title":"에이전트 페르소나","agents.add":"에이전트 추가","agents.name":"이름","agents.role":"역할","agents.systemPrompt":"시스템 프롬프트","agents.cliTool":"CLI 도구","agents.cliModel":"모델","agents.color":"색상","agents.empty":"에이전트가 없습니다. 토론을 시작하려면 에이전트 페르소나를 만드세요.","agents.manage":"에이전트 관리","agents.presets":"프리셋 템플릿","agents.roles.architect":"아키텍트","agents.roles.developer":"개발자","agents.roles.reviewer":"리뷰어","agents.roles.pm":"PM","agents.roles.tester":"테스터","agents.roles.custom":"사용자 정의","git.ahead":"앞섬","git.behind":"뒤처짐","git.staged":"스테이징","git.unstaged":"변경됨","git.noChanges":"작업 트리 깨끗","git.refresh":"새로고침","git.files":"파일","git.commitHistory":"커밋 히스토리","git.branches":"브랜치","git.remotes":"원격","git.tags":"태그","git.stashes":"스태시","git.noCommits":"아직 커밋이 없습니다","git.loadMore":"더 불러오는 중...","git.author":"작성자","git.hash":"해시","git.graph":"그래프","git.description":"설명","git.date":"날짜","git.commit":"커밋","git.pull":"Pull","git.push":"Push","git.fetch":"패치","git.branch":"브랜치","git.merge":"병합","git.stash":"스태시","git.discard":"폐기","git.tag":"태그","git.untracked":"추적 안 됨","git.fileStatus":"파일 상태","git.stageAll":"모두 스테이지","git.unstageAll":"모두 언스테이지","git.stage":"스테이지","git.unstage":"언스테이지","git.commitMessage":"커밋 메시지...","git.branchName":"브랜치 이름...","git.tagName":"태그 이름...","git.tagMessage":"태그 메시지 (선택)...","git.stashMessage":"스태시 메시지 (선택)...","git.selectBranch":"브랜치 선택...","git.discardAll":"모두 폐기","git.confirmDiscard":"모든 변경 사항을 폐기하시겠습니까? 되돌릴 수 없습니다.","git.confirmDiscardFile":"이 파일의 변경 사항을 폐기하시겠습니까?","git.newBranch":"새 브랜치","git.deleteBranch":"브랜치 삭제","git.stashPop":"꺼내기","git.noStashes":"스태시 없음","git.actions":"작업","git.close":"닫기","git.create":"생성","git.delete":"삭제","git.modified":"수정됨","git.added":"추가됨","git.deleted":"삭제됨","git.renamed":"이름변경","git.copied":"복사됨","lang.toggle":"EN","theme.light":"라이트","theme.dark":"다크"}},TE=C.createContext(null);function BD({children:e}){const[t,n]=C.useState(()=>{const o=localStorage.getItem("clitrigger-lang");return o==="ko"||o==="en"?o:"ko"}),a=C.useCallback(()=>{n(o=>{const c=o==="en"?"ko":"en";return localStorage.setItem("clitrigger-lang",c),c})},[]),s=C.useMemo(()=>qD(),[]),l=C.useCallback(o=>ID[t][o]??s[t][o]??o,[t,s]);return d.jsx(TE.Provider,{value:{lang:t,toggleLang:a,t:l},children:e})}function Ue(){const e=C.useContext(TE);if(!e)throw new Error("useI18n must be used within I18nProvider");return e}function HD({onLogin:e}){const[t,n]=C.useState(""),[a,s]=C.useState(""),[l,o]=C.useState(!1),{t:c,toggleLang:f}=Ue(),h=async g=>{if(g.preventDefault(),!!t){s(""),o(!0);try{await e(t)}catch{s(c("login.error"))}finally{o(!1)}}};return d.jsxs("div",{className:"min-h-screen bg-theme-bg flex items-center justify-center px-4 relative",children:[d.jsx("button",{onClick:f,className:"lang-toggle absolute top-6 right-6",children:c("lang.toggle")}),d.jsxs("div",{className:"w-full max-w-sm animate-fade-in",children:[d.jsxs("div",{className:"text-center mb-10",children:[d.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-accent/10 mb-5",children:d.jsx("svg",{className:"w-8 h-8 text-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 7.5l3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0021 18V6a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 6v12a2.25 2.25 0 002.25 2.25z"})})}),d.jsx("h1",{className:"text-2xl font-semibold text-theme-text",children:c("login.title")}),d.jsx("p",{className:"text-theme-muted text-sm mt-2",children:c("login.subtitle")})]}),d.jsx("form",{onSubmit:h,children:d.jsxs("div",{className:"card p-8",children:[d.jsx("label",{className:"block text-sm font-medium text-theme-text-secondary mb-2",children:c("login.password")}),d.jsx("input",{type:"password",value:t,onChange:g=>n(g.target.value),placeholder:"*************",className:"input-field text-base",autoFocus:!0}),a&&d.jsx("div",{className:"mt-4 py-2.5 px-4 bg-status-error/5 border border-status-error/20 rounded-xl text-sm text-status-error",children:a}),d.jsx("button",{type:"submit",disabled:!t||l,className:"btn-primary w-full mt-6 py-3",children:c(l?"login.loading":"login.submit")})]})}),d.jsx("div",{className:"mt-6 text-center text-xs text-theme-text-tertiary",children:c("login.footer")}),d.jsx("div",{className:"mt-4 px-2 py-3 rounded-xl text-xs text-theme-text-tertiary border leading-relaxed text-center",children:c("login.disclaimer")})]})]})}function PD(e){return qe("/api/projects/browse",{initialPath:e})}function AE(){return rt("/api/projects")}function FD(e){return rt(`/api/projects/${e}`)}function UD(e){return qe("/api/projects",e)}function $D(e,t){return qs(`/api/projects/${e}`,t)}function ME(e,t){const n=t?`?todoId=${encodeURIComponent(t)}`:"";return rt(`/api/projects/${e}/debug-logs${n}`)}function GD(e){return qa(`/api/projects/${e}`)}function VD(e){return qe(`/api/projects/${e}/start`)}function YD(e){return qe(`/api/projects/${e}/stop`)}function RE(e){return rt(`/api/projects/${e}/status`)}function XD(e){return qe(`/api/projects/${e}/check-git`)}function KD(e,t){return rt(`/api/projects/${e}/git-status`)}function WD(e,t=0,n=50,a){const s=new URLSearchParams({skip:String(t),limit:String(n)});return rt(`/api/projects/${e}/git-log?${s}`)}function QD(e,t){return rt(`/api/projects/${e}/git-refs`)}function Ju(e,t){return qe(`/api/projects/${e}/git-stage`,{files:t})}function _j(e,t){return qe(`/api/projects/${e}/git-unstage`,{files:t})}function ZD(e,t){return qe(`/api/projects/${e}/git-commit`,{message:t})}function JD(e,t,n){return qe(`/api/projects/${e}/git-pull`,{remote:t,branch:n})}function eO(e,t,n,a){return qe(`/api/projects/${e}/git-push`,{remote:t,branch:n,setUpstream:a})}function tO(e,t,n){return qe(`/api/projects/${e}/git-fetch`,{remote:t,prune:n})}function nO(e,t,n){return qe(`/api/projects/${e}/git-branch`,{name:t,startPoint:n})}function rO(e,t,n){return qe(`/api/projects/${e}/git-branch-delete`,{name:t,force:n})}function aO(e,t){return qe(`/api/projects/${e}/git-checkout`,{branch:t})}function iO(e,t){return qe(`/api/projects/${e}/git-merge`,{branch:t})}function sO(e,t){return qe(`/api/projects/${e}/git-stash`,{message:t})}function lO(e,t){return qe(`/api/projects/${e}/git-stash-pop`,{index:t})}function oO(e){return rt(`/api/projects/${e}/git-stash-list`)}function LE(e,t,n){return qe(`/api/projects/${e}/git-discard`,{files:t,all:n})}function uO(e,t,n,a){return qe(`/api/projects/${e}/git-tag`,{name:t,message:n,commit:a})}const DE=C.createContext({theme:"light",toggleTheme:()=>{}});function cO(){const[e,t]=C.useState(()=>{const a=localStorage.getItem("theme");return a==="light"||a==="dark"?a:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"});C.useEffect(()=>{document.documentElement.setAttribute("data-theme",e),localStorage.setItem("theme",e)},[e]);const n=C.useCallback(()=>{t(a=>a==="light"?"dark":"light")},[]);return{theme:e,toggleTheme:n}}function OE(){return C.useContext(DE)}function dO({onLogout:e,authRequired:t,connected:n,onEvent:a,onClose:s}){var k;const[l,o]=C.useState([]),[c,f]=C.useState({}),h=yr(),{t:g,toggleLang:p}=Ue(),{theme:x,toggleTheme:y}=OE(),w=((k=h.pathname.match(/^\/projects\/([^/]+)/))==null?void 0:k[1])||null;C.useEffect(()=>{j()},[]),C.useEffect(()=>{const N=()=>j();return window.addEventListener("projects:changed",N),()=>window.removeEventListener("projects:changed",N)},[]),C.useEffect(()=>a(N=>{N.type==="project:status-changed"&&N.projectId&&f(_=>({..._,[N.projectId]:{running:N.running??0,completed:N.completed??0,total:N.total??0}}))}),[a]);function j(){AE().then(N=>{o(N),N.forEach(_=>{RE(_.id).then(E=>{f(M=>({...M,[_.id]:E}))}).catch(()=>{})})}).catch(()=>{})}const S=()=>{s==null||s()};return d.jsxs("div",{className:"flex flex-col h-full",children:[d.jsx("div",{className:"px-4 pt-5 pb-3",children:d.jsx(Hn,{to:"/",onClick:S,className:"block",children:d.jsxs("svg",{viewBox:"0 0 200 32",fill:"none",className:"h-6 w-auto",children:[d.jsxs("text",{x:"0",y:"24",fontFamily:"'JetBrains Mono', monospace",fontSize:"22",fontWeight:"500",fill:"var(--color-accent)",opacity:"0.5",children:[">","_"]}),d.jsx("text",{x:"38",y:"24",fontFamily:"'JetBrains Mono', monospace",fontSize:"22",fontWeight:"700",fill:"var(--color-accent)",children:"CLI"}),d.jsx("text",{x:"96",y:"24",fontFamily:"'JetBrains Mono', monospace",fontSize:"22",fontWeight:"500",fill:"var(--color-text-primary)",children:"Trigger"})]})})}),d.jsx("nav",{className:"px-3 mb-2",children:d.jsxs(Hn,{to:"/",onClick:S,className:"flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors",style:h.pathname==="/"?{backgroundColor:"var(--color-bg-hover)",color:"var(--color-text-primary)"}:{color:"var(--color-text-tertiary)"},children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"})}),g("sidebar.home")]})}),d.jsx("div",{className:"mx-4 border-t",style:{borderColor:"var(--color-border)"}}),d.jsxs("div",{className:"flex-1 overflow-y-auto px-3 pt-3",children:[d.jsx("div",{className:"px-3 mb-2 text-[10px] font-semibold uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:g("sidebar.workspaces")}),d.jsx("div",{className:"space-y-0.5",children:l.map(N=>{const _=c[N.id],E=w===String(N.id),M=_&&_.running>0;return d.jsxs(Hn,{to:`/projects/${N.id}`,onClick:S,className:"flex items-center gap-2.5 px-3 py-1.5 rounded-lg text-sm transition-colors",style:E?{backgroundColor:"var(--color-bg-hover)",color:"var(--color-text-primary)"}:{color:"var(--color-text-tertiary)"},children:[d.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${M?"bg-status-running animate-pulse":""}`,style:M?void 0:{backgroundColor:"var(--color-text-faint)"}}),d.jsx("span",{className:"truncate",children:N.name})]},N.id)})})]}),d.jsxs("div",{className:"px-3 pb-4 pt-2 space-y-1",style:{borderTop:"1px solid var(--color-border)"},children:[d.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 text-xs",style:{color:"var(--color-text-muted)"},children:[d.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${n?"bg-status-success":"bg-status-error"}`}),n?g("detail.live"):"Disconnected"]}),d.jsxs("div",{className:"flex items-center gap-1 px-1",children:[d.jsx("button",{onClick:y,className:"flex items-center justify-center w-8 h-8 rounded-lg transition-colors",style:{color:"var(--color-text-tertiary)"},title:g(x==="light"?"theme.dark":"theme.light"),children:x==="light"?d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z"})}):d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z"})})}),d.jsx("button",{onClick:p,className:"flex items-center justify-center w-8 h-8 rounded-lg transition-colors text-xs font-medium",style:{color:"var(--color-text-tertiary)"},children:g("lang.toggle")}),t&&d.jsx("button",{onClick:e,className:"flex items-center justify-center w-8 h-8 rounded-lg transition-colors ml-auto",style:{color:"var(--color-text-tertiary)"},title:g("projects.logout"),children:d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9"})})})]})]})]})}function fO({children:e,onLogout:t,authRequired:n,connected:a,onEvent:s}){const[l,o]=C.useState(!1);return d.jsxs("div",{className:"flex h-screen",style:{backgroundColor:"var(--color-bg-primary)"},children:[d.jsx("aside",{className:`
61
+ fixed inset-y-0 left-0 z-40 w-60 flex-shrink-0
62
+ transform transition-transform duration-200 ease-in-out
63
+ md:translate-x-0 md:static md:z-auto
64
+ ${l?"translate-x-0":"-translate-x-full"}
65
+ `,style:{backgroundColor:"var(--color-bg-secondary)"},children:d.jsx(dO,{onLogout:t,authRequired:n,connected:a,onEvent:s,onClose:()=>o(!1)})}),l&&d.jsx("div",{className:"fixed inset-0 z-30 bg-black/50 md:hidden",onClick:()=>o(!1)}),d.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0",children:[d.jsxs("div",{className:"md:hidden flex items-center px-4 py-3 border-b",style:{borderColor:"var(--color-border)"},children:[d.jsx("button",{onClick:()=>o(!0),className:"p-1.5 rounded-lg hover:bg-white/5 transition-colors",style:{color:"var(--color-text-secondary)"},children:d.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})})}),d.jsx("span",{className:"ml-3 text-sm font-semibold",style:{color:"var(--color-text-primary)"},children:"CLITrigger"})]}),d.jsx("main",{className:"flex-1 overflow-y-auto",children:e})]})]})}function hO({onSubmit:e,onCancel:t}){const[n,a]=C.useState(""),[s,l]=C.useState(""),[o,c]=C.useState(!1),{t:f}=Ue(),h=p=>{p.preventDefault(),!(!n.trim()||!s.trim())&&e(n.trim(),s.trim())},g=async()=>{c(!0);try{const p=await PD(s||void 0);p.path&&l(p.path)}catch{}c(!1)};return d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30 backdrop-blur-sm p-4",children:d.jsx("div",{className:"w-full max-w-md animate-scale-in",children:d.jsxs("div",{className:"card p-8 shadow-elevated",children:[d.jsx("h2",{className:"text-lg font-semibold text-warm-800 mb-6",children:f("form.newProject")}),d.jsxs("form",{onSubmit:h,children:[d.jsxs("div",{className:"mb-5",children:[d.jsx("label",{className:"block text-sm font-medium text-warm-600 mb-2",children:f("form.projectName")}),d.jsx("input",{type:"text",placeholder:"my-project",value:n,onChange:p=>a(p.target.value),className:"input-field",autoFocus:!0})]}),d.jsxs("div",{className:"mb-8",children:[d.jsx("label",{className:"block text-sm font-medium text-warm-600 mb-2",children:f("form.folderPath")}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"text",placeholder:"C:/Projects/my-project",value:s,onChange:p=>l(p.target.value),className:"input-field text-sm flex-1"}),d.jsx("button",{type:"button",onClick:g,disabled:o,className:"btn-ghost text-sm px-3 shrink-0",title:f("browse.title"),children:o?d.jsxs("svg",{className:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),d.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})})]})]}),d.jsxs("div",{className:"flex justify-end gap-3",children:[d.jsx("button",{type:"button",onClick:t,className:"btn-ghost text-sm",children:f("form.cancel")}),d.jsx("button",{type:"submit",disabled:!n.trim()||!s.trim(),className:"btn-primary text-sm",children:f("form.create")})]})]})]})})})}const mO=80,Nj=120,Vr=180,Cj=.03,Ej=8;function pO(){const e=C.useRef(null),t=C.useRef({x:-1e3,y:-1e3}),n=C.useRef([]),a=C.useRef(0);return C.useEffect(()=>{const s=e.current;if(!s)return;const l=s.getContext("2d");if(!l)return;let o=0,c=0;function f(){const y=s.parentElement;y&&(o=y.clientWidth,c=y.clientHeight,s.width=o*window.devicePixelRatio,s.height=c*window.devicePixelRatio,s.style.width=`${o}px`,s.style.height=`${c}px`,l.setTransform(window.devicePixelRatio,0,0,window.devicePixelRatio,0,0),h())}function h(){n.current=[];for(let y=0;y<mO;y++){const w=Math.random()*o,j=Math.random()*c;n.current.push({x:w,y:j,baseX:w,baseY:j,vx:(Math.random()-.5)*.3,vy:(Math.random()-.5)*.3,size:Math.random()*1.5+.5,alpha:Math.random()*.4+.1})}}function g(y){const w=s.getBoundingClientRect();t.current.x=y.clientX-w.left,t.current.y=y.clientY-w.top}function p(){t.current.x=-1e3,t.current.y=-1e3}function x(){if(!l)return;l.clearRect(0,0,o,c);const y=n.current,w=t.current;for(const j of y){const S=j.x-w.x,k=j.y-w.y,N=Math.sqrt(S*S+k*k);if(N<Vr&&N>0){const _=(Vr-N)/Vr,E=Math.atan2(k,S);j.vx+=Math.cos(E)*_*Ej*.05,j.vy+=Math.sin(E)*_*Ej*.05}j.vx+=(j.baseX-j.x)*Cj,j.vy+=(j.baseY-j.y)*Cj,j.baseX+=(Math.random()-.5)*.1,j.baseY+=(Math.random()-.5)*.1,j.baseX<0&&(j.baseX=0),j.baseX>o&&(j.baseX=o),j.baseY<0&&(j.baseY=0),j.baseY>c&&(j.baseY=c),j.vx*=.92,j.vy*=.92,j.x+=j.vx,j.y+=j.vy}for(let j=0;j<y.length;j++){for(let _=j+1;_<y.length;_++){const E=y[j].x-y[_].x,M=y[j].y-y[_].y,T=Math.sqrt(E*E+M*M);if(T<Nj){const R=(1-T/Nj)*.15;l.beginPath(),l.strokeStyle=`rgba(75, 141, 255, ${R})`,l.lineWidth=.5,l.moveTo(y[j].x,y[j].y),l.lineTo(y[_].x,y[_].y),l.stroke()}}const S=y[j].x-w.x,k=y[j].y-w.y,N=Math.sqrt(S*S+k*k);if(N<Vr){const _=(1-N/Vr)*.3;l.beginPath(),l.strokeStyle=`rgba(75, 141, 255, ${_})`,l.lineWidth=.8,l.moveTo(y[j].x,y[j].y),l.lineTo(w.x,w.y),l.stroke()}}for(const j of y){const S=j.x-w.x,k=j.y-w.y,N=Math.sqrt(S*S+k*k),_=N<Vr?j.alpha+(1-N/Vr)*.5:j.alpha;l.beginPath(),l.arc(j.x,j.y,j.size,0,Math.PI*2),l.fillStyle=`rgba(75, 141, 255, ${_})`,l.fill(),N<Vr&&(l.beginPath(),l.arc(j.x,j.y,j.size*3,0,Math.PI*2),l.fillStyle=`rgba(75, 141, 255, ${(1-N/Vr)*.08})`,l.fill())}a.current=requestAnimationFrame(x)}return f(),s.addEventListener("mousemove",g),s.addEventListener("mouseleave",p),window.addEventListener("resize",f),a.current=requestAnimationFrame(x),()=>{cancelAnimationFrame(a.current),s.removeEventListener("mousemove",g),s.removeEventListener("mouseleave",p),window.removeEventListener("resize",f)}},[]),d.jsx("canvas",{ref:e,className:"absolute inset-0 pointer-events-auto",style:{zIndex:0}})}function gO({onEvent:e}){const[t,n]=C.useState([]),[a,s]=C.useState({}),[l,o]=C.useState(!1),[c,f]=C.useState(!0),[h,g]=C.useState(""),{t:p}=Ue();C.useEffect(()=>{AE().then(j=>{n(j),j.forEach(S=>{RE(S.id).then(k=>{s(N=>({...N,[S.id]:k}))}).catch(()=>{})})}).catch(()=>{}).finally(()=>f(!1))},[]),C.useEffect(()=>e(j=>{j.type==="project:status-changed"&&j.projectId&&s(S=>({...S,[j.projectId]:{running:j.running??0,completed:j.completed??0,total:j.total??0}}))}),[e]);const x=async(j,S)=>{try{const k=await UD({name:j,path:S});n(N=>[...N,k]),o(!1),window.dispatchEvent(new Event("projects:changed"))}catch{}},y=async(j,S,k=!1)=>{if(S.preventDefault(),S.stopPropagation(),!(!k&&!confirm(p("projects.deleteConfirm"))))try{await GD(j),n(N=>N.filter(_=>_.id!==j)),window.dispatchEvent(new Event("projects:changed"))}catch{}},w=h?t.filter(j=>j.name.toLowerCase().includes(h.toLowerCase())||j.path.toLowerCase().includes(h.toLowerCase())):t;return d.jsxs("div",{className:"px-6 py-6 sm:px-8 sm:py-8 relative min-h-full",children:[d.jsx(pO,{}),d.jsxs("div",{className:"relative",style:{zIndex:1},children:[d.jsxs("div",{className:"flex items-center justify-between gap-4 mb-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-xl font-semibold",style:{color:"var(--color-text-primary)"},children:p("projects.title")}),d.jsxs("p",{className:"text-sm mt-0.5",style:{color:"var(--color-text-tertiary)"},children:[w.length," ",p("projects.tasks")]})]}),d.jsxs("button",{onClick:()=>o(!0),className:"btn-primary text-sm",children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})}),d.jsx("span",{className:"hidden sm:inline",children:p("projects.new")})]})]}),d.jsxs("div",{className:"mb-6 relative",children:[d.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",style:{color:"var(--color-text-muted)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"})}),d.jsx("input",{type:"text",value:h,onChange:j=>g(j.target.value),placeholder:p("projects.search"),className:"w-full pl-10 pr-4 py-2.5 rounded-xl text-sm transition-all duration-200 focus:outline-none focus:ring-2",style:{backgroundColor:"var(--color-bg-input)",borderColor:"var(--color-border)",color:"var(--color-text-primary)",border:"1px solid var(--color-border)"}})]}),c?d.jsx("div",{className:"text-center py-20 animate-fade-in",style:{color:"var(--color-text-muted)"},children:p("projects.loading")}):w.length===0?d.jsxs("div",{className:"text-center py-20 animate-fade-in",children:[d.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl mb-4",style:{backgroundColor:"var(--color-bg-tertiary)"},children:d.jsx("svg",{className:"w-8 h-8",style:{color:"var(--color-text-muted)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})})}),d.jsx("p",{className:"font-medium",style:{color:"var(--color-text-secondary)"},children:p("projects.empty")}),d.jsx("p",{className:"text-sm mt-1",style:{color:"var(--color-text-muted)"},children:p("projects.emptyHint")})]}):d.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3",children:w.map(j=>{const S=a[j.id]||{total:0,completed:0,running:0},k=j.path_exists===!1,N=k?"div":Hn,_=k?{onClick:E=>{confirm(p("projects.pathMissingConfirm"))&&y(j.id,E,!0)},className:"group block rounded-xl border p-5 transition-all duration-200 cursor-pointer opacity-50 relative",style:{backgroundColor:"var(--color-bg-card)",borderColor:"var(--color-border-muted)"}}:{to:`/projects/${j.id}`,className:"group block rounded-xl border p-5 transition-all duration-200 relative hover:border-[var(--color-border-strong)]",style:{backgroundColor:"var(--color-bg-card)",borderColor:"var(--color-border-muted)"}};return d.jsxs(N,{..._,children:[d.jsx("button",{onClick:E=>y(j.id,E),className:"absolute top-3 right-3 p-1.5 rounded-lg opacity-0 group-hover:opacity-100 transition-all hover:bg-status-error/10",style:{color:"var(--color-text-muted)"},title:p("projects.delete"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),d.jsx("h3",{className:"text-sm font-semibold truncate",style:{color:"var(--color-text-primary)"},children:j.name}),d.jsx("p",{className:"mt-1 text-xs font-mono truncate",style:{color:"var(--color-text-tertiary)"},children:j.path}),d.jsx("div",{className:"mt-2 flex gap-1.5",children:k?d.jsx("span",{className:"badge bg-status-error/10 text-status-error text-[10px]",children:p("projects.pathMissing")}):j.is_git_repo?d.jsx("span",{className:"badge bg-status-success/10 text-status-success text-[10px]",children:"Git"}):d.jsx("span",{className:"badge bg-status-warning/10 text-status-warning text-[10px]",children:p("projects.noGit")})}),d.jsxs("div",{className:"mt-4 flex items-center gap-2 text-xs",children:[d.jsxs("span",{className:"px-2 py-0.5 rounded-md",style:{backgroundColor:"var(--color-bg-tertiary)",color:"var(--color-text-tertiary)"},children:[S.total," ",p("projects.tasks")]}),S.running>0&&d.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-status-running/10 text-status-running",children:[d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-status-running animate-pulse"}),S.running," ",p("projects.active")]}),S.completed>0&&d.jsxs("span",{className:"px-2 py-0.5 rounded-md bg-status-success/10 text-status-success",children:[S.completed," ",p("projects.done")]})]}),S.total>0&&d.jsx("div",{className:"mt-3 h-1 rounded-full overflow-hidden",style:{backgroundColor:"var(--color-bg-tertiary)"},children:d.jsx("div",{className:"h-full rounded-full bg-status-success transition-all duration-500",style:{width:`${S.completed/S.total*100}%`}})})]},j.id)})}),l&&d.jsx(hO,{onSubmit:(j,S)=>x(j,S),onCancel:()=>o(!1)})]})]})}function Ih(e){return rt(`/api/projects/${e}/todos`)}function Bh(e,t){return qe(`/api/projects/${e}/todos`,t)}function Hh(e,t){return qs(`/api/todos/${e}`,t)}function xO(e){return qa(`/api/todos/${e}`)}function Tj(e,t="headless"){return qe(`/api/todos/${e}/start`,{mode:t})}function yO(e){return qe(`/api/todos/${e}/stop`)}function zE(e){return rt(`/api/todos/${e}/logs`)}function qE(e){return rt(`/api/todos/${e}/diff`)}function IE(e){return rt(`/api/todos/${e}/result`)}function bO(e){return qe(`/api/todos/${e}/merge`)}function vO(e){return qe(`/api/todos/${e}/merge-chain`)}function wO(e){return qe(`/api/todos/${e}/cleanup`)}function jO(e,t="headless"){return qe(`/api/todos/${e}/retry`,{mode:t})}function kO(e,t,n="headless"){return qe(`/api/todos/${e}/continue`,{prompt:t,mode:n})}function jb(e,t){return qe(`/api/todos/${e}/images`,{images:t})}function BE(e,t){return qa(`/api/todos/${e}/images/${t}`)}function ao(e,t){return`/api/todos/${e}/images/${t}`}function Aj(e){return rt(`/api/projects/${e}/pipelines`)}function SO(e,t){return qe(`/api/projects/${e}/pipelines`,t)}function ec(e){return rt(`/api/pipelines/${e}`)}function _O(e){return qa(`/api/pipelines/${e}`)}function HE(e){return qe(`/api/pipelines/${e}/start`)}function PE(e){return qe(`/api/pipelines/${e}/stop`)}function NO(e){return qe(`/api/pipelines/${e}/skip-phase`)}function CO(e){return qe(`/api/pipelines/${e}/retry-phase`)}function EO(e,t){const n=t?`/api/pipelines/${e}/logs?phase=${t}`:`/api/pipelines/${e}/logs`;return rt(n)}function TO(e){return qe(`/api/pipelines/${e}/merge`)}function AO(e){return rt(`/api/pipelines/${e}/diff`)}function MO(e){return qe(`/api/pipelines/${e}/cleanup`)}function Mj(e){return rt(`/api/projects/${e}/schedules`)}function RO(e,t){return qe(`/api/projects/${e}/schedules`,t)}function LO(e,t){return qs(`/api/schedules/${e}`,t)}function DO(e,t,n=!1){return qe(`/api/todos/${e}/schedule`,{run_at:t,keep_original:n})}function OO(e){return qa(`/api/schedules/${e}`)}function zO(e){return qe(`/api/schedules/${e}/activate`)}function qO(e){return qe(`/api/schedules/${e}/pause`)}function Ph(e){return rt(`/api/schedules/${e}/runs`)}function IO(e){return qe(`/api/schedules/${e}/trigger`)}function FE(e){return rt(`/api/projects/${e}/agents`)}function BO(e,t){return qe(`/api/projects/${e}/agents`,t)}function HO(e,t){return qs(`/api/agents/${e}`,t)}function PO(e){return qa(`/api/agents/${e}`)}function Rj(e){return rt(`/api/projects/${e}/discussions`)}function FO(e,t){return qe(`/api/projects/${e}/discussions`,t)}function ui(e){return rt(`/api/discussions/${e}`)}function UO(e,t){return qs(`/api/discussions/${e}`,t)}function $O(e){return qa(`/api/discussions/${e}`)}function UE(e){return qe(`/api/discussions/${e}/start`)}function $E(e){return qe(`/api/discussions/${e}/stop`)}function GO(e,t){return qe(`/api/discussions/${e}/inject`,{content:t})}function VO(e){return qe(`/api/discussions/${e}/skip-turn`)}function YO(e,t){return qe(`/api/discussions/${e}/implement`,{agent_id:t})}function XO(e,t){return rt(`/api/discussions/${e}/logs`)}function KO(e){return qe(`/api/discussions/${e}/merge`)}function WO(e){return qe(`/api/discussions/${e}/cleanup`)}function QO(e,t){return rt(`/api/plugins/${e}/config/${t}`)}function ZO(e,t,n){return qs(`/api/plugins/${e}/config/${t}`,n)}function GE(){return rt("/api/models")}function JO(e,t,n){return qe("/api/models",{cliTool:e,modelValue:t,modelLabel:n})}function e8(e){return qa(`/api/models/${e}`)}const Hy=[{value:"claude",label:"Claude Code",supportsInteractive:!0,models:[{value:"",label:"Default"},{value:"claude-sonnet-4-6",label:"Claude Sonnet 4.6"},{value:"claude-opus-4-6",label:"Claude Opus 4.6"},{value:"claude-haiku-4-5",label:"Claude Haiku 4.5"}]},{value:"gemini",label:"Gemini CLI",supportsInteractive:!1,models:[{value:"",label:"Default (Gemini 2.5 Pro)"}]},{value:"codex",label:"Codex CLI",supportsInteractive:!1,models:[{value:"",label:"Default"},{value:"gpt-4.1",label:"GPT-4.1"},{value:"gpt-4.1-mini",label:"GPT-4.1 Mini"},{value:"gpt-4.1-nano",label:"GPT-4.1 Nano"},{value:"o3",label:"o3"},{value:"o4-mini",label:"o4-mini"}]}],za=Hy;let ws=null,Vl=null;function VE(){return Vl||(Vl=GE().then(e=>{ws=e}).catch(()=>{ws=null}),Vl)}function t8(){return Vl=null,ws=null,VE()}function io(e){const t=Hy.find(n=>n.value===e)??Hy[0];return ws&&ws[e]?{...t,models:ws[e].map(n=>({value:n.value,label:n.label}))}:t}function ko(){const[e,t]=C.useState(!1),[,n]=C.useState(0);C.useEffect(()=>{VE().then(()=>t(!0))},[]);const a=C.useCallback(()=>{t8().then(()=>n(l=>l+1))},[]),s=C.useCallback(l=>io(l),[e]);return{loaded:e,refresh:a,getToolConfig:s}}function n8(){const{t:e}=Ue(),{refresh:t}=ko(),[n,a]=C.useState({}),[s,l]=C.useState("claude"),[o,c]=C.useState(""),[f,h]=C.useState(""),[g,p]=C.useState(!1),[x,y]=C.useState(""),w=()=>{GE().then(a).catch(()=>{})};C.useEffect(()=>{w()},[]);const j=async()=>{if(!(!o.trim()||!f.trim())){p(!0),y("");try{await JO(s,o.trim(),f.trim()),c(""),h(""),w(),t()}catch(N){N instanceof Error&&y(N.message)}finally{p(!1)}}},S=async N=>{try{await e8(N),w(),t()}catch{}},k=n[s]||[];return d.jsxs("div",{className:"mt-6 p-4 border border-warm-200 rounded-xl",children:[d.jsx("h4",{className:"text-sm font-semibold text-warm-700 mb-3",children:e("header.modelSettings")||"AI Model Settings"}),d.jsx("div",{className:"flex gap-1.5 mb-4",children:za.map(N=>d.jsx("button",{type:"button",onClick:()=>{l(N.value),y("")},className:`px-3 py-1.5 rounded-md text-xs font-medium transition-colors ${s===N.value?"bg-accent text-white":"bg-warm-100 text-warm-500 hover:bg-warm-200"}`,children:N.label},N.value))}),d.jsx("div",{className:"space-y-1.5 mb-4",children:k.map(N=>d.jsxs("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg bg-warm-50",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("span",{className:"text-xs font-medium text-warm-700",children:N.label}),N.value&&d.jsx("span",{className:"ml-2 text-[10px] text-warm-400 font-mono",children:N.value}),N.isDefault&&d.jsx("span",{className:"ml-2 text-[10px] text-warm-300",children:"(built-in)"})]}),!N.isDefault&&d.jsx("button",{type:"button",onClick:()=>S(N.id),className:"text-warm-300 hover:text-status-error transition-colors p-1",children:d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]},N.id))}),d.jsxs("div",{className:"flex gap-2 items-end",children:[d.jsxs("div",{className:"flex-1",children:[d.jsx("label",{className:"block text-[10px] font-medium text-warm-400 mb-1",children:e("header.modelValue")||"Model ID"}),d.jsx("input",{type:"text",value:o,onChange:N=>c(N.target.value),placeholder:"e.g. claude-sonnet-4-7",className:"input-field text-xs"})]}),d.jsxs("div",{className:"flex-1",children:[d.jsx("label",{className:"block text-[10px] font-medium text-warm-400 mb-1",children:e("header.modelLabel")||"Display Name"}),d.jsx("input",{type:"text",value:f,onChange:N=>h(N.target.value),placeholder:"e.g. Claude Sonnet 4.7",className:"input-field text-xs"})]}),d.jsx("button",{type:"button",onClick:j,disabled:g||!o.trim()||!f.trim(),className:"btn-primary text-xs px-3 py-2 flex-shrink-0",children:g?"...":e("header.addModel")||"Add"})]}),x&&d.jsx("p",{className:"text-xs text-status-error mt-1.5",children:x}),d.jsx("p",{className:"text-[10px] text-warm-300 mt-3",children:e("header.modelSettingsHint")||"Add custom models here. They will appear in model dropdowns across all projects."})]})}function r8({project:e,todos:t,onStartAll:n,onStopAll:a,onProjectUpdate:s}){const l=t.some(Y=>Y.status==="pending"||Y.status==="failed"||Y.status==="stopped"),o=t.some(Y=>Y.status==="running"),{t:c}=Ue(),[f,h]=C.useState(!1),[g,p]=C.useState(e.max_concurrent??3),[x,y]=C.useState(e.default_max_turns??30),[w,j]=C.useState(e.cli_tool||"claude"),[S,k]=C.useState(e.claude_model??""),[N,_]=C.useState(e.claude_options??""),[E,M]=C.useState(e.sandbox_mode||"strict"),[T,R]=C.useState(!!e.debug_logging),[B,P]=C.useState(!!e.show_token_usage),[L,H]=C.useState(e.use_worktree!==0),[F,G]=C.useState(!1),[q,O]=C.useState(!1),[D,X]=C.useState(!1),[K,Z]=C.useState({}),[z,$]=C.useState(()=>{try{return e.cli_fallback_chain?JSON.parse(e.cli_fallback_chain):[]}catch{return[]}});C.useEffect(()=>{const Y=By();Promise.all(Y.map(async ae=>{try{const he=await QO(ae.id,e.id);return[ae.id,he]}catch{return[ae.id,{}]}})).then(ae=>{const he={};for(const[ke,_e]of ae)he[ke]=_e;Z(he)})},[e.id]);const{getToolConfig:Q}=ko(),I=Y=>{j(Y),k("")},V=Q(w),te=C.useCallback(async()=>{X(!0);try{const Y=await XD(e.id);s(Y)}catch{}finally{X(!1)}},[e.id,s]),ne=(Y,ae)=>{Z(he=>({...he,[Y]:{...he[Y],...ae}}))},W=async()=>{var Y,ae,he,ke,_e,oe,je,Se,Ae,se,Ee,Te,Me,we;O(!0);try{const De=!L&&e.is_git_repo?1:g,Be=await $D(e.id,{max_concurrent:De,default_max_turns:x,cli_tool:w,sandbox_mode:E,debug_logging:T?1:0,use_worktree:L?1:0,show_token_usage:B?1:0,claude_model:S||null,claude_options:N||null,cli_fallback_chain:z.length>0?JSON.stringify(z):null,gstack_enabled:((Y=K.gstack)==null?void 0:Y.enabled)==="1"?1:0,gstack_skills:((ae=K.gstack)==null?void 0:ae.skills)||null,jira_enabled:((he=K.jira)==null?void 0:he.enabled)==="1"?1:0,jira_base_url:((ke=K.jira)==null?void 0:ke.base_url)||null,jira_email:((_e=K.jira)==null?void 0:_e.email)||null,jira_api_token:((oe=K.jira)==null?void 0:oe.api_token)||null,jira_project_key:((je=K.jira)==null?void 0:je.project_key)||null,notion_enabled:((Se=K.notion)==null?void 0:Se.enabled)==="1"?1:0,notion_api_key:((Ae=K.notion)==null?void 0:Ae.api_key)||null,notion_database_id:((se=K.notion)==null?void 0:se.database_id)||null,github_enabled:((Ee=K.github)==null?void 0:Ee.enabled)==="1"?1:0,github_token:((Te=K.github)==null?void 0:Te.token)||null,github_owner:((Me=K.github)==null?void 0:Me.owner)||null,github_repo:((we=K.github)==null?void 0:we.repo)||null});await Promise.all(Object.entries(K).map(([ie,xe])=>ZO(ie,e.id,xe))),s(Be),h(!1)}catch{}finally{O(!1)}};return d.jsxs("div",{className:"mb-8",children:[d.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("h1",{className:"text-xl sm:text-2xl font-semibold text-warm-800 truncate",children:e.name}),d.jsx("p",{className:"mt-1 text-xs text-warm-400 font-mono truncate",children:e.path}),d.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.is_git_repo?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"badge bg-status-success/10 text-status-success",children:"Git"}),d.jsxs("span",{className:"badge bg-status-running/10 text-status-running",children:[c("header.branch"),": ",e.default_branch]})]}):d.jsx("span",{className:"badge bg-status-warning/10 text-status-warning",children:c("header.noGit")}),d.jsxs("span",{className:"badge bg-accent/10 text-accent-dark",children:[c("header.workers"),": ",e.max_concurrent??3]}),d.jsx("span",{className:"badge bg-status-merged/10 text-status-merged",children:Q(e.cli_tool||"claude").label}),e.claude_model&&d.jsxs("span",{className:"badge bg-status-merged/10 text-status-merged",children:[c("header.model"),": ",e.claude_model]}),d.jsx("span",{className:`badge ${(e.sandbox_mode||"strict")==="strict"?"bg-status-success/10 text-status-success":"bg-status-warning/10 text-status-warning"}`,children:(e.sandbox_mode||"strict")==="strict"?c("header.sandboxBadgeStrict"):c("header.sandboxBadgePermissive")}),e.is_git_repo&&!e.use_worktree?d.jsx("span",{className:"badge bg-status-warning/10 text-status-warning",children:c("header.noWorktreeBadge")}):null,e.debug_logging?d.jsx("span",{className:"badge bg-purple-100 text-purple-700",children:c("header.debugBadge")}):null,e.gstack_enabled?d.jsx("span",{className:"badge bg-status-success/10 text-status-success",children:"gstack"}):null,e.jira_enabled?d.jsx("span",{className:"badge bg-blue-100 text-blue-700",children:"Jira"}):null]})]}),d.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[d.jsx("button",{onClick:()=>h(!f),className:"btn-ghost text-sm",title:c("header.settings"),children:d.jsxs("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}),d.jsxs("button",{onClick:n,disabled:!l,className:"btn-primary text-sm",children:[d.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M8 5v14l11-7z"})}),c("header.runAll")]}),d.jsxs("button",{onClick:a,disabled:!o,className:"btn-danger text-sm",children:[d.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M6 6h12v12H6z"})}),c("header.stopAll")]})]})]}),f&&d.jsxs("div",{className:"mt-5 card p-6 animate-slide-up",children:[d.jsx("h3",{className:"text-sm font-semibold text-warm-700 mb-5",children:c("header.config")}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-5",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:c("header.maxWorkers")}),d.jsx("input",{type:"number",min:1,max:10,value:g,onChange:Y=>p(Math.min(10,Math.max(1,parseInt(Y.target.value,10)||1))),className:"input-field"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:c("settings.defaultMaxTurns")}),d.jsx("input",{type:"number",min:5,max:200,value:x,onChange:Y=>y(Math.min(200,Math.max(5,parseInt(Y.target.value,10)||30))),className:"input-field"}),d.jsx("p",{className:"text-[10px] text-warm-400 mt-1",children:c("settings.defaultMaxTurnsHint")})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:c("header.cliTool")}),d.jsx("select",{value:w,onChange:Y=>I(Y.target.value),className:"input-field",children:za.map(Y=>d.jsx("option",{value:Y.value,children:Y.label},Y.value))}),w==="claude"&&d.jsxs("a",{href:"https://claude.ai/settings/usage",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 mt-1.5 text-xs text-purple-500 hover:text-purple-700 transition-colors",children:[d.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z"})}),c("header.usageLimit")]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:c("header.aiModel")}),d.jsx("select",{value:S,onChange:Y=>k(Y.target.value),className:"input-field",children:V.models.map(Y=>d.jsx("option",{value:Y.value,children:Y.label},Y.value))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:c("header.cliFlags")}),d.jsx("input",{type:"text",value:N,onChange:Y=>_(Y.target.value),placeholder:"--verbose",className:"input-field"})]})]}),d.jsxs("div",{className:"mt-6 p-4 border border-warm-200 rounded-xl",children:[d.jsx("h4",{className:"text-sm font-semibold text-warm-700 mb-2",children:c("header.fallbackChainTitle")}),d.jsx("p",{className:"text-xs text-warm-400 mb-3",children:c("header.fallbackChainHint")}),d.jsx("div",{className:"flex flex-wrap gap-2",children:za.map(Y=>{const ae=z.indexOf(Y.value),he=ae!==-1;return d.jsxs("button",{type:"button",onClick:()=>{$(ke=>he?ke.filter(_e=>_e!==Y.value):[...ke,Y.value])},className:`px-3 py-1.5 rounded-lg text-xs font-medium border transition-colors ${he?"bg-accent/20 border-accent text-accent-dark":"bg-warm-50 border-warm-200 text-warm-500 hover:border-warm-300"}`,children:[he&&d.jsxs("span",{className:"mr-1 font-bold",children:[ae+1,"."]}),Y.label]},Y.value)})}),z.length>0&&d.jsx("p",{className:"text-xs text-warm-500 mt-2",children:z.map(Y=>{var ae;return((ae=za.find(he=>he.value===Y))==null?void 0:ae.label)??Y}).join(" → ")})]}),d.jsxs("div",{className:"mt-6 p-4 border border-warm-200 rounded-xl",children:[d.jsx("h4",{className:"text-sm font-semibold text-warm-700 mb-2",children:c("header.sandboxTitle")}),d.jsxs("div",{className:"flex gap-3",children:[d.jsxs("button",{type:"button",onClick:()=>M("strict"),className:`flex-1 px-4 py-3 rounded-lg border text-left transition-colors ${E==="strict"?"bg-status-success/10 border-status-success text-status-success":"bg-warm-50 border-warm-200 text-warm-500 hover:border-warm-300"}`,children:[d.jsx("div",{className:"text-xs font-semibold",children:c("header.sandboxStrict")}),d.jsx("div",{className:"text-[10px] mt-1 opacity-80",children:c("header.sandboxStrictDesc")})]}),d.jsxs("button",{type:"button",onClick:()=>{E!=="permissive"&&G(!0)},className:`flex-1 px-4 py-3 rounded-lg border text-left transition-colors ${E==="permissive"?"bg-status-warning/10 border-status-warning text-status-warning":"bg-warm-50 border-warm-200 text-warm-500 hover:border-warm-300"}`,children:[d.jsx("div",{className:"text-xs font-semibold",children:c("header.sandboxPermissive")}),d.jsx("div",{className:"text-[10px] mt-1 opacity-80",children:c("header.sandboxPermissiveDesc")})]})]}),E==="permissive"&&d.jsx("p",{className:"text-[10px] text-status-warning mt-2",children:c("header.sandboxWarning")})]}),F&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:d.jsxs("div",{className:"bg-theme-card rounded-2xl p-6 max-w-sm mx-4 shadow-xl",children:[d.jsx("p",{className:"text-sm text-warm-700 mb-4",children:c("header.sandboxWarning")}),d.jsxs("div",{className:"flex justify-end gap-3",children:[d.jsx("button",{onClick:()=>G(!1),className:"btn-ghost text-sm",children:c("header.cancel")}),d.jsx("button",{onClick:()=>{M("permissive"),G(!1)},className:"btn-danger text-sm",children:c("header.sandboxPermissive")})]})]})}),e.is_git_repo?d.jsxs("div",{className:"mt-6 p-4 border border-warm-200 rounded-xl",children:[d.jsx("h4",{className:"text-sm font-semibold text-warm-700 mb-2",children:c("header.worktreeTitle")}),d.jsxs("div",{className:"flex gap-3",children:[d.jsxs("button",{type:"button",onClick:()=>H(!0),className:`flex-1 px-4 py-3 rounded-lg border text-left transition-colors ${L?"bg-status-success/10 border-status-success text-status-success":"bg-warm-50 border-warm-200 text-warm-500 hover:border-warm-300"}`,children:[d.jsx("div",{className:"text-xs font-semibold",children:c("header.worktreeEnabled")}),d.jsx("div",{className:"text-[10px] mt-1 opacity-80",children:c("header.worktreeEnabledDesc")})]}),d.jsxs("button",{type:"button",onClick:()=>H(!1),className:`flex-1 px-4 py-3 rounded-lg border text-left transition-colors ${L?"bg-warm-50 border-warm-200 text-warm-500 hover:border-warm-300":"bg-status-warning/10 border-status-warning text-status-warning"}`,children:[d.jsx("div",{className:"text-xs font-semibold",children:c("header.worktreeDisabled")}),d.jsx("div",{className:"text-[10px] mt-1 opacity-80",children:c("header.worktreeDisabledDesc")})]})]}),!L&&d.jsx("p",{className:"text-[10px] text-status-warning mt-2",children:c("header.worktreeWarning")})]}):null,d.jsxs("div",{className:"mt-6 p-4 border border-warm-200 rounded-xl",children:[d.jsx("h4",{className:"text-sm font-semibold text-warm-700 mb-2",children:c("header.showTokenUsageTitle")}),d.jsx("p",{className:"text-[10px] text-warm-500 mb-3",children:c("header.showTokenUsageDesc")}),d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:B,onChange:Y=>P(Y.target.checked),className:"rounded"}),d.jsx("span",{className:"text-xs text-warm-600",children:c("header.showTokenUsageEnable")})]})]}),d.jsxs("div",{className:"mt-6 p-4 border border-warm-200 rounded-xl",children:[d.jsx("h4",{className:"text-sm font-semibold text-warm-700 mb-2",children:c("header.debugLoggingTitle")}),d.jsx("p",{className:"text-[10px] text-warm-500 mb-3",children:c("header.debugLoggingDesc")}),d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:T,onChange:Y=>R(Y.target.checked),className:"rounded"}),d.jsx("span",{className:"text-xs text-warm-600",children:c("header.debugLoggingEnable")})]})]}),By().map(Y=>d.jsx("div",{className:"mt-6",children:d.jsx(Y.SettingsComponent,{project:e,config:K[Y.id]||{},onConfigChange:ae=>ne(Y.id,ae)})},Y.id)),d.jsx(n8,{}),!e.is_git_repo&&d.jsxs("div",{className:"mt-5 p-3 bg-status-warning/5 border border-status-warning/20 rounded-xl",children:[d.jsx("p",{className:"text-xs text-warm-600 mb-2",children:c("header.noGitHint")}),d.jsx("button",{onClick:te,disabled:D,className:"btn-ghost text-xs",children:D?"...":c("header.recheckGit")})]}),d.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[d.jsx("button",{onClick:()=>h(!1),className:"btn-ghost text-sm",children:c("header.cancel")}),d.jsx("button",{onClick:W,disabled:q,className:"btn-primary text-sm",children:c(q?"header.saving":"header.save")})]})]})]})}function kb({status:e}){const{t}=Ue(),n={pending:{labelKey:"status.pending",classes:"bg-warm-200 text-warm-500"},running:{labelKey:"status.running",classes:"bg-status-running/10 text-status-running"},completed:{labelKey:"status.completed",classes:"bg-status-success/10 text-status-success"},failed:{labelKey:"status.failed",classes:"bg-status-error/10 text-status-error"},stopped:{labelKey:"status.stopped",classes:"bg-status-warning/10 text-status-warning"},merged:{labelKey:"status.merged",classes:"bg-status-merged/10 text-status-merged"}},{labelKey:a,classes:s}=n[e];return d.jsxs("span",{className:`badge text-[10px] font-semibold ${s}`,children:[e==="running"&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-status-running animate-pulse"}),t(a)]})}const Aa={bg:"#1e1e1e",border:"#3c3c3c",cursor:"#aeafad",timestamp:"#6a9955",prefix:{info:"#569cd6",error:"#f44747",output:"#9cdcfe",commit:"#4ec9b0",input:"#c586c0",prompt:"#c586c0",warning:"#dcdcaa"},message:{info:"#9cdcfe",error:"#f1807e",output:"#d4d4d4",commit:"#a8c990",input:"#ce9178",prompt:"#c586c0",warning:"#dcdcaa"}};function a8(e,t){const n=[],a=/(\*\*(.+?)\*\*)|(`(.+?)`)|(\*(.+?)\*)/g;let s=0,l,o=0;for(;(l=a.exec(e))!==null;)l.index>s&&n.push(e.slice(s,l.index)),l[1]?n.push(d.jsx("strong",{style:{color:"#d7ba7d",fontWeight:700},children:l[2]},o++)):l[3]?n.push(d.jsx("code",{style:{color:"#ce9178",background:"rgba(255,255,255,0.07)",padding:"0 3px",borderRadius:3,fontSize:"0.7rem"},children:l[4]},o++)):l[5]&&n.push(d.jsx("em",{style:{color:t,opacity:.75,fontStyle:"italic"},children:l[6]},o++)),s=l.index+l[0].length;return s<e.length&&n.push(e.slice(s)),n.length>0?n:[e]}const Lj={info:"[INF]",error:"[ERR]",output:"[OUT]",commit:"[GIT]",input:"[>>>]",prompt:"[PRM]",warning:"[WRN]"};function YE({logs:e,interactive:t,todoId:n,onSendInput:a}){const s=C.useRef(null),[l,o]=C.useState(""),[c,f]=C.useState(!1),[h,g]=C.useState(!1),p=C.useRef(0),{t:x}=Ue();C.useEffect(()=>{s.current&&(s.current.scrollTop=s.current.scrollHeight)},[e]),C.useEffect(()=>{if(!h||e.length===0)return;const j=Date.now()-p.current,S=e[e.length-1];if(S.log_type==="output"||S.log_type==="error"||S.log_type==="commit")if(j>=1e3)g(!1);else{const k=setTimeout(()=>g(!1),1e3-j);return()=>clearTimeout(k)}},[e,h]);const y=j=>{j.preventDefault(),!(!l.trim()||!n||!a)&&(a(n,l),o(""),g(!0),p.current=Date.now())},w=async()=>{const j=e.map(S=>`${new Date(S.created_at).toLocaleTimeString()} ${Lj[S.log_type]} ${S.message}`).join(`
66
+ `);await navigator.clipboard.writeText(j),f(!0),setTimeout(()=>f(!1),2e3)};return d.jsxs("div",{className:"flex flex-col",children:[d.jsxs("div",{className:"relative",children:[e.length>0&&d.jsx("button",{onClick:w,style:{position:"absolute",top:8,right:8,zIndex:10,padding:"2px 8px",fontSize:"10px",fontFamily:"monospace",borderRadius:4,background:"#2d2d2d",color:"#858585",border:"1px solid #3c3c3c",cursor:"pointer",transition:"color 0.15s"},onMouseEnter:j=>j.currentTarget.style.color="#d4d4d4",onMouseLeave:j=>j.currentTarget.style.color="#858585",children:x(c?"log.copied":"log.copy")}),d.jsxs("div",{ref:s,className:"h-48 sm:h-64 overflow-y-auto overflow-x-auto rounded-xl p-3 sm:p-4 font-mono text-xs",style:{backgroundColor:Aa.bg,border:`1px solid ${Aa.border}`},children:[e.length===0?d.jsx("p",{style:{color:"#6a9955"},children:x("log.awaiting")}):e.map(j=>{const S=new Date(j.created_at).toLocaleTimeString(),k=Aa.prefix[j.log_type],N=Aa.message[j.log_type];return d.jsxs("div",{className:"mb-0.5 leading-relaxed",children:[d.jsx("span",{style:{color:Aa.timestamp},children:S})," ",d.jsx("span",{style:{color:k,fontWeight:700},children:Lj[j.log_type]})," ",d.jsx("span",{style:{color:N},children:a8(j.message,N)})]},j.id)}),t&&h&&d.jsxs("div",{className:"mb-0.5 leading-relaxed",children:[d.jsxs("span",{className:"inline-flex gap-1",style:{color:"#569cd6"},children:[d.jsx("span",{className:"animate-bounce",style:{animationDelay:"0ms",animationDuration:"1.2s"},children:"●"}),d.jsx("span",{className:"animate-bounce",style:{animationDelay:"200ms",animationDuration:"1.2s"},children:"●"}),d.jsx("span",{className:"animate-bounce",style:{animationDelay:"400ms",animationDuration:"1.2s"},children:"●"})]}),d.jsx("span",{className:"ml-2",style:{color:"#6a9955",fontSize:"0.65rem"},children:x("log.waitingResponse")})]}),d.jsx("span",{style:{color:Aa.cursor},className:"animate-pulse",children:"_"})]})]}),t&&d.jsxs("form",{onSubmit:y,style:{display:"flex",alignItems:"center",gap:8,backgroundColor:Aa.bg,border:`1px solid ${Aa.border}`,borderTop:"none",borderBottomLeftRadius:12,borderBottomRightRadius:12,padding:"6px 16px"},children:[d.jsx("span",{style:{color:"#569cd6",fontFamily:"monospace",fontWeight:700,fontSize:12},children:"$"}),d.jsx("input",{type:"text",value:l,onChange:j=>o(j.target.value),style:{flex:1,background:"transparent",border:"none",outline:"none",color:"#ce9178",fontFamily:"monospace",fontSize:12},placeholder:x("todo.sendPlaceholder"),autoFocus:!0}),d.jsx("button",{type:"submit",style:{color:"#569cd6",fontFamily:"monospace",fontWeight:700,fontSize:12,letterSpacing:"0.05em",background:"none",border:"none",cursor:"pointer"},onMouseEnter:j=>j.currentTarget.style.color="#9cdcfe",onMouseLeave:j=>j.currentTarget.style.color="#569cd6",children:"SEND"})]})]})}let i8=0;function Pc({onSave:e,onCancel:t,initialTitle:n="",initialDescription:a="",initialCliTool:s,initialCliModel:l,initialDependsOn:o,initialMaxTurns:c,projectCliTool:f="claude",projectCliModel:h="",existingImages:g=[],todoId:p,onDeleteImage:x,availableTodos:y=[]}){const[w,j]=C.useState(n),[S,k]=C.useState(a),[N,_]=C.useState(s||f||"claude"),[E,M]=C.useState(l??h??""),[T,R]=C.useState(o??""),[B,P]=C.useState((c==null?void 0:c.toString())??""),[L,H]=C.useState([]),[F,G]=C.useState(g),q=C.useRef(null),O=C.useRef(null),{t:D}=Ue(),{getToolConfig:X}=ko(),K=X(N),Z=Y=>{_(Y),M("")},z=C.useCallback(Y=>{const ae=Array.from(Y).filter(he=>he.type.startsWith("image/"));for(const he of ae){const ke=new FileReader;ke.onload=()=>{const _e=ke.result,oe=`pending-${++i8}`;H(je=>[...je,{id:oe,name:he.name,data:_e,preview:_e}])},ke.readAsDataURL(he)}},[]),$=C.useCallback(Y=>{var _e;const ae=(_e=Y.clipboardData)==null?void 0:_e.items;if(!ae)return;const he=[];for(let oe=0;oe<ae.length;oe++)ae[oe].type.startsWith("image/")&&he.push(ae[oe]);if(he.length===0)return;Y.preventDefault();const ke=[];for(const oe of he){const je=oe.getAsFile();je&&ke.push(je)}z(ke)},[z]),Q=C.useCallback(Y=>{var ae;Y.preventDefault(),Y.stopPropagation(),(ae=Y.dataTransfer)!=null&&ae.files&&z(Y.dataTransfer.files)},[z]),I=C.useCallback(Y=>{Y.preventDefault(),Y.stopPropagation()},[]),V=Y=>{H(ae=>ae.filter(he=>he.id!==Y))},te=Y=>{x&&x(Y),G(ae=>ae.filter(he=>he.id!==Y))},ne=Y=>{if(Y.preventDefault(),!w.trim())return;const ae=B?parseInt(B,10):void 0;e(w.trim(),S.trim(),N,E||void 0,L.length>0?L:void 0,T||void 0,ae||void 0)},W=F.length+L.length;return d.jsxs("form",{onSubmit:ne,className:"card p-5 border-accent/30",children:[d.jsx("div",{className:"mb-3",children:d.jsx("input",{type:"text",placeholder:D("todoForm.titlePlaceholder"),value:w,onChange:Y=>j(Y.target.value),className:"input-field",autoFocus:!0})}),d.jsxs("div",{className:"mb-4",children:[d.jsx("textarea",{ref:q,placeholder:D("todoForm.descPlaceholder"),value:S,onChange:Y=>k(Y.target.value),onPaste:$,onDrop:Q,onDragOver:I,rows:3,className:"input-field resize-none"}),d.jsxs("div",{className:"flex items-center gap-2 mt-1.5",children:[d.jsxs("button",{type:"button",onClick:()=>{var Y;return(Y=O.current)==null?void 0:Y.click()},className:"inline-flex items-center gap-1 px-2 py-1 rounded text-[10px] font-medium text-warm-400 hover:text-warm-600 hover:bg-warm-100 transition-colors",children:[d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),D("todoForm.addImage")]}),d.jsx("span",{className:"text-[10px] text-warm-300",children:D("todoForm.pasteHint")})]}),d.jsx("input",{ref:O,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:Y=>{Y.target.files&&z(Y.target.files),Y.target.value=""}})]}),W>0&&d.jsxs("div",{className:"mb-4",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[d.jsx("h4",{className:"text-xs font-semibold text-warm-500 uppercase tracking-wider",children:D("todoForm.images")}),d.jsxs("span",{className:"text-[10px] text-warm-400",children:["(",W,")"]})]}),d.jsxs("div",{className:"flex flex-wrap gap-2",children:[F.map(Y=>d.jsxs("div",{className:"relative group",children:[d.jsx("img",{src:p?ao(p,Y.id):"",alt:Y.originalName,className:"h-20 w-20 object-cover rounded-lg border border-warm-200"}),d.jsx("button",{type:"button",onClick:()=>te(Y.id),className:"absolute -top-1.5 -right-1.5 h-5 w-5 rounded-full bg-status-error text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:d.jsx("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),d.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-black/50 rounded-b-lg px-1 py-0.5",children:d.jsx("span",{className:"text-[8px] text-white truncate block",children:Y.originalName})})]},Y.id)),L.map(Y=>d.jsxs("div",{className:"relative group",children:[d.jsx("img",{src:Y.preview,alt:Y.name,className:"h-20 w-20 object-cover rounded-lg border border-accent/30"}),d.jsx("button",{type:"button",onClick:()=>V(Y.id),className:"absolute -top-1.5 -right-1.5 h-5 w-5 rounded-full bg-status-error text-white flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:d.jsx("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),d.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-black/50 rounded-b-lg px-1 py-0.5",children:d.jsx("span",{className:"text-[8px] text-white truncate block",children:Y.name})})]},Y.id))]})]}),d.jsxs("div",{className:"mb-4 grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-1.5",children:D("todoForm.cliTool")}),d.jsx("select",{value:N,onChange:Y=>Z(Y.target.value),className:"input-field text-sm",children:za.map(Y=>d.jsx("option",{value:Y.value,children:Y.label},Y.value))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-1.5",children:D("todoForm.aiModel")}),d.jsx("select",{value:E,onChange:Y=>M(Y.target.value),className:"input-field text-sm",children:K.models.map(Y=>d.jsx("option",{value:Y.value,children:Y.label},Y.value))})]})]}),N==="claude"&&d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-1.5",children:D("todoForm.maxTurns")}),d.jsx("input",{type:"number",min:"1",max:"500",placeholder:D("todoForm.maxTurnsPlaceholder"),value:B,onChange:Y=>P(Y.target.value),className:"input-field text-sm w-32"}),d.jsx("p",{className:"text-[10px] text-warm-400 mt-1",children:D("todoForm.maxTurnsHint")})]}),y.length>0&&d.jsxs("div",{className:"mb-4",children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-1.5",children:D("todoForm.dependsOn")}),d.jsxs("select",{value:T,onChange:Y=>R(Y.target.value),className:"input-field text-sm",children:[d.jsx("option",{value:"",children:D("todoForm.noDependency")}),y.map(Y=>d.jsxs("option",{value:Y.id,children:[Y.title," (",D(`status.${Y.status}`),")"]},Y.id))]}),T&&d.jsx("p",{className:"text-[10px] text-warm-400 mt-1",children:D("todoForm.dependsOnHint")})]}),d.jsxs("div",{className:"flex gap-3 justify-end",children:[d.jsx("button",{type:"button",onClick:t,className:"btn-ghost text-sm",children:D("todoForm.cancel")}),d.jsx("button",{type:"submit",disabled:!w.trim(),className:"btn-primary text-sm",children:D("todoForm.save")})]})]})}function s8({todo:e,allTodos:t=[],projectCliTool:n,onStart:a,onStop:s,onDelete:l,onEdit:o,onMerge:c,onCleanup:f,onRetry:h,onContinue:g,onFix:p,onSchedule:x,onEvent:y,isInteractive:w,onSendInput:j,isDragSource:S,isDragging:k,isDragOver:N,isValidDropTarget:_,onDragStart:E,onDragEnd:M,onDragOverTarget:T,onDragLeaveTarget:R,onDropTarget:B,onRemoveDependency:P,debugLogging:L,showTokenUsage:H,isChainMember:F}){const[G,q]=C.useState(!1),[O,D]=C.useState(!1),[X,K]=C.useState([]),[Z,z]=C.useState(!1),[$,Q]=C.useState(!1),[I,V]=C.useState(null),[te,ne]=C.useState(!1),[W,Y]=C.useState(null),[ae,he]=C.useState(!1),[ke,_e]=C.useState(null),[oe,je]=C.useState(!1),[Se,Ae]=C.useState(null),[se,Ee]=C.useState(!1),[Te,Me]=C.useState(null),[we,De]=C.useState(!1),[Be,ie]=C.useState(""),[xe,J]=C.useState(!1),[fe,be]=C.useState(null),[Ne,Oe]=C.useState(null),[ht,yt]=C.useState(!1),[tt,st]=C.useState(!1),[Ft,ut]=C.useState(!1),[tn,nn]=C.useState(()=>{const pe=new Date;pe.setHours(pe.getHours()+1),pe.setMinutes(0,0,0);const Ge=pe.getFullYear(),Ke=String(pe.getMonth()+1).padStart(2,"0"),Ut=String(pe.getDate()).padStart(2,"0"),mt=String(pe.getHours()).padStart(2,"0"),ia=String(pe.getMinutes()).padStart(2,"0");return`${Ge}-${Ke}-${Ut}T${mt}:${ia}`}),[Ci,jr]=C.useState(!1),{t:Re}=Ue(),na=e.status==="pending"||e.status==="failed"||e.status==="stopped",$n=(e.status==="pending"||e.status==="failed"||e.status==="stopped")&&!!x,ra=e.status==="running",kr=e.status==="completed"||e.status==="stopped"||e.status==="merged",Gs=e.status==="completed"&&!F&&!!e.branch_name,Ei=e.status==="completed"||e.status==="failed"||e.status==="stopped",Ha=!!g&&e.status==="completed"&&!!e.worktree_path,Sr=e.status!=="running"&&e.status!=="pending"&&(e.worktree_path||e.branch_name)&&!F,aa=e.status==="completed"||e.status==="failed"||e.status==="stopped"||e.status==="merged";C.useEffect(()=>{w&&e.status==="running"&&!G&&q(!0)},[w,e.status]),C.useEffect(()=>{G&&!Z&&zE(e.id).then(pe=>{K(pe),z(!0)}).catch(()=>{})},[G,Z,e.id]),C.useEffect(()=>{G&&aa&&!ht&&IE(e.id).then(pe=>{Oe(pe),yt(!0)}).catch(()=>{yt(!0)})},[G,aa,ht,e.id]),C.useEffect(()=>y(pe=>{if(pe.type==="todo:log"&&pe.todoId===e.id&&pe.message){const Ge={id:`ws-${Date.now()}-${Math.random()}`,todo_id:e.id,log_type:pe.logType||"output",message:pe.message,created_at:new Date().toISOString()};K(Ke=>[...Ke,Ge])}if(pe.type==="todo:commit"&&pe.todoId===e.id&&pe.message){const Ge={id:`ws-commit-${Date.now()}-${Math.random()}`,todo_id:e.id,log_type:"commit",message:`${pe.commitHash?`[${pe.commitHash}] `:""}${pe.message}`,created_at:new Date().toISOString()};K(Ke=>[...Ke,Ge])}}),[y,e.id]);const Ti=async()=>{try{const{files:pe}=await ME(e.project_id,e.id);pe.length>0&&window.open(`/api/projects/${e.project_id}/debug-logs/${encodeURIComponent(pe[0].name)}`,"_blank")}catch{}},Ai=async()=>{if($){Q(!1);return}ne(!0),Y(null);try{const pe=await qE(e.id);V(pe),Q(!0)}catch(pe){Y(pe instanceof Error?pe.message:"Failed to load diff")}finally{ne(!1)}},Mi=async()=>{he(!0),_e(null);try{await c(e.id)}catch(pe){_e(pe instanceof Error?pe.message:"Merge failed")}finally{he(!1)}},Pa=async()=>{je(!0),Ae(null);try{await f(e.id)}catch(pe){Ae(pe instanceof Error?pe.message:"Cleanup failed")}finally{je(!1)}},Fa=async(pe="headless")=>{Ee(!0),Me(null),K([]),z(!1),V(null),Q(!1),Oe(null),yt(!1);try{await h(e.id,pe)}catch(Ge){Me(Ge instanceof Error?Ge.message:"Retry failed")}finally{Ee(!1)}},Ri=async(pe="headless")=>{if(!g)return;const Ge=Be.trim();if(!Ge){be(Re("todo.continuePromptRequired"));return}J(!0),be(null);try{await g(e.id,Ge,pe),De(!1),ie(""),K([]),z(!1)}catch(Ke){be(Ke instanceof Error?Ke.message:"Continue failed")}finally{J(!1)}},Li=async()=>{if(!(!x||!tn)){jr(!0);try{await x(e.id,new Date(tn).toISOString(),Ft),st(!1)}catch{}finally{jr(!1)}}},An=pe=>{if(pe<60)return`${pe}s`;const Ge=Math.floor(pe/60),Ke=pe%60;if(Ge<60)return Ke>0?`${Ge}m ${Ke}s`:`${Ge}m`;const Ut=Math.floor(Ge/60),mt=Ge%60;return mt>0?`${Ut}h ${mt}m`:`${Ut}h`},At=pe=>pe>=1e6?`${(pe/1e6).toFixed(1)}M`:pe>=1e3?`${(pe/1e3).toFixed(1)}k`:String(pe),Gt={A:{label:"Added",color:"text-green-500"},M:{label:"Modified",color:"text-amber-500"},D:{label:"Deleted",color:"text-red-500"},R:{label:"Renamed",color:"text-blue-500"},C:{label:"Copied",color:"text-purple-500"}},Qt=e.images?JSON.parse(e.images):[],sn=e.depends_on?t.find(pe=>pe.id===e.depends_on):null,_r=t.find(pe=>pe.depends_on===e.id&&pe.merged_from_branch),Vs=e.cli_tool||n||"claude",Di=io(Vs).supportsInteractive;if(O)return d.jsx(Pc,{initialTitle:e.title,initialDescription:e.description??void 0,initialCliTool:e.cli_tool??void 0,initialCliModel:e.cli_model??void 0,initialDependsOn:e.depends_on??void 0,initialMaxTurns:e.max_turns??void 0,existingImages:Qt,todoId:e.id,availableTodos:t.filter(pe=>pe.id!==e.id),onDeleteImage:async pe=>{await BE(e.id,pe)},onSave:async(pe,Ge,Ke,Ut,mt,ia,Ys)=>{await o(e.id,pe,Ge,Ke,Ut,ia,Ys),mt&&mt.length>0&&await jb(e.id,mt.map(Cr=>({name:Cr.name,data:Cr.data}))),D(!1)},onCancel:()=>D(!1)});const Nr={pending:"border-l-warm-300",running:"border-l-status-running",completed:"border-l-status-success",failed:"border-l-status-error",stopped:"border-l-status-warning",merged:"border-l-status-merged"}[e.status],Ua=pe=>{pe.dataTransfer.setData("text/plain",e.id),pe.dataTransfer.effectAllowed="link",E==null||E(e.id)},ar=()=>{M==null||M()},ir=pe=>{!k||S||(pe.preventDefault(),pe.dataTransfer.dropEffect=_?"link":"none",T==null||T(e.id))},sr=()=>{R==null||R(e.id)},lr=pe=>{pe.preventDefault(),!(!k||S||!_)&&(B==null||B(e.id))},Et=k&&!S&&N&&_,$a=k&&!S&&N&&!_;return d.jsxs("div",{className:`relative transition-all duration-200 ${S?"opacity-40 scale-[0.98]":""} `,onDragOver:ir,onDragLeave:sr,onDrop:lr,children:[d.jsxs("div",{className:`card border-l-4 ${Nr} overflow-hidden transition-all duration-200 ${Et?"ring-2 ring-cyan-400 ring-offset-1":""} ${$a?"ring-2 ring-red-300 ring-offset-1":""}`,children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 md:flex-nowrap md:gap-3 px-3 md:px-4 py-3 md:py-3.5 cursor-pointer hover:bg-warm-50 transition-colors",onClick:()=>q(!G),children:[d.jsx("div",{draggable:!0,onDragStart:Ua,onDragEnd:ar,onClick:pe=>pe.stopPropagation(),className:"flex-shrink-0 cursor-grab active:cursor-grabbing text-warm-300 hover:text-warm-500 transition-colors p-0.5 -ml-1",title:Re("dnd.dropHint"),children:d.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"currentColor",children:[d.jsx("circle",{cx:"5",cy:"3",r:"1.2"}),d.jsx("circle",{cx:"11",cy:"3",r:"1.2"}),d.jsx("circle",{cx:"5",cy:"8",r:"1.2"}),d.jsx("circle",{cx:"11",cy:"8",r:"1.2"}),d.jsx("circle",{cx:"5",cy:"13",r:"1.2"}),d.jsx("circle",{cx:"11",cy:"13",r:"1.2"})]})}),d.jsx("button",{className:"text-warm-400 hover:text-accent flex-shrink-0 transition-colors",children:d.jsx("svg",{className:`h-3.5 w-3.5 transition-transform duration-200 ${G?"rotate-90":""}`,fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M8 5v14l11-7z"})})}),d.jsxs("span",{className:"text-[10px] font-mono text-warm-400 w-6 flex-shrink-0",children:["#",e.priority]}),d.jsx("span",{className:"flex-1 basis-[calc(100%-100px)] md:basis-auto min-w-0 text-sm text-warm-800 font-medium truncate order-none",children:e.title}),Qt.length>0&&d.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full text-[10px] font-mono text-warm-400 bg-warm-100 flex-shrink-0",children:[d.jsx("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),Qt.length]}),sn&&d.jsxs("span",{className:"hidden md:inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-mono font-medium bg-cyan-500/10 text-cyan-600 flex-shrink-0 group/dep",title:`${Re("todo.dependsOn")}: ${sn.title}`,children:[d.jsx("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),sn.title.length>20?sn.title.slice(0,20)+"...":sn.title,P&&d.jsx("button",{onClick:pe=>{pe.stopPropagation(),P(e.id)},className:"ml-0.5 h-3.5 w-3.5 rounded-full hover:bg-cyan-500/20 inline-flex items-center justify-center opacity-0 group-hover/dep:opacity-100 transition-opacity",title:Re("dnd.removeDep"),children:d.jsx("svg",{className:"h-2.5 w-2.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),e.cli_tool&&d.jsxs("span",{className:"hidden md:inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-mono font-medium bg-status-merged/10 text-status-merged flex-shrink-0",children:[io(e.cli_tool||"claude").label,e.cli_model&&d.jsxs("span",{className:"text-warm-400",children:["/ ",e.cli_model]})]}),d.jsx(kb,{status:e.status}),d.jsxs("div",{className:"flex items-center gap-0.5 ml-auto md:ml-2 flex-shrink-0",onClick:pe=>pe.stopPropagation(),children:[na&&d.jsxs(d.Fragment,{children:[d.jsx("button",{onClick:()=>a(e.id,"headless"),className:"p-1.5 text-status-success/60 hover:text-status-success hover:bg-status-success/10 rounded-lg transition-colors",title:Re("todo.startHeadless"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M8 5v14l11-7z"})})}),Di&&d.jsx("button",{onClick:()=>a(e.id,"interactive"),className:"p-1.5 text-blue-500/60 hover:text-blue-500 hover:bg-blue-500/10 rounded-lg transition-colors",title:Re("todo.startInteractive"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),d.jsx("button",{onClick:()=>a(e.id,"verbose"),className:"p-1.5 text-purple-500/60 hover:text-purple-500 hover:bg-purple-500/10 rounded-lg transition-colors",title:Re("todo.startVerbose"),children:d.jsxs("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})})]}),$n&&d.jsx("button",{onClick:()=>st(!tt),className:"p-1.5 text-blue-500/60 hover:text-blue-500 hover:bg-blue-500/10 rounded-lg transition-colors",title:Re("todo.schedule"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),ra&&d.jsx("button",{onClick:()=>s(e.id),className:"p-1.5 text-status-error/60 hover:text-status-error hover:bg-status-error/10 rounded-lg transition-colors",title:Re("todo.stop"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M6 6h12v12H6z"})})}),kr&&d.jsx("button",{onClick:Ai,disabled:te,className:"p-1.5 text-status-info/60 hover:text-status-info hover:bg-status-info/10 rounded-lg transition-colors disabled:opacity-30",title:Re("todo.viewDiff"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),L&&aa&&d.jsx("button",{onClick:Ti,className:"p-1.5 text-purple-400 hover:text-purple-600 hover:bg-purple-50 rounded-lg transition-colors",title:Re("todo.viewDebugLog"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"})})}),Gs&&d.jsx("button",{onClick:Mi,disabled:ae,className:"p-1.5 text-status-merged/60 hover:text-status-merged hover:bg-status-merged/10 rounded-lg transition-colors disabled:opacity-30",title:Re("todo.merge"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})})}),Sr&&d.jsx("button",{onClick:Pa,disabled:oe,className:"p-1.5 text-orange-500/60 hover:text-orange-500 hover:bg-orange-500/10 rounded-lg transition-colors disabled:opacity-30",title:Re("todo.cleanup"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"})})}),Ha&&d.jsx("button",{onClick:()=>{De(pe=>!pe),be(null)},disabled:xe,className:"p-1.5 text-emerald-500/60 hover:text-emerald-500 hover:bg-emerald-500/10 rounded-lg transition-colors disabled:opacity-30",title:Re("todo.continue"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 5l7 7-7 7M5 5l7 7-7 7"})})}),Ei&&d.jsx("button",{onClick:()=>Fa("headless"),disabled:se,className:"p-1.5 text-cyan-500/60 hover:text-cyan-500 hover:bg-cyan-500/10 rounded-lg transition-colors disabled:opacity-30",title:Re("todo.retry"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h4.586M20 20v-5h-4.586M4.929 9A8 8 0 0119.071 9M19.071 15A8 8 0 014.929 15"})})}),d.jsx("button",{onClick:()=>D(!0),className:"p-1.5 text-warm-400 hover:text-accent hover:bg-accent/10 rounded-lg transition-colors",title:Re("todo.edit"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),d.jsx("button",{onClick:()=>l(e.id),className:"p-1.5 text-warm-400 hover:text-status-error hover:bg-status-error/10 rounded-lg transition-colors",title:Re("todo.delete"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),tt&&d.jsx("div",{className:"border-t border-blue-200 px-5 py-3 bg-blue-50/50 animate-fade-in",children:d.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[d.jsx("label",{className:"text-xs font-medium text-blue-600",children:Re("todo.scheduleAt")}),d.jsx("input",{type:"datetime-local",value:tn,onChange:pe=>nn(pe.target.value),className:"bg-theme-card border border-blue-200 rounded-lg px-2 py-1.5 text-sm font-mono text-warm-800 focus:border-blue-400 focus:outline-none focus:ring-2 focus:ring-blue-400/20",min:new Date().toISOString().slice(0,16)}),d.jsx("button",{onClick:Li,disabled:Ci||!tn,className:"btn-primary text-xs py-1.5 !bg-blue-500 hover:!bg-blue-600 disabled:opacity-30",children:Re(Ci?"todo.scheduling":"todo.confirmSchedule")}),d.jsx("button",{onClick:()=>st(!1),className:"btn-ghost text-xs py-1.5",children:Re("scheduleForm.cancel")}),d.jsxs("label",{className:"flex items-center gap-2 text-xs text-blue-700",children:[d.jsx("input",{type:"checkbox",checked:Ft,onChange:pe=>ut(pe.target.checked),className:"rounded border-blue-300 text-blue-500 focus:ring-blue-400"}),Re("todo.scheduleKeepOriginal")]})]})}),we&&d.jsx("div",{className:"border-t border-emerald-200 px-5 py-3 bg-emerald-50/50 animate-fade-in",children:d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsxs("label",{className:"text-xs font-medium text-emerald-600",children:[Re("todo.continuePromptLabel"),(e.round_count??1)>1&&d.jsxs("span",{className:"ml-2 text-emerald-500/70",children:["(",Re("todo.roundLabel")," ",e.round_count,")"]})]}),d.jsx("textarea",{value:Be,onChange:pe=>ie(pe.target.value),placeholder:Re("todo.continuePromptPlaceholder"),rows:3,className:"w-full bg-theme-card border border-emerald-200 rounded-lg px-3 py-2 text-sm text-warm-800 focus:border-emerald-400 focus:outline-none focus:ring-2 focus:ring-emerald-400/20 resize-y",disabled:xe}),fe&&d.jsx("p",{className:"text-xs text-status-error",children:fe}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:()=>Ri("headless"),disabled:xe||!Be.trim(),className:"btn-primary text-xs py-1.5 !bg-emerald-500 hover:!bg-emerald-600 disabled:opacity-30",children:Re(xe?"todo.continuing":"todo.confirmContinue")}),d.jsx("button",{onClick:()=>{De(!1),be(null)},disabled:xe,className:"btn-ghost text-xs py-1.5",children:Re("scheduleForm.cancel")})]})]})}),G&&d.jsxs("div",{className:"border-t border-warm-200 px-3 sm:px-5 py-4 sm:py-5 space-y-4 sm:space-y-5 animate-fade-in bg-warm-50/50",children:[d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-warm-500 uppercase tracking-wider mb-2",children:Re("todo.description")}),d.jsx("p",{className:"text-sm text-warm-600 whitespace-pre-wrap leading-relaxed",children:e.description||Re("todo.noDescription")})]}),Qt.length>0&&d.jsxs("div",{children:[d.jsxs("h4",{className:"text-xs font-semibold text-warm-500 uppercase tracking-wider mb-2",children:[Re("todo.attachedImages")," (",Qt.length,")"]}),d.jsx("div",{className:"flex flex-wrap gap-2",children:Qt.map(pe=>d.jsx("a",{href:ao(e.id,pe.id),target:"_blank",rel:"noopener noreferrer",className:"block",children:d.jsx("img",{src:ao(e.id,pe.id),alt:pe.originalName,className:"h-24 w-24 object-cover rounded-lg border border-warm-200 hover:border-accent transition-colors cursor-pointer"})},pe.id))})]}),sn&&d.jsx("div",{className:"flex items-center gap-2 text-xs",children:d.jsxs("span",{className:"badge bg-cyan-500/10 text-cyan-600",children:[Re("todo.dependsOn"),": ",sn.title]})}),e.branch_name&&d.jsxs("div",{className:"flex flex-wrap gap-2 text-xs",children:[d.jsxs("span",{className:"badge bg-status-running/10 text-status-running",children:[Re("todo.branch"),": ",e.branch_name]}),e.worktree_path&&d.jsxs("span",{className:"badge bg-warm-200 text-warm-600 font-mono",children:[Re("todo.path"),": ",e.worktree_path]}),e.merged_from_branch&&d.jsxs("span",{className:"badge bg-purple-500/10 text-purple-600",children:[Re("todo.mergedFrom"),": ",e.merged_from_branch]}),!e.worktree_path&&_r&&d.jsxs("span",{className:"badge bg-amber-500/10 text-amber-600",children:[Re("todo.transferredTo"),": ",_r.title.length>20?_r.title.slice(0,20)+"...":_r.title]})]}),e.status==="failed"&&X.length>0&&(()=>{var Ut;const pe=X.filter(mt=>mt.log_type==="error");if(pe.length===0)return null;const Ge=pe.find(mt=>/exited with code (\d+)/.test(mt.message)),Ke=Ge?(Ut=Ge.message.match(/exited with code (\d+)/))==null?void 0:Ut[1]:null;return d.jsxs("div",{className:"rounded-xl border border-status-error/30 bg-status-error/5 overflow-hidden",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 bg-status-error/10 border-b border-status-error/20",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("svg",{className:"h-4 w-4 text-status-error",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})}),d.jsx("h4",{className:"text-xs font-semibold text-status-error uppercase tracking-wider",children:Re("failure.title")}),Ke&&d.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-status-error/15 text-status-error",children:[Re("failure.exitCode"),": ",Ke]})]}),p&&d.jsxs("button",{onClick:()=>p(e,pe),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-amber-500/15 text-amber-500 hover:bg-amber-500/25 border border-amber-500/30 transition-colors",title:Re("failure.fix"),children:[d.jsxs("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),Re("failure.fix")]})]}),d.jsx("div",{className:"px-4 py-3 space-y-1.5 max-h-48 overflow-y-auto",children:pe.map(mt=>d.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[d.jsx("span",{className:"text-warm-500 font-mono flex-shrink-0",children:new Date(mt.created_at).toLocaleTimeString()}),d.jsx("span",{className:"text-status-error font-mono whitespace-pre-wrap break-all",children:mt.message})]},mt.id))})]})})(),aa&&Ne&&d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex flex-wrap gap-3",children:[Ne.duration_seconds!==null&&d.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-warm-100 text-warm-700",children:[d.jsx("svg",{className:"h-3.5 w-3.5 text-warm-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),d.jsx("span",{className:"text-xs font-medium",children:Re("result.duration")}),d.jsx("span",{className:"text-xs font-mono",children:An(Ne.duration_seconds)})]}),Ne.commits.length>0&&d.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-status-success/10 text-status-success",children:[d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),d.jsxs("span",{className:"text-xs font-medium",children:[Ne.commits.length," ",Re("result.commits")]})]}),Ne.diff_stats.files_changed>0&&d.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-status-info/10 text-status-info",children:[d.jsxs("span",{className:"text-xs font-medium",children:[Ne.diff_stats.files_changed," ",Re("result.filesChanged")]}),d.jsxs("span",{className:"text-xs text-status-success font-mono",children:["+",Ne.diff_stats.insertions]}),d.jsxs("span",{className:"text-xs text-status-error font-mono",children:["-",Ne.diff_stats.deletions]})]}),H&&Ne.token_usage&&(()=>{const pe=Ne.token_usage,Ge=(pe.input_tokens??0)+(pe.cache_read_input_tokens??0)+(pe.cache_creation_input_tokens??0),Ke=Ge+(pe.output_tokens??0);let Ut,mt;return Ke>=5e5?(Ut=Re("result.levelHeavy"),mt="text-status-error font-semibold"):Ke>=3e5?(Ut=Re("result.levelHigh"),mt="text-orange-600 font-semibold"):Ke>=1e5?(Ut=Re("result.levelModerate"),mt="text-amber-600"):(Ut=Re("result.levelLight"),mt="text-purple-500"),d.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-purple-100 text-purple-700",children:[d.jsx("svg",{className:"h-3.5 w-3.5 text-purple-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),Ge>0&&d.jsxs("span",{className:"text-xs font-mono",children:[Re("result.inputTokens")," ",At(Ge)]}),Ge>0&&pe.output_tokens!==null&&d.jsx("span",{className:"text-xs text-purple-300",children:"·"}),pe.output_tokens!==null&&d.jsxs("span",{className:"text-xs font-mono",children:[Re("result.outputTokens")," ",At(pe.output_tokens)]}),pe.num_turns!=null&&pe.num_turns>1&&d.jsx("span",{className:"text-xs text-purple-300",children:"·"}),pe.num_turns!=null&&pe.num_turns>1&&d.jsxs("span",{className:"text-xs font-mono",children:[pe.num_turns,Re("result.turns")]}),d.jsx("span",{className:"text-xs text-purple-300",children:"·"}),d.jsx("span",{className:`text-xs font-mono ${mt}`,children:Ut})]})})()]}),Ne.commits.length>0&&d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-warm-500 uppercase tracking-wider mb-2",children:Re("result.commitHistory")}),d.jsx("div",{className:"space-y-1",children:Ne.commits.map((pe,Ge)=>d.jsxs("div",{className:"flex items-start gap-2 text-xs py-1 px-2 rounded hover:bg-warm-100 transition-colors",children:[d.jsx("span",{className:"font-mono text-status-info flex-shrink-0",children:pe.hash.slice(0,7)||"-------"}),d.jsx("span",{className:"text-warm-700 flex-1",children:pe.message}),d.jsx("span",{className:"text-warm-400 flex-shrink-0",children:new Date(pe.date).toLocaleTimeString()})]},Ge))})]}),Ne.changed_files.length>0&&d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-warm-500 uppercase tracking-wider mb-2",children:Re("result.changedFiles")}),d.jsx("div",{className:"space-y-0.5",children:Ne.changed_files.map((pe,Ge)=>{const Ke=Gt[pe.status]||{label:pe.status,color:"text-warm-500"};return d.jsxs("div",{className:"flex items-center gap-2 text-xs py-1 px-2 rounded hover:bg-warm-100 transition-colors",children:[d.jsx("span",{className:`font-mono font-bold w-4 text-center flex-shrink-0 ${Ke.color}`,children:pe.status}),d.jsx("span",{className:"font-mono text-warm-700 flex-1 truncate",title:pe.file,children:pe.file}),pe.renamedFrom&&d.jsxs("span",{className:"text-warm-400 truncate",title:pe.renamedFrom,children:["← ",pe.renamedFrom]})]},Ge)})})]})]}),ke&&d.jsxs("div",{className:"py-2.5 px-4 bg-status-error/5 border border-status-error/20 rounded-xl text-xs text-status-error",children:[Re("todo.mergeFailed"),": ",ke]}),Se&&d.jsxs("div",{className:"py-2.5 px-4 bg-status-error/5 border border-status-error/20 rounded-xl text-xs text-status-error",children:[Re("todo.cleanupFailed"),": ",Se]}),Te&&d.jsxs("div",{className:"py-2.5 px-4 bg-status-error/5 border border-status-error/20 rounded-xl text-xs text-status-error",children:[Re("todo.retryFailed"),": ",Te]}),W&&d.jsxs("div",{className:"py-2.5 px-4 bg-status-error/5 border border-status-error/20 rounded-xl text-xs text-status-error",children:[Re("todo.diffError"),": ",W]}),$&&I&&d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("h4",{className:"text-xs font-semibold text-warm-500 uppercase tracking-wider",children:Re("todo.diffOutput")}),d.jsxs("div",{className:"flex gap-3 text-xs",children:[d.jsxs("span",{className:"text-warm-400",children:[I.stats.files_changed," ",Re("todo.files")]}),d.jsxs("span",{className:"text-status-success",children:["+",I.stats.insertions]}),d.jsxs("span",{className:"text-status-error",children:["-",I.stats.deletions]})]})]}),d.jsx("pre",{className:"h-60 sm:h-80 overflow-auto bg-warm-800 rounded-xl border border-warm-700 p-3 sm:p-4 font-mono text-xs leading-relaxed",children:I.diff?I.diff.split(`
67
+ `).map((pe,Ge)=>{let Ke="text-warm-400";return pe.startsWith("+")&&!pe.startsWith("+++")?Ke="text-green-400":pe.startsWith("-")&&!pe.startsWith("---")?Ke="text-red-400":pe.startsWith("@@")?Ke="text-blue-400":pe.startsWith("diff ")&&(Ke="text-amber-300 font-bold"),d.jsx("div",{className:Ke,children:pe},Ge)}):d.jsx("span",{className:"text-warm-500 italic",children:Re("log.noChanges")})})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-warm-500 uppercase tracking-wider mb-2",children:Re("todo.systemLog")}),d.jsx(YE,{logs:X,interactive:w&&e.status==="running",todoId:e.id,onSendInput:j})]})]})]}),Et&&d.jsxs("div",{className:"mt-1.5 flex items-center gap-2 px-4 py-2 rounded-lg border-2 border-dashed border-cyan-400 bg-cyan-50/50 animate-fade-in",children:[d.jsx("svg",{className:"h-3.5 w-3.5 text-cyan-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),d.jsx("span",{className:"text-xs font-medium text-cyan-600",children:Re("dnd.dropHint")})]}),$a&&d.jsxs("div",{className:"mt-1.5 flex items-center gap-2 px-4 py-2 rounded-lg border-2 border-dashed border-red-300 bg-red-50/50 animate-fade-in",children:[d.jsx("svg",{className:"h-3.5 w-3.5 text-red-400 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"})}),d.jsx("span",{className:"text-xs font-medium text-red-400",children:Re("dnd.cyclicWarning")})]})]})}function Ht(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,a;n<e.length;n++)(a=Ht(e[n]))!==""&&(t+=(t&&" ")+a);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var l8={value:()=>{}};function Fc(){for(var e=0,t=arguments.length,n={},a;e<t;++e){if(!(a=arguments[e]+"")||a in n||/[\s.]/.test(a))throw new Error("illegal type: "+a);n[a]=[]}return new gc(n)}function gc(e){this._=e}function o8(e,t){return e.trim().split(/^|\s+/).map(function(n){var a="",s=n.indexOf(".");if(s>=0&&(a=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:a}})}gc.prototype=Fc.prototype={constructor:gc,on:function(e,t){var n=this._,a=o8(e+"",n),s,l=-1,o=a.length;if(arguments.length<2){for(;++l<o;)if((s=(e=a[l]).type)&&(s=u8(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++l<o;)if(s=(e=a[l]).type)n[s]=Dj(n[s],e.name,t);else if(t==null)for(s in n)n[s]=Dj(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new gc(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),a=0,s,l;a<s;++a)n[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(l=this._[e],a=0,s=l.length;a<s;++a)l[a].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var a=this._[e],s=0,l=a.length;s<l;++s)a[s].value.apply(t,n)}};function u8(e,t){for(var n=0,a=e.length,s;n<a;++n)if((s=e[n]).name===t)return s.value}function Dj(e,t,n){for(var a=0,s=e.length;a<s;++a)if(e[a].name===t){e[a]=l8,e=e.slice(0,a).concat(e.slice(a+1));break}return n!=null&&e.push({name:t,value:n}),e}var Py="http://www.w3.org/1999/xhtml";const Oj={svg:"http://www.w3.org/2000/svg",xhtml:Py,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Uc(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Oj.hasOwnProperty(t)?{space:Oj[t],local:e}:e}function c8(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Py&&t.documentElement.namespaceURI===Py?t.createElement(e):t.createElementNS(n,e)}}function d8(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function XE(e){var t=Uc(e);return(t.local?d8:c8)(t)}function f8(){}function Sb(e){return e==null?f8:function(){return this.querySelector(e)}}function h8(e){typeof e!="function"&&(e=Sb(e));for(var t=this._groups,n=t.length,a=new Array(n),s=0;s<n;++s)for(var l=t[s],o=l.length,c=a[s]=new Array(o),f,h,g=0;g<o;++g)(f=l[g])&&(h=e.call(f,f.__data__,g,l))&&("__data__"in f&&(h.__data__=f.__data__),c[g]=h);return new Tn(a,this._parents)}function m8(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function p8(){return[]}function KE(e){return e==null?p8:function(){return this.querySelectorAll(e)}}function g8(e){return function(){return m8(e.apply(this,arguments))}}function x8(e){typeof e=="function"?e=g8(e):e=KE(e);for(var t=this._groups,n=t.length,a=[],s=[],l=0;l<n;++l)for(var o=t[l],c=o.length,f,h=0;h<c;++h)(f=o[h])&&(a.push(e.call(f,f.__data__,h,o)),s.push(f));return new Tn(a,s)}function WE(e){return function(){return this.matches(e)}}function QE(e){return function(t){return t.matches(e)}}var y8=Array.prototype.find;function b8(e){return function(){return y8.call(this.children,e)}}function v8(){return this.firstElementChild}function w8(e){return this.select(e==null?v8:b8(typeof e=="function"?e:QE(e)))}var j8=Array.prototype.filter;function k8(){return Array.from(this.children)}function S8(e){return function(){return j8.call(this.children,e)}}function _8(e){return this.selectAll(e==null?k8:S8(typeof e=="function"?e:QE(e)))}function N8(e){typeof e!="function"&&(e=WE(e));for(var t=this._groups,n=t.length,a=new Array(n),s=0;s<n;++s)for(var l=t[s],o=l.length,c=a[s]=[],f,h=0;h<o;++h)(f=l[h])&&e.call(f,f.__data__,h,l)&&c.push(f);return new Tn(a,this._parents)}function ZE(e){return new Array(e.length)}function C8(){return new Tn(this._enter||this._groups.map(ZE),this._parents)}function kc(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}kc.prototype={constructor:kc,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function E8(e){return function(){return e}}function T8(e,t,n,a,s,l){for(var o=0,c,f=t.length,h=l.length;o<h;++o)(c=t[o])?(c.__data__=l[o],a[o]=c):n[o]=new kc(e,l[o]);for(;o<f;++o)(c=t[o])&&(s[o]=c)}function A8(e,t,n,a,s,l,o){var c,f,h=new Map,g=t.length,p=l.length,x=new Array(g),y;for(c=0;c<g;++c)(f=t[c])&&(x[c]=y=o.call(f,f.__data__,c,t)+"",h.has(y)?s[c]=f:h.set(y,f));for(c=0;c<p;++c)y=o.call(e,l[c],c,l)+"",(f=h.get(y))?(a[c]=f,f.__data__=l[c],h.delete(y)):n[c]=new kc(e,l[c]);for(c=0;c<g;++c)(f=t[c])&&h.get(x[c])===f&&(s[c]=f)}function M8(e){return e.__data__}function R8(e,t){if(!arguments.length)return Array.from(this,M8);var n=t?A8:T8,a=this._parents,s=this._groups;typeof e!="function"&&(e=E8(e));for(var l=s.length,o=new Array(l),c=new Array(l),f=new Array(l),h=0;h<l;++h){var g=a[h],p=s[h],x=p.length,y=L8(e.call(g,g&&g.__data__,h,a)),w=y.length,j=c[h]=new Array(w),S=o[h]=new Array(w),k=f[h]=new Array(x);n(g,p,j,S,k,y,t);for(var N=0,_=0,E,M;N<w;++N)if(E=j[N]){for(N>=_&&(_=N+1);!(M=S[_])&&++_<w;);E._next=M||null}}return o=new Tn(o,a),o._enter=c,o._exit=f,o}function L8(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function D8(){return new Tn(this._exit||this._groups.map(ZE),this._parents)}function O8(e,t,n){var a=this.enter(),s=this,l=this.exit();return typeof e=="function"?(a=e(a),a&&(a=a.selection())):a=a.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?l.remove():n(l),a&&s?a.merge(s).order():s}function z8(e){for(var t=e.selection?e.selection():e,n=this._groups,a=t._groups,s=n.length,l=a.length,o=Math.min(s,l),c=new Array(s),f=0;f<o;++f)for(var h=n[f],g=a[f],p=h.length,x=c[f]=new Array(p),y,w=0;w<p;++w)(y=h[w]||g[w])&&(x[w]=y);for(;f<s;++f)c[f]=n[f];return new Tn(c,this._parents)}function q8(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var a=e[t],s=a.length-1,l=a[s],o;--s>=0;)(o=a[s])&&(l&&o.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(o,l),l=o);return this}function I8(e){e||(e=B8);function t(p,x){return p&&x?e(p.__data__,x.__data__):!p-!x}for(var n=this._groups,a=n.length,s=new Array(a),l=0;l<a;++l){for(var o=n[l],c=o.length,f=s[l]=new Array(c),h,g=0;g<c;++g)(h=o[g])&&(f[g]=h);f.sort(t)}return new Tn(s,this._parents).order()}function B8(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function H8(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function P8(){return Array.from(this)}function F8(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var a=e[t],s=0,l=a.length;s<l;++s){var o=a[s];if(o)return o}return null}function U8(){let e=0;for(const t of this)++e;return e}function $8(){return!this.node()}function G8(e){for(var t=this._groups,n=0,a=t.length;n<a;++n)for(var s=t[n],l=0,o=s.length,c;l<o;++l)(c=s[l])&&e.call(c,c.__data__,l,s);return this}function V8(e){return function(){this.removeAttribute(e)}}function Y8(e){return function(){this.removeAttributeNS(e.space,e.local)}}function X8(e,t){return function(){this.setAttribute(e,t)}}function K8(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function W8(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Q8(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Z8(e,t){var n=Uc(e);if(arguments.length<2){var a=this.node();return n.local?a.getAttributeNS(n.space,n.local):a.getAttribute(n)}return this.each((t==null?n.local?Y8:V8:typeof t=="function"?n.local?Q8:W8:n.local?K8:X8)(n,t))}function JE(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function J8(e){return function(){this.style.removeProperty(e)}}function ez(e,t,n){return function(){this.style.setProperty(e,t,n)}}function tz(e,t,n){return function(){var a=t.apply(this,arguments);a==null?this.style.removeProperty(e):this.style.setProperty(e,a,n)}}function nz(e,t,n){return arguments.length>1?this.each((t==null?J8:typeof t=="function"?tz:ez)(e,t,n??"")):_s(this.node(),e)}function _s(e,t){return e.style.getPropertyValue(t)||JE(e).getComputedStyle(e,null).getPropertyValue(t)}function rz(e){return function(){delete this[e]}}function az(e,t){return function(){this[e]=t}}function iz(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function sz(e,t){return arguments.length>1?this.each((t==null?rz:typeof t=="function"?iz:az)(e,t)):this.node()[e]}function e3(e){return e.trim().split(/^|\s+/)}function _b(e){return e.classList||new t3(e)}function t3(e){this._node=e,this._names=e3(e.getAttribute("class")||"")}t3.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function n3(e,t){for(var n=_b(e),a=-1,s=t.length;++a<s;)n.add(t[a])}function r3(e,t){for(var n=_b(e),a=-1,s=t.length;++a<s;)n.remove(t[a])}function lz(e){return function(){n3(this,e)}}function oz(e){return function(){r3(this,e)}}function uz(e,t){return function(){(t.apply(this,arguments)?n3:r3)(this,e)}}function cz(e,t){var n=e3(e+"");if(arguments.length<2){for(var a=_b(this.node()),s=-1,l=n.length;++s<l;)if(!a.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?uz:t?lz:oz)(n,t))}function dz(){this.textContent=""}function fz(e){return function(){this.textContent=e}}function hz(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function mz(e){return arguments.length?this.each(e==null?dz:(typeof e=="function"?hz:fz)(e)):this.node().textContent}function pz(){this.innerHTML=""}function gz(e){return function(){this.innerHTML=e}}function xz(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function yz(e){return arguments.length?this.each(e==null?pz:(typeof e=="function"?xz:gz)(e)):this.node().innerHTML}function bz(){this.nextSibling&&this.parentNode.appendChild(this)}function vz(){return this.each(bz)}function wz(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function jz(){return this.each(wz)}function kz(e){var t=typeof e=="function"?e:XE(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Sz(){return null}function _z(e,t){var n=typeof e=="function"?e:XE(e),a=t==null?Sz:typeof t=="function"?t:Sb(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),a.apply(this,arguments)||null)})}function Nz(){var e=this.parentNode;e&&e.removeChild(this)}function Cz(){return this.each(Nz)}function Ez(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Tz(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Az(e){return this.select(e?Tz:Ez)}function Mz(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Rz(e){return function(t){e.call(this,t,this.__data__)}}function Lz(e){return e.trim().split(/^|\s+/).map(function(t){var n="",a=t.indexOf(".");return a>=0&&(n=t.slice(a+1),t=t.slice(0,a)),{type:t,name:n}})}function Dz(e){return function(){var t=this.__on;if(t){for(var n=0,a=-1,s=t.length,l;n<s;++n)l=t[n],(!e.type||l.type===e.type)&&l.name===e.name?this.removeEventListener(l.type,l.listener,l.options):t[++a]=l;++a?t.length=a:delete this.__on}}}function Oz(e,t,n){return function(){var a=this.__on,s,l=Rz(t);if(a){for(var o=0,c=a.length;o<c;++o)if((s=a[o]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=l,s.options=n),s.value=t;return}}this.addEventListener(e.type,l,n),s={type:e.type,name:e.name,value:t,listener:l,options:n},a?a.push(s):this.__on=[s]}}function zz(e,t,n){var a=Lz(e+""),s,l=a.length,o;if(arguments.length<2){var c=this.node().__on;if(c){for(var f=0,h=c.length,g;f<h;++f)for(s=0,g=c[f];s<l;++s)if((o=a[s]).type===g.type&&o.name===g.name)return g.value}return}for(c=t?Oz:Dz,s=0;s<l;++s)this.each(c(a[s],t,n));return this}function a3(e,t,n){var a=JE(e),s=a.CustomEvent;typeof s=="function"?s=new s(t,n):(s=a.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function qz(e,t){return function(){return a3(this,e,t)}}function Iz(e,t){return function(){return a3(this,e,t.apply(this,arguments))}}function Bz(e,t){return this.each((typeof t=="function"?Iz:qz)(e,t))}function*Hz(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var a=e[t],s=0,l=a.length,o;s<l;++s)(o=a[s])&&(yield o)}var i3=[null];function Tn(e,t){this._groups=e,this._parents=t}function So(){return new Tn([[document.documentElement]],i3)}function Pz(){return this}Tn.prototype=So.prototype={constructor:Tn,select:h8,selectAll:x8,selectChild:w8,selectChildren:_8,filter:N8,data:R8,enter:C8,exit:D8,join:O8,merge:z8,selection:Pz,order:q8,sort:I8,call:H8,nodes:P8,node:F8,size:U8,empty:$8,each:G8,attr:Z8,style:nz,property:sz,classed:cz,text:mz,html:yz,raise:vz,lower:jz,append:kz,insert:_z,remove:Cz,clone:Az,datum:Mz,on:zz,dispatch:Bz,[Symbol.iterator]:Hz};function Cn(e){return typeof e=="string"?new Tn([[document.querySelector(e)]],[document.documentElement]):new Tn([[e]],i3)}function Fz(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Kn(e,t){if(e=Fz(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var a=n.createSVGPoint();return a.x=e.clientX,a.y=e.clientY,a=a.matrixTransform(t.getScreenCTM().inverse()),[a.x,a.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const Uz={passive:!1},so={capture:!0,passive:!1};function Fh(e){e.stopImmediatePropagation()}function js(e){e.preventDefault(),e.stopImmediatePropagation()}function s3(e){var t=e.document.documentElement,n=Cn(e).on("dragstart.drag",js,so);"onselectstart"in t?n.on("selectstart.drag",js,so):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function l3(e,t){var n=e.document.documentElement,a=Cn(e).on("dragstart.drag",null);t&&(a.on("click.drag",js,so),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in n?a.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const tc=e=>()=>e;function Fy(e,{sourceEvent:t,subject:n,target:a,identifier:s,active:l,x:o,y:c,dx:f,dy:h,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:g}})}Fy.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function $z(e){return!e.ctrlKey&&!e.button}function Gz(){return this.parentNode}function Vz(e,t){return t??{x:e.x,y:e.y}}function Yz(){return navigator.maxTouchPoints||"ontouchstart"in this}function o3(){var e=$z,t=Gz,n=Vz,a=Yz,s={},l=Fc("start","drag","end"),o=0,c,f,h,g,p=0;function x(E){E.on("mousedown.drag",y).filter(a).on("touchstart.drag",S).on("touchmove.drag",k,Uz).on("touchend.drag touchcancel.drag",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function y(E,M){if(!(g||!e.call(this,E,M))){var T=_(this,t.call(this,E,M),E,M,"mouse");T&&(Cn(E.view).on("mousemove.drag",w,so).on("mouseup.drag",j,so),s3(E.view),Fh(E),h=!1,c=E.clientX,f=E.clientY,T("start",E))}}function w(E){if(js(E),!h){var M=E.clientX-c,T=E.clientY-f;h=M*M+T*T>p}s.mouse("drag",E)}function j(E){Cn(E.view).on("mousemove.drag mouseup.drag",null),l3(E.view,h),js(E),s.mouse("end",E)}function S(E,M){if(e.call(this,E,M)){var T=E.changedTouches,R=t.call(this,E,M),B=T.length,P,L;for(P=0;P<B;++P)(L=_(this,R,E,M,T[P].identifier,T[P]))&&(Fh(E),L("start",E,T[P]))}}function k(E){var M=E.changedTouches,T=M.length,R,B;for(R=0;R<T;++R)(B=s[M[R].identifier])&&(js(E),B("drag",E,M[R]))}function N(E){var M=E.changedTouches,T=M.length,R,B;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),R=0;R<T;++R)(B=s[M[R].identifier])&&(Fh(E),B("end",E,M[R]))}function _(E,M,T,R,B,P){var L=l.copy(),H=Kn(P||T,M),F,G,q;if((q=n.call(E,new Fy("beforestart",{sourceEvent:T,target:x,identifier:B,active:o,x:H[0],y:H[1],dx:0,dy:0,dispatch:L}),R))!=null)return F=q.x-H[0]||0,G=q.y-H[1]||0,function O(D,X,K){var Z=H,z;switch(D){case"start":s[B]=O,z=o++;break;case"end":delete s[B],--o;case"drag":H=Kn(K||X,M),z=o;break}L.call(D,E,new Fy(D,{sourceEvent:X,subject:q,target:x,identifier:B,active:z,x:H[0]+F,y:H[1]+G,dx:H[0]-Z[0],dy:H[1]-Z[1],dispatch:L}),R)}}return x.filter=function(E){return arguments.length?(e=typeof E=="function"?E:tc(!!E),x):e},x.container=function(E){return arguments.length?(t=typeof E=="function"?E:tc(E),x):t},x.subject=function(E){return arguments.length?(n=typeof E=="function"?E:tc(E),x):n},x.touchable=function(E){return arguments.length?(a=typeof E=="function"?E:tc(!!E),x):a},x.on=function(){var E=l.on.apply(l,arguments);return E===l?x:E},x.clickDistance=function(E){return arguments.length?(p=(E=+E)*E,x):Math.sqrt(p)},x}function Nb(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function u3(e,t){var n=Object.create(e.prototype);for(var a in t)n[a]=t[a];return n}function _o(){}var lo=.7,Sc=1/lo,ks="\\s*([+-]?\\d+)\\s*",oo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",pr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Xz=/^#([0-9a-f]{3,8})$/,Kz=new RegExp(`^rgb\\(${ks},${ks},${ks}\\)$`),Wz=new RegExp(`^rgb\\(${pr},${pr},${pr}\\)$`),Qz=new RegExp(`^rgba\\(${ks},${ks},${ks},${oo}\\)$`),Zz=new RegExp(`^rgba\\(${pr},${pr},${pr},${oo}\\)$`),Jz=new RegExp(`^hsl\\(${oo},${pr},${pr}\\)$`),eq=new RegExp(`^hsla\\(${oo},${pr},${pr},${oo}\\)$`),zj={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};Nb(_o,xi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qj,formatHex:qj,formatHex8:tq,formatHsl:nq,formatRgb:Ij,toString:Ij});function qj(){return this.rgb().formatHex()}function tq(){return this.rgb().formatHex8()}function nq(){return c3(this).formatHsl()}function Ij(){return this.rgb().formatRgb()}function xi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Xz.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Bj(t):n===3?new gn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?nc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?nc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Kz.exec(e))?new gn(t[1],t[2],t[3],1):(t=Wz.exec(e))?new gn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Qz.exec(e))?nc(t[1],t[2],t[3],t[4]):(t=Zz.exec(e))?nc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Jz.exec(e))?Fj(t[1],t[2]/100,t[3]/100,1):(t=eq.exec(e))?Fj(t[1],t[2]/100,t[3]/100,t[4]):zj.hasOwnProperty(e)?Bj(zj[e]):e==="transparent"?new gn(NaN,NaN,NaN,0):null}function Bj(e){return new gn(e>>16&255,e>>8&255,e&255,1)}function nc(e,t,n,a){return a<=0&&(e=t=n=NaN),new gn(e,t,n,a)}function rq(e){return e instanceof _o||(e=xi(e)),e?(e=e.rgb(),new gn(e.r,e.g,e.b,e.opacity)):new gn}function Uy(e,t,n,a){return arguments.length===1?rq(e):new gn(e,t,n,a??1)}function gn(e,t,n,a){this.r=+e,this.g=+t,this.b=+n,this.opacity=+a}Nb(gn,Uy,u3(_o,{brighter(e){return e=e==null?Sc:Math.pow(Sc,e),new gn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?lo:Math.pow(lo,e),new gn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new gn(pi(this.r),pi(this.g),pi(this.b),_c(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:Hj,formatHex:Hj,formatHex8:aq,formatRgb:Pj,toString:Pj}));function Hj(){return`#${mi(this.r)}${mi(this.g)}${mi(this.b)}`}function aq(){return`#${mi(this.r)}${mi(this.g)}${mi(this.b)}${mi((isNaN(this.opacity)?1:this.opacity)*255)}`}function Pj(){const e=_c(this.opacity);return`${e===1?"rgb(":"rgba("}${pi(this.r)}, ${pi(this.g)}, ${pi(this.b)}${e===1?")":`, ${e})`}`}function _c(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function pi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function mi(e){return e=pi(e),(e<16?"0":"")+e.toString(16)}function Fj(e,t,n,a){return a<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Wn(e,t,n,a)}function c3(e){if(e instanceof Wn)return new Wn(e.h,e.s,e.l,e.opacity);if(e instanceof _o||(e=xi(e)),!e)return new Wn;if(e instanceof Wn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,a=e.b/255,s=Math.min(t,n,a),l=Math.max(t,n,a),o=NaN,c=l-s,f=(l+s)/2;return c?(t===l?o=(n-a)/c+(n<a)*6:n===l?o=(a-t)/c+2:o=(t-n)/c+4,c/=f<.5?l+s:2-l-s,o*=60):c=f>0&&f<1?0:o,new Wn(o,c,f,e.opacity)}function iq(e,t,n,a){return arguments.length===1?c3(e):new Wn(e,t,n,a??1)}function Wn(e,t,n,a){this.h=+e,this.s=+t,this.l=+n,this.opacity=+a}Nb(Wn,iq,u3(_o,{brighter(e){return e=e==null?Sc:Math.pow(Sc,e),new Wn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?lo:Math.pow(lo,e),new Wn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,a=n+(n<.5?n:1-n)*t,s=2*n-a;return new gn(Uh(e>=240?e-240:e+120,s,a),Uh(e,s,a),Uh(e<120?e+240:e-120,s,a),this.opacity)},clamp(){return new Wn(Uj(this.h),rc(this.s),rc(this.l),_c(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=_c(this.opacity);return`${e===1?"hsl(":"hsla("}${Uj(this.h)}, ${rc(this.s)*100}%, ${rc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Uj(e){return e=(e||0)%360,e<0?e+360:e}function rc(e){return Math.max(0,Math.min(1,e||0))}function Uh(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Cb=e=>()=>e;function sq(e,t){return function(n){return e+n*t}}function lq(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(a){return Math.pow(e+a*t,n)}}function oq(e){return(e=+e)==1?d3:function(t,n){return n-t?lq(t,n,e):Cb(isNaN(t)?n:t)}}function d3(e,t){var n=t-e;return n?sq(e,n):Cb(isNaN(e)?t:e)}const Nc=(function e(t){var n=oq(t);function a(s,l){var o=n((s=Uy(s)).r,(l=Uy(l)).r),c=n(s.g,l.g),f=n(s.b,l.b),h=d3(s.opacity,l.opacity);return function(g){return s.r=o(g),s.g=c(g),s.b=f(g),s.opacity=h(g),s+""}}return a.gamma=e,a})(1);function uq(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,a=t.slice(),s;return function(l){for(s=0;s<n;++s)a[s]=e[s]*(1-l)+t[s]*l;return a}}function cq(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function dq(e,t){var n=t?t.length:0,a=e?Math.min(n,e.length):0,s=new Array(a),l=new Array(n),o;for(o=0;o<a;++o)s[o]=Zl(e[o],t[o]);for(;o<n;++o)l[o]=t[o];return function(c){for(o=0;o<a;++o)l[o]=s[o](c);return l}}function fq(e,t){var n=new Date;return e=+e,t=+t,function(a){return n.setTime(e*(1-a)+t*a),n}}function hr(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function hq(e,t){var n={},a={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=Zl(e[s],t[s]):a[s]=t[s];return function(l){for(s in n)a[s]=n[s](l);return a}}var $y=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$h=new RegExp($y.source,"g");function mq(e){return function(){return e}}function pq(e){return function(t){return e(t)+""}}function f3(e,t){var n=$y.lastIndex=$h.lastIndex=0,a,s,l,o=-1,c=[],f=[];for(e=e+"",t=t+"";(a=$y.exec(e))&&(s=$h.exec(t));)(l=s.index)>n&&(l=t.slice(n,l),c[o]?c[o]+=l:c[++o]=l),(a=a[0])===(s=s[0])?c[o]?c[o]+=s:c[++o]=s:(c[++o]=null,f.push({i:o,x:hr(a,s)})),n=$h.lastIndex;return n<t.length&&(l=t.slice(n),c[o]?c[o]+=l:c[++o]=l),c.length<2?f[0]?pq(f[0].x):mq(t):(t=f.length,function(h){for(var g=0,p;g<t;++g)c[(p=f[g]).i]=p.x(h);return c.join("")})}function Zl(e,t){var n=typeof t,a;return t==null||n==="boolean"?Cb(t):(n==="number"?hr:n==="string"?(a=xi(t))?(t=a,Nc):f3:t instanceof xi?Nc:t instanceof Date?fq:cq(t)?uq:Array.isArray(t)?dq:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?hq:hr)(e,t)}var $j=180/Math.PI,Gy={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function h3(e,t,n,a,s,l){var o,c,f;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(f=e*n+t*a)&&(n-=e*f,a-=t*f),(c=Math.sqrt(n*n+a*a))&&(n/=c,a/=c,f/=c),e*a<t*n&&(e=-e,t=-t,f=-f,o=-o),{translateX:s,translateY:l,rotate:Math.atan2(t,e)*$j,skewX:Math.atan(f)*$j,scaleX:o,scaleY:c}}var ac;function gq(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Gy:h3(t.a,t.b,t.c,t.d,t.e,t.f)}function xq(e){return e==null||(ac||(ac=document.createElementNS("http://www.w3.org/2000/svg","g")),ac.setAttribute("transform",e),!(e=ac.transform.baseVal.consolidate()))?Gy:(e=e.matrix,h3(e.a,e.b,e.c,e.d,e.e,e.f))}function m3(e,t,n,a){function s(h){return h.length?h.pop()+" ":""}function l(h,g,p,x,y,w){if(h!==p||g!==x){var j=y.push("translate(",null,t,null,n);w.push({i:j-4,x:hr(h,p)},{i:j-2,x:hr(g,x)})}else(p||x)&&y.push("translate("+p+t+x+n)}function o(h,g,p,x){h!==g?(h-g>180?g+=360:g-h>180&&(h+=360),x.push({i:p.push(s(p)+"rotate(",null,a)-2,x:hr(h,g)})):g&&p.push(s(p)+"rotate("+g+a)}function c(h,g,p,x){h!==g?x.push({i:p.push(s(p)+"skewX(",null,a)-2,x:hr(h,g)}):g&&p.push(s(p)+"skewX("+g+a)}function f(h,g,p,x,y,w){if(h!==p||g!==x){var j=y.push(s(y)+"scale(",null,",",null,")");w.push({i:j-4,x:hr(h,p)},{i:j-2,x:hr(g,x)})}else(p!==1||x!==1)&&y.push(s(y)+"scale("+p+","+x+")")}return function(h,g){var p=[],x=[];return h=e(h),g=e(g),l(h.translateX,h.translateY,g.translateX,g.translateY,p,x),o(h.rotate,g.rotate,p,x),c(h.skewX,g.skewX,p,x),f(h.scaleX,h.scaleY,g.scaleX,g.scaleY,p,x),h=g=null,function(y){for(var w=-1,j=x.length,S;++w<j;)p[(S=x[w]).i]=S.x(y);return p.join("")}}}var yq=m3(gq,"px, ","px)","deg)"),bq=m3(xq,", ",")",")"),vq=1e-12;function Gj(e){return((e=Math.exp(e))+1/e)/2}function wq(e){return((e=Math.exp(e))-1/e)/2}function jq(e){return((e=Math.exp(2*e))-1)/(e+1)}const xc=(function e(t,n,a){function s(l,o){var c=l[0],f=l[1],h=l[2],g=o[0],p=o[1],x=o[2],y=g-c,w=p-f,j=y*y+w*w,S,k;if(j<vq)k=Math.log(x/h)/t,S=function(R){return[c+R*y,f+R*w,h*Math.exp(t*R*k)]};else{var N=Math.sqrt(j),_=(x*x-h*h+a*j)/(2*h*n*N),E=(x*x-h*h-a*j)/(2*x*n*N),M=Math.log(Math.sqrt(_*_+1)-_),T=Math.log(Math.sqrt(E*E+1)-E);k=(T-M)/t,S=function(R){var B=R*k,P=Gj(M),L=h/(n*N)*(P*jq(t*B+M)-wq(M));return[c+L*y,f+L*w,h*P/Gj(t*B+M)]}}return S.duration=k*1e3*t/Math.SQRT2,S}return s.rho=function(l){var o=Math.max(.001,+l),c=o*o,f=c*c;return e(o,c,f)},s})(Math.SQRT2,2,4);var Ns=0,Yl=0,Bl=0,p3=1e3,Cc,Xl,Ec=0,yi=0,$c=0,uo=typeof performance=="object"&&performance.now?performance:Date,g3=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Eb(){return yi||(g3(kq),yi=uo.now()+$c)}function kq(){yi=0}function Tc(){this._call=this._time=this._next=null}Tc.prototype=x3.prototype={constructor:Tc,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Eb():+n)+(t==null?0:+t),!this._next&&Xl!==this&&(Xl?Xl._next=this:Cc=this,Xl=this),this._call=e,this._time=n,Vy()},stop:function(){this._call&&(this._call=null,this._time=1/0,Vy())}};function x3(e,t,n){var a=new Tc;return a.restart(e,t,n),a}function Sq(){Eb(),++Ns;for(var e=Cc,t;e;)(t=yi-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ns}function Vj(){yi=(Ec=uo.now())+$c,Ns=Yl=0;try{Sq()}finally{Ns=0,Nq(),yi=0}}function _q(){var e=uo.now(),t=e-Ec;t>p3&&($c-=t,Ec=e)}function Nq(){for(var e,t=Cc,n,a=1/0;t;)t._call?(a>t._time&&(a=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Cc=n);Xl=e,Vy(a)}function Vy(e){if(!Ns){Yl&&(Yl=clearTimeout(Yl));var t=e-yi;t>24?(e<1/0&&(Yl=setTimeout(Vj,e-uo.now()-$c)),Bl&&(Bl=clearInterval(Bl))):(Bl||(Ec=uo.now(),Bl=setInterval(_q,p3)),Ns=1,g3(Vj))}}function Yj(e,t,n){var a=new Tc;return t=t==null?0:+t,a.restart(s=>{a.stop(),e(s+t)},t,n),a}var Cq=Fc("start","end","cancel","interrupt"),Eq=[],y3=0,Xj=1,Yy=2,yc=3,Kj=4,Xy=5,bc=6;function Gc(e,t,n,a,s,l){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Tq(e,n,{name:t,index:a,group:s,on:Cq,tween:Eq,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:y3})}function Tb(e,t){var n=nr(e,t);if(n.state>y3)throw new Error("too late; already scheduled");return n}function br(e,t){var n=nr(e,t);if(n.state>yc)throw new Error("too late; already running");return n}function nr(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Tq(e,t,n){var a=e.__transition,s;a[t]=n,n.timer=x3(l,0,n.time);function l(h){n.state=Xj,n.timer.restart(o,n.delay,n.time),n.delay<=h&&o(h-n.delay)}function o(h){var g,p,x,y;if(n.state!==Xj)return f();for(g in a)if(y=a[g],y.name===n.name){if(y.state===yc)return Yj(o);y.state===Kj?(y.state=bc,y.timer.stop(),y.on.call("interrupt",e,e.__data__,y.index,y.group),delete a[g]):+g<t&&(y.state=bc,y.timer.stop(),y.on.call("cancel",e,e.__data__,y.index,y.group),delete a[g])}if(Yj(function(){n.state===yc&&(n.state=Kj,n.timer.restart(c,n.delay,n.time),c(h))}),n.state=Yy,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Yy){for(n.state=yc,s=new Array(x=n.tween.length),g=0,p=-1;g<x;++g)(y=n.tween[g].value.call(e,e.__data__,n.index,n.group))&&(s[++p]=y);s.length=p+1}}function c(h){for(var g=h<n.duration?n.ease.call(null,h/n.duration):(n.timer.restart(f),n.state=Xy,1),p=-1,x=s.length;++p<x;)s[p].call(e,g);n.state===Xy&&(n.on.call("end",e,e.__data__,n.index,n.group),f())}function f(){n.state=bc,n.timer.stop(),delete a[t];for(var h in a)return;delete e.__transition}}function vc(e,t){var n=e.__transition,a,s,l=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((a=n[o]).name!==t){l=!1;continue}s=a.state>Yy&&a.state<Xy,a.state=bc,a.timer.stop(),a.on.call(s?"interrupt":"cancel",e,e.__data__,a.index,a.group),delete n[o]}l&&delete e.__transition}}function Aq(e){return this.each(function(){vc(this,e)})}function Mq(e,t){var n,a;return function(){var s=br(this,e),l=s.tween;if(l!==n){a=n=l;for(var o=0,c=a.length;o<c;++o)if(a[o].name===t){a=a.slice(),a.splice(o,1);break}}s.tween=a}}function Rq(e,t,n){var a,s;if(typeof n!="function")throw new Error;return function(){var l=br(this,e),o=l.tween;if(o!==a){s=(a=o).slice();for(var c={name:t,value:n},f=0,h=s.length;f<h;++f)if(s[f].name===t){s[f]=c;break}f===h&&s.push(c)}l.tween=s}}function Lq(e,t){var n=this._id;if(e+="",arguments.length<2){for(var a=nr(this.node(),n).tween,s=0,l=a.length,o;s<l;++s)if((o=a[s]).name===e)return o.value;return null}return this.each((t==null?Mq:Rq)(n,e,t))}function Ab(e,t,n){var a=e._id;return e.each(function(){var s=br(this,a);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return nr(s,a).value[t]}}function b3(e,t){var n;return(typeof t=="number"?hr:t instanceof xi?Nc:(n=xi(t))?(t=n,Nc):f3)(e,t)}function Dq(e){return function(){this.removeAttribute(e)}}function Oq(e){return function(){this.removeAttributeNS(e.space,e.local)}}function zq(e,t,n){var a,s=n+"",l;return function(){var o=this.getAttribute(e);return o===s?null:o===a?l:l=t(a=o,n)}}function qq(e,t,n){var a,s=n+"",l;return function(){var o=this.getAttributeNS(e.space,e.local);return o===s?null:o===a?l:l=t(a=o,n)}}function Iq(e,t,n){var a,s,l;return function(){var o,c=n(this),f;return c==null?void this.removeAttribute(e):(o=this.getAttribute(e),f=c+"",o===f?null:o===a&&f===s?l:(s=f,l=t(a=o,c)))}}function Bq(e,t,n){var a,s,l;return function(){var o,c=n(this),f;return c==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),f=c+"",o===f?null:o===a&&f===s?l:(s=f,l=t(a=o,c)))}}function Hq(e,t){var n=Uc(e),a=n==="transform"?bq:b3;return this.attrTween(e,typeof t=="function"?(n.local?Bq:Iq)(n,a,Ab(this,"attr."+e,t)):t==null?(n.local?Oq:Dq)(n):(n.local?qq:zq)(n,a,t))}function Pq(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Fq(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Uq(e,t){var n,a;function s(){var l=t.apply(this,arguments);return l!==a&&(n=(a=l)&&Fq(e,l)),n}return s._value=t,s}function $q(e,t){var n,a;function s(){var l=t.apply(this,arguments);return l!==a&&(n=(a=l)&&Pq(e,l)),n}return s._value=t,s}function Gq(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var a=Uc(e);return this.tween(n,(a.local?Uq:$q)(a,t))}function Vq(e,t){return function(){Tb(this,e).delay=+t.apply(this,arguments)}}function Yq(e,t){return t=+t,function(){Tb(this,e).delay=t}}function Xq(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Vq:Yq)(t,e)):nr(this.node(),t).delay}function Kq(e,t){return function(){br(this,e).duration=+t.apply(this,arguments)}}function Wq(e,t){return t=+t,function(){br(this,e).duration=t}}function Qq(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Kq:Wq)(t,e)):nr(this.node(),t).duration}function Zq(e,t){if(typeof t!="function")throw new Error;return function(){br(this,e).ease=t}}function Jq(e){var t=this._id;return arguments.length?this.each(Zq(t,e)):nr(this.node(),t).ease}function eI(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;br(this,e).ease=n}}function tI(e){if(typeof e!="function")throw new Error;return this.each(eI(this._id,e))}function nI(e){typeof e!="function"&&(e=WE(e));for(var t=this._groups,n=t.length,a=new Array(n),s=0;s<n;++s)for(var l=t[s],o=l.length,c=a[s]=[],f,h=0;h<o;++h)(f=l[h])&&e.call(f,f.__data__,h,l)&&c.push(f);return new Qr(a,this._parents,this._name,this._id)}function rI(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,a=t.length,s=n.length,l=Math.min(a,s),o=new Array(a),c=0;c<l;++c)for(var f=t[c],h=n[c],g=f.length,p=o[c]=new Array(g),x,y=0;y<g;++y)(x=f[y]||h[y])&&(p[y]=x);for(;c<a;++c)o[c]=t[c];return new Qr(o,this._parents,this._name,this._id)}function aI(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function iI(e,t,n){var a,s,l=aI(t)?Tb:br;return function(){var o=l(this,e),c=o.on;c!==a&&(s=(a=c).copy()).on(t,n),o.on=s}}function sI(e,t){var n=this._id;return arguments.length<2?nr(this.node(),n).on.on(e):this.each(iI(n,e,t))}function lI(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function oI(){return this.on("end.remove",lI(this._id))}function uI(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Sb(e));for(var a=this._groups,s=a.length,l=new Array(s),o=0;o<s;++o)for(var c=a[o],f=c.length,h=l[o]=new Array(f),g,p,x=0;x<f;++x)(g=c[x])&&(p=e.call(g,g.__data__,x,c))&&("__data__"in g&&(p.__data__=g.__data__),h[x]=p,Gc(h[x],t,n,x,h,nr(g,n)));return new Qr(l,this._parents,t,n)}function cI(e){var t=this._name,n=this._id;typeof e!="function"&&(e=KE(e));for(var a=this._groups,s=a.length,l=[],o=[],c=0;c<s;++c)for(var f=a[c],h=f.length,g,p=0;p<h;++p)if(g=f[p]){for(var x=e.call(g,g.__data__,p,f),y,w=nr(g,n),j=0,S=x.length;j<S;++j)(y=x[j])&&Gc(y,t,n,j,x,w);l.push(x),o.push(g)}return new Qr(l,o,t,n)}var dI=So.prototype.constructor;function fI(){return new dI(this._groups,this._parents)}function hI(e,t){var n,a,s;return function(){var l=_s(this,e),o=(this.style.removeProperty(e),_s(this,e));return l===o?null:l===n&&o===a?s:s=t(n=l,a=o)}}function v3(e){return function(){this.style.removeProperty(e)}}function mI(e,t,n){var a,s=n+"",l;return function(){var o=_s(this,e);return o===s?null:o===a?l:l=t(a=o,n)}}function pI(e,t,n){var a,s,l;return function(){var o=_s(this,e),c=n(this),f=c+"";return c==null&&(f=c=(this.style.removeProperty(e),_s(this,e))),o===f?null:o===a&&f===s?l:(s=f,l=t(a=o,c))}}function gI(e,t){var n,a,s,l="style."+t,o="end."+l,c;return function(){var f=br(this,e),h=f.on,g=f.value[l]==null?c||(c=v3(t)):void 0;(h!==n||s!==g)&&(a=(n=h).copy()).on(o,s=g),f.on=a}}function xI(e,t,n){var a=(e+="")=="transform"?yq:b3;return t==null?this.styleTween(e,hI(e,a)).on("end.style."+e,v3(e)):typeof t=="function"?this.styleTween(e,pI(e,a,Ab(this,"style."+e,t))).each(gI(this._id,e)):this.styleTween(e,mI(e,a,t),n).on("end.style."+e,null)}function yI(e,t,n){return function(a){this.style.setProperty(e,t.call(this,a),n)}}function bI(e,t,n){var a,s;function l(){var o=t.apply(this,arguments);return o!==s&&(a=(s=o)&&yI(e,o,n)),a}return l._value=t,l}function vI(e,t,n){var a="style."+(e+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(t==null)return this.tween(a,null);if(typeof t!="function")throw new Error;return this.tween(a,bI(e,t,n??""))}function wI(e){return function(){this.textContent=e}}function jI(e){return function(){var t=e(this);this.textContent=t??""}}function kI(e){return this.tween("text",typeof e=="function"?jI(Ab(this,"text",e)):wI(e==null?"":e+""))}function SI(e){return function(t){this.textContent=e.call(this,t)}}function _I(e){var t,n;function a(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&SI(s)),t}return a._value=e,a}function NI(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,_I(e))}function CI(){for(var e=this._name,t=this._id,n=w3(),a=this._groups,s=a.length,l=0;l<s;++l)for(var o=a[l],c=o.length,f,h=0;h<c;++h)if(f=o[h]){var g=nr(f,t);Gc(f,e,n,h,o,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new Qr(a,this._parents,e,n)}function EI(){var e,t,n=this,a=n._id,s=n.size();return new Promise(function(l,o){var c={value:o},f={value:function(){--s===0&&l()}};n.each(function(){var h=br(this,a),g=h.on;g!==e&&(t=(e=g).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(f)),h.on=t}),s===0&&l()})}var TI=0;function Qr(e,t,n,a){this._groups=e,this._parents=t,this._name=n,this._id=a}function w3(){return++TI}var Yr=So.prototype;Qr.prototype={constructor:Qr,select:uI,selectAll:cI,selectChild:Yr.selectChild,selectChildren:Yr.selectChildren,filter:nI,merge:rI,selection:fI,transition:CI,call:Yr.call,nodes:Yr.nodes,node:Yr.node,size:Yr.size,empty:Yr.empty,each:Yr.each,on:sI,attr:Hq,attrTween:Gq,style:xI,styleTween:vI,text:kI,textTween:NI,remove:oI,tween:Lq,delay:Xq,duration:Qq,ease:Jq,easeVarying:tI,end:EI,[Symbol.iterator]:Yr[Symbol.iterator]};function AI(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var MI={time:null,delay:0,duration:250,ease:AI};function RI(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function LI(e){var t,n;e instanceof Qr?(t=e._id,e=e._name):(t=w3(),(n=MI).time=Eb(),e=e==null?null:e+"");for(var a=this._groups,s=a.length,l=0;l<s;++l)for(var o=a[l],c=o.length,f,h=0;h<c;++h)(f=o[h])&&Gc(f,e,t,h,o,n||RI(f,t));return new Qr(a,this._parents,e,t)}So.prototype.interrupt=Aq;So.prototype.transition=LI;const ic=e=>()=>e;function DI(e,{sourceEvent:t,target:n,transform:a,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:s}})}function Xr(e,t,n){this.k=e,this.x=t,this.y=n}Xr.prototype={constructor:Xr,scale:function(e){return e===1?this:new Xr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Xr(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Vc=new Xr(1,0,0);j3.prototype=Xr.prototype;function j3(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Vc;return e.__zoom}function Gh(e){e.stopImmediatePropagation()}function Hl(e){e.preventDefault(),e.stopImmediatePropagation()}function OI(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function zI(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Wj(){return this.__zoom||Vc}function qI(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function II(){return navigator.maxTouchPoints||"ontouchstart"in this}function BI(e,t,n){var a=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s),o>l?(l+o)/2:Math.min(0,l)||Math.max(0,o))}function k3(){var e=OI,t=zI,n=BI,a=qI,s=II,l=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],c=250,f=xc,h=Fc("start","zoom","end"),g,p,x,y=500,w=150,j=0,S=10;function k(q){q.property("__zoom",Wj).on("wheel.zoom",B,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",L).filter(s).on("touchstart.zoom",H).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",G).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(q,O,D,X){var K=q.selection?q.selection():q;K.property("__zoom",Wj),q!==K?M(q,O,D,X):K.interrupt().each(function(){T(this,arguments).event(X).start().zoom(null,typeof O=="function"?O.apply(this,arguments):O).end()})},k.scaleBy=function(q,O,D,X){k.scaleTo(q,function(){var K=this.__zoom.k,Z=typeof O=="function"?O.apply(this,arguments):O;return K*Z},D,X)},k.scaleTo=function(q,O,D,X){k.transform(q,function(){var K=t.apply(this,arguments),Z=this.__zoom,z=D==null?E(K):typeof D=="function"?D.apply(this,arguments):D,$=Z.invert(z),Q=typeof O=="function"?O.apply(this,arguments):O;return n(_(N(Z,Q),z,$),K,o)},D,X)},k.translateBy=function(q,O,D,X){k.transform(q,function(){return n(this.__zoom.translate(typeof O=="function"?O.apply(this,arguments):O,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),o)},null,X)},k.translateTo=function(q,O,D,X,K){k.transform(q,function(){var Z=t.apply(this,arguments),z=this.__zoom,$=X==null?E(Z):typeof X=="function"?X.apply(this,arguments):X;return n(Vc.translate($[0],$[1]).scale(z.k).translate(typeof O=="function"?-O.apply(this,arguments):-O,typeof D=="function"?-D.apply(this,arguments):-D),Z,o)},X,K)};function N(q,O){return O=Math.max(l[0],Math.min(l[1],O)),O===q.k?q:new Xr(O,q.x,q.y)}function _(q,O,D){var X=O[0]-D[0]*q.k,K=O[1]-D[1]*q.k;return X===q.x&&K===q.y?q:new Xr(q.k,X,K)}function E(q){return[(+q[0][0]+ +q[1][0])/2,(+q[0][1]+ +q[1][1])/2]}function M(q,O,D,X){q.on("start.zoom",function(){T(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(X).end()}).tween("zoom",function(){var K=this,Z=arguments,z=T(K,Z).event(X),$=t.apply(K,Z),Q=D==null?E($):typeof D=="function"?D.apply(K,Z):D,I=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),V=K.__zoom,te=typeof O=="function"?O.apply(K,Z):O,ne=f(V.invert(Q).concat(I/V.k),te.invert(Q).concat(I/te.k));return function(W){if(W===1)W=te;else{var Y=ne(W),ae=I/Y[2];W=new Xr(ae,Q[0]-Y[0]*ae,Q[1]-Y[1]*ae)}z.zoom(null,W)}})}function T(q,O,D){return!D&&q.__zooming||new R(q,O)}function R(q,O){this.that=q,this.args=O,this.active=0,this.sourceEvent=null,this.extent=t.apply(q,O),this.taps=0}R.prototype={event:function(q){return q&&(this.sourceEvent=q),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(q,O){return this.mouse&&q!=="mouse"&&(this.mouse[1]=O.invert(this.mouse[0])),this.touch0&&q!=="touch"&&(this.touch0[1]=O.invert(this.touch0[0])),this.touch1&&q!=="touch"&&(this.touch1[1]=O.invert(this.touch1[0])),this.that.__zoom=O,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(q){var O=Cn(this.that).datum();h.call(q,this.that,new DI(q,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:h}),O)}};function B(q,...O){if(!e.apply(this,arguments))return;var D=T(this,O).event(q),X=this.__zoom,K=Math.max(l[0],Math.min(l[1],X.k*Math.pow(2,a.apply(this,arguments)))),Z=Kn(q);if(D.wheel)(D.mouse[0][0]!==Z[0]||D.mouse[0][1]!==Z[1])&&(D.mouse[1]=X.invert(D.mouse[0]=Z)),clearTimeout(D.wheel);else{if(X.k===K)return;D.mouse=[Z,X.invert(Z)],vc(this),D.start()}Hl(q),D.wheel=setTimeout(z,w),D.zoom("mouse",n(_(N(X,K),D.mouse[0],D.mouse[1]),D.extent,o));function z(){D.wheel=null,D.end()}}function P(q,...O){if(x||!e.apply(this,arguments))return;var D=q.currentTarget,X=T(this,O,!0).event(q),K=Cn(q.view).on("mousemove.zoom",Q,!0).on("mouseup.zoom",I,!0),Z=Kn(q,D),z=q.clientX,$=q.clientY;s3(q.view),Gh(q),X.mouse=[Z,this.__zoom.invert(Z)],vc(this),X.start();function Q(V){if(Hl(V),!X.moved){var te=V.clientX-z,ne=V.clientY-$;X.moved=te*te+ne*ne>j}X.event(V).zoom("mouse",n(_(X.that.__zoom,X.mouse[0]=Kn(V,D),X.mouse[1]),X.extent,o))}function I(V){K.on("mousemove.zoom mouseup.zoom",null),l3(V.view,X.moved),Hl(V),X.event(V).end()}}function L(q,...O){if(e.apply(this,arguments)){var D=this.__zoom,X=Kn(q.changedTouches?q.changedTouches[0]:q,this),K=D.invert(X),Z=D.k*(q.shiftKey?.5:2),z=n(_(N(D,Z),X,K),t.apply(this,O),o);Hl(q),c>0?Cn(this).transition().duration(c).call(M,z,X,q):Cn(this).call(k.transform,z,X,q)}}function H(q,...O){if(e.apply(this,arguments)){var D=q.touches,X=D.length,K=T(this,O,q.changedTouches.length===X).event(q),Z,z,$,Q;for(Gh(q),z=0;z<X;++z)$=D[z],Q=Kn($,this),Q=[Q,this.__zoom.invert(Q),$.identifier],K.touch0?!K.touch1&&K.touch0[2]!==Q[2]&&(K.touch1=Q,K.taps=0):(K.touch0=Q,Z=!0,K.taps=1+!!g);g&&(g=clearTimeout(g)),Z&&(K.taps<2&&(p=Q[0],g=setTimeout(function(){g=null},y)),vc(this),K.start())}}function F(q,...O){if(this.__zooming){var D=T(this,O).event(q),X=q.changedTouches,K=X.length,Z,z,$,Q;for(Hl(q),Z=0;Z<K;++Z)z=X[Z],$=Kn(z,this),D.touch0&&D.touch0[2]===z.identifier?D.touch0[0]=$:D.touch1&&D.touch1[2]===z.identifier&&(D.touch1[0]=$);if(z=D.that.__zoom,D.touch1){var I=D.touch0[0],V=D.touch0[1],te=D.touch1[0],ne=D.touch1[1],W=(W=te[0]-I[0])*W+(W=te[1]-I[1])*W,Y=(Y=ne[0]-V[0])*Y+(Y=ne[1]-V[1])*Y;z=N(z,Math.sqrt(W/Y)),$=[(I[0]+te[0])/2,(I[1]+te[1])/2],Q=[(V[0]+ne[0])/2,(V[1]+ne[1])/2]}else if(D.touch0)$=D.touch0[0],Q=D.touch0[1];else return;D.zoom("touch",n(_(z,$,Q),D.extent,o))}}function G(q,...O){if(this.__zooming){var D=T(this,O).event(q),X=q.changedTouches,K=X.length,Z,z;for(Gh(q),x&&clearTimeout(x),x=setTimeout(function(){x=null},y),Z=0;Z<K;++Z)z=X[Z],D.touch0&&D.touch0[2]===z.identifier?delete D.touch0:D.touch1&&D.touch1[2]===z.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(z=Kn(z,this),Math.hypot(p[0]-z[0],p[1]-z[1])<S)){var $=Cn(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return k.wheelDelta=function(q){return arguments.length?(a=typeof q=="function"?q:ic(+q),k):a},k.filter=function(q){return arguments.length?(e=typeof q=="function"?q:ic(!!q),k):e},k.touchable=function(q){return arguments.length?(s=typeof q=="function"?q:ic(!!q),k):s},k.extent=function(q){return arguments.length?(t=typeof q=="function"?q:ic([[+q[0][0],+q[0][1]],[+q[1][0],+q[1][1]]]),k):t},k.scaleExtent=function(q){return arguments.length?(l[0]=+q[0],l[1]=+q[1],k):[l[0],l[1]]},k.translateExtent=function(q){return arguments.length?(o[0][0]=+q[0][0],o[1][0]=+q[1][0],o[0][1]=+q[0][1],o[1][1]=+q[1][1],k):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},k.constrain=function(q){return arguments.length?(n=q,k):n},k.duration=function(q){return arguments.length?(c=+q,k):c},k.interpolate=function(q){return arguments.length?(f=q,k):f},k.on=function(){var q=h.on.apply(h,arguments);return q===h?k:q},k.clickDistance=function(q){return arguments.length?(j=(q=+q)*q,k):Math.sqrt(j)},k.tapDistance=function(q){return arguments.length?(S=+q,k):S},k}const gr={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:e=>`Node type "${e}" 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:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:a})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:a}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},co=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],S3=["Enter"," ","Escape"],_3={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Cs;(function(e){e.Strict="strict",e.Loose="loose"})(Cs||(Cs={}));var gi;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(gi||(gi={}));var fo;(function(e){e.Partial="partial",e.Full="full"})(fo||(fo={}));const N3={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Oa;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Oa||(Oa={}));var ho;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ho||(ho={}));var Ie;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ie||(Ie={}));const Qj={[Ie.Left]:Ie.Right,[Ie.Right]:Ie.Left,[Ie.Top]:Ie.Bottom,[Ie.Bottom]:Ie.Top};function C3(e){return e===null?null:e?"valid":"invalid"}const E3=e=>"id"in e&&"source"in e&&"target"in e,HI=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Mb=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),No=(e,t=[0,0])=>{const{width:n,height:a}=Zr(e),s=e.origin??t,l=n*s[0],o=a*s[1];return{x:e.position.x-l,y:e.position.y-o}},PI=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((a,s)=>{const l=typeof s=="string";let o=!t.nodeLookup&&!l?s:void 0;t.nodeLookup&&(o=l?t.nodeLookup.get(s):Mb(s)?s:t.nodeLookup.get(s.id));const c=o?Ac(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Yc(a,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Xc(n)},Co=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=Yc(n,Ac(s)),a=!0)}),a?Xc(n):{x:0,y:0,width:0,height:0}},Rb=(e,t,[n,a,s]=[0,0,1],l=!1,o=!1)=>{const c={...To(t,[n,a,s]),width:t.width/s,height:t.height/s},f=[];for(const h of e.values()){const{measured:g,selectable:p=!0,hidden:x=!1}=h;if(o&&!p||x)continue;const y=g.width??h.width??h.initialWidth??null,w=g.height??h.height??h.initialHeight??null,j=mo(c,Ts(h)),S=(y??0)*(w??0),k=l&&j>0;(!h.internals.handleBounds||k||j>=S||h.dragging)&&f.push(h)}return f},FI=(e,t)=>{const n=new Set;return e.forEach(a=>{n.add(a.id)}),t.filter(a=>n.has(a.source)||n.has(a.target))};function UI(e,t){const n=new Map,a=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!a||a.has(s.id))&&n.set(s.id,s)}),n}async function $I({nodes:e,width:t,height:n,panZoom:a,minZoom:s,maxZoom:l},o){if(e.size===0)return Promise.resolve(!0);const c=UI(e,o),f=Co(c),h=Lb(f,t,n,(o==null?void 0:o.minZoom)??s,(o==null?void 0:o.maxZoom)??l,(o==null?void 0:o.padding)??.1);return await a.setViewport(h,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),Promise.resolve(!0)}function T3({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:a=[0,0],nodeExtent:s,onError:l}){const o=n.get(e),c=o.parentId?n.get(o.parentId):void 0,{x:f,y:h}=c?c.internals.positionAbsolute:{x:0,y:0},g=o.origin??a;let p=o.extent||s;if(o.extent==="parent"&&!o.expandParent)if(!c)l==null||l("005",gr.error005());else{const y=c.measured.width,w=c.measured.height;y&&w&&(p=[[f,h],[f+y,h+w]])}else c&&As(o.extent)&&(p=[[o.extent[0][0]+f,o.extent[0][1]+h],[o.extent[1][0]+f,o.extent[1][1]+h]]);const x=As(p)?bi(t,p,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(l==null||l("015",gr.error015())),{position:{x:x.x-f+(o.measured.width??0)*g[0],y:x.y-h+(o.measured.height??0)*g[1]},positionAbsolute:x}}async function GI({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:a,onBeforeDelete:s}){const l=new Set(e.map(x=>x.id)),o=[];for(const x of n){if(x.deletable===!1)continue;const y=l.has(x.id),w=!y&&x.parentId&&o.find(j=>j.id===x.parentId);(y||w)&&o.push(x)}const c=new Set(t.map(x=>x.id)),f=a.filter(x=>x.deletable!==!1),g=FI(o,f);for(const x of f)c.has(x.id)&&!g.find(w=>w.id===x.id)&&g.push(x);if(!s)return{edges:g,nodes:o};const p=await s({nodes:o,edges:g});return typeof p=="boolean"?p?{edges:g,nodes:o}:{edges:[],nodes:[]}:p}const Es=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),bi=(e={x:0,y:0},t,n)=>({x:Es(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Es(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function A3(e,t,n){const{width:a,height:s}=Zr(n),{x:l,y:o}=n.internals.positionAbsolute;return bi(e,[[l,o],[l+a,o+s]],t)}const Zj=(e,t,n)=>e<t?Es(Math.abs(e-t),1,t)/t:e>n?-Es(Math.abs(e-n),1,t)/t:0,M3=(e,t,n=15,a=40)=>{const s=Zj(e.x,a,t.width-a)*n,l=Zj(e.y,a,t.height-a)*n;return[s,l]},Yc=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Ky=({x:e,y:t,width:n,height:a})=>({x:e,y:t,x2:e+n,y2:t+a}),Xc=({x:e,y:t,x2:n,y2:a})=>({x:e,y:t,width:n-e,height:a-t}),Ts=(e,t=[0,0])=>{var s,l;const{x:n,y:a}=Mb(e)?e.internals.positionAbsolute:No(e,t);return{x:n,y:a,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0}},Ac=(e,t=[0,0])=>{var s,l;const{x:n,y:a}=Mb(e)?e.internals.positionAbsolute:No(e,t);return{x:n,y:a,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:a+(((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0)}},R3=(e,t)=>Xc(Yc(Ky(e),Ky(t))),mo=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),a=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*a)},Jj=e=>Qn(e.width)&&Qn(e.height)&&Qn(e.x)&&Qn(e.y),Qn=e=>!isNaN(e)&&isFinite(e),VI=(e,t)=>{},Eo=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),To=({x:e,y:t},[n,a,s],l=!1,o=[1,1])=>{const c={x:(e-n)/s,y:(t-a)/s};return l?Eo(c,o):c},Mc=({x:e,y:t},[n,a,s])=>({x:e*s+n,y:t*s+a});function ms(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function YI(e,t,n){if(typeof e=="string"||typeof e=="number"){const a=ms(e,n),s=ms(e,t);return{top:a,right:s,bottom:a,left:s,x:s*2,y:a*2}}if(typeof e=="object"){const a=ms(e.top??e.y??0,n),s=ms(e.bottom??e.y??0,n),l=ms(e.left??e.x??0,t),o=ms(e.right??e.x??0,t);return{top:a,right:o,bottom:s,left:l,x:l+o,y:a+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function XI(e,t,n,a,s,l){const{x:o,y:c}=Mc(e,[t,n,a]),{x:f,y:h}=Mc({x:e.x+e.width,y:e.y+e.height},[t,n,a]),g=s-f,p=l-h;return{left:Math.floor(o),top:Math.floor(c),right:Math.floor(g),bottom:Math.floor(p)}}const Lb=(e,t,n,a,s,l)=>{const o=YI(l,t,n),c=(t-o.x)/e.width,f=(n-o.y)/e.height,h=Math.min(c,f),g=Es(h,a,s),p=e.x+e.width/2,x=e.y+e.height/2,y=t/2-p*g,w=n/2-x*g,j=XI(e,y,w,g,t,n),S={left:Math.min(j.left-o.left,0),top:Math.min(j.top-o.top,0),right:Math.min(j.right-o.right,0),bottom:Math.min(j.bottom-o.bottom,0)};return{x:y-S.left+S.right,y:w-S.top+S.bottom,zoom:g}},po=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function As(e){return e!=null&&e!=="parent"}function Zr(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function L3(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function D3(e,t={width:0,height:0},n,a,s){const l={...e},o=a.get(n);if(o){const c=o.origin||s;l.x+=o.internals.positionAbsolute.x-(t.width??0)*c[0],l.y+=o.internals.positionAbsolute.y-(t.height??0)*c[1]}return l}function ek(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function KI(){let e,t;return{promise:new Promise((a,s)=>{e=a,t=s}),resolve:e,reject:t}}function WI(e){return{..._3,...e||{}}}function Jl(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:a,containerBounds:s}){const{x:l,y:o}=Zn(e),c=To({x:l-((s==null?void 0:s.left)??0),y:o-((s==null?void 0:s.top)??0)},a),{x:f,y:h}=n?Eo(c,t):c;return{xSnapped:f,ySnapped:h,...c}}const Db=e=>({width:e.offsetWidth,height:e.offsetHeight}),O3=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},QI=["INPUT","SELECT","TEXTAREA"];function z3(e){var a,s;const t=((s=(a=e.composedPath)==null?void 0:a.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:QI.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const q3=e=>"clientX"in e,Zn=(e,t)=>{var l,o;const n=q3(e),a=n?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,s=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:a-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},tk=(e,t,n,a,s)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(o=>{const c=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:s,position:o.getAttribute("data-handlepos"),x:(c.left-n.left)/a,y:(c.top-n.top)/a,...Db(o)}})};function I3({sourceX:e,sourceY:t,targetX:n,targetY:a,sourceControlX:s,sourceControlY:l,targetControlX:o,targetControlY:c}){const f=e*.125+s*.375+o*.375+n*.125,h=t*.125+l*.375+c*.375+a*.125,g=Math.abs(f-e),p=Math.abs(h-t);return[f,h,g,p]}function sc(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function nk({pos:e,x1:t,y1:n,x2:a,y2:s,c:l}){switch(e){case Ie.Left:return[t-sc(t-a,l),n];case Ie.Right:return[t+sc(a-t,l),n];case Ie.Top:return[t,n-sc(n-s,l)];case Ie.Bottom:return[t,n+sc(s-n,l)]}}function B3({sourceX:e,sourceY:t,sourcePosition:n=Ie.Bottom,targetX:a,targetY:s,targetPosition:l=Ie.Top,curvature:o=.25}){const[c,f]=nk({pos:n,x1:e,y1:t,x2:a,y2:s,c:o}),[h,g]=nk({pos:l,x1:a,y1:s,x2:e,y2:t,c:o}),[p,x,y,w]=I3({sourceX:e,sourceY:t,targetX:a,targetY:s,sourceControlX:c,sourceControlY:f,targetControlX:h,targetControlY:g});return[`M${e},${t} C${c},${f} ${h},${g} ${a},${s}`,p,x,y,w]}function H3({sourceX:e,sourceY:t,targetX:n,targetY:a}){const s=Math.abs(n-e)/2,l=n<e?n+s:n-s,o=Math.abs(a-t)/2,c=a<t?a+o:a-o;return[l,c,s,o]}function ZI({sourceNode:e,targetNode:t,selected:n=!1,zIndex:a=0,elevateOnSelect:s=!1,zIndexMode:l="basic"}){if(l==="manual")return a;const o=s&&n?a+1e3:a,c=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return o+c}function JI({sourceNode:e,targetNode:t,width:n,height:a,transform:s}){const l=Yc(Ac(e),Ac(t));l.x===l.x2&&(l.x2+=1),l.y===l.y2&&(l.y2+=1);const o={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:a/s[2]};return mo(o,Xc(l))>0}const e7=({source:e,sourceHandle:t,target:n,targetHandle:a})=>`xy-edge__${e}${t||""}-${n}${a||""}`,t7=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),n7=(e,t,n={})=>{if(!e.source||!e.target)return t;const a=n.getEdgeId||e7;let s;return E3(e)?s={...e}:s={...e,id:a(e)},t7(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function P3({sourceX:e,sourceY:t,targetX:n,targetY:a}){const[s,l,o,c]=H3({sourceX:e,sourceY:t,targetX:n,targetY:a});return[`M ${e},${t}L ${n},${a}`,s,l,o,c]}const rk={[Ie.Left]:{x:-1,y:0},[Ie.Right]:{x:1,y:0},[Ie.Top]:{x:0,y:-1},[Ie.Bottom]:{x:0,y:1}},r7=({source:e,sourcePosition:t=Ie.Bottom,target:n})=>t===Ie.Left||t===Ie.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},ak=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function a7({source:e,sourcePosition:t=Ie.Bottom,target:n,targetPosition:a=Ie.Top,center:s,offset:l,stepPosition:o}){const c=rk[t],f=rk[a],h={x:e.x+c.x*l,y:e.y+c.y*l},g={x:n.x+f.x*l,y:n.y+f.y*l},p=r7({source:h,sourcePosition:t,target:g}),x=p.x!==0?"x":"y",y=p[x];let w=[],j,S;const k={x:0,y:0},N={x:0,y:0},[,,_,E]=H3({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[x]*f[x]===-1){x==="x"?(j=s.x??h.x+(g.x-h.x)*o,S=s.y??(h.y+g.y)/2):(j=s.x??(h.x+g.x)/2,S=s.y??h.y+(g.y-h.y)*o);const B=[{x:j,y:h.y},{x:j,y:g.y}],P=[{x:h.x,y:S},{x:g.x,y:S}];c[x]===y?w=x==="x"?B:P:w=x==="x"?P:B}else{const B=[{x:h.x,y:g.y}],P=[{x:g.x,y:h.y}];if(x==="x"?w=c.x===y?P:B:w=c.y===y?B:P,t===a){const q=Math.abs(e[x]-n[x]);if(q<=l){const O=Math.min(l-1,l-q);c[x]===y?k[x]=(h[x]>e[x]?-1:1)*O:N[x]=(g[x]>n[x]?-1:1)*O}}if(t!==a){const q=x==="x"?"y":"x",O=c[x]===f[q],D=h[q]>g[q],X=h[q]<g[q];(c[x]===1&&(!O&&D||O&&X)||c[x]!==1&&(!O&&X||O&&D))&&(w=x==="x"?B:P)}const L={x:h.x+k.x,y:h.y+k.y},H={x:g.x+N.x,y:g.y+N.y},F=Math.max(Math.abs(L.x-w[0].x),Math.abs(H.x-w[0].x)),G=Math.max(Math.abs(L.y-w[0].y),Math.abs(H.y-w[0].y));F>=G?(j=(L.x+H.x)/2,S=w[0].y):(j=w[0].x,S=(L.y+H.y)/2)}const M={x:h.x+k.x,y:h.y+k.y},T={x:g.x+N.x,y:g.y+N.y};return[[e,...M.x!==w[0].x||M.y!==w[0].y?[M]:[],...w,...T.x!==w[w.length-1].x||T.y!==w[w.length-1].y?[T]:[],n],j,S,_,E]}function i7(e,t,n,a){const s=Math.min(ak(e,t)/2,ak(t,n)/2,a),{x:l,y:o}=t;if(e.x===l&&l===n.x||e.y===o&&o===n.y)return`L${l} ${o}`;if(e.y===o){const h=e.x<n.x?-1:1,g=e.y<n.y?1:-1;return`L ${l+s*h},${o}Q ${l},${o} ${l},${o+s*g}`}const c=e.x<n.x?1:-1,f=e.y<n.y?-1:1;return`L ${l},${o+s*f}Q ${l},${o} ${l+s*c},${o}`}function Wy({sourceX:e,sourceY:t,sourcePosition:n=Ie.Bottom,targetX:a,targetY:s,targetPosition:l=Ie.Top,borderRadius:o=5,centerX:c,centerY:f,offset:h=20,stepPosition:g=.5}){const[p,x,y,w,j]=a7({source:{x:e,y:t},sourcePosition:n,target:{x:a,y:s},targetPosition:l,center:{x:c,y:f},offset:h,stepPosition:g});let S=`M${p[0].x} ${p[0].y}`;for(let k=1;k<p.length-1;k++)S+=i7(p[k-1],p[k],p[k+1],o);return S+=`L${p[p.length-1].x} ${p[p.length-1].y}`,[S,x,y,w,j]}function ik(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function s7(e){var p;const{sourceNode:t,targetNode:n}=e;if(!ik(t)||!ik(n))return null;const a=t.internals.handleBounds||sk(t.handles),s=n.internals.handleBounds||sk(n.handles),l=lk((a==null?void 0:a.source)??[],e.sourceHandle),o=lk(e.connectionMode===Cs.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!l||!o)return(p=e.onError)==null||p.call(e,"008",gr.error008(l?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(l==null?void 0:l.position)||Ie.Bottom,f=(o==null?void 0:o.position)||Ie.Top,h=vi(t,l,c),g=vi(n,o,f);return{sourceX:h.x,sourceY:h.y,targetX:g.x,targetY:g.y,sourcePosition:c,targetPosition:f}}function sk(e){if(!e)return null;const t=[],n=[];for(const a of e)a.width=a.width??1,a.height=a.height??1,a.type==="source"?t.push(a):a.type==="target"&&n.push(a);return{source:t,target:n}}function vi(e,t,n=Ie.Left,a=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,l=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:c}=t??Zr(e);if(a)return{x:s+o/2,y:l+c/2};switch((t==null?void 0:t.position)??n){case Ie.Top:return{x:s+o/2,y:l};case Ie.Right:return{x:s+o,y:l+c/2};case Ie.Bottom:return{x:s+o/2,y:l+c};case Ie.Left:return{x:s,y:l+c/2}}}function lk(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Qy(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(a=>`${a}=${e[a]}`).join("&")}`:""}function l7(e,{id:t,defaultColor:n,defaultMarkerStart:a,defaultMarkerEnd:s}){const l=new Set;return e.reduce((o,c)=>([c.markerStart||a,c.markerEnd||s].forEach(f=>{if(f&&typeof f=="object"){const h=Qy(f,t);l.has(h)||(o.push({id:h,color:f.color||n,...f}),l.add(h))}}),o),[]).sort((o,c)=>o.id.localeCompare(c.id))}const F3=1e3,o7=10,Ob={nodeOrigin:[0,0],nodeExtent:co,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},u7={...Ob,checkEquality:!0};function zb(e,t){const n={...e};for(const a in t)t[a]!==void 0&&(n[a]=t[a]);return n}function c7(e,t,n){const a=zb(Ob,n);for(const s of e.values())if(s.parentId)Ib(s,e,t,a);else{const l=No(s,a.nodeOrigin),o=As(s.extent)?s.extent:a.nodeExtent,c=bi(l,o,Zr(s));s.internals.positionAbsolute=c}}function d7(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],a=[];for(const s of e.handles){const l={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(l):s.type==="target"&&a.push(l)}return{source:n,target:a}}function qb(e){return e==="manual"}function Zy(e,t,n,a={}){var g,p;const s=zb(u7,a),l={i:0},o=new Map(t),c=s!=null&&s.elevateNodesOnSelect&&!qb(s.zIndexMode)?F3:0;let f=e.length>0,h=!1;t.clear(),n.clear();for(const x of e){let y=o.get(x.id);if(s.checkEquality&&x===(y==null?void 0:y.internals.userNode))t.set(x.id,y);else{const w=No(x,s.nodeOrigin),j=As(x.extent)?x.extent:s.nodeExtent,S=bi(w,j,Zr(x));y={...s.defaults,...x,measured:{width:(g=x.measured)==null?void 0:g.width,height:(p=x.measured)==null?void 0:p.height},internals:{positionAbsolute:S,handleBounds:d7(x,y),z:U3(x,c,s.zIndexMode),userNode:x}},t.set(x.id,y)}(y.measured===void 0||y.measured.width===void 0||y.measured.height===void 0)&&!y.hidden&&(f=!1),x.parentId&&Ib(y,t,n,a,l),h||(h=x.selected??!1)}return{nodesInitialized:f,hasSelectedNodes:h}}function f7(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Ib(e,t,n,a,s){const{elevateNodesOnSelect:l,nodeOrigin:o,nodeExtent:c,zIndexMode:f}=zb(Ob,a),h=e.parentId,g=t.get(h);if(!g){console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}f7(e,n),s&&!g.parentId&&g.internals.rootParentIndex===void 0&&f==="auto"&&(g.internals.rootParentIndex=++s.i,g.internals.z=g.internals.z+s.i*o7),s&&g.internals.rootParentIndex!==void 0&&(s.i=g.internals.rootParentIndex);const p=l&&!qb(f)?F3:0,{x,y,z:w}=h7(e,g,o,c,p,f),{positionAbsolute:j}=e.internals,S=x!==j.x||y!==j.y;(S||w!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x,y}:j,z:w}})}function U3(e,t,n){const a=Qn(e.zIndex)?e.zIndex:0;return qb(n)?a:a+(e.selected?t:0)}function h7(e,t,n,a,s,l){const{x:o,y:c}=t.internals.positionAbsolute,f=Zr(e),h=No(e,n),g=As(e.extent)?bi(h,e.extent,f):h;let p=bi({x:o+g.x,y:c+g.y},a,f);e.extent==="parent"&&(p=A3(p,f,t));const x=U3(e,s,l),y=t.internals.z??0;return{x:p.x,y:p.y,z:y>=x?y+1:x}}function Bb(e,t,n,a=[0,0]){var o;const s=[],l=new Map;for(const c of e){const f=t.get(c.parentId);if(!f)continue;const h=((o=l.get(c.parentId))==null?void 0:o.expandedRect)??Ts(f),g=R3(h,c.rect);l.set(c.parentId,{expandedRect:g,parent:f})}return l.size>0&&l.forEach(({expandedRect:c,parent:f},h)=>{var _;const g=f.internals.positionAbsolute,p=Zr(f),x=f.origin??a,y=c.x<g.x?Math.round(Math.abs(g.x-c.x)):0,w=c.y<g.y?Math.round(Math.abs(g.y-c.y)):0,j=Math.max(p.width,Math.round(c.width)),S=Math.max(p.height,Math.round(c.height)),k=(j-p.width)*x[0],N=(S-p.height)*x[1];(y>0||w>0||k||N)&&(s.push({id:h,type:"position",position:{x:f.position.x-y+k,y:f.position.y-w+N}}),(_=n.get(h))==null||_.forEach(E=>{e.some(M=>M.id===E.id)||s.push({id:E.id,type:"position",position:{x:E.position.x+y,y:E.position.y+w}})})),(p.width<c.width||p.height<c.height||y||w)&&s.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:j+(y?x[0]*y-k:0),height:S+(w?x[1]*w-N:0)}})}),s}function m7(e,t,n,a,s,l,o){const c=a==null?void 0:a.querySelector(".xyflow__viewport");let f=!1;if(!c)return{changes:[],updatedInternals:f};const h=[],g=window.getComputedStyle(c),{m22:p}=new window.DOMMatrixReadOnly(g.transform),x=[];for(const y of e.values()){const w=t.get(y.id);if(!w)continue;if(w.hidden){t.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),f=!0;continue}const j=Db(y.nodeElement),S=w.measured.width!==j.width||w.measured.height!==j.height;if(!!(j.width&&j.height&&(S||!w.internals.handleBounds||y.force))){const N=y.nodeElement.getBoundingClientRect(),_=As(w.extent)?w.extent:l;let{positionAbsolute:E}=w.internals;w.parentId&&w.extent==="parent"?E=A3(E,j,t.get(w.parentId)):_&&(E=bi(E,_,j));const M={...w,measured:j,internals:{...w.internals,positionAbsolute:E,handleBounds:{source:tk("source",y.nodeElement,N,p,w.id),target:tk("target",y.nodeElement,N,p,w.id)}}};t.set(w.id,M),w.parentId&&Ib(M,t,n,{nodeOrigin:s,zIndexMode:o}),f=!0,S&&(h.push({id:w.id,type:"dimensions",dimensions:j}),w.expandParent&&w.parentId&&x.push({id:w.id,parentId:w.parentId,rect:Ts(M,s)}))}}if(x.length>0){const y=Bb(x,t,n,s);h.push(...y)}return{changes:h,updatedInternals:f}}async function p7({delta:e,panZoom:t,transform:n,translateExtent:a,width:s,height:l}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,l]],a),c=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(c)}function ok(e,t,n,a,s,l){let o=s;const c=a.get(o)||new Map;a.set(o,c.set(n,t)),o=`${s}-${e}`;const f=a.get(o)||new Map;if(a.set(o,f.set(n,t)),l){o=`${s}-${e}-${l}`;const h=a.get(o)||new Map;a.set(o,h.set(n,t))}}function $3(e,t,n){e.clear(),t.clear();for(const a of n){const{source:s,target:l,sourceHandle:o=null,targetHandle:c=null}=a,f={edgeId:a.id,source:s,target:l,sourceHandle:o,targetHandle:c},h=`${s}-${o}--${l}-${c}`,g=`${l}-${c}--${s}-${o}`;ok("source",f,g,e,s,o),ok("target",f,h,e,l,c),t.set(a.id,a)}}function G3(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:G3(n,t):!1}function uk(e,t,n){var s;let a=e;do{if((s=a==null?void 0:a.matches)!=null&&s.call(a,t))return!0;if(a===n)return!1;a=a==null?void 0:a.parentElement}while(a);return!1}function g7(e,t,n,a){const s=new Map;for(const[l,o]of e)if((o.selected||o.id===a)&&(!o.parentId||!G3(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const c=e.get(l);c&&s.set(l,{id:l,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return s}function Vh({nodeId:e,dragItems:t,nodeLookup:n,dragging:a=!0}){var o,c,f;const s=[];for(const[h,g]of t){const p=(o=n.get(h))==null?void 0:o.internals.userNode;p&&s.push({...p,position:g.position,dragging:a})}if(!e)return[s[0],s];const l=(c=n.get(e))==null?void 0:c.internals.userNode;return[l?{...l,position:((f=t.get(e))==null?void 0:f.position)||l.position,dragging:a}:s[0],s]}function x7({dragItems:e,snapGrid:t,x:n,y:a}){const s=e.values().next().value;if(!s)return null;const l={x:n-s.distance.x,y:a-s.distance.y},o=Eo(l,t);return{x:o.x-l.x,y:o.y-l.y}}function y7({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:a,onDragStop:s}){let l={x:null,y:null},o=0,c=new Map,f=!1,h={x:0,y:0},g=null,p=!1,x=null,y=!1,w=!1,j=null;function S({noDragClassName:N,handleSelector:_,domNode:E,isSelectable:M,nodeId:T,nodeClickDistance:R=0}){x=Cn(E);function B({x:F,y:G}){const{nodeLookup:q,nodeExtent:O,snapGrid:D,snapToGrid:X,nodeOrigin:K,onNodeDrag:Z,onSelectionDrag:z,onError:$,updateNodePositions:Q}=t();l={x:F,y:G};let I=!1;const V=c.size>1,te=V&&O?Ky(Co(c)):null,ne=V&&X?x7({dragItems:c,snapGrid:D,x:F,y:G}):null;for(const[W,Y]of c){if(!q.has(W))continue;let ae={x:F-Y.distance.x,y:G-Y.distance.y};X&&(ae=ne?{x:Math.round(ae.x+ne.x),y:Math.round(ae.y+ne.y)}:Eo(ae,D));let he=null;if(V&&O&&!Y.extent&&te){const{positionAbsolute:oe}=Y.internals,je=oe.x-te.x+O[0][0],Se=oe.x+Y.measured.width-te.x2+O[1][0],Ae=oe.y-te.y+O[0][1],se=oe.y+Y.measured.height-te.y2+O[1][1];he=[[je,Ae],[Se,se]]}const{position:ke,positionAbsolute:_e}=T3({nodeId:W,nextPosition:ae,nodeLookup:q,nodeExtent:he||O,nodeOrigin:K,onError:$});I=I||Y.position.x!==ke.x||Y.position.y!==ke.y,Y.position=ke,Y.internals.positionAbsolute=_e}if(w=w||I,!!I&&(Q(c,!0),j&&(a||Z||!T&&z))){const[W,Y]=Vh({nodeId:T,dragItems:c,nodeLookup:q});a==null||a(j,c,W,Y),Z==null||Z(j,W,Y),T||z==null||z(j,Y)}}async function P(){if(!g)return;const{transform:F,panBy:G,autoPanSpeed:q,autoPanOnNodeDrag:O}=t();if(!O){f=!1,cancelAnimationFrame(o);return}const[D,X]=M3(h,g,q);(D!==0||X!==0)&&(l.x=(l.x??0)-D/F[2],l.y=(l.y??0)-X/F[2],await G({x:D,y:X})&&B(l)),o=requestAnimationFrame(P)}function L(F){var V;const{nodeLookup:G,multiSelectionActive:q,nodesDraggable:O,transform:D,snapGrid:X,snapToGrid:K,selectNodesOnDrag:Z,onNodeDragStart:z,onSelectionDragStart:$,unselectNodesAndEdges:Q}=t();p=!0,(!Z||!M)&&!q&&T&&((V=G.get(T))!=null&&V.selected||Q()),M&&Z&&T&&(e==null||e(T));const I=Jl(F.sourceEvent,{transform:D,snapGrid:X,snapToGrid:K,containerBounds:g});if(l=I,c=g7(G,O,I,T),c.size>0&&(n||z||!T&&$)){const[te,ne]=Vh({nodeId:T,dragItems:c,nodeLookup:G});n==null||n(F.sourceEvent,c,te,ne),z==null||z(F.sourceEvent,te,ne),T||$==null||$(F.sourceEvent,ne)}}const H=o3().clickDistance(R).on("start",F=>{const{domNode:G,nodeDragThreshold:q,transform:O,snapGrid:D,snapToGrid:X}=t();g=(G==null?void 0:G.getBoundingClientRect())||null,y=!1,w=!1,j=F.sourceEvent,q===0&&L(F),l=Jl(F.sourceEvent,{transform:O,snapGrid:D,snapToGrid:X,containerBounds:g}),h=Zn(F.sourceEvent,g)}).on("drag",F=>{const{autoPanOnNodeDrag:G,transform:q,snapGrid:O,snapToGrid:D,nodeDragThreshold:X,nodeLookup:K}=t(),Z=Jl(F.sourceEvent,{transform:q,snapGrid:O,snapToGrid:D,containerBounds:g});if(j=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||T&&!K.has(T))&&(y=!0),!y){if(!f&&G&&p&&(f=!0,P()),!p){const z=Zn(F.sourceEvent,g),$=z.x-h.x,Q=z.y-h.y;Math.sqrt($*$+Q*Q)>X&&L(F)}(l.x!==Z.xSnapped||l.y!==Z.ySnapped)&&c&&p&&(h=Zn(F.sourceEvent,g),B(Z))}}).on("end",F=>{if(!(!p||y)&&(f=!1,p=!1,cancelAnimationFrame(o),c.size>0)){const{nodeLookup:G,updateNodePositions:q,onNodeDragStop:O,onSelectionDragStop:D}=t();if(w&&(q(c,!1),w=!1),s||O||!T&&D){const[X,K]=Vh({nodeId:T,dragItems:c,nodeLookup:G,dragging:!1});s==null||s(F.sourceEvent,c,X,K),O==null||O(F.sourceEvent,X,K),T||D==null||D(F.sourceEvent,K)}}}).filter(F=>{const G=F.target;return!F.button&&(!N||!uk(G,`.${N}`,E))&&(!_||uk(G,_,E))});x.call(H)}function k(){x==null||x.on(".drag",null)}return{update:S,destroy:k}}function b7(e,t,n){const a=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())mo(s,Ts(l))>0&&a.push(l);return a}const v7=250;function w7(e,t,n,a){var c,f;let s=[],l=1/0;const o=b7(e,n,t+v7);for(const h of o){const g=[...((c=h.internals.handleBounds)==null?void 0:c.source)??[],...((f=h.internals.handleBounds)==null?void 0:f.target)??[]];for(const p of g){if(a.nodeId===p.nodeId&&a.type===p.type&&a.id===p.id)continue;const{x,y}=vi(h,p,p.position,!0),w=Math.sqrt(Math.pow(x-e.x,2)+Math.pow(y-e.y,2));w>t||(w<l?(s=[{...p,x,y}],l=w):w===l&&s.push({...p,x,y}))}}if(!s.length)return null;if(s.length>1){const h=a.type==="source"?"target":"source";return s.find(g=>g.type===h)??s[0]}return s[0]}function V3(e,t,n,a,s,l=!1){var h,g,p;const o=a.get(e);if(!o)return null;const c=s==="strict"?(h=o.internals.handleBounds)==null?void 0:h[t]:[...((g=o.internals.handleBounds)==null?void 0:g.source)??[],...((p=o.internals.handleBounds)==null?void 0:p.target)??[]],f=(n?c==null?void 0:c.find(x=>x.id===n):c==null?void 0:c[0])??null;return f&&l?{...f,...vi(o,f,f.position,!0)}:f}function Y3(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function j7(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const X3=()=>!0;function k7(e,{connectionMode:t,connectionRadius:n,handleId:a,nodeId:s,edgeUpdaterType:l,isTarget:o,domNode:c,nodeLookup:f,lib:h,autoPanOnConnect:g,flowId:p,panBy:x,cancelConnection:y,onConnectStart:w,onConnect:j,onConnectEnd:S,isValidConnection:k=X3,onReconnectEnd:N,updateConnection:_,getTransform:E,getFromHandle:M,autoPanSpeed:T,dragThreshold:R=1,handleDomNode:B}){const P=O3(e.target);let L=0,H;const{x:F,y:G}=Zn(e),q=Y3(l,B),O=c==null?void 0:c.getBoundingClientRect();let D=!1;if(!O||!q)return;const X=V3(s,q,a,f,t);if(!X)return;let K=Zn(e,O),Z=!1,z=null,$=!1,Q=null;function I(){if(!g||!O)return;const[ke,_e]=M3(K,O,T);x({x:ke,y:_e}),L=requestAnimationFrame(I)}const V={...X,nodeId:s,type:q,position:X.position},te=f.get(s);let W={inProgress:!0,isValid:null,from:vi(te,V,Ie.Left,!0),fromHandle:V,fromPosition:V.position,fromNode:te,to:K,toHandle:null,toPosition:Qj[V.position],toNode:null,pointer:K};function Y(){D=!0,_(W),w==null||w(e,{nodeId:s,handleId:a,handleType:q})}R===0&&Y();function ae(ke){if(!D){const{x:se,y:Ee}=Zn(ke),Te=se-F,Me=Ee-G;if(!(Te*Te+Me*Me>R*R))return;Y()}if(!M()||!V){he(ke);return}const _e=E();K=Zn(ke,O),H=w7(To(K,_e,!1,[1,1]),n,f,V),Z||(I(),Z=!0);const oe=K3(ke,{handle:H,connectionMode:t,fromNodeId:s,fromHandleId:a,fromType:o?"target":"source",isValidConnection:k,doc:P,lib:h,flowId:p,nodeLookup:f});Q=oe.handleDomNode,z=oe.connection,$=j7(!!H,oe.isValid);const je=f.get(s),Se=je?vi(je,V,Ie.Left,!0):W.from,Ae={...W,from:Se,isValid:$,to:oe.toHandle&&$?Mc({x:oe.toHandle.x,y:oe.toHandle.y},_e):K,toHandle:oe.toHandle,toPosition:$&&oe.toHandle?oe.toHandle.position:Qj[V.position],toNode:oe.toHandle?f.get(oe.toHandle.nodeId):null,pointer:K};_(Ae),W=Ae}function he(ke){if(!("touches"in ke&&ke.touches.length>0)){if(D){(H||Q)&&z&&$&&(j==null||j(z));const{inProgress:_e,...oe}=W,je={...oe,toPosition:W.toHandle?W.toPosition:null};S==null||S(ke,je),l&&(N==null||N(ke,je))}y(),cancelAnimationFrame(L),Z=!1,$=!1,z=null,Q=null,P.removeEventListener("mousemove",ae),P.removeEventListener("mouseup",he),P.removeEventListener("touchmove",ae),P.removeEventListener("touchend",he)}}P.addEventListener("mousemove",ae),P.addEventListener("mouseup",he),P.addEventListener("touchmove",ae),P.addEventListener("touchend",he)}function K3(e,{handle:t,connectionMode:n,fromNodeId:a,fromHandleId:s,fromType:l,doc:o,lib:c,flowId:f,isValidConnection:h=X3,nodeLookup:g}){const p=l==="target",x=t?o.querySelector(`.${c}-flow__handle[data-id="${f}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:y,y:w}=Zn(e),j=o.elementFromPoint(y,w),S=j!=null&&j.classList.contains(`${c}-flow__handle`)?j:x,k={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const N=Y3(void 0,S),_=S.getAttribute("data-nodeid"),E=S.getAttribute("data-handleid"),M=S.classList.contains("connectable"),T=S.classList.contains("connectableend");if(!_||!N)return k;const R={source:p?_:a,sourceHandle:p?E:s,target:p?a:_,targetHandle:p?s:E};k.connection=R;const P=M&&T&&(n===Cs.Strict?p&&N==="source"||!p&&N==="target":_!==a||E!==s);k.isValid=P&&h(R),k.toHandle=V3(_,N,E,g,n,!0)}return k}const Jy={onPointerDown:k7,isValid:K3};function S7({domNode:e,panZoom:t,getTransform:n,getViewScale:a}){const s=Cn(e);function l({translateExtent:c,width:f,height:h,zoomStep:g=1,pannable:p=!0,zoomable:x=!0,inversePan:y=!1}){const w=_=>{if(_.sourceEvent.type!=="wheel"||!t)return;const E=n(),M=_.sourceEvent.ctrlKey&&po()?10:1,T=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*g,R=E[2]*Math.pow(2,T*M);t.scaleTo(R)};let j=[0,0];const S=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(j=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},k=_=>{const E=n();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!t)return;const M=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],T=[M[0]-j[0],M[1]-j[1]];j=M;const R=a()*Math.max(E[2],Math.log(E[2]))*(y?-1:1),B={x:E[0]-T[0]*R,y:E[1]-T[1]*R},P=[[0,0],[f,h]];t.setViewportConstrained({x:B.x,y:B.y,zoom:E[2]},P,c)},N=k3().on("start",S).on("zoom",p?k:null).on("zoom.wheel",x?w:null);s.call(N,{})}function o(){s.on("zoom",null)}return{update:l,destroy:o,pointer:Kn}}const Kc=e=>({x:e.x,y:e.y,zoom:e.k}),Yh=({x:e,y:t,zoom:n})=>Vc.translate(e,t).scale(n),bs=(e,t)=>e.target.closest(`.${t}`),W3=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),_7=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Xh=(e,t=0,n=_7,a=()=>{})=>{const s=typeof t=="number"&&t>0;return s||a(),s?e.transition().duration(t).ease(n).on("end",a):e},Q3=e=>{const t=e.ctrlKey&&po()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function N7({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:a,panOnScrollMode:s,panOnScrollSpeed:l,zoomOnPinch:o,onPanZoomStart:c,onPanZoom:f,onPanZoomEnd:h}){return g=>{if(bs(g,t))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(g.ctrlKey&&o){const S=Kn(g),k=Q3(g),N=p*Math.pow(2,k);a.scaleTo(n,N,S,g);return}const x=g.deltaMode===1?20:1;let y=s===gi.Vertical?0:g.deltaX*x,w=s===gi.Horizontal?0:g.deltaY*x;!po()&&g.shiftKey&&s!==gi.Vertical&&(y=g.deltaY*x,w=0),a.translateBy(n,-(y/p)*l,-(w/p)*l,{internal:!0});const j=Kc(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(f==null||f(g,j),e.panScrollTimeout=setTimeout(()=>{h==null||h(g,j),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(g,j))}}function C7({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(a,s){const l=a.type==="wheel",o=!t&&l&&!a.ctrlKey,c=bs(a,e);if(a.ctrlKey&&l&&c&&a.preventDefault(),o||c)return null;a.preventDefault(),n.call(this,a,s)}}function E7({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return a=>{var l,o,c;if((l=a.sourceEvent)!=null&&l.internal)return;const s=Kc(a.transform);e.mouseButton=((o=a.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((c=a.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(a.sourceEvent,s))}}function T7({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:a,onPanZoom:s}){return l=>{var o,c;e.usedRightMouseButton=!!(n&&W3(t,e.mouseButton??0)),(o=l.sourceEvent)!=null&&o.sync||a([l.transform.x,l.transform.y,l.transform.k]),s&&!((c=l.sourceEvent)!=null&&c.internal)&&(s==null||s(l.sourceEvent,Kc(l.transform)))}}function A7({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:a,onPanZoomEnd:s,onPaneContextMenu:l}){return o=>{var c;if(!((c=o.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,l&&W3(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&l(o.sourceEvent),e.usedRightMouseButton=!1,a(!1),s)){const f=Kc(o.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(o.sourceEvent,f)},n?150:0)}}}function M7({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:a,panOnScroll:s,zoomOnDoubleClick:l,userSelectionActive:o,noWheelClassName:c,noPanClassName:f,lib:h,connectionInProgress:g}){return p=>{var S;const x=e||t,y=n&&p.ctrlKey,w=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(bs(p,`${h}-flow__node`)||bs(p,`${h}-flow__edge`)))return!0;if(!a&&!x&&!s&&!l&&!n||o||g&&!w||bs(p,c)&&w||bs(p,f)&&(!w||s&&w&&!e)||!n&&p.ctrlKey&&w)return!1;if(!n&&p.type==="touchstart"&&((S=p.touches)==null?void 0:S.length)>1)return p.preventDefault(),!1;if(!x&&!s&&!y&&w||!a&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(a)&&!a.includes(p.button)&&p.type==="mousedown")return!1;const j=Array.isArray(a)&&a.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||w)&&j}}function R7({domNode:e,minZoom:t,maxZoom:n,translateExtent:a,viewport:s,onPanZoom:l,onPanZoomStart:o,onPanZoomEnd:c,onDraggingChange:f}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),p=k3().scaleExtent([t,n]).translateExtent(a),x=Cn(e).call(p);N({x:s.x,y:s.y,zoom:Es(s.zoom,t,n)},[[0,0],[g.width,g.height]],a);const y=x.on("wheel.zoom"),w=x.on("dblclick.zoom");p.wheelDelta(Q3);function j(H,F){return x?new Promise(G=>{p==null||p.interpolate((F==null?void 0:F.interpolate)==="linear"?Zl:xc).transform(Xh(x,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>G(!0)),H)}):Promise.resolve(!1)}function S({noWheelClassName:H,noPanClassName:F,onPaneContextMenu:G,userSelectionActive:q,panOnScroll:O,panOnDrag:D,panOnScrollMode:X,panOnScrollSpeed:K,preventScrolling:Z,zoomOnPinch:z,zoomOnScroll:$,zoomOnDoubleClick:Q,zoomActivationKeyPressed:I,lib:V,onTransformChange:te,connectionInProgress:ne,paneClickDistance:W,selectionOnDrag:Y}){q&&!h.isZoomingOrPanning&&k();const ae=O&&!I&&!q;p.clickDistance(Y?1/0:!Qn(W)||W<0?0:W);const he=ae?N7({zoomPanValues:h,noWheelClassName:H,d3Selection:x,d3Zoom:p,panOnScrollMode:X,panOnScrollSpeed:K,zoomOnPinch:z,onPanZoomStart:o,onPanZoom:l,onPanZoomEnd:c}):C7({noWheelClassName:H,preventScrolling:Z,d3ZoomHandler:y});if(x.on("wheel.zoom",he,{passive:!1}),!q){const _e=E7({zoomPanValues:h,onDraggingChange:f,onPanZoomStart:o});p.on("start",_e);const oe=T7({zoomPanValues:h,panOnDrag:D,onPaneContextMenu:!!G,onPanZoom:l,onTransformChange:te});p.on("zoom",oe);const je=A7({zoomPanValues:h,panOnDrag:D,panOnScroll:O,onPaneContextMenu:G,onPanZoomEnd:c,onDraggingChange:f});p.on("end",je)}const ke=M7({zoomActivationKeyPressed:I,panOnDrag:D,zoomOnScroll:$,panOnScroll:O,zoomOnDoubleClick:Q,zoomOnPinch:z,userSelectionActive:q,noPanClassName:F,noWheelClassName:H,lib:V,connectionInProgress:ne});p.filter(ke),Q?x.on("dblclick.zoom",w):x.on("dblclick.zoom",null)}function k(){p.on("zoom",null)}async function N(H,F,G){const q=Yh(H),O=p==null?void 0:p.constrain()(q,F,G);return O&&await j(O),new Promise(D=>D(O))}async function _(H,F){const G=Yh(H);return await j(G,F),new Promise(q=>q(G))}function E(H){if(x){const F=Yh(H),G=x.property("__zoom");(G.k!==H.zoom||G.x!==H.x||G.y!==H.y)&&(p==null||p.transform(x,F,null,{sync:!0}))}}function M(){const H=x?j3(x.node()):{x:0,y:0,k:1};return{x:H.x,y:H.y,zoom:H.k}}function T(H,F){return x?new Promise(G=>{p==null||p.interpolate((F==null?void 0:F.interpolate)==="linear"?Zl:xc).scaleTo(Xh(x,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>G(!0)),H)}):Promise.resolve(!1)}function R(H,F){return x?new Promise(G=>{p==null||p.interpolate((F==null?void 0:F.interpolate)==="linear"?Zl:xc).scaleBy(Xh(x,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>G(!0)),H)}):Promise.resolve(!1)}function B(H){p==null||p.scaleExtent(H)}function P(H){p==null||p.translateExtent(H)}function L(H){const F=!Qn(H)||H<0?0:H;p==null||p.clickDistance(F)}return{update:S,destroy:k,setViewport:_,setViewportConstrained:N,getViewport:M,scaleTo:T,scaleBy:R,setScaleExtent:B,setTranslateExtent:P,syncViewport:E,setClickDistance:L}}var Ms;(function(e){e.Line="line",e.Handle="handle"})(Ms||(Ms={}));function L7({width:e,prevWidth:t,height:n,prevHeight:a,affectsX:s,affectsY:l}){const o=e-t,c=n-a,f=[o>0?1:o<0?-1:0,c>0?1:c<0?-1:0];return o&&s&&(f[0]=f[0]*-1),c&&l&&(f[1]=f[1]*-1),f}function ck(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),a=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:a,affectsY:s}}function Ma(e,t){return Math.max(0,t-e)}function Ra(e,t){return Math.max(0,e-t)}function lc(e,t,n){return Math.max(0,t-e,e-n)}function dk(e,t){return e?!t:t}function D7(e,t,n,a,s,l,o,c){let{affectsX:f,affectsY:h}=t;const{isHorizontal:g,isVertical:p}=t,x=g&&p,{xSnapped:y,ySnapped:w}=n,{minWidth:j,maxWidth:S,minHeight:k,maxHeight:N}=a,{x:_,y:E,width:M,height:T,aspectRatio:R}=e;let B=Math.floor(g?y-e.pointerX:0),P=Math.floor(p?w-e.pointerY:0);const L=M+(f?-B:B),H=T+(h?-P:P),F=-l[0]*M,G=-l[1]*T;let q=lc(L,j,S),O=lc(H,k,N);if(o){let K=0,Z=0;f&&B<0?K=Ma(_+B+F,o[0][0]):!f&&B>0&&(K=Ra(_+L+F,o[1][0])),h&&P<0?Z=Ma(E+P+G,o[0][1]):!h&&P>0&&(Z=Ra(E+H+G,o[1][1])),q=Math.max(q,K),O=Math.max(O,Z)}if(c){let K=0,Z=0;f&&B>0?K=Ra(_+B,c[0][0]):!f&&B<0&&(K=Ma(_+L,c[1][0])),h&&P>0?Z=Ra(E+P,c[0][1]):!h&&P<0&&(Z=Ma(E+H,c[1][1])),q=Math.max(q,K),O=Math.max(O,Z)}if(s){if(g){const K=lc(L/R,k,N)*R;if(q=Math.max(q,K),o){let Z=0;!f&&!h||f&&!h&&x?Z=Ra(E+G+L/R,o[1][1])*R:Z=Ma(E+G+(f?B:-B)/R,o[0][1])*R,q=Math.max(q,Z)}if(c){let Z=0;!f&&!h||f&&!h&&x?Z=Ma(E+L/R,c[1][1])*R:Z=Ra(E+(f?B:-B)/R,c[0][1])*R,q=Math.max(q,Z)}}if(p){const K=lc(H*R,j,S)/R;if(O=Math.max(O,K),o){let Z=0;!f&&!h||h&&!f&&x?Z=Ra(_+H*R+F,o[1][0])/R:Z=Ma(_+(h?P:-P)*R+F,o[0][0])/R,O=Math.max(O,Z)}if(c){let Z=0;!f&&!h||h&&!f&&x?Z=Ma(_+H*R,c[1][0])/R:Z=Ra(_+(h?P:-P)*R,c[0][0])/R,O=Math.max(O,Z)}}}P=P+(P<0?O:-O),B=B+(B<0?q:-q),s&&(x?L>H*R?P=(dk(f,h)?-B:B)/R:B=(dk(f,h)?-P:P)*R:g?(P=B/R,h=f):(B=P*R,f=h));const D=f?_+B:_,X=h?E+P:E;return{width:M+(f?-B:B),height:T+(h?-P:P),x:l[0]*B*(f?-1:1)+D,y:l[1]*P*(h?-1:1)+X}}const Z3={width:0,height:0,x:0,y:0},O7={...Z3,pointerX:0,pointerY:0,aspectRatio:1};function z7(e){return[[0,0],[e.measured.width,e.measured.height]]}function q7(e,t,n){const a=t.position.x+e.position.x,s=t.position.y+e.position.y,l=e.measured.width??0,o=e.measured.height??0,c=n[0]*l,f=n[1]*o;return[[a-c,s-f],[a+l-c,s+o-f]]}function I7({domNode:e,nodeId:t,getStoreItems:n,onChange:a,onEnd:s}){const l=Cn(e);let o={controlDirection:ck("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:h,boundaries:g,keepAspectRatio:p,resizeDirection:x,onResizeStart:y,onResize:w,onResizeEnd:j,shouldResize:S}){let k={...Z3},N={...O7};o={boundaries:g,resizeDirection:x,keepAspectRatio:p,controlDirection:ck(h)};let _,E=null,M=[],T,R,B,P=!1;const L=o3().on("start",H=>{const{nodeLookup:F,transform:G,snapGrid:q,snapToGrid:O,nodeOrigin:D,paneDomNode:X}=n();if(_=F.get(t),!_)return;E=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:K,ySnapped:Z}=Jl(H.sourceEvent,{transform:G,snapGrid:q,snapToGrid:O,containerBounds:E});k={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},N={...k,pointerX:K,pointerY:Z,aspectRatio:k.width/k.height},T=void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(T=F.get(_.parentId),R=T&&_.extent==="parent"?z7(T):void 0),M=[],B=void 0;for(const[z,$]of F)if($.parentId===t&&(M.push({id:z,position:{...$.position},extent:$.extent}),$.extent==="parent"||$.expandParent)){const Q=q7($,_,$.origin??D);B?B=[[Math.min(Q[0][0],B[0][0]),Math.min(Q[0][1],B[0][1])],[Math.max(Q[1][0],B[1][0]),Math.max(Q[1][1],B[1][1])]]:B=Q}y==null||y(H,{...k})}).on("drag",H=>{const{transform:F,snapGrid:G,snapToGrid:q,nodeOrigin:O}=n(),D=Jl(H.sourceEvent,{transform:F,snapGrid:G,snapToGrid:q,containerBounds:E}),X=[];if(!_)return;const{x:K,y:Z,width:z,height:$}=k,Q={},I=_.origin??O,{width:V,height:te,x:ne,y:W}=D7(N,o.controlDirection,D,o.boundaries,o.keepAspectRatio,I,R,B),Y=V!==z,ae=te!==$,he=ne!==K&&Y,ke=W!==Z&&ae;if(!he&&!ke&&!Y&&!ae)return;if((he||ke||I[0]===1||I[1]===1)&&(Q.x=he?ne:k.x,Q.y=ke?W:k.y,k.x=Q.x,k.y=Q.y,M.length>0)){const Se=ne-K,Ae=W-Z;for(const se of M)se.position={x:se.position.x-Se+I[0]*(V-z),y:se.position.y-Ae+I[1]*(te-$)},X.push(se)}if((Y||ae)&&(Q.width=Y&&(!o.resizeDirection||o.resizeDirection==="horizontal")?V:k.width,Q.height=ae&&(!o.resizeDirection||o.resizeDirection==="vertical")?te:k.height,k.width=Q.width,k.height=Q.height),T&&_.expandParent){const Se=I[0]*(Q.width??0);Q.x&&Q.x<Se&&(k.x=Se,N.x=N.x-(Q.x-Se));const Ae=I[1]*(Q.height??0);Q.y&&Q.y<Ae&&(k.y=Ae,N.y=N.y-(Q.y-Ae))}const _e=L7({width:k.width,prevWidth:z,height:k.height,prevHeight:$,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),oe={...k,direction:_e};(S==null?void 0:S(H,oe))!==!1&&(P=!0,w==null||w(H,oe),a(Q,X))}).on("end",H=>{P&&(j==null||j(H,{...k}),s==null||s({...k}),P=!1)});l.call(L)}function f(){l.on(".drag",null)}return{update:c,destroy:f}}var Kh={exports:{}},Wh={},Qh={exports:{}},Zh={};/**
68
+ * @license React
69
+ * use-sync-external-store-shim.production.js
70
+ *
71
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
72
+ *
73
+ * This source code is licensed under the MIT license found in the
74
+ * LICENSE file in the root directory of this source tree.
75
+ */var fk;function B7(){if(fk)return Zh;fk=1;var e=bo();function t(p,x){return p===x&&(p!==0||1/p===1/x)||p!==p&&x!==x}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,s=e.useEffect,l=e.useLayoutEffect,o=e.useDebugValue;function c(p,x){var y=x(),w=a({inst:{value:y,getSnapshot:x}}),j=w[0].inst,S=w[1];return l(function(){j.value=y,j.getSnapshot=x,f(j)&&S({inst:j})},[p,y,x]),s(function(){return f(j)&&S({inst:j}),p(function(){f(j)&&S({inst:j})})},[p]),o(y),y}function f(p){var x=p.getSnapshot;p=p.value;try{var y=x();return!n(p,y)}catch{return!0}}function h(p,x){return x()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:c;return Zh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Zh}var hk;function H7(){return hk||(hk=1,Qh.exports=B7()),Qh.exports}/**
76
+ * @license React
77
+ * use-sync-external-store-shim/with-selector.production.js
78
+ *
79
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
80
+ *
81
+ * This source code is licensed under the MIT license found in the
82
+ * LICENSE file in the root directory of this source tree.
83
+ */var mk;function P7(){if(mk)return Wh;mk=1;var e=bo(),t=H7();function n(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var a=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,l=e.useRef,o=e.useEffect,c=e.useMemo,f=e.useDebugValue;return Wh.useSyncExternalStoreWithSelector=function(h,g,p,x,y){var w=l(null);if(w.current===null){var j={hasValue:!1,value:null};w.current=j}else j=w.current;w=c(function(){function k(T){if(!N){if(N=!0,_=T,T=x(T),y!==void 0&&j.hasValue){var R=j.value;if(y(R,T))return E=R}return E=T}if(R=E,a(_,T))return R;var B=x(T);return y!==void 0&&y(R,B)?(_=T,R):(_=T,E=B)}var N=!1,_,E,M=p===void 0?null:p;return[function(){return k(g())},M===null?void 0:function(){return k(M())}]},[g,p,x,y]);var S=s(h,w[0],w[1]);return o(function(){j.hasValue=!0,j.value=S},[S]),f(S),S},Wh}var pk;function F7(){return pk||(pk=1,Kh.exports=P7()),Kh.exports}var U7=F7();const $7=Ds(U7),G7={},gk=e=>{let t;const n=new Set,a=(g,p)=>{const x=typeof g=="function"?g(t):g;if(!Object.is(x,t)){const y=t;t=p??(typeof x!="object"||x===null)?x:Object.assign({},t,x),n.forEach(w=>w(t,y))}},s=()=>t,f={setState:a,getState:s,getInitialState:()=>h,subscribe:g=>(n.add(g),()=>n.delete(g)),destroy:()=>{(G7?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},h=t=e(a,s,f);return f},V7=e=>e?gk(e):gk,{useDebugValue:Y7}=uE,{useSyncExternalStoreWithSelector:X7}=$7,K7=e=>e;function J3(e,t=K7,n){const a=X7(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Y7(a),a}const xk=(e,t)=>{const n=V7(e),a=(s,l=t)=>J3(n,s,l);return Object.assign(a,n),a},W7=(e,t)=>e?xk(e,t):xk;function _t(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[a,s]of e)if(!Object.is(s,t.get(a)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const a of e)if(!t.has(a))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const a of n)if(!Object.prototype.hasOwnProperty.call(t,a)||!Object.is(e[a],t[a]))return!1;return!0}const Wc=C.createContext(null),Q7=Wc.Provider,eT=gr.error001();function it(e,t){const n=C.useContext(Wc);if(n===null)throw new Error(eT);return J3(n,e,t)}function Nt(){const e=C.useContext(Wc);if(e===null)throw new Error(eT);return C.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const yk={display:"none"},Z7={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},tT="react-flow__node-desc",nT="react-flow__edge-desc",J7="react-flow__aria-live",e9=e=>e.ariaLiveMessage,t9=e=>e.ariaLabelConfig;function n9({rfId:e}){const t=it(e9);return d.jsx("div",{id:`${J7}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Z7,children:t})}function r9({rfId:e,disableKeyboardA11y:t}){const n=it(t9);return d.jsxs(d.Fragment,{children:[d.jsx("div",{id:`${tT}-${e}`,style:yk,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),d.jsx("div",{id:`${nT}-${e}`,style:yk,children:n["edge.a11yDescription.default"]}),!t&&d.jsx(n9,{rfId:e})]})}const Qc=C.forwardRef(({position:e="top-left",children:t,className:n,style:a,...s},l)=>{const o=`${e}`.split("-");return d.jsx("div",{className:Ht(["react-flow__panel",n,...o]),style:a,ref:l,...s,children:t})});Qc.displayName="Panel";function a9({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:d.jsx(Qc,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:d.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const i9=e=>{const t=[],n=[];for(const[,a]of e.nodeLookup)a.selected&&t.push(a.internals.userNode);for(const[,a]of e.edgeLookup)a.selected&&n.push(a);return{selectedNodes:t,selectedEdges:n}},oc=e=>e.id;function s9(e,t){return _t(e.selectedNodes.map(oc),t.selectedNodes.map(oc))&&_t(e.selectedEdges.map(oc),t.selectedEdges.map(oc))}function l9({onSelectionChange:e}){const t=Nt(),{selectedNodes:n,selectedEdges:a}=it(i9,s9);return C.useEffect(()=>{const s={nodes:n,edges:a};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(l=>l(s))},[n,a,e]),null}const o9=e=>!!e.onSelectionChangeHandlers;function u9({onSelectionChange:e}){const t=it(o9);return e||t?d.jsx(l9,{onSelectionChange:e}):null}const eb=typeof window<"u"?C.useLayoutEffect:C.useEffect,rT=[0,0],c9={x:0,y:0,zoom:1},d9=["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"],bk=[...d9,"rfId"],f9=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),vk={translateExtent:co,nodeOrigin:rT,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function h9(e){const{setNodes:t,setEdges:n,setMinZoom:a,setMaxZoom:s,setTranslateExtent:l,setNodeExtent:o,reset:c,setDefaultNodesAndEdges:f}=it(f9,_t),h=Nt();eb(()=>(f(e.defaultNodes,e.defaultEdges),()=>{g.current=vk,c()}),[]);const g=C.useRef(vk);return eb(()=>{for(const p of bk){const x=e[p],y=g.current[p];x!==y&&(typeof e[p]>"u"||(p==="nodes"?t(x):p==="edges"?n(x):p==="minZoom"?a(x):p==="maxZoom"?s(x):p==="translateExtent"?l(x):p==="nodeExtent"?o(x):p==="ariaLabelConfig"?h.setState({ariaLabelConfig:WI(x)}):p==="fitView"?h.setState({fitViewQueued:x}):p==="fitViewOptions"?h.setState({fitViewOptions:x}):h.setState({[p]:x})))}g.current=e},bk.map(p=>e[p])),null}function wk(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function m9(e){var a;const[t,n]=C.useState(e==="system"?null:e);return C.useEffect(()=>{if(e!=="system"){n(e);return}const s=wk(),l=()=>n(s!=null&&s.matches?"dark":"light");return l(),s==null||s.addEventListener("change",l),()=>{s==null||s.removeEventListener("change",l)}},[e]),t!==null?t:(a=wk())!=null&&a.matches?"dark":"light"}const jk=typeof document<"u"?document:null;function go(e=null,t={target:jk,actInsideInputWithModifier:!0}){const[n,a]=C.useState(!1),s=C.useRef(!1),l=C.useRef(new Set([])),[o,c]=C.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
84
+ `).replace(`
85
+
86
+ `,`
87
+ +`).split(`
88
+ `)),g=h.reduce((p,x)=>p.concat(...x),[]);return[h,g]}return[[],[]]},[e]);return C.useEffect(()=>{const f=(t==null?void 0:t.target)??jk,h=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const g=y=>{var S,k;if(s.current=y.ctrlKey||y.metaKey||y.shiftKey||y.altKey,(!s.current||s.current&&!h)&&z3(y))return!1;const j=Sk(y.code,c);if(l.current.add(y[j]),kk(o,l.current,!1)){const N=((k=(S=y.composedPath)==null?void 0:S.call(y))==null?void 0:k[0])||y.target,_=(N==null?void 0:N.nodeName)==="BUTTON"||(N==null?void 0:N.nodeName)==="A";t.preventDefault!==!1&&(s.current||!_)&&y.preventDefault(),a(!0)}},p=y=>{const w=Sk(y.code,c);kk(o,l.current,!0)?(a(!1),l.current.clear()):l.current.delete(y[w]),y.key==="Meta"&&l.current.clear(),s.current=!1},x=()=>{l.current.clear(),a(!1)};return f==null||f.addEventListener("keydown",g),f==null||f.addEventListener("keyup",p),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{f==null||f.removeEventListener("keydown",g),f==null||f.removeEventListener("keyup",p),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,a]),n}function kk(e,t,n){return e.filter(a=>n||a.length===t.size).some(a=>a.every(s=>t.has(s)))}function Sk(e,t){return t.includes(e)?"code":"key"}const p9=()=>{const e=Nt();return C.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:a}=e.getState();return a?a.scaleTo(t,n):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[a,s,l],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??a,y:t.y??s,zoom:t.zoom??l},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,a]=e.getState().transform;return{x:t,y:n,zoom:a}},setCenter:async(t,n,a)=>e.getState().setCenter(t,n,a),fitBounds:async(t,n)=>{const{width:a,height:s,minZoom:l,maxZoom:o,panZoom:c}=e.getState(),f=Lb(t,a,s,l,o,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(f,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:a,snapGrid:s,snapToGrid:l,domNode:o}=e.getState();if(!o)return t;const{x:c,y:f}=o.getBoundingClientRect(),h={x:t.x-c,y:t.y-f},g=n.snapGrid??s,p=n.snapToGrid??l;return To(h,a,p,g)},flowToScreenPosition:t=>{const{transform:n,domNode:a}=e.getState();if(!a)return t;const{x:s,y:l}=a.getBoundingClientRect(),o=Mc(t,n);return{x:o.x+s,y:o.y+l}}}),[])};function aT(e,t){const n=[],a=new Map,s=[];for(const l of e)if(l.type==="add"){s.push(l);continue}else if(l.type==="remove"||l.type==="replace")a.set(l.id,[l]);else{const o=a.get(l.id);o?o.push(l):a.set(l.id,[l])}for(const l of t){const o=a.get(l.id);if(!o){n.push(l);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const c={...l};for(const f of o)g9(f,c);n.push(c)}return s.length&&s.forEach(l=>{l.index!==void 0?n.splice(l.index,0,{...l.item}):n.push({...l.item})}),n}function g9(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function iT(e,t){return aT(e,t)}function sT(e,t){return aT(e,t)}function hi(e,t){return{id:e,type:"select",selected:t}}function vs(e,t=new Set,n=!1){const a=[];for(const[s,l]of e){const o=t.has(s);!(l.selected===void 0&&!o)&&l.selected!==o&&(n&&(l.selected=o),a.push(hi(l.id,o)))}return a}function _k({items:e=[],lookup:t}){var s;const n=[],a=new Map(e.map(l=>[l.id,l]));for(const[l,o]of e.entries()){const c=t.get(o.id),f=((s=c==null?void 0:c.internals)==null?void 0:s.userNode)??c;f!==void 0&&f!==o&&n.push({id:o.id,item:o,type:"replace"}),f===void 0&&n.push({item:o,type:"add",index:l})}for(const[l]of t)a.get(l)===void 0&&n.push({id:l,type:"remove"});return n}function Nk(e){return{id:e.id,type:"remove"}}const Ck=e=>HI(e),x9=e=>E3(e);function lT(e){return C.forwardRef(e)}function Ek(e){const[t,n]=C.useState(BigInt(0)),[a]=C.useState(()=>y9(()=>n(s=>s+BigInt(1))));return eb(()=>{const s=a.get();s.length&&(e(s),a.reset())},[t]),a}function y9(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const oT=C.createContext(null);function b9({children:e}){const t=Nt(),n=C.useCallback(c=>{const{nodes:f=[],setNodes:h,hasDefaultNodes:g,onNodesChange:p,nodeLookup:x,fitViewQueued:y,onNodesChangeMiddlewareMap:w}=t.getState();let j=f;for(const k of c)j=typeof k=="function"?k(j):k;let S=_k({items:j,lookup:x});for(const k of w.values())S=k(S);g&&h(j),S.length>0?p==null||p(S):y&&window.requestAnimationFrame(()=>{const{fitViewQueued:k,nodes:N,setNodes:_}=t.getState();k&&_(N)})},[]),a=Ek(n),s=C.useCallback(c=>{const{edges:f=[],setEdges:h,hasDefaultEdges:g,onEdgesChange:p,edgeLookup:x}=t.getState();let y=f;for(const w of c)y=typeof w=="function"?w(y):w;g?h(y):p&&p(_k({items:y,lookup:x}))},[]),l=Ek(s),o=C.useMemo(()=>({nodeQueue:a,edgeQueue:l}),[]);return d.jsx(oT.Provider,{value:o,children:e})}function v9(){const e=C.useContext(oT);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const w9=e=>!!e.panZoom;function Hb(){const e=p9(),t=Nt(),n=v9(),a=it(w9),s=C.useMemo(()=>{const l=p=>t.getState().nodeLookup.get(p),o=p=>{n.nodeQueue.push(p)},c=p=>{n.edgeQueue.push(p)},f=p=>{var k,N;const{nodeLookup:x,nodeOrigin:y}=t.getState(),w=Ck(p)?p:x.get(p.id),j=w.parentId?D3(w.position,w.measured,w.parentId,x,y):w.position,S={...w,position:j,width:((k=w.measured)==null?void 0:k.width)??w.width,height:((N=w.measured)==null?void 0:N.height)??w.height};return Ts(S)},h=(p,x,y={replace:!1})=>{o(w=>w.map(j=>{if(j.id===p){const S=typeof x=="function"?x(j):x;return y.replace&&Ck(S)?S:{...j,...S}}return j}))},g=(p,x,y={replace:!1})=>{c(w=>w.map(j=>{if(j.id===p){const S=typeof x=="function"?x(j):x;return y.replace&&x9(S)?S:{...j,...S}}return j}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>{var x;return(x=l(p))==null?void 0:x.internals.userNode},getInternalNode:l,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(x=>({...x}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:o,setEdges:c,addNodes:p=>{const x=Array.isArray(p)?p:[p];n.nodeQueue.push(y=>[...y,...x])},addEdges:p=>{const x=Array.isArray(p)?p:[p];n.edgeQueue.push(y=>[...y,...x])},toObject:()=>{const{nodes:p=[],edges:x=[],transform:y}=t.getState(),[w,j,S]=y;return{nodes:p.map(k=>({...k})),edges:x.map(k=>({...k})),viewport:{x:w,y:j,zoom:S}}},deleteElements:async({nodes:p=[],edges:x=[]})=>{const{nodes:y,edges:w,onNodesDelete:j,onEdgesDelete:S,triggerNodeChanges:k,triggerEdgeChanges:N,onDelete:_,onBeforeDelete:E}=t.getState(),{nodes:M,edges:T}=await GI({nodesToRemove:p,edgesToRemove:x,nodes:y,edges:w,onBeforeDelete:E}),R=T.length>0,B=M.length>0;if(R){const P=T.map(Nk);S==null||S(T),N(P)}if(B){const P=M.map(Nk);j==null||j(M),k(P)}return(B||R)&&(_==null||_({nodes:M,edges:T})),{deletedNodes:M,deletedEdges:T}},getIntersectingNodes:(p,x=!0,y)=>{const w=Jj(p),j=w?p:f(p),S=y!==void 0;return j?(y||t.getState().nodes).filter(k=>{const N=t.getState().nodeLookup.get(k.id);if(N&&!w&&(k.id===p.id||!N.internals.positionAbsolute))return!1;const _=Ts(S?k:N),E=mo(_,j);return x&&E>0||E>=_.width*_.height||E>=j.width*j.height}):[]},isNodeIntersecting:(p,x,y=!0)=>{const j=Jj(p)?p:f(p);if(!j)return!1;const S=mo(j,x);return y&&S>0||S>=x.width*x.height||S>=j.width*j.height},updateNode:h,updateNodeData:(p,x,y={replace:!1})=>{h(p,w=>{const j=typeof x=="function"?x(w):x;return y.replace?{...w,data:j}:{...w,data:{...w.data,...j}}},y)},updateEdge:g,updateEdgeData:(p,x,y={replace:!1})=>{g(p,w=>{const j=typeof x=="function"?x(w):x;return y.replace?{...w,data:j}:{...w,data:{...w.data,...j}}},y)},getNodesBounds:p=>{const{nodeLookup:x,nodeOrigin:y}=t.getState();return PI(p,{nodeLookup:x,nodeOrigin:y})},getHandleConnections:({type:p,id:x,nodeId:y})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${y}-${p}${x?`-${x}`:""}`))==null?void 0:w.values())??[])},getNodeConnections:({type:p,handleId:x,nodeId:y})=>{var w;return Array.from(((w=t.getState().connectionLookup.get(`${y}${p?x?`-${p}-${x}`:`-${p}`:""}`))==null?void 0:w.values())??[])},fitView:async p=>{const x=t.getState().fitViewResolver??KI();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:x}),n.nodeQueue.push(y=>[...y]),x.promise}}},[]);return C.useMemo(()=>({...s,...e,viewportInitialized:a}),[a])}const Tk=e=>e.selected,j9=typeof window<"u"?window:void 0;function k9({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Nt(),{deleteElements:a}=Hb(),s=go(e,{actInsideInputWithModifier:!1}),l=go(t,{target:j9});C.useEffect(()=>{if(s){const{edges:o,nodes:c}=n.getState();a({nodes:c.filter(Tk),edges:o.filter(Tk)}),n.setState({nodesSelectionActive:!1})}},[s]),C.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])}function S9(e){const t=Nt();C.useEffect(()=>{const n=()=>{var s,l,o,c;if(!e.current||!(((l=(s=e.current).checkVisibility)==null?void 0:l.call(s))??!0))return!1;const a=Db(e.current);(a.height===0||a.width===0)&&((c=(o=t.getState()).onError)==null||c.call(o,"004",gr.error004())),t.setState({width:a.width||500,height:a.height||500})};if(e.current){n(),window.addEventListener("resize",n);const a=new ResizeObserver(()=>n());return a.observe(e.current),()=>{window.removeEventListener("resize",n),a&&e.current&&a.unobserve(e.current)}}},[])}const Zc={position:"absolute",width:"100%",height:"100%",top:0,left:0},_9=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function N9({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:a=!1,panOnScrollSpeed:s=.5,panOnScrollMode:l=gi.Free,zoomOnDoubleClick:o=!0,panOnDrag:c=!0,defaultViewport:f,translateExtent:h,minZoom:g,maxZoom:p,zoomActivationKeyCode:x,preventScrolling:y=!0,children:w,noWheelClassName:j,noPanClassName:S,onViewportChange:k,isControlledViewport:N,paneClickDistance:_,selectionOnDrag:E}){const M=Nt(),T=C.useRef(null),{userSelectionActive:R,lib:B,connectionInProgress:P}=it(_9,_t),L=go(x),H=C.useRef();S9(T);const F=C.useCallback(G=>{k==null||k({x:G[0],y:G[1],zoom:G[2]}),N||M.setState({transform:G})},[k,N]);return C.useEffect(()=>{if(T.current){H.current=R7({domNode:T.current,minZoom:g,maxZoom:p,translateExtent:h,viewport:f,onDraggingChange:D=>M.setState(X=>X.paneDragging===D?X:{paneDragging:D}),onPanZoomStart:(D,X)=>{const{onViewportChangeStart:K,onMoveStart:Z}=M.getState();Z==null||Z(D,X),K==null||K(X)},onPanZoom:(D,X)=>{const{onViewportChange:K,onMove:Z}=M.getState();Z==null||Z(D,X),K==null||K(X)},onPanZoomEnd:(D,X)=>{const{onViewportChangeEnd:K,onMoveEnd:Z}=M.getState();Z==null||Z(D,X),K==null||K(X)}});const{x:G,y:q,zoom:O}=H.current.getViewport();return M.setState({panZoom:H.current,transform:[G,q,O],domNode:T.current.closest(".react-flow")}),()=>{var D;(D=H.current)==null||D.destroy()}}},[]),C.useEffect(()=>{var G;(G=H.current)==null||G.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:a,panOnScrollSpeed:s,panOnScrollMode:l,zoomOnDoubleClick:o,panOnDrag:c,zoomActivationKeyPressed:L,preventScrolling:y,noPanClassName:S,userSelectionActive:R,noWheelClassName:j,lib:B,onTransformChange:F,connectionInProgress:P,selectionOnDrag:E,paneClickDistance:_})},[e,t,n,a,s,l,o,c,L,y,S,R,j,B,F,P,E,_]),d.jsx("div",{className:"react-flow__renderer",ref:T,style:Zc,children:w})}const C9=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function E9(){const{userSelectionActive:e,userSelectionRect:t}=it(C9,_t);return e&&t?d.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Jh=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},T9=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function A9({isSelecting:e,selectionKeyPressed:t,selectionMode:n=fo.Full,panOnDrag:a,paneClickDistance:s,selectionOnDrag:l,onSelectionStart:o,onSelectionEnd:c,onPaneClick:f,onPaneContextMenu:h,onPaneScroll:g,onPaneMouseEnter:p,onPaneMouseMove:x,onPaneMouseLeave:y,children:w}){const j=Nt(),{userSelectionActive:S,elementsSelectable:k,dragging:N,connectionInProgress:_}=it(T9,_t),E=k&&(e||S),M=C.useRef(null),T=C.useRef(),R=C.useRef(new Set),B=C.useRef(new Set),P=C.useRef(!1),L=K=>{if(P.current||_){P.current=!1;return}f==null||f(K),j.getState().resetSelectedElements(),j.setState({nodesSelectionActive:!1})},H=K=>{if(Array.isArray(a)&&(a!=null&&a.includes(2))){K.preventDefault();return}h==null||h(K)},F=g?K=>g(K):void 0,G=K=>{P.current&&(K.stopPropagation(),P.current=!1)},q=K=>{var te,ne;const{domNode:Z}=j.getState();if(T.current=Z==null?void 0:Z.getBoundingClientRect(),!T.current)return;const z=K.target===M.current;if(!z&&!!K.target.closest(".nokey")||!e||!(l&&z||t)||K.button!==0||!K.isPrimary)return;(ne=(te=K.target)==null?void 0:te.setPointerCapture)==null||ne.call(te,K.pointerId),P.current=!1;const{x:I,y:V}=Zn(K.nativeEvent,T.current);j.setState({userSelectionRect:{width:0,height:0,startX:I,startY:V,x:I,y:V}}),z||(K.stopPropagation(),K.preventDefault())},O=K=>{const{userSelectionRect:Z,transform:z,nodeLookup:$,edgeLookup:Q,connectionLookup:I,triggerNodeChanges:V,triggerEdgeChanges:te,defaultEdgeOptions:ne,resetSelectedElements:W}=j.getState();if(!T.current||!Z)return;const{x:Y,y:ae}=Zn(K.nativeEvent,T.current),{startX:he,startY:ke}=Z;if(!P.current){const Ae=t?0:s;if(Math.hypot(Y-he,ae-ke)<=Ae)return;W(),o==null||o(K)}P.current=!0;const _e={startX:he,startY:ke,x:Y<he?Y:he,y:ae<ke?ae:ke,width:Math.abs(Y-he),height:Math.abs(ae-ke)},oe=R.current,je=B.current;R.current=new Set(Rb($,_e,z,n===fo.Partial,!0).map(Ae=>Ae.id)),B.current=new Set;const Se=(ne==null?void 0:ne.selectable)??!0;for(const Ae of R.current){const se=I.get(Ae);if(se)for(const{edgeId:Ee}of se.values()){const Te=Q.get(Ee);Te&&(Te.selectable??Se)&&B.current.add(Ee)}}if(!ek(oe,R.current)){const Ae=vs($,R.current,!0);V(Ae)}if(!ek(je,B.current)){const Ae=vs(Q,B.current);te(Ae)}j.setState({userSelectionRect:_e,userSelectionActive:!0,nodesSelectionActive:!1})},D=K=>{var Z,z;K.button===0&&((z=(Z=K.target)==null?void 0:Z.releasePointerCapture)==null||z.call(Z,K.pointerId),!S&&K.target===M.current&&j.getState().userSelectionRect&&(L==null||L(K)),j.setState({userSelectionActive:!1,userSelectionRect:null}),P.current&&(c==null||c(K),j.setState({nodesSelectionActive:R.current.size>0})))},X=a===!0||Array.isArray(a)&&a.includes(0);return d.jsxs("div",{className:Ht(["react-flow__pane",{draggable:X,dragging:N,selection:e}]),onClick:E?void 0:Jh(L,M),onContextMenu:Jh(H,M),onWheel:Jh(F,M),onPointerEnter:E?void 0:p,onPointerMove:E?O:x,onPointerUp:E?D:void 0,onPointerDownCapture:E?q:void 0,onClickCapture:E?G:void 0,onPointerLeave:y,ref:M,style:Zc,children:[w,d.jsx(E9,{})]})}function tb({id:e,store:t,unselect:n=!1,nodeRef:a}){const{addSelectedNodes:s,unselectNodesAndEdges:l,multiSelectionActive:o,nodeLookup:c,onError:f}=t.getState(),h=c.get(e);if(!h){f==null||f("012",gr.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&o)&&(l({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var g;return(g=a==null?void 0:a.current)==null?void 0:g.blur()})):s([e])}function uT({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:a,nodeId:s,isSelectable:l,nodeClickDistance:o}){const c=Nt(),[f,h]=C.useState(!1),g=C.useRef();return C.useEffect(()=>{g.current=y7({getStoreItems:()=>c.getState(),onNodeMouseDown:p=>{tb({id:p,store:c,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),C.useEffect(()=>{if(!(t||!e.current||!g.current))return g.current.update({noDragClassName:n,handleSelector:a,domNode:e.current,isSelectable:l,nodeId:s,nodeClickDistance:o}),()=>{var p;(p=g.current)==null||p.destroy()}},[n,a,t,l,e,s,o]),f}const M9=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function cT(){const e=Nt();return C.useCallback(n=>{const{nodeExtent:a,snapToGrid:s,snapGrid:l,nodesDraggable:o,onError:c,updateNodePositions:f,nodeLookup:h,nodeOrigin:g}=e.getState(),p=new Map,x=M9(o),y=s?l[0]:5,w=s?l[1]:5,j=n.direction.x*y*n.factor,S=n.direction.y*w*n.factor;for(const[,k]of h){if(!x(k))continue;let N={x:k.internals.positionAbsolute.x+j,y:k.internals.positionAbsolute.y+S};s&&(N=Eo(N,l));const{position:_,positionAbsolute:E}=T3({nodeId:k.id,nextPosition:N,nodeLookup:h,nodeExtent:a,nodeOrigin:g,onError:c});k.position=_,k.internals.positionAbsolute=E,p.set(k.id,k)}f(p)},[])}const Pb=C.createContext(null),R9=Pb.Provider;Pb.Consumer;const dT=()=>C.useContext(Pb),L9=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),D9=(e,t,n)=>a=>{const{connectionClickStartHandle:s,connectionMode:l,connection:o}=a,{fromHandle:c,toHandle:f,isValid:h}=o,g=(f==null?void 0:f.nodeId)===e&&(f==null?void 0:f.id)===t&&(f==null?void 0:f.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:g,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:l===Cs.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!s,valid:g&&h}};function O9({type:e="source",position:t=Ie.Top,isValidConnection:n,isConnectable:a=!0,isConnectableStart:s=!0,isConnectableEnd:l=!0,id:o,onConnect:c,children:f,className:h,onMouseDown:g,onTouchStart:p,...x},y){var O,D;const w=o||null,j=e==="target",S=Nt(),k=dT(),{connectOnClick:N,noPanClassName:_,rfId:E}=it(L9,_t),{connectingFrom:M,connectingTo:T,clickConnecting:R,isPossibleEndHandle:B,connectionInProcess:P,clickConnectionInProcess:L,valid:H}=it(D9(k,w,e),_t);k||(D=(O=S.getState()).onError)==null||D.call(O,"010",gr.error010());const F=X=>{const{defaultEdgeOptions:K,onConnect:Z,hasDefaultEdges:z}=S.getState(),$={...K,...X};if(z){const{edges:Q,setEdges:I}=S.getState();I(n7($,Q))}Z==null||Z($),c==null||c($)},G=X=>{if(!k)return;const K=q3(X.nativeEvent);if(s&&(K&&X.button===0||!K)){const Z=S.getState();Jy.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:Z.autoPanOnConnect,connectionMode:Z.connectionMode,connectionRadius:Z.connectionRadius,domNode:Z.domNode,nodeLookup:Z.nodeLookup,lib:Z.lib,isTarget:j,handleId:w,nodeId:k,flowId:Z.rfId,panBy:Z.panBy,cancelConnection:Z.cancelConnection,onConnectStart:Z.onConnectStart,onConnectEnd:(...z)=>{var $,Q;return(Q=($=S.getState()).onConnectEnd)==null?void 0:Q.call($,...z)},updateConnection:Z.updateConnection,onConnect:F,isValidConnection:n||((...z)=>{var $,Q;return((Q=($=S.getState()).isValidConnection)==null?void 0:Q.call($,...z))??!0}),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:Z.autoPanSpeed,dragThreshold:Z.connectionDragThreshold})}K?g==null||g(X):p==null||p(X)},q=X=>{const{onClickConnectStart:K,onClickConnectEnd:Z,connectionClickStartHandle:z,connectionMode:$,isValidConnection:Q,lib:I,rfId:V,nodeLookup:te,connection:ne}=S.getState();if(!k||!z&&!s)return;if(!z){K==null||K(X.nativeEvent,{nodeId:k,handleId:w,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:k,type:e,id:w}});return}const W=O3(X.target),Y=n||Q,{connection:ae,isValid:he}=Jy.isValid(X.nativeEvent,{handle:{nodeId:k,id:w,type:e},connectionMode:$,fromNodeId:z.nodeId,fromHandleId:z.id||null,fromType:z.type,isValidConnection:Y,flowId:V,doc:W,lib:I,nodeLookup:te});he&&ae&&F(ae);const ke=structuredClone(ne);delete ke.inProgress,ke.toPosition=ke.toHandle?ke.toHandle.position:null,Z==null||Z(X,ke),S.setState({connectionClickStartHandle:null})};return d.jsx("div",{"data-handleid":w,"data-nodeid":k,"data-handlepos":t,"data-id":`${E}-${k}-${w}-${e}`,className:Ht(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",_,h,{source:!j,target:j,connectable:a,connectablestart:s,connectableend:l,clickconnecting:R,connectingfrom:M,connectingto:T,valid:H,connectionindicator:a&&(!P||B)&&(P||L?l:s)}]),onMouseDown:G,onTouchStart:G,onClick:N?q:void 0,ref:y,...x,children:f})}const Rs=C.memo(lT(O9));function z9({data:e,isConnectable:t,sourcePosition:n=Ie.Bottom}){return d.jsxs(d.Fragment,{children:[e==null?void 0:e.label,d.jsx(Rs,{type:"source",position:n,isConnectable:t})]})}function q9({data:e,isConnectable:t,targetPosition:n=Ie.Top,sourcePosition:a=Ie.Bottom}){return d.jsxs(d.Fragment,{children:[d.jsx(Rs,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,d.jsx(Rs,{type:"source",position:a,isConnectable:t})]})}function I9(){return null}function B9({data:e,isConnectable:t,targetPosition:n=Ie.Top}){return d.jsxs(d.Fragment,{children:[d.jsx(Rs,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Rc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Ak={input:z9,default:q9,output:B9,group:I9};function H9(e){var t,n,a,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((a=e.style)==null?void 0:a.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const P9=e=>{const{width:t,height:n,x:a,y:s}=Co(e.nodeLookup,{filter:l=>!!l.selected});return{width:Qn(t)?t:null,height:Qn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${a}px,${s}px)`}};function F9({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const a=Nt(),{width:s,height:l,transformString:o,userSelectionActive:c}=it(P9,_t),f=cT(),h=C.useRef(null);C.useEffect(()=>{var y;n||(y=h.current)==null||y.focus({preventScroll:!0})},[n]);const g=!c&&s!==null&&l!==null;if(uT({nodeRef:h,disabled:!g}),!g)return null;const p=e?y=>{const w=a.getState().nodes.filter(j=>j.selected);e(y,w)}:void 0,x=y=>{Object.prototype.hasOwnProperty.call(Rc,y.key)&&(y.preventDefault(),f({direction:Rc[y.key],factor:y.shiftKey?4:1}))};return d.jsx("div",{className:Ht(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:d.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:x,style:{width:s,height:l}})})}const Mk=typeof window<"u"?window:void 0,U9=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function fT({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:a,onPaneMouseLeave:s,onPaneContextMenu:l,onPaneScroll:o,paneClickDistance:c,deleteKeyCode:f,selectionKeyCode:h,selectionOnDrag:g,selectionMode:p,onSelectionStart:x,onSelectionEnd:y,multiSelectionKeyCode:w,panActivationKeyCode:j,zoomActivationKeyCode:S,elementsSelectable:k,zoomOnScroll:N,zoomOnPinch:_,panOnScroll:E,panOnScrollSpeed:M,panOnScrollMode:T,zoomOnDoubleClick:R,panOnDrag:B,defaultViewport:P,translateExtent:L,minZoom:H,maxZoom:F,preventScrolling:G,onSelectionContextMenu:q,noWheelClassName:O,noPanClassName:D,disableKeyboardA11y:X,onViewportChange:K,isControlledViewport:Z}){const{nodesSelectionActive:z,userSelectionActive:$}=it(U9,_t),Q=go(h,{target:Mk}),I=go(j,{target:Mk}),V=I||B,te=I||E,ne=g&&V!==!0,W=Q||$||ne;return k9({deleteKeyCode:f,multiSelectionKeyCode:w}),d.jsx(N9,{onPaneContextMenu:l,elementsSelectable:k,zoomOnScroll:N,zoomOnPinch:_,panOnScroll:te,panOnScrollSpeed:M,panOnScrollMode:T,zoomOnDoubleClick:R,panOnDrag:!Q&&V,defaultViewport:P,translateExtent:L,minZoom:H,maxZoom:F,zoomActivationKeyCode:S,preventScrolling:G,noWheelClassName:O,noPanClassName:D,onViewportChange:K,isControlledViewport:Z,paneClickDistance:c,selectionOnDrag:ne,children:d.jsxs(A9,{onSelectionStart:x,onSelectionEnd:y,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:a,onPaneMouseLeave:s,onPaneContextMenu:l,onPaneScroll:o,panOnDrag:V,isSelecting:!!W,selectionMode:p,selectionKeyPressed:Q,paneClickDistance:c,selectionOnDrag:ne,children:[e,z&&d.jsx(F9,{onSelectionContextMenu:q,noPanClassName:D,disableKeyboardA11y:X})]})})}fT.displayName="FlowRenderer";const $9=C.memo(fT),G9=e=>t=>e?Rb(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function V9(e){return it(C.useCallback(G9(e),[e]),_t)}const Y9=e=>e.updateNodeInternals;function X9(){const e=it(Y9),[t]=C.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const a=new Map;n.forEach(s=>{const l=s.target.getAttribute("data-id");a.set(l,{id:l,nodeElement:s.target,force:!0})}),e(a)}));return C.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function K9({node:e,nodeType:t,hasDimensions:n,resizeObserver:a}){const s=Nt(),l=C.useRef(null),o=C.useRef(null),c=C.useRef(e.sourcePosition),f=C.useRef(e.targetPosition),h=C.useRef(t),g=n&&!!e.internals.handleBounds;return C.useEffect(()=>{l.current&&!e.hidden&&(!g||o.current!==l.current)&&(o.current&&(a==null||a.unobserve(o.current)),a==null||a.observe(l.current),o.current=l.current)},[g,e.hidden]),C.useEffect(()=>()=>{o.current&&(a==null||a.unobserve(o.current),o.current=null)},[]),C.useEffect(()=>{if(l.current){const p=h.current!==t,x=c.current!==e.sourcePosition,y=f.current!==e.targetPosition;(p||x||y)&&(h.current=t,c.current=e.sourcePosition,f.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function W9({id:e,onClick:t,onMouseEnter:n,onMouseMove:a,onMouseLeave:s,onContextMenu:l,onDoubleClick:o,nodesDraggable:c,elementsSelectable:f,nodesConnectable:h,nodesFocusable:g,resizeObserver:p,noDragClassName:x,noPanClassName:y,disableKeyboardA11y:w,rfId:j,nodeTypes:S,nodeClickDistance:k,onError:N}){const{node:_,internals:E,isParent:M}=it(Y=>{const ae=Y.nodeLookup.get(e),he=Y.parentLookup.has(e);return{node:ae,internals:ae.internals,isParent:he}},_t);let T=_.type||"default",R=(S==null?void 0:S[T])||Ak[T];R===void 0&&(N==null||N("003",gr.error003(T)),T="default",R=(S==null?void 0:S.default)||Ak.default);const B=!!(_.draggable||c&&typeof _.draggable>"u"),P=!!(_.selectable||f&&typeof _.selectable>"u"),L=!!(_.connectable||h&&typeof _.connectable>"u"),H=!!(_.focusable||g&&typeof _.focusable>"u"),F=Nt(),G=L3(_),q=K9({node:_,nodeType:T,hasDimensions:G,resizeObserver:p}),O=uT({nodeRef:q,disabled:_.hidden||!B,noDragClassName:x,handleSelector:_.dragHandle,nodeId:e,isSelectable:P,nodeClickDistance:k}),D=cT();if(_.hidden)return null;const X=Zr(_),K=H9(_),Z=P||B||t||n||a||s,z=n?Y=>n(Y,{...E.userNode}):void 0,$=a?Y=>a(Y,{...E.userNode}):void 0,Q=s?Y=>s(Y,{...E.userNode}):void 0,I=l?Y=>l(Y,{...E.userNode}):void 0,V=o?Y=>o(Y,{...E.userNode}):void 0,te=Y=>{const{selectNodesOnDrag:ae,nodeDragThreshold:he}=F.getState();P&&(!ae||!B||he>0)&&tb({id:e,store:F,nodeRef:q}),t&&t(Y,{...E.userNode})},ne=Y=>{if(!(z3(Y.nativeEvent)||w)){if(S3.includes(Y.key)&&P){const ae=Y.key==="Escape";tb({id:e,store:F,unselect:ae,nodeRef:q})}else if(B&&_.selected&&Object.prototype.hasOwnProperty.call(Rc,Y.key)){Y.preventDefault();const{ariaLabelConfig:ae}=F.getState();F.setState({ariaLiveMessage:ae["node.a11yDescription.ariaLiveMessage"]({direction:Y.key.replace("Arrow","").toLowerCase(),x:~~E.positionAbsolute.x,y:~~E.positionAbsolute.y})}),D({direction:Rc[Y.key],factor:Y.shiftKey?4:1})}}},W=()=>{var je;if(w||!((je=q.current)!=null&&je.matches(":focus-visible")))return;const{transform:Y,width:ae,height:he,autoPanOnNodeFocus:ke,setCenter:_e}=F.getState();if(!ke)return;Rb(new Map([[e,_]]),{x:0,y:0,width:ae,height:he},Y,!0).length>0||_e(_.position.x+X.width/2,_.position.y+X.height/2,{zoom:Y[2]})};return d.jsx("div",{className:Ht(["react-flow__node",`react-flow__node-${T}`,{[y]:B},_.className,{selected:_.selected,selectable:P,parent:M,draggable:B,dragging:O}]),ref:q,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:Z?"all":"none",visibility:G?"visible":"hidden",..._.style,...K},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:$,onMouseLeave:Q,onContextMenu:I,onClick:te,onDoubleClick:V,onKeyDown:H?ne:void 0,tabIndex:H?0:void 0,onFocus:H?W:void 0,role:_.ariaRole??(H?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${tT}-${j}`,"aria-label":_.ariaLabel,..._.domAttributes,children:d.jsx(R9,{value:e,children:d.jsx(R,{id:e,data:_.data,type:T,positionAbsoluteX:E.positionAbsolute.x,positionAbsoluteY:E.positionAbsolute.y,selected:_.selected??!1,selectable:P,draggable:B,deletable:_.deletable??!0,isConnectable:L,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:O,dragHandle:_.dragHandle,zIndex:E.z,parentId:_.parentId,...X})})})}var Q9=C.memo(W9);const Z9=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function hT(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:a,elementsSelectable:s,onError:l}=it(Z9,_t),o=V9(e.onlyRenderVisibleElements),c=X9();return d.jsx("div",{className:"react-flow__nodes",style:Zc,children:o.map(f=>d.jsx(Q9,{id:f,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:a,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:l},f))})}hT.displayName="NodeRenderer";const J9=C.memo(hT);function eB(e){return it(C.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const a=[];if(n.width&&n.height)for(const s of n.edges){const l=n.nodeLookup.get(s.source),o=n.nodeLookup.get(s.target);l&&o&&JI({sourceNode:l,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&a.push(s.id)}return a},[e]),_t)}const tB=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return d.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},nB=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return d.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Rk={[ho.Arrow]:tB,[ho.ArrowClosed]:nB};function rB(e){const t=Nt();return C.useMemo(()=>{var s,l;return Object.prototype.hasOwnProperty.call(Rk,e)?Rk[e]:((l=(s=t.getState()).onError)==null||l.call(s,"009",gr.error009(e)),null)},[e])}const aB=({id:e,type:t,color:n,width:a=12.5,height:s=12.5,markerUnits:l="strokeWidth",strokeWidth:o,orient:c="auto-start-reverse"})=>{const f=rB(t);return f?d.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${a}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:c,refX:"0",refY:"0",children:d.jsx(f,{color:n,strokeWidth:o})}):null},mT=({defaultColor:e,rfId:t})=>{const n=it(l=>l.edges),a=it(l=>l.defaultEdgeOptions),s=C.useMemo(()=>l7(n,{id:t,defaultColor:e,defaultMarkerStart:a==null?void 0:a.markerStart,defaultMarkerEnd:a==null?void 0:a.markerEnd}),[n,a,t,e]);return s.length?d.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:d.jsx("defs",{children:s.map(l=>d.jsx(aB,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};mT.displayName="MarkerDefinitions";var iB=C.memo(mT);function pT({x:e,y:t,label:n,labelStyle:a,labelShowBg:s=!0,labelBgStyle:l,labelBgPadding:o=[2,4],labelBgBorderRadius:c=2,children:f,className:h,...g}){const[p,x]=C.useState({x:1,y:0,width:0,height:0}),y=Ht(["react-flow__edge-textwrapper",h]),w=C.useRef(null);return C.useEffect(()=>{if(w.current){const j=w.current.getBBox();x({x:j.x,y:j.y,width:j.width,height:j.height})}},[n]),n?d.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:y,visibility:p.width?"visible":"hidden",...g,children:[s&&d.jsx("rect",{width:p.width+2*o[0],x:-o[0],y:-o[1],height:p.height+2*o[1],className:"react-flow__edge-textbg",style:l,rx:c,ry:c}),d.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:w,style:a,children:n}),f]}):null}pT.displayName="EdgeText";const sB=C.memo(pT);function Jc({path:e,labelX:t,labelY:n,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:o,labelBgPadding:c,labelBgBorderRadius:f,interactionWidth:h=20,...g}){return d.jsxs(d.Fragment,{children:[d.jsx("path",{...g,d:e,fill:"none",className:Ht(["react-flow__edge-path",g.className])}),h?d.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,a&&Qn(t)&&Qn(n)?d.jsx(sB,{x:t,y:n,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:o,labelBgPadding:c,labelBgBorderRadius:f}):null]})}function Lk({pos:e,x1:t,y1:n,x2:a,y2:s}){return e===Ie.Left||e===Ie.Right?[.5*(t+a),n]:[t,.5*(n+s)]}function gT({sourceX:e,sourceY:t,sourcePosition:n=Ie.Bottom,targetX:a,targetY:s,targetPosition:l=Ie.Top}){const[o,c]=Lk({pos:n,x1:e,y1:t,x2:a,y2:s}),[f,h]=Lk({pos:l,x1:a,y1:s,x2:e,y2:t}),[g,p,x,y]=I3({sourceX:e,sourceY:t,targetX:a,targetY:s,sourceControlX:o,sourceControlY:c,targetControlX:f,targetControlY:h});return[`M${e},${t} C${o},${c} ${f},${h} ${a},${s}`,g,p,x,y]}function xT(e){return C.memo(({id:t,sourceX:n,sourceY:a,targetX:s,targetY:l,sourcePosition:o,targetPosition:c,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:p,labelBgPadding:x,labelBgBorderRadius:y,style:w,markerEnd:j,markerStart:S,interactionWidth:k})=>{const[N,_,E]=gT({sourceX:n,sourceY:a,sourcePosition:o,targetX:s,targetY:l,targetPosition:c}),M=e.isInternal?void 0:t;return d.jsx(Jc,{id:M,path:N,labelX:_,labelY:E,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:p,labelBgPadding:x,labelBgBorderRadius:y,style:w,markerEnd:j,markerStart:S,interactionWidth:k})})}const lB=xT({isInternal:!1}),yT=xT({isInternal:!0});lB.displayName="SimpleBezierEdge";yT.displayName="SimpleBezierEdgeInternal";function bT(e){return C.memo(({id:t,sourceX:n,sourceY:a,targetX:s,targetY:l,label:o,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:p,style:x,sourcePosition:y=Ie.Bottom,targetPosition:w=Ie.Top,markerEnd:j,markerStart:S,pathOptions:k,interactionWidth:N})=>{const[_,E,M]=Wy({sourceX:n,sourceY:a,sourcePosition:y,targetX:s,targetY:l,targetPosition:w,borderRadius:k==null?void 0:k.borderRadius,offset:k==null?void 0:k.offset,stepPosition:k==null?void 0:k.stepPosition}),T=e.isInternal?void 0:t;return d.jsx(Jc,{id:T,path:_,labelX:E,labelY:M,label:o,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:p,style:x,markerEnd:j,markerStart:S,interactionWidth:N})})}const vT=bT({isInternal:!1}),wT=bT({isInternal:!0});vT.displayName="SmoothStepEdge";wT.displayName="SmoothStepEdgeInternal";function jT(e){return C.memo(({id:t,...n})=>{var s;const a=e.isInternal?void 0:t;return d.jsx(vT,{...n,id:a,pathOptions:C.useMemo(()=>{var l;return{borderRadius:0,offset:(l=n.pathOptions)==null?void 0:l.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const oB=jT({isInternal:!1}),kT=jT({isInternal:!0});oB.displayName="StepEdge";kT.displayName="StepEdgeInternal";function ST(e){return C.memo(({id:t,sourceX:n,sourceY:a,targetX:s,targetY:l,label:o,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:p,style:x,markerEnd:y,markerStart:w,interactionWidth:j})=>{const[S,k,N]=P3({sourceX:n,sourceY:a,targetX:s,targetY:l}),_=e.isInternal?void 0:t;return d.jsx(Jc,{id:_,path:S,labelX:k,labelY:N,label:o,labelStyle:c,labelShowBg:f,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:p,style:x,markerEnd:y,markerStart:w,interactionWidth:j})})}const uB=ST({isInternal:!1}),_T=ST({isInternal:!0});uB.displayName="StraightEdge";_T.displayName="StraightEdgeInternal";function NT(e){return C.memo(({id:t,sourceX:n,sourceY:a,targetX:s,targetY:l,sourcePosition:o=Ie.Bottom,targetPosition:c=Ie.Top,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:p,labelBgPadding:x,labelBgBorderRadius:y,style:w,markerEnd:j,markerStart:S,pathOptions:k,interactionWidth:N})=>{const[_,E,M]=B3({sourceX:n,sourceY:a,sourcePosition:o,targetX:s,targetY:l,targetPosition:c,curvature:k==null?void 0:k.curvature}),T=e.isInternal?void 0:t;return d.jsx(Jc,{id:T,path:_,labelX:E,labelY:M,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:p,labelBgPadding:x,labelBgBorderRadius:y,style:w,markerEnd:j,markerStart:S,interactionWidth:N})})}const cB=NT({isInternal:!1}),CT=NT({isInternal:!0});cB.displayName="BezierEdge";CT.displayName="BezierEdgeInternal";const Dk={default:CT,straight:_T,step:kT,smoothstep:wT,simplebezier:yT},Ok={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},dB=(e,t,n)=>n===Ie.Left?e-t:n===Ie.Right?e+t:e,fB=(e,t,n)=>n===Ie.Top?e-t:n===Ie.Bottom?e+t:e,zk="react-flow__edgeupdater";function qk({position:e,centerX:t,centerY:n,radius:a=10,onMouseDown:s,onMouseEnter:l,onMouseOut:o,type:c}){return d.jsx("circle",{onMouseDown:s,onMouseEnter:l,onMouseOut:o,className:Ht([zk,`${zk}-${c}`]),cx:dB(t,a,e),cy:fB(n,a,e),r:a,stroke:"transparent",fill:"transparent"})}function hB({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:a,sourceY:s,targetX:l,targetY:o,sourcePosition:c,targetPosition:f,onReconnect:h,onReconnectStart:g,onReconnectEnd:p,setReconnecting:x,setUpdateHover:y}){const w=Nt(),j=(E,M)=>{if(E.button!==0)return;const{autoPanOnConnect:T,domNode:R,connectionMode:B,connectionRadius:P,lib:L,onConnectStart:H,cancelConnection:F,nodeLookup:G,rfId:q,panBy:O,updateConnection:D}=w.getState(),X=M.type==="target",K=($,Q)=>{x(!1),p==null||p($,n,M.type,Q)},Z=$=>h==null?void 0:h(n,$),z=($,Q)=>{x(!0),g==null||g(E,n,M.type),H==null||H($,Q)};Jy.onPointerDown(E.nativeEvent,{autoPanOnConnect:T,connectionMode:B,connectionRadius:P,domNode:R,handleId:M.id,nodeId:M.nodeId,nodeLookup:G,isTarget:X,edgeUpdaterType:M.type,lib:L,flowId:q,cancelConnection:F,panBy:O,isValidConnection:(...$)=>{var Q,I;return((I=(Q=w.getState()).isValidConnection)==null?void 0:I.call(Q,...$))??!0},onConnect:Z,onConnectStart:z,onConnectEnd:(...$)=>{var Q,I;return(I=(Q=w.getState()).onConnectEnd)==null?void 0:I.call(Q,...$)},onReconnectEnd:K,updateConnection:D,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:E.currentTarget})},S=E=>j(E,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),k=E=>j(E,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),N=()=>y(!0),_=()=>y(!1);return d.jsxs(d.Fragment,{children:[(e===!0||e==="source")&&d.jsx(qk,{position:c,centerX:a,centerY:s,radius:t,onMouseDown:S,onMouseEnter:N,onMouseOut:_,type:"source"}),(e===!0||e==="target")&&d.jsx(qk,{position:f,centerX:l,centerY:o,radius:t,onMouseDown:k,onMouseEnter:N,onMouseOut:_,type:"target"})]})}function mB({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:a,onClick:s,onDoubleClick:l,onContextMenu:o,onMouseEnter:c,onMouseMove:f,onMouseLeave:h,reconnectRadius:g,onReconnect:p,onReconnectStart:x,onReconnectEnd:y,rfId:w,edgeTypes:j,noPanClassName:S,onError:k,disableKeyboardA11y:N}){let _=it(_e=>_e.edgeLookup.get(e));const E=it(_e=>_e.defaultEdgeOptions);_=E?{...E,..._}:_;let M=_.type||"default",T=(j==null?void 0:j[M])||Dk[M];T===void 0&&(k==null||k("011",gr.error011(M)),M="default",T=(j==null?void 0:j.default)||Dk.default);const R=!!(_.focusable||t&&typeof _.focusable>"u"),B=typeof p<"u"&&(_.reconnectable||n&&typeof _.reconnectable>"u"),P=!!(_.selectable||a&&typeof _.selectable>"u"),L=C.useRef(null),[H,F]=C.useState(!1),[G,q]=C.useState(!1),O=Nt(),{zIndex:D,sourceX:X,sourceY:K,targetX:Z,targetY:z,sourcePosition:$,targetPosition:Q}=it(C.useCallback(_e=>{const oe=_e.nodeLookup.get(_.source),je=_e.nodeLookup.get(_.target);if(!oe||!je)return{zIndex:_.zIndex,...Ok};const Se=s7({id:e,sourceNode:oe,targetNode:je,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:_e.connectionMode,onError:k});return{zIndex:ZI({selected:_.selected,zIndex:_.zIndex,sourceNode:oe,targetNode:je,elevateOnSelect:_e.elevateEdgesOnSelect,zIndexMode:_e.zIndexMode}),...Se||Ok}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),_t),I=C.useMemo(()=>_.markerStart?`url('#${Qy(_.markerStart,w)}')`:void 0,[_.markerStart,w]),V=C.useMemo(()=>_.markerEnd?`url('#${Qy(_.markerEnd,w)}')`:void 0,[_.markerEnd,w]);if(_.hidden||X===null||K===null||Z===null||z===null)return null;const te=_e=>{var Ae;const{addSelectedEdges:oe,unselectNodesAndEdges:je,multiSelectionActive:Se}=O.getState();P&&(O.setState({nodesSelectionActive:!1}),_.selected&&Se?(je({nodes:[],edges:[_]}),(Ae=L.current)==null||Ae.blur()):oe([e])),s&&s(_e,_)},ne=l?_e=>{l(_e,{..._})}:void 0,W=o?_e=>{o(_e,{..._})}:void 0,Y=c?_e=>{c(_e,{..._})}:void 0,ae=f?_e=>{f(_e,{..._})}:void 0,he=h?_e=>{h(_e,{..._})}:void 0,ke=_e=>{var oe;if(!N&&S3.includes(_e.key)&&P){const{unselectNodesAndEdges:je,addSelectedEdges:Se}=O.getState();_e.key==="Escape"?((oe=L.current)==null||oe.blur(),je({edges:[_]})):Se([e])}};return d.jsx("svg",{style:{zIndex:D},children:d.jsxs("g",{className:Ht(["react-flow__edge",`react-flow__edge-${M}`,_.className,S,{selected:_.selected,animated:_.animated,inactive:!P&&!s,updating:H,selectable:P}]),onClick:te,onDoubleClick:ne,onContextMenu:W,onMouseEnter:Y,onMouseMove:ae,onMouseLeave:he,onKeyDown:R?ke:void 0,tabIndex:R?0:void 0,role:_.ariaRole??(R?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":R?`${nT}-${w}`:void 0,ref:L,..._.domAttributes,children:[!G&&d.jsx(T,{id:e,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:P,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:X,sourceY:K,targetX:Z,targetY:z,sourcePosition:$,targetPosition:Q,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:I,markerEnd:V,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),B&&d.jsx(hB,{edge:_,isReconnectable:B,reconnectRadius:g,onReconnect:p,onReconnectStart:x,onReconnectEnd:y,sourceX:X,sourceY:K,targetX:Z,targetY:z,sourcePosition:$,targetPosition:Q,setUpdateHover:F,setReconnecting:q})]})})}var pB=C.memo(mB);const gB=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function ET({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:a,noPanClassName:s,onReconnect:l,onEdgeContextMenu:o,onEdgeMouseEnter:c,onEdgeMouseMove:f,onEdgeMouseLeave:h,onEdgeClick:g,reconnectRadius:p,onEdgeDoubleClick:x,onReconnectStart:y,onReconnectEnd:w,disableKeyboardA11y:j}){const{edgesFocusable:S,edgesReconnectable:k,elementsSelectable:N,onError:_}=it(gB,_t),E=eB(t);return d.jsxs("div",{className:"react-flow__edges",children:[d.jsx(iB,{defaultColor:e,rfId:n}),E.map(M=>d.jsx(pB,{id:M,edgesFocusable:S,edgesReconnectable:k,elementsSelectable:N,noPanClassName:s,onReconnect:l,onContextMenu:o,onMouseEnter:c,onMouseMove:f,onMouseLeave:h,onClick:g,reconnectRadius:p,onDoubleClick:x,onReconnectStart:y,onReconnectEnd:w,rfId:n,onError:_,edgeTypes:a,disableKeyboardA11y:j},M))]})}ET.displayName="EdgeRenderer";const xB=C.memo(ET),yB=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function bB({children:e}){const t=it(yB);return d.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function vB(e){const t=Hb(),n=C.useRef(!1);C.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const wB=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function jB(e){const t=it(wB),n=Nt();return C.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function kB(e){return e.connection.inProgress?{...e.connection,to:To(e.connection.to,e.transform)}:{...e.connection}}function SB(e){return kB}function _B(e){const t=SB();return it(t,_t)}const NB=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function CB({containerStyle:e,style:t,type:n,component:a}){const{nodesConnectable:s,width:l,height:o,isValid:c,inProgress:f}=it(NB,_t);return!(l&&s&&f)?null:d.jsx("svg",{style:e,width:l,height:o,className:"react-flow__connectionline react-flow__container",children:d.jsx("g",{className:Ht(["react-flow__connection",C3(c)]),children:d.jsx(TT,{style:t,type:n,CustomComponent:a,isValid:c})})})}const TT=({style:e,type:t=Oa.Bezier,CustomComponent:n,isValid:a})=>{const{inProgress:s,from:l,fromNode:o,fromHandle:c,fromPosition:f,to:h,toNode:g,toHandle:p,toPosition:x,pointer:y}=_B();if(!s)return;if(n)return d.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:c,fromX:l.x,fromY:l.y,toX:h.x,toY:h.y,fromPosition:f,toPosition:x,connectionStatus:C3(a),toNode:g,toHandle:p,pointer:y});let w="";const j={sourceX:l.x,sourceY:l.y,sourcePosition:f,targetX:h.x,targetY:h.y,targetPosition:x};switch(t){case Oa.Bezier:[w]=B3(j);break;case Oa.SimpleBezier:[w]=gT(j);break;case Oa.Step:[w]=Wy({...j,borderRadius:0});break;case Oa.SmoothStep:[w]=Wy(j);break;default:[w]=P3(j)}return d.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};TT.displayName="ConnectionLine";const EB={};function Ik(e=EB){C.useRef(e),Nt(),C.useEffect(()=>{},[e])}function TB(){Nt(),C.useRef(!1),C.useEffect(()=>{},[])}function AT({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:a,onEdgeClick:s,onNodeDoubleClick:l,onEdgeDoubleClick:o,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:g,onSelectionContextMenu:p,onSelectionStart:x,onSelectionEnd:y,connectionLineType:w,connectionLineStyle:j,connectionLineComponent:S,connectionLineContainerStyle:k,selectionKeyCode:N,selectionOnDrag:_,selectionMode:E,multiSelectionKeyCode:M,panActivationKeyCode:T,zoomActivationKeyCode:R,deleteKeyCode:B,onlyRenderVisibleElements:P,elementsSelectable:L,defaultViewport:H,translateExtent:F,minZoom:G,maxZoom:q,preventScrolling:O,defaultMarkerColor:D,zoomOnScroll:X,zoomOnPinch:K,panOnScroll:Z,panOnScrollSpeed:z,panOnScrollMode:$,zoomOnDoubleClick:Q,panOnDrag:I,onPaneClick:V,onPaneMouseEnter:te,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneScroll:Y,onPaneContextMenu:ae,paneClickDistance:he,nodeClickDistance:ke,onEdgeContextMenu:_e,onEdgeMouseEnter:oe,onEdgeMouseMove:je,onEdgeMouseLeave:Se,reconnectRadius:Ae,onReconnect:se,onReconnectStart:Ee,onReconnectEnd:Te,noDragClassName:Me,noWheelClassName:we,noPanClassName:De,disableKeyboardA11y:Be,nodeExtent:ie,rfId:xe,viewport:J,onViewportChange:fe}){return Ik(e),Ik(t),TB(),vB(n),jB(J),d.jsx($9,{onPaneClick:V,onPaneMouseEnter:te,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneContextMenu:ae,onPaneScroll:Y,paneClickDistance:he,deleteKeyCode:B,selectionKeyCode:N,selectionOnDrag:_,selectionMode:E,onSelectionStart:x,onSelectionEnd:y,multiSelectionKeyCode:M,panActivationKeyCode:T,zoomActivationKeyCode:R,elementsSelectable:L,zoomOnScroll:X,zoomOnPinch:K,zoomOnDoubleClick:Q,panOnScroll:Z,panOnScrollSpeed:z,panOnScrollMode:$,panOnDrag:I,defaultViewport:H,translateExtent:F,minZoom:G,maxZoom:q,onSelectionContextMenu:p,preventScrolling:O,noDragClassName:Me,noWheelClassName:we,noPanClassName:De,disableKeyboardA11y:Be,onViewportChange:fe,isControlledViewport:!!J,children:d.jsxs(bB,{children:[d.jsx(xB,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:o,onReconnect:se,onReconnectStart:Ee,onReconnectEnd:Te,onlyRenderVisibleElements:P,onEdgeContextMenu:_e,onEdgeMouseEnter:oe,onEdgeMouseMove:je,onEdgeMouseLeave:Se,reconnectRadius:Ae,defaultMarkerColor:D,noPanClassName:De,disableKeyboardA11y:Be,rfId:xe}),d.jsx(CB,{style:j,type:w,component:S,containerStyle:k}),d.jsx("div",{className:"react-flow__edgelabel-renderer"}),d.jsx(J9,{nodeTypes:e,onNodeClick:a,onNodeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:g,nodeClickDistance:ke,onlyRenderVisibleElements:P,noPanClassName:De,noDragClassName:Me,disableKeyboardA11y:Be,nodeExtent:ie,rfId:xe}),d.jsx("div",{className:"react-flow__viewport-portal"})]})})}AT.displayName="GraphView";const AB=C.memo(AT),Bk=({nodes:e,edges:t,defaultNodes:n,defaultEdges:a,width:s,height:l,fitView:o,fitViewOptions:c,minZoom:f=.5,maxZoom:h=2,nodeOrigin:g,nodeExtent:p,zIndexMode:x="basic"}={})=>{const y=new Map,w=new Map,j=new Map,S=new Map,k=a??t??[],N=n??e??[],_=g??[0,0],E=p??co;$3(j,S,k);const{nodesInitialized:M}=Zy(N,y,w,{nodeOrigin:_,nodeExtent:E,zIndexMode:x});let T=[0,0,1];if(o&&s&&l){const R=Co(y,{filter:H=>!!((H.width||H.initialWidth)&&(H.height||H.initialHeight))}),{x:B,y:P,zoom:L}=Lb(R,s,l,f,h,(c==null?void 0:c.padding)??.1);T=[B,P,L]}return{rfId:"1",width:s??0,height:l??0,transform:T,nodes:N,nodesInitialized:M,nodeLookup:y,parentLookup:w,edges:k,edgeLookup:S,connectionLookup:j,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:f,maxZoom:h,translateExtent:co,nodeExtent:E,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Cs.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,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:o??!1,fitViewOptions:c,fitViewResolver:null,connection:{...N3},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:VI,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:_3,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},MB=({nodes:e,edges:t,defaultNodes:n,defaultEdges:a,width:s,height:l,fitView:o,fitViewOptions:c,minZoom:f,maxZoom:h,nodeOrigin:g,nodeExtent:p,zIndexMode:x})=>W7((y,w)=>{async function j(){const{nodeLookup:S,panZoom:k,fitViewOptions:N,fitViewResolver:_,width:E,height:M,minZoom:T,maxZoom:R}=w();k&&(await $I({nodes:S,width:E,height:M,panZoom:k,minZoom:T,maxZoom:R},N),_==null||_.resolve(!0),y({fitViewResolver:null}))}return{...Bk({nodes:e,edges:t,width:s,height:l,fitView:o,fitViewOptions:c,minZoom:f,maxZoom:h,nodeOrigin:g,nodeExtent:p,defaultNodes:n,defaultEdges:a,zIndexMode:x}),setNodes:S=>{const{nodeLookup:k,parentLookup:N,nodeOrigin:_,elevateNodesOnSelect:E,fitViewQueued:M,zIndexMode:T,nodesSelectionActive:R}=w(),{nodesInitialized:B,hasSelectedNodes:P}=Zy(S,k,N,{nodeOrigin:_,nodeExtent:p,elevateNodesOnSelect:E,checkEquality:!0,zIndexMode:T}),L=R&&P;M&&B?(j(),y({nodes:S,nodesInitialized:B,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:L})):y({nodes:S,nodesInitialized:B,nodesSelectionActive:L})},setEdges:S=>{const{connectionLookup:k,edgeLookup:N}=w();$3(k,N,S),y({edges:S})},setDefaultNodesAndEdges:(S,k)=>{if(S){const{setNodes:N}=w();N(S),y({hasDefaultNodes:!0})}if(k){const{setEdges:N}=w();N(k),y({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:k,nodeLookup:N,parentLookup:_,domNode:E,nodeOrigin:M,nodeExtent:T,debug:R,fitViewQueued:B,zIndexMode:P}=w(),{changes:L,updatedInternals:H}=m7(S,N,_,E,M,T,P);H&&(c7(N,_,{nodeOrigin:M,nodeExtent:T,zIndexMode:P}),B?(j(),y({fitViewQueued:!1,fitViewOptions:void 0})):y({}),(L==null?void 0:L.length)>0&&(R&&console.log("React Flow: trigger node changes",L),k==null||k(L)))},updateNodePositions:(S,k=!1)=>{const N=[];let _=[];const{nodeLookup:E,triggerNodeChanges:M,connection:T,updateConnection:R,onNodesChangeMiddlewareMap:B}=w();for(const[P,L]of S){const H=E.get(P),F=!!(H!=null&&H.expandParent&&(H!=null&&H.parentId)&&(L!=null&&L.position)),G={id:P,type:"position",position:F?{x:Math.max(0,L.position.x),y:Math.max(0,L.position.y)}:L.position,dragging:k};if(H&&T.inProgress&&T.fromNode.id===H.id){const q=vi(H,T.fromHandle,Ie.Left,!0);R({...T,from:q})}F&&H.parentId&&N.push({id:P,parentId:H.parentId,rect:{...L.internals.positionAbsolute,width:L.measured.width??0,height:L.measured.height??0}}),_.push(G)}if(N.length>0){const{parentLookup:P,nodeOrigin:L}=w(),H=Bb(N,E,P,L);_.push(...H)}for(const P of B.values())_=P(_);M(_)},triggerNodeChanges:S=>{const{onNodesChange:k,setNodes:N,nodes:_,hasDefaultNodes:E,debug:M}=w();if(S!=null&&S.length){if(E){const T=iT(S,_);N(T)}M&&console.log("React Flow: trigger node changes",S),k==null||k(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:k,setEdges:N,edges:_,hasDefaultEdges:E,debug:M}=w();if(S!=null&&S.length){if(E){const T=sT(S,_);N(T)}M&&console.log("React Flow: trigger edge changes",S),k==null||k(S)}},addSelectedNodes:S=>{const{multiSelectionActive:k,edgeLookup:N,nodeLookup:_,triggerNodeChanges:E,triggerEdgeChanges:M}=w();if(k){const T=S.map(R=>hi(R,!0));E(T);return}E(vs(_,new Set([...S]),!0)),M(vs(N))},addSelectedEdges:S=>{const{multiSelectionActive:k,edgeLookup:N,nodeLookup:_,triggerNodeChanges:E,triggerEdgeChanges:M}=w();if(k){const T=S.map(R=>hi(R,!0));M(T);return}M(vs(N,new Set([...S]))),E(vs(_,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:k}={})=>{const{edges:N,nodes:_,nodeLookup:E,triggerNodeChanges:M,triggerEdgeChanges:T}=w(),R=S||_,B=k||N,P=[];for(const H of R){if(!H.selected)continue;const F=E.get(H.id);F&&(F.selected=!1),P.push(hi(H.id,!1))}const L=[];for(const H of B)H.selected&&L.push(hi(H.id,!1));M(P),T(L)},setMinZoom:S=>{const{panZoom:k,maxZoom:N}=w();k==null||k.setScaleExtent([S,N]),y({minZoom:S})},setMaxZoom:S=>{const{panZoom:k,minZoom:N}=w();k==null||k.setScaleExtent([N,S]),y({maxZoom:S})},setTranslateExtent:S=>{var k;(k=w().panZoom)==null||k.setTranslateExtent(S),y({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:k,triggerNodeChanges:N,triggerEdgeChanges:_,elementsSelectable:E}=w();if(!E)return;const M=k.reduce((R,B)=>B.selected?[...R,hi(B.id,!1)]:R,[]),T=S.reduce((R,B)=>B.selected?[...R,hi(B.id,!1)]:R,[]);N(M),_(T)},setNodeExtent:S=>{const{nodes:k,nodeLookup:N,parentLookup:_,nodeOrigin:E,elevateNodesOnSelect:M,nodeExtent:T,zIndexMode:R}=w();S[0][0]===T[0][0]&&S[0][1]===T[0][1]&&S[1][0]===T[1][0]&&S[1][1]===T[1][1]||(Zy(k,N,_,{nodeOrigin:E,nodeExtent:S,elevateNodesOnSelect:M,checkEquality:!1,zIndexMode:R}),y({nodeExtent:S}))},panBy:S=>{const{transform:k,width:N,height:_,panZoom:E,translateExtent:M}=w();return p7({delta:S,panZoom:E,transform:k,translateExtent:M,width:N,height:_})},setCenter:async(S,k,N)=>{const{width:_,height:E,maxZoom:M,panZoom:T}=w();if(!T)return Promise.resolve(!1);const R=typeof(N==null?void 0:N.zoom)<"u"?N.zoom:M;return await T.setViewport({x:_/2-S*R,y:E/2-k*R,zoom:R},{duration:N==null?void 0:N.duration,ease:N==null?void 0:N.ease,interpolate:N==null?void 0:N.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{y({connection:{...N3}})},updateConnection:S=>{y({connection:S})},reset:()=>y({...Bk()})}},Object.is);function RB({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:a,initialWidth:s,initialHeight:l,initialMinZoom:o,initialMaxZoom:c,initialFitViewOptions:f,fitView:h,nodeOrigin:g,nodeExtent:p,zIndexMode:x,children:y}){const[w]=C.useState(()=>MB({nodes:e,edges:t,defaultNodes:n,defaultEdges:a,width:s,height:l,fitView:h,minZoom:o,maxZoom:c,fitViewOptions:f,nodeOrigin:g,nodeExtent:p,zIndexMode:x}));return d.jsx(Q7,{value:w,children:d.jsx(b9,{children:y})})}function LB({children:e,nodes:t,edges:n,defaultNodes:a,defaultEdges:s,width:l,height:o,fitView:c,fitViewOptions:f,minZoom:h,maxZoom:g,nodeOrigin:p,nodeExtent:x,zIndexMode:y}){return C.useContext(Wc)?d.jsx(d.Fragment,{children:e}):d.jsx(RB,{initialNodes:t,initialEdges:n,defaultNodes:a,defaultEdges:s,initialWidth:l,initialHeight:o,fitView:c,initialFitViewOptions:f,initialMinZoom:h,initialMaxZoom:g,nodeOrigin:p,nodeExtent:x,zIndexMode:y,children:e})}const DB={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function OB({nodes:e,edges:t,defaultNodes:n,defaultEdges:a,className:s,nodeTypes:l,edgeTypes:o,onNodeClick:c,onEdgeClick:f,onInit:h,onMove:g,onMoveStart:p,onMoveEnd:x,onConnect:y,onConnectStart:w,onConnectEnd:j,onClickConnectStart:S,onClickConnectEnd:k,onNodeMouseEnter:N,onNodeMouseMove:_,onNodeMouseLeave:E,onNodeContextMenu:M,onNodeDoubleClick:T,onNodeDragStart:R,onNodeDrag:B,onNodeDragStop:P,onNodesDelete:L,onEdgesDelete:H,onDelete:F,onSelectionChange:G,onSelectionDragStart:q,onSelectionDrag:O,onSelectionDragStop:D,onSelectionContextMenu:X,onSelectionStart:K,onSelectionEnd:Z,onBeforeDelete:z,connectionMode:$,connectionLineType:Q=Oa.Bezier,connectionLineStyle:I,connectionLineComponent:V,connectionLineContainerStyle:te,deleteKeyCode:ne="Backspace",selectionKeyCode:W="Shift",selectionOnDrag:Y=!1,selectionMode:ae=fo.Full,panActivationKeyCode:he="Space",multiSelectionKeyCode:ke=po()?"Meta":"Control",zoomActivationKeyCode:_e=po()?"Meta":"Control",snapToGrid:oe,snapGrid:je,onlyRenderVisibleElements:Se=!1,selectNodesOnDrag:Ae,nodesDraggable:se,autoPanOnNodeFocus:Ee,nodesConnectable:Te,nodesFocusable:Me,nodeOrigin:we=rT,edgesFocusable:De,edgesReconnectable:Be,elementsSelectable:ie=!0,defaultViewport:xe=c9,minZoom:J=.5,maxZoom:fe=2,translateExtent:be=co,preventScrolling:Ne=!0,nodeExtent:Oe,defaultMarkerColor:ht="#b1b1b7",zoomOnScroll:yt=!0,zoomOnPinch:tt=!0,panOnScroll:st=!1,panOnScrollSpeed:Ft=.5,panOnScrollMode:ut=gi.Free,zoomOnDoubleClick:tn=!0,panOnDrag:nn=!0,onPaneClick:Ci,onPaneMouseEnter:jr,onPaneMouseMove:Re,onPaneMouseLeave:na,onPaneScroll:$n,onPaneContextMenu:ra,paneClickDistance:kr=1,nodeClickDistance:Gs=0,children:Ei,onReconnect:Ha,onReconnectStart:Sr,onReconnectEnd:aa,onEdgeContextMenu:Ti,onEdgeDoubleClick:Ai,onEdgeMouseEnter:Mi,onEdgeMouseMove:Pa,onEdgeMouseLeave:Fa,reconnectRadius:Ri=10,onNodesChange:Li,onEdgesChange:An,noDragClassName:At="nodrag",noWheelClassName:Gt="nowheel",noPanClassName:Qt="nopan",fitView:sn,fitViewOptions:_r,connectOnClick:Vs,attributionPosition:Di,proOptions:Nr,defaultEdgeOptions:Ua,elevateNodesOnSelect:ar=!0,elevateEdgesOnSelect:ir=!1,disableKeyboardA11y:sr=!1,autoPanOnConnect:lr,autoPanOnNodeDrag:Et,autoPanSpeed:$a,connectionRadius:pe,isValidConnection:Ge,onError:Ke,style:Ut,id:mt,nodeDragThreshold:ia,connectionDragThreshold:Ys,viewport:Cr,onViewportChange:Oi,width:Gn,height:ln,colorMode:Io="light",debug:jd,onScroll:sa,ariaLabelConfig:Bo,zIndexMode:Ga="basic",...kd},on){const Va=mt||"1",Ho=m9(Io),Xs=C.useCallback(Er=>{Er.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),sa==null||sa(Er)},[sa]);return d.jsx("div",{"data-testid":"rf__wrapper",...kd,onScroll:Xs,style:{...Ut,...DB},ref:on,className:Ht(["react-flow",s,Ho]),id:mt,role:"application",children:d.jsxs(LB,{nodes:e,edges:t,width:Gn,height:ln,fitView:sn,fitViewOptions:_r,minZoom:J,maxZoom:fe,nodeOrigin:we,nodeExtent:Oe,zIndexMode:Ga,children:[d.jsx(h9,{nodes:e,edges:t,defaultNodes:n,defaultEdges:a,onConnect:y,onConnectStart:w,onConnectEnd:j,onClickConnectStart:S,onClickConnectEnd:k,nodesDraggable:se,autoPanOnNodeFocus:Ee,nodesConnectable:Te,nodesFocusable:Me,edgesFocusable:De,edgesReconnectable:Be,elementsSelectable:ie,elevateNodesOnSelect:ar,elevateEdgesOnSelect:ir,minZoom:J,maxZoom:fe,nodeExtent:Oe,onNodesChange:Li,onEdgesChange:An,snapToGrid:oe,snapGrid:je,connectionMode:$,translateExtent:be,connectOnClick:Vs,defaultEdgeOptions:Ua,fitView:sn,fitViewOptions:_r,onNodesDelete:L,onEdgesDelete:H,onDelete:F,onNodeDragStart:R,onNodeDrag:B,onNodeDragStop:P,onSelectionDrag:O,onSelectionDragStart:q,onSelectionDragStop:D,onMove:g,onMoveStart:p,onMoveEnd:x,noPanClassName:Qt,nodeOrigin:we,rfId:Va,autoPanOnConnect:lr,autoPanOnNodeDrag:Et,autoPanSpeed:$a,onError:Ke,connectionRadius:pe,isValidConnection:Ge,selectNodesOnDrag:Ae,nodeDragThreshold:ia,connectionDragThreshold:Ys,onBeforeDelete:z,debug:jd,ariaLabelConfig:Bo,zIndexMode:Ga}),d.jsx(AB,{onInit:h,onNodeClick:c,onEdgeClick:f,onNodeMouseEnter:N,onNodeMouseMove:_,onNodeMouseLeave:E,onNodeContextMenu:M,onNodeDoubleClick:T,nodeTypes:l,edgeTypes:o,connectionLineType:Q,connectionLineStyle:I,connectionLineComponent:V,connectionLineContainerStyle:te,selectionKeyCode:W,selectionOnDrag:Y,selectionMode:ae,deleteKeyCode:ne,multiSelectionKeyCode:ke,panActivationKeyCode:he,zoomActivationKeyCode:_e,onlyRenderVisibleElements:Se,defaultViewport:xe,translateExtent:be,minZoom:J,maxZoom:fe,preventScrolling:Ne,zoomOnScroll:yt,zoomOnPinch:tt,zoomOnDoubleClick:tn,panOnScroll:st,panOnScrollSpeed:Ft,panOnScrollMode:ut,panOnDrag:nn,onPaneClick:Ci,onPaneMouseEnter:jr,onPaneMouseMove:Re,onPaneMouseLeave:na,onPaneScroll:$n,onPaneContextMenu:ra,paneClickDistance:kr,nodeClickDistance:Gs,onSelectionContextMenu:X,onSelectionStart:K,onSelectionEnd:Z,onReconnect:Ha,onReconnectStart:Sr,onReconnectEnd:aa,onEdgeContextMenu:Ti,onEdgeDoubleClick:Ai,onEdgeMouseEnter:Mi,onEdgeMouseMove:Pa,onEdgeMouseLeave:Fa,reconnectRadius:Ri,defaultMarkerColor:ht,noDragClassName:At,noWheelClassName:Gt,noPanClassName:Qt,rfId:Va,disableKeyboardA11y:sr,nodeExtent:Oe,viewport:Cr,onViewportChange:Oi}),d.jsx(u9,{onSelectionChange:G}),Ei,d.jsx(a9,{proOptions:Nr,position:Di}),d.jsx(r9,{rfId:Va,disableKeyboardA11y:sr})]})})}var zB=lT(OB);function qB(e){const[t,n]=C.useState(e),a=C.useCallback(s=>n(l=>iT(s,l)),[]);return[t,n,a]}function IB(e){const[t,n]=C.useState(e),a=C.useCallback(s=>n(l=>sT(s,l)),[]);return[t,n,a]}function BB({dimensions:e,lineWidth:t,variant:n,className:a}){return d.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ht(["react-flow__background-pattern",n,a])})}function HB({radius:e,className:t}){return d.jsx("circle",{cx:e,cy:e,r:e,className:Ht(["react-flow__background-pattern","dots",t])})}var Kr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Kr||(Kr={}));const PB={[Kr.Dots]:1,[Kr.Lines]:1,[Kr.Cross]:6},FB=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function MT({id:e,variant:t=Kr.Dots,gap:n=20,size:a,lineWidth:s=1,offset:l=0,color:o,bgColor:c,style:f,className:h,patternClassName:g}){const p=C.useRef(null),{transform:x,patternId:y}=it(FB,_t),w=a||PB[t],j=t===Kr.Dots,S=t===Kr.Cross,k=Array.isArray(n)?n:[n,n],N=[k[0]*x[2]||1,k[1]*x[2]||1],_=w*x[2],E=Array.isArray(l)?l:[l,l],M=S?[_,_]:N,T=[E[0]*x[2]||1+M[0]/2,E[1]*x[2]||1+M[1]/2],R=`${y}${e||""}`;return d.jsxs("svg",{className:Ht(["react-flow__background",h]),style:{...f,...Zc,"--xy-background-color-props":c,"--xy-background-pattern-color-props":o},ref:p,"data-testid":"rf__background",children:[d.jsx("pattern",{id:R,x:x[0]%N[0],y:x[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:j?d.jsx(HB,{radius:_/2,className:g}):d.jsx(BB,{dimensions:M,lineWidth:s,variant:t,className:g})}),d.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${R})`})]})}MT.displayName="Background";const UB=C.memo(MT);function $B(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:d.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function GB(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:d.jsx("path",{d:"M0 0h32v4.2H0z"})})}function VB(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:d.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 YB(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.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 XB(){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:d.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 uc({children:e,className:t,...n}){return d.jsx("button",{type:"button",className:Ht(["react-flow__controls-button",t]),...n,children:e})}const KB=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function RT({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:a=!0,fitViewOptions:s,onZoomIn:l,onZoomOut:o,onFitView:c,onInteractiveChange:f,className:h,children:g,position:p="bottom-left",orientation:x="vertical","aria-label":y}){const w=Nt(),{isInteractive:j,minZoomReached:S,maxZoomReached:k,ariaLabelConfig:N}=it(KB,_t),{zoomIn:_,zoomOut:E,fitView:M}=Hb(),T=()=>{_(),l==null||l()},R=()=>{E(),o==null||o()},B=()=>{M(s),c==null||c()},P=()=>{w.setState({nodesDraggable:!j,nodesConnectable:!j,elementsSelectable:!j}),f==null||f(!j)},L=x==="horizontal"?"horizontal":"vertical";return d.jsxs(Qc,{className:Ht(["react-flow__controls",L,h]),position:p,style:e,"data-testid":"rf__controls","aria-label":y??N["controls.ariaLabel"],children:[t&&d.jsxs(d.Fragment,{children:[d.jsx(uc,{onClick:T,className:"react-flow__controls-zoomin",title:N["controls.zoomIn.ariaLabel"],"aria-label":N["controls.zoomIn.ariaLabel"],disabled:k,children:d.jsx($B,{})}),d.jsx(uc,{onClick:R,className:"react-flow__controls-zoomout",title:N["controls.zoomOut.ariaLabel"],"aria-label":N["controls.zoomOut.ariaLabel"],disabled:S,children:d.jsx(GB,{})})]}),n&&d.jsx(uc,{className:"react-flow__controls-fitview",onClick:B,title:N["controls.fitView.ariaLabel"],"aria-label":N["controls.fitView.ariaLabel"],children:d.jsx(VB,{})}),a&&d.jsx(uc,{className:"react-flow__controls-interactive",onClick:P,title:N["controls.interactive.ariaLabel"],"aria-label":N["controls.interactive.ariaLabel"],children:j?d.jsx(XB,{}):d.jsx(YB,{})}),g]})}RT.displayName="Controls";const WB=C.memo(RT);function QB({id:e,x:t,y:n,width:a,height:s,style:l,color:o,strokeColor:c,strokeWidth:f,className:h,borderRadius:g,shapeRendering:p,selected:x,onClick:y}){const{background:w,backgroundColor:j}=l||{},S=o||w||j;return d.jsx("rect",{className:Ht(["react-flow__minimap-node",{selected:x},h]),x:t,y:n,rx:g,ry:g,width:a,height:s,style:{fill:S,stroke:c,strokeWidth:f},shapeRendering:p,onClick:y?k=>y(k,e):void 0})}const ZB=C.memo(QB),JB=e=>e.nodes.map(t=>t.id),em=e=>e instanceof Function?e:()=>e;function eH({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:a=5,nodeStrokeWidth:s,nodeComponent:l=ZB,onClick:o}){const c=it(JB,_t),f=em(t),h=em(e),g=em(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return d.jsx(d.Fragment,{children:c.map(x=>d.jsx(nH,{id:x,nodeColorFunc:f,nodeStrokeColorFunc:h,nodeClassNameFunc:g,nodeBorderRadius:a,nodeStrokeWidth:s,NodeComponent:l,onClick:o,shapeRendering:p},x))})}function tH({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:a,nodeBorderRadius:s,nodeStrokeWidth:l,shapeRendering:o,NodeComponent:c,onClick:f}){const{node:h,x:g,y:p,width:x,height:y}=it(w=>{const j=w.nodeLookup.get(e);if(!j)return{node:void 0,x:0,y:0,width:0,height:0};const S=j.internals.userNode,{x:k,y:N}=j.internals.positionAbsolute,{width:_,height:E}=Zr(S);return{node:S,x:k,y:N,width:_,height:E}},_t);return!h||h.hidden||!L3(h)?null:d.jsx(c,{x:g,y:p,width:x,height:y,style:h.style,selected:!!h.selected,className:a(h),color:t(h),borderRadius:s,strokeColor:n(h),strokeWidth:l,shapeRendering:o,onClick:f,id:h.id})}const nH=C.memo(tH);var rH=C.memo(eH);const aH=200,iH=150,sH=e=>!e.hidden,lH=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?R3(Co(e.nodeLookup,{filter:sH}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},oH="react-flow__minimap-desc";function LT({style:e,className:t,nodeStrokeColor:n,nodeColor:a,nodeClassName:s="",nodeBorderRadius:l=5,nodeStrokeWidth:o,nodeComponent:c,bgColor:f,maskColor:h,maskStrokeColor:g,maskStrokeWidth:p,position:x="bottom-right",onClick:y,onNodeClick:w,pannable:j=!1,zoomable:S=!1,ariaLabel:k,inversePan:N,zoomStep:_=1,offsetScale:E=5}){const M=Nt(),T=C.useRef(null),{boundingRect:R,viewBB:B,rfId:P,panZoom:L,translateExtent:H,flowWidth:F,flowHeight:G,ariaLabelConfig:q}=it(lH,_t),O=(e==null?void 0:e.width)??aH,D=(e==null?void 0:e.height)??iH,X=R.width/O,K=R.height/D,Z=Math.max(X,K),z=Z*O,$=Z*D,Q=E*Z,I=R.x-(z-R.width)/2-Q,V=R.y-($-R.height)/2-Q,te=z+Q*2,ne=$+Q*2,W=`${oH}-${P}`,Y=C.useRef(0),ae=C.useRef();Y.current=Z,C.useEffect(()=>{if(T.current&&L)return ae.current=S7({domNode:T.current,panZoom:L,getTransform:()=>M.getState().transform,getViewScale:()=>Y.current}),()=>{var oe;(oe=ae.current)==null||oe.destroy()}},[L]),C.useEffect(()=>{var oe;(oe=ae.current)==null||oe.update({translateExtent:H,width:F,height:G,inversePan:N,pannable:j,zoomStep:_,zoomable:S})},[j,S,N,_,H,F,G]);const he=y?oe=>{var Ae;const[je,Se]=((Ae=ae.current)==null?void 0:Ae.pointer(oe))||[0,0];y(oe,{x:je,y:Se})}:void 0,ke=w?C.useCallback((oe,je)=>{const Se=M.getState().nodeLookup.get(je).internals.userNode;w(oe,Se)},[]):void 0,_e=k??q["minimap.ariaLabel"];return d.jsx(Qc,{position:x,style:{...e,"--xy-minimap-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*Z:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:Ht(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:d.jsxs("svg",{width:O,height:D,viewBox:`${I} ${V} ${te} ${ne}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":W,ref:T,onClick:he,children:[_e&&d.jsx("title",{id:W,children:_e}),d.jsx(rH,{onClick:ke,nodeColor:a,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:s,nodeStrokeWidth:o,nodeComponent:c}),d.jsx("path",{className:"react-flow__minimap-mask",d:`M${I-Q},${V-Q}h${te+Q*2}v${ne+Q*2}h${-te-Q*2}z
89
+ M${B.x},${B.y}h${B.width}v${B.height}h${-B.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}LT.displayName="MiniMap";const uH=C.memo(LT),cH=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,dH={[Ms.Line]:"right",[Ms.Handle]:"bottom-right"};function fH({nodeId:e,position:t,variant:n=Ms.Handle,className:a,style:s=void 0,children:l,color:o,minWidth:c=10,minHeight:f=10,maxWidth:h=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:x,autoScale:y=!0,shouldResize:w,onResizeStart:j,onResize:S,onResizeEnd:k}){const N=dT(),_=typeof e=="string"?e:N,E=Nt(),M=C.useRef(null),T=n===Ms.Handle,R=it(C.useCallback(cH(T&&y),[T,y]),_t),B=C.useRef(null),P=t??dH[n];C.useEffect(()=>{if(!(!M.current||!_))return B.current||(B.current=I7({domNode:M.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:H,transform:F,snapGrid:G,snapToGrid:q,nodeOrigin:O,domNode:D}=E.getState();return{nodeLookup:H,transform:F,snapGrid:G,snapToGrid:q,nodeOrigin:O,paneDomNode:D}},onChange:(H,F)=>{const{triggerNodeChanges:G,nodeLookup:q,parentLookup:O,nodeOrigin:D}=E.getState(),X=[],K={x:H.x,y:H.y},Z=q.get(_);if(Z&&Z.expandParent&&Z.parentId){const z=Z.origin??D,$=H.width??Z.measured.width??0,Q=H.height??Z.measured.height??0,I={id:Z.id,parentId:Z.parentId,rect:{width:$,height:Q,...D3({x:H.x??Z.position.x,y:H.y??Z.position.y},{width:$,height:Q},Z.parentId,q,z)}},V=Bb([I],q,O,D);X.push(...V),K.x=H.x?Math.max(z[0]*$,H.x):void 0,K.y=H.y?Math.max(z[1]*Q,H.y):void 0}if(K.x!==void 0&&K.y!==void 0){const z={id:_,type:"position",position:{...K}};X.push(z)}if(H.width!==void 0&&H.height!==void 0){const $={id:_,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:H.width,height:H.height}};X.push($)}for(const z of F){const $={...z,type:"position"};X.push($)}G(X)},onEnd:({width:H,height:F})=>{const G={id:_,type:"dimensions",resizing:!1,dimensions:{width:H,height:F}};E.getState().triggerNodeChanges([G])}})),B.current.update({controlPosition:P,boundaries:{minWidth:c,minHeight:f,maxWidth:h,maxHeight:g},keepAspectRatio:p,resizeDirection:x,onResizeStart:j,onResize:S,onResizeEnd:k,shouldResize:w}),()=>{var H;(H=B.current)==null||H.destroy()}},[P,c,f,h,g,p,j,S,k,w]);const L=P.split("-");return d.jsx("div",{className:Ht(["react-flow__resize-control","nodrag",...L,n,a]),ref:M,style:{...s,scale:R,...o&&{[T?"backgroundColor":"borderColor"]:o}},children:l})}C.memo(fH);function Fb(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var tm,Hk;function hH(){if(Hk)return tm;Hk=1;function e(){this.__data__=[],this.size=0}return tm=e,tm}var nm,Pk;function Is(){if(Pk)return nm;Pk=1;function e(t,n){return t===n||t!==t&&n!==n}return nm=e,nm}var rm,Fk;function ed(){if(Fk)return rm;Fk=1;var e=Is();function t(n,a){for(var s=n.length;s--;)if(e(n[s][0],a))return s;return-1}return rm=t,rm}var am,Uk;function mH(){if(Uk)return am;Uk=1;var e=ed(),t=Array.prototype,n=t.splice;function a(s){var l=this.__data__,o=e(l,s);if(o<0)return!1;var c=l.length-1;return o==c?l.pop():n.call(l,o,1),--this.size,!0}return am=a,am}var im,$k;function pH(){if($k)return im;$k=1;var e=ed();function t(n){var a=this.__data__,s=e(a,n);return s<0?void 0:a[s][1]}return im=t,im}var sm,Gk;function gH(){if(Gk)return sm;Gk=1;var e=ed();function t(n){return e(this.__data__,n)>-1}return sm=t,sm}var lm,Vk;function xH(){if(Vk)return lm;Vk=1;var e=ed();function t(n,a){var s=this.__data__,l=e(s,n);return l<0?(++this.size,s.push([n,a])):s[l][1]=a,this}return lm=t,lm}var om,Yk;function td(){if(Yk)return om;Yk=1;var e=hH(),t=mH(),n=pH(),a=gH(),s=xH();function l(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var h=o[c];this.set(h[0],h[1])}}return l.prototype.clear=e,l.prototype.delete=t,l.prototype.get=n,l.prototype.has=a,l.prototype.set=s,om=l,om}var um,Xk;function yH(){if(Xk)return um;Xk=1;var e=td();function t(){this.__data__=new e,this.size=0}return um=t,um}var cm,Kk;function bH(){if(Kk)return cm;Kk=1;function e(t){var n=this.__data__,a=n.delete(t);return this.size=n.size,a}return cm=e,cm}var dm,Wk;function vH(){if(Wk)return dm;Wk=1;function e(t){return this.__data__.get(t)}return dm=e,dm}var fm,Qk;function wH(){if(Qk)return fm;Qk=1;function e(t){return this.__data__.has(t)}return fm=e,fm}var hm,Zk;function DT(){if(Zk)return hm;Zk=1;var e=typeof Wu=="object"&&Wu&&Wu.Object===Object&&Wu;return hm=e,hm}var mm,Jk;function rr(){if(Jk)return mm;Jk=1;var e=DT(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return mm=n,mm}var pm,eS;function Bs(){if(eS)return pm;eS=1;var e=rr(),t=e.Symbol;return pm=t,pm}var gm,tS;function jH(){if(tS)return gm;tS=1;var e=Bs(),t=Object.prototype,n=t.hasOwnProperty,a=t.toString,s=e?e.toStringTag:void 0;function l(o){var c=n.call(o,s),f=o[s];try{o[s]=void 0;var h=!0}catch{}var g=a.call(o);return h&&(c?o[s]=f:delete o[s]),g}return gm=l,gm}var xm,nS;function kH(){if(nS)return xm;nS=1;var e=Object.prototype,t=e.toString;function n(a){return t.call(a)}return xm=n,xm}var ym,rS;function ji(){if(rS)return ym;rS=1;var e=Bs(),t=jH(),n=kH(),a="[object Null]",s="[object Undefined]",l=e?e.toStringTag:void 0;function o(c){return c==null?c===void 0?s:a:l&&l in Object(c)?t(c):n(c)}return ym=o,ym}var bm,aS;function Fn(){if(aS)return bm;aS=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return bm=e,bm}var vm,iS;function Ao(){if(iS)return vm;iS=1;var e=ji(),t=Fn(),n="[object AsyncFunction]",a="[object Function]",s="[object GeneratorFunction]",l="[object Proxy]";function o(c){if(!t(c))return!1;var f=e(c);return f==a||f==s||f==n||f==l}return vm=o,vm}var wm,sS;function SH(){if(sS)return wm;sS=1;var e=rr(),t=e["__core-js_shared__"];return wm=t,wm}var jm,lS;function _H(){if(lS)return jm;lS=1;var e=SH(),t=(function(){var a=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})();function n(a){return!!t&&t in a}return jm=n,jm}var km,oS;function OT(){if(oS)return km;oS=1;var e=Function.prototype,t=e.toString;function n(a){if(a!=null){try{return t.call(a)}catch{}try{return a+""}catch{}}return""}return km=n,km}var Sm,uS;function NH(){if(uS)return Sm;uS=1;var e=Ao(),t=_H(),n=Fn(),a=OT(),s=/[\\^$.*+?()[\]{}|]/g,l=/^\[object .+?Constructor\]$/,o=Function.prototype,c=Object.prototype,f=o.toString,h=c.hasOwnProperty,g=RegExp("^"+f.call(h).replace(s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(x){if(!n(x)||t(x))return!1;var y=e(x)?g:l;return y.test(a(x))}return Sm=p,Sm}var _m,cS;function CH(){if(cS)return _m;cS=1;function e(t,n){return t==null?void 0:t[n]}return _m=e,_m}var Nm,dS;function ki(){if(dS)return Nm;dS=1;var e=NH(),t=CH();function n(a,s){var l=t(a,s);return e(l)?l:void 0}return Nm=n,Nm}var Cm,fS;function Ub(){if(fS)return Cm;fS=1;var e=ki(),t=rr(),n=e(t,"Map");return Cm=n,Cm}var Em,hS;function nd(){if(hS)return Em;hS=1;var e=ki(),t=e(Object,"create");return Em=t,Em}var Tm,mS;function EH(){if(mS)return Tm;mS=1;var e=nd();function t(){this.__data__=e?e(null):{},this.size=0}return Tm=t,Tm}var Am,pS;function TH(){if(pS)return Am;pS=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Am=e,Am}var Mm,gS;function AH(){if(gS)return Mm;gS=1;var e=nd(),t="__lodash_hash_undefined__",n=Object.prototype,a=n.hasOwnProperty;function s(l){var o=this.__data__;if(e){var c=o[l];return c===t?void 0:c}return a.call(o,l)?o[l]:void 0}return Mm=s,Mm}var Rm,xS;function MH(){if(xS)return Rm;xS=1;var e=nd(),t=Object.prototype,n=t.hasOwnProperty;function a(s){var l=this.__data__;return e?l[s]!==void 0:n.call(l,s)}return Rm=a,Rm}var Lm,yS;function RH(){if(yS)return Lm;yS=1;var e=nd(),t="__lodash_hash_undefined__";function n(a,s){var l=this.__data__;return this.size+=this.has(a)?0:1,l[a]=e&&s===void 0?t:s,this}return Lm=n,Lm}var Dm,bS;function LH(){if(bS)return Dm;bS=1;var e=EH(),t=TH(),n=AH(),a=MH(),s=RH();function l(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var h=o[c];this.set(h[0],h[1])}}return l.prototype.clear=e,l.prototype.delete=t,l.prototype.get=n,l.prototype.has=a,l.prototype.set=s,Dm=l,Dm}var Om,vS;function DH(){if(vS)return Om;vS=1;var e=LH(),t=td(),n=Ub();function a(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Om=a,Om}var zm,wS;function OH(){if(wS)return zm;wS=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return zm=e,zm}var qm,jS;function rd(){if(jS)return qm;jS=1;var e=OH();function t(n,a){var s=n.__data__;return e(a)?s[typeof a=="string"?"string":"hash"]:s.map}return qm=t,qm}var Im,kS;function zH(){if(kS)return Im;kS=1;var e=rd();function t(n){var a=e(this,n).delete(n);return this.size-=a?1:0,a}return Im=t,Im}var Bm,SS;function qH(){if(SS)return Bm;SS=1;var e=rd();function t(n){return e(this,n).get(n)}return Bm=t,Bm}var Hm,_S;function IH(){if(_S)return Hm;_S=1;var e=rd();function t(n){return e(this,n).has(n)}return Hm=t,Hm}var Pm,NS;function BH(){if(NS)return Pm;NS=1;var e=rd();function t(n,a){var s=e(this,n),l=s.size;return s.set(n,a),this.size+=s.size==l?0:1,this}return Pm=t,Pm}var Fm,CS;function $b(){if(CS)return Fm;CS=1;var e=DH(),t=zH(),n=qH(),a=IH(),s=BH();function l(o){var c=-1,f=o==null?0:o.length;for(this.clear();++c<f;){var h=o[c];this.set(h[0],h[1])}}return l.prototype.clear=e,l.prototype.delete=t,l.prototype.get=n,l.prototype.has=a,l.prototype.set=s,Fm=l,Fm}var Um,ES;function HH(){if(ES)return Um;ES=1;var e=td(),t=Ub(),n=$b(),a=200;function s(l,o){var c=this.__data__;if(c instanceof e){var f=c.__data__;if(!t||f.length<a-1)return f.push([l,o]),this.size=++c.size,this;c=this.__data__=new n(f)}return c.set(l,o),this.size=c.size,this}return Um=s,Um}var $m,TS;function ad(){if(TS)return $m;TS=1;var e=td(),t=yH(),n=bH(),a=vH(),s=wH(),l=HH();function o(c){var f=this.__data__=new e(c);this.size=f.size}return o.prototype.clear=t,o.prototype.delete=n,o.prototype.get=a,o.prototype.has=s,o.prototype.set=l,$m=o,$m}var Gm,AS;function Gb(){if(AS)return Gm;AS=1;function e(t,n){for(var a=-1,s=t==null?0:t.length;++a<s&&n(t[a],a,t)!==!1;);return t}return Gm=e,Gm}var Vm,MS;function zT(){if(MS)return Vm;MS=1;var e=ki(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return Vm=t,Vm}var Ym,RS;function id(){if(RS)return Ym;RS=1;var e=zT();function t(n,a,s){a=="__proto__"&&e?e(n,a,{configurable:!0,enumerable:!0,value:s,writable:!0}):n[a]=s}return Ym=t,Ym}var Xm,LS;function sd(){if(LS)return Xm;LS=1;var e=id(),t=Is(),n=Object.prototype,a=n.hasOwnProperty;function s(l,o,c){var f=l[o];(!(a.call(l,o)&&t(f,c))||c===void 0&&!(o in l))&&e(l,o,c)}return Xm=s,Xm}var Km,DS;function Mo(){if(DS)return Km;DS=1;var e=sd(),t=id();function n(a,s,l,o){var c=!l;l||(l={});for(var f=-1,h=s.length;++f<h;){var g=s[f],p=o?o(l[g],a[g],g,l,a):void 0;p===void 0&&(p=a[g]),c?t(l,g,p):e(l,g,p)}return l}return Km=n,Km}var Wm,OS;function PH(){if(OS)return Wm;OS=1;function e(t,n){for(var a=-1,s=Array(t);++a<t;)s[a]=n(a);return s}return Wm=e,Wm}var Qm,zS;function vr(){if(zS)return Qm;zS=1;function e(t){return t!=null&&typeof t=="object"}return Qm=e,Qm}var Zm,qS;function FH(){if(qS)return Zm;qS=1;var e=ji(),t=vr(),n="[object Arguments]";function a(s){return t(s)&&e(s)==n}return Zm=a,Zm}var Jm,IS;function Ro(){if(IS)return Jm;IS=1;var e=FH(),t=vr(),n=Object.prototype,a=n.hasOwnProperty,s=n.propertyIsEnumerable,l=e((function(){return arguments})())?e:function(o){return t(o)&&a.call(o,"callee")&&!s.call(o,"callee")};return Jm=l,Jm}var ep,BS;function Pt(){if(BS)return ep;BS=1;var e=Array.isArray;return ep=e,ep}var Kl={exports:{}},tp,HS;function UH(){if(HS)return tp;HS=1;function e(){return!1}return tp=e,tp}Kl.exports;var PS;function Hs(){return PS||(PS=1,(function(e,t){var n=rr(),a=UH(),s=t&&!t.nodeType&&t,l=s&&!0&&e&&!e.nodeType&&e,o=l&&l.exports===s,c=o?n.Buffer:void 0,f=c?c.isBuffer:void 0,h=f||a;e.exports=h})(Kl,Kl.exports)),Kl.exports}var np,FS;function ld(){if(FS)return np;FS=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(a,s){var l=typeof a;return s=s??e,!!s&&(l=="number"||l!="symbol"&&t.test(a))&&a>-1&&a%1==0&&a<s}return np=n,np}var rp,US;function Vb(){if(US)return rp;US=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return rp=t,rp}var ap,$S;function $H(){if($S)return ap;$S=1;var e=ji(),t=Vb(),n=vr(),a="[object Arguments]",s="[object Array]",l="[object Boolean]",o="[object Date]",c="[object Error]",f="[object Function]",h="[object Map]",g="[object Number]",p="[object Object]",x="[object RegExp]",y="[object Set]",w="[object String]",j="[object WeakMap]",S="[object ArrayBuffer]",k="[object DataView]",N="[object Float32Array]",_="[object Float64Array]",E="[object Int8Array]",M="[object Int16Array]",T="[object Int32Array]",R="[object Uint8Array]",B="[object Uint8ClampedArray]",P="[object Uint16Array]",L="[object Uint32Array]",H={};H[N]=H[_]=H[E]=H[M]=H[T]=H[R]=H[B]=H[P]=H[L]=!0,H[a]=H[s]=H[S]=H[l]=H[k]=H[o]=H[c]=H[f]=H[h]=H[g]=H[p]=H[x]=H[y]=H[w]=H[j]=!1;function F(G){return n(G)&&t(G.length)&&!!H[e(G)]}return ap=F,ap}var ip,GS;function od(){if(GS)return ip;GS=1;function e(t){return function(n){return t(n)}}return ip=e,ip}var Wl={exports:{}};Wl.exports;var VS;function Yb(){return VS||(VS=1,(function(e,t){var n=DT(),a=t&&!t.nodeType&&t,s=a&&!0&&e&&!e.nodeType&&e,l=s&&s.exports===a,o=l&&n.process,c=(function(){try{var f=s&&s.require&&s.require("util").types;return f||o&&o.binding&&o.binding("util")}catch{}})();e.exports=c})(Wl,Wl.exports)),Wl.exports}var sp,YS;function Lo(){if(YS)return sp;YS=1;var e=$H(),t=od(),n=Yb(),a=n&&n.isTypedArray,s=a?t(a):e;return sp=s,sp}var lp,XS;function qT(){if(XS)return lp;XS=1;var e=PH(),t=Ro(),n=Pt(),a=Hs(),s=ld(),l=Lo(),o=Object.prototype,c=o.hasOwnProperty;function f(h,g){var p=n(h),x=!p&&t(h),y=!p&&!x&&a(h),w=!p&&!x&&!y&&l(h),j=p||x||y||w,S=j?e(h.length,String):[],k=S.length;for(var N in h)(g||c.call(h,N))&&!(j&&(N=="length"||y&&(N=="offset"||N=="parent")||w&&(N=="buffer"||N=="byteLength"||N=="byteOffset")||s(N,k)))&&S.push(N);return S}return lp=f,lp}var op,KS;function ud(){if(KS)return op;KS=1;var e=Object.prototype;function t(n){var a=n&&n.constructor,s=typeof a=="function"&&a.prototype||e;return n===s}return op=t,op}var up,WS;function IT(){if(WS)return up;WS=1;function e(t,n){return function(a){return t(n(a))}}return up=e,up}var cp,QS;function GH(){if(QS)return cp;QS=1;var e=IT(),t=e(Object.keys,Object);return cp=t,cp}var dp,ZS;function Xb(){if(ZS)return dp;ZS=1;var e=ud(),t=GH(),n=Object.prototype,a=n.hasOwnProperty;function s(l){if(!e(l))return t(l);var o=[];for(var c in Object(l))a.call(l,c)&&c!="constructor"&&o.push(c);return o}return dp=s,dp}var fp,JS;function Jr(){if(JS)return fp;JS=1;var e=Ao(),t=Vb();function n(a){return a!=null&&t(a.length)&&!e(a)}return fp=n,fp}var hp,e_;function Ia(){if(e_)return hp;e_=1;var e=qT(),t=Xb(),n=Jr();function a(s){return n(s)?e(s):t(s)}return hp=a,hp}var mp,t_;function VH(){if(t_)return mp;t_=1;var e=Mo(),t=Ia();function n(a,s){return a&&e(s,t(s),a)}return mp=n,mp}var pp,n_;function YH(){if(n_)return pp;n_=1;function e(t){var n=[];if(t!=null)for(var a in Object(t))n.push(a);return n}return pp=e,pp}var gp,r_;function XH(){if(r_)return gp;r_=1;var e=Fn(),t=ud(),n=YH(),a=Object.prototype,s=a.hasOwnProperty;function l(o){if(!e(o))return n(o);var c=t(o),f=[];for(var h in o)h=="constructor"&&(c||!s.call(o,h))||f.push(h);return f}return gp=l,gp}var xp,a_;function Si(){if(a_)return xp;a_=1;var e=qT(),t=XH(),n=Jr();function a(s){return n(s)?e(s,!0):t(s)}return xp=a,xp}var yp,i_;function KH(){if(i_)return yp;i_=1;var e=Mo(),t=Si();function n(a,s){return a&&e(s,t(s),a)}return yp=n,yp}var Ql={exports:{}};Ql.exports;var s_;function BT(){return s_||(s_=1,(function(e,t){var n=rr(),a=t&&!t.nodeType&&t,s=a&&!0&&e&&!e.nodeType&&e,l=s&&s.exports===a,o=l?n.Buffer:void 0,c=o?o.allocUnsafe:void 0;function f(h,g){if(g)return h.slice();var p=h.length,x=c?c(p):new h.constructor(p);return h.copy(x),x}e.exports=f})(Ql,Ql.exports)),Ql.exports}var bp,l_;function HT(){if(l_)return bp;l_=1;function e(t,n){var a=-1,s=t.length;for(n||(n=Array(s));++a<s;)n[a]=t[a];return n}return bp=e,bp}var vp,o_;function PT(){if(o_)return vp;o_=1;function e(t,n){for(var a=-1,s=t==null?0:t.length,l=0,o=[];++a<s;){var c=t[a];n(c,a,t)&&(o[l++]=c)}return o}return vp=e,vp}var wp,u_;function FT(){if(u_)return wp;u_=1;function e(){return[]}return wp=e,wp}var jp,c_;function Kb(){if(c_)return jp;c_=1;var e=PT(),t=FT(),n=Object.prototype,a=n.propertyIsEnumerable,s=Object.getOwnPropertySymbols,l=s?function(o){return o==null?[]:(o=Object(o),e(s(o),function(c){return a.call(o,c)}))}:t;return jp=l,jp}var kp,d_;function WH(){if(d_)return kp;d_=1;var e=Mo(),t=Kb();function n(a,s){return e(a,t(a),s)}return kp=n,kp}var Sp,f_;function Wb(){if(f_)return Sp;f_=1;function e(t,n){for(var a=-1,s=n.length,l=t.length;++a<s;)t[l+a]=n[a];return t}return Sp=e,Sp}var _p,h_;function cd(){if(h_)return _p;h_=1;var e=IT(),t=e(Object.getPrototypeOf,Object);return _p=t,_p}var Np,m_;function UT(){if(m_)return Np;m_=1;var e=Wb(),t=cd(),n=Kb(),a=FT(),s=Object.getOwnPropertySymbols,l=s?function(o){for(var c=[];o;)e(c,n(o)),o=t(o);return c}:a;return Np=l,Np}var Cp,p_;function QH(){if(p_)return Cp;p_=1;var e=Mo(),t=UT();function n(a,s){return e(a,t(a),s)}return Cp=n,Cp}var Ep,g_;function $T(){if(g_)return Ep;g_=1;var e=Wb(),t=Pt();function n(a,s,l){var o=s(a);return t(a)?o:e(o,l(a))}return Ep=n,Ep}var Tp,x_;function GT(){if(x_)return Tp;x_=1;var e=$T(),t=Kb(),n=Ia();function a(s){return e(s,n,t)}return Tp=a,Tp}var Ap,y_;function ZH(){if(y_)return Ap;y_=1;var e=$T(),t=UT(),n=Si();function a(s){return e(s,n,t)}return Ap=a,Ap}var Mp,b_;function JH(){if(b_)return Mp;b_=1;var e=ki(),t=rr(),n=e(t,"DataView");return Mp=n,Mp}var Rp,v_;function eP(){if(v_)return Rp;v_=1;var e=ki(),t=rr(),n=e(t,"Promise");return Rp=n,Rp}var Lp,w_;function VT(){if(w_)return Lp;w_=1;var e=ki(),t=rr(),n=e(t,"Set");return Lp=n,Lp}var Dp,j_;function tP(){if(j_)return Dp;j_=1;var e=ki(),t=rr(),n=e(t,"WeakMap");return Dp=n,Dp}var Op,k_;function Ps(){if(k_)return Op;k_=1;var e=JH(),t=Ub(),n=eP(),a=VT(),s=tP(),l=ji(),o=OT(),c="[object Map]",f="[object Object]",h="[object Promise]",g="[object Set]",p="[object WeakMap]",x="[object DataView]",y=o(e),w=o(t),j=o(n),S=o(a),k=o(s),N=l;return(e&&N(new e(new ArrayBuffer(1)))!=x||t&&N(new t)!=c||n&&N(n.resolve())!=h||a&&N(new a)!=g||s&&N(new s)!=p)&&(N=function(_){var E=l(_),M=E==f?_.constructor:void 0,T=M?o(M):"";if(T)switch(T){case y:return x;case w:return c;case j:return h;case S:return g;case k:return p}return E}),Op=N,Op}var zp,S_;function nP(){if(S_)return zp;S_=1;var e=Object.prototype,t=e.hasOwnProperty;function n(a){var s=a.length,l=new a.constructor(s);return s&&typeof a[0]=="string"&&t.call(a,"index")&&(l.index=a.index,l.input=a.input),l}return zp=n,zp}var qp,__;function YT(){if(__)return qp;__=1;var e=rr(),t=e.Uint8Array;return qp=t,qp}var Ip,N_;function Qb(){if(N_)return Ip;N_=1;var e=YT();function t(n){var a=new n.constructor(n.byteLength);return new e(a).set(new e(n)),a}return Ip=t,Ip}var Bp,C_;function rP(){if(C_)return Bp;C_=1;var e=Qb();function t(n,a){var s=a?e(n.buffer):n.buffer;return new n.constructor(s,n.byteOffset,n.byteLength)}return Bp=t,Bp}var Hp,E_;function aP(){if(E_)return Hp;E_=1;var e=/\w*$/;function t(n){var a=new n.constructor(n.source,e.exec(n));return a.lastIndex=n.lastIndex,a}return Hp=t,Hp}var Pp,T_;function iP(){if(T_)return Pp;T_=1;var e=Bs(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;function a(s){return n?Object(n.call(s)):{}}return Pp=a,Pp}var Fp,A_;function XT(){if(A_)return Fp;A_=1;var e=Qb();function t(n,a){var s=a?e(n.buffer):n.buffer;return new n.constructor(s,n.byteOffset,n.length)}return Fp=t,Fp}var Up,M_;function sP(){if(M_)return Up;M_=1;var e=Qb(),t=rP(),n=aP(),a=iP(),s=XT(),l="[object Boolean]",o="[object Date]",c="[object Map]",f="[object Number]",h="[object RegExp]",g="[object Set]",p="[object String]",x="[object Symbol]",y="[object ArrayBuffer]",w="[object DataView]",j="[object Float32Array]",S="[object Float64Array]",k="[object Int8Array]",N="[object Int16Array]",_="[object Int32Array]",E="[object Uint8Array]",M="[object Uint8ClampedArray]",T="[object Uint16Array]",R="[object Uint32Array]";function B(P,L,H){var F=P.constructor;switch(L){case y:return e(P);case l:case o:return new F(+P);case w:return t(P,H);case j:case S:case k:case N:case _:case E:case M:case T:case R:return s(P,H);case c:return new F;case f:case p:return new F(P);case h:return n(P);case g:return new F;case x:return a(P)}}return Up=B,Up}var $p,R_;function KT(){if(R_)return $p;R_=1;var e=Fn(),t=Object.create,n=(function(){function a(){}return function(s){if(!e(s))return{};if(t)return t(s);a.prototype=s;var l=new a;return a.prototype=void 0,l}})();return $p=n,$p}var Gp,L_;function WT(){if(L_)return Gp;L_=1;var e=KT(),t=cd(),n=ud();function a(s){return typeof s.constructor=="function"&&!n(s)?e(t(s)):{}}return Gp=a,Gp}var Vp,D_;function lP(){if(D_)return Vp;D_=1;var e=Ps(),t=vr(),n="[object Map]";function a(s){return t(s)&&e(s)==n}return Vp=a,Vp}var Yp,O_;function oP(){if(O_)return Yp;O_=1;var e=lP(),t=od(),n=Yb(),a=n&&n.isMap,s=a?t(a):e;return Yp=s,Yp}var Xp,z_;function uP(){if(z_)return Xp;z_=1;var e=Ps(),t=vr(),n="[object Set]";function a(s){return t(s)&&e(s)==n}return Xp=a,Xp}var Kp,q_;function cP(){if(q_)return Kp;q_=1;var e=uP(),t=od(),n=Yb(),a=n&&n.isSet,s=a?t(a):e;return Kp=s,Kp}var Wp,I_;function QT(){if(I_)return Wp;I_=1;var e=ad(),t=Gb(),n=sd(),a=VH(),s=KH(),l=BT(),o=HT(),c=WH(),f=QH(),h=GT(),g=ZH(),p=Ps(),x=nP(),y=sP(),w=WT(),j=Pt(),S=Hs(),k=oP(),N=Fn(),_=cP(),E=Ia(),M=Si(),T=1,R=2,B=4,P="[object Arguments]",L="[object Array]",H="[object Boolean]",F="[object Date]",G="[object Error]",q="[object Function]",O="[object GeneratorFunction]",D="[object Map]",X="[object Number]",K="[object Object]",Z="[object RegExp]",z="[object Set]",$="[object String]",Q="[object Symbol]",I="[object WeakMap]",V="[object ArrayBuffer]",te="[object DataView]",ne="[object Float32Array]",W="[object Float64Array]",Y="[object Int8Array]",ae="[object Int16Array]",he="[object Int32Array]",ke="[object Uint8Array]",_e="[object Uint8ClampedArray]",oe="[object Uint16Array]",je="[object Uint32Array]",Se={};Se[P]=Se[L]=Se[V]=Se[te]=Se[H]=Se[F]=Se[ne]=Se[W]=Se[Y]=Se[ae]=Se[he]=Se[D]=Se[X]=Se[K]=Se[Z]=Se[z]=Se[$]=Se[Q]=Se[ke]=Se[_e]=Se[oe]=Se[je]=!0,Se[G]=Se[q]=Se[I]=!1;function Ae(se,Ee,Te,Me,we,De){var Be,ie=Ee&T,xe=Ee&R,J=Ee&B;if(Te&&(Be=we?Te(se,Me,we,De):Te(se)),Be!==void 0)return Be;if(!N(se))return se;var fe=j(se);if(fe){if(Be=x(se),!ie)return o(se,Be)}else{var be=p(se),Ne=be==q||be==O;if(S(se))return l(se,ie);if(be==K||be==P||Ne&&!we){if(Be=xe||Ne?{}:w(se),!ie)return xe?f(se,s(Be,se)):c(se,a(Be,se))}else{if(!Se[be])return we?se:{};Be=y(se,be,ie)}}De||(De=new e);var Oe=De.get(se);if(Oe)return Oe;De.set(se,Be),_(se)?se.forEach(function(tt){Be.add(Ae(tt,Ee,Te,tt,se,De))}):k(se)&&se.forEach(function(tt,st){Be.set(st,Ae(tt,Ee,Te,st,se,De))});var ht=J?xe?g:h:xe?M:E,yt=fe?void 0:ht(se);return t(yt||se,function(tt,st){yt&&(st=tt,tt=se[st]),n(Be,st,Ae(tt,Ee,Te,st,se,De))}),Be}return Wp=Ae,Wp}var Qp,B_;function dP(){if(B_)return Qp;B_=1;var e=QT(),t=4;function n(a){return e(a,t)}return Qp=n,Qp}var Zp,H_;function Zb(){if(H_)return Zp;H_=1;function e(t){return function(){return t}}return Zp=e,Zp}var Jp,P_;function fP(){if(P_)return Jp;P_=1;function e(t){return function(n,a,s){for(var l=-1,o=Object(n),c=s(n),f=c.length;f--;){var h=c[t?f:++l];if(a(o[h],h,o)===!1)break}return n}}return Jp=e,Jp}var eg,F_;function Jb(){if(F_)return eg;F_=1;var e=fP(),t=e();return eg=t,eg}var tg,U_;function ev(){if(U_)return tg;U_=1;var e=Jb(),t=Ia();function n(a,s){return a&&e(a,s,t)}return tg=n,tg}var ng,$_;function hP(){if($_)return ng;$_=1;var e=Jr();function t(n,a){return function(s,l){if(s==null)return s;if(!e(s))return n(s,l);for(var o=s.length,c=a?o:-1,f=Object(s);(a?c--:++c<o)&&l(f[c],c,f)!==!1;);return s}}return ng=t,ng}var rg,G_;function dd(){if(G_)return rg;G_=1;var e=ev(),t=hP(),n=t(e);return rg=n,rg}var ag,V_;function _i(){if(V_)return ag;V_=1;function e(t){return t}return ag=e,ag}var ig,Y_;function ZT(){if(Y_)return ig;Y_=1;var e=_i();function t(n){return typeof n=="function"?n:e}return ig=t,ig}var sg,X_;function JT(){if(X_)return sg;X_=1;var e=Gb(),t=dd(),n=ZT(),a=Pt();function s(l,o){var c=a(l)?e:t;return c(l,n(o))}return sg=s,sg}var lg,K_;function eA(){return K_||(K_=1,lg=JT()),lg}var og,W_;function mP(){if(W_)return og;W_=1;var e=dd();function t(n,a){var s=[];return e(n,function(l,o,c){a(l,o,c)&&s.push(l)}),s}return og=t,og}var ug,Q_;function pP(){if(Q_)return ug;Q_=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return ug=t,ug}var cg,Z_;function gP(){if(Z_)return cg;Z_=1;function e(t){return this.__data__.has(t)}return cg=e,cg}var dg,J_;function tA(){if(J_)return dg;J_=1;var e=$b(),t=pP(),n=gP();function a(s){var l=-1,o=s==null?0:s.length;for(this.__data__=new e;++l<o;)this.add(s[l])}return a.prototype.add=a.prototype.push=t,a.prototype.has=n,dg=a,dg}var fg,e5;function xP(){if(e5)return fg;e5=1;function e(t,n){for(var a=-1,s=t==null?0:t.length;++a<s;)if(n(t[a],a,t))return!0;return!1}return fg=e,fg}var hg,t5;function nA(){if(t5)return hg;t5=1;function e(t,n){return t.has(n)}return hg=e,hg}var mg,n5;function rA(){if(n5)return mg;n5=1;var e=tA(),t=xP(),n=nA(),a=1,s=2;function l(o,c,f,h,g,p){var x=f&a,y=o.length,w=c.length;if(y!=w&&!(x&&w>y))return!1;var j=p.get(o),S=p.get(c);if(j&&S)return j==c&&S==o;var k=-1,N=!0,_=f&s?new e:void 0;for(p.set(o,c),p.set(c,o);++k<y;){var E=o[k],M=c[k];if(h)var T=x?h(M,E,k,c,o,p):h(E,M,k,o,c,p);if(T!==void 0){if(T)continue;N=!1;break}if(_){if(!t(c,function(R,B){if(!n(_,B)&&(E===R||g(E,R,f,h,p)))return _.push(B)})){N=!1;break}}else if(!(E===M||g(E,M,f,h,p))){N=!1;break}}return p.delete(o),p.delete(c),N}return mg=l,mg}var pg,r5;function yP(){if(r5)return pg;r5=1;function e(t){var n=-1,a=Array(t.size);return t.forEach(function(s,l){a[++n]=[l,s]}),a}return pg=e,pg}var gg,a5;function tv(){if(a5)return gg;a5=1;function e(t){var n=-1,a=Array(t.size);return t.forEach(function(s){a[++n]=s}),a}return gg=e,gg}var xg,i5;function bP(){if(i5)return xg;i5=1;var e=Bs(),t=YT(),n=Is(),a=rA(),s=yP(),l=tv(),o=1,c=2,f="[object Boolean]",h="[object Date]",g="[object Error]",p="[object Map]",x="[object Number]",y="[object RegExp]",w="[object Set]",j="[object String]",S="[object Symbol]",k="[object ArrayBuffer]",N="[object DataView]",_=e?e.prototype:void 0,E=_?_.valueOf:void 0;function M(T,R,B,P,L,H,F){switch(B){case N:if(T.byteLength!=R.byteLength||T.byteOffset!=R.byteOffset)return!1;T=T.buffer,R=R.buffer;case k:return!(T.byteLength!=R.byteLength||!H(new t(T),new t(R)));case f:case h:case x:return n(+T,+R);case g:return T.name==R.name&&T.message==R.message;case y:case j:return T==R+"";case p:var G=s;case w:var q=P&o;if(G||(G=l),T.size!=R.size&&!q)return!1;var O=F.get(T);if(O)return O==R;P|=c,F.set(T,R);var D=a(G(T),G(R),P,L,H,F);return F.delete(T),D;case S:if(E)return E.call(T)==E.call(R)}return!1}return xg=M,xg}var yg,s5;function vP(){if(s5)return yg;s5=1;var e=GT(),t=1,n=Object.prototype,a=n.hasOwnProperty;function s(l,o,c,f,h,g){var p=c&t,x=e(l),y=x.length,w=e(o),j=w.length;if(y!=j&&!p)return!1;for(var S=y;S--;){var k=x[S];if(!(p?k in o:a.call(o,k)))return!1}var N=g.get(l),_=g.get(o);if(N&&_)return N==o&&_==l;var E=!0;g.set(l,o),g.set(o,l);for(var M=p;++S<y;){k=x[S];var T=l[k],R=o[k];if(f)var B=p?f(R,T,k,o,l,g):f(T,R,k,l,o,g);if(!(B===void 0?T===R||h(T,R,c,f,g):B)){E=!1;break}M||(M=k=="constructor")}if(E&&!M){var P=l.constructor,L=o.constructor;P!=L&&"constructor"in l&&"constructor"in o&&!(typeof P=="function"&&P instanceof P&&typeof L=="function"&&L instanceof L)&&(E=!1)}return g.delete(l),g.delete(o),E}return yg=s,yg}var bg,l5;function wP(){if(l5)return bg;l5=1;var e=ad(),t=rA(),n=bP(),a=vP(),s=Ps(),l=Pt(),o=Hs(),c=Lo(),f=1,h="[object Arguments]",g="[object Array]",p="[object Object]",x=Object.prototype,y=x.hasOwnProperty;function w(j,S,k,N,_,E){var M=l(j),T=l(S),R=M?g:s(j),B=T?g:s(S);R=R==h?p:R,B=B==h?p:B;var P=R==p,L=B==p,H=R==B;if(H&&o(j)){if(!o(S))return!1;M=!0,P=!1}if(H&&!P)return E||(E=new e),M||c(j)?t(j,S,k,N,_,E):n(j,S,R,k,N,_,E);if(!(k&f)){var F=P&&y.call(j,"__wrapped__"),G=L&&y.call(S,"__wrapped__");if(F||G){var q=F?j.value():j,O=G?S.value():S;return E||(E=new e),_(q,O,k,N,E)}}return H?(E||(E=new e),a(j,S,k,N,_,E)):!1}return bg=w,bg}var vg,o5;function aA(){if(o5)return vg;o5=1;var e=wP(),t=vr();function n(a,s,l,o,c){return a===s?!0:a==null||s==null||!t(a)&&!t(s)?a!==a&&s!==s:e(a,s,l,o,n,c)}return vg=n,vg}var wg,u5;function jP(){if(u5)return wg;u5=1;var e=ad(),t=aA(),n=1,a=2;function s(l,o,c,f){var h=c.length,g=h,p=!f;if(l==null)return!g;for(l=Object(l);h--;){var x=c[h];if(p&&x[2]?x[1]!==l[x[0]]:!(x[0]in l))return!1}for(;++h<g;){x=c[h];var y=x[0],w=l[y],j=x[1];if(p&&x[2]){if(w===void 0&&!(y in l))return!1}else{var S=new e;if(f)var k=f(w,j,y,l,o,S);if(!(k===void 0?t(j,w,n|a,f,S):k))return!1}}return!0}return wg=s,wg}var jg,c5;function iA(){if(c5)return jg;c5=1;var e=Fn();function t(n){return n===n&&!e(n)}return jg=t,jg}var kg,d5;function kP(){if(d5)return kg;d5=1;var e=iA(),t=Ia();function n(a){for(var s=t(a),l=s.length;l--;){var o=s[l],c=a[o];s[l]=[o,c,e(c)]}return s}return kg=n,kg}var Sg,f5;function sA(){if(f5)return Sg;f5=1;function e(t,n){return function(a){return a==null?!1:a[t]===n&&(n!==void 0||t in Object(a))}}return Sg=e,Sg}var _g,h5;function SP(){if(h5)return _g;h5=1;var e=jP(),t=kP(),n=sA();function a(s){var l=t(s);return l.length==1&&l[0][2]?n(l[0][0],l[0][1]):function(o){return o===s||e(o,s,l)}}return _g=a,_g}var Ng,m5;function Fs(){if(m5)return Ng;m5=1;var e=ji(),t=vr(),n="[object Symbol]";function a(s){return typeof s=="symbol"||t(s)&&e(s)==n}return Ng=a,Ng}var Cg,p5;function nv(){if(p5)return Cg;p5=1;var e=Pt(),t=Fs(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function s(l,o){if(e(l))return!1;var c=typeof l;return c=="number"||c=="symbol"||c=="boolean"||l==null||t(l)?!0:a.test(l)||!n.test(l)||o!=null&&l in Object(o)}return Cg=s,Cg}var Eg,g5;function _P(){if(g5)return Eg;g5=1;var e=$b(),t="Expected a function";function n(a,s){if(typeof a!="function"||s!=null&&typeof s!="function")throw new TypeError(t);var l=function(){var o=arguments,c=s?s.apply(this,o):o[0],f=l.cache;if(f.has(c))return f.get(c);var h=a.apply(this,o);return l.cache=f.set(c,h)||f,h};return l.cache=new(n.Cache||e),l}return n.Cache=e,Eg=n,Eg}var Tg,x5;function NP(){if(x5)return Tg;x5=1;var e=_P(),t=500;function n(a){var s=e(a,function(o){return l.size===t&&l.clear(),o}),l=s.cache;return s}return Tg=n,Tg}var Ag,y5;function CP(){if(y5)return Ag;y5=1;var e=NP(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,a=e(function(s){var l=[];return s.charCodeAt(0)===46&&l.push(""),s.replace(t,function(o,c,f,h){l.push(f?h.replace(n,"$1"):c||o)}),l});return Ag=a,Ag}var Mg,b5;function fd(){if(b5)return Mg;b5=1;function e(t,n){for(var a=-1,s=t==null?0:t.length,l=Array(s);++a<s;)l[a]=n(t[a],a,t);return l}return Mg=e,Mg}var Rg,v5;function EP(){if(v5)return Rg;v5=1;var e=Bs(),t=fd(),n=Pt(),a=Fs(),s=e?e.prototype:void 0,l=s?s.toString:void 0;function o(c){if(typeof c=="string")return c;if(n(c))return t(c,o)+"";if(a(c))return l?l.call(c):"";var f=c+"";return f=="0"&&1/c==-1/0?"-0":f}return Rg=o,Rg}var Lg,w5;function lA(){if(w5)return Lg;w5=1;var e=EP();function t(n){return n==null?"":e(n)}return Lg=t,Lg}var Dg,j5;function hd(){if(j5)return Dg;j5=1;var e=Pt(),t=nv(),n=CP(),a=lA();function s(l,o){return e(l)?l:t(l,o)?[l]:n(a(l))}return Dg=s,Dg}var Og,k5;function Do(){if(k5)return Og;k5=1;var e=Fs();function t(n){if(typeof n=="string"||e(n))return n;var a=n+"";return a=="0"&&1/n==-1/0?"-0":a}return Og=t,Og}var zg,S5;function md(){if(S5)return zg;S5=1;var e=hd(),t=Do();function n(a,s){s=e(s,a);for(var l=0,o=s.length;a!=null&&l<o;)a=a[t(s[l++])];return l&&l==o?a:void 0}return zg=n,zg}var qg,_5;function TP(){if(_5)return qg;_5=1;var e=md();function t(n,a,s){var l=n==null?void 0:e(n,a);return l===void 0?s:l}return qg=t,qg}var Ig,N5;function AP(){if(N5)return Ig;N5=1;function e(t,n){return t!=null&&n in Object(t)}return Ig=e,Ig}var Bg,C5;function oA(){if(C5)return Bg;C5=1;var e=hd(),t=Ro(),n=Pt(),a=ld(),s=Vb(),l=Do();function o(c,f,h){f=e(f,c);for(var g=-1,p=f.length,x=!1;++g<p;){var y=l(f[g]);if(!(x=c!=null&&h(c,y)))break;c=c[y]}return x||++g!=p?x:(p=c==null?0:c.length,!!p&&s(p)&&a(y,p)&&(n(c)||t(c)))}return Bg=o,Bg}var Hg,E5;function uA(){if(E5)return Hg;E5=1;var e=AP(),t=oA();function n(a,s){return a!=null&&t(a,s,e)}return Hg=n,Hg}var Pg,T5;function MP(){if(T5)return Pg;T5=1;var e=aA(),t=TP(),n=uA(),a=nv(),s=iA(),l=sA(),o=Do(),c=1,f=2;function h(g,p){return a(g)&&s(p)?l(o(g),p):function(x){var y=t(x,g);return y===void 0&&y===p?n(x,g):e(p,y,c|f)}}return Pg=h,Pg}var Fg,A5;function cA(){if(A5)return Fg;A5=1;function e(t){return function(n){return n==null?void 0:n[t]}}return Fg=e,Fg}var Ug,M5;function RP(){if(M5)return Ug;M5=1;var e=md();function t(n){return function(a){return e(a,n)}}return Ug=t,Ug}var $g,R5;function LP(){if(R5)return $g;R5=1;var e=cA(),t=RP(),n=nv(),a=Do();function s(l){return n(l)?e(a(l)):t(l)}return $g=s,$g}var Gg,L5;function ea(){if(L5)return Gg;L5=1;var e=SP(),t=MP(),n=_i(),a=Pt(),s=LP();function l(o){return typeof o=="function"?o:o==null?n:typeof o=="object"?a(o)?t(o[0],o[1]):e(o):s(o)}return Gg=l,Gg}var Vg,D5;function dA(){if(D5)return Vg;D5=1;var e=PT(),t=mP(),n=ea(),a=Pt();function s(l,o){var c=a(l)?e:t;return c(l,n(o,3))}return Vg=s,Vg}var Yg,O5;function DP(){if(O5)return Yg;O5=1;var e=Object.prototype,t=e.hasOwnProperty;function n(a,s){return a!=null&&t.call(a,s)}return Yg=n,Yg}var Xg,z5;function fA(){if(z5)return Xg;z5=1;var e=DP(),t=oA();function n(a,s){return a!=null&&t(a,s,e)}return Xg=n,Xg}var Kg,q5;function OP(){if(q5)return Kg;q5=1;var e=Xb(),t=Ps(),n=Ro(),a=Pt(),s=Jr(),l=Hs(),o=ud(),c=Lo(),f="[object Map]",h="[object Set]",g=Object.prototype,p=g.hasOwnProperty;function x(y){if(y==null)return!0;if(s(y)&&(a(y)||typeof y=="string"||typeof y.splice=="function"||l(y)||c(y)||n(y)))return!y.length;var w=t(y);if(w==f||w==h)return!y.size;if(o(y))return!e(y).length;for(var j in y)if(p.call(y,j))return!1;return!0}return Kg=x,Kg}var Wg,I5;function hA(){if(I5)return Wg;I5=1;function e(t){return t===void 0}return Wg=e,Wg}var Qg,B5;function mA(){if(B5)return Qg;B5=1;var e=dd(),t=Jr();function n(a,s){var l=-1,o=t(a)?Array(a.length):[];return e(a,function(c,f,h){o[++l]=s(c,f,h)}),o}return Qg=n,Qg}var Zg,H5;function pA(){if(H5)return Zg;H5=1;var e=fd(),t=ea(),n=mA(),a=Pt();function s(l,o){var c=a(l)?e:n;return c(l,t(o,3))}return Zg=s,Zg}var Jg,P5;function zP(){if(P5)return Jg;P5=1;function e(t,n,a,s){var l=-1,o=t==null?0:t.length;for(s&&o&&(a=t[++l]);++l<o;)a=n(a,t[l],l,t);return a}return Jg=e,Jg}var ex,F5;function qP(){if(F5)return ex;F5=1;function e(t,n,a,s,l){return l(t,function(o,c,f){a=s?(s=!1,o):n(a,o,c,f)}),a}return ex=e,ex}var tx,U5;function gA(){if(U5)return tx;U5=1;var e=zP(),t=dd(),n=ea(),a=qP(),s=Pt();function l(o,c,f){var h=s(o)?e:a,g=arguments.length<3;return h(o,n(c,4),f,g,t)}return tx=l,tx}var nx,$5;function IP(){if($5)return nx;$5=1;var e=ji(),t=Pt(),n=vr(),a="[object String]";function s(l){return typeof l=="string"||!t(l)&&n(l)&&e(l)==a}return nx=s,nx}var rx,G5;function BP(){if(G5)return rx;G5=1;var e=cA(),t=e("length");return rx=t,rx}var ax,V5;function HP(){if(V5)return ax;V5=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",a="\\u20d0-\\u20ff",s=t+n+a,l="\\ufe0e\\ufe0f",o="\\u200d",c=RegExp("["+o+e+s+l+"]");function f(h){return c.test(h)}return ax=f,ax}var ix,Y5;function PP(){if(Y5)return ix;Y5=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",a="\\u20d0-\\u20ff",s=t+n+a,l="\\ufe0e\\ufe0f",o="["+e+"]",c="["+s+"]",f="\\ud83c[\\udffb-\\udfff]",h="(?:"+c+"|"+f+")",g="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",x="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",w=h+"?",j="["+l+"]?",S="(?:"+y+"(?:"+[g,p,x].join("|")+")"+j+w+")*",k=j+w+S,N="(?:"+[g+c+"?",c,p,x,o].join("|")+")",_=RegExp(f+"(?="+f+")|"+N+k,"g");function E(M){for(var T=_.lastIndex=0;_.test(M);)++T;return T}return ix=E,ix}var sx,X5;function FP(){if(X5)return sx;X5=1;var e=BP(),t=HP(),n=PP();function a(s){return t(s)?n(s):e(s)}return sx=a,sx}var lx,K5;function UP(){if(K5)return lx;K5=1;var e=Xb(),t=Ps(),n=Jr(),a=IP(),s=FP(),l="[object Map]",o="[object Set]";function c(f){if(f==null)return 0;if(n(f))return a(f)?s(f):f.length;var h=t(f);return h==l||h==o?f.size:e(f).length}return lx=c,lx}var ox,W5;function $P(){if(W5)return ox;W5=1;var e=Gb(),t=KT(),n=ev(),a=ea(),s=cd(),l=Pt(),o=Hs(),c=Ao(),f=Fn(),h=Lo();function g(p,x,y){var w=l(p),j=w||o(p)||h(p);if(x=a(x,4),y==null){var S=p&&p.constructor;j?y=w?new S:[]:f(p)?y=c(S)?t(s(p)):{}:y={}}return(j?e:n)(p,function(k,N,_){return x(y,k,N,_)}),y}return ox=g,ox}var ux,Q5;function GP(){if(Q5)return ux;Q5=1;var e=Bs(),t=Ro(),n=Pt(),a=e?e.isConcatSpreadable:void 0;function s(l){return n(l)||t(l)||!!(a&&l&&l[a])}return ux=s,ux}var cx,Z5;function rv(){if(Z5)return cx;Z5=1;var e=Wb(),t=GP();function n(a,s,l,o,c){var f=-1,h=a.length;for(l||(l=t),c||(c=[]);++f<h;){var g=a[f];s>0&&l(g)?s>1?n(g,s-1,l,o,c):e(c,g):o||(c[c.length]=g)}return c}return cx=n,cx}var dx,J5;function VP(){if(J5)return dx;J5=1;function e(t,n,a){switch(a.length){case 0:return t.call(n);case 1:return t.call(n,a[0]);case 2:return t.call(n,a[0],a[1]);case 3:return t.call(n,a[0],a[1],a[2])}return t.apply(n,a)}return dx=e,dx}var fx,eN;function xA(){if(eN)return fx;eN=1;var e=VP(),t=Math.max;function n(a,s,l){return s=t(s===void 0?a.length-1:s,0),function(){for(var o=arguments,c=-1,f=t(o.length-s,0),h=Array(f);++c<f;)h[c]=o[s+c];c=-1;for(var g=Array(s+1);++c<s;)g[c]=o[c];return g[s]=l(h),e(a,this,g)}}return fx=n,fx}var hx,tN;function YP(){if(tN)return hx;tN=1;var e=Zb(),t=zT(),n=_i(),a=t?function(s,l){return t(s,"toString",{configurable:!0,enumerable:!1,value:e(l),writable:!0})}:n;return hx=a,hx}var mx,nN;function XP(){if(nN)return mx;nN=1;var e=800,t=16,n=Date.now;function a(s){var l=0,o=0;return function(){var c=n(),f=t-(c-o);if(o=c,f>0){if(++l>=e)return arguments[0]}else l=0;return s.apply(void 0,arguments)}}return mx=a,mx}var px,rN;function yA(){if(rN)return px;rN=1;var e=YP(),t=XP(),n=t(e);return px=n,px}var gx,aN;function pd(){if(aN)return gx;aN=1;var e=_i(),t=xA(),n=yA();function a(s,l){return n(t(s,l,e),s+"")}return gx=a,gx}var xx,iN;function bA(){if(iN)return xx;iN=1;function e(t,n,a,s){for(var l=t.length,o=a+(s?1:-1);s?o--:++o<l;)if(n(t[o],o,t))return o;return-1}return xx=e,xx}var yx,sN;function KP(){if(sN)return yx;sN=1;function e(t){return t!==t}return yx=e,yx}var bx,lN;function WP(){if(lN)return bx;lN=1;function e(t,n,a){for(var s=a-1,l=t.length;++s<l;)if(t[s]===n)return s;return-1}return bx=e,bx}var vx,oN;function QP(){if(oN)return vx;oN=1;var e=bA(),t=KP(),n=WP();function a(s,l,o){return l===l?n(s,l,o):e(s,t,o)}return vx=a,vx}var wx,uN;function ZP(){if(uN)return wx;uN=1;var e=QP();function t(n,a){var s=n==null?0:n.length;return!!s&&e(n,a,0)>-1}return wx=t,wx}var jx,cN;function JP(){if(cN)return jx;cN=1;function e(t,n,a){for(var s=-1,l=t==null?0:t.length;++s<l;)if(a(n,t[s]))return!0;return!1}return jx=e,jx}var kx,dN;function eF(){if(dN)return kx;dN=1;function e(){}return kx=e,kx}var Sx,fN;function tF(){if(fN)return Sx;fN=1;var e=VT(),t=eF(),n=tv(),a=1/0,s=e&&1/n(new e([,-0]))[1]==a?function(l){return new e(l)}:t;return Sx=s,Sx}var _x,hN;function nF(){if(hN)return _x;hN=1;var e=tA(),t=ZP(),n=JP(),a=nA(),s=tF(),l=tv(),o=200;function c(f,h,g){var p=-1,x=t,y=f.length,w=!0,j=[],S=j;if(g)w=!1,x=n;else if(y>=o){var k=h?null:s(f);if(k)return l(k);w=!1,x=a,S=new e}else S=h?[]:j;e:for(;++p<y;){var N=f[p],_=h?h(N):N;if(N=g||N!==0?N:0,w&&_===_){for(var E=S.length;E--;)if(S[E]===_)continue e;h&&S.push(_),j.push(N)}else x(S,_,g)||(S!==j&&S.push(_),j.push(N))}return j}return _x=c,_x}var Nx,mN;function vA(){if(mN)return Nx;mN=1;var e=Jr(),t=vr();function n(a){return t(a)&&e(a)}return Nx=n,Nx}var Cx,pN;function rF(){if(pN)return Cx;pN=1;var e=rv(),t=pd(),n=nF(),a=vA(),s=t(function(l){return n(e(l,1,a,!0))});return Cx=s,Cx}var Ex,gN;function aF(){if(gN)return Ex;gN=1;var e=fd();function t(n,a){return e(a,function(s){return n[s]})}return Ex=t,Ex}var Tx,xN;function wA(){if(xN)return Tx;xN=1;var e=aF(),t=Ia();function n(a){return a==null?[]:e(a,t(a))}return Tx=n,Tx}var Ax,yN;function Un(){if(yN)return Ax;yN=1;var e;if(typeof Fb=="function")try{e={clone:dP(),constant:Zb(),each:eA(),filter:dA(),has:fA(),isArray:Pt(),isEmpty:OP(),isFunction:Ao(),isUndefined:hA(),keys:Ia(),map:pA(),reduce:gA(),size:UP(),transform:$P(),union:rF(),values:wA()}}catch{}return e||(e=window._),Ax=e,Ax}var Mx,bN;function av(){if(bN)return Mx;bN=1;var e=Un();Mx=s;var t="\0",n="\0",a="";function s(g){this._isDirected=e.has(g,"directed")?g.directed:!0,this._isMultigraph=e.has(g,"multigraph")?g.multigraph:!1,this._isCompound=e.has(g,"compound")?g.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[n]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}s.prototype._nodeCount=0,s.prototype._edgeCount=0,s.prototype.isDirected=function(){return this._isDirected},s.prototype.isMultigraph=function(){return this._isMultigraph},s.prototype.isCompound=function(){return this._isCompound},s.prototype.setGraph=function(g){return this._label=g,this},s.prototype.graph=function(){return this._label},s.prototype.setDefaultNodeLabel=function(g){return e.isFunction(g)||(g=e.constant(g)),this._defaultNodeLabelFn=g,this},s.prototype.nodeCount=function(){return this._nodeCount},s.prototype.nodes=function(){return e.keys(this._nodes)},s.prototype.sources=function(){var g=this;return e.filter(this.nodes(),function(p){return e.isEmpty(g._in[p])})},s.prototype.sinks=function(){var g=this;return e.filter(this.nodes(),function(p){return e.isEmpty(g._out[p])})},s.prototype.setNodes=function(g,p){var x=arguments,y=this;return e.each(g,function(w){x.length>1?y.setNode(w,p):y.setNode(w)}),this},s.prototype.setNode=function(g,p){return e.has(this._nodes,g)?(arguments.length>1&&(this._nodes[g]=p),this):(this._nodes[g]=arguments.length>1?p:this._defaultNodeLabelFn(g),this._isCompound&&(this._parent[g]=n,this._children[g]={},this._children[n][g]=!0),this._in[g]={},this._preds[g]={},this._out[g]={},this._sucs[g]={},++this._nodeCount,this)},s.prototype.node=function(g){return this._nodes[g]},s.prototype.hasNode=function(g){return e.has(this._nodes,g)},s.prototype.removeNode=function(g){var p=this;if(e.has(this._nodes,g)){var x=function(y){p.removeEdge(p._edgeObjs[y])};delete this._nodes[g],this._isCompound&&(this._removeFromParentsChildList(g),delete this._parent[g],e.each(this.children(g),function(y){p.setParent(y)}),delete this._children[g]),e.each(e.keys(this._in[g]),x),delete this._in[g],delete this._preds[g],e.each(e.keys(this._out[g]),x),delete this._out[g],delete this._sucs[g],--this._nodeCount}return this},s.prototype.setParent=function(g,p){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(p))p=n;else{p+="";for(var x=p;!e.isUndefined(x);x=this.parent(x))if(x===g)throw new Error("Setting "+p+" as parent of "+g+" would create a cycle");this.setNode(p)}return this.setNode(g),this._removeFromParentsChildList(g),this._parent[g]=p,this._children[p][g]=!0,this},s.prototype._removeFromParentsChildList=function(g){delete this._children[this._parent[g]][g]},s.prototype.parent=function(g){if(this._isCompound){var p=this._parent[g];if(p!==n)return p}},s.prototype.children=function(g){if(e.isUndefined(g)&&(g=n),this._isCompound){var p=this._children[g];if(p)return e.keys(p)}else{if(g===n)return this.nodes();if(this.hasNode(g))return[]}},s.prototype.predecessors=function(g){var p=this._preds[g];if(p)return e.keys(p)},s.prototype.successors=function(g){var p=this._sucs[g];if(p)return e.keys(p)},s.prototype.neighbors=function(g){var p=this.predecessors(g);if(p)return e.union(p,this.successors(g))},s.prototype.isLeaf=function(g){var p;return this.isDirected()?p=this.successors(g):p=this.neighbors(g),p.length===0},s.prototype.filterNodes=function(g){var p=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});p.setGraph(this.graph());var x=this;e.each(this._nodes,function(j,S){g(S)&&p.setNode(S,j)}),e.each(this._edgeObjs,function(j){p.hasNode(j.v)&&p.hasNode(j.w)&&p.setEdge(j,x.edge(j))});var y={};function w(j){var S=x.parent(j);return S===void 0||p.hasNode(S)?(y[j]=S,S):S in y?y[S]:w(S)}return this._isCompound&&e.each(p.nodes(),function(j){p.setParent(j,w(j))}),p},s.prototype.setDefaultEdgeLabel=function(g){return e.isFunction(g)||(g=e.constant(g)),this._defaultEdgeLabelFn=g,this},s.prototype.edgeCount=function(){return this._edgeCount},s.prototype.edges=function(){return e.values(this._edgeObjs)},s.prototype.setPath=function(g,p){var x=this,y=arguments;return e.reduce(g,function(w,j){return y.length>1?x.setEdge(w,j,p):x.setEdge(w,j),j}),this},s.prototype.setEdge=function(){var g,p,x,y,w=!1,j=arguments[0];typeof j=="object"&&j!==null&&"v"in j?(g=j.v,p=j.w,x=j.name,arguments.length===2&&(y=arguments[1],w=!0)):(g=j,p=arguments[1],x=arguments[3],arguments.length>2&&(y=arguments[2],w=!0)),g=""+g,p=""+p,e.isUndefined(x)||(x=""+x);var S=c(this._isDirected,g,p,x);if(e.has(this._edgeLabels,S))return w&&(this._edgeLabels[S]=y),this;if(!e.isUndefined(x)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(g),this.setNode(p),this._edgeLabels[S]=w?y:this._defaultEdgeLabelFn(g,p,x);var k=f(this._isDirected,g,p,x);return g=k.v,p=k.w,Object.freeze(k),this._edgeObjs[S]=k,l(this._preds[p],g),l(this._sucs[g],p),this._in[p][S]=k,this._out[g][S]=k,this._edgeCount++,this},s.prototype.edge=function(g,p,x){var y=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,g,p,x);return this._edgeLabels[y]},s.prototype.hasEdge=function(g,p,x){var y=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,g,p,x);return e.has(this._edgeLabels,y)},s.prototype.removeEdge=function(g,p,x){var y=arguments.length===1?h(this._isDirected,arguments[0]):c(this._isDirected,g,p,x),w=this._edgeObjs[y];return w&&(g=w.v,p=w.w,delete this._edgeLabels[y],delete this._edgeObjs[y],o(this._preds[p],g),o(this._sucs[g],p),delete this._in[p][y],delete this._out[g][y],this._edgeCount--),this},s.prototype.inEdges=function(g,p){var x=this._in[g];if(x){var y=e.values(x);return p?e.filter(y,function(w){return w.v===p}):y}},s.prototype.outEdges=function(g,p){var x=this._out[g];if(x){var y=e.values(x);return p?e.filter(y,function(w){return w.w===p}):y}},s.prototype.nodeEdges=function(g,p){var x=this.inEdges(g,p);if(x)return x.concat(this.outEdges(g,p))};function l(g,p){g[p]?g[p]++:g[p]=1}function o(g,p){--g[p]||delete g[p]}function c(g,p,x,y){var w=""+p,j=""+x;if(!g&&w>j){var S=w;w=j,j=S}return w+a+j+a+(e.isUndefined(y)?t:y)}function f(g,p,x,y){var w=""+p,j=""+x;if(!g&&w>j){var S=w;w=j,j=S}var k={v:w,w:j};return y&&(k.name=y),k}function h(g,p){return c(g,p.v,p.w,p.name)}return Mx}var Rx,vN;function iF(){return vN||(vN=1,Rx="2.1.8"),Rx}var Lx,wN;function sF(){return wN||(wN=1,Lx={Graph:av(),version:iF()}),Lx}var Dx,jN;function lF(){if(jN)return Dx;jN=1;var e=Un(),t=av();Dx={write:n,read:l};function n(o){var c={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:a(o),edges:s(o)};return e.isUndefined(o.graph())||(c.value=e.clone(o.graph())),c}function a(o){return e.map(o.nodes(),function(c){var f=o.node(c),h=o.parent(c),g={v:c};return e.isUndefined(f)||(g.value=f),e.isUndefined(h)||(g.parent=h),g})}function s(o){return e.map(o.edges(),function(c){var f=o.edge(c),h={v:c.v,w:c.w};return e.isUndefined(c.name)||(h.name=c.name),e.isUndefined(f)||(h.value=f),h})}function l(o){var c=new t(o.options).setGraph(o.value);return e.each(o.nodes,function(f){c.setNode(f.v,f.value),f.parent&&c.setParent(f.v,f.parent)}),e.each(o.edges,function(f){c.setEdge({v:f.v,w:f.w,name:f.name},f.value)}),c}return Dx}var Ox,kN;function oF(){if(kN)return Ox;kN=1;var e=Un();Ox=t;function t(n){var a={},s=[],l;function o(c){e.has(a,c)||(a[c]=!0,l.push(c),e.each(n.successors(c),o),e.each(n.predecessors(c),o))}return e.each(n.nodes(),function(c){l=[],o(c),l.length&&s.push(l)}),s}return Ox}var zx,SN;function jA(){if(SN)return zx;SN=1;var e=Un();zx=t;function t(){this._arr=[],this._keyIndices={}}return t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(n){return n.key})},t.prototype.has=function(n){return e.has(this._keyIndices,n)},t.prototype.priority=function(n){var a=this._keyIndices[n];if(a!==void 0)return this._arr[a].priority},t.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(n,a){var s=this._keyIndices;if(n=String(n),!e.has(s,n)){var l=this._arr,o=l.length;return s[n]=o,l.push({key:n,priority:a}),this._decrease(o),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},t.prototype.decrease=function(n,a){var s=this._keyIndices[n];if(a>this._arr[s].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[s].priority+" New: "+a);this._arr[s].priority=a,this._decrease(s)},t.prototype._heapify=function(n){var a=this._arr,s=2*n,l=s+1,o=n;s<a.length&&(o=a[s].priority<a[o].priority?s:o,l<a.length&&(o=a[l].priority<a[o].priority?l:o),o!==n&&(this._swap(n,o),this._heapify(o)))},t.prototype._decrease=function(n){for(var a=this._arr,s=a[n].priority,l;n!==0&&(l=n>>1,!(a[l].priority<s));)this._swap(n,l),n=l},t.prototype._swap=function(n,a){var s=this._arr,l=this._keyIndices,o=s[n],c=s[a];s[n]=c,s[a]=o,l[c.key]=n,l[o.key]=a},zx}var qx,_N;function kA(){if(_N)return qx;_N=1;var e=Un(),t=jA();qx=a;var n=e.constant(1);function a(l,o,c,f){return s(l,String(o),c||n,f||function(h){return l.outEdges(h)})}function s(l,o,c,f){var h={},g=new t,p,x,y=function(w){var j=w.v!==p?w.v:w.w,S=h[j],k=c(w),N=x.distance+k;if(k<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+w+" Weight: "+k);N<S.distance&&(S.distance=N,S.predecessor=p,g.decrease(j,N))};for(l.nodes().forEach(function(w){var j=w===o?0:Number.POSITIVE_INFINITY;h[w]={distance:j},g.add(w,j)});g.size()>0&&(p=g.removeMin(),x=h[p],x.distance!==Number.POSITIVE_INFINITY);)f(p).forEach(y);return h}return qx}var Ix,NN;function uF(){if(NN)return Ix;NN=1;var e=kA(),t=Un();Ix=n;function n(a,s,l){return t.transform(a.nodes(),function(o,c){o[c]=e(a,c,s,l)},{})}return Ix}var Bx,CN;function SA(){if(CN)return Bx;CN=1;var e=Un();Bx=t;function t(n){var a=0,s=[],l={},o=[];function c(f){var h=l[f]={onStack:!0,lowlink:a,index:a++};if(s.push(f),n.successors(f).forEach(function(x){e.has(l,x)?l[x].onStack&&(h.lowlink=Math.min(h.lowlink,l[x].index)):(c(x),h.lowlink=Math.min(h.lowlink,l[x].lowlink))}),h.lowlink===h.index){var g=[],p;do p=s.pop(),l[p].onStack=!1,g.push(p);while(f!==p);o.push(g)}}return n.nodes().forEach(function(f){e.has(l,f)||c(f)}),o}return Bx}var Hx,EN;function cF(){if(EN)return Hx;EN=1;var e=Un(),t=SA();Hx=n;function n(a){return e.filter(t(a),function(s){return s.length>1||s.length===1&&a.hasEdge(s[0],s[0])})}return Hx}var Px,TN;function dF(){if(TN)return Px;TN=1;var e=Un();Px=n;var t=e.constant(1);function n(s,l,o){return a(s,l||t,o||function(c){return s.outEdges(c)})}function a(s,l,o){var c={},f=s.nodes();return f.forEach(function(h){c[h]={},c[h][h]={distance:0},f.forEach(function(g){h!==g&&(c[h][g]={distance:Number.POSITIVE_INFINITY})}),o(h).forEach(function(g){var p=g.v===h?g.w:g.v,x=l(g);c[h][p]={distance:x,predecessor:h}})}),f.forEach(function(h){var g=c[h];f.forEach(function(p){var x=c[p];f.forEach(function(y){var w=x[h],j=g[y],S=x[y],k=w.distance+j.distance;k<S.distance&&(S.distance=k,S.predecessor=j.predecessor)})})}),c}return Px}var Fx,AN;function _A(){if(AN)return Fx;AN=1;var e=Un();Fx=t,t.CycleException=n;function t(a){var s={},l={},o=[];function c(f){if(e.has(l,f))throw new n;e.has(s,f)||(l[f]=!0,s[f]=!0,e.each(a.predecessors(f),c),delete l[f],o.push(f))}if(e.each(a.sinks(),c),e.size(s)!==a.nodeCount())throw new n;return o}function n(){}return n.prototype=new Error,Fx}var Ux,MN;function fF(){if(MN)return Ux;MN=1;var e=_A();Ux=t;function t(n){try{e(n)}catch(a){if(a instanceof e.CycleException)return!1;throw a}return!0}return Ux}var $x,RN;function NA(){if(RN)return $x;RN=1;var e=Un();$x=t;function t(a,s,l){e.isArray(s)||(s=[s]);var o=(a.isDirected()?a.successors:a.neighbors).bind(a),c=[],f={};return e.each(s,function(h){if(!a.hasNode(h))throw new Error("Graph does not have node: "+h);n(a,h,l==="post",f,o,c)}),c}function n(a,s,l,o,c,f){e.has(o,s)||(o[s]=!0,l||f.push(s),e.each(c(s),function(h){n(a,h,l,o,c,f)}),l&&f.push(s))}return $x}var Gx,LN;function hF(){if(LN)return Gx;LN=1;var e=NA();Gx=t;function t(n,a){return e(n,a,"post")}return Gx}var Vx,DN;function mF(){if(DN)return Vx;DN=1;var e=NA();Vx=t;function t(n,a){return e(n,a,"pre")}return Vx}var Yx,ON;function pF(){if(ON)return Yx;ON=1;var e=Un(),t=av(),n=jA();Yx=a;function a(s,l){var o=new t,c={},f=new n,h;function g(x){var y=x.v===h?x.w:x.v,w=f.priority(y);if(w!==void 0){var j=l(x);j<w&&(c[y]=h,f.decrease(y,j))}}if(s.nodeCount()===0)return o;e.each(s.nodes(),function(x){f.add(x,Number.POSITIVE_INFINITY),o.setNode(x)}),f.decrease(s.nodes()[0],0);for(var p=!1;f.size()>0;){if(h=f.removeMin(),e.has(c,h))o.setEdge(h,c[h]);else{if(p)throw new Error("Input graph is not connected: "+s);p=!0}s.nodeEdges(h).forEach(g)}return o}return Yx}var Xx,zN;function gF(){return zN||(zN=1,Xx={components:oF(),dijkstra:kA(),dijkstraAll:uF(),findCycles:cF(),floydWarshall:dF(),isAcyclic:fF(),postorder:hF(),preorder:mF(),prim:pF(),tarjan:SA(),topsort:_A()}),Xx}var Kx,qN;function xF(){if(qN)return Kx;qN=1;var e=sF();return Kx={Graph:e.Graph,json:lF(),alg:gF(),version:e.version},Kx}var Wx,IN;function tr(){if(IN)return Wx;IN=1;var e;if(typeof Fb=="function")try{e=xF()}catch{}return e||(e=window.graphlib),Wx=e,Wx}var Qx,BN;function yF(){if(BN)return Qx;BN=1;var e=QT(),t=1,n=4;function a(s){return e(s,t|n)}return Qx=a,Qx}var Zx,HN;function gd(){if(HN)return Zx;HN=1;var e=Is(),t=Jr(),n=ld(),a=Fn();function s(l,o,c){if(!a(c))return!1;var f=typeof o;return(f=="number"?t(c)&&n(o,c.length):f=="string"&&o in c)?e(c[o],l):!1}return Zx=s,Zx}var Jx,PN;function bF(){if(PN)return Jx;PN=1;var e=pd(),t=Is(),n=gd(),a=Si(),s=Object.prototype,l=s.hasOwnProperty,o=e(function(c,f){c=Object(c);var h=-1,g=f.length,p=g>2?f[2]:void 0;for(p&&n(f[0],f[1],p)&&(g=1);++h<g;)for(var x=f[h],y=a(x),w=-1,j=y.length;++w<j;){var S=y[w],k=c[S];(k===void 0||t(k,s[S])&&!l.call(c,S))&&(c[S]=x[S])}return c});return Jx=o,Jx}var e0,FN;function vF(){if(FN)return e0;FN=1;var e=ea(),t=Jr(),n=Ia();function a(s){return function(l,o,c){var f=Object(l);if(!t(l)){var h=e(o,3);l=n(l),o=function(p){return h(f[p],p,f)}}var g=s(l,o,c);return g>-1?f[h?l[g]:g]:void 0}}return e0=a,e0}var t0,UN;function wF(){if(UN)return t0;UN=1;var e=/\s/;function t(n){for(var a=n.length;a--&&e.test(n.charAt(a)););return a}return t0=t,t0}var n0,$N;function jF(){if($N)return n0;$N=1;var e=wF(),t=/^\s+/;function n(a){return a&&a.slice(0,e(a)+1).replace(t,"")}return n0=n,n0}var r0,GN;function kF(){if(GN)return r0;GN=1;var e=jF(),t=Fn(),n=Fs(),a=NaN,s=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,o=/^0o[0-7]+$/i,c=parseInt;function f(h){if(typeof h=="number")return h;if(n(h))return a;if(t(h)){var g=typeof h.valueOf=="function"?h.valueOf():h;h=t(g)?g+"":g}if(typeof h!="string")return h===0?h:+h;h=e(h);var p=l.test(h);return p||o.test(h)?c(h.slice(2),p?2:8):s.test(h)?a:+h}return r0=f,r0}var a0,VN;function CA(){if(VN)return a0;VN=1;var e=kF(),t=1/0,n=17976931348623157e292;function a(s){if(!s)return s===0?s:0;if(s=e(s),s===t||s===-t){var l=s<0?-1:1;return l*n}return s===s?s:0}return a0=a,a0}var i0,YN;function SF(){if(YN)return i0;YN=1;var e=CA();function t(n){var a=e(n),s=a%1;return a===a?s?a-s:a:0}return i0=t,i0}var s0,XN;function _F(){if(XN)return s0;XN=1;var e=bA(),t=ea(),n=SF(),a=Math.max;function s(l,o,c){var f=l==null?0:l.length;if(!f)return-1;var h=c==null?0:n(c);return h<0&&(h=a(f+h,0)),e(l,t(o,3),h)}return s0=s,s0}var l0,KN;function NF(){if(KN)return l0;KN=1;var e=vF(),t=_F(),n=e(t);return l0=n,l0}var o0,WN;function EA(){if(WN)return o0;WN=1;var e=rv();function t(n){var a=n==null?0:n.length;return a?e(n,1):[]}return o0=t,o0}var u0,QN;function CF(){if(QN)return u0;QN=1;var e=Jb(),t=ZT(),n=Si();function a(s,l){return s==null?s:e(s,t(l),n)}return u0=a,u0}var c0,ZN;function EF(){if(ZN)return c0;ZN=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return c0=e,c0}var d0,JN;function TF(){if(JN)return d0;JN=1;var e=id(),t=ev(),n=ea();function a(s,l){var o={};return l=n(l,3),t(s,function(c,f,h){e(o,f,l(c,f,h))}),o}return d0=a,d0}var f0,eC;function iv(){if(eC)return f0;eC=1;var e=Fs();function t(n,a,s){for(var l=-1,o=n.length;++l<o;){var c=n[l],f=a(c);if(f!=null&&(h===void 0?f===f&&!e(f):s(f,h)))var h=f,g=c}return g}return f0=t,f0}var h0,tC;function AF(){if(tC)return h0;tC=1;function e(t,n){return t>n}return h0=e,h0}var m0,nC;function MF(){if(nC)return m0;nC=1;var e=iv(),t=AF(),n=_i();function a(s){return s&&s.length?e(s,n,t):void 0}return m0=a,m0}var p0,rC;function TA(){if(rC)return p0;rC=1;var e=id(),t=Is();function n(a,s,l){(l!==void 0&&!t(a[s],l)||l===void 0&&!(s in a))&&e(a,s,l)}return p0=n,p0}var g0,aC;function RF(){if(aC)return g0;aC=1;var e=ji(),t=cd(),n=vr(),a="[object Object]",s=Function.prototype,l=Object.prototype,o=s.toString,c=l.hasOwnProperty,f=o.call(Object);function h(g){if(!n(g)||e(g)!=a)return!1;var p=t(g);if(p===null)return!0;var x=c.call(p,"constructor")&&p.constructor;return typeof x=="function"&&x instanceof x&&o.call(x)==f}return g0=h,g0}var x0,iC;function AA(){if(iC)return x0;iC=1;function e(t,n){if(!(n==="constructor"&&typeof t[n]=="function")&&n!="__proto__")return t[n]}return x0=e,x0}var y0,sC;function LF(){if(sC)return y0;sC=1;var e=Mo(),t=Si();function n(a){return e(a,t(a))}return y0=n,y0}var b0,lC;function DF(){if(lC)return b0;lC=1;var e=TA(),t=BT(),n=XT(),a=HT(),s=WT(),l=Ro(),o=Pt(),c=vA(),f=Hs(),h=Ao(),g=Fn(),p=RF(),x=Lo(),y=AA(),w=LF();function j(S,k,N,_,E,M,T){var R=y(S,N),B=y(k,N),P=T.get(B);if(P){e(S,N,P);return}var L=M?M(R,B,N+"",S,k,T):void 0,H=L===void 0;if(H){var F=o(B),G=!F&&f(B),q=!F&&!G&&x(B);L=B,F||G||q?o(R)?L=R:c(R)?L=a(R):G?(H=!1,L=t(B,!0)):q?(H=!1,L=n(B,!0)):L=[]:p(B)||l(B)?(L=R,l(R)?L=w(R):(!g(R)||h(R))&&(L=s(B))):H=!1}H&&(T.set(B,L),E(L,B,_,M,T),T.delete(B)),e(S,N,L)}return b0=j,b0}var v0,oC;function OF(){if(oC)return v0;oC=1;var e=ad(),t=TA(),n=Jb(),a=DF(),s=Fn(),l=Si(),o=AA();function c(f,h,g,p,x){f!==h&&n(h,function(y,w){if(x||(x=new e),s(y))a(f,h,w,g,c,p,x);else{var j=p?p(o(f,w),y,w+"",f,h,x):void 0;j===void 0&&(j=y),t(f,w,j)}},l)}return v0=c,v0}var w0,uC;function zF(){if(uC)return w0;uC=1;var e=pd(),t=gd();function n(a){return e(function(s,l){var o=-1,c=l.length,f=c>1?l[c-1]:void 0,h=c>2?l[2]:void 0;for(f=a.length>3&&typeof f=="function"?(c--,f):void 0,h&&t(l[0],l[1],h)&&(f=c<3?void 0:f,c=1),s=Object(s);++o<c;){var g=l[o];g&&a(s,g,o,f)}return s})}return w0=n,w0}var j0,cC;function qF(){if(cC)return j0;cC=1;var e=OF(),t=zF(),n=t(function(a,s,l){e(a,s,l)});return j0=n,j0}var k0,dC;function MA(){if(dC)return k0;dC=1;function e(t,n){return t<n}return k0=e,k0}var S0,fC;function IF(){if(fC)return S0;fC=1;var e=iv(),t=MA(),n=_i();function a(s){return s&&s.length?e(s,n,t):void 0}return S0=a,S0}var _0,hC;function BF(){if(hC)return _0;hC=1;var e=iv(),t=ea(),n=MA();function a(s,l){return s&&s.length?e(s,t(l,2),n):void 0}return _0=a,_0}var N0,mC;function HF(){if(mC)return N0;mC=1;var e=rr(),t=function(){return e.Date.now()};return N0=t,N0}var C0,pC;function PF(){if(pC)return C0;pC=1;var e=sd(),t=hd(),n=ld(),a=Fn(),s=Do();function l(o,c,f,h){if(!a(o))return o;c=t(c,o);for(var g=-1,p=c.length,x=p-1,y=o;y!=null&&++g<p;){var w=s(c[g]),j=f;if(w==="__proto__"||w==="constructor"||w==="prototype")return o;if(g!=x){var S=y[w];j=h?h(S,w,y):void 0,j===void 0&&(j=a(S)?S:n(c[g+1])?[]:{})}e(y,w,j),y=y[w]}return o}return C0=l,C0}var E0,gC;function FF(){if(gC)return E0;gC=1;var e=md(),t=PF(),n=hd();function a(s,l,o){for(var c=-1,f=l.length,h={};++c<f;){var g=l[c],p=e(s,g);o(p,g)&&t(h,n(g,s),p)}return h}return E0=a,E0}var T0,xC;function UF(){if(xC)return T0;xC=1;var e=FF(),t=uA();function n(a,s){return e(a,s,function(l,o){return t(a,o)})}return T0=n,T0}var A0,yC;function $F(){if(yC)return A0;yC=1;var e=EA(),t=xA(),n=yA();function a(s){return n(t(s,void 0,e),s+"")}return A0=a,A0}var M0,bC;function GF(){if(bC)return M0;bC=1;var e=UF(),t=$F(),n=t(function(a,s){return a==null?{}:e(a,s)});return M0=n,M0}var R0,vC;function VF(){if(vC)return R0;vC=1;var e=Math.ceil,t=Math.max;function n(a,s,l,o){for(var c=-1,f=t(e((s-a)/(l||1)),0),h=Array(f);f--;)h[o?f:++c]=a,a+=l;return h}return R0=n,R0}var L0,wC;function YF(){if(wC)return L0;wC=1;var e=VF(),t=gd(),n=CA();function a(s){return function(l,o,c){return c&&typeof c!="number"&&t(l,o,c)&&(o=c=void 0),l=n(l),o===void 0?(o=l,l=0):o=n(o),c=c===void 0?l<o?1:-1:n(c),e(l,o,c,s)}}return L0=a,L0}var D0,jC;function XF(){if(jC)return D0;jC=1;var e=YF(),t=e();return D0=t,D0}var O0,kC;function KF(){if(kC)return O0;kC=1;function e(t,n){var a=t.length;for(t.sort(n);a--;)t[a]=t[a].value;return t}return O0=e,O0}var z0,SC;function WF(){if(SC)return z0;SC=1;var e=Fs();function t(n,a){if(n!==a){var s=n!==void 0,l=n===null,o=n===n,c=e(n),f=a!==void 0,h=a===null,g=a===a,p=e(a);if(!h&&!p&&!c&&n>a||c&&f&&g&&!h&&!p||l&&f&&g||!s&&g||!o)return 1;if(!l&&!c&&!p&&n<a||p&&s&&o&&!l&&!c||h&&s&&o||!f&&o||!g)return-1}return 0}return z0=t,z0}var q0,_C;function QF(){if(_C)return q0;_C=1;var e=WF();function t(n,a,s){for(var l=-1,o=n.criteria,c=a.criteria,f=o.length,h=s.length;++l<f;){var g=e(o[l],c[l]);if(g){if(l>=h)return g;var p=s[l];return g*(p=="desc"?-1:1)}}return n.index-a.index}return q0=t,q0}var I0,NC;function ZF(){if(NC)return I0;NC=1;var e=fd(),t=md(),n=ea(),a=mA(),s=KF(),l=od(),o=QF(),c=_i(),f=Pt();function h(g,p,x){p.length?p=e(p,function(j){return f(j)?function(S){return t(S,j.length===1?j[0]:j)}:j}):p=[c];var y=-1;p=e(p,l(n));var w=a(g,function(j,S,k){var N=e(p,function(_){return _(j)});return{criteria:N,index:++y,value:j}});return s(w,function(j,S){return o(j,S,x)})}return I0=h,I0}var B0,CC;function JF(){if(CC)return B0;CC=1;var e=rv(),t=ZF(),n=pd(),a=gd(),s=n(function(l,o){if(l==null)return[];var c=o.length;return c>1&&a(l,o[0],o[1])?o=[]:c>2&&a(o[0],o[1],o[2])&&(o=[o[0]]),t(l,e(o,1),[])});return B0=s,B0}var H0,EC;function eU(){if(EC)return H0;EC=1;var e=lA(),t=0;function n(a){var s=++t;return e(a)+s}return H0=n,H0}var P0,TC;function tU(){if(TC)return P0;TC=1;function e(t,n,a){for(var s=-1,l=t.length,o=n.length,c={};++s<l;){var f=s<o?n[s]:void 0;a(c,t[s],f)}return c}return P0=e,P0}var F0,AC;function nU(){if(AC)return F0;AC=1;var e=sd(),t=tU();function n(a,s){return t(a||[],s||[],e)}return F0=n,F0}var U0,MC;function Ct(){if(MC)return U0;MC=1;var e;if(typeof Fb=="function")try{e={cloneDeep:yF(),constant:Zb(),defaults:bF(),each:eA(),filter:dA(),find:NF(),flatten:EA(),forEach:JT(),forIn:CF(),has:fA(),isUndefined:hA(),last:EF(),map:pA(),mapValues:TF(),max:MF(),merge:qF(),min:IF(),minBy:BF(),now:HF(),pick:GF(),range:XF(),reduce:gA(),sortBy:JF(),uniqueId:eU(),values:wA(),zipObject:nU()}}catch{}return e||(e=window._),U0=e,U0}var $0,RC;function rU(){if(RC)return $0;RC=1,$0=e;function e(){var a={};a._next=a._prev=a,this._sentinel=a}e.prototype.dequeue=function(){var a=this._sentinel,s=a._prev;if(s!==a)return t(s),s},e.prototype.enqueue=function(a){var s=this._sentinel;a._prev&&a._next&&t(a),a._next=s._next,s._next._prev=a,s._next=a,a._prev=s},e.prototype.toString=function(){for(var a=[],s=this._sentinel,l=s._prev;l!==s;)a.push(JSON.stringify(l,n)),l=l._prev;return"["+a.join(", ")+"]"};function t(a){a._prev._next=a._next,a._next._prev=a._prev,delete a._next,delete a._prev}function n(a,s){if(a!=="_next"&&a!=="_prev")return s}return $0}var G0,LC;function aU(){if(LC)return G0;LC=1;var e=Ct(),t=tr().Graph,n=rU();G0=s;var a=e.constant(1);function s(h,g){if(h.nodeCount()<=1)return[];var p=c(h,g||a),x=l(p.graph,p.buckets,p.zeroIdx);return e.flatten(e.map(x,function(y){return h.outEdges(y.v,y.w)}),!0)}function l(h,g,p){for(var x=[],y=g[g.length-1],w=g[0],j;h.nodeCount();){for(;j=w.dequeue();)o(h,g,p,j);for(;j=y.dequeue();)o(h,g,p,j);if(h.nodeCount()){for(var S=g.length-2;S>0;--S)if(j=g[S].dequeue(),j){x=x.concat(o(h,g,p,j,!0));break}}}return x}function o(h,g,p,x,y){var w=y?[]:void 0;return e.forEach(h.inEdges(x.v),function(j){var S=h.edge(j),k=h.node(j.v);y&&w.push({v:j.v,w:j.w}),k.out-=S,f(g,p,k)}),e.forEach(h.outEdges(x.v),function(j){var S=h.edge(j),k=j.w,N=h.node(k);N.in-=S,f(g,p,N)}),h.removeNode(x.v),w}function c(h,g){var p=new t,x=0,y=0;e.forEach(h.nodes(),function(S){p.setNode(S,{v:S,in:0,out:0})}),e.forEach(h.edges(),function(S){var k=p.edge(S.v,S.w)||0,N=g(S),_=k+N;p.setEdge(S.v,S.w,_),y=Math.max(y,p.node(S.v).out+=N),x=Math.max(x,p.node(S.w).in+=N)});var w=e.range(y+x+3).map(function(){return new n}),j=x+1;return e.forEach(p.nodes(),function(S){f(w,j,p.node(S))}),{graph:p,buckets:w,zeroIdx:j}}function f(h,g,p){p.out?p.in?h[p.out-p.in+g].enqueue(p):h[h.length-1].enqueue(p):h[0].enqueue(p)}return G0}var V0,DC;function iU(){if(DC)return V0;DC=1;var e=Ct(),t=aU();V0={run:n,undo:s};function n(l){var o=l.graph().acyclicer==="greedy"?t(l,c(l)):a(l);e.forEach(o,function(f){var h=l.edge(f);l.removeEdge(f),h.forwardName=f.name,h.reversed=!0,l.setEdge(f.w,f.v,h,e.uniqueId("rev"))});function c(f){return function(h){return f.edge(h).weight}}}function a(l){var o=[],c={},f={};function h(g){e.has(f,g)||(f[g]=!0,c[g]=!0,e.forEach(l.outEdges(g),function(p){e.has(c,p.w)?o.push(p):h(p.w)}),delete c[g])}return e.forEach(l.nodes(),h),o}function s(l){e.forEach(l.edges(),function(o){var c=l.edge(o);if(c.reversed){l.removeEdge(o);var f=c.forwardName;delete c.reversed,delete c.forwardName,l.setEdge(o.w,o.v,c,f)}})}return V0}var Y0,OC;function xn(){if(OC)return Y0;OC=1;var e=Ct(),t=tr().Graph;Y0={addDummyNode:n,simplify:a,asNonCompoundGraph:s,successorWeights:l,predecessorWeights:o,intersectRect:c,buildLayerMatrix:f,normalizeRanks:h,removeEmptyRanks:g,addBorderNode:p,maxRank:x,partition:y,time:w,notime:j};function n(S,k,N,_){var E;do E=e.uniqueId(_);while(S.hasNode(E));return N.dummy=k,S.setNode(E,N),E}function a(S){var k=new t().setGraph(S.graph());return e.forEach(S.nodes(),function(N){k.setNode(N,S.node(N))}),e.forEach(S.edges(),function(N){var _=k.edge(N.v,N.w)||{weight:0,minlen:1},E=S.edge(N);k.setEdge(N.v,N.w,{weight:_.weight+E.weight,minlen:Math.max(_.minlen,E.minlen)})}),k}function s(S){var k=new t({multigraph:S.isMultigraph()}).setGraph(S.graph());return e.forEach(S.nodes(),function(N){S.children(N).length||k.setNode(N,S.node(N))}),e.forEach(S.edges(),function(N){k.setEdge(N,S.edge(N))}),k}function l(S){var k=e.map(S.nodes(),function(N){var _={};return e.forEach(S.outEdges(N),function(E){_[E.w]=(_[E.w]||0)+S.edge(E).weight}),_});return e.zipObject(S.nodes(),k)}function o(S){var k=e.map(S.nodes(),function(N){var _={};return e.forEach(S.inEdges(N),function(E){_[E.v]=(_[E.v]||0)+S.edge(E).weight}),_});return e.zipObject(S.nodes(),k)}function c(S,k){var N=S.x,_=S.y,E=k.x-N,M=k.y-_,T=S.width/2,R=S.height/2;if(!E&&!M)throw new Error("Not possible to find intersection inside of the rectangle");var B,P;return Math.abs(M)*T>Math.abs(E)*R?(M<0&&(R=-R),B=R*E/M,P=R):(E<0&&(T=-T),B=T,P=T*M/E),{x:N+B,y:_+P}}function f(S){var k=e.map(e.range(x(S)+1),function(){return[]});return e.forEach(S.nodes(),function(N){var _=S.node(N),E=_.rank;e.isUndefined(E)||(k[E][_.order]=N)}),k}function h(S){var k=e.min(e.map(S.nodes(),function(N){return S.node(N).rank}));e.forEach(S.nodes(),function(N){var _=S.node(N);e.has(_,"rank")&&(_.rank-=k)})}function g(S){var k=e.min(e.map(S.nodes(),function(M){return S.node(M).rank})),N=[];e.forEach(S.nodes(),function(M){var T=S.node(M).rank-k;N[T]||(N[T]=[]),N[T].push(M)});var _=0,E=S.graph().nodeRankFactor;e.forEach(N,function(M,T){e.isUndefined(M)&&T%E!==0?--_:_&&e.forEach(M,function(R){S.node(R).rank+=_})})}function p(S,k,N,_){var E={width:0,height:0};return arguments.length>=4&&(E.rank=N,E.order=_),n(S,"border",E,k)}function x(S){return e.max(e.map(S.nodes(),function(k){var N=S.node(k).rank;if(!e.isUndefined(N))return N}))}function y(S,k){var N={lhs:[],rhs:[]};return e.forEach(S,function(_){k(_)?N.lhs.push(_):N.rhs.push(_)}),N}function w(S,k){var N=e.now();try{return k()}finally{console.log(S+" time: "+(e.now()-N)+"ms")}}function j(S,k){return k()}return Y0}var X0,zC;function sU(){if(zC)return X0;zC=1;var e=Ct(),t=xn();X0={run:n,undo:s};function n(l){l.graph().dummyChains=[],e.forEach(l.edges(),function(o){a(l,o)})}function a(l,o){var c=o.v,f=l.node(c).rank,h=o.w,g=l.node(h).rank,p=o.name,x=l.edge(o),y=x.labelRank;if(g!==f+1){l.removeEdge(o);var w,j,S;for(S=0,++f;f<g;++S,++f)x.points=[],j={width:0,height:0,edgeLabel:x,edgeObj:o,rank:f},w=t.addDummyNode(l,"edge",j,"_d"),f===y&&(j.width=x.width,j.height=x.height,j.dummy="edge-label",j.labelpos=x.labelpos),l.setEdge(c,w,{weight:x.weight},p),S===0&&l.graph().dummyChains.push(w),c=w;l.setEdge(c,h,{weight:x.weight},p)}}function s(l){e.forEach(l.graph().dummyChains,function(o){var c=l.node(o),f=c.edgeLabel,h;for(l.setEdge(c.edgeObj,f);c.dummy;)h=l.successors(o)[0],l.removeNode(o),f.points.push({x:c.x,y:c.y}),c.dummy==="edge-label"&&(f.x=c.x,f.y=c.y,f.width=c.width,f.height=c.height),o=h,c=l.node(o)})}return X0}var K0,qC;function Lc(){if(qC)return K0;qC=1;var e=Ct();K0={longestPath:t,slack:n};function t(a){var s={};function l(o){var c=a.node(o);if(e.has(s,o))return c.rank;s[o]=!0;var f=e.min(e.map(a.outEdges(o),function(h){return l(h.w)-a.edge(h).minlen}));return(f===Number.POSITIVE_INFINITY||f===void 0||f===null)&&(f=0),c.rank=f}e.forEach(a.sources(),l)}function n(a,s){return a.node(s.w).rank-a.node(s.v).rank-a.edge(s).minlen}return K0}var W0,IC;function RA(){if(IC)return W0;IC=1;var e=Ct(),t=tr().Graph,n=Lc().slack;W0=a;function a(c){var f=new t({directed:!1}),h=c.nodes()[0],g=c.nodeCount();f.setNode(h,{});for(var p,x;s(f,c)<g;)p=l(f,c),x=f.hasNode(p.v)?n(c,p):-n(c,p),o(f,c,x);return f}function s(c,f){function h(g){e.forEach(f.nodeEdges(g),function(p){var x=p.v,y=g===x?p.w:x;!c.hasNode(y)&&!n(f,p)&&(c.setNode(y,{}),c.setEdge(g,y,{}),h(y))})}return e.forEach(c.nodes(),h),c.nodeCount()}function l(c,f){return e.minBy(f.edges(),function(h){if(c.hasNode(h.v)!==c.hasNode(h.w))return n(f,h)})}function o(c,f,h){e.forEach(c.nodes(),function(g){f.node(g).rank+=h})}return W0}var Q0,BC;function lU(){if(BC)return Q0;BC=1;var e=Ct(),t=RA(),n=Lc().slack,a=Lc().longestPath,s=tr().alg.preorder,l=tr().alg.postorder,o=xn().simplify;Q0=c,c.initLowLimValues=p,c.initCutValues=f,c.calcCutValue=g,c.leaveEdge=y,c.enterEdge=w,c.exchangeEdges=j;function c(_){_=o(_),a(_);var E=t(_);p(E),f(E,_);for(var M,T;M=y(E);)T=w(E,_,M),j(E,_,M,T)}function f(_,E){var M=l(_,_.nodes());M=M.slice(0,M.length-1),e.forEach(M,function(T){h(_,E,T)})}function h(_,E,M){var T=_.node(M),R=T.parent;_.edge(M,R).cutvalue=g(_,E,M)}function g(_,E,M){var T=_.node(M),R=T.parent,B=!0,P=E.edge(M,R),L=0;return P||(B=!1,P=E.edge(R,M)),L=P.weight,e.forEach(E.nodeEdges(M),function(H){var F=H.v===M,G=F?H.w:H.v;if(G!==R){var q=F===B,O=E.edge(H).weight;if(L+=q?O:-O,k(_,M,G)){var D=_.edge(M,G).cutvalue;L+=q?-D:D}}}),L}function p(_,E){arguments.length<2&&(E=_.nodes()[0]),x(_,{},1,E)}function x(_,E,M,T,R){var B=M,P=_.node(T);return E[T]=!0,e.forEach(_.neighbors(T),function(L){e.has(E,L)||(M=x(_,E,M,L,T))}),P.low=B,P.lim=M++,R?P.parent=R:delete P.parent,M}function y(_){return e.find(_.edges(),function(E){return _.edge(E).cutvalue<0})}function w(_,E,M){var T=M.v,R=M.w;E.hasEdge(T,R)||(T=M.w,R=M.v);var B=_.node(T),P=_.node(R),L=B,H=!1;B.lim>P.lim&&(L=P,H=!0);var F=e.filter(E.edges(),function(G){return H===N(_,_.node(G.v),L)&&H!==N(_,_.node(G.w),L)});return e.minBy(F,function(G){return n(E,G)})}function j(_,E,M,T){var R=M.v,B=M.w;_.removeEdge(R,B),_.setEdge(T.v,T.w,{}),p(_),f(_,E),S(_,E)}function S(_,E){var M=e.find(_.nodes(),function(R){return!E.node(R).parent}),T=s(_,M);T=T.slice(1),e.forEach(T,function(R){var B=_.node(R).parent,P=E.edge(R,B),L=!1;P||(P=E.edge(B,R),L=!0),E.node(R).rank=E.node(B).rank+(L?P.minlen:-P.minlen)})}function k(_,E,M){return _.hasEdge(E,M)}function N(_,E,M){return M.low<=E.lim&&E.lim<=M.lim}return Q0}var Z0,HC;function oU(){if(HC)return Z0;HC=1;var e=Lc(),t=e.longestPath,n=RA(),a=lU();Z0=s;function s(f){switch(f.graph().ranker){case"network-simplex":c(f);break;case"tight-tree":o(f);break;case"longest-path":l(f);break;default:c(f)}}var l=t;function o(f){t(f),n(f)}function c(f){a(f)}return Z0}var J0,PC;function uU(){if(PC)return J0;PC=1;var e=Ct();J0=t;function t(s){var l=a(s);e.forEach(s.graph().dummyChains,function(o){for(var c=s.node(o),f=c.edgeObj,h=n(s,l,f.v,f.w),g=h.path,p=h.lca,x=0,y=g[x],w=!0;o!==f.w;){if(c=s.node(o),w){for(;(y=g[x])!==p&&s.node(y).maxRank<c.rank;)x++;y===p&&(w=!1)}if(!w){for(;x<g.length-1&&s.node(y=g[x+1]).minRank<=c.rank;)x++;y=g[x]}s.setParent(o,y),o=s.successors(o)[0]}})}function n(s,l,o,c){var f=[],h=[],g=Math.min(l[o].low,l[c].low),p=Math.max(l[o].lim,l[c].lim),x,y;x=o;do x=s.parent(x),f.push(x);while(x&&(l[x].low>g||p>l[x].lim));for(y=x,x=c;(x=s.parent(x))!==y;)h.push(x);return{path:f.concat(h.reverse()),lca:y}}function a(s){var l={},o=0;function c(f){var h=o;e.forEach(s.children(f),c),l[f]={low:h,lim:o++}}return e.forEach(s.children(),c),l}return J0}var ey,FC;function cU(){if(FC)return ey;FC=1;var e=Ct(),t=xn();ey={run:n,cleanup:o};function n(c){var f=t.addDummyNode(c,"root",{},"_root"),h=s(c),g=e.max(e.values(h))-1,p=2*g+1;c.graph().nestingRoot=f,e.forEach(c.edges(),function(y){c.edge(y).minlen*=p});var x=l(c)+1;e.forEach(c.children(),function(y){a(c,f,p,x,g,h,y)}),c.graph().nodeRankFactor=p}function a(c,f,h,g,p,x,y){var w=c.children(y);if(!w.length){y!==f&&c.setEdge(f,y,{weight:0,minlen:h});return}var j=t.addBorderNode(c,"_bt"),S=t.addBorderNode(c,"_bb"),k=c.node(y);c.setParent(j,y),k.borderTop=j,c.setParent(S,y),k.borderBottom=S,e.forEach(w,function(N){a(c,f,h,g,p,x,N);var _=c.node(N),E=_.borderTop?_.borderTop:N,M=_.borderBottom?_.borderBottom:N,T=_.borderTop?g:2*g,R=E!==M?1:p-x[y]+1;c.setEdge(j,E,{weight:T,minlen:R,nestingEdge:!0}),c.setEdge(M,S,{weight:T,minlen:R,nestingEdge:!0})}),c.parent(y)||c.setEdge(f,j,{weight:0,minlen:p+x[y]})}function s(c){var f={};function h(g,p){var x=c.children(g);x&&x.length&&e.forEach(x,function(y){h(y,p+1)}),f[g]=p}return e.forEach(c.children(),function(g){h(g,1)}),f}function l(c){return e.reduce(c.edges(),function(f,h){return f+c.edge(h).weight},0)}function o(c){var f=c.graph();c.removeNode(f.nestingRoot),delete f.nestingRoot,e.forEach(c.edges(),function(h){var g=c.edge(h);g.nestingEdge&&c.removeEdge(h)})}return ey}var ty,UC;function dU(){if(UC)return ty;UC=1;var e=Ct(),t=xn();ty=n;function n(s){function l(o){var c=s.children(o),f=s.node(o);if(c.length&&e.forEach(c,l),e.has(f,"minRank")){f.borderLeft=[],f.borderRight=[];for(var h=f.minRank,g=f.maxRank+1;h<g;++h)a(s,"borderLeft","_bl",o,f,h),a(s,"borderRight","_br",o,f,h)}}e.forEach(s.children(),l)}function a(s,l,o,c,f,h){var g={width:0,height:0,rank:h,borderType:l},p=f[l][h-1],x=t.addDummyNode(s,"border",g,o);f[l][h]=x,s.setParent(x,c),p&&s.setEdge(p,x,{weight:1})}return ty}var ny,$C;function fU(){if($C)return ny;$C=1;var e=Ct();ny={adjust:t,undo:n};function t(h){var g=h.graph().rankdir.toLowerCase();(g==="lr"||g==="rl")&&a(h)}function n(h){var g=h.graph().rankdir.toLowerCase();(g==="bt"||g==="rl")&&l(h),(g==="lr"||g==="rl")&&(c(h),a(h))}function a(h){e.forEach(h.nodes(),function(g){s(h.node(g))}),e.forEach(h.edges(),function(g){s(h.edge(g))})}function s(h){var g=h.width;h.width=h.height,h.height=g}function l(h){e.forEach(h.nodes(),function(g){o(h.node(g))}),e.forEach(h.edges(),function(g){var p=h.edge(g);e.forEach(p.points,o),e.has(p,"y")&&o(p)})}function o(h){h.y=-h.y}function c(h){e.forEach(h.nodes(),function(g){f(h.node(g))}),e.forEach(h.edges(),function(g){var p=h.edge(g);e.forEach(p.points,f),e.has(p,"x")&&f(p)})}function f(h){var g=h.x;h.x=h.y,h.y=g}return ny}var ry,GC;function hU(){if(GC)return ry;GC=1;var e=Ct();ry=t;function t(n){var a={},s=e.filter(n.nodes(),function(h){return!n.children(h).length}),l=e.max(e.map(s,function(h){return n.node(h).rank})),o=e.map(e.range(l+1),function(){return[]});function c(h){if(!e.has(a,h)){a[h]=!0;var g=n.node(h);o[g.rank].push(h),e.forEach(n.successors(h),c)}}var f=e.sortBy(s,function(h){return n.node(h).rank});return e.forEach(f,c),o}return ry}var ay,VC;function mU(){if(VC)return ay;VC=1;var e=Ct();ay=t;function t(a,s){for(var l=0,o=1;o<s.length;++o)l+=n(a,s[o-1],s[o]);return l}function n(a,s,l){for(var o=e.zipObject(l,e.map(l,function(x,y){return y})),c=e.flatten(e.map(s,function(x){return e.sortBy(e.map(a.outEdges(x),function(y){return{pos:o[y.w],weight:a.edge(y).weight}}),"pos")}),!0),f=1;f<l.length;)f<<=1;var h=2*f-1;f-=1;var g=e.map(new Array(h),function(){return 0}),p=0;return e.forEach(c.forEach(function(x){var y=x.pos+f;g[y]+=x.weight;for(var w=0;y>0;)y%2&&(w+=g[y+1]),y=y-1>>1,g[y]+=x.weight;p+=x.weight*w})),p}return ay}var iy,YC;function pU(){if(YC)return iy;YC=1;var e=Ct();iy=t;function t(n,a){return e.map(a,function(s){var l=n.inEdges(s);if(l.length){var o=e.reduce(l,function(c,f){var h=n.edge(f),g=n.node(f.v);return{sum:c.sum+h.weight*g.order,weight:c.weight+h.weight}},{sum:0,weight:0});return{v:s,barycenter:o.sum/o.weight,weight:o.weight}}else return{v:s}})}return iy}var sy,XC;function gU(){if(XC)return sy;XC=1;var e=Ct();sy=t;function t(s,l){var o={};e.forEach(s,function(f,h){var g=o[f.v]={indegree:0,in:[],out:[],vs:[f.v],i:h};e.isUndefined(f.barycenter)||(g.barycenter=f.barycenter,g.weight=f.weight)}),e.forEach(l.edges(),function(f){var h=o[f.v],g=o[f.w];!e.isUndefined(h)&&!e.isUndefined(g)&&(g.indegree++,h.out.push(o[f.w]))});var c=e.filter(o,function(f){return!f.indegree});return n(c)}function n(s){var l=[];function o(h){return function(g){g.merged||(e.isUndefined(g.barycenter)||e.isUndefined(h.barycenter)||g.barycenter>=h.barycenter)&&a(h,g)}}function c(h){return function(g){g.in.push(h),--g.indegree===0&&s.push(g)}}for(;s.length;){var f=s.pop();l.push(f),e.forEach(f.in.reverse(),o(f)),e.forEach(f.out,c(f))}return e.map(e.filter(l,function(h){return!h.merged}),function(h){return e.pick(h,["vs","i","barycenter","weight"])})}function a(s,l){var o=0,c=0;s.weight&&(o+=s.barycenter*s.weight,c+=s.weight),l.weight&&(o+=l.barycenter*l.weight,c+=l.weight),s.vs=l.vs.concat(s.vs),s.barycenter=o/c,s.weight=c,s.i=Math.min(l.i,s.i),l.merged=!0}return sy}var ly,KC;function xU(){if(KC)return ly;KC=1;var e=Ct(),t=xn();ly=n;function n(l,o){var c=t.partition(l,function(j){return e.has(j,"barycenter")}),f=c.lhs,h=e.sortBy(c.rhs,function(j){return-j.i}),g=[],p=0,x=0,y=0;f.sort(s(!!o)),y=a(g,h,y),e.forEach(f,function(j){y+=j.vs.length,g.push(j.vs),p+=j.barycenter*j.weight,x+=j.weight,y=a(g,h,y)});var w={vs:e.flatten(g,!0)};return x&&(w.barycenter=p/x,w.weight=x),w}function a(l,o,c){for(var f;o.length&&(f=e.last(o)).i<=c;)o.pop(),l.push(f.vs),c++;return c}function s(l){return function(o,c){return o.barycenter<c.barycenter?-1:o.barycenter>c.barycenter?1:l?c.i-o.i:o.i-c.i}}return ly}var oy,WC;function yU(){if(WC)return oy;WC=1;var e=Ct(),t=pU(),n=gU(),a=xU();oy=s;function s(c,f,h,g){var p=c.children(f),x=c.node(f),y=x?x.borderLeft:void 0,w=x?x.borderRight:void 0,j={};y&&(p=e.filter(p,function(M){return M!==y&&M!==w}));var S=t(c,p);e.forEach(S,function(M){if(c.children(M.v).length){var T=s(c,M.v,h,g);j[M.v]=T,e.has(T,"barycenter")&&o(M,T)}});var k=n(S,h);l(k,j);var N=a(k,g);if(y&&(N.vs=e.flatten([y,N.vs,w],!0),c.predecessors(y).length)){var _=c.node(c.predecessors(y)[0]),E=c.node(c.predecessors(w)[0]);e.has(N,"barycenter")||(N.barycenter=0,N.weight=0),N.barycenter=(N.barycenter*N.weight+_.order+E.order)/(N.weight+2),N.weight+=2}return N}function l(c,f){e.forEach(c,function(h){h.vs=e.flatten(h.vs.map(function(g){return f[g]?f[g].vs:g}),!0)})}function o(c,f){e.isUndefined(c.barycenter)?(c.barycenter=f.barycenter,c.weight=f.weight):(c.barycenter=(c.barycenter*c.weight+f.barycenter*f.weight)/(c.weight+f.weight),c.weight+=f.weight)}return oy}var uy,QC;function bU(){if(QC)return uy;QC=1;var e=Ct(),t=tr().Graph;uy=n;function n(s,l,o){var c=a(s),f=new t({compound:!0}).setGraph({root:c}).setDefaultNodeLabel(function(h){return s.node(h)});return e.forEach(s.nodes(),function(h){var g=s.node(h),p=s.parent(h);(g.rank===l||g.minRank<=l&&l<=g.maxRank)&&(f.setNode(h),f.setParent(h,p||c),e.forEach(s[o](h),function(x){var y=x.v===h?x.w:x.v,w=f.edge(y,h),j=e.isUndefined(w)?0:w.weight;f.setEdge(y,h,{weight:s.edge(x).weight+j})}),e.has(g,"minRank")&&f.setNode(h,{borderLeft:g.borderLeft[l],borderRight:g.borderRight[l]}))}),f}function a(s){for(var l;s.hasNode(l=e.uniqueId("_root")););return l}return uy}var cy,ZC;function vU(){if(ZC)return cy;ZC=1;var e=Ct();cy=t;function t(n,a,s){var l={},o;e.forEach(s,function(c){for(var f=n.parent(c),h,g;f;){if(h=n.parent(f),h?(g=l[h],l[h]=f):(g=o,o=f),g&&g!==f){a.setEdge(g,f);return}f=h}})}return cy}var dy,JC;function wU(){if(JC)return dy;JC=1;var e=Ct(),t=hU(),n=mU(),a=yU(),s=bU(),l=vU(),o=tr().Graph,c=xn();dy=f;function f(x){var y=c.maxRank(x),w=h(x,e.range(1,y+1),"inEdges"),j=h(x,e.range(y-1,-1,-1),"outEdges"),S=t(x);p(x,S);for(var k=Number.POSITIVE_INFINITY,N,_=0,E=0;E<4;++_,++E){g(_%2?w:j,_%4>=2),S=c.buildLayerMatrix(x);var M=n(x,S);M<k&&(E=0,N=e.cloneDeep(S),k=M)}p(x,N)}function h(x,y,w){return e.map(y,function(j){return s(x,j,w)})}function g(x,y){var w=new o;e.forEach(x,function(j){var S=j.graph().root,k=a(j,S,w,y);e.forEach(k.vs,function(N,_){j.node(N).order=_}),l(j,w,k.vs)})}function p(x,y){e.forEach(y,function(w){e.forEach(w,function(j,S){x.node(j).order=S})})}return dy}var fy,e4;function jU(){if(e4)return fy;e4=1;var e=Ct(),t=tr().Graph,n=xn();fy={positionX:w,findType1Conflicts:a,findType2Conflicts:s,addConflict:o,hasConflict:c,verticalAlignment:f,horizontalCompaction:h,alignCoordinates:x,findSmallestWidthAlignment:p,balance:y};function a(k,N){var _={};function E(M,T){var R=0,B=0,P=M.length,L=e.last(T);return e.forEach(T,function(H,F){var G=l(k,H),q=G?k.node(G).order:P;(G||H===L)&&(e.forEach(T.slice(B,F+1),function(O){e.forEach(k.predecessors(O),function(D){var X=k.node(D),K=X.order;(K<R||q<K)&&!(X.dummy&&k.node(O).dummy)&&o(_,D,O)})}),B=F+1,R=q)}),T}return e.reduce(N,E),_}function s(k,N){var _={};function E(T,R,B,P,L){var H;e.forEach(e.range(R,B),function(F){H=T[F],k.node(H).dummy&&e.forEach(k.predecessors(H),function(G){var q=k.node(G);q.dummy&&(q.order<P||q.order>L)&&o(_,G,H)})})}function M(T,R){var B=-1,P,L=0;return e.forEach(R,function(H,F){if(k.node(H).dummy==="border"){var G=k.predecessors(H);G.length&&(P=k.node(G[0]).order,E(R,L,F,B,P),L=F,B=P)}E(R,L,R.length,P,T.length)}),R}return e.reduce(N,M),_}function l(k,N){if(k.node(N).dummy)return e.find(k.predecessors(N),function(_){return k.node(_).dummy})}function o(k,N,_){if(N>_){var E=N;N=_,_=E}var M=k[N];M||(k[N]=M={}),M[_]=!0}function c(k,N,_){if(N>_){var E=N;N=_,_=E}return e.has(k[N],_)}function f(k,N,_,E){var M={},T={},R={};return e.forEach(N,function(B){e.forEach(B,function(P,L){M[P]=P,T[P]=P,R[P]=L})}),e.forEach(N,function(B){var P=-1;e.forEach(B,function(L){var H=E(L);if(H.length){H=e.sortBy(H,function(D){return R[D]});for(var F=(H.length-1)/2,G=Math.floor(F),q=Math.ceil(F);G<=q;++G){var O=H[G];T[L]===L&&P<R[O]&&!c(_,L,O)&&(T[O]=L,T[L]=M[L]=M[O],P=R[O])}}})}),{root:M,align:T}}function h(k,N,_,E,M){var T={},R=g(k,N,_,M),B=M?"borderLeft":"borderRight";function P(F,G){for(var q=R.nodes(),O=q.pop(),D={};O;)D[O]?F(O):(D[O]=!0,q.push(O),q=q.concat(G(O))),O=q.pop()}function L(F){T[F]=R.inEdges(F).reduce(function(G,q){return Math.max(G,T[q.v]+R.edge(q))},0)}function H(F){var G=R.outEdges(F).reduce(function(O,D){return Math.min(O,T[D.w]-R.edge(D))},Number.POSITIVE_INFINITY),q=k.node(F);G!==Number.POSITIVE_INFINITY&&q.borderType!==B&&(T[F]=Math.max(T[F],G))}return P(L,R.predecessors.bind(R)),P(H,R.successors.bind(R)),e.forEach(E,function(F){T[F]=T[_[F]]}),T}function g(k,N,_,E){var M=new t,T=k.graph(),R=j(T.nodesep,T.edgesep,E);return e.forEach(N,function(B){var P;e.forEach(B,function(L){var H=_[L];if(M.setNode(H),P){var F=_[P],G=M.edge(F,H);M.setEdge(F,H,Math.max(R(k,L,P),G||0))}P=L})}),M}function p(k,N){return e.minBy(e.values(N),function(_){var E=Number.NEGATIVE_INFINITY,M=Number.POSITIVE_INFINITY;return e.forIn(_,function(T,R){var B=S(k,R)/2;E=Math.max(T+B,E),M=Math.min(T-B,M)}),E-M})}function x(k,N){var _=e.values(N),E=e.min(_),M=e.max(_);e.forEach(["u","d"],function(T){e.forEach(["l","r"],function(R){var B=T+R,P=k[B],L;if(P!==N){var H=e.values(P);L=R==="l"?E-e.min(H):M-e.max(H),L&&(k[B]=e.mapValues(P,function(F){return F+L}))}})})}function y(k,N){return e.mapValues(k.ul,function(_,E){if(N)return k[N.toLowerCase()][E];var M=e.sortBy(e.map(k,E));return(M[1]+M[2])/2})}function w(k){var N=n.buildLayerMatrix(k),_=e.merge(a(k,N),s(k,N)),E={},M;e.forEach(["u","d"],function(R){M=R==="u"?N:e.values(N).reverse(),e.forEach(["l","r"],function(B){B==="r"&&(M=e.map(M,function(F){return e.values(F).reverse()}));var P=(R==="u"?k.predecessors:k.successors).bind(k),L=f(k,M,_,P),H=h(k,M,L.root,L.align,B==="r");B==="r"&&(H=e.mapValues(H,function(F){return-F})),E[R+B]=H})});var T=p(k,E);return x(E,T),y(E,k.graph().align)}function j(k,N,_){return function(E,M,T){var R=E.node(M),B=E.node(T),P=0,L;if(P+=R.width/2,e.has(R,"labelpos"))switch(R.labelpos.toLowerCase()){case"l":L=-R.width/2;break;case"r":L=R.width/2;break}if(L&&(P+=_?L:-L),L=0,P+=(R.dummy?N:k)/2,P+=(B.dummy?N:k)/2,P+=B.width/2,e.has(B,"labelpos"))switch(B.labelpos.toLowerCase()){case"l":L=B.width/2;break;case"r":L=-B.width/2;break}return L&&(P+=_?L:-L),L=0,P}}function S(k,N){return k.node(N).width}return fy}var hy,t4;function kU(){if(t4)return hy;t4=1;var e=Ct(),t=xn(),n=jU().positionX;hy=a;function a(l){l=t.asNonCompoundGraph(l),s(l),e.forEach(n(l),function(o,c){l.node(c).x=o})}function s(l){var o=t.buildLayerMatrix(l),c=l.graph().ranksep,f=0;e.forEach(o,function(h){var g=e.max(e.map(h,function(p){return l.node(p).height}));e.forEach(h,function(p){l.node(p).y=f+g/2}),f+=g+c})}return hy}var my,n4;function SU(){if(n4)return my;n4=1;var e=Ct(),t=iU(),n=sU(),a=oU(),s=xn().normalizeRanks,l=uU(),o=xn().removeEmptyRanks,c=cU(),f=dU(),h=fU(),g=wU(),p=kU(),x=xn(),y=tr().Graph;my=w;function w(V,te){var ne=te&&te.debugTiming?x.time:x.notime;ne("layout",function(){var W=ne(" buildLayoutGraph",function(){return P(V)});ne(" runLayout",function(){j(W,ne)}),ne(" updateInputGraph",function(){S(V,W)})})}function j(V,te){te(" makeSpaceForEdgeLabels",function(){L(V)}),te(" removeSelfEdges",function(){Z(V)}),te(" acyclic",function(){t.run(V)}),te(" nestingGraph.run",function(){c.run(V)}),te(" rank",function(){a(x.asNonCompoundGraph(V))}),te(" injectEdgeLabelProxies",function(){H(V)}),te(" removeEmptyRanks",function(){o(V)}),te(" nestingGraph.cleanup",function(){c.cleanup(V)}),te(" normalizeRanks",function(){s(V)}),te(" assignRankMinMax",function(){F(V)}),te(" removeEdgeLabelProxies",function(){G(V)}),te(" normalize.run",function(){n.run(V)}),te(" parentDummyChains",function(){l(V)}),te(" addBorderSegments",function(){f(V)}),te(" order",function(){g(V)}),te(" insertSelfEdges",function(){z(V)}),te(" adjustCoordinateSystem",function(){h.adjust(V)}),te(" position",function(){p(V)}),te(" positionSelfEdges",function(){$(V)}),te(" removeBorderNodes",function(){K(V)}),te(" normalize.undo",function(){n.undo(V)}),te(" fixupEdgeLabelCoords",function(){D(V)}),te(" undoCoordinateSystem",function(){h.undo(V)}),te(" translateGraph",function(){q(V)}),te(" assignNodeIntersects",function(){O(V)}),te(" reversePoints",function(){X(V)}),te(" acyclic.undo",function(){t.undo(V)})}function S(V,te){e.forEach(V.nodes(),function(ne){var W=V.node(ne),Y=te.node(ne);W&&(W.x=Y.x,W.y=Y.y,te.children(ne).length&&(W.width=Y.width,W.height=Y.height))}),e.forEach(V.edges(),function(ne){var W=V.edge(ne),Y=te.edge(ne);W.points=Y.points,e.has(Y,"x")&&(W.x=Y.x,W.y=Y.y)}),V.graph().width=te.graph().width,V.graph().height=te.graph().height}var k=["nodesep","edgesep","ranksep","marginx","marginy"],N={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},_=["acyclicer","ranker","rankdir","align"],E=["width","height"],M={width:0,height:0},T=["minlen","weight","width","height","labeloffset"],R={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},B=["labelpos"];function P(V){var te=new y({multigraph:!0,compound:!0}),ne=I(V.graph());return te.setGraph(e.merge({},N,Q(ne,k),e.pick(ne,_))),e.forEach(V.nodes(),function(W){var Y=I(V.node(W));te.setNode(W,e.defaults(Q(Y,E),M)),te.setParent(W,V.parent(W))}),e.forEach(V.edges(),function(W){var Y=I(V.edge(W));te.setEdge(W,e.merge({},R,Q(Y,T),e.pick(Y,B)))}),te}function L(V){var te=V.graph();te.ranksep/=2,e.forEach(V.edges(),function(ne){var W=V.edge(ne);W.minlen*=2,W.labelpos.toLowerCase()!=="c"&&(te.rankdir==="TB"||te.rankdir==="BT"?W.width+=W.labeloffset:W.height+=W.labeloffset)})}function H(V){e.forEach(V.edges(),function(te){var ne=V.edge(te);if(ne.width&&ne.height){var W=V.node(te.v),Y=V.node(te.w),ae={rank:(Y.rank-W.rank)/2+W.rank,e:te};x.addDummyNode(V,"edge-proxy",ae,"_ep")}})}function F(V){var te=0;e.forEach(V.nodes(),function(ne){var W=V.node(ne);W.borderTop&&(W.minRank=V.node(W.borderTop).rank,W.maxRank=V.node(W.borderBottom).rank,te=e.max(te,W.maxRank))}),V.graph().maxRank=te}function G(V){e.forEach(V.nodes(),function(te){var ne=V.node(te);ne.dummy==="edge-proxy"&&(V.edge(ne.e).labelRank=ne.rank,V.removeNode(te))})}function q(V){var te=Number.POSITIVE_INFINITY,ne=0,W=Number.POSITIVE_INFINITY,Y=0,ae=V.graph(),he=ae.marginx||0,ke=ae.marginy||0;function _e(oe){var je=oe.x,Se=oe.y,Ae=oe.width,se=oe.height;te=Math.min(te,je-Ae/2),ne=Math.max(ne,je+Ae/2),W=Math.min(W,Se-se/2),Y=Math.max(Y,Se+se/2)}e.forEach(V.nodes(),function(oe){_e(V.node(oe))}),e.forEach(V.edges(),function(oe){var je=V.edge(oe);e.has(je,"x")&&_e(je)}),te-=he,W-=ke,e.forEach(V.nodes(),function(oe){var je=V.node(oe);je.x-=te,je.y-=W}),e.forEach(V.edges(),function(oe){var je=V.edge(oe);e.forEach(je.points,function(Se){Se.x-=te,Se.y-=W}),e.has(je,"x")&&(je.x-=te),e.has(je,"y")&&(je.y-=W)}),ae.width=ne-te+he,ae.height=Y-W+ke}function O(V){e.forEach(V.edges(),function(te){var ne=V.edge(te),W=V.node(te.v),Y=V.node(te.w),ae,he;ne.points?(ae=ne.points[0],he=ne.points[ne.points.length-1]):(ne.points=[],ae=Y,he=W),ne.points.unshift(x.intersectRect(W,ae)),ne.points.push(x.intersectRect(Y,he))})}function D(V){e.forEach(V.edges(),function(te){var ne=V.edge(te);if(e.has(ne,"x"))switch((ne.labelpos==="l"||ne.labelpos==="r")&&(ne.width-=ne.labeloffset),ne.labelpos){case"l":ne.x-=ne.width/2+ne.labeloffset;break;case"r":ne.x+=ne.width/2+ne.labeloffset;break}})}function X(V){e.forEach(V.edges(),function(te){var ne=V.edge(te);ne.reversed&&ne.points.reverse()})}function K(V){e.forEach(V.nodes(),function(te){if(V.children(te).length){var ne=V.node(te),W=V.node(ne.borderTop),Y=V.node(ne.borderBottom),ae=V.node(e.last(ne.borderLeft)),he=V.node(e.last(ne.borderRight));ne.width=Math.abs(he.x-ae.x),ne.height=Math.abs(Y.y-W.y),ne.x=ae.x+ne.width/2,ne.y=W.y+ne.height/2}}),e.forEach(V.nodes(),function(te){V.node(te).dummy==="border"&&V.removeNode(te)})}function Z(V){e.forEach(V.edges(),function(te){if(te.v===te.w){var ne=V.node(te.v);ne.selfEdges||(ne.selfEdges=[]),ne.selfEdges.push({e:te,label:V.edge(te)}),V.removeEdge(te)}})}function z(V){var te=x.buildLayerMatrix(V);e.forEach(te,function(ne){var W=0;e.forEach(ne,function(Y,ae){var he=V.node(Y);he.order=ae+W,e.forEach(he.selfEdges,function(ke){x.addDummyNode(V,"selfedge",{width:ke.label.width,height:ke.label.height,rank:he.rank,order:ae+ ++W,e:ke.e,label:ke.label},"_se")}),delete he.selfEdges})})}function $(V){e.forEach(V.nodes(),function(te){var ne=V.node(te);if(ne.dummy==="selfedge"){var W=V.node(ne.e.v),Y=W.x+W.width/2,ae=W.y,he=ne.x-Y,ke=W.height/2;V.setEdge(ne.e,ne.label),V.removeNode(te),ne.label.points=[{x:Y+2*he/3,y:ae-ke},{x:Y+5*he/6,y:ae-ke},{x:Y+he,y:ae},{x:Y+5*he/6,y:ae+ke},{x:Y+2*he/3,y:ae+ke}],ne.label.x=ne.x,ne.label.y=ne.y}})}function Q(V,te){return e.mapValues(e.pick(V,te),Number)}function I(V){var te={};return e.forEach(V,function(ne,W){te[W.toLowerCase()]=ne}),te}return my}var py,r4;function _U(){if(r4)return py;r4=1;var e=Ct(),t=xn(),n=tr().Graph;py={debugOrdering:a};function a(s){var l=t.buildLayerMatrix(s),o=new n({compound:!0,multigraph:!0}).setGraph({});return e.forEach(s.nodes(),function(c){o.setNode(c,{label:c}),o.setParent(c,"layer"+s.node(c).rank)}),e.forEach(s.edges(),function(c){o.setEdge(c.v,c.w,{},c.name)}),e.forEach(l,function(c,f){var h="layer"+f;o.setNode(h,{rank:"same"}),e.reduce(c,function(g,p){return o.setEdge(g,p,{style:"invis"}),p})}),o}return py}var gy,a4;function NU(){return a4||(a4=1,gy="0.8.5"),gy}var xy,i4;function CU(){return i4||(i4=1,xy={graphlib:tr(),layout:SU(),debug:_U(),util:{time:xn().time,notime:xn().notime},version:NU()}),xy}var EU=CU();const s4=Ds(EU),TU={pending:"#D4B896",running:"#2196F3",completed:"#4CAF50",failed:"#E53935",stopped:"#FF9800",merged:"#9C27B0"},AU={pending:"",running:"ring-2 ring-status-running/50 animate-pulse",completed:"",failed:"ring-1 ring-status-error/30",stopped:"",merged:""};function MU({data:e}){const t=e,{todo:n,allTodos:a,selected:s,onStart:l,onStop:o,onDelete:c,onMerge:f,onCleanup:h,onRetry:g,onSelect:p}=t,{t:x}=Ue(),y=n.status==="pending"||n.status==="failed"||n.status==="stopped",w=n.status==="running",j=n.status==="completed",S=n.status!=="running"&&n.status!=="pending"&&(n.worktree_path||n.branch_name),k=n.status==="completed"||n.status==="failed"||n.status==="stopped",N=n.depends_on?a.find(M=>M.id===n.depends_on):null,_=!!N&&N.status!=="completed",E=TU[n.status];return d.jsxs("div",{className:`bg-theme-card rounded-xl shadow-soft min-w-[240px] max-w-[280px] overflow-hidden transition-all duration-200 ${AU[n.status]} ${s?"ring-2 ring-accent shadow-lg":""}`,style:{borderLeft:`4px solid ${E}`},children:[d.jsx(Rs,{type:"target",position:Ie.Top,className:"!w-3 !h-3 !bg-cyan-500 !border-2 !border-white !-top-1.5"}),d.jsxs("div",{className:"px-3 py-2.5 cursor-pointer hover:bg-warm-50 transition-colors",onClick:()=>p(n.id),children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsxs("span",{className:"text-[10px] font-mono text-warm-400",children:["#",n.priority]}),d.jsx("span",{className:"flex-1 text-xs text-warm-800 font-medium truncate",title:n.title,children:n.title}),d.jsx(kb,{status:n.status})]}),d.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[n.cli_tool&&d.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-[9px] font-mono font-medium bg-status-merged/10 text-status-merged",children:io(n.cli_tool||"claude").label}),N&&d.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[9px] font-mono bg-cyan-500/10 text-cyan-600",children:[d.jsx("svg",{className:"h-2.5 w-2.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),N.title.length>15?N.title.slice(0,15)+"...":N.title]})]})]}),d.jsxs("div",{className:"flex items-center justify-end gap-0 px-2 py-1.5 border-t border-warm-100 bg-warm-50/50",children:[y&&d.jsx("button",{onClick:M=>{M.stopPropagation(),l(n.id,"headless")},className:"p-1 text-status-success/60 hover:text-status-success hover:bg-status-success/10 rounded transition-colors",title:x(_?"todo.startWithDependency":"todo.startHeadless"),children:d.jsx("svg",{className:"h-3 w-3",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M8 5v14l11-7z"})})}),w&&d.jsx("button",{onClick:M=>{M.stopPropagation(),o(n.id)},className:"p-1 text-status-error/60 hover:text-status-error hover:bg-status-error/10 rounded transition-colors",title:x("todo.stop"),children:d.jsx("svg",{className:"h-3 w-3",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M6 6h12v12H6z"})})}),j&&d.jsx("button",{onClick:M=>{M.stopPropagation(),f(n.id)},className:"p-1 text-status-merged/60 hover:text-status-merged hover:bg-status-merged/10 rounded transition-colors",title:x("todo.merge"),children:d.jsx("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})})}),S&&d.jsx("button",{onClick:M=>{M.stopPropagation(),h(n.id)},className:"p-1 text-orange-500/60 hover:text-orange-500 hover:bg-orange-500/10 rounded transition-colors",title:x("todo.cleanup"),children:d.jsx("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"})})}),k&&d.jsx("button",{onClick:M=>{M.stopPropagation(),g(n.id,"headless")},className:"p-1 text-cyan-500/60 hover:text-cyan-500 hover:bg-cyan-500/10 rounded transition-colors",title:x("todo.retry"),children:d.jsx("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h4.586M20 20v-5h-4.586M4.929 9A8 8 0 0119.071 9M19.071 15A8 8 0 014.929 15"})})}),d.jsx("button",{onClick:M=>{M.stopPropagation(),c(n.id)},className:"p-1 text-warm-400 hover:text-status-error hover:bg-status-error/10 rounded transition-colors",title:x("todo.delete"),children:d.jsx("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]}),d.jsx(Rs,{type:"source",position:Ie.Bottom,className:"!w-3 !h-3 !bg-accent !border-2 !border-white !-bottom-1.5"})]})}const RU=C.memo(MU);function LU({todo:e,allTodos:t,onClose:n,onEdit:a,onStart:s,onStop:l,onMerge:o,onCleanup:c,onRetry:f,onContinue:h,onFix:g,onEvent:p,isInteractive:x,onSendInput:y,debugLogging:w,showTokenUsage:j}){const[S,k]=C.useState([]),[N,_]=C.useState(!1),[E,M]=C.useState(!1),[T,R]=C.useState(!1),[B,P]=C.useState(null),[L,H]=C.useState(!1),[F,G]=C.useState(null),[q,O]=C.useState(!1),[D,X]=C.useState(!1),[K,Z]=C.useState(""),[z,$]=C.useState(!1),[Q,I]=C.useState(null),{t:V}=Ue(),te=e.status==="pending"||e.status==="failed"||e.status==="stopped",ne=e.status==="running",W=e.status==="completed"||e.status==="stopped"||e.status==="merged",Y=e.status==="completed",ae=e.status==="completed"||e.status==="failed"||e.status==="stopped",he=!!h&&e.status==="completed"&&!!e.worktree_path,ke=e.status!=="running"&&e.status!=="pending"&&(e.worktree_path||e.branch_name),_e=e.status==="completed"||e.status==="failed"||e.status==="stopped"||e.status==="merged",oe=e.images?JSON.parse(e.images):[],je=e.depends_on?t.find(we=>we.id===e.depends_on):null,Se=!!je&&je.status!=="completed",Ae=t.find(we=>we.depends_on===e.id&&we.merged_from_branch);C.useEffect(()=>{k([]),_(!1),G(null),O(!1),P(null),R(!1),zE(e.id).then(we=>{k(we),_(!0)}).catch(()=>{_(!0)})},[e.id]),C.useEffect(()=>{_e&&!q&&IE(e.id).then(we=>{G(we),O(!0)}).catch(()=>{O(!0)})},[_e,q,e.id]),C.useEffect(()=>p(we=>{if(we.type==="todo:log"&&we.todoId===e.id&&we.message){const De={id:`ws-${Date.now()}-${Math.random()}`,todo_id:e.id,log_type:we.logType||"output",message:we.message,created_at:new Date().toISOString()};k(Be=>[...Be,De])}if(we.type==="todo:commit"&&we.todoId===e.id&&we.message){const De={id:`ws-commit-${Date.now()}-${Math.random()}`,todo_id:e.id,log_type:"commit",message:`${we.commitHash?`[${we.commitHash}] `:""}${we.message}`,created_at:new Date().toISOString()};k(Be=>[...Be,De])}}),[p,e.id]);const se=async()=>{if(T){R(!1);return}H(!0);try{const we=await qE(e.id);P(we),R(!0)}catch{}finally{H(!1)}},Ee=async()=>{try{const{files:we}=await ME(e.project_id,e.id);we.length>0&&window.open(`/api/projects/${e.project_id}/debug-logs/${encodeURIComponent(we[0].name)}`,"_blank")}catch{}},Te=we=>{if(we<60)return`${we}s`;const De=Math.floor(we/60),Be=we%60;if(De<60)return Be>0?`${De}m ${Be}s`:`${De}m`;const ie=Math.floor(De/60),xe=De%60;return xe>0?`${ie}h ${xe}m`:`${ie}h`},Me=we=>we>=1e6?`${(we/1e6).toFixed(1)}M`:we>=1e3?`${(we/1e3).toFixed(1)}k`:String(we);return E?d.jsx("div",{className:"w-[380px] border-l border-warm-200 bg-theme-card overflow-y-auto p-4",children:d.jsx(Pc,{initialTitle:e.title,initialDescription:e.description??void 0,initialCliTool:e.cli_tool??void 0,initialCliModel:e.cli_model??void 0,initialDependsOn:e.depends_on??void 0,initialMaxTurns:e.max_turns??void 0,existingImages:oe,todoId:e.id,availableTodos:t.filter(we=>we.id!==e.id),onDeleteImage:async we=>{await BE(e.id,we)},onSave:async(we,De,Be,ie,xe,J,fe)=>{await a(e.id,we,De,Be,ie,J,fe),xe&&xe.length>0&&await jb(e.id,xe.map(be=>({name:be.name,data:be.data}))),M(!1)},onCancel:()=>M(!1)})}):d.jsxs("div",{className:"w-[380px] border-l border-warm-200 bg-theme-card overflow-y-auto animate-slide-up",children:[d.jsxs("div",{className:"sticky top-0 bg-theme-card border-b border-warm-200 px-4 py-3 flex items-center gap-2 z-10",children:[d.jsx(kb,{status:e.status}),d.jsx("span",{className:"flex-1 text-sm font-medium text-warm-800 truncate",children:e.title}),d.jsx("button",{onClick:()=>M(!0),className:"p-1.5 text-warm-400 hover:text-accent hover:bg-accent/10 rounded-lg transition-colors",title:V("todo.edit"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),d.jsx("button",{onClick:n,className:"p-1.5 text-warm-400 hover:text-warm-600 hover:bg-warm-100 rounded-lg transition-colors",children:d.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("div",{className:"px-4 py-4 space-y-4",children:[d.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[te&&d.jsx(d.Fragment,{children:d.jsx("button",{onClick:()=>s(e.id,"headless"),className:"btn-ghost text-xs py-1.5 text-status-success",title:V(Se?"todo.startWithDependency":"todo.startHeadless"),children:V("todo.startHeadless")})}),ne&&d.jsx("button",{onClick:()=>l(e.id),className:"btn-ghost text-xs py-1.5 text-status-error",children:V("todo.stop")}),W&&d.jsx("button",{onClick:se,disabled:L,className:"btn-ghost text-xs py-1.5 text-status-info disabled:opacity-30",children:V("todo.viewDiff")}),w&&_e&&d.jsx("button",{onClick:Ee,className:"btn-ghost text-xs py-1.5 text-purple-600",children:V("todo.viewDebugLog")}),Y&&d.jsx("button",{onClick:()=>o(e.id),className:"btn-ghost text-xs py-1.5 text-status-merged",children:V("todo.merge")}),ke&&d.jsx("button",{onClick:()=>c(e.id),className:"btn-ghost text-xs py-1.5 text-orange-500",children:V("todo.cleanup")}),he&&d.jsx("button",{onClick:()=>{X(we=>!we),I(null)},disabled:z,className:"btn-ghost text-xs py-1.5 text-emerald-500",children:V("todo.continue")}),ae&&d.jsx("button",{onClick:()=>f(e.id,"headless"),className:"btn-ghost text-xs py-1.5 text-cyan-500",children:V("todo.retry")})]}),D&&h&&d.jsxs("div",{className:"border border-emerald-200 rounded-lg px-3 py-2 bg-emerald-50/50 space-y-2",children:[d.jsxs("label",{className:"text-xs font-medium text-emerald-600",children:[V("todo.continuePromptLabel"),(e.round_count??1)>1&&d.jsxs("span",{className:"ml-2 text-emerald-500/70",children:["(",V("todo.roundLabel")," ",e.round_count,")"]})]}),d.jsx("textarea",{value:K,onChange:we=>Z(we.target.value),placeholder:V("todo.continuePromptPlaceholder"),rows:3,disabled:z,className:"w-full bg-theme-card border border-emerald-200 rounded-lg px-2 py-1.5 text-xs text-warm-800 focus:border-emerald-400 focus:outline-none focus:ring-2 focus:ring-emerald-400/20 resize-y"}),Q&&d.jsx("p",{className:"text-xs text-status-error",children:Q}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:async()=>{const we=K.trim();if(!we){I(V("todo.continuePromptRequired"));return}$(!0),I(null);try{await h(e.id,we,"headless"),X(!1),Z("")}catch(De){I(De instanceof Error?De.message:"Continue failed")}finally{$(!1)}},disabled:z||!K.trim(),className:"btn-primary text-xs py-1.5 !bg-emerald-500 hover:!bg-emerald-600 disabled:opacity-30",children:V(z?"todo.continuing":"todo.confirmContinue")}),d.jsx("button",{onClick:()=>{X(!1),I(null)},disabled:z,className:"btn-ghost text-xs py-1.5",children:V("scheduleForm.cancel")})]})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-warm-500 uppercase tracking-wider mb-1",children:V("todo.description")}),d.jsx("p",{className:"text-xs text-warm-600 whitespace-pre-wrap leading-relaxed",children:e.description||V("todo.noDescription")})]}),oe.length>0&&d.jsxs("div",{children:[d.jsxs("h4",{className:"text-xs font-semibold text-warm-500 uppercase tracking-wider mb-1",children:[V("todo.attachedImages")," (",oe.length,")"]}),d.jsx("div",{className:"flex flex-wrap gap-2",children:oe.map(we=>d.jsx("a",{href:ao(e.id,we.id),target:"_blank",rel:"noopener noreferrer",children:d.jsx("img",{src:ao(e.id,we.id),alt:we.originalName,className:"h-16 w-16 object-cover rounded-lg border border-warm-200 hover:border-accent transition-colors"})},we.id))})]}),d.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[d.jsxs("span",{className:"text-[10px] font-mono text-warm-400 badge bg-warm-100",children:["#",e.priority]}),e.cli_tool&&d.jsxs("span",{className:"badge text-[10px] font-mono bg-status-merged/10 text-status-merged",children:[io(e.cli_tool||"claude").label,e.cli_model&&d.jsxs("span",{className:"text-warm-400 ml-1",children:["/ ",e.cli_model]})]}),je&&d.jsxs("span",{className:"badge text-[10px] font-mono bg-cyan-500/10 text-cyan-600",children:[V("todo.dependsOn"),": ",je.title.length>20?je.title.slice(0,20)+"...":je.title]})]}),e.branch_name&&d.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[d.jsxs("span",{className:"badge text-[10px] bg-status-running/10 text-status-running",children:[V("todo.branch"),": ",e.branch_name]}),e.merged_from_branch&&d.jsxs("span",{className:"badge text-[10px] bg-purple-500/10 text-purple-600",children:[V("todo.mergedFrom"),": ",e.merged_from_branch]}),!e.worktree_path&&Ae&&d.jsxs("span",{className:"badge text-[10px] bg-amber-500/10 text-amber-600",children:[V("todo.transferredTo"),": ",Ae.title.length>20?Ae.title.slice(0,20)+"...":Ae.title]})]}),e.status==="failed"&&S.length>0&&(()=>{const we=S.filter(De=>De.log_type==="error");return we.length===0?null:d.jsxs("div",{className:"rounded-lg border border-status-error/30 bg-status-error/5 overflow-hidden",children:[d.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-status-error/10 border-b border-status-error/20",children:[d.jsx("h4",{className:"text-[10px] font-semibold text-status-error uppercase tracking-wider",children:V("failure.title")}),g&&d.jsx("button",{onClick:()=>g(e,we),className:"text-[10px] font-medium text-amber-500 hover:text-amber-600",children:V("failure.fix")})]}),d.jsx("div",{className:"px-3 py-2 space-y-1 max-h-32 overflow-y-auto",children:we.map(De=>d.jsx("div",{className:"text-[10px] font-mono text-status-error whitespace-pre-wrap break-all",children:De.message},De.id))})]})})(),_e&&F&&d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex flex-wrap gap-2",children:[F.duration_seconds!==null&&d.jsx("span",{className:"text-[10px] font-mono badge bg-warm-100 text-warm-600",children:Te(F.duration_seconds)}),F.commits.length>0&&d.jsxs("span",{className:"text-[10px] font-mono badge bg-status-success/10 text-status-success",children:[F.commits.length," commits"]}),F.diff_stats.files_changed>0&&d.jsxs("span",{className:"text-[10px] font-mono badge bg-status-info/10 text-status-info",children:[F.diff_stats.files_changed," files",d.jsxs("span",{className:"text-status-success ml-1",children:["+",F.diff_stats.insertions]}),d.jsxs("span",{className:"text-status-error ml-1",children:["-",F.diff_stats.deletions]})]}),j&&F.token_usage&&F.token_usage.input_tokens!==null&&d.jsxs("span",{className:"text-[10px] font-mono badge bg-purple-100 text-purple-700",children:[Me(F.token_usage.input_tokens)," in / ",Me(F.token_usage.output_tokens??0)," out"]})]}),F.commits.length>0&&d.jsxs("div",{children:[d.jsx("h4",{className:"text-[10px] font-semibold text-warm-500 uppercase tracking-wider mb-1",children:V("result.commitHistory")}),d.jsx("div",{className:"space-y-0.5",children:F.commits.map((we,De)=>d.jsxs("div",{className:"flex items-start gap-1.5 text-[10px]",children:[d.jsx("span",{className:"font-mono text-status-info flex-shrink-0",children:we.hash.slice(0,7)}),d.jsx("span",{className:"text-warm-700 truncate",children:we.message})]},De))})]})]}),T&&B&&d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("h4",{className:"text-[10px] font-semibold text-warm-500 uppercase tracking-wider",children:V("todo.diffOutput")}),d.jsxs("div",{className:"flex gap-2 text-[10px]",children:[d.jsxs("span",{className:"text-status-success",children:["+",B.stats.insertions]}),d.jsxs("span",{className:"text-status-error",children:["-",B.stats.deletions]})]})]}),d.jsx("pre",{className:"h-48 overflow-auto bg-warm-800 rounded-lg p-3 font-mono text-[10px] leading-relaxed",children:B.diff?B.diff.split(`
90
+ `).map((we,De)=>{let Be="text-warm-400";return we.startsWith("+")&&!we.startsWith("+++")?Be="text-green-400":we.startsWith("-")&&!we.startsWith("---")?Be="text-red-400":we.startsWith("@@")?Be="text-blue-400":we.startsWith("diff ")&&(Be="text-amber-300 font-bold"),d.jsx("div",{className:Be,children:we},De)}):d.jsx("span",{className:"text-warm-500 italic",children:V("log.noChanges")})})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-[10px] font-semibold text-warm-500 uppercase tracking-wider mb-1",children:V("todo.systemLog")}),d.jsx(YE,{logs:S,interactive:x&&e.status==="running",todoId:e.id,onSendInput:y})]})]})]})}const DU={taskNode:RU},l4=260,o4=100;function u4(e){const t=new s4.graphlib.Graph;t.setDefaultEdgeLabel(()=>({})),t.setGraph({rankdir:"TB",nodesep:60,ranksep:100});for(const a of e)t.setNode(a.id,{width:l4,height:o4});for(const a of e)a.depends_on&&t.setEdge(a.depends_on,a.id);s4.layout(t);const n=new Map;for(const a of e){const s=t.node(a.id);s&&n.set(a.id,{x:s.x-l4/2,y:s.y-o4/2})}return{nodePositions:n}}function c4(e,t,n){let a=n;const s=new Set;for(;a;){if(a===t)return!0;if(s.has(a))return!1;s.add(a);const l=e.find(o=>o.id===a);a=(l==null?void 0:l.depends_on)??null}return!1}const yy={running:"#2196F3",completed:"#4CAF50",failed:"#E53935",stopped:"#FF9800",merged:"#9C27B0",pending:"#B8A88A"};function OU({todos:e,projectCliTool:t,projectCliModel:n,onAddTodo:a,onStartTodo:s,onStopTodo:l,onDeleteTodo:o,onEditTodo:c,onMergeTodo:f,onCleanupTodo:h,onRetryTodo:g,onContinueTodo:p,onFixTodo:x,onUpdateDependency:y,onUpdatePosition:w,onEvent:j,onSendInput:S,interactiveTodos:k,debugLogging:N,showTokenUsage:_}){const[E,M]=C.useState(null),[T,R]=C.useState(!1),{t:B}=Ue(),{theme:P}=OE(),L=P==="dark",H=C.useCallback(ae=>{M(he=>he===ae?null:ae)},[]),{initialNodes:F,initialEdges:G}=C.useMemo(()=>{const he=e.some(oe=>oe.position_x==null||oe.position_y==null)?u4(e).nodePositions:null,ke=e.map(oe=>{var je,Se;return{id:oe.id,type:"taskNode",position:{x:oe.position_x??((je=he==null?void 0:he.get(oe.id))==null?void 0:je.x)??0,y:oe.position_y??((Se=he==null?void 0:he.get(oe.id))==null?void 0:Se.y)??0},data:{todo:oe,allTodos:e,selected:oe.id===E,onStart:s,onStop:l,onDelete:o,onMerge:f,onCleanup:h,onRetry:g,onFix:x,onSelect:H}}}),_e=e.filter(oe=>oe.depends_on).map(oe=>{var Se;const je=((Se=e.find(Ae=>Ae.id===oe.depends_on))==null?void 0:Se.status)??"pending";return{id:`e-${oe.depends_on}-${oe.id}`,source:oe.depends_on,target:oe.id,type:"smoothstep",animated:je==="running",style:{stroke:yy[je]??"#B8A88A",strokeWidth:2},markerEnd:{type:ho.ArrowClosed,width:16,height:16,color:yy[je]??"#B8A88A"}}});return{initialNodes:ke,initialEdges:_e}},[e,E,s,l,o,f,h,g,x,H]),[q,O,D]=qB(F),[X,K,Z]=IB(G);C.useEffect(()=>{O(F),K(G)},[F,G,O,K]);const z=C.useCallback(ae=>{!ae.source||!ae.target||!y||c4(e,ae.source,ae.target)||y(ae.target,ae.source)},[e,y]),$=C.useCallback(ae=>{if(y)for(const he of ae)y(he.target,null)},[y]),Q=C.useCallback((ae,he)=>{w&&w(he.id,he.position.x,he.position.y)},[w]),I=C.useRef(!0),V=C.useCallback(()=>{I.current=!1},[]),te=C.useCallback((ae,he)=>{I.current=!0,!(!y||!he.source||!he.target)&&(y(ae.target,null),c4(e,he.source,he.target)||y(he.target,he.source))},[e,y]),ne=C.useCallback((ae,he)=>{!I.current&&y&&y(he.target,null),I.current=!0},[y]),W=C.useCallback(()=>{const{nodePositions:ae}=u4(e);if(O(he=>he.map(ke=>{const _e=ae.get(ke.id);return _e?{...ke,position:_e}:ke})),w)for(const[he,ke]of ae)w(he,ke.x,ke.y)},[e,O,w]),Y=E?e.find(ae=>ae.id===E):null;return d.jsxs("div",{className:"flex gap-0 h-[600px]",children:[d.jsxs("div",{className:"flex-1 rounded-xl border border-warm-200 overflow-hidden bg-warm-50 ",children:[d.jsxs(zB,{nodes:q,edges:X,onNodesChange:D,onEdgesChange:Z,onConnect:z,onEdgesDelete:$,onReconnectStart:V,onReconnect:te,onReconnectEnd:ne,onNodeDragStop:Q,nodeTypes:DU,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:2,deleteKeyCode:"Delete",proOptions:{hideAttribution:!0},children:[d.jsx(UB,{variant:Kr.Dots,gap:20,size:1,color:L?"#4A4A60":"#D4B896",style:{opacity:.3}}),d.jsx(WB,{showInteractive:!1,className:"!bg-theme-card !border-warm-200 !shadow-soft !rounded-lg"}),d.jsx(uH,{nodeColor:ae=>{var _e;const he=ae.data,ke=((_e=he==null?void 0:he.todo)==null?void 0:_e.status)??"pending";return yy[ke]??"#B8A88A"},maskColor:L?"rgba(23, 23, 31, 0.7)":"rgba(245, 241, 235, 0.7)",className:"!bg-theme-card !border-warm-200 !shadow-soft !rounded-lg"})]}),d.jsxs("div",{className:"absolute top-3 right-3 flex items-center gap-2 z-10",children:[d.jsxs("button",{onClick:W,className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium bg-theme-card border border-warm-200 rounded-lg shadow-soft hover:bg-warm-50 text-warm-600 transition-colors",title:B("graph.autoLayout"),children:[d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})}),B("graph.autoLayout")]}),d.jsxs("button",{onClick:()=>R(!0),className:"btn-primary text-xs py-1.5",children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})}),B("todos.add")]})]})]}),Y&&d.jsx(LU,{todo:Y,allTodos:e,onClose:()=>M(null),onEdit:c,onStart:s,onStop:l,onMerge:f,onCleanup:h,onRetry:g,onContinue:p,onFix:x,onEvent:j,isInteractive:k.has(Y.id),onSendInput:S,debugLogging:N,showTokenUsage:_}),T&&d.jsx("div",{className:"fixed inset-0 bg-black/30 z-50 flex items-center justify-center p-4",onClick:()=>R(!1),children:d.jsx("div",{className:"w-full max-w-lg",onClick:ae=>ae.stopPropagation(),children:d.jsx(Pc,{projectCliTool:t,projectCliModel:n,availableTodos:e,onSave:async(ae,he,ke,_e,oe,je,Se)=>{await a(ae,he,ke,_e,oe,je,Se),R(!1)},onCancel:()=>R(!1)})})})]})}function d4(e,t,n){let a=n;const s=new Set;for(;a;){if(a===t)return!0;if(s.has(a))return!1;s.add(a);const l=e.find(o=>o.id===a);a=(l==null?void 0:l.depends_on)??null}return!1}function zU({todos:e,projectCliTool:t,projectCliModel:n,onAddTodo:a,onStartTodo:s,onStopTodo:l,onDeleteTodo:o,onEditTodo:c,onMergeTodo:f,onMergeChain:h,onCleanupTodo:g,onRetryTodo:p,onContinueTodo:x,onFixTodo:y,onScheduleTodo:w,onUpdateDependency:j,onUpdatePosition:S,onEvent:k,onSendInput:N,interactiveTodos:_,debugLogging:E,showTokenUsage:M}){var _e;const[T,R]=C.useState(!1),[B,P]=C.useState(null),[L,H]=C.useState(null),[F,G]=C.useState(()=>{try{return localStorage.getItem("todoViewMode")||"list"}catch{return"list"}}),{t:q}=Ue(),O=C.useCallback(oe=>{G(oe);try{localStorage.setItem("todoViewMode",oe)}catch{}},[]),D=(()=>{const oe=[...e].sort((Te,Me)=>Te.priority-Me.priority),je=new Map,Se=[];for(const Te of oe)if(Te.depends_on){const Me=je.get(Te.depends_on)||[];Me.push(Te),je.set(Te.depends_on,Me)}else Se.push(Te);const Ae=[],se=new Set,Ee=(Te,Me)=>{if(se.has(Te.id))return;se.add(Te.id),Ae.push({todo:Te,depth:Me});const we=je.get(Te.id);if(we)for(const De of we)Ee(De,Me+1)};for(const Te of Se)Ee(Te,0);for(const Te of oe)se.has(Te.id)||Ae.push({todo:Te,depth:0});return Ae})(),{completedChainRoots:X,completedChainMembers:K}=C.useMemo(()=>{const oe=new Map;for(const se of e)if(se.depends_on){const Ee=oe.get(se.depends_on)||[];Ee.push(se.id),oe.set(se.depends_on,Ee)}const je=e.filter(se=>!se.depends_on&&oe.has(se.id)),Se=new Map,Ae=new Set;for(const se of je){const Ee=[],Te=Me=>{if(!e.find(Be=>Be.id===Me))return;Ee.push(Me);const De=oe.get(Me)||[];for(const Be of De)Te(Be)};if(Te(se.id),Ee.length>=2&&Ee.every(Me=>{const we=e.find(De=>De.id===Me);return(we==null?void 0:we.status)==="completed"||(we==null?void 0:we.status)==="merged"})){Se.set(se.id,Ee.length);for(const Me of Ee)Ae.add(Me)}}return{completedChainRoots:Se,completedChainMembers:Ae}},[e]),[Z,z]=C.useState(null),[$,Q]=C.useState(null),I=C.useCallback(async oe=>{if(h){z(oe),Q(null);try{await h(oe)}catch(je){Q(je instanceof Error?je.message:"Merge failed")}finally{z(null)}}},[h]),V=C.useRef(!1),te=C.useCallback(oe=>{V.current=!1,P(oe)},[]),ne=C.useCallback(async()=>{if(!V.current&&B&&j){const oe=e.find(je=>je.id===B);oe!=null&&oe.depends_on&&await j(B,null)}P(null),H(null)},[B,e,j]),W=C.useCallback(oe=>{H(oe)},[]),Y=C.useCallback(oe=>{H(je=>je===oe?null:je)},[]),ae=C.useCallback(async oe=>{!B||!j||B!==oe&&(d4(e,B,oe)||(V.current=!0,await j(B,oe),P(null),H(null)))},[B,e,j]),he=C.useCallback(async oe=>{j&&await j(oe,null)},[j]),ke=C.useCallback(oe=>!B||B===oe?!1:!d4(e,B,oe),[B,e]);return F==="graph"?d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-5",children:[d.jsx("h2",{className:"text-sm font-semibold text-warm-600 uppercase tracking-wider",children:q("todos.title")}),d.jsx("div",{className:"flex items-center gap-2",children:d.jsxs("div",{className:"flex items-center bg-warm-100 rounded-lg p-0.5",children:[d.jsx("button",{onClick:()=>O("list"),className:"p-1.5 rounded-md transition-colors text-warm-400 hover:text-warm-600",title:q("graph.listView"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),d.jsx("button",{onClick:()=>O("graph"),className:"p-1.5 rounded-md transition-colors bg-theme-card shadow-sm text-accent",title:q("graph.graphView"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})})})]})})]}),d.jsx(OU,{todos:e,projectCliTool:t,projectCliModel:n,onAddTodo:a,onStartTodo:s,onStopTodo:l,onDeleteTodo:o,onEditTodo:c,onMergeTodo:f,onCleanupTodo:g,onRetryTodo:p,onContinueTodo:x,onFixTodo:y,onUpdateDependency:j,onUpdatePosition:S,onEvent:k,onSendInput:N,interactiveTodos:_,debugLogging:E,showTokenUsage:M})]}):d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-5",children:[d.jsx("h2",{className:"text-sm font-semibold text-warm-600 uppercase tracking-wider",children:q("todos.title")}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs("div",{className:"flex items-center bg-warm-100 rounded-lg p-0.5",children:[d.jsx("button",{onClick:()=>O("list"),className:"p-1.5 rounded-md transition-colors bg-theme-card shadow-sm text-accent",title:q("graph.listView"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),d.jsx("button",{onClick:()=>O("graph"),className:"p-1.5 rounded-md transition-colors text-warm-400 hover:text-warm-600",title:q("graph.graphView"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})})})]}),!T&&d.jsxs("button",{onClick:()=>R(!0),className:"btn-primary text-xs py-2",children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})}),q("todos.add")]})]})]}),T&&d.jsx("div",{className:"mb-5 animate-slide-up",children:d.jsx(Pc,{projectCliTool:t,projectCliModel:n,availableTodos:e,onSave:async(oe,je,Se,Ae,se,Ee,Te)=>{await a(oe,je,Se,Ae,se,Ee,Te),R(!1)},onCancel:()=>R(!1)})}),d.jsx("div",{className:"space-y-3",children:D.length===0?d.jsxs("div",{className:"card p-10 text-center",children:[d.jsx("p",{className:"text-warm-600 font-medium",children:q("todos.empty")}),d.jsx("p",{className:"text-warm-400 text-sm mt-1",children:q("todos.emptyHint")})]}):D.map(({todo:oe,depth:je},Se)=>{const Ae=X.has(oe.id),se=K.has(oe.id);return d.jsxs("div",{children:[Ae&&d.jsxs("div",{className:"flex items-center gap-2 mb-2 px-3 py-2 rounded-lg bg-status-merged/5 border border-status-merged/20 animate-slide-up",style:{animationDelay:`${Se*30}ms`},children:[d.jsx("svg",{className:"h-4 w-4 text-status-merged flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})}),d.jsx("span",{className:"text-xs font-semibold text-status-merged",children:q("todo.chainComplete")}),d.jsx("span",{className:"text-[10px] font-mono text-warm-400",children:q("todo.chainTasks").replace("{count}",String(X.get(oe.id)))}),d.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[$&&Z===null&&d.jsx("span",{className:"text-[10px] text-status-error",children:$}),d.jsxs("button",{onClick:()=>I(oe.id),disabled:Z===oe.id,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-status-merged/15 text-status-merged hover:bg-status-merged/25 border border-status-merged/30 transition-colors disabled:opacity-50",title:q("todo.mergeChainDesc"),children:[d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})}),Z===oe.id?"...":q("todo.mergeChain")]})]})]}),d.jsx("div",{className:"animate-slide-up",style:{animationDelay:`${Se*30}ms`,marginLeft:je>0?`${je*24}px`:void 0},children:d.jsx(s8,{todo:oe,allTodos:e,projectCliTool:t,onStart:s,onStop:l,onDelete:o,onEdit:c,onMerge:f,onCleanup:g,onRetry:p,onContinue:x,onFix:y,onSchedule:w,onEvent:k,isInteractive:_.has(oe.id),onSendInput:N,isDragSource:B===oe.id,isDragging:B!==null,isDragOver:L===oe.id,isValidDropTarget:ke(oe.id),onDragStart:te,onDragEnd:ne,onDragOverTarget:W,onDragLeaveTarget:Y,onDropTarget:ae,onRemoveDependency:j?he:void 0,debugLogging:E,showTokenUsage:M,isChainMember:se})})]},oe.id)})}),B&&((_e=e.find(oe=>oe.id===B))==null?void 0:_e.depends_on)&&d.jsxs("div",{className:"mt-3 border-2 border-dashed border-red-300 rounded-lg p-4 text-center text-sm text-red-400 transition-colors hover:border-red-400 hover:text-red-500 hover:bg-red-50",onDragOver:oe=>{oe.preventDefault(),oe.dataTransfer.dropEffect="move"},onDrop:oe=>{oe.preventDefault(),B&&j&&(V.current=!0,j(B,null))},children:[d.jsx("svg",{className:"w-5 h-5 mx-auto mb-1",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.181 8.68a4.503 4.503 0 0 1 1.903 6.405m-9.768-2.782L3.56 14.06a4.5 4.5 0 0 0 6.364 6.365l3.129-3.129m5.614-5.615 1.757-1.757a4.5 4.5 0 0 0-6.364-6.365l-3.129 3.129m0 0a4.503 4.503 0 0 0-1.903 6.405"})}),q("dnd.dropToRemoveDep")]})]})}function qU({todos:e}){const t=e.length,{t:n}=Ue();if(t===0)return null;const a={completed:e.filter(o=>o.status==="completed").length,running:e.filter(o=>o.status==="running").length,failed:e.filter(o=>o.status==="failed").length,stopped:e.filter(o=>o.status==="stopped").length,pending:e.filter(o=>o.status==="pending").length,merged:e.filter(o=>o.status==="merged").length},s=a.completed+a.merged,l=Math.round(s/t*100);return d.jsxs("div",{className:"mb-8",children:[d.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-3",children:[d.jsxs("span",{className:"text-sm font-medium text-warm-700",children:[d.jsxs("span",{className:"text-accent-dark",children:[l,"%"]}),d.jsxs("span",{className:"text-warm-400 ml-2",children:[s,"/",t," ",n("progress.complete")]})]}),d.jsxs("div",{className:"flex flex-wrap gap-2 sm:gap-3 text-xs text-warm-500",children:[d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-status-success"})," ",a.completed," ",n("progress.done")]}),d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-status-running animate-pulse"})," ",a.running," ",n("progress.live")]}),d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-warm-300"})," ",a.pending," ",n("progress.idle")]}),a.failed>0&&d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-status-error"})," ",a.failed," ",n("progress.fail")]}),a.stopped>0&&d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-status-warning"})," ",a.stopped," ",n("progress.stop")]}),a.merged>0&&d.jsxs("span",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"h-2 w-2 rounded-full bg-status-merged"})," ",a.merged," ",n("progress.merged")]})]})]}),d.jsx("div",{className:"h-2 w-full overflow-hidden bg-warm-200 rounded-full",children:d.jsxs("div",{className:"flex h-full",children:[a.completed>0&&d.jsx("div",{className:"bg-status-success transition-all duration-500 first:rounded-l-full last:rounded-r-full",style:{width:`${a.completed/t*100}%`}}),a.running>0&&d.jsx("div",{className:"bg-status-running transition-all duration-500 animate-pulse last:rounded-r-full",style:{width:`${a.running/t*100}%`}}),a.failed>0&&d.jsx("div",{className:"bg-status-error transition-all duration-500 last:rounded-r-full",style:{width:`${a.failed/t*100}%`}}),a.stopped>0&&d.jsx("div",{className:"bg-status-warning transition-all duration-500 last:rounded-r-full",style:{width:`${a.stopped/t*100}%`}}),a.merged>0&&d.jsx("div",{className:"bg-status-merged transition-all duration-500 last:rounded-r-full",style:{width:`${a.merged/t*100}%`}})]})})]})}const f4={pending:{label:"status.pending",badgeClasses:"bg-warm-200 text-warm-500",borderColor:"border-l-warm-300"},running:{label:"status.running",badgeClasses:"bg-status-running/10 text-status-running",borderColor:"border-l-status-running"},paused:{label:"status.stopped",badgeClasses:"bg-status-warning/10 text-status-warning",borderColor:"border-l-status-warning"},completed:{label:"status.completed",badgeClasses:"bg-status-success/10 text-status-success",borderColor:"border-l-status-success"},failed:{label:"status.failed",badgeClasses:"bg-status-error/10 text-status-error",borderColor:"border-l-status-error"},stopped:{label:"status.stopped",badgeClasses:"bg-status-warning/10 text-status-warning",borderColor:"border-l-status-warning"},merged:{label:"status.merged",badgeClasses:"bg-status-merged/10 text-status-merged",borderColor:"border-l-status-merged"}},IU={planning:"pipeline.planning",implementation:"pipeline.implementation",review:"pipeline.review",feedback_impl:"pipeline.feedback",documentation:"pipeline.documentation"};function BU({pipeline:e,onStart:t,onStop:n,onDelete:a}){const{t:s}=Ue(),l=f4[e.status]||f4.pending,o=e.status==="pending"||e.status==="paused"||e.status==="failed",c=e.status==="running";return d.jsx("div",{className:`card border-l-4 ${l.borderColor} overflow-hidden`,children:d.jsxs("div",{className:"flex items-center gap-3 px-4 py-3.5",children:[d.jsx("div",{className:"flex-shrink-0 text-warm-400",children:d.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z"})})}),d.jsxs(Hn,{to:`/projects/${e.project_id}/pipelines/${e.id}`,className:"flex-1 min-w-0 group",children:[d.jsx("span",{className:"text-sm text-warm-800 font-medium truncate block group-hover:text-accent transition-colors",children:e.title}),e.current_phase&&d.jsxs("span",{className:"text-[11px] text-warm-400",children:[s("pipeline.phase"),": ",s(IU[e.current_phase])||e.current_phase]})]}),d.jsxs("span",{className:`inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-semibold ${l.badgeClasses}`,children:[e.status==="running"&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-status-running animate-pulse"}),s(l.label)]}),d.jsxs("div",{className:"flex items-center gap-0.5 ml-2",children:[o&&d.jsx("button",{onClick:f=>{f.preventDefault(),t(e.id)},className:"p-1.5 text-status-success/60 hover:text-status-success hover:bg-status-success/10 rounded-lg transition-colors",title:s("pipeline.start"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M8 5v14l11-7z"})})}),c&&d.jsx("button",{onClick:f=>{f.preventDefault(),n(e.id)},className:"p-1.5 text-status-warning/60 hover:text-status-warning hover:bg-status-warning/10 rounded-lg transition-colors",title:s("pipeline.pause"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"})})}),d.jsx("button",{onClick:f=>{f.preventDefault(),a(e.id)},className:"p-1.5 text-warm-400 hover:text-status-error hover:bg-status-error/10 rounded-lg transition-colors",title:s("todo.delete"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]})})}function HU({onSave:e,onCancel:t}){const[n,a]=C.useState(""),[s,l]=C.useState(""),[o,c]=C.useState(!1),{t:f}=Ue(),h=async g=>{if(g.preventDefault(),!(!n.trim()||!s.trim())){c(!0);try{await e(n.trim(),s.trim()),a(""),l("")}finally{c(!1)}}};return d.jsxs("form",{onSubmit:h,className:"card p-5 space-y-4 border-l-4 border-l-accent",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-semibold text-warm-500 uppercase tracking-wider mb-1.5",children:f("pipeline.featureTitle")}),d.jsx("input",{type:"text",value:n,onChange:g=>a(g.target.value),placeholder:f("pipeline.featureTitleHint"),className:"input-field",autoFocus:!0})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-semibold text-warm-500 uppercase tracking-wider mb-1.5",children:f("pipeline.featureDesc")}),d.jsx("textarea",{value:s,onChange:g=>l(g.target.value),placeholder:f("pipeline.featureDescHint"),rows:5,className:"input-field resize-none"})]}),d.jsxs("div",{className:"flex gap-2 justify-end",children:[d.jsx("button",{type:"button",onClick:t,className:"btn-secondary text-xs py-2",children:f("form.cancel")}),d.jsx("button",{type:"submit",disabled:!n.trim()||!s.trim()||o,className:"btn-primary text-xs py-2",children:f(o?"pipeline.creating":"pipeline.create")})]})]})}function PU({pipelines:e,onAddPipeline:t,onStartPipeline:n,onStopPipeline:a,onDeletePipeline:s}){const[l,o]=C.useState(!1),{t:c}=Ue();return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-5",children:[d.jsx("h2",{className:"text-sm font-semibold text-warm-600 uppercase tracking-wider",children:c("pipelines.title")}),!l&&d.jsxs("button",{onClick:()=>o(!0),className:"btn-primary text-xs py-2",children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})}),c("pipelines.add")]})]}),l&&d.jsx("div",{className:"mb-5 animate-slide-up",children:d.jsx(HU,{onSave:async(f,h)=>{await t(f,h),o(!1)},onCancel:()=>o(!1)})}),d.jsx("div",{className:"space-y-3",children:e.length===0&&!l?d.jsxs("div",{className:"card p-10 text-center",children:[d.jsx("div",{className:"mx-auto mb-3 w-10 h-10 rounded-full bg-accent/10 flex items-center justify-center",children:d.jsx("svg",{className:"w-5 h-5 text-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z"})})}),d.jsx("p",{className:"text-warm-600 font-medium",children:c("pipelines.empty")}),d.jsx("p",{className:"text-warm-400 text-sm mt-1",children:c("pipelines.emptyHint")}),d.jsx("p",{className:"text-warm-400 text-xs mt-2 max-w-sm mx-auto leading-relaxed",children:c("pipelines.emptyDesc")})]}):e.map((f,h)=>d.jsx("div",{className:"animate-slide-up",style:{animationDelay:`${h*30}ms`},children:d.jsx(BU,{pipeline:f,onStart:n,onStop:a,onDelete:s})},f.id))})]})}const FU=[{value:1,labelKey:"cron.mon"},{value:2,labelKey:"cron.tue"},{value:3,labelKey:"cron.wed"},{value:4,labelKey:"cron.thu"},{value:5,labelKey:"cron.fri"},{value:6,labelKey:"cron.sat"},{value:0,labelKey:"cron.sun"}];function UU(e){const t={mode:"daily",everyMinutes:30,hourlyMinute:0,dailyHour:9,dailyMinute:0,weeklyDays:[1,2,3,4,5],weeklyHour:9,weeklyMinute:0,monthlyDay:1,monthlyHour:9,monthlyMinute:0};if(!e)return t;const n=e.trim().split(/\s+/);if(n.length!==5)return{...t,mode:"custom"};const[a,s,l,,o]=n,c=a.match(/^\*\/(\d+)$/);if(c&&s==="*"&&l==="*"&&o==="*")return{...t,mode:"minutes",everyMinutes:parseInt(c[1])};if(/^\d+$/.test(a)&&s==="*"&&l==="*"&&o==="*")return{...t,mode:"hourly",hourlyMinute:parseInt(a)};const f=/^\d+$/.test(a)?parseInt(a):-1,h=/^\d+$/.test(s)?parseInt(s):-1;if(f<0||h<0)return{...t,mode:"custom"};if(l==="*"&&o!=="*"){const g=o.split(",").map(p=>{const x=parseInt(p);return isNaN(x)?-1:x}).filter(p=>p>=0);if(g.length>0)return{...t,mode:"weekly",weeklyDays:g,weeklyHour:h,weeklyMinute:f}}return/^\d+$/.test(l)&&o==="*"?{...t,mode:"monthly",monthlyDay:parseInt(l),monthlyHour:h,monthlyMinute:f}:l==="*"&&o==="*"?{...t,mode:"daily",dailyHour:h,dailyMinute:f}:{...t,mode:"custom"}}function h4(e){switch(e.mode){case"minutes":return`*/${e.everyMinutes} * * * *`;case"hourly":return`${e.hourlyMinute} * * * *`;case"daily":return`${e.dailyMinute} ${e.dailyHour} * * *`;case"weekly":return`${e.weeklyMinute} ${e.weeklyHour} * * ${e.weeklyDays.sort((t,n)=>t-n).join(",")}`;case"monthly":return`${e.monthlyMinute} ${e.monthlyHour} ${e.monthlyDay} * *`;default:return""}}function $U({value:e,onChange:t}){const{t:n}=Ue(),[a,s]=C.useState(()=>UU(e)),[l,o]=C.useState(e);C.useEffect(()=>{if(a.mode==="custom")t(l);else{const y=h4(a);t(y)}},[a,l]);const c=y=>{s(w=>({...w,...y}))},f=y=>{s(w=>{const j=w.weeklyDays.includes(y)?w.weeklyDays.filter(S=>S!==y):[...w.weeklyDays,y];return{...w,weeklyDays:j.length>0?j:w.weeklyDays}})},h=[{value:"minutes",labelKey:"cron.everyMinutes"},{value:"hourly",labelKey:"cron.hourly"},{value:"daily",labelKey:"cron.daily"},{value:"weekly",labelKey:"cron.weekly"},{value:"monthly",labelKey:"cron.monthly"},{value:"custom",labelKey:"cron.custom"}],g="bg-warm-50 border border-warm-300 rounded-lg px-2 py-1.5 text-sm text-warm-800 font-mono text-center transition-all duration-200 focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/20",p=(y,w,j,S)=>d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("select",{value:y,onChange:k=>j(parseInt(k.target.value)),className:`${g} w-16`,children:Array.from({length:24},(k,N)=>d.jsx("option",{value:N,children:String(N).padStart(2,"0")},N))}),d.jsx("span",{className:"text-warm-500 font-mono",children:":"}),d.jsx("select",{value:w,onChange:k=>S(parseInt(k.target.value)),className:`${g} w-16`,children:Array.from({length:12},(k,N)=>N*5).map(k=>d.jsx("option",{value:k,children:String(k).padStart(2,"0")},k))})]}),x=a.mode==="custom"?l:h4(a);return d.jsxs("div",{className:"space-y-3",children:[d.jsx("div",{className:"flex flex-wrap gap-1.5",children:h.map(y=>d.jsx("button",{type:"button",onClick:()=>c({mode:y.value}),className:`px-2.5 py-1 rounded-md text-xs font-medium transition-colors ${a.mode===y.value?"bg-amber-500 text-white":"bg-warm-100 text-warm-500 hover:bg-warm-200"}`,children:n(y.labelKey)},y.value))}),d.jsxs("div",{className:"bg-warm-50 rounded-lg p-3",children:[a.mode==="minutes"&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-sm text-warm-600",children:n("cron.every")}),d.jsx("select",{value:a.everyMinutes,onChange:y=>c({everyMinutes:parseInt(y.target.value)}),className:`${g} w-20`,children:[5,10,15,20,30].map(y=>d.jsx("option",{value:y,children:y},y))}),d.jsx("span",{className:"text-sm text-warm-600",children:n("cron.minutesLabel")})]}),a.mode==="hourly"&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-sm text-warm-600",children:n("cron.everyHourAt")}),d.jsx("select",{value:a.hourlyMinute,onChange:y=>c({hourlyMinute:parseInt(y.target.value)}),className:`${g} w-16`,children:Array.from({length:12},(y,w)=>w*5).map(y=>d.jsx("option",{value:y,children:String(y).padStart(2,"0")},y))}),d.jsx("span",{className:"text-sm text-warm-600",children:n("cron.minutesPast")})]}),a.mode==="daily"&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-sm text-warm-600",children:n("cron.everyDayAt")}),p(a.dailyHour,a.dailyMinute,y=>c({dailyHour:y}),y=>c({dailyMinute:y}))]}),a.mode==="weekly"&&d.jsxs("div",{className:"space-y-3",children:[d.jsx("div",{className:"flex flex-wrap gap-1.5",children:FU.map(y=>d.jsx("button",{type:"button",onClick:()=>f(y.value),className:`w-9 h-9 rounded-lg text-xs font-medium transition-colors ${a.weeklyDays.includes(y.value)?"bg-amber-500 text-white":"bg-theme-card text-warm-500 border border-warm-200 hover:border-amber-300"}`,children:n(y.labelKey)},y.value))}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-sm text-warm-600",children:n("cron.at")}),p(a.weeklyHour,a.weeklyMinute,y=>c({weeklyHour:y}),y=>c({weeklyMinute:y}))]})]}),a.mode==="monthly"&&d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[d.jsx("span",{className:"text-sm text-warm-600",children:n("cron.everyMonthOn")}),d.jsx("select",{value:a.monthlyDay,onChange:y=>c({monthlyDay:parseInt(y.target.value)}),className:`${g} w-16`,children:Array.from({length:28},(y,w)=>w+1).map(y=>d.jsx("option",{value:y,children:y},y))}),d.jsx("span",{className:"text-sm text-warm-600",children:n("cron.dayAt")}),p(a.monthlyHour,a.monthlyMinute,y=>c({monthlyHour:y}),y=>c({monthlyMinute:y}))]}),a.mode==="custom"&&d.jsxs("div",{children:[d.jsx("input",{type:"text",placeholder:"*/30 * * * *",value:l,onChange:y=>o(y.target.value),className:"bg-warm-50 border border-warm-300 rounded-lg px-3 py-1.5 w-full text-sm text-warm-800 font-mono transition-all duration-200 focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/20"}),d.jsx("p",{className:"text-[10px] text-warm-400 mt-1",children:n("schedule.cronHint")})]})]}),a.mode!=="custom"&&x&&d.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[d.jsxs("span",{className:"text-warm-400",children:[n("cron.expression"),":"]}),d.jsx("code",{className:"px-2 py-0.5 rounded bg-warm-100 text-warm-600 font-mono",children:x})]})]})}function GU(){const e=new Date;e.setHours(e.getHours()+1),e.setMinutes(0,0,0);const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0"),s=String(e.getHours()).padStart(2,"0"),l=String(e.getMinutes()).padStart(2,"0");return`${t}-${n}-${a}T${s}:${l}`}function VU(e){const t=new Date(e),n=t.getFullYear(),a=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0"),l=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0");return`${n}-${a}-${s}T${l}:${o}`}function LA({onSave:e,onCancel:t,initialTitle:n="",initialDescription:a="",initialCronExpression:s="",initialCliTool:l,initialCliModel:o,initialSkipIfRunning:c=!0,initialScheduleType:f="recurring",initialRunAt:h,projectCliTool:g="claude",projectCliModel:p=""}){const[x,y]=C.useState(n),[w,j]=C.useState(a),[S,k]=C.useState(s),[N,_]=C.useState(l||g||"claude"),[E,M]=C.useState(o??p??""),[T,R]=C.useState(c),[B,P]=C.useState(f),[L,H]=C.useState(h?VU(h):GU()),{t:F}=Ue(),{getToolConfig:G}=ko(),q=G(N),O=Z=>{_(Z),M("")},D=B==="once",X=x.trim()&&(D?!!L:!!S.trim()),K=Z=>{Z.preventDefault(),X&&e({title:x.trim(),description:w.trim(),cronExpression:D?"":S.trim(),cliTool:N,cliModel:E||void 0,skipIfRunning:T,scheduleType:B,runAt:D?new Date(L).toISOString():void 0})};return d.jsxs("form",{onSubmit:K,className:"card p-5 border-amber-500/30",children:[d.jsx("div",{className:"mb-3",children:d.jsx("input",{type:"text",placeholder:F("scheduleForm.titlePlaceholder"),value:x,onChange:Z=>y(Z.target.value),className:"input-field",autoFocus:!0})}),d.jsx("div",{className:"mb-3",children:d.jsx("textarea",{placeholder:F("scheduleForm.descPlaceholder"),value:w,onChange:Z=>j(Z.target.value),rows:3,className:"input-field resize-none"})}),d.jsxs("div",{className:"mb-3",children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-1.5",children:F("schedule.type")}),d.jsxs("div",{className:"flex gap-1.5",children:[d.jsx("button",{type:"button",onClick:()=>P("recurring"),className:`px-3 py-1.5 rounded-md text-xs font-medium transition-colors ${B==="recurring"?"bg-amber-500 text-white":"bg-warm-100 text-warm-500 hover:bg-warm-200"}`,children:F("schedule.recurring")}),d.jsx("button",{type:"button",onClick:()=>P("once"),className:`px-3 py-1.5 rounded-md text-xs font-medium transition-colors ${B==="once"?"bg-amber-500 text-white":"bg-warm-100 text-warm-500 hover:bg-warm-200"}`,children:F("schedule.once")})]})]}),D?d.jsxs("div",{className:"mb-3",children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-1.5",children:F("schedule.runAtLabel")}),d.jsx("input",{type:"datetime-local",value:L,onChange:Z=>H(Z.target.value),className:"input-field text-sm font-mono",min:new Date().toISOString().slice(0,16)})]}):d.jsxs("div",{className:"mb-3",children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-1.5",children:F("schedule.cronExpression")}),d.jsx($U,{value:S,onChange:k})]}),d.jsxs("div",{className:"mb-3 grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-1.5",children:F("scheduleForm.cliTool")}),d.jsx("select",{value:N,onChange:Z=>O(Z.target.value),className:"input-field text-sm !py-2",children:za.map(Z=>d.jsx("option",{value:Z.value,children:Z.label},Z.value))})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-1.5",children:F("scheduleForm.aiModel")}),d.jsx("select",{value:E,onChange:Z=>M(Z.target.value),className:"input-field text-sm !py-2",children:q.models.map(Z=>d.jsx("option",{value:Z.value,children:Z.label},Z.value))})]})]}),!D&&d.jsx("div",{className:"mb-4",children:d.jsxs("label",{className:"flex items-center gap-2 text-sm text-warm-600 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:T,onChange:Z=>R(Z.target.checked),className:"rounded border-warm-300 text-amber-500 focus:ring-amber-500"}),F("schedule.skipIfRunning")]})}),d.jsxs("div",{className:"flex gap-3 justify-end",children:[d.jsx("button",{type:"button",onClick:t,className:"btn-ghost text-sm",children:F("scheduleForm.cancel")}),d.jsx("button",{type:"submit",disabled:!X,className:"btn-primary text-sm",children:F("scheduleForm.save")})]})]})}function YU({schedule:e,onToggle:t,onDelete:n,onEdit:a,onTrigger:s,onMergeRun:l,onCleanupRun:o}){const[c,f]=C.useState(!1),[h,g]=C.useState(!1),[p,x]=C.useState([]),[y,w]=C.useState(!1),[j,S]=C.useState(!1),[k,N]=C.useState(null),{t:_}=Ue(),E=async()=>{try{const O=await Ph(e.id);x(O)}catch{}},M=async O=>{if(!(!O.todo_id||!l)){N(O.id);try{await l(O.todo_id),await E()}finally{N(null)}}},T=async O=>{if(!(!O.todo_id||!o)){N(O.id);try{await o(O.todo_id),await E()}finally{N(null)}}},R=e.schedule_type==="once",B=async()=>{if(!y)try{const O=await Ph(e.id);x(O),w(!0)}catch{}},P=()=>{const O=!c;f(O),O&&B()},L=async()=>{S(!0);try{await s(e.id);const O=await Ph(e.id);x(O),w(!0)}finally{S(!1)}};if(h)return d.jsx(LA,{initialTitle:e.title,initialDescription:e.description??"",initialCronExpression:R?"":e.cron_expression,initialCliTool:e.cli_tool??void 0,initialCliModel:e.cli_model??void 0,initialSkipIfRunning:!!e.skip_if_running,initialScheduleType:e.schedule_type,initialRunAt:e.run_at??void 0,onSave:async O=>{await a(e.id,{title:O.title,description:O.description,cron_expression:O.cronExpression||void 0,cli_tool:O.cliTool,cli_model:O.cliModel,skip_if_running:O.skipIfRunning,schedule_type:O.scheduleType,run_at:O.runAt}),g(!1)},onCancel:()=>g(!1)});const H=e.is_active?"border-l-amber-500":"border-l-warm-300",F={triggered:"text-status-running",skipped:"text-status-warning",completed:"text-status-success",failed:"text-status-error"},G={triggered:_("schedule.runTriggered"),skipped:_("schedule.runSkipped"),completed:_("schedule.runCompleted"),failed:_("schedule.runFailed")},q=O=>O?new Date(O).toLocaleString():"";return d.jsxs("div",{className:`card border-l-4 ${H} overflow-hidden`,children:[d.jsxs("div",{className:"flex items-center gap-3 px-4 py-3.5 cursor-pointer hover:bg-warm-50 transition-colors",onClick:P,children:[d.jsx("button",{className:"text-warm-400 hover:text-amber-500 flex-shrink-0 transition-colors",children:d.jsx("svg",{className:`h-3.5 w-3.5 transition-transform duration-200 ${c?"rotate-90":""}`,fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M8 5v14l11-7z"})})}),d.jsx("span",{className:"flex-1 text-sm text-warm-800 font-medium truncate",children:e.title}),R?d.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-mono font-medium bg-blue-500/10 text-blue-600 flex-shrink-0",children:[d.jsx("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),q(e.run_at)]}):d.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-mono font-medium bg-amber-500/10 text-amber-600 flex-shrink-0",children:e.cron_expression}),d.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-semibold ${R?"bg-blue-500/10 text-blue-600":"bg-amber-500/10 text-amber-600"}`,children:_(R?"schedule.once":"schedule.recurring")}),d.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-semibold ${e.is_active?"bg-status-success/10 text-status-success":"bg-warm-200 text-warm-500"}`,children:e.is_active?_("schedule.active"):_("schedule.paused")}),d.jsxs("div",{className:"flex items-center gap-0.5 ml-2",onClick:O=>O.stopPropagation(),children:[d.jsx("button",{onClick:L,disabled:j,className:"p-1.5 text-amber-500/60 hover:text-amber-500 hover:bg-amber-500/10 rounded-lg transition-colors disabled:opacity-30",title:_("schedule.trigger"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M8 5v14l11-7z"})})}),d.jsx("button",{onClick:()=>t(e.id,!e.is_active),className:`p-1.5 rounded-lg transition-colors ${e.is_active?"text-status-warning/60 hover:text-status-warning hover:bg-status-warning/10":"text-status-success/60 hover:text-status-success hover:bg-status-success/10"}`,title:e.is_active?_("schedule.pause"):_("schedule.activate"),children:e.is_active?d.jsx("svg",{className:"h-3.5 w-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"})}):d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),d.jsx("button",{onClick:()=>g(!0),className:"p-1.5 text-warm-400 hover:text-accent hover:bg-accent/10 rounded-lg transition-colors",title:_("schedule.edit"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),d.jsx("button",{onClick:()=>n(e.id),className:"p-1.5 text-warm-400 hover:text-status-error hover:bg-status-error/10 rounded-lg transition-colors",title:_("schedule.delete"),children:d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),c&&d.jsxs("div",{className:"border-t border-warm-200 px-5 py-5 space-y-4 animate-fade-in bg-warm-50/50",children:[e.description&&d.jsx("div",{children:d.jsx("p",{className:"text-sm text-warm-600 whitespace-pre-wrap leading-relaxed",children:e.description})}),d.jsxs("div",{className:"flex flex-wrap gap-2 text-xs",children:[R?d.jsxs("span",{className:"badge bg-blue-500/10 text-blue-600 font-mono",children:[_("schedule.runAtLabel"),": ",q(e.run_at)]}):d.jsx("span",{className:"badge bg-amber-500/10 text-amber-600 font-mono",children:e.cron_expression}),!R&&e.skip_if_running?d.jsx("span",{className:"badge bg-status-info/10 text-status-info",children:_("schedule.skipIfRunning")}):null,d.jsxs("span",{className:"badge bg-warm-200 text-warm-600",children:[_("schedule.lastRun"),": ",e.last_run_at?new Date(e.last_run_at).toLocaleString():_("schedule.never")]})]}),d.jsxs("div",{children:[d.jsx("h4",{className:"text-xs font-semibold text-warm-500 uppercase tracking-wider mb-2",children:_("schedule.runs")}),p.length===0?d.jsx("p",{className:"text-xs text-warm-400 italic",children:_("schedule.noRuns")}):d.jsx("div",{className:"max-h-48 overflow-auto space-y-1",children:p.map(O=>{const D=O.todo_id&&O.todo_status==="completed"&&!!O.todo_branch_name,X=O.todo_id&&O.todo_status!=="running"&&O.todo_status!=="pending"&&(O.todo_worktree_path||O.todo_branch_name),K=k===O.id;return d.jsxs("div",{className:"flex items-center gap-3 text-xs py-1.5 px-3 rounded-lg bg-theme-hover",children:[d.jsx("span",{className:`font-medium ${F[O.status]||"text-warm-500"}`,children:G[O.status]||O.status}),O.skipped_reason&&d.jsxs("span",{className:"text-warm-400",children:["(",O.skipped_reason,")"]}),d.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[D&&l&&d.jsx("button",{onClick:()=>M(O),disabled:K,className:"p-1 text-status-merged/60 hover:text-status-merged hover:bg-status-merged/10 rounded transition-colors disabled:opacity-30",title:_("todo.merge"),children:d.jsx("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"})})}),X&&o&&d.jsx("button",{onClick:()=>T(O),disabled:K,className:"p-1 text-status-warning/60 hover:text-status-warning hover:bg-status-warning/10 rounded transition-colors disabled:opacity-30",title:_("todo.cleanup"),children:d.jsx("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]}),d.jsx("span",{className:"text-warm-400 font-mono flex-shrink-0",children:new Date(O.started_at).toLocaleString()})]},O.id)})})]})]})]})}function XU({schedules:e,projectCliTool:t,projectCliModel:n,onAddSchedule:a,onToggleSchedule:s,onDeleteSchedule:l,onEditSchedule:o,onTriggerSchedule:c,onMergeRun:f,onCleanupRun:h}){const[g,p]=C.useState(!1),{t:x}=Ue();return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-5",children:[d.jsx("h2",{className:"text-sm font-semibold text-warm-600 uppercase tracking-wider",children:x("schedules.title")}),!g&&d.jsxs("button",{onClick:()=>p(!0),className:"btn-primary text-xs py-2",children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})}),x("schedules.add")]})]}),g&&d.jsx("div",{className:"mb-5 animate-slide-up",children:d.jsx(LA,{projectCliTool:t,projectCliModel:n,onSave:async y=>{await a(y),p(!1)},onCancel:()=>p(!1)})}),d.jsx("div",{className:"space-y-3",children:e.length===0?d.jsxs("div",{className:"card p-10 text-center",children:[d.jsx("p",{className:"text-warm-600 font-medium",children:x("schedules.empty")}),d.jsx("p",{className:"text-warm-400 text-sm mt-1",children:x("schedules.emptyHint")})]}):e.map((y,w)=>d.jsx("div",{className:"animate-slide-up",style:{animationDelay:`${w*30}ms`},children:d.jsx(YU,{schedule:y,onToggle:s,onDelete:l,onEdit:o,onTrigger:c,onMergeRun:f,onCleanupRun:h})},y.id))})]})}const ps=["#D4A843","#2196F3","#4CAF50","#E53935","#9C27B0","#FF9800","#00BCD4","#795548"];function KU(e){const t=new Map;e.forEach((s,l)=>t.set(s.hash,l));const n=[],a=[];for(let s=0;s<e.length;s++){const l=e[s];let o=n.indexOf(l.hash);o===-1&&(o=n.indexOf(null),o===-1&&(o=n.length,n.push(null))),n[o]=null;const c=ps[o%ps.length],f=[];for(let h=0;h<l.parentHashes.length;h++){const g=l.parentHashes[h],p=t.get(g);if(p===void 0)continue;let x=n.indexOf(g);if(x!==-1)f.push({fromLane:o,toLane:x,toRow:p,color:ps[x%ps.length]});else if(h===0)n[o]=g,f.push({fromLane:o,toLane:o,toRow:p,color:c});else{let y=n.indexOf(null);y===-1&&(y=n.length,n.push(null)),n[y]=g,f.push({fromLane:o,toLane:y,toRow:p,color:ps[y%ps.length]})}}a.push({lane:o,color:c,connections:f})}return a}function WU({refStr:e}){const t=e.startsWith("HEAD"),n=e.startsWith("origin/")||e.includes("remotes/"),a=e.startsWith("tag: ");let s=e,l="";return a?(s=e.replace("tag: ",""),l="bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-300"):t?(s=e.replace("HEAD -> ",""),l="bg-status-success/15 text-status-success font-semibold"):n?l="bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-300":l="bg-accent/15 text-accent",d.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium whitespace-nowrap ${l}`,children:s})}const Da=32,ci=16,QU=4,ZU=10;function JU({graphNodes:e,totalRows:t}){const a=(Math.min(ZU,e.reduce((s,l)=>{const o=l.connections.reduce((c,f)=>Math.max(c,f.fromLane,f.toLane),0);return Math.max(s,l.lane,o)},0)+1)+1)*ci+8;return d.jsxs("svg",{width:a,height:t*Da,className:"shrink-0",style:{minWidth:a},children:[e.map((s,l)=>s.connections.map((o,c)=>{const f=o.fromLane*ci+ci/2+4,h=l*Da+Da/2,g=o.toLane*ci+ci/2+4,p=o.toRow*Da+Da/2;if(f===g)return d.jsx("line",{x1:f,y1:h,x2:g,y2:p,stroke:o.color,strokeWidth:2,strokeOpacity:.7},`${l}-${c}`);{const x=(h+p)/2;return d.jsx("path",{d:`M${f},${h} C${f},${x} ${g},${x} ${g},${p}`,fill:"none",stroke:o.color,strokeWidth:2,strokeOpacity:.7},`${l}-${c}`)}})),e.map((s,l)=>{const o=s.lane*ci+ci/2+4,c=l*Da+Da/2;return d.jsx("circle",{cx:o,cy:c,r:QU,fill:s.color,stroke:"white",strokeWidth:1.5},`dot-${l}`)})]})}function m4(e,t){return e==="?"||t==="?"?{label:"U",color:"text-warm-400"}:e==="A"||t==="A"?{label:"A",color:"text-status-success"}:e==="D"||t==="D"?{label:"D",color:"text-status-error"}:e==="R"||t==="R"?{label:"R",color:"text-purple-500"}:e==="C"||t==="C"?{label:"C",color:"text-blue-500"}:{label:"M",color:"text-accent"}}function e$({projectId:e,onRefresh:t,busy:n,setBusy:a,branches:s,statusFiles:l}){const{t:o}=Ue(),[c,f]=C.useState(null),[h,g]=C.useState(""),[p,x]=C.useState(""),[y,w]=C.useState(null),j=()=>{f(null),g(""),x(""),w(null)},S=async M=>{a(!0),w(null);try{await M(),j(),t()}catch(T){w(T instanceof Error?T.message:"Error")}finally{a(!1)}},k=l.some(M=>M.index!==" "&&M.index!=="?"),N=({label:M,onClick:T,icon:R,badge:B})=>d.jsxs("button",{onClick:T,disabled:n,className:"flex flex-col items-center gap-0.5 px-2.5 py-1.5 rounded hover:bg-warm-50 transition-colors disabled:opacity-50 relative",title:M,children:[d.jsx("div",{className:"h-5 w-5 flex items-center justify-center text-warm-500",children:R}),d.jsx("span",{className:"text-[10px] text-warm-600 whitespace-nowrap",children:M}),B!==void 0&&B>0&&d.jsx("span",{className:"absolute -top-0.5 -right-0.5 bg-accent text-white text-[9px] font-bold rounded-full h-3.5 min-w-[14px] flex items-center justify-center px-0.5",children:B})]}),_=({title:M,children:T})=>d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30",onClick:j,children:d.jsxs("div",{className:"bg-theme-card rounded-lg shadow-xl w-80 max-w-[90vw]",onClick:R=>R.stopPropagation(),children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-warm-100",children:[d.jsx("span",{className:"text-sm font-semibold text-warm-700",children:M}),d.jsx("button",{onClick:j,className:"text-warm-400 hover:text-warm-600",children:d.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsxs("div",{className:"p-4 space-y-3",children:[y&&d.jsx("p",{className:"text-status-error text-xs",children:y}),T]})]})}),E=s.filter(M=>!M.remote);return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-warm-100 overflow-x-auto",children:[d.jsx(N,{label:o("git.commit"),onClick:()=>f("commit"),icon:d.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,className:"h-5 w-5",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"})})}),d.jsx(N,{label:o("git.pull"),onClick:()=>S(()=>JD(e)),icon:d.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,className:"h-5 w-5",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})})}),d.jsx(N,{label:o("git.push"),onClick:()=>S(()=>eO(e)),icon:d.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,className:"h-5 w-5",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"})})}),d.jsx(N,{label:o("git.fetch"),onClick:()=>S(()=>tO(e)),icon:d.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,className:"h-5 w-5",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 7.5h-.75A2.25 2.25 0 004.5 9.75v7.5a2.25 2.25 0 002.25 2.25h7.5a2.25 2.25 0 002.25-2.25v-7.5a2.25 2.25 0 00-2.25-2.25h-.75m-6 3.75l3 3m0 0l3-3m-3 3V1.5"})})}),d.jsx("div",{className:"w-px h-8 bg-warm-200 mx-1"}),d.jsx(N,{label:o("git.branch"),onClick:()=>f("branch"),icon:d.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,className:"h-5 w-5",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 3v12m0 0a3 3 0 103 3H15a3 3 0 100-3m-9 0h9m-9 0a3 3 0 01-3-3V6a3 3 0 013-3h0"})})}),d.jsx(N,{label:o("git.merge"),onClick:()=>f("merge"),icon:d.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,className:"h-5 w-5",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"})})}),d.jsx(N,{label:o("git.stash"),onClick:()=>f("stash"),icon:d.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,className:"h-5 w-5",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})})}),d.jsx(N,{label:o("git.discard"),onClick:()=>{l.length!==0&&confirm(o("git.confirmDiscard"))&&S(()=>LE(e,void 0,!0))},icon:d.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,className:"h-5 w-5",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182"})})}),d.jsx(N,{label:o("git.tag"),onClick:()=>f("tag"),icon:d.jsxs("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,className:"h-5 w-5",children:[d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z"}),d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6h.008v.008H6V6z"})]})})]}),c==="commit"&&d.jsxs(_,{title:o("git.commit"),children:[d.jsx("textarea",{className:"w-full border border-warm-200 rounded px-3 py-2 text-sm resize-none focus:outline-none focus:ring-1 focus:ring-accent",rows:3,placeholder:o("git.commitMessage"),value:h,onChange:M=>g(M.target.value),autoFocus:!0}),d.jsxs("button",{className:"w-full btn-primary text-sm py-2",disabled:n||!h.trim()||!k,onClick:()=>S(()=>ZD(e,h.trim())),children:[o("git.commit")," ",!k&&d.jsxs("span",{className:"text-xs opacity-70 ml-1",children:["(",o("git.staged"),": 0)"]})]})]}),c==="branch"&&d.jsxs(_,{title:o("git.newBranch"),children:[d.jsx("input",{className:"w-full border border-warm-200 rounded px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-accent",placeholder:o("git.branchName"),value:h,onChange:M=>g(M.target.value),autoFocus:!0}),d.jsx("div",{className:"flex gap-2",children:d.jsx("button",{className:"flex-1 btn-primary text-sm py-2",disabled:n||!h.trim(),onClick:()=>S(()=>nO(e,h.trim())),children:o("git.create")})}),E.length>0&&d.jsxs("div",{className:"border-t border-warm-100 pt-2 mt-1",children:[d.jsx("p",{className:"text-[10px] text-warm-400 uppercase tracking-wider mb-1",children:o("git.selectBranch")}),d.jsx("div",{className:"max-h-32 overflow-y-auto space-y-px",children:E.filter(M=>!M.current).map(M=>d.jsxs("div",{className:"flex items-center justify-between px-2 py-1 text-xs hover:bg-warm-50 rounded group",children:[d.jsx("button",{className:"truncate text-warm-600 hover:text-accent",onClick:()=>S(()=>aO(e,M.name)),children:M.name}),d.jsx("button",{className:"text-warm-300 hover:text-status-error opacity-0 group-hover:opacity-100 transition-opacity text-[10px]",onClick:()=>{confirm(`Delete branch ${M.name}?`)&&S(()=>rO(e,M.name))},children:o("git.delete")})]},M.name))})]})]}),c==="merge"&&d.jsxs(_,{title:o("git.merge"),children:[d.jsx("p",{className:"text-xs text-warm-500",children:o("git.selectBranch")}),d.jsx("div",{className:"max-h-48 overflow-y-auto space-y-px",children:E.filter(M=>!M.current).map(M=>d.jsx("button",{className:"w-full text-left px-3 py-2 text-sm hover:bg-warm-50 rounded text-warm-600 truncate",disabled:n,onClick:()=>S(()=>iO(e,M.name)),children:M.name},M.name))})]}),c==="stash"&&d.jsx(t$,{projectId:e,busy:n,exec:S,inputValue:h,setInputValue:g}),c==="tag"&&d.jsxs(_,{title:o("git.tag"),children:[d.jsx("input",{className:"w-full border border-warm-200 rounded px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-accent",placeholder:o("git.tagName"),value:h,onChange:M=>g(M.target.value),autoFocus:!0}),d.jsx("input",{className:"w-full border border-warm-200 rounded px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-accent",placeholder:o("git.tagMessage"),value:p,onChange:M=>x(M.target.value)}),d.jsx("button",{className:"w-full btn-primary text-sm py-2",disabled:n||!h.trim(),onClick:()=>S(()=>uO(e,h.trim(),p.trim()||void 0)),children:o("git.create")})]})]})}function t$({projectId:e,busy:t,exec:n,inputValue:a,setInputValue:s}){const{t:l}=Ue(),[o,c]=C.useState([]);return C.useEffect(()=>{oO(e).then(c).catch(()=>{})},[e]),d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/30",onClick:()=>s(""),children:d.jsxs("div",{className:"bg-theme-card rounded-lg shadow-xl w-80 max-w-[90vw]",onClick:f=>f.stopPropagation(),children:[d.jsx("div",{className:"flex items-center justify-between px-4 py-3 border-b border-warm-100",children:d.jsx("span",{className:"text-sm font-semibold text-warm-700",children:l("git.stash")})}),d.jsxs("div",{className:"p-4 space-y-3",children:[d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{className:"flex-1 border border-warm-200 rounded px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-accent",placeholder:l("git.stashMessage"),value:a,onChange:f=>s(f.target.value),autoFocus:!0}),d.jsx("button",{className:"btn-primary text-sm px-3 py-2",disabled:t,onClick:()=>n(()=>sO(e,a.trim()||void 0)),children:l("git.stash")})]}),o.length>0?d.jsx("div",{className:"space-y-px max-h-40 overflow-y-auto",children:o.map(f=>d.jsxs("div",{className:"flex items-center justify-between px-2 py-1.5 text-xs hover:bg-warm-50 rounded",children:[d.jsx("span",{className:"text-warm-600 truncate flex-1",children:f.message||`stash@{${f.index}}`}),d.jsx("button",{className:"text-accent hover:underline text-[11px] ml-2 shrink-0",disabled:t,onClick:()=>n(()=>lO(e,f.index)),children:l("git.stashPop")})]},f.index))}):d.jsx("p",{className:"text-xs text-warm-400 text-center",children:l("git.noStashes")})]})]})})}function n$({projectId:e,files:t,busy:n,setBusy:a,onRefresh:s}){const{t:l}=Ue(),o=t.filter(w=>w.index!==" "&&w.index!=="?"),c=t.filter(w=>w.working_dir!==" "&&w.working_dir!=="?"&&(w.index===" "||w.index==="?")),f=t.filter(w=>w.index==="?"&&w.working_dir==="?"),[h,g]=C.useState(null),p=async w=>{a(!0),g(null);try{await w(),s()}catch(j){g(j instanceof Error?j.message:"Operation failed")}finally{a(!1)}};if(t.length===0)return d.jsx("div",{className:"px-3 py-2 text-xs text-warm-400 text-center",children:l("git.noChanges")});const x=h?d.jsxs("div",{className:"px-2 py-1 bg-red-50 text-red-600 text-xs flex items-center justify-between",children:[d.jsx("span",{className:"truncate",children:h}),d.jsx("button",{onClick:()=>g(null),className:"ml-2 shrink-0 text-red-400 hover:text-red-600",children:"×"})]}):null,y=({file:w,type:j})=>{const S=j==="staged"?m4(w.index," "):m4(" ",w.working_dir);return d.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-0.5 hover:bg-warm-50 rounded group text-xs",children:[d.jsx("span",{className:`font-mono font-bold text-[10px] w-3 text-center ${S.color}`,children:S.label}),d.jsx("span",{className:"truncate flex-1 text-warm-600",children:w.path}),d.jsxs("div",{className:"opacity-0 group-hover:opacity-100 flex gap-1 transition-opacity",children:[j==="staged"&&d.jsx("button",{className:"text-[10px] text-warm-400 hover:text-warm-600",disabled:n,onClick:()=>p(()=>_j(e,[w.path])),children:l("git.unstage")}),j==="unstaged"&&d.jsxs(d.Fragment,{children:[d.jsx("button",{className:"text-[10px] text-accent hover:underline",disabled:n,onClick:()=>p(()=>Ju(e,[w.path])),children:l("git.stage")}),d.jsx("button",{className:"text-[10px] text-status-error hover:underline",disabled:n,onClick:()=>{confirm(l("git.confirmDiscardFile"))&&p(()=>LE(e,[w.path]))},children:l("git.discard")})]}),j==="untracked"&&d.jsx("button",{className:"text-[10px] text-accent hover:underline",disabled:n,onClick:()=>p(()=>Ju(e,[w.path])),children:l("git.stage")})]})]})};return d.jsxs("div",{className:"space-y-1",children:[x,o.length>0&&d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between px-2 py-1",children:[d.jsxs("span",{className:"text-[10px] font-semibold text-status-success uppercase tracking-wider",children:[l("git.staged")," (",o.length,")"]}),d.jsx("button",{className:"text-[10px] text-warm-400 hover:text-warm-600",disabled:n,onClick:()=>p(()=>_j(e,o.map(w=>w.path))),children:l("git.unstageAll")})]}),o.map(w=>d.jsx(y,{file:w,type:"staged"},`s-${w.path}`))]}),c.length>0&&d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between px-2 py-1",children:[d.jsxs("span",{className:"text-[10px] font-semibold text-accent uppercase tracking-wider",children:[l("git.unstaged")," (",c.length,")"]}),d.jsx("button",{className:"text-[10px] text-warm-400 hover:text-warm-600",disabled:n,onClick:()=>p(()=>Ju(e,c.map(w=>w.path))),children:l("git.stageAll")})]}),c.map(w=>d.jsx(y,{file:w,type:"unstaged"},`u-${w.path}`))]}),f.length>0&&d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between px-2 py-1",children:[d.jsxs("span",{className:"text-[10px] font-semibold text-warm-400 uppercase tracking-wider",children:[l("git.untracked")," (",f.length,")"]}),d.jsx("button",{className:"text-[10px] text-warm-400 hover:text-warm-600",disabled:n,onClick:()=>p(()=>Ju(e,f.map(w=>w.path))),children:l("git.stageAll")})]}),f.map(w=>d.jsx(y,{file:w,type:"untracked"},`t-${w.path}`))]})]})}function r$({branches:e,tags:t,stashCount:n}){const{t:a}=Ue(),[s,l]=C.useState(new Set(["local","remote"])),o=g=>{l(p=>{const x=new Set(p);return x.has(g)?x.delete(g):x.add(g),x})},c=e.filter(g=>!g.remote),f=e.filter(g=>g.remote),h=({id:g,label:p,count:x})=>d.jsxs("button",{onClick:()=>o(g),className:"w-full flex items-center gap-1.5 py-1.5 text-[11px] font-semibold text-warm-500 uppercase tracking-wider hover:text-warm-700 transition-colors",children:[d.jsx("svg",{className:`h-3 w-3 transition-transform ${s.has(g)?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),p,d.jsx("span",{className:"text-warm-400 font-normal ml-auto",children:x})]});return d.jsxs("div",{className:"space-y-1",children:[d.jsx(h,{id:"local",label:a("git.branches"),count:c.length}),s.has("local")&&d.jsx("div",{className:"pl-1 space-y-px",children:c.map(g=>d.jsxs("div",{className:`flex items-center gap-1.5 px-2 py-1 rounded text-xs truncate ${g.current?"text-accent font-semibold bg-accent/10":"text-warm-600 hover:bg-warm-50"}`,children:[g.current&&d.jsx("svg",{className:"h-3 w-3 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),d.jsx("span",{className:"truncate",children:g.name})]},g.name))}),f.length>0&&d.jsxs(d.Fragment,{children:[d.jsx(h,{id:"remote",label:a("git.remotes"),count:f.length}),s.has("remote")&&d.jsx("div",{className:"pl-1 space-y-px",children:f.map(g=>d.jsx("div",{className:"px-2 py-1 text-xs text-warm-500 truncate hover:bg-warm-50 rounded",children:g.name.replace("remotes/","")},g.name))})]}),t.length>0&&d.jsxs(d.Fragment,{children:[d.jsx(h,{id:"tags",label:a("git.tags"),count:t.length}),s.has("tags")&&d.jsx("div",{className:"pl-1 space-y-px",children:t.map(g=>d.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 text-xs text-warm-500 truncate hover:bg-warm-50 rounded",children:[d.jsxs("svg",{className:"h-3 w-3 text-purple-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.568 3H5.25A2.25 2.25 0 003 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 005.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 009.568 3z"}),d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6h.008v.008H6V6z"})]}),g]},g))})]}),n>0&&d.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 text-[11px] font-semibold text-warm-500 uppercase tracking-wider",children:[a("git.stashes"),d.jsx("span",{className:"text-warm-400 font-normal ml-auto",children:n})]})]})}function a$(e){const t=Date.now(),n=new Date(e).getTime(),a=Math.floor((t-n)/1e3);if(a<60)return`${a}s`;const s=Math.floor(a/60);if(s<60)return`${s}m`;const l=Math.floor(s/60);if(l<24)return`${l}h`;const o=Math.floor(l/24);if(o<30)return`${o}d`;const c=Math.floor(o/30);return c<12?`${c}mo`:`${Math.floor(o/365)}y`}function i$({project:e,refreshTrigger:t}){const{t:n}=Ue(),[a,s]=C.useState([]),[l,o]=C.useState(!0),[c,f]=C.useState(!1),[h,g]=C.useState(!0),[p,x]=C.useState(null),[y,w]=C.useState([]),[j,S]=C.useState([]),[k,N]=C.useState(0),[_,E]=C.useState([]),[M,T]=C.useState(!1),R=C.useRef(null),B=C.useRef(null),P=C.useRef(!1),L=C.useCallback(async()=>{try{const O=await QD(e.id);w(O.branches),S(O.tags),N(O.stashCount)}catch{}},[e.id]),H=C.useCallback(async()=>{try{const O=await KD(e.id);E(O.files)}catch{}},[e.id]),F=C.useCallback(async(O,D=!1)=>{if(!P.current){P.current=!0,f(!0),x(null);try{const X=await WD(e.id,O,50);s(K=>D?X.commits:[...K,...X.commits]),o(X.hasMore)}catch(X){x(X instanceof Error?X.message:"Failed to fetch git log")}finally{f(!1),g(!1),P.current=!1}}},[e.id]),G=C.useCallback(()=>{s([]),o(!0),g(!0),F(0,!0),L(),H()},[F,L,H]);C.useEffect(()=>{F(0,!0),L(),H()},[F,L,H]),C.useEffect(()=>{t&&t>0&&G()},[t]),C.useEffect(()=>{const O=R.current;if(!O)return;const D=new IntersectionObserver(X=>{X[0].isIntersecting&&l&&!P.current&&a.length>0&&F(a.length)},{rootMargin:"200px"});return D.observe(O),()=>D.disconnect()},[l,a.length,F]);const q=C.useMemo(()=>KU(a),[a]);return d.jsxs("div",{className:"animate-fade-in flex flex-col",style:{height:"calc(100vh - 260px)",minHeight:"400px"},children:[d.jsx("div",{className:"card mb-2 overflow-hidden",children:d.jsx(e$,{projectId:e.id,onRefresh:G,busy:M,setBusy:T,branches:y,statusFiles:_})}),d.jsxs("div",{className:"flex gap-3 flex-1 min-h-0",children:[d.jsxs("div",{className:"w-56 shrink-0 flex flex-col gap-2 min-h-0",children:[d.jsx("div",{className:"card overflow-y-auto p-3 flex-shrink-0",style:{maxHeight:"45%"},children:d.jsx(r$,{branches:y,tags:j,stashCount:k})}),d.jsxs("div",{className:"card overflow-y-auto p-2 flex-1 min-h-0",children:[d.jsxs("div",{className:"px-2 py-1 text-[11px] font-semibold text-warm-500 uppercase tracking-wider border-b border-warm-100 mb-1",children:[n("git.fileStatus")," (",_.length,")"]}),d.jsx(n$,{projectId:e.id,files:_,busy:M,setBusy:T,onRefresh:G})]})]}),d.jsxs("div",{className:"card flex-1 overflow-hidden flex flex-col min-h-0",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-warm-100",children:[d.jsx("span",{className:"text-sm font-semibold text-warm-700",children:n("git.commitHistory")}),d.jsxs("button",{onClick:G,disabled:c,className:"btn-ghost text-xs flex items-center gap-1.5",children:[d.jsx("svg",{className:`h-3.5 w-3.5 ${c?"animate-spin":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182"})}),n("git.refresh")]})]}),d.jsxs("div",{className:"flex items-center px-4 py-1.5 border-b border-warm-50 text-[10px] text-warm-400 uppercase tracking-wider",children:[d.jsx("div",{className:"w-24 shrink-0",children:n("git.graph")}),d.jsx("div",{className:"flex-1 min-w-0",children:n("git.description")}),d.jsx("div",{className:"w-14 text-right shrink-0",children:n("git.date")}),d.jsx("div",{className:"shrink-0 ml-2",children:n("git.author")}),d.jsx("div",{className:"w-16 text-right shrink-0",children:n("git.hash")})]}),p&&d.jsx("div",{className:"p-6 text-center",children:d.jsx("p",{className:"text-status-error text-sm",children:p})}),h&&!p&&d.jsx("div",{className:"p-6 text-center",children:d.jsx("p",{className:"text-warm-500 text-sm",children:n("detail.loading")})}),!h&&!p&&a.length===0&&d.jsx("div",{className:"p-6 text-center",children:d.jsx("p",{className:"text-warm-500 text-sm",children:n("git.noCommits")})}),a.length>0&&d.jsxs("div",{className:"flex-1 overflow-y-auto",ref:B,children:[d.jsxs("div",{className:"relative flex",children:[d.jsx("div",{className:"shrink-0 sticky left-0",children:d.jsx(JU,{graphNodes:q,totalRows:a.length})}),d.jsx("div",{className:"flex-1 min-w-0",children:a.map(O=>d.jsxs("div",{className:"flex items-center px-3 hover:bg-warm-50/50 transition-colors border-b border-warm-50/50",style:{height:Da},children:[d.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-1.5",children:[O.refs.length>0&&d.jsx("div",{className:"flex items-center gap-1 shrink-0",children:O.refs.map((D,X)=>d.jsx(WU,{refStr:D},X))}),d.jsx("span",{className:"text-xs text-warm-700 truncate",title:O.message,children:O.message})]}),d.jsx("div",{className:"w-14 text-right shrink-0",children:d.jsx("span",{className:"text-[11px] text-warm-400",title:O.date,children:a$(O.date)})}),d.jsx("div",{className:"shrink-0 ml-2",children:d.jsx("span",{className:"text-[11px] text-warm-500",children:O.author})}),d.jsx("div",{className:"w-16 text-right shrink-0",children:d.jsx("span",{className:"text-[11px] font-mono text-warm-400 cursor-pointer hover:text-accent transition-colors",title:O.hash,onClick:()=>navigator.clipboard.writeText(O.hash),children:O.hash.substring(0,7)})})]},O.hash))})]}),d.jsx("div",{ref:R,className:"h-8 flex items-center justify-center",children:c&&d.jsx("span",{className:"text-xs text-warm-400",children:n("git.loadMore")})})]})]})]})]})}const s$=["architect","developer","reviewer","pm","tester","custom"],di=["#6366f1","#8b5cf6","#ec4899","#f43f5e","#f97316","#eab308","#22c55e","#14b8a6","#06b6d4","#3b82f6"],l$=[{name:"Architect",nameKo:"아키텍트",role:"architect",prompt:"You are a senior software architect. Focus on system design, scalability, maintainability, and separation of concerns. Evaluate proposals for architectural soundness and suggest patterns that work well."},{name:"Developer",nameKo:"개발자",role:"developer",prompt:"You are a senior full-stack developer. Focus on implementation feasibility, code quality, existing patterns in the codebase, and developer experience. Be pragmatic about what can realistically be built."},{name:"Reviewer",nameKo:"리뷰어",role:"reviewer",prompt:"You are a senior code reviewer and quality advocate. Focus on edge cases, error handling, security, performance, and testing strategy. Challenge assumptions and find potential issues."},{name:"Product Manager",nameKo:"PM",role:"pm",prompt:"You are a product manager. Focus on user experience, feature scope, priorities, and trade-offs. Ensure the discussion stays grounded in user needs and business value."},{name:"Tester",nameKo:"테스터",role:"tester",prompt:"You are a QA engineer and testing specialist. Focus on testability, test coverage strategy, edge cases, regression risks, and how to verify the feature works correctly."}];function o$({projectId:e,agents:t,onAgentsChange:n}){const{t:a,lang:s}=Ue(),[l,o]=C.useState(!1),[c,f]=C.useState(null),[h,g]=C.useState(""),[p,x]=C.useState("developer"),[y,w]=C.useState(""),[j,S]=C.useState(""),[k,N]=C.useState(""),[_,E]=C.useState(di[0]),[M,T]=C.useState(!1),{getToolConfig:R}=ko(),B=()=>{g(""),x("developer"),w(""),S(""),N(""),E(di[Math.floor(Math.random()*di.length)]),o(!1),f(null)},P=async()=>{if(!(!h.trim()||!y.trim())){T(!0);try{if(c){const G=await HO(c,{name:h,role:p,system_prompt:y,avatar_color:_,cli_tool:j||null,cli_model:k||null});n(t.map(q=>q.id===c?G:q))}else{const G=await BO(e,{name:h,role:p,system_prompt:y,avatar_color:_,...j?{cli_tool:j}:{},...k?{cli_model:k}:{}});n([...t,G])}B()}finally{T(!1)}}},L=G=>{f(G.id),g(G.name),x(G.role),w(G.system_prompt),S(G.cli_tool||""),N(G.cli_model||""),E(G.avatar_color||di[0]),o(!0)},H=async G=>{await PO(G),n(t.filter(q=>q.id!==G))},F=G=>{g(s==="ko"?G.nameKo:G.name),x(G.role),w(G.prompt),E(di[Math.floor(Math.random()*di.length)]),o(!0)};return d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h3",{className:"text-sm font-semibold text-warm-700",children:a("agents.title")}),d.jsxs("button",{onClick:()=>{B(),o(!0)},className:"btn btn-sm text-xs",children:["+ ",a("agents.add")]})]}),t.length===0&&!l&&d.jsx("p",{className:"text-xs text-warm-400 py-2",children:a("agents.empty")}),d.jsx("div",{className:"space-y-2",children:t.map(G=>{var q;return d.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-xl bg-warm-50 border border-warm-150 hover:border-warm-250 transition-colors group",children:[d.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center text-white text-sm font-bold flex-shrink-0 shadow-sm",style:{backgroundColor:G.avatar_color||"#6366f1"},children:G.name.charAt(0).toUpperCase()}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"text-sm font-semibold text-warm-700 truncate",children:G.name}),d.jsxs("div",{className:"text-xs text-warm-400 mt-0.5",children:[a(`agents.roles.${G.role}`)||G.role,G.cli_tool&&d.jsxs("span",{className:"ml-1.5 text-warm-300",children:["· ",((q=za.find(O=>O.value===G.cli_tool))==null?void 0:q.label)||G.cli_tool,G.cli_model?` / ${G.cli_model}`:""]})]})]}),d.jsxs("div",{className:"flex gap-1.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[d.jsx("button",{onClick:()=>L(G),className:"p-1.5 text-warm-400 hover:text-warm-600 hover:bg-warm-100 rounded-lg transition-colors",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),d.jsx("button",{onClick:()=>H(G.id),className:"p-1.5 text-warm-400 hover:text-status-error hover:bg-red-50 rounded-lg transition-colors",children:d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]},G.id)})}),l&&d.jsxs("div",{className:"space-y-5 p-5 rounded-xl border border-warm-200 bg-theme-card shadow-sm",children:[!c&&d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:a("agents.presets")}),d.jsx("div",{className:"flex flex-wrap gap-2",children:l$.map(G=>d.jsx("button",{onClick:()=>F(G),className:"px-3 py-1.5 text-xs rounded-lg bg-warm-50 text-warm-600 hover:bg-warm-100 border border-warm-150 hover:border-warm-300 transition-colors font-medium",children:s==="ko"?G.nameKo:G.name},G.role))})]}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:a("agents.name")}),d.jsx("input",{type:"text",value:h,onChange:G=>g(G.target.value),className:"input-field",placeholder:s==="ko"?"에이전트 이름":"Agent name"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:a("agents.role")}),d.jsx("select",{value:p,onChange:G=>x(G.target.value),className:"input-field",children:s$.map(G=>d.jsx("option",{value:G,children:a(`agents.roles.${G}`)},G))})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:a("agents.systemPrompt")}),d.jsx("textarea",{value:y,onChange:G=>w(G.target.value),rows:5,className:"input-field resize-y min-h-[100px]",placeholder:s==="ko"?"이 에이전트의 전문 분야와 관점을 설명하세요...":"Describe this agent's expertise and perspective..."}),d.jsx("p",{className:"text-[10px] text-warm-400 mt-1.5",children:s==="ko"?"토론 시 이 에이전트가 어떤 관점에서 발언할지 결정합니다.":"Determines what perspective this agent brings to the discussion."})]}),d.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:a("agents.cliTool")}),d.jsxs("select",{value:j,onChange:G=>{S(G.target.value),N("")},className:"input-field text-sm",children:[d.jsx("option",{value:"",children:s==="ko"?"프로젝트 기본값 사용":"Use project default"}),za.map(G=>d.jsx("option",{value:G.value,children:G.label},G.value))]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:a("agents.cliModel")}),d.jsx("select",{value:k,onChange:G=>N(G.target.value),className:"input-field text-sm",disabled:!j,children:j?R(j).models.map(G=>d.jsx("option",{value:G.value,children:G.label},G.value)):d.jsx("option",{value:"",children:s==="ko"?"프로젝트 기본값 사용":"Use project default"})})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:a("agents.color")}),d.jsxs("div",{className:"flex items-center gap-2.5",children:[d.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center text-white text-sm font-bold flex-shrink-0 shadow-sm",style:{backgroundColor:_},children:h?h.charAt(0).toUpperCase():"?"}),d.jsx("div",{className:"flex flex-wrap gap-2",children:di.map(G=>d.jsx("button",{onClick:()=>E(G),className:`w-7 h-7 rounded-full transition-all ${_===G?"ring-2 ring-offset-2 ring-warm-400 scale-110":"hover:scale-105 opacity-70 hover:opacity-100"}`,style:{backgroundColor:G}},G))})]})]}),d.jsxs("div",{className:"flex justify-end gap-3 pt-2 border-t border-warm-100",children:[d.jsx("button",{onClick:B,className:"btn btn-sm text-xs text-warm-500",children:a("header.cancel")}),d.jsx("button",{onClick:P,disabled:!h.trim()||!y.trim()||M,className:"btn btn-sm btn-primary text-xs",children:a(M?"header.saving":"header.save")})]})]})]})}const p4={title:"",description:"",agent_ids:[],max_rounds:3,auto_implement:!1,implement_agent_id:""};function DA({agents:e,initialValues:t,mode:n,allowAdvancedFields:a=!0,submitting:s=!1,onSubmit:l,onCancel:o}){const{t:c,lang:f}=Ue(),[h,g]=C.useState({...p4,...t});C.useEffect(()=>{g({...p4,...t})},[t]);const p=(N,_)=>{g(E=>({...E,[N]:_}))},x=N=>c(`agents.roles.${N.role}`)||N.role,y=h.agent_ids.map(N=>e.find(_=>_.id===N)).filter(N=>!!N),w=N=>{g(_=>{const E=_.agent_ids.includes(N)?_.agent_ids.filter(M=>M!==N):[..._.agent_ids,N];return{..._,agent_ids:E,implement_agent_id:_.implement_agent_id&&!E.includes(_.implement_agent_id)?"":_.implement_agent_id}})},j=(N,_)=>{g(E=>{const M=E.agent_ids.indexOf(N),T=M+_;if(M===-1||T<0||T>=E.agent_ids.length)return E;const R=[...E.agent_ids];return[R[M],R[T]]=[R[T],R[M]],{...E,agent_ids:R}})},S=async()=>{!h.title.trim()||!h.description.trim()||a&&h.agent_ids.length<2||a&&h.auto_implement&&!h.implement_agent_id||await l({title:h.title.trim(),description:h.description.trim(),agent_ids:h.agent_ids,max_rounds:h.max_rounds,auto_implement:a?h.auto_implement:!1,implement_agent_id:a&&h.auto_implement?h.implement_agent_id:void 0})},k=h.title.trim()&&h.description.trim()&&(!a||h.agent_ids.length>=2)&&(!a||!h.auto_implement||!!h.implement_agent_id);return d.jsxs("div",{className:"card p-5 space-y-5",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:f==="ko"?"제목":"Title"}),d.jsx("input",{type:"text",value:h.title,onChange:N=>p("title",N.target.value),className:"input-field",placeholder:f==="ko"?"토론 주제를 입력하세요":"Enter discussion topic"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:f==="ko"?"설명":"Description"}),d.jsx("textarea",{value:h.description,onChange:N=>p("description",N.target.value),rows:4,className:"input-field resize-y min-h-[80px]",placeholder:f==="ko"?"토론할 기능이나 의사결정 배경을 자세히 설명하세요":"Describe the feature to discuss in detail"})]}),a&&d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{children:[d.jsxs("label",{className:"block text-xs font-medium text-warm-500 mb-1.5",children:[c("discussions.agents"),d.jsx("span",{className:"ml-2 text-warm-400 font-normal",children:f==="ko"?`(${h.agent_ids.length}명 선택됨 · 최소 2명)`:`(${h.agent_ids.length} selected · min 2)`})]}),d.jsx("p",{className:"text-[11px] text-warm-400",children:f==="ko"?"참여 에이전트를 고른 뒤, 아래 발언 순서에서 실제 토론 진행 순서를 조정합니다.":"Select participants first, then adjust the actual speaking order below."})]}),d.jsxs("div",{className:"rounded-2xl border border-accent/30 bg-accent/5 p-3 space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between gap-3",children:[d.jsxs("div",{children:[d.jsx("div",{className:"text-xs font-semibold text-warm-700",children:f==="ko"?"발언 순서":"Speaking Order"}),d.jsx("p",{className:"text-[11px] text-warm-500 mt-1",children:f==="ko"?"1라운드 기준이며, 이후 라운드에도 같은 순서로 반복됩니다.":"This order is used for round 1 and repeats in later rounds."})]}),y.length>=2&&d.jsx("div",{className:"text-[10px] font-semibold text-accent-dark bg-white/70 border border-accent/30 rounded-full px-2.5 py-1",children:f==="ko"?"순서 조정 가능":"Reorder enabled"})]}),y.length===0?d.jsx("div",{className:"rounded-xl border border-dashed border-warm-200 bg-white/70 px-4 py-5 text-center text-xs text-warm-400",children:f==="ko"?"에이전트를 선택하면 여기서 발언 순서를 바로 조정할 수 있습니다.":"Select agents to adjust the speaking order here."}):d.jsx("div",{className:"space-y-2",children:y.map((N,_)=>{const E=_===0,M=_===y.length-1,T=E?f==="ko"?"첫 발언":"Opens the round":M?f==="ko"?"마지막 발언":"Closes the round":f==="ko"?`${_+1}번째 발언`:`Turn ${_+1}`;return d.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border border-warm-200 bg-white/85 px-3 py-3 md:flex-row md:items-center md:justify-between",children:[d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[d.jsx("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full bg-accent text-[11px] font-bold text-white flex-shrink-0",children:_+1}),d.jsx("div",{className:"w-6 h-6 rounded-full flex-shrink-0 border border-white/80 shadow-sm",style:{backgroundColor:N.avatar_color||"#6366f1"}}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("div",{className:"text-sm font-semibold text-warm-700 truncate",children:N.name}),d.jsxs("div",{className:"text-[11px] text-warm-500",children:[x(N)," · ",T]})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{type:"button",onClick:()=>j(N.id,-1),disabled:E,className:"px-2.5 py-1.5 rounded-lg border border-warm-200 bg-warm-50 text-[11px] font-medium text-warm-600 hover:bg-warm-100 disabled:opacity-40 disabled:cursor-not-allowed",children:f==="ko"?"앞으로":"Earlier"}),d.jsx("button",{type:"button",onClick:()=>j(N.id,1),disabled:M,className:"px-2.5 py-1.5 rounded-lg border border-warm-200 bg-warm-50 text-[11px] font-medium text-warm-600 hover:bg-warm-100 disabled:opacity-40 disabled:cursor-not-allowed",children:f==="ko"?"뒤로":"Later"})]})]},N.id)})})]}),e.length===0?d.jsx("p",{className:"text-xs text-warm-400 py-3 px-4 bg-warm-50 rounded-xl border border-warm-150",children:c("agents.empty")}):d.jsx("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:e.map(N=>{const _=h.agent_ids.includes(N.id),E=h.agent_ids.indexOf(N.id)+1;return d.jsxs("button",{type:"button",onClick:()=>w(N.id),className:`text-left rounded-2xl border px-3.5 py-3 transition-all ${_?"border-accent bg-accent/5 shadow-sm":"border-warm-200 bg-warm-50 hover:border-warm-300 hover:bg-warm-100"}`,children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[d.jsx("div",{className:"w-6 h-6 rounded-full flex-shrink-0 border border-white/80 shadow-sm",style:{backgroundColor:N.avatar_color||"#6366f1"}}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("div",{className:`text-sm font-semibold truncate ${_?"text-warm-700":"text-warm-600"}`,children:N.name}),d.jsx("div",{className:"text-[11px] text-warm-400",children:x(N)})]})]}),_&&d.jsx("div",{className:"inline-flex items-center justify-center min-w-7 h-7 rounded-full bg-accent text-[11px] font-bold text-white flex-shrink-0",children:E})]}),d.jsx("div",{className:`mt-3 text-[11px] ${_?"text-accent-dark":"text-warm-400"}`,children:_?f==="ko"?`${E}번째 발언으로 참여 중`:`Included as turn ${E}`:f==="ko"?"클릭해서 참여 에이전트에 추가":"Click to add this participant"})]},N.id)})})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-2",children:c("discussions.maxRounds")}),d.jsx("input",{type:"number",min:1,max:10,value:h.max_rounds,onChange:N=>p("max_rounds",Number(N.target.value)),className:"input-field w-24 text-center"}),d.jsx("p",{className:"text-[10px] text-warm-400 mt-1.5",children:c("discussions.roundExplain")})]}),d.jsxs("div",{children:[d.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:h.auto_implement,onChange:N=>{const _=N.target.checked;g(E=>({...E,auto_implement:_,implement_agent_id:_?E.implement_agent_id:""}))},className:"rounded border-warm-300 text-accent focus:ring-accent"}),d.jsx("span",{className:"text-xs font-medium text-warm-500",children:c("discussions.autoImplement")})]}),d.jsx("p",{className:"text-[10px] text-warm-400 mt-1 ml-6",children:c("discussions.autoImplementHint")}),h.auto_implement&&d.jsxs("div",{className:"mt-2 ml-6",children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-1",children:c("discussions.selectAgent")}),d.jsxs("select",{value:h.implement_agent_id,onChange:N=>p("implement_agent_id",N.target.value),className:"input-field text-xs w-56",children:[d.jsx("option",{value:"",children:f==="ko"?"-- 에이전트 선택 --":"-- Select agent --"}),y.map(N=>d.jsxs("option",{value:N.id,children:[N.name," (",x(N),")"]},N.id))]})]})]})]}),d.jsxs("div",{className:"flex justify-end gap-3 pt-2 border-t border-warm-100",children:[d.jsx("button",{type:"button",onClick:o,className:"btn-secondary text-xs py-2",children:c("header.cancel")}),d.jsx("button",{type:"button",onClick:S,disabled:!k||s,className:"btn-primary text-xs py-2",children:c(s?"header.saving":n==="create"?"discussions.add":"header.save")})]})]})}const u$={pending:"bg-warm-200 text-warm-600",running:"bg-status-success/10 text-status-success",paused:"bg-amber-100 text-amber-700",completed:"bg-accent/10 text-accent",failed:"bg-status-error/10 text-status-error",merged:"bg-accent/10 text-accent"};function c$({projectId:e,discussions:t,onAddDiscussion:n,onStartDiscussion:a,onStopDiscussion:s,onDeleteDiscussion:l}){const{t:o}=Ue(),c=pb(),[f,h]=C.useState([]),[g,p]=C.useState(!1),[x,y]=C.useState(!1),[w,j]=C.useState(!1);C.useEffect(()=>{FE(e).then(h).catch(()=>{})},[e]);const S=C.useCallback(async N=>{j(!0);try{const _=await FO(e,N);n(_),p(!1)}finally{j(!1)}},[e,n]),k=N=>{try{return JSON.parse(N).map(E=>f.find(M=>M.id===E)).filter(E=>!!E)}catch{return[]}};return d.jsxs("div",{className:"space-y-4 animate-fade-in",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-sm font-semibold text-warm-700 tracking-wide uppercase",children:o("discussions.title")}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:()=>y(!x),className:"btn-secondary text-xs py-2",children:o("agents.manage")}),d.jsxs("button",{onClick:()=>p(!g),className:"btn-primary text-xs py-2",children:["+ ",o("discussions.add")]})]})]}),x&&d.jsx("div",{className:"card p-4",children:d.jsx(o$,{projectId:e,agents:f,onAgentsChange:h})}),g&&d.jsx(DA,{agents:f,mode:"create",submitting:w,onSubmit:S,onCancel:()=>p(!1)}),t.length===0&&!g?d.jsxs("div",{className:"card p-10 text-center",children:[d.jsx("p",{className:"text-warm-400 text-sm",children:o("discussions.empty")}),d.jsx("p",{className:"text-warm-300 text-xs mt-1",children:o("discussions.emptyHint")})]}):d.jsx("div",{className:"space-y-2",children:t.map(N=>{const _=k(N.agent_ids),E=N.status==="pending"||N.status==="paused"||N.status==="failed",M=N.status==="running";return d.jsx("div",{className:"card p-4 hover:shadow-md transition-shadow cursor-pointer",onClick:()=>c(`/projects/${e}/discussions/${N.id}`),children:d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("h3",{className:"text-sm font-semibold text-warm-700 truncate",children:N.title}),d.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase ${u$[N.status]||""}`,children:o(`status.${N.status}`)||N.status})]}),d.jsx("p",{className:"text-xs text-warm-400 mt-1 line-clamp-1",children:N.description}),d.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[d.jsxs("span",{className:"text-[10px] text-warm-400",children:[o("discussions.round")," ",N.current_round,"/",N.max_rounds]}),d.jsx("div",{className:"flex -space-x-1",children:_.slice(0,5).map(T=>d.jsx("div",{className:"w-5 h-5 rounded-full border-2 border-white text-[8px] text-white font-bold flex items-center justify-center",style:{backgroundColor:T.avatar_color||"#6366f1"},title:T.name,children:T.name.charAt(0)},T.id))})]})]}),d.jsxs("div",{className:"flex gap-1",onClick:T=>T.stopPropagation(),children:[E&&d.jsx("button",{onClick:()=>a(N.id),className:"p-1.5 text-status-success hover:bg-status-success/10 rounded transition-colors",title:o("header.runAll"),children:d.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M8 5v14l11-7z"})})}),M&&d.jsx("button",{onClick:()=>s(N.id),className:"p-1.5 text-amber-600 hover:bg-amber-50 rounded transition-colors",title:o("discussions.pause"),children:d.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})})}),d.jsx("button",{onClick:()=>l(N.id),className:"p-1.5 text-warm-400 hover:text-status-error rounded transition-colors",title:o("todo.delete"),children:d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]})},N.id)})})]})}function d$({onEvent:e,connected:t,sendMessage:n}){const{id:a}=gb(),[s,l]=C.useState(null),[o,c]=C.useState([]),[f,h]=C.useState([]),[g,p]=C.useState([]),[x,y]=C.useState([]),[w,j]=ND(),[S,k]=C.useState(w.get("tab")||"tasks"),N=C.useCallback(ie=>{k(ie),j(ie==="tasks"?{}:{tab:ie},{replace:!0})},[j]),[_,E]=C.useState(!0),[M,T]=C.useState(!1),[R,B]=C.useState(new Set),[P,L]=C.useState(0),{t:H}=Ue();C.useEffect(()=>{a&&Promise.all([FD(a),Ih(a),Aj(a),Mj(a),Rj(a)]).then(([ie,xe,J,fe,be])=>{l(ie),c(xe),h(J),p(fe),y(be);const Ne=xe.filter(Oe=>Oe.status==="running"&&Oe.execution_mode==="interactive").map(Oe=>Oe.id);Ne.length>0&&B(new Set(Ne))}).catch(()=>T(!0)).finally(()=>E(!1))},[a]);const F=C.useRef(o);F.current=o,C.useEffect(()=>{if(!a)return;const ie=setInterval(()=>{F.current.some(J=>J.status==="running")&&Ih(a).then(J=>{c(fe=>fe.map(be=>{const Ne=J.find(Oe=>Oe.id===be.id);return Ne&&Ne.status!==be.status?Ne:be}))}).catch(()=>{})},5e3);return()=>clearInterval(ie)},[a]);const G=C.useRef(t);C.useEffect(()=>{t&&!G.current&&a&&Promise.all([Ih(a),Aj(a),Mj(a),Rj(a)]).then(([ie,xe,J,fe])=>{c(ie),h(xe),p(J),y(fe)}).catch(()=>{}),G.current=t},[t,a]),C.useEffect(()=>e(ie=>{ie.type==="todo:status-changed"&&ie.todoId&&ie.status&&(c(xe=>xe.map(J=>{if(J.id!==ie.todoId)return J;const fe={status:ie.status,updated_at:new Date().toISOString()};return ie.worktree_path!==void 0&&(fe.worktree_path=ie.worktree_path??null),ie.branch_name!==void 0&&(fe.branch_name=ie.branch_name??null),{...J,...fe}})),(ie.status==="completed"||ie.status==="merged"||ie.status==="failed")&&L(xe=>xe+1),ie.status==="running"&&ie.mode==="interactive"?B(xe=>new Set(xe).add(ie.todoId)):ie.status!=="running"&&B(xe=>{const J=new Set(xe);return J.delete(ie.todoId),J})),ie.type==="pipeline:status-changed"&&ie.pipelineId&&h(xe=>xe.map(J=>J.id===ie.pipelineId?{...J,status:ie.status,current_phase:ie.currentPhase??null,updated_at:new Date().toISOString()}:J)),ie.type==="schedule:status-changed"&&ie.scheduleId&&p(xe=>xe.map(J=>J.id===ie.scheduleId?{...J,is_active:ie.isActive?1:0,updated_at:new Date().toISOString()}:J)),ie.type==="discussion:status-changed"&&ie.discussionId&&y(xe=>xe.map(J=>J.id===ie.discussionId?{...J,status:ie.status,current_round:ie.currentRound??J.current_round,updated_at:new Date().toISOString()}:J))}),[e]);const q=C.useCallback(async(ie,xe,J,fe,be,Ne,Oe)=>{if(!a)return;const ht=await Bh(a,{title:ie,description:xe,cli_tool:J,cli_model:fe,depends_on:Ne,max_turns:Oe??null});if(be&&be.length>0){const yt=await jb(ht.id,be.map(tt=>({name:tt.name,data:tt.data})));ht.images=JSON.stringify(yt.images)}c(yt=>[...yt,ht])},[a]),O=C.useCallback(async(ie,xe)=>{const J=xe==="interactive";J&&B(fe=>new Set(fe).add(ie));try{const fe=await Tj(ie,xe);c(be=>be.map(Ne=>Ne.id===ie?fe:Ne))}catch(fe){throw J&&B(be=>{const Ne=new Set(be);return Ne.delete(ie),Ne}),fe}},[]),D=C.useCallback(async ie=>{const xe=await yO(ie);c(J=>J.map(fe=>fe.id===ie?xe:fe))},[]),X=C.useCallback(async ie=>{await xO(ie),c(xe=>xe.filter(J=>J.id!==ie))},[]),K=C.useCallback(async(ie,xe,J,fe,be,Ne,Oe)=>{const ht=await Hh(ie,{title:xe,description:J,cli_tool:fe,cli_model:be,depends_on:Ne??null,max_turns:Oe??null});c(yt=>yt.map(tt=>tt.id===ie?ht:tt))},[]),Z=C.useCallback(async ie=>{await bO(ie),c(xe=>xe.map(J=>J.id===ie?{...J,status:"merged",worktree_path:null,branch_name:null,updated_at:new Date().toISOString()}:J))},[]),z=C.useCallback(async ie=>{const xe=await vO(ie),J=new Set(xe.mergedIds);c(fe=>fe.map(be=>J.has(be.id)?{...be,status:"merged",worktree_path:null,branch_name:null,updated_at:new Date().toISOString()}:be))},[]),$=C.useCallback(async ie=>{await wO(ie),c(xe=>xe.map(J=>J.id===ie?{...J,worktree_path:null,branch_name:null,updated_at:new Date().toISOString()}:J))},[]),Q=C.useCallback(async(ie,xe)=>{const J=xe==="interactive";J&&B(fe=>new Set(fe).add(ie));try{const fe=await jO(ie,xe);c(be=>be.map(Ne=>Ne.id===ie?fe:Ne))}catch(fe){throw J&&B(be=>{const Ne=new Set(be);return Ne.delete(ie),Ne}),fe}},[]),I=C.useCallback(async(ie,xe,J)=>{const fe=J==="interactive";fe&&B(be=>new Set(be).add(ie));try{const be=await kO(ie,xe,J);c(Ne=>Ne.map(Oe=>Oe.id===ie?be:Oe))}catch(be){throw fe&&B(Ne=>{const Oe=new Set(Ne);return Oe.delete(ie),Oe}),be}},[]),V=C.useCallback(async(ie,xe,J)=>{const fe=await DO(ie,xe,J);fe.original_deleted&&c(be=>be.filter(Ne=>Ne.id!==ie)),p(be=>[fe.schedule,...be])},[]),te=C.useCallback((ie,xe)=>{n({type:"todo:stdin",todoId:ie,input:xe})},[n]),ne=C.useCallback(async(ie,xe)=>{const J=await Hh(ie,{depends_on:xe});c(fe=>fe.map(be=>be.id===ie?J:be))},[]),W=C.useCallback(async(ie,xe,J)=>{await Hh(ie,{position_x:xe,position_y:J}),c(fe=>fe.map(be=>be.id===ie?{...be,position_x:xe,position_y:J}:be))},[]),Y=C.useCallback(async(ie,xe)=>{if(!a)return;const J=xe.map(Oe=>Oe.message).join(`
91
+ `),fe=`The previous task "${ie.title}" failed with the following errors:
92
+
93
+ ---
94
+ ${J}
95
+ ---
96
+
97
+ Please analyze the failure above and fix the issue. The original task description was:
98
+ ${ie.description||"(no description)"}`,be=`[Fix] ${ie.title}`,Ne=await Bh(a,{title:be.slice(0,200),description:fe,cli_tool:ie.cli_tool??void 0,cli_model:ie.cli_model??void 0});c(Oe=>[...Oe,Ne]);try{const Oe=await Tj(Ne.id,"headless");c(ht=>ht.map(yt=>yt.id===Ne.id?Oe:yt))}catch{}},[a]),ae=C.useCallback(async(ie,xe)=>{if(!a)return;const J=await SO(a,{title:ie,description:xe});h(fe=>[J,...fe])},[a]),he=C.useCallback(async ie=>{await HE(ie),h(xe=>xe.map(J=>J.id===ie?{...J,status:"running",updated_at:new Date().toISOString()}:J))},[]),ke=C.useCallback(async ie=>{await PE(ie),h(xe=>xe.map(J=>J.id===ie?{...J,status:"paused",updated_at:new Date().toISOString()}:J))},[]),_e=C.useCallback(async ie=>{await _O(ie),h(xe=>xe.filter(J=>J.id!==ie))},[]),oe=C.useCallback(async ie=>{if(!a)return;const xe=await RO(a,{title:ie.title,description:ie.description,cron_expression:ie.cronExpression||void 0,cli_tool:ie.cliTool,cli_model:ie.cliModel,skip_if_running:ie.skipIfRunning,schedule_type:ie.scheduleType,run_at:ie.runAt});p(J=>[xe,...J])},[a]),je=C.useCallback(async(ie,xe)=>{const J=xe?await zO(ie):await qO(ie);p(fe=>fe.map(be=>be.id===ie?J:be))},[]),Se=C.useCallback(async ie=>{await OO(ie),p(xe=>xe.filter(J=>J.id!==ie))},[]),Ae=C.useCallback(async(ie,xe)=>{const J=await LO(ie,xe);p(fe=>fe.map(be=>be.id===ie?J:be))},[]),se=C.useCallback(async ie=>{await IO(ie)},[]),Ee=C.useCallback(ie=>{y(xe=>[ie,...xe])},[]),Te=C.useCallback(async ie=>{await UE(ie),y(xe=>xe.map(J=>J.id===ie?{...J,status:"running",updated_at:new Date().toISOString()}:J))},[]),Me=C.useCallback(async ie=>{await $E(ie),y(xe=>xe.map(J=>J.id===ie?{...J,status:"paused",updated_at:new Date().toISOString()}:J))},[]),we=C.useCallback(async ie=>{await $O(ie),y(xe=>xe.filter(J=>J.id!==ie))},[]),De=C.useCallback(async()=>{a&&(await VD(a),c(ie=>ie.map(xe=>xe.status==="pending"||xe.status==="failed"||xe.status==="stopped"?{...xe,status:"running",updated_at:new Date().toISOString()}:xe)))},[a]),Be=C.useCallback(async()=>{a&&(await YD(a),c(ie=>ie.map(xe=>xe.status==="running"?{...xe,status:"stopped",updated_at:new Date().toISOString()}:xe)))},[a]);return _?d.jsx("div",{className:"px-6 py-6 sm:px-8 sm:py-8",children:d.jsx("div",{className:"text-center py-20 animate-fade-in",style:{color:"var(--color-text-muted)"},children:H("detail.loading")})}):M||!s?d.jsx("div",{className:"px-6 py-6 sm:px-8 sm:py-8",children:d.jsxs("div",{className:"card p-16 text-center animate-fade-in",children:[d.jsx("p",{className:"text-status-error font-medium text-lg",children:H("detail.notFound")}),d.jsx(Hn,{to:"/",className:"mt-4 inline-block text-sm text-accent hover:text-accent-dark transition-colors",children:H("detail.backToProjects")})]})}):d.jsxs("div",{className:"px-6 py-6 sm:px-8 sm:py-8",children:[d.jsx(r8,{project:s,todos:o,onStartAll:De,onStopAll:Be,onProjectUpdate:ie=>l(ie)}),d.jsx(qU,{todos:o}),d.jsxs("div",{className:"flex gap-0 mb-4 border-b border-theme-border overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:[d.jsxs("button",{onClick:()=>N("tasks"),className:`px-3 sm:px-5 py-2 sm:py-2.5 text-[10px] sm:text-xs font-semibold tracking-wider uppercase border-b-2 whitespace-nowrap -mb-px transition-colors ${S==="tasks"?"text-accent border-accent":"text-theme-muted border-transparent hover:text-theme-text-secondary"}`,children:[H("tabs.tasks")," (",o.length,")"]}),d.jsxs("button",{onClick:()=>N("pipelines"),className:`px-3 sm:px-5 py-2 sm:py-2.5 text-[10px] sm:text-xs font-semibold tracking-wider uppercase border-b-2 whitespace-nowrap -mb-px transition-colors ${S==="pipelines"?"text-accent border-accent":"text-theme-muted border-transparent hover:text-theme-text-secondary"}`,children:[H("tabs.pipelines")," (",f.length,")"]}),d.jsxs("button",{onClick:()=>N("discussions"),className:`px-3 sm:px-5 py-2 sm:py-2.5 text-[10px] sm:text-xs font-semibold tracking-wider uppercase border-b-2 whitespace-nowrap -mb-px transition-colors ${S==="discussions"?"text-accent border-accent":"text-theme-muted border-transparent hover:text-theme-text-secondary"}`,children:[H("tabs.discussions")," (",x.length,")"]}),d.jsxs("button",{onClick:()=>N("schedules"),className:`px-3 sm:px-5 py-2 sm:py-2.5 text-[10px] sm:text-xs font-semibold tracking-wider uppercase border-b-2 whitespace-nowrap -mb-px transition-colors ${S==="schedules"?"text-accent border-accent":"text-theme-muted border-transparent hover:text-theme-text-secondary"}`,children:[H("tabs.schedules")," (",g.length,")"]}),Sj(s).map(ie=>d.jsx("button",{onClick:()=>N(ie.id),className:`px-3 sm:px-5 py-2 sm:py-2.5 text-[10px] sm:text-xs font-semibold tracking-wider uppercase border-b-2 whitespace-nowrap -mb-px transition-colors ${S===ie.id?"text-accent border-accent":"text-theme-muted border-transparent hover:text-theme-text-secondary"}`,children:H(`tabs.${ie.id}`)||ie.displayName},ie.id)),s.is_git_repo?d.jsx("button",{onClick:()=>N("git"),className:`px-3 sm:px-5 py-2 sm:py-2.5 text-[10px] sm:text-xs font-semibold tracking-wider uppercase border-b-2 whitespace-nowrap -mb-px transition-colors ${S==="git"?"text-accent border-accent":"text-theme-muted border-transparent hover:text-theme-text-secondary"}`,children:H("tabs.git")}):null]}),S==="tasks"&&d.jsx(zU,{todos:o,projectCliTool:s.cli_tool,projectCliModel:s.claude_model??void 0,onAddTodo:q,onStartTodo:O,onStopTodo:D,onDeleteTodo:X,onEditTodo:K,onMergeTodo:Z,onMergeChain:z,onCleanupTodo:$,onRetryTodo:Q,onContinueTodo:I,onFixTodo:Y,onScheduleTodo:V,onUpdateDependency:ne,onUpdatePosition:W,onEvent:e,onSendInput:te,interactiveTodos:R,debugLogging:!!s.debug_logging,showTokenUsage:!!s.show_token_usage}),S==="pipelines"&&d.jsx(PU,{pipelines:f,onAddPipeline:ae,onStartPipeline:he,onStopPipeline:ke,onDeletePipeline:_e}),S==="discussions"&&a&&d.jsx(c$,{projectId:a,discussions:x,onAddDiscussion:Ee,onStartDiscussion:Te,onStopDiscussion:Me,onDeleteDiscussion:we}),Sj(s).map(ie=>S===ie.id&&ie.PanelComponent?d.jsx(ie.PanelComponent,{project:s,onImportAsTask:async(xe,J)=>{if(!a)return;const fe=await Bh(a,{title:xe,description:J});c(be=>[...be,fe])}},ie.id):null),S==="git"&&s.is_git_repo?d.jsx(i$,{project:s,refreshTrigger:P}):null,S==="schedules"&&d.jsx(XU,{schedules:g,projectCliTool:s.cli_tool,projectCliModel:s.claude_model??void 0,onAddSchedule:oe,onToggleSchedule:je,onDeleteSchedule:Se,onEditSchedule:Ae,onTriggerSchedule:se,onMergeRun:Z,onCleanupRun:$})]})}const f$={planning:"pipeline.planning",implementation:"pipeline.implementation",review:"pipeline.review",feedback_impl:"pipeline.feedback",documentation:"pipeline.documentation"},h$={planning:"P",implementation:"I",review:"R",feedback_impl:"F",documentation:"D"},g4={pending:{node:"bg-warm-100 border-warm-300 text-warm-400",label:"text-warm-400",line:"bg-warm-200"},running:{node:"bg-status-running/10 border-status-running text-status-running animate-pulse",label:"text-status-running font-semibold",line:"bg-status-running/30"},completed:{node:"bg-status-success/10 border-status-success text-status-success",label:"text-status-success",line:"bg-status-success/40"},failed:{node:"bg-status-error/10 border-status-error text-status-error",label:"text-status-error",line:"bg-status-error/30"},skipped:{node:"bg-warm-100 border-warm-300/50 text-warm-300",label:"text-warm-300",line:"bg-warm-200/50"}};function m$({phases:e,selectedPhase:t,onSelectPhase:n}){const{t:a}=Ue();return d.jsx("div",{className:"flex items-center justify-between gap-1 py-4 px-2 overflow-x-auto",children:e.map((s,l)=>{const o=g4[s.status]||g4.pending,c=t===s.phase_type;return d.jsxs("div",{className:"flex items-center flex-1 min-w-0",children:[d.jsxs("button",{onClick:()=>n(s.phase_type),className:"flex flex-col items-center gap-1.5 flex-shrink-0 group cursor-pointer",children:[d.jsx("div",{className:`
99
+ w-10 h-10 rounded-xl flex items-center justify-center border-2 text-sm font-bold
100
+ transition-all duration-200
101
+ ${o.node}
102
+ ${c?"ring-2 ring-offset-2 ring-offset-white ring-accent scale-110":"hover:scale-105"}
103
+ `,children:s.status==="completed"?d.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})}):s.status==="failed"?d.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}):s.status==="skipped"?d.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z"})}):h$[s.phase_type]}),d.jsx("span",{className:`text-[9px] font-semibold tracking-wider whitespace-nowrap uppercase ${o.label}`,children:a(f$[s.phase_type])||s.phase_type})]}),l<e.length-1&&d.jsx("div",{className:`flex-1 h-0.5 mx-1 rounded-full ${o.line} min-w-[12px]`})]},s.id)})})}const p$={planning:"pipeline.planningFull",implementation:"pipeline.implementationFull",review:"pipeline.reviewFull",feedback_impl:"pipeline.feedbackFull",documentation:"pipeline.documentationFull"},x4={info:"text-status-running",error:"text-status-error",output:"text-warm-600",commit:"text-status-success"},g$={info:"[INF]",error:"[ERR]",output:"[OUT]",commit:"[GIT]"};function x$({onEvent:e,connected:t}){const{id:n,pipelineId:a}=gb(),[s,l]=C.useState(null),[o,c]=C.useState(!0),[f,h]=C.useState(null),[g,p]=C.useState([]),[x,y]=C.useState(!1),[w,j]=C.useState(!1),[S,k]=C.useState(null),[N,_]=C.useState(!1),[E,M]=C.useState(!1),[T,R]=C.useState(!1),[B,P]=C.useState(null),{t:L}=Ue();C.useEffect(()=>{a&&ec(a).then(W=>{if(l(W),W.current_phase)h(W.current_phase);else if(W.phases.length>0){const Y=[...W.phases].reverse().find(ae=>ae.status==="completed");h((Y==null?void 0:Y.phase_type)||W.phases[0].phase_type)}}).catch(()=>P(L("pipeline.notFound"))).finally(()=>c(!1))},[a,L]),C.useEffect(()=>{!a||!f||(y(!1),EO(a,f).then(W=>{p(W),y(!0)}).catch(()=>p([])))},[a,f]),C.useEffect(()=>e(W=>{if(a){if(W.type==="pipeline:status-changed"&&W.pipelineId===a&&(l(Y=>Y&&{...Y,status:W.status,current_phase:W.currentPhase??null}),W.currentPhase&&W.status==="running"&&h(W.currentPhase)),W.type==="pipeline:phase-changed"&&W.pipelineId===a&&l(Y=>Y&&{...Y,phases:Y.phases.map(ae=>ae.phase_type===W.phaseType?{...ae,status:W.status}:ae)}),W.type==="pipeline:log"&&W.pipelineId===a&&W.phaseType===f){const Y={id:`ws-${Date.now()}-${Math.random()}`,pipeline_id:a,phase_type:W.phaseType||"",log_type:W.logType||"output",message:W.message||"",created_at:new Date().toISOString()};p(ae=>[...ae,Y])}if(W.type==="pipeline:commit"&&W.pipelineId===a&&W.phaseType===f){const Y={id:`ws-commit-${Date.now()}-${Math.random()}`,pipeline_id:a,phase_type:W.phaseType||"",log_type:"commit",message:`[${W.commitHash||""}] ${W.message||""}`,created_at:new Date().toISOString()};p(ae=>[...ae,Y])}}}),[e,a,f]),C.useEffect(()=>{const W=document.getElementById("pipeline-log-container");W&&(W.scrollTop=W.scrollHeight)},[g]);const H=C.useCallback(async()=>{if(a)try{const W=await HE(a);l(W)}catch(W){P(W instanceof Error?W.message:"Failed to start")}},[a]),F=C.useCallback(async()=>{if(a)try{await PE(a);const W=await ec(a);l(W)}catch(W){P(W instanceof Error?W.message:"Failed to stop")}},[a]),G=C.useCallback(async()=>{if(a)try{const W=await NO(a);l(W)}catch(W){P(W instanceof Error?W.message:"Failed to skip")}},[a]),q=C.useCallback(async()=>{if(a)try{const W=await CO(a);l(W)}catch(W){P(W instanceof Error?W.message:"Failed to retry")}},[a]),O=C.useCallback(async()=>{if(a){M(!0);try{await TO(a);const W=await ec(a);l(W)}catch(W){P(W instanceof Error?W.message:"Merge failed")}finally{M(!1)}}},[a]),D=C.useCallback(async()=>{if(a){R(!0);try{await MO(a);const W=await ec(a);l(W)}catch(W){P(W instanceof Error?W.message:"Cleanup failed")}finally{R(!1)}}},[a]),X=C.useCallback(async()=>{if(a){if(w){j(!1);return}_(!0);try{const W=await AO(a);k(W),j(!0)}catch(W){P(W instanceof Error?W.message:"Failed to load diff")}finally{_(!1)}}},[a,w]);if(o)return d.jsx("div",{className:"mx-auto max-w-4xl px-4 sm:px-6 py-6 sm:py-8",children:d.jsx("div",{className:"text-center py-20 text-warm-500 animate-fade-in",children:L("detail.loading")})});if(B&&!s)return d.jsx("div",{className:"mx-auto max-w-4xl px-4 sm:px-6 py-6 sm:py-8",children:d.jsxs("div",{className:"card p-16 text-center animate-fade-in",children:[d.jsx("p",{className:"text-status-error font-medium text-lg",children:B}),d.jsx(Hn,{to:`/projects/${n}`,className:"mt-4 inline-block text-sm text-accent hover:text-accent-dark transition-colors",children:L("pipeline.backToProject")})]})});if(!s)return null;const K=s.phases.find(W=>W.phase_type===f),Z=s.status==="pending"||s.status==="paused"||s.status==="failed",z=s.status==="running",$=s.status==="completed",Q=s.status==="running"||s.status==="paused",I=s.status==="failed",V=s.status==="completed"||s.status==="failed"||s.status==="merged",te=s.status!=="running"&&s.status!=="pending"&&(s.worktree_path||s.branch_name),ne=()=>({running:"bg-status-running/10 text-status-running",completed:"bg-status-success/10 text-status-success",failed:"bg-status-error/10 text-status-error",paused:"bg-status-warning/10 text-status-warning",merged:"bg-status-merged/10 text-status-merged",stopped:"bg-status-warning/10 text-status-warning"})[s.status]||"bg-warm-200 text-warm-500";return d.jsxs("div",{className:"mx-auto max-w-4xl px-4 sm:px-6 py-6 sm:py-8",children:[d.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[d.jsxs(Hn,{to:`/projects/${n}`,className:"inline-flex items-center gap-1.5 text-sm text-warm-500 hover:text-accent transition-colors",children:[d.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),L("detail.back")]}),d.jsx("span",{className:"text-warm-300",children:"/"}),d.jsx("span",{className:"text-sm text-warm-700 truncate font-medium",children:L("tabs.pipelines")}),t&&d.jsxs("span",{className:"ml-auto inline-flex items-center gap-1.5 text-xs text-status-success",children:[d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-status-success animate-pulse"}),L("detail.live")]})]}),d.jsx("div",{className:"card p-5 mb-6",children:d.jsxs("div",{className:"flex items-start justify-between gap-4",children:[d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("h1",{className:"text-lg font-semibold text-warm-800 mb-1",children:s.title}),d.jsx("p",{className:"text-sm text-warm-500 whitespace-pre-wrap leading-relaxed",children:s.description}),s.branch_name&&d.jsxs("span",{className:"inline-flex items-center gap-1 mt-2 px-2.5 py-0.5 rounded-full text-[10px] font-medium font-mono bg-accent/10 text-accent",children:[d.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m9.193-9.193a4.5 4.5 0 00-6.364 0l-4.5 4.5a4.5 4.5 0 001.242 7.244"})}),s.branch_name]})]}),d.jsx("div",{className:"flex flex-col items-end gap-2",children:d.jsxs("span",{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-semibold ${ne()}`,children:[s.status==="running"&&d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-status-running animate-pulse"}),L(`status.${s.status==="paused"?"stopped":s.status}`)]})})]})}),s.phases.length>0&&d.jsxs("div",{className:"card p-4 mb-6",children:[d.jsx("h3",{className:"text-xs font-semibold text-warm-500 uppercase tracking-wider mb-2",children:L("pipeline.phases")}),d.jsx(m$,{phases:s.phases,currentPhase:s.current_phase,selectedPhase:f,onSelectPhase:W=>{h(W),y(!1)}})]}),d.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[Z&&d.jsxs("button",{onClick:H,className:"btn-primary text-xs py-2",children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M8 5v14l11-7z"})}),s.status==="pending"?L("pipeline.start"):s.status==="paused"?L("pipeline.resume"):L("pipeline.retry")]}),z&&d.jsxs("button",{onClick:F,className:"btn-danger text-xs py-2",children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"})}),L("pipeline.pause")]}),Q&&d.jsxs("button",{onClick:G,className:"btn-secondary text-xs py-2",children:[d.jsx("svg",{className:"w-3.5 h-3.5",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M6 18l8.5-6L6 6v12zM16 6v12h2V6h-2z"})}),L("pipeline.skipPhase")]}),I&&d.jsx("button",{onClick:q,className:"btn-secondary text-xs py-2",children:L("pipeline.retryPhase")}),V&&d.jsx("button",{onClick:X,disabled:N,className:"btn-secondary text-xs py-2 disabled:opacity-40",children:L(w?"pipeline.hideDiff":"pipeline.viewDiff")}),$&&d.jsx("button",{onClick:O,disabled:E,className:"btn-primary text-xs py-2 disabled:opacity-40",children:L(E?"pipeline.merging":"pipeline.merge")}),te&&d.jsx("button",{onClick:D,disabled:T,className:"btn-danger text-xs py-2 disabled:opacity-40",children:L(T?"pipeline.cleaning":"pipeline.cleanup")})]}),B&&d.jsxs("div",{className:"py-2.5 px-4 mb-4 bg-status-error/5 border border-status-error/20 rounded-xl text-sm text-status-error flex items-center justify-between",children:[d.jsx("span",{children:B}),d.jsx("button",{onClick:()=>P(null),className:"text-xs underline ml-3 hover:no-underline",children:"dismiss"})]}),w&&S&&d.jsxs("div",{className:"card p-4 mb-6",children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsx("h4",{className:"text-xs font-semibold text-warm-500 uppercase tracking-wider",children:L("pipeline.diffOutput")}),d.jsxs("div",{className:"flex gap-3 text-xs font-mono",children:[d.jsxs("span",{className:"text-warm-500",children:[S.stats.files_changed," ",L("pipeline.files")]}),d.jsxs("span",{className:"text-status-success",children:["+",S.stats.insertions]}),d.jsxs("span",{className:"text-status-error",children:["-",S.stats.deletions]})]})]}),d.jsx("pre",{className:"h-60 sm:h-80 overflow-auto bg-warm-50 border border-warm-200 rounded-xl p-3 sm:p-4 font-mono text-xs leading-relaxed",children:S.diff?S.diff.split(`
104
+ `).map((W,Y)=>{let ae="text-warm-500";return W.startsWith("+")&&!W.startsWith("+++")?ae="text-status-success":W.startsWith("-")&&!W.startsWith("---")?ae="text-status-error":W.startsWith("@@")?ae="text-status-running":W.startsWith("diff ")&&(ae="text-accent font-semibold"),d.jsx("div",{className:ae,children:W},Y)}):d.jsx("span",{className:"text-warm-400 italic",children:L("pipeline.noChanges")})})]}),f&&d.jsxs("div",{className:"card p-4",children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsxs("h3",{className:"text-xs font-semibold text-warm-500 uppercase tracking-wider",children:[L(p$[f])||f," — LOG"]}),(K==null?void 0:K.status)&&d.jsx("span",{className:`text-[10px] font-semibold tracking-wider uppercase ${K.status==="running"?"text-status-running":K.status==="completed"?"text-status-success":K.status==="failed"?"text-status-error":K.status==="skipped"?"text-status-warning":"text-warm-400"}`,children:L(`status.${K.status==="skipped"?"stopped":K.status==="running"?"running":K.status==="completed"?"completed":K.status==="failed"?"failed":"pending"}`)})]}),(K==null?void 0:K.output)&&d.jsxs("details",{className:"mb-3",children:[d.jsx("summary",{className:"text-xs text-accent cursor-pointer hover:underline font-medium",children:L("pipeline.phaseOutput")}),d.jsx("pre",{className:"mt-2 max-h-60 overflow-auto bg-warm-50 border border-warm-200 rounded-xl p-3 font-mono text-xs text-warm-600 leading-relaxed whitespace-pre-wrap",children:K.output})]}),d.jsx("div",{id:"pipeline-log-container",className:"h-80 overflow-y-auto bg-warm-50 border border-warm-200 rounded-xl p-4 font-mono text-xs",children:x?g.length===0?d.jsx("p",{className:"text-warm-400",children:L("pipeline.awaitingOutput")}):g.map(W=>{const Y=new Date(W.created_at).toLocaleTimeString();return d.jsxs("div",{className:"mb-0.5 leading-relaxed",children:[d.jsx("span",{className:"text-warm-300",children:Y})," ",d.jsx("span",{className:`font-bold ${x4[W.log_type]||"text-warm-600"}`,children:g$[W.log_type]||"[???]"})," ",d.jsx("span",{className:x4[W.log_type]||"text-warm-600",children:W.message})]},W.id)}):d.jsx("p",{className:"text-warm-400 animate-pulse",children:L("pipeline.loadingLogs")})})]})]})}function y$(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const b$=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,v$=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,w$={};function y4(e,t){return(w$.jsx?v$:b$).test(e)}const j$=/[ \t\n\f\r]/g;function k$(e){return typeof e=="object"?e.type==="text"?b4(e.value):!1:b4(e)}function b4(e){return e.replace(j$,"")===""}class Oo{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Oo.prototype.normal={};Oo.prototype.property={};Oo.prototype.space=void 0;function OA(e,t){const n={},a={};for(const s of e)Object.assign(n,s.property),Object.assign(a,s.normal);return new Oo(n,a,t)}function nb(e){return e.toLowerCase()}class yn{constructor(t,n){this.attribute=n,this.property=t}}yn.prototype.attribute="";yn.prototype.booleanish=!1;yn.prototype.boolean=!1;yn.prototype.commaOrSpaceSeparated=!1;yn.prototype.commaSeparated=!1;yn.prototype.defined=!1;yn.prototype.mustUseProperty=!1;yn.prototype.number=!1;yn.prototype.overloadedBoolean=!1;yn.prototype.property="";yn.prototype.spaceSeparated=!1;yn.prototype.space=void 0;let S$=0;const Xe=Ni(),Bt=Ni(),rb=Ni(),Ce=Ni(),wt=Ni(),Ss=Ni(),Nn=Ni();function Ni(){return 2**++S$}const ab=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xe,booleanish:Bt,commaOrSpaceSeparated:Nn,commaSeparated:Ss,number:Ce,overloadedBoolean:rb,spaceSeparated:wt},Symbol.toStringTag,{value:"Module"})),by=Object.keys(ab);class sv extends yn{constructor(t,n,a,s){let l=-1;if(super(t,n),v4(this,"space",s),typeof a=="number")for(;++l<by.length;){const o=by[l];v4(this,by[l],(a&ab[o])===ab[o])}}}sv.prototype.defined=!0;function v4(e,t,n){n&&(e[t]=n)}function Us(e){const t={},n={};for(const[a,s]of Object.entries(e.properties)){const l=new sv(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(l.mustUseProperty=!0),t[a]=l,n[nb(a)]=a,n[nb(l.attribute)]=a}return new Oo(t,n,e.space)}const zA=Us({properties:{ariaActiveDescendant:null,ariaAtomic:Bt,ariaAutoComplete:null,ariaBusy:Bt,ariaChecked:Bt,ariaColCount:Ce,ariaColIndex:Ce,ariaColSpan:Ce,ariaControls:wt,ariaCurrent:null,ariaDescribedBy:wt,ariaDetails:null,ariaDisabled:Bt,ariaDropEffect:wt,ariaErrorMessage:null,ariaExpanded:Bt,ariaFlowTo:wt,ariaGrabbed:Bt,ariaHasPopup:null,ariaHidden:Bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:wt,ariaLevel:Ce,ariaLive:null,ariaModal:Bt,ariaMultiLine:Bt,ariaMultiSelectable:Bt,ariaOrientation:null,ariaOwns:wt,ariaPlaceholder:null,ariaPosInSet:Ce,ariaPressed:Bt,ariaReadOnly:Bt,ariaRelevant:null,ariaRequired:Bt,ariaRoleDescription:wt,ariaRowCount:Ce,ariaRowIndex:Ce,ariaRowSpan:Ce,ariaSelected:Bt,ariaSetSize:Ce,ariaSort:null,ariaValueMax:Ce,ariaValueMin:Ce,ariaValueNow:Ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function qA(e,t){return t in e?e[t]:t}function IA(e,t){return qA(e,t.toLowerCase())}const _$=Us({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ss,acceptCharset:wt,accessKey:wt,action:null,allow:null,allowFullScreen:Xe,allowPaymentRequest:Xe,allowUserMedia:Xe,alt:null,as:null,async:Xe,autoCapitalize:null,autoComplete:wt,autoFocus:Xe,autoPlay:Xe,blocking:wt,capture:null,charSet:null,checked:Xe,cite:null,className:wt,cols:Ce,colSpan:null,content:null,contentEditable:Bt,controls:Xe,controlsList:wt,coords:Ce|Ss,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xe,defer:Xe,dir:null,dirName:null,disabled:Xe,download:rb,draggable:Bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xe,formTarget:null,headers:wt,height:Ce,hidden:rb,high:Ce,href:null,hrefLang:null,htmlFor:wt,httpEquiv:wt,id:null,imageSizes:null,imageSrcSet:null,inert:Xe,inputMode:null,integrity:null,is:null,isMap:Xe,itemId:null,itemProp:wt,itemRef:wt,itemScope:Xe,itemType:wt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xe,low:Ce,manifest:null,max:null,maxLength:Ce,media:null,method:null,min:null,minLength:Ce,multiple:Xe,muted:Xe,name:null,nonce:null,noModule:Xe,noValidate:Xe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Xe,optimum:Ce,pattern:null,ping:wt,placeholder:null,playsInline:Xe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xe,referrerPolicy:null,rel:wt,required:Xe,reversed:Xe,rows:Ce,rowSpan:Ce,sandbox:wt,scope:null,scoped:Xe,seamless:Xe,selected:Xe,shadowRootClonable:Xe,shadowRootDelegatesFocus:Xe,shadowRootMode:null,shape:null,size:Ce,sizes:null,slot:null,span:Ce,spellCheck:Bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ce,step:null,style:null,tabIndex:Ce,target:null,title:null,translate:null,type:null,typeMustMatch:Xe,useMap:null,value:Bt,width:Ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:wt,axis:null,background:null,bgColor:null,border:Ce,borderColor:null,bottomMargin:Ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xe,declare:Xe,event:null,face:null,frame:null,frameBorder:null,hSpace:Ce,leftMargin:Ce,link:null,longDesc:null,lowSrc:null,marginHeight:Ce,marginWidth:Ce,noResize:Xe,noHref:Xe,noShade:Xe,noWrap:Xe,object:null,profile:null,prompt:null,rev:null,rightMargin:Ce,rules:null,scheme:null,scrolling:Bt,standby:null,summary:null,text:null,topMargin:Ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ce,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Xe,disableRemotePlayback:Xe,prefix:null,property:null,results:Ce,security:null,unselectable:null},space:"html",transform:IA}),N$=Us({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Nn,accentHeight:Ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ce,amplitude:Ce,arabicForm:null,ascent:Ce,attributeName:null,attributeType:null,azimuth:Ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ce,by:null,calcMode:null,capHeight:Ce,className:wt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ce,diffuseConstant:Ce,direction:null,display:null,dur:null,divisor:Ce,dominantBaseline:null,download:Xe,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ce,enableBackground:null,end:null,event:null,exponent:Ce,externalResourcesRequired:null,fill:null,fillOpacity:Ce,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ss,g2:Ss,glyphName:Ss,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ce,horizOriginX:Ce,horizOriginY:Ce,id:null,ideographic:Ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ce,k:Ce,k1:Ce,k2:Ce,k3:Ce,k4:Ce,kernelMatrix:Nn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ce,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ce,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ce,overlineThickness:Ce,paintOrder:null,panose1:null,path:null,pathLength:Ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:wt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ce,pointsAtY:Ce,pointsAtZ:Ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Nn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Nn,rev:Nn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Nn,requiredFeatures:Nn,requiredFonts:Nn,requiredFormats:Nn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ce,specularExponent:Ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ce,strikethroughThickness:Ce,string:null,stroke:null,strokeDashArray:Nn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ce,strokeOpacity:Ce,strokeWidth:null,style:null,surfaceScale:Ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Nn,tabIndex:Ce,tableValues:null,target:null,targetX:Ce,targetY:Ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Nn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ce,underlineThickness:Ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ce,values:null,vAlphabetic:Ce,vMathematical:Ce,vectorEffect:null,vHanging:Ce,vIdeographic:Ce,version:null,vertAdvY:Ce,vertOriginX:Ce,vertOriginY:Ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:qA}),BA=Us({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),HA=Us({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:IA}),PA=Us({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),C$={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},E$=/[A-Z]/g,w4=/-[a-z]/g,T$=/^data[-\w.:]+$/i;function A$(e,t){const n=nb(t);let a=t,s=yn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&T$.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(w4,R$);a="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!w4.test(l)){let o=l.replace(E$,M$);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=sv}return new s(a,t)}function M$(e){return"-"+e.toLowerCase()}function R$(e){return e.charAt(1).toUpperCase()}const L$=OA([zA,_$,BA,HA,PA],"html"),lv=OA([zA,N$,BA,HA,PA],"svg");function D$(e){return e.join(" ").trim()}var gs={},vy,j4;function O$(){if(j4)return vy;j4=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
105
+ `,h="/",g="*",p="",x="comment",y="declaration";function w(S,k){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];k=k||{};var N=1,_=1;function E(q){var O=q.match(t);O&&(N+=O.length);var D=q.lastIndexOf(f);_=~D?q.length-D:_+q.length}function M(){var q={line:N,column:_};return function(O){return O.position=new T(q),P(),O}}function T(q){this.start=q,this.end={line:N,column:_},this.source=k.source}T.prototype.content=S;function R(q){var O=new Error(k.source+":"+N+":"+_+": "+q);if(O.reason=q,O.filename=k.source,O.line=N,O.column=_,O.source=S,!k.silent)throw O}function B(q){var O=q.exec(S);if(O){var D=O[0];return E(D),S=S.slice(D.length),O}}function P(){B(n)}function L(q){var O;for(q=q||[];O=H();)O!==!1&&q.push(O);return q}function H(){var q=M();if(!(h!=S.charAt(0)||g!=S.charAt(1))){for(var O=2;p!=S.charAt(O)&&(g!=S.charAt(O)||h!=S.charAt(O+1));)++O;if(O+=2,p===S.charAt(O-1))return R("End of comment missing");var D=S.slice(2,O-2);return _+=2,E(D),S=S.slice(O),_+=2,q({type:x,comment:D})}}function F(){var q=M(),O=B(a);if(O){if(H(),!B(s))return R("property missing ':'");var D=B(l),X=q({type:y,property:j(O[0].replace(e,p)),value:D?j(D[0].replace(e,p)):p});return B(o),X}}function G(){var q=[];L(q);for(var O;O=F();)O!==!1&&(q.push(O),L(q));return q}return P(),G()}function j(S){return S?S.replace(c,p):p}return vy=w,vy}var k4;function z$(){if(k4)return gs;k4=1;var e=gs&&gs.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(gs,"__esModule",{value:!0}),gs.default=n;const t=e(O$());function n(a,s){let l=null;if(!a||typeof a!="string")return l;const o=(0,t.default)(a),c=typeof s=="function";return o.forEach(f=>{if(f.type!=="declaration")return;const{property:h,value:g}=f;c?s(h,g,f):g&&(l=l||{},l[h]=g)}),l}return gs}var Pl={},S4;function q$(){if(S4)return Pl;S4=1,Object.defineProperty(Pl,"__esModule",{value:!0}),Pl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,l=function(h){return!h||n.test(h)||e.test(h)},o=function(h,g){return g.toUpperCase()},c=function(h,g){return"".concat(g,"-")},f=function(h,g){return g===void 0&&(g={}),l(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(s,c):h=h.replace(a,c),h.replace(t,o))};return Pl.camelCase=f,Pl}var Fl,_4;function I$(){if(_4)return Fl;_4=1;var e=Fl&&Fl.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(z$()),n=q$();function a(s,l){var o={};return!s||typeof s!="string"||(0,t.default)(s,function(c,f){c&&f&&(o[(0,n.camelCase)(c,l)]=f)}),o}return a.default=a,Fl=a,Fl}var B$=I$();const H$=Ds(B$),FA=UA("end"),ov=UA("start");function UA(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function P$(e){const t=ov(e),n=FA(e);if(t&&n)return{start:t,end:n}}function eo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?N4(e.position):"start"in e||"end"in e?N4(e):"line"in e||"column"in e?ib(e):""}function ib(e){return C4(e&&e.line)+":"+C4(e&&e.column)}function N4(e){return ib(e&&e.start)+"-"+ib(e&&e.end)}function C4(e){return e&&typeof e=="number"?e:1}class en extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let s="",l={},o=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?s=t:!l.cause&&t&&(o=!0,s=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof a=="string"){const f=a.indexOf(":");f===-1?l.ruleId=a:(l.source=a.slice(0,f),l.ruleId=a.slice(f+1))}if(!l.place&&l.ancestors&&l.ancestors){const f=l.ancestors[l.ancestors.length-1];f&&(l.place=f.position)}const c=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=c?c.line:void 0,this.name=eo(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}en.prototype.file="";en.prototype.name="";en.prototype.reason="";en.prototype.message="";en.prototype.stack="";en.prototype.column=void 0;en.prototype.line=void 0;en.prototype.ancestors=void 0;en.prototype.cause=void 0;en.prototype.fatal=void 0;en.prototype.place=void 0;en.prototype.ruleId=void 0;en.prototype.source=void 0;const uv={}.hasOwnProperty,F$=new Map,U$=/[A-Z]/g,$$=new Set(["table","tbody","thead","tfoot","tr"]),G$=new Set(["td","th"]),$A="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function V$(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=eG(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=J$(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?lv:L$,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=GA(s,e,void 0);return l&&typeof l!="string"?l:s.create(e,s.Fragment,{children:l||void 0},void 0)}function GA(e,t,n){if(t.type==="element")return Y$(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return X$(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return W$(e,t,n);if(t.type==="mdxjsEsm")return K$(e,t);if(t.type==="root")return Q$(e,t,n);if(t.type==="text")return Z$(e,t)}function Y$(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=lv,e.schema=s),e.ancestors.push(t);const l=YA(e,t.tagName,!1),o=tG(e,t);let c=dv(e,t);return $$.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!k$(f):!0})),VA(e,o,l,t),cv(o,c),e.ancestors.pop(),e.schema=a,e.create(t,l,o,n)}function X$(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}xo(e,t.position)}function K$(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);xo(e,t.position)}function W$(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=lv,e.schema=s),e.ancestors.push(t);const l=t.name===null?e.Fragment:YA(e,t.name,!0),o=nG(e,t),c=dv(e,t);return VA(e,o,l,t),cv(o,c),e.ancestors.pop(),e.schema=a,e.create(t,l,o,n)}function Q$(e,t,n){const a={};return cv(a,dv(e,t)),e.create(t,e.Fragment,a,n)}function Z$(e,t){return t.value}function VA(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function cv(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function J$(e,t,n){return a;function a(s,l,o,c){const h=Array.isArray(o.children)?n:t;return c?h(l,o,c):h(l,o)}}function eG(e,t){return n;function n(a,s,l,o){const c=Array.isArray(l.children),f=ov(a);return t(s,l,o,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function tG(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&uv.call(t.properties,s)){const l=rG(e,s,t.properties[s]);if(l){const[o,c]=l;e.tableCellAlignToStyle&&o==="align"&&typeof c=="string"&&G$.has(t.tagName)?a=c:n[o]=c}}if(a){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function nG(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const l=a.data.estree.body[0];l.type;const o=l.expression;o.type;const c=o.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else xo(e,t.position);else{const s=a.name;let l;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const c=a.value.data.estree.body[0];c.type,l=e.evaluater.evaluateExpression(c.expression)}else xo(e,t.position);else l=a.value===null?!0:a.value;n[s]=l}return n}function dv(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:F$;for(;++a<t.children.length;){const l=t.children[a];let o;if(e.passKeys){const f=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(f){const h=s.get(f)||0;o=f+"-"+h,s.set(f,h+1)}}const c=GA(e,l,o);c!==void 0&&n.push(c)}return n}function rG(e,t,n){const a=A$(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?y$(n):D$(n)),a.property==="style"){let s=typeof n=="object"?n:aG(e,String(n));return e.stylePropertyNameCase==="css"&&(s=iG(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?C$[a.property]||a.property:a.attribute,n]}}function aG(e,t){try{return H$(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new en("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=$A+"#cannot-parse-style-attribute",s}}function YA(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let l=-1,o;for(;++l<s.length;){const c=y4(s[l])?{type:"Identifier",name:s[l]}:{type:"Literal",value:s[l]};o=o?{type:"MemberExpression",object:o,property:c,computed:!!(l&&c.type==="Literal"),optional:!1}:c}a=o}else a=y4(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return uv.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);xo(e)}function xo(e,t){const n=new en("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=$A+"#cannot-handle-mdx-estrees-without-createevaluater",n}function iG(e){const t={};let n;for(n in e)uv.call(e,n)&&(t[sG(n)]=e[n]);return t}function sG(e){let t=e.replace(U$,lG);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function lG(e){return"-"+e.toLowerCase()}const wy={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},oG={};function fv(e,t){const n=oG,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return XA(e,a,s)}function XA(e,t,n){if(uG(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return E4(e.children,t,n)}return Array.isArray(e)?E4(e,t,n):""}function E4(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=XA(e[s],t,n);return a.join("")}function uG(e){return!!(e&&typeof e=="object")}const T4=document.createElement("i");function hv(e){const t="&"+e+";";T4.innerHTML=t;const n=T4.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function En(e,t,n,a){const s=e.length;let l=0,o;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,a.length<1e4)o=Array.from(a),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);l<a.length;)o=a.slice(l,l+1e4),o.unshift(t,0),e.splice(...o),l+=1e4,t+=1e4}function Bn(e,t){return e.length>0?(En(e,e.length,0,t),e):t}const A4={}.hasOwnProperty;function KA(e){const t={};let n=-1;for(;++n<e.length;)cG(t,e[n]);return t}function cG(e,t){let n;for(n in t){const s=(A4.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let o;if(l)for(o in l){A4.call(s,o)||(s[o]=[]);const c=l[o];dG(s[o],Array.isArray(c)?c:c?[c]:[])}}}function dG(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);En(e,0,0,a)}function WA(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Jn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const an=Ba(/[A-Za-z]/),Jt=Ba(/[\dA-Za-z]/),fG=Ba(/[#-'*+\--9=?A-Z^-~]/);function Dc(e){return e!==null&&(e<32||e===127)}const sb=Ba(/\d/),hG=Ba(/[\dA-Fa-f]/),mG=Ba(/[!-/:-@[-`{-~]/);function Pe(e){return e!==null&&e<-2}function vt(e){return e!==null&&(e<0||e===32)}function Ze(e){return e===-2||e===-1||e===32}const xd=Ba(new RegExp("\\p{P}|\\p{S}","u")),wi=Ba(/\s/);function Ba(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function $s(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const l=e.charCodeAt(n);let o="";if(l===37&&Jt(e.charCodeAt(n+1))&&Jt(e.charCodeAt(n+2)))s=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(o=String.fromCharCode(l));else if(l>55295&&l<57344){const c=e.charCodeAt(n+1);l<56320&&c>56319&&c<57344?(o=String.fromCharCode(l,c),s=1):o="�"}else o=String.fromCharCode(l);o&&(t.push(e.slice(a,n),encodeURIComponent(o)),a=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(a)}function at(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(f){return Ze(f)?(e.enter(n),c(f)):t(f)}function c(f){return Ze(f)&&l++<s?(e.consume(f),c):(e.exit(n),t(f))}}const pG={tokenize:gG};function gG(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let n;return t;function a(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),at(e,t,"linePrefix")}function s(c){return e.enter("paragraph"),l(c)}function l(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,o(c)}function o(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Pe(c)?(e.consume(c),e.exit("chunkText"),l):(e.consume(c),o)}}const xG={tokenize:yG},M4={tokenize:bG};function yG(e){const t=this,n=[];let a=0,s,l,o;return c;function c(_){if(a<n.length){const E=n[a];return t.containerState=E[1],e.attempt(E[0].continuation,f,h)(_)}return h(_)}function f(_){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&N();const E=t.events.length;let M=E,T;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){T=t.events[M][1].end;break}k(a);let R=E;for(;R<t.events.length;)t.events[R][1].end={...T},R++;return En(t.events,M+1,0,t.events.slice(E)),t.events.length=R,h(_)}return c(_)}function h(_){if(a===n.length){if(!s)return x(_);if(s.currentConstruct&&s.currentConstruct.concrete)return w(_);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(M4,g,p)(_)}function g(_){return s&&N(),k(a),x(_)}function p(_){return t.parser.lazy[t.now().line]=a!==n.length,o=t.now().offset,w(_)}function x(_){return t.containerState={},e.attempt(M4,y,w)(_)}function y(_){return a++,n.push([t.currentConstruct,t.containerState]),x(_)}function w(_){if(_===null){s&&N(),k(0),e.consume(_);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:l}),j(_)}function j(_){if(_===null){S(e.exit("chunkFlow"),!0),k(0),e.consume(_);return}return Pe(_)?(e.consume(_),S(e.exit("chunkFlow")),a=0,t.interrupt=void 0,c):(e.consume(_),j)}function S(_,E){const M=t.sliceStream(_);if(E&&M.push(null),_.previous=l,l&&(l.next=_),l=_,s.defineSkip(_.start),s.write(M),t.parser.lazy[_.start.line]){let T=s.events.length;for(;T--;)if(s.events[T][1].start.offset<o&&(!s.events[T][1].end||s.events[T][1].end.offset>o))return;const R=t.events.length;let B=R,P,L;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(P){L=t.events[B][1].end;break}P=!0}for(k(a),T=R;T<t.events.length;)t.events[T][1].end={...L},T++;En(t.events,B+1,0,t.events.slice(R)),t.events.length=T}}function k(_){let E=n.length;for(;E-- >_;){const M=n[E];t.containerState=M[1],M[0].exit.call(t,e)}n.length=_}function N(){s.write([null]),l=void 0,s=void 0,t.containerState._closeFlow=void 0}}function bG(e,t,n){return at(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ls(e){if(e===null||vt(e)||wi(e))return 1;if(xd(e))return 2}function yd(e,t,n){const a=[];let s=-1;for(;++s<e.length;){const l=e[s].resolveAll;l&&!a.includes(l)&&(t=l(t,n),a.push(l))}return t}const lb={name:"attention",resolveAll:vG,tokenize:wG};function vG(e,t){let n=-1,a,s,l,o,c,f,h,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[a][1].end},x={...e[n][1].start};R4(p,-f),R4(x,f),o={type:f>1?"strongSequence":"emphasisSequence",start:p,end:{...e[a][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},l={type:f>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},s={type:f>1?"strong":"emphasis",start:{...o.start},end:{...c.end}},e[a][1].end={...o.start},e[n][1].start={...c.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=Bn(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=Bn(h,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",l,t]]),h=Bn(h,yd(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=Bn(h,[["exit",l,t],["enter",c,t],["exit",c,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,h=Bn(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,En(e,a-1,n-a+3,h),n=a+h.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function wG(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=Ls(a);let l;return o;function o(f){return l=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===l)return e.consume(f),c;const h=e.exit("attentionSequence"),g=Ls(f),p=!g||g===2&&s||n.includes(f),x=!s||s===2&&g||n.includes(a);return h._open=!!(l===42?p:p&&(s||!x)),h._close=!!(l===42?x:x&&(g||!p)),t(f)}}function R4(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const jG={name:"autolink",tokenize:kG};function kG(e,t,n){let a=0;return s;function s(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(y){return an(y)?(e.consume(y),o):y===64?n(y):h(y)}function o(y){return y===43||y===45||y===46||Jt(y)?(a=1,c(y)):h(y)}function c(y){return y===58?(e.consume(y),a=0,f):(y===43||y===45||y===46||Jt(y))&&a++<32?(e.consume(y),c):(a=0,h(y))}function f(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||Dc(y)?n(y):(e.consume(y),f)}function h(y){return y===64?(e.consume(y),g):fG(y)?(e.consume(y),h):n(y)}function g(y){return Jt(y)?p(y):n(y)}function p(y){return y===46?(e.consume(y),a=0,g):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):x(y)}function x(y){if((y===45||Jt(y))&&a++<63){const w=y===45?x:p;return e.consume(y),w}return n(y)}}const zo={partial:!0,tokenize:SG};function SG(e,t,n){return a;function a(l){return Ze(l)?at(e,s,"linePrefix")(l):s(l)}function s(l){return l===null||Pe(l)?t(l):n(l)}}const QA={continuation:{tokenize:NG},exit:CG,name:"blockQuote",tokenize:_G};function _G(e,t,n){const a=this;return s;function s(o){if(o===62){const c=a.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),l}return n(o)}function l(o){return Ze(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function NG(e,t,n){const a=this;return s;function s(o){return Ze(o)?at(e,l,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):l(o)}function l(o){return e.attempt(QA,t,n)(o)}}function CG(e){e.exit("blockQuote")}const ZA={name:"characterEscape",tokenize:EG};function EG(e,t,n){return a;function a(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),s}function s(l){return mG(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const JA={name:"characterReference",tokenize:TG};function TG(e,t,n){const a=this;let s=0,l,o;return c;function c(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),f}function f(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),l=31,o=Jt,g(p))}function h(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,o=hG,g):(e.enter("characterReferenceValue"),l=7,o=sb,g(p))}function g(p){if(p===59&&s){const x=e.exit("characterReferenceValue");return o===Jt&&!hv(a.sliceSerialize(x))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(p)&&s++<l?(e.consume(p),g):n(p)}}const L4={partial:!0,tokenize:MG},D4={concrete:!0,name:"codeFenced",tokenize:AG};function AG(e,t,n){const a=this,s={partial:!0,tokenize:M};let l=0,o=0,c;return f;function f(T){return h(T)}function h(T){const R=a.events[a.events.length-1];return l=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,c=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(T)}function g(T){return T===c?(o++,e.consume(T),g):o<3?n(T):(e.exit("codeFencedFenceSequence"),Ze(T)?at(e,p,"whitespace")(T):p(T))}function p(T){return T===null||Pe(T)?(e.exit("codeFencedFence"),a.interrupt?t(T):e.check(L4,j,E)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(T))}function x(T){return T===null||Pe(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(T)):Ze(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),at(e,y,"whitespace")(T)):T===96&&T===c?n(T):(e.consume(T),x)}function y(T){return T===null||Pe(T)?p(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(T))}function w(T){return T===null||Pe(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(T)):T===96&&T===c?n(T):(e.consume(T),w)}function j(T){return e.attempt(s,E,S)(T)}function S(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),k}function k(T){return l>0&&Ze(T)?at(e,N,"linePrefix",l+1)(T):N(T)}function N(T){return T===null||Pe(T)?e.check(L4,j,E)(T):(e.enter("codeFlowValue"),_(T))}function _(T){return T===null||Pe(T)?(e.exit("codeFlowValue"),N(T)):(e.consume(T),_)}function E(T){return e.exit("codeFenced"),t(T)}function M(T,R,B){let P=0;return L;function L(O){return T.enter("lineEnding"),T.consume(O),T.exit("lineEnding"),H}function H(O){return T.enter("codeFencedFence"),Ze(O)?at(T,F,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):F(O)}function F(O){return O===c?(T.enter("codeFencedFenceSequence"),G(O)):B(O)}function G(O){return O===c?(P++,T.consume(O),G):P>=o?(T.exit("codeFencedFenceSequence"),Ze(O)?at(T,q,"whitespace")(O):q(O)):B(O)}function q(O){return O===null||Pe(O)?(T.exit("codeFencedFence"),R(O)):B(O)}}}function MG(e,t,n){const a=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l)}function l(o){return a.parser.lazy[a.now().line]?n(o):t(o)}}const jy={name:"codeIndented",tokenize:LG},RG={partial:!0,tokenize:DG};function LG(e,t,n){const a=this;return s;function s(h){return e.enter("codeIndented"),at(e,l,"linePrefix",5)(h)}function l(h){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?o(h):n(h)}function o(h){return h===null?f(h):Pe(h)?e.attempt(RG,o,f)(h):(e.enter("codeFlowValue"),c(h))}function c(h){return h===null||Pe(h)?(e.exit("codeFlowValue"),o(h)):(e.consume(h),c)}function f(h){return e.exit("codeIndented"),t(h)}}function DG(e,t,n){const a=this;return s;function s(o){return a.parser.lazy[a.now().line]?n(o):Pe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):at(e,l,"linePrefix",5)(o)}function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):Pe(o)?s(o):n(o)}}const OG={name:"codeText",previous:qG,resolve:zG,tokenize:IG};function zG(e){let t=e.length-4,n=3,a,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function qG(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function IG(e,t,n){let a=0,s,l;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),c(p)}function c(p){return p===96?(e.consume(p),a++,c):(e.exit("codeTextSequence"),f(p))}function f(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),f):p===96?(l=e.enter("codeTextSequence"),s=0,g(p)):Pe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("codeTextData"),h(p))}function h(p){return p===null||p===32||p===96||Pe(p)?(e.exit("codeTextData"),f(p)):(e.consume(p),h)}function g(p){return p===96?(e.consume(p),s++,g):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(l.type="codeTextData",h(p))}}class BG{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const s=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&Ul(this.left,a),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ul(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ul(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ul(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ul(this.left,n.reverse())}}}function Ul(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function eM(e){const t={};let n=-1,a,s,l,o,c,f,h;const g=new BG(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(a=g.get(n),n&&a[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(f=a[1]._tokenizer.events,l=0,l<f.length&&f[l][1].type==="lineEndingBlank"&&(l+=2),l<f.length&&f[l][1].type==="content"))for(;++l<f.length&&f[l][1].type!=="content";)f[l][1].type==="chunkText"&&(f[l][1]._isInFirstContentOfListItem=!0,l++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,HG(g,n)),n=t[n],h=!0);else if(a[1]._container){for(l=n,s=void 0;l--;)if(o=g.get(l),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(g.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=l);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(a[1].end={...g.get(s)[1].start},c=g.slice(s,n),c.unshift(a),g.splice(s,n-s+1,c))}}return En(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function HG(e,t){const n=e.get(t)[1],a=e.get(t)[2];let s=t-1;const l=[];let o=n._tokenizer;o||(o=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const c=o.events,f=[],h={};let g,p,x=-1,y=n,w=0,j=0;const S=[j];for(;y;){for(;e.get(++s)[1]!==y;);l.push(s),y._tokenizer||(g=a.sliceStream(y),y.next||g.push(null),p&&o.defineSkip(y.start),y._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(g),y._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=y,y=y.next}for(y=n;++x<c.length;)c[x][0]==="exit"&&c[x-1][0]==="enter"&&c[x][1].type===c[x-1][1].type&&c[x][1].start.line!==c[x][1].end.line&&(j=x+1,S.push(j),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(o.events=[],y?(y._tokenizer=void 0,y.previous=void 0):S.pop(),x=S.length;x--;){const k=c.slice(S[x],S[x+1]),N=l.pop();f.push([N,N+k.length-1]),e.splice(N,2,k)}for(f.reverse(),x=-1;++x<f.length;)h[w+f[x][0]]=w+f[x][1],w+=f[x][1]-f[x][0]-1;return h}const PG={resolve:UG,tokenize:$G},FG={partial:!0,tokenize:GG};function UG(e){return eM(e),e}function $G(e,t){let n;return a;function a(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(c)}function s(c){return c===null?l(c):Pe(c)?e.check(FG,o,l)(c):(e.consume(c),s)}function l(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function o(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function GG(e,t,n){const a=this;return s;function s(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),at(e,l,"linePrefix")}function l(o){if(o===null||Pe(o))return n(o);const c=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(o):e.interrupt(a.parser.constructs.flow,n,t)(o)}}function tM(e,t,n,a,s,l,o,c,f){const h=f||Number.POSITIVE_INFINITY;let g=0;return p;function p(k){return k===60?(e.enter(a),e.enter(s),e.enter(l),e.consume(k),e.exit(l),x):k===null||k===32||k===41||Dc(k)?n(k):(e.enter(a),e.enter(o),e.enter(c),e.enter("chunkString",{contentType:"string"}),j(k))}function x(k){return k===62?(e.enter(l),e.consume(k),e.exit(l),e.exit(s),e.exit(a),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),y(k))}function y(k){return k===62?(e.exit("chunkString"),e.exit(c),x(k)):k===null||k===60||Pe(k)?n(k):(e.consume(k),k===92?w:y)}function w(k){return k===60||k===62||k===92?(e.consume(k),y):y(k)}function j(k){return!g&&(k===null||k===41||vt(k))?(e.exit("chunkString"),e.exit(c),e.exit(o),e.exit(a),t(k)):g<h&&k===40?(e.consume(k),g++,j):k===41?(e.consume(k),g--,j):k===null||k===32||k===40||Dc(k)?n(k):(e.consume(k),k===92?S:j)}function S(k){return k===40||k===41||k===92?(e.consume(k),j):j(k)}}function nM(e,t,n,a,s,l){const o=this;let c=0,f;return h;function h(y){return e.enter(a),e.enter(s),e.consume(y),e.exit(s),e.enter(l),g}function g(y){return c>999||y===null||y===91||y===93&&!f||y===94&&!c&&"_hiddenFootnoteSupport"in o.parser.constructs?n(y):y===93?(e.exit(l),e.enter(s),e.consume(y),e.exit(s),e.exit(a),t):Pe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||y===91||y===93||Pe(y)||c++>999?(e.exit("chunkString"),g(y)):(e.consume(y),f||(f=!Ze(y)),y===92?x:p)}function x(y){return y===91||y===92||y===93?(e.consume(y),c++,p):p(y)}}function rM(e,t,n,a,s,l){let o;return c;function c(x){return x===34||x===39||x===40?(e.enter(a),e.enter(s),e.consume(x),e.exit(s),o=x===40?41:x,f):n(x)}function f(x){return x===o?(e.enter(s),e.consume(x),e.exit(s),e.exit(a),t):(e.enter(l),h(x))}function h(x){return x===o?(e.exit(l),f(o)):x===null?n(x):Pe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),at(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===o||x===null||Pe(x)?(e.exit("chunkString"),h(x)):(e.consume(x),x===92?p:g)}function p(x){return x===o||x===92?(e.consume(x),g):g(x)}}function to(e,t){let n;return a;function a(s){return Pe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):Ze(s)?at(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const VG={name:"definition",tokenize:XG},YG={partial:!0,tokenize:KG};function XG(e,t,n){const a=this;let s;return l;function l(y){return e.enter("definition"),o(y)}function o(y){return nM.call(a,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function c(y){return s=Jn(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),f):n(y)}function f(y){return vt(y)?to(e,h)(y):h(y)}function h(y){return tM(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function g(y){return e.attempt(YG,p,p)(y)}function p(y){return Ze(y)?at(e,x,"whitespace")(y):x(y)}function x(y){return y===null||Pe(y)?(e.exit("definition"),a.parser.defined.push(s),t(y)):n(y)}}function KG(e,t,n){return a;function a(c){return vt(c)?to(e,s)(c):n(c)}function s(c){return rM(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function l(c){return Ze(c)?at(e,o,"whitespace")(c):o(c)}function o(c){return c===null||Pe(c)?t(c):n(c)}}const WG={name:"hardBreakEscape",tokenize:QG};function QG(e,t,n){return a;function a(l){return e.enter("hardBreakEscape"),e.consume(l),s}function s(l){return Pe(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const ZG={name:"headingAtx",resolve:JG,tokenize:eV};function JG(e,t){let n=e.length-2,a=3,s,l;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(s={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},l={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},En(e,a,n-a+1,[["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t]])),e}function eV(e,t,n){let a=0;return s;function s(g){return e.enter("atxHeading"),l(g)}function l(g){return e.enter("atxHeadingSequence"),o(g)}function o(g){return g===35&&a++<6?(e.consume(g),o):g===null||vt(g)?(e.exit("atxHeadingSequence"),c(g)):n(g)}function c(g){return g===35?(e.enter("atxHeadingSequence"),f(g)):g===null||Pe(g)?(e.exit("atxHeading"),t(g)):Ze(g)?at(e,c,"whitespace")(g):(e.enter("atxHeadingText"),h(g))}function f(g){return g===35?(e.consume(g),f):(e.exit("atxHeadingSequence"),c(g))}function h(g){return g===null||g===35||vt(g)?(e.exit("atxHeadingText"),c(g)):(e.consume(g),h)}}const tV=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],O4=["pre","script","style","textarea"],nV={concrete:!0,name:"htmlFlow",resolveTo:iV,tokenize:sV},rV={partial:!0,tokenize:oV},aV={partial:!0,tokenize:lV};function iV(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function sV(e,t,n){const a=this;let s,l,o,c,f;return h;function h(I){return g(I)}function g(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),p}function p(I){return I===33?(e.consume(I),x):I===47?(e.consume(I),l=!0,j):I===63?(e.consume(I),s=3,a.interrupt?t:z):an(I)?(e.consume(I),o=String.fromCharCode(I),S):n(I)}function x(I){return I===45?(e.consume(I),s=2,y):I===91?(e.consume(I),s=5,c=0,w):an(I)?(e.consume(I),s=4,a.interrupt?t:z):n(I)}function y(I){return I===45?(e.consume(I),a.interrupt?t:z):n(I)}function w(I){const V="CDATA[";return I===V.charCodeAt(c++)?(e.consume(I),c===V.length?a.interrupt?t:F:w):n(I)}function j(I){return an(I)?(e.consume(I),o=String.fromCharCode(I),S):n(I)}function S(I){if(I===null||I===47||I===62||vt(I)){const V=I===47,te=o.toLowerCase();return!V&&!l&&O4.includes(te)?(s=1,a.interrupt?t(I):F(I)):tV.includes(o.toLowerCase())?(s=6,V?(e.consume(I),k):a.interrupt?t(I):F(I)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(I):l?N(I):_(I))}return I===45||Jt(I)?(e.consume(I),o+=String.fromCharCode(I),S):n(I)}function k(I){return I===62?(e.consume(I),a.interrupt?t:F):n(I)}function N(I){return Ze(I)?(e.consume(I),N):L(I)}function _(I){return I===47?(e.consume(I),L):I===58||I===95||an(I)?(e.consume(I),E):Ze(I)?(e.consume(I),_):L(I)}function E(I){return I===45||I===46||I===58||I===95||Jt(I)?(e.consume(I),E):M(I)}function M(I){return I===61?(e.consume(I),T):Ze(I)?(e.consume(I),M):_(I)}function T(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),f=I,R):Ze(I)?(e.consume(I),T):B(I)}function R(I){return I===f?(e.consume(I),f=null,P):I===null||Pe(I)?n(I):(e.consume(I),R)}function B(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||vt(I)?M(I):(e.consume(I),B)}function P(I){return I===47||I===62||Ze(I)?_(I):n(I)}function L(I){return I===62?(e.consume(I),H):n(I)}function H(I){return I===null||Pe(I)?F(I):Ze(I)?(e.consume(I),H):n(I)}function F(I){return I===45&&s===2?(e.consume(I),D):I===60&&s===1?(e.consume(I),X):I===62&&s===4?(e.consume(I),$):I===63&&s===3?(e.consume(I),z):I===93&&s===5?(e.consume(I),Z):Pe(I)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(rV,Q,G)(I)):I===null||Pe(I)?(e.exit("htmlFlowData"),G(I)):(e.consume(I),F)}function G(I){return e.check(aV,q,Q)(I)}function q(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),O}function O(I){return I===null||Pe(I)?G(I):(e.enter("htmlFlowData"),F(I))}function D(I){return I===45?(e.consume(I),z):F(I)}function X(I){return I===47?(e.consume(I),o="",K):F(I)}function K(I){if(I===62){const V=o.toLowerCase();return O4.includes(V)?(e.consume(I),$):F(I)}return an(I)&&o.length<8?(e.consume(I),o+=String.fromCharCode(I),K):F(I)}function Z(I){return I===93?(e.consume(I),z):F(I)}function z(I){return I===62?(e.consume(I),$):I===45&&s===2?(e.consume(I),z):F(I)}function $(I){return I===null||Pe(I)?(e.exit("htmlFlowData"),Q(I)):(e.consume(I),$)}function Q(I){return e.exit("htmlFlow"),t(I)}}function lV(e,t,n){const a=this;return s;function s(o){return Pe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),l):n(o)}function l(o){return a.parser.lazy[a.now().line]?n(o):t(o)}}function oV(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(zo,t,n)}}const uV={name:"htmlText",tokenize:cV};function cV(e,t,n){const a=this;let s,l,o;return c;function c(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),f}function f(z){return z===33?(e.consume(z),h):z===47?(e.consume(z),M):z===63?(e.consume(z),_):an(z)?(e.consume(z),B):n(z)}function h(z){return z===45?(e.consume(z),g):z===91?(e.consume(z),l=0,w):an(z)?(e.consume(z),N):n(z)}function g(z){return z===45?(e.consume(z),y):n(z)}function p(z){return z===null?n(z):z===45?(e.consume(z),x):Pe(z)?(o=p,X(z)):(e.consume(z),p)}function x(z){return z===45?(e.consume(z),y):p(z)}function y(z){return z===62?D(z):z===45?x(z):p(z)}function w(z){const $="CDATA[";return z===$.charCodeAt(l++)?(e.consume(z),l===$.length?j:w):n(z)}function j(z){return z===null?n(z):z===93?(e.consume(z),S):Pe(z)?(o=j,X(z)):(e.consume(z),j)}function S(z){return z===93?(e.consume(z),k):j(z)}function k(z){return z===62?D(z):z===93?(e.consume(z),k):j(z)}function N(z){return z===null||z===62?D(z):Pe(z)?(o=N,X(z)):(e.consume(z),N)}function _(z){return z===null?n(z):z===63?(e.consume(z),E):Pe(z)?(o=_,X(z)):(e.consume(z),_)}function E(z){return z===62?D(z):_(z)}function M(z){return an(z)?(e.consume(z),T):n(z)}function T(z){return z===45||Jt(z)?(e.consume(z),T):R(z)}function R(z){return Pe(z)?(o=R,X(z)):Ze(z)?(e.consume(z),R):D(z)}function B(z){return z===45||Jt(z)?(e.consume(z),B):z===47||z===62||vt(z)?P(z):n(z)}function P(z){return z===47?(e.consume(z),D):z===58||z===95||an(z)?(e.consume(z),L):Pe(z)?(o=P,X(z)):Ze(z)?(e.consume(z),P):D(z)}function L(z){return z===45||z===46||z===58||z===95||Jt(z)?(e.consume(z),L):H(z)}function H(z){return z===61?(e.consume(z),F):Pe(z)?(o=H,X(z)):Ze(z)?(e.consume(z),H):P(z)}function F(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),s=z,G):Pe(z)?(o=F,X(z)):Ze(z)?(e.consume(z),F):(e.consume(z),q)}function G(z){return z===s?(e.consume(z),s=void 0,O):z===null?n(z):Pe(z)?(o=G,X(z)):(e.consume(z),G)}function q(z){return z===null||z===34||z===39||z===60||z===61||z===96?n(z):z===47||z===62||vt(z)?P(z):(e.consume(z),q)}function O(z){return z===47||z===62||vt(z)?P(z):n(z)}function D(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),t):n(z)}function X(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),K}function K(z){return Ze(z)?at(e,Z,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):Z(z)}function Z(z){return e.enter("htmlTextData"),o(z)}}const mv={name:"labelEnd",resolveAll:mV,resolveTo:pV,tokenize:gV},dV={tokenize:xV},fV={tokenize:yV},hV={tokenize:bV};function mV(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const s=a.type==="labelImage"?4:2;a.type="data",t+=s}}return e.length!==n.length&&En(e,0,e.length,n),e}function pV(e,t){let n=e.length,a=0,s,l,o,c;for(;n--;)if(s=e[n][1],l){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(l=n,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(o=n);const f={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[l][1].start},end:{...e[o][1].end}},g={type:"labelText",start:{...e[l+a+2][1].end},end:{...e[o-2][1].start}};return c=[["enter",f,t],["enter",h,t]],c=Bn(c,e.slice(l+1,l+a+3)),c=Bn(c,[["enter",g,t]]),c=Bn(c,yd(t.parser.constructs.insideSpan.null,e.slice(l+a+4,o-3),t)),c=Bn(c,[["exit",g,t],e[o-2],e[o-1],["exit",h,t]]),c=Bn(c,e.slice(o+1)),c=Bn(c,[["exit",f,t]]),En(e,l,e.length,c),e}function gV(e,t,n){const a=this;let s=a.events.length,l,o;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){l=a.events[s][1];break}return c;function c(x){return l?l._inactive?p(x):(o=a.parser.defined.includes(Jn(a.sliceSerialize({start:l.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),f):n(x)}function f(x){return x===40?e.attempt(dV,g,o?g:p)(x):x===91?e.attempt(fV,g,o?h:p)(x):o?g(x):p(x)}function h(x){return e.attempt(hV,g,p)(x)}function g(x){return t(x)}function p(x){return l._balanced=!0,n(x)}}function xV(e,t,n){return a;function a(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),s}function s(p){return vt(p)?to(e,l)(p):l(p)}function l(p){return p===41?g(p):tM(e,o,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return vt(p)?to(e,f)(p):g(p)}function c(p){return n(p)}function f(p){return p===34||p===39||p===40?rM(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):g(p)}function h(p){return vt(p)?to(e,g)(p):g(p)}function g(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function yV(e,t,n){const a=this;return s;function s(c){return nM.call(a,e,l,o,"reference","referenceMarker","referenceString")(c)}function l(c){return a.parser.defined.includes(Jn(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function o(c){return n(c)}}function bV(e,t,n){return a;function a(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),s}function s(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const vV={name:"labelStartImage",resolveAll:mv.resolveAll,tokenize:wV};function wV(e,t,n){const a=this;return s;function s(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),l}function l(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),o):n(c)}function o(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(c):t(c)}}const jV={name:"labelStartLink",resolveAll:mv.resolveAll,tokenize:kV};function kV(e,t,n){const a=this;return s;function s(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),l}function l(o){return o===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(o):t(o)}}const ky={name:"lineEnding",tokenize:SV};function SV(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),at(e,t,"linePrefix")}}const wc={name:"thematicBreak",tokenize:_V};function _V(e,t,n){let a=0,s;return l;function l(h){return e.enter("thematicBreak"),o(h)}function o(h){return s=h,c(h)}function c(h){return h===s?(e.enter("thematicBreakSequence"),f(h)):a>=3&&(h===null||Pe(h))?(e.exit("thematicBreak"),t(h)):n(h)}function f(h){return h===s?(e.consume(h),a++,f):(e.exit("thematicBreakSequence"),Ze(h)?at(e,c,"whitespace")(h):c(h))}}const pn={continuation:{tokenize:TV},exit:MV,name:"list",tokenize:EV},NV={partial:!0,tokenize:RV},CV={partial:!0,tokenize:AV};function EV(e,t,n){const a=this,s=a.events[a.events.length-1];let l=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return c;function c(y){const w=a.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!a.containerState.marker||y===a.containerState.marker:sb(y)){if(a.containerState.type||(a.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(wc,n,h)(y):h(y);if(!a.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(y)}return n(y)}function f(y){return sb(y)&&++o<10?(e.consume(y),f):(!a.interrupt||o<2)&&(a.containerState.marker?y===a.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),h(y)):n(y)}function h(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||y,e.check(zo,a.interrupt?n:g,e.attempt(NV,x,p))}function g(y){return a.containerState.initialBlankLine=!0,l++,x(y)}function p(y){return Ze(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),x):n(y)}function x(y){return a.containerState.size=l+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function TV(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(zo,s,l);function s(c){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,at(e,t,"listItemIndent",a.containerState.size+1)(c)}function l(c){return a.containerState.furtherBlankLines||!Ze(c)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,o(c)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(CV,t,o)(c))}function o(c){return a.containerState._closeFlow=!0,a.interrupt=void 0,at(e,e.attempt(pn,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function AV(e,t,n){const a=this;return at(e,s,"listItemIndent",a.containerState.size+1);function s(l){const o=a.events[a.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===a.containerState.size?t(l):n(l)}}function MV(e){e.exit(this.containerState.type)}function RV(e,t,n){const a=this;return at(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(l){const o=a.events[a.events.length-1];return!Ze(l)&&o&&o[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const z4={name:"setextUnderline",resolveTo:LV,tokenize:DV};function LV(e,t){let n=e.length,a,s,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const o={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",l?(e.splice(s,0,["enter",o,t]),e.splice(l+1,0,["exit",e[a][1],t]),e[a][1].end={...e[l][1].end}):e[a][1]=o,e.push(["exit",o,t]),e}function DV(e,t,n){const a=this;let s;return l;function l(h){let g=a.events.length,p;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){p=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||p)?(e.enter("setextHeadingLine"),s=h,o(h)):n(h)}function o(h){return e.enter("setextHeadingLineSequence"),c(h)}function c(h){return h===s?(e.consume(h),c):(e.exit("setextHeadingLineSequence"),Ze(h)?at(e,f,"lineSuffix")(h):f(h))}function f(h){return h===null||Pe(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const OV={tokenize:zV};function zV(e){const t=this,n=e.attempt(zo,a,e.attempt(this.parser.constructs.flowInitial,s,at(e,e.attempt(this.parser.constructs.flow,s,e.attempt(PG,s)),"linePrefix")));return n;function a(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const qV={resolveAll:iM()},IV=aM("string"),BV=aM("text");function aM(e){return{resolveAll:iM(e==="text"?HV:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],l=n.attempt(s,o,c);return o;function o(g){return h(g)?l(g):c(g)}function c(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),f}function f(g){return h(g)?(n.exit("data"),l(g)):(n.consume(g),f)}function h(g){if(g===null)return!0;const p=s[g];let x=-1;if(p)for(;++x<p.length;){const y=p[x];if(!y.previous||y.previous.call(a,a.previous))return!0}return!1}}}function iM(e){return t;function t(n,a){let s=-1,l;for(;++s<=n.length;)l===void 0?n[s]&&n[s][1].type==="data"&&(l=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==l+2&&(n[l][1].end=n[s-1][1].end,n.splice(l+2,s-l-2),s=l+2),l=void 0);return e?e(n,a):n}}function HV(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],s=t.sliceStream(a);let l=s.length,o=-1,c=0,f;for(;l--;){const h=s[l];if(typeof h=="string"){for(o=h.length;h.charCodeAt(o-1)===32;)c++,o--;if(o)break;o=-1}else if(h===-2)f=!0,c++;else if(h!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const h={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?o:a.start._bufferIndex+o,_index:a.start._index+l,line:a.end.line,column:a.end.column-c,offset:a.end.offset-c},end:{...a.end}};a.end={...h.start},a.start.offset===a.end.offset?Object.assign(a,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const PV={42:pn,43:pn,45:pn,48:pn,49:pn,50:pn,51:pn,52:pn,53:pn,54:pn,55:pn,56:pn,57:pn,62:QA},FV={91:VG},UV={[-2]:jy,[-1]:jy,32:jy},$V={35:ZG,42:wc,45:[z4,wc],60:nV,61:z4,95:wc,96:D4,126:D4},GV={38:JA,92:ZA},VV={[-5]:ky,[-4]:ky,[-3]:ky,33:vV,38:JA,42:lb,60:[jG,uV],91:jV,92:[WG,ZA],93:mv,95:lb,96:OG},YV={null:[lb,qV]},XV={null:[42,95]},KV={null:[]},WV=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:XV,contentInitial:FV,disable:KV,document:PV,flow:$V,flowInitial:UV,insideSpan:YV,string:GV,text:VV},Symbol.toStringTag,{value:"Module"}));function QV(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},l=[];let o=[],c=[];const f={attempt:R(M),check:R(T),consume:N,enter:_,exit:E,interrupt:R(T,{interrupt:!0})},h={code:null,containerState:{},defineSkip:j,events:[],now:w,parser:e,previous:null,sliceSerialize:x,sliceStream:y,write:p};let g=t.tokenize.call(h,f);return t.resolveAll&&l.push(t),h;function p(H){return o=Bn(o,H),S(),o[o.length-1]!==null?[]:(B(t,0),h.events=yd(l,h.events,h),h.events)}function x(H,F){return JV(y(H),F)}function y(H){return ZV(o,H)}function w(){const{_bufferIndex:H,_index:F,line:G,column:q,offset:O}=a;return{_bufferIndex:H,_index:F,line:G,column:q,offset:O}}function j(H){s[H.line]=H.column,L()}function S(){let H;for(;a._index<o.length;){const F=o[a._index];if(typeof F=="string")for(H=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===H&&a._bufferIndex<F.length;)k(F.charCodeAt(a._bufferIndex));else k(F)}}function k(H){g=g(H)}function N(H){Pe(H)?(a.line++,a.column=1,a.offset+=H===-3?2:1,L()):H!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===o[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=H}function _(H,F){const G=F||{};return G.type=H,G.start=w(),h.events.push(["enter",G,h]),c.push(G),G}function E(H){const F=c.pop();return F.end=w(),h.events.push(["exit",F,h]),F}function M(H,F){B(H,F.from)}function T(H,F){F.restore()}function R(H,F){return G;function G(q,O,D){let X,K,Z,z;return Array.isArray(q)?Q(q):"tokenize"in q?Q([q]):$(q);function $(ne){return W;function W(Y){const ae=Y!==null&&ne[Y],he=Y!==null&&ne.null,ke=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(he)?he:he?[he]:[]];return Q(ke)(Y)}}function Q(ne){return X=ne,K=0,ne.length===0?D:I(ne[K])}function I(ne){return W;function W(Y){return z=P(),Z=ne,ne.partial||(h.currentConstruct=ne),ne.name&&h.parser.constructs.disable.null.includes(ne.name)?te():ne.tokenize.call(F?Object.assign(Object.create(h),F):h,f,V,te)(Y)}}function V(ne){return H(Z,z),O}function te(ne){return z.restore(),++K<X.length?I(X[K]):D}}}function B(H,F){H.resolveAll&&!l.includes(H)&&l.push(H),H.resolve&&En(h.events,F,h.events.length-F,H.resolve(h.events.slice(F),h)),H.resolveTo&&(h.events=H.resolveTo(h.events,h))}function P(){const H=w(),F=h.previous,G=h.currentConstruct,q=h.events.length,O=Array.from(c);return{from:q,restore:D};function D(){a=H,h.previous=F,h.currentConstruct=G,h.events.length=q,c=O,L()}}function L(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function ZV(e,t){const n=t.start._index,a=t.start._bufferIndex,s=t.end._index,l=t.end._bufferIndex;let o;if(n===s)o=[e[n].slice(a,l)];else{if(o=e.slice(n,s),a>-1){const c=o[0];typeof c=="string"?o[0]=c.slice(a):o.shift()}l>0&&o.push(e[s].slice(0,l))}return o}function JV(e,t){let n=-1;const a=[];let s;for(;++n<e.length;){const l=e[n];let o;if(typeof l=="string")o=l;else switch(l){case-5:{o="\r";break}case-4:{o=`
106
+ `;break}case-3:{o=`\r
107
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&s)continue;o=" ";break}default:o=String.fromCharCode(l)}s=l===-2,a.push(o)}return a.join("")}function eY(e){const a={constructs:KA([WV,...(e||{}).extensions||[]]),content:s(pG),defined:[],document:s(xG),flow:s(OV),lazy:{},string:s(IV),text:s(BV)};return a;function s(l){return o;function o(c){return QV(a,l,c)}}}function tY(e){for(;!eM(e););return e}const q4=/[\0\t\n\r]/g;function nY(){let e=1,t="",n=!0,a;return s;function s(l,o,c){const f=[];let h,g,p,x,y;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(o||void 0).decode(l)),p=0,t="",n&&(l.charCodeAt(0)===65279&&p++,n=void 0);p<l.length;){if(q4.lastIndex=p,h=q4.exec(l),x=h&&h.index!==void 0?h.index:l.length,y=l.charCodeAt(x),!h){t=l.slice(p);break}if(y===10&&p===x&&a)f.push(-3),a=void 0;else switch(a&&(f.push(-5),a=void 0),p<x&&(f.push(l.slice(p,x)),e+=x-p),y){case 0:{f.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,f.push(-2);e++<g;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:a=!0,e=1}p=x+1}return c&&(a&&f.push(-5),t&&f.push(t),f.push(null)),f}}const rY=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function aY(e){return e.replace(rY,iY)}function iY(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),l=s===120||s===88;return WA(n.slice(l?2:1),l?16:10)}return hv(n)||e}const sM={}.hasOwnProperty;function sY(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),lY(n)(tY(eY(n).document().write(nY()(e,t,!0))))}function lY(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(Te),autolinkProtocol:P,autolinkEmail:P,atxHeading:l(Se),blockQuote:l(he),characterEscape:P,characterReference:P,codeFenced:l(ke),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:l(ke,o),codeText:l(_e,o),codeTextData:P,data:P,codeFlowValue:P,definition:l(oe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:l(je),hardBreakEscape:l(Ae),hardBreakTrailing:l(Ae),htmlFlow:l(se,o),htmlFlowData:P,htmlText:l(se,o),htmlTextData:P,image:l(Ee),label:o,link:l(Te),listItem:l(we),listItemValue:x,listOrdered:l(Me,p),listUnordered:l(Me),paragraph:l(De),reference:I,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:l(Se),strong:l(Be),thematicBreak:l(xe)},exit:{atxHeading:f(),atxHeadingSequence:M,autolink:f(),autolinkEmail:ae,autolinkProtocol:Y,blockQuote:f(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:ne,characterReference:W,codeFenced:f(S),codeFencedFence:j,codeFencedFenceInfo:y,codeFencedFenceMeta:w,codeFlowValue:L,codeIndented:f(k),codeText:f(O),codeTextData:L,data:L,definition:f(),definitionDestinationString:E,definitionLabelString:N,definitionTitleString:_,emphasis:f(),hardBreakEscape:f(F),hardBreakTrailing:f(F),htmlFlow:f(G),htmlFlowData:L,htmlText:f(q),htmlTextData:L,image:f(X),label:Z,labelText:K,lineEnding:H,link:f(D),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:V,resourceDestinationString:z,resourceTitleString:$,resource:Q,setextHeading:f(B),setextHeadingLineSequence:R,setextHeadingText:T,strong:f(),thematicBreak:f()}};lM(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(J){let fe={type:"root",children:[]};const be={stack:[fe],tokenStack:[],config:t,enter:c,exit:h,buffer:o,resume:g,data:n},Ne=[];let Oe=-1;for(;++Oe<J.length;)if(J[Oe][1].type==="listOrdered"||J[Oe][1].type==="listUnordered")if(J[Oe][0]==="enter")Ne.push(Oe);else{const ht=Ne.pop();Oe=s(J,ht,Oe)}for(Oe=-1;++Oe<J.length;){const ht=t[J[Oe][0]];sM.call(ht,J[Oe][1].type)&&ht[J[Oe][1].type].call(Object.assign({sliceSerialize:J[Oe][2].sliceSerialize},be),J[Oe][1])}if(be.tokenStack.length>0){const ht=be.tokenStack[be.tokenStack.length-1];(ht[1]||I4).call(be,void 0,ht[0])}for(fe.position={start:La(J.length>0?J[0][1].start:{line:1,column:1,offset:0}),end:La(J.length>0?J[J.length-2][1].end:{line:1,column:1,offset:0})},Oe=-1;++Oe<t.transforms.length;)fe=t.transforms[Oe](fe)||fe;return fe}function s(J,fe,be){let Ne=fe-1,Oe=-1,ht=!1,yt,tt,st,Ft;for(;++Ne<=be;){const ut=J[Ne];switch(ut[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ut[0]==="enter"?Oe++:Oe--,Ft=void 0;break}case"lineEndingBlank":{ut[0]==="enter"&&(yt&&!Ft&&!Oe&&!st&&(st=Ne),Ft=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ft=void 0}if(!Oe&&ut[0]==="enter"&&ut[1].type==="listItemPrefix"||Oe===-1&&ut[0]==="exit"&&(ut[1].type==="listUnordered"||ut[1].type==="listOrdered")){if(yt){let tn=Ne;for(tt=void 0;tn--;){const nn=J[tn];if(nn[1].type==="lineEnding"||nn[1].type==="lineEndingBlank"){if(nn[0]==="exit")continue;tt&&(J[tt][1].type="lineEndingBlank",ht=!0),nn[1].type="lineEnding",tt=tn}else if(!(nn[1].type==="linePrefix"||nn[1].type==="blockQuotePrefix"||nn[1].type==="blockQuotePrefixWhitespace"||nn[1].type==="blockQuoteMarker"||nn[1].type==="listItemIndent"))break}st&&(!tt||st<tt)&&(yt._spread=!0),yt.end=Object.assign({},tt?J[tt][1].start:ut[1].end),J.splice(tt||Ne,0,["exit",yt,ut[2]]),Ne++,be++}if(ut[1].type==="listItemPrefix"){const tn={type:"listItem",_spread:!1,start:Object.assign({},ut[1].start),end:void 0};yt=tn,J.splice(Ne,0,["enter",tn,ut[2]]),Ne++,be++,st=void 0,Ft=!0}}}return J[fe][1]._spread=ht,be}function l(J,fe){return be;function be(Ne){c.call(this,J(Ne),Ne),fe&&fe.call(this,Ne)}}function o(){this.stack.push({type:"fragment",children:[]})}function c(J,fe,be){this.stack[this.stack.length-1].children.push(J),this.stack.push(J),this.tokenStack.push([fe,be||void 0]),J.position={start:La(fe.start),end:void 0}}function f(J){return fe;function fe(be){J&&J.call(this,be),h.call(this,be)}}function h(J,fe){const be=this.stack.pop(),Ne=this.tokenStack.pop();if(Ne)Ne[0].type!==J.type&&(fe?fe.call(this,J,Ne[0]):(Ne[1]||I4).call(this,J,Ne[0]));else throw new Error("Cannot close `"+J.type+"` ("+eo({start:J.start,end:J.end})+"): it’s not open");be.position.end=La(J.end)}function g(){return fv(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function x(J){if(this.data.expectingFirstListItemValue){const fe=this.stack[this.stack.length-2];fe.start=Number.parseInt(this.sliceSerialize(J),10),this.data.expectingFirstListItemValue=void 0}}function y(){const J=this.resume(),fe=this.stack[this.stack.length-1];fe.lang=J}function w(){const J=this.resume(),fe=this.stack[this.stack.length-1];fe.meta=J}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const J=this.resume(),fe=this.stack[this.stack.length-1];fe.value=J.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const J=this.resume(),fe=this.stack[this.stack.length-1];fe.value=J.replace(/(\r?\n|\r)$/g,"")}function N(J){const fe=this.resume(),be=this.stack[this.stack.length-1];be.label=fe,be.identifier=Jn(this.sliceSerialize(J)).toLowerCase()}function _(){const J=this.resume(),fe=this.stack[this.stack.length-1];fe.title=J}function E(){const J=this.resume(),fe=this.stack[this.stack.length-1];fe.url=J}function M(J){const fe=this.stack[this.stack.length-1];if(!fe.depth){const be=this.sliceSerialize(J).length;fe.depth=be}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function R(J){const fe=this.stack[this.stack.length-1];fe.depth=this.sliceSerialize(J).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function P(J){const be=this.stack[this.stack.length-1].children;let Ne=be[be.length-1];(!Ne||Ne.type!=="text")&&(Ne=ie(),Ne.position={start:La(J.start),end:void 0},be.push(Ne)),this.stack.push(Ne)}function L(J){const fe=this.stack.pop();fe.value+=this.sliceSerialize(J),fe.position.end=La(J.end)}function H(J){const fe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const be=fe.children[fe.children.length-1];be.position.end=La(J.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(fe.type)&&(P.call(this,J),L.call(this,J))}function F(){this.data.atHardBreak=!0}function G(){const J=this.resume(),fe=this.stack[this.stack.length-1];fe.value=J}function q(){const J=this.resume(),fe=this.stack[this.stack.length-1];fe.value=J}function O(){const J=this.resume(),fe=this.stack[this.stack.length-1];fe.value=J}function D(){const J=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";J.type+="Reference",J.referenceType=fe,delete J.url,delete J.title}else delete J.identifier,delete J.label;this.data.referenceType=void 0}function X(){const J=this.stack[this.stack.length-1];if(this.data.inReference){const fe=this.data.referenceType||"shortcut";J.type+="Reference",J.referenceType=fe,delete J.url,delete J.title}else delete J.identifier,delete J.label;this.data.referenceType=void 0}function K(J){const fe=this.sliceSerialize(J),be=this.stack[this.stack.length-2];be.label=aY(fe),be.identifier=Jn(fe).toLowerCase()}function Z(){const J=this.stack[this.stack.length-1],fe=this.resume(),be=this.stack[this.stack.length-1];if(this.data.inReference=!0,be.type==="link"){const Ne=J.children;be.children=Ne}else be.alt=fe}function z(){const J=this.resume(),fe=this.stack[this.stack.length-1];fe.url=J}function $(){const J=this.resume(),fe=this.stack[this.stack.length-1];fe.title=J}function Q(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function V(J){const fe=this.resume(),be=this.stack[this.stack.length-1];be.label=fe,be.identifier=Jn(this.sliceSerialize(J)).toLowerCase(),this.data.referenceType="full"}function te(J){this.data.characterReferenceType=J.type}function ne(J){const fe=this.sliceSerialize(J),be=this.data.characterReferenceType;let Ne;be?(Ne=WA(fe,be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ne=hv(fe);const Oe=this.stack[this.stack.length-1];Oe.value+=Ne}function W(J){const fe=this.stack.pop();fe.position.end=La(J.end)}function Y(J){L.call(this,J);const fe=this.stack[this.stack.length-1];fe.url=this.sliceSerialize(J)}function ae(J){L.call(this,J);const fe=this.stack[this.stack.length-1];fe.url="mailto:"+this.sliceSerialize(J)}function he(){return{type:"blockquote",children:[]}}function ke(){return{type:"code",lang:null,meta:null,value:""}}function _e(){return{type:"inlineCode",value:""}}function oe(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function je(){return{type:"emphasis",children:[]}}function Se(){return{type:"heading",depth:0,children:[]}}function Ae(){return{type:"break"}}function se(){return{type:"html",value:""}}function Ee(){return{type:"image",title:null,url:"",alt:null}}function Te(){return{type:"link",title:null,url:"",children:[]}}function Me(J){return{type:"list",ordered:J.type==="listOrdered",start:null,spread:J._spread,children:[]}}function we(J){return{type:"listItem",spread:J._spread,checked:null,children:[]}}function De(){return{type:"paragraph",children:[]}}function Be(){return{type:"strong",children:[]}}function ie(){return{type:"text",value:""}}function xe(){return{type:"thematicBreak"}}}function La(e){return{line:e.line,column:e.column,offset:e.offset}}function lM(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?lM(e,a):oY(e,a)}}function oY(e,t){let n;for(n in t)if(sM.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function I4(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+eo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+eo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+eo({start:t.start,end:t.end})+") is still open")}function uY(e){const t=this;t.parser=n;function n(a){return sY(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function cY(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function dY(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
108
+ `}]}function fY(e,t){const n=t.value?t.value+`
109
+ `:"",a={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(a.className=["language-"+s[0]]);let l={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function hY(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mY(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pY(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=$s(a.toLowerCase()),l=e.footnoteOrder.indexOf(a);let o,c=e.footnoteCounts.get(a);c===void 0?(c=0,e.footnoteOrder.push(a),o=e.footnoteOrder.length):o=l+1,c+=1,e.footnoteCounts.set(a,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,f);const h={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,h),e.applyData(t,h)}function gY(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xY(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function oM(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const s=e.all(t),l=s[0];l&&l.type==="text"?l.value="["+l.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=a:s.push({type:"text",value:a}),s}function yY(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return oM(e,t);const s={src:$s(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(s.title=a.title);const l={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,l),e.applyData(t,l)}function bY(e,t){const n={src:$s(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function vY(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function wY(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return oM(e,t);const s={href:$s(a.url||"")};a.title!==null&&a.title!==void 0&&(s.title=a.title);const l={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function jY(e,t){const n={href:$s(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function kY(e,t,n){const a=e.all(t),s=n?SY(n):uM(t),l={},o=[];if(typeof t.checked=="boolean"){const g=a[0];let p;g&&g.type==="element"&&g.tagName==="p"?p=g:(p={type:"element",tagName:"p",properties:{},children:[]},a.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let c=-1;for(;++c<a.length;){const g=a[c];(s||c!==0||g.type!=="element"||g.tagName!=="p")&&o.push({type:"text",value:`
110
+ `}),g.type==="element"&&g.tagName==="p"&&!s?o.push(...g.children):o.push(g)}const f=a[a.length-1];f&&(s||f.type!=="element"||f.tagName!=="p")&&o.push({type:"text",value:`
111
+ `});const h={type:"element",tagName:"li",properties:l,children:o};return e.patch(t,h),e.applyData(t,h)}function SY(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=uM(n[a])}return t}function uM(e){const t=e.spread;return t??e.children.length>1}function _Y(e,t){const n={},a=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<a.length;){const o=a[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function NY(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CY(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function EY(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TY(e,t){const n=e.all(t),a=n.shift(),s=[];if(a){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],o),s.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=ov(t.children[1]),f=FA(t.children[t.children.length-1]);c&&f&&(o.position={start:c,end:f}),s.push(o)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,l),e.applyData(t,l)}function AY(e,t,n){const a=n?n.children:void 0,l=(a?a.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,c=o?o.length:t.children.length;let f=-1;const h=[];for(;++f<c;){const p=t.children[f],x={},y=o?o[f]:void 0;y&&(x.align=y);let w={type:"element",tagName:l,properties:x,children:[]};p&&(w.children=e.all(p),e.patch(p,w),w=e.applyData(p,w)),h.push(w)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,g),e.applyData(t,g)}function MY(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const B4=9,H4=32;function RY(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),s=0;const l=[];for(;a;)l.push(P4(t.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=n.exec(t);return l.push(P4(t.slice(s),s>0,!1)),l.join("")}function P4(e,t,n){let a=0,s=e.length;if(t){let l=e.codePointAt(a);for(;l===B4||l===H4;)a++,l=e.codePointAt(a)}if(n){let l=e.codePointAt(s-1);for(;l===B4||l===H4;)s--,l=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function LY(e,t){const n={type:"text",value:RY(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function DY(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const OY={blockquote:cY,break:dY,code:fY,delete:hY,emphasis:mY,footnoteReference:pY,heading:gY,html:xY,imageReference:yY,image:bY,inlineCode:vY,linkReference:wY,link:jY,listItem:kY,list:_Y,paragraph:NY,root:CY,strong:EY,table:TY,tableCell:MY,tableRow:AY,text:LY,thematicBreak:DY,toml:cc,yaml:cc,definition:cc,footnoteDefinition:cc};function cc(){}const cM=-1,bd=0,no=1,Oc=2,pv=3,gv=4,xv=5,yv=6,dM=7,fM=8,F4=typeof self=="object"?self:globalThis,zY=(e,t)=>{const n=(s,l)=>(e.set(l,s),s),a=s=>{if(e.has(s))return e.get(s);const[l,o]=t[s];switch(l){case bd:case cM:return n(o,s);case no:{const c=n([],s);for(const f of o)c.push(a(f));return c}case Oc:{const c=n({},s);for(const[f,h]of o)c[a(f)]=a(h);return c}case pv:return n(new Date(o),s);case gv:{const{source:c,flags:f}=o;return n(new RegExp(c,f),s)}case xv:{const c=n(new Map,s);for(const[f,h]of o)c.set(a(f),a(h));return c}case yv:{const c=n(new Set,s);for(const f of o)c.add(a(f));return c}case dM:{const{name:c,message:f}=o;return n(new F4[c](f),s)}case fM:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:c}=new Uint8Array(o);return n(new DataView(c),o)}}return n(new F4[l](o),s)};return a},U4=e=>zY(new Map,e)(0),xs="",{toString:qY}={},{keys:IY}=Object,$l=e=>{const t=typeof e;if(t!=="object"||!e)return[bd,t];const n=qY.call(e).slice(8,-1);switch(n){case"Array":return[no,xs];case"Object":return[Oc,xs];case"Date":return[pv,xs];case"RegExp":return[gv,xs];case"Map":return[xv,xs];case"Set":return[yv,xs];case"DataView":return[no,n]}return n.includes("Array")?[no,n]:n.includes("Error")?[dM,n]:[Oc,n]},dc=([e,t])=>e===bd&&(t==="function"||t==="symbol"),BY=(e,t,n,a)=>{const s=(o,c)=>{const f=a.push(o)-1;return n.set(c,f),f},l=o=>{if(n.has(o))return n.get(o);let[c,f]=$l(o);switch(c){case bd:{let g=o;switch(f){case"bigint":c=fM,g=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);g=null;break;case"undefined":return s([cM],o)}return s([c,g],o)}case no:{if(f){let x=o;return f==="DataView"?x=new Uint8Array(o.buffer):f==="ArrayBuffer"&&(x=new Uint8Array(o)),s([f,[...x]],o)}const g=[],p=s([c,g],o);for(const x of o)g.push(l(x));return p}case Oc:{if(f)switch(f){case"BigInt":return s([f,o.toString()],o);case"Boolean":case"Number":case"String":return s([f,o.valueOf()],o)}if(t&&"toJSON"in o)return l(o.toJSON());const g=[],p=s([c,g],o);for(const x of IY(o))(e||!dc($l(o[x])))&&g.push([l(x),l(o[x])]);return p}case pv:return s([c,o.toISOString()],o);case gv:{const{source:g,flags:p}=o;return s([c,{source:g,flags:p}],o)}case xv:{const g=[],p=s([c,g],o);for(const[x,y]of o)(e||!(dc($l(x))||dc($l(y))))&&g.push([l(x),l(y)]);return p}case yv:{const g=[],p=s([c,g],o);for(const x of o)(e||!dc($l(x)))&&g.push(l(x));return p}}const{message:h}=o;return s([c,{name:f,message:h}],o)};return l},$4=(e,{json:t,lossy:n}={})=>{const a=[];return BY(!(t||n),!!t,new Map,a)(e),a},zc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?U4($4(e,t)):structuredClone(e):(e,t)=>U4($4(e,t));function HY(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function PY(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function FY(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||HY,a=e.options.footnoteBackLabel||PY,s=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[f]);if(!h)continue;const g=e.all(h),p=String(h.identifier).toUpperCase(),x=$s(p.toLowerCase());let y=0;const w=[],j=e.footnoteCounts.get(p);for(;j!==void 0&&++y<=j;){w.length>0&&w.push({type:"text",value:" "});let N=typeof n=="string"?n:n(f,y);typeof N=="string"&&(N={type:"text",value:N}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(f,y),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const S=g[g.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const N=S.children[S.children.length-1];N&&N.type==="text"?N.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...w)}else g.push(...w);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(g,!0)};e.patch(h,k),c.push(k)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...zc(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
112
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
113
+ `}]}}const vd=(function(e){if(e==null)return VY;if(typeof e=="function")return wd(e);if(typeof e=="object")return Array.isArray(e)?UY(e):$Y(e);if(typeof e=="string")return GY(e);throw new Error("Expected function, string, or object as test")});function UY(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=vd(e[n]);return wd(a);function a(...s){let l=-1;for(;++l<t.length;)if(t[l].apply(this,s))return!0;return!1}}function $Y(e){const t=e;return wd(n);function n(a){const s=a;let l;for(l in e)if(s[l]!==t[l])return!1;return!0}}function GY(e){return wd(t);function t(n){return n&&n.type===e}}function wd(e){return t;function t(n,a,s){return!!(YY(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function VY(){return!0}function YY(e){return e!==null&&typeof e=="object"&&"type"in e}const hM=[],XY=!0,ob=!1,KY="skip";function mM(e,t,n,a){let s;typeof t=="function"&&typeof n!="function"?(a=n,n=t):s=t;const l=vd(s),o=a?-1:1;c(e,void 0,[])();function c(f,h,g){const p=f&&typeof f=="object"?f:{};if(typeof p.type=="string"){const y=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(f.type+(y?"<"+y+">":""))+")"})}return x;function x(){let y=hM,w,j,S;if((!t||l(f,h,g[g.length-1]||void 0))&&(y=WY(n(f,g)),y[0]===ob))return y;if("children"in f&&f.children){const k=f;if(k.children&&y[0]!==KY)for(j=(a?k.children.length:-1)+o,S=g.concat(k);j>-1&&j<k.children.length;){const N=k.children[j];if(w=c(N,j,S)(),w[0]===ob)return w;j=typeof w[1]=="number"?w[1]:j+o}}return y}}}function WY(e){return Array.isArray(e)?e:typeof e=="number"?[XY,e]:e==null?hM:[e]}function bv(e,t,n,a){let s,l,o;typeof t=="function"&&typeof n!="function"?(l=void 0,o=t,s=n):(l=t,o=n,s=a),mM(e,l,c,s);function c(f,h){const g=h[h.length-1],p=g?g.children.indexOf(f):void 0;return o(f,p,g)}}const ub={}.hasOwnProperty,QY={};function ZY(e,t){const n=t||QY,a=new Map,s=new Map,l=new Map,o={...OY,...n.handlers},c={all:h,applyData:eX,definitionById:a,footnoteById:s,footnoteCounts:l,footnoteOrder:[],handlers:o,one:f,options:n,patch:JY,wrap:nX};return bv(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const p=g.type==="definition"?a:s,x=String(g.identifier).toUpperCase();p.has(x)||p.set(x,g)}}),c;function f(g,p){const x=g.type,y=c.handlers[x];if(ub.call(c.handlers,x)&&y)return y(c,g,p);if(c.options.passThrough&&c.options.passThrough.includes(x)){if("children"in g){const{children:j,...S}=g,k=zc(S);return k.children=c.all(g),k}return zc(g)}return(c.options.unknownHandler||tX)(c,g,p)}function h(g){const p=[];if("children"in g){const x=g.children;let y=-1;for(;++y<x.length;){const w=c.one(x[y],g);if(w){if(y&&x[y-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=G4(w.value)),!Array.isArray(w)&&w.type==="element")){const j=w.children[0];j&&j.type==="text"&&(j.value=G4(j.value))}Array.isArray(w)?p.push(...w):p.push(w)}}}return p}}function JY(e,t){e.position&&(t.position=P$(e))}function eX(e,t){let n=t;if(e&&e.data){const a=e.data.hName,s=e.data.hChildren,l=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const o="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:o}}n.type==="element"&&l&&Object.assign(n.properties,zc(l)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function tX(e,t){const n=t.data||{},a="value"in t&&!(ub.call(n,"hProperties")||ub.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function nX(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
114
+ `});++a<e.length;)a&&n.push({type:"text",value:`
115
+ `}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
116
+ `}),n}function G4(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function V4(e,t){const n=ZY(e,t),a=n.one(e,void 0),s=FY(n),l=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&l.children.push({type:"text",value:`
117
+ `},s),l}function rX(e,t){return e&&"run"in e?async function(n,a){const s=V4(n,{file:a,...t});await e.run(s,a)}:function(n,a){return V4(n,{file:a,...e||t})}}function Y4(e){if(e)throw e}var Sy,X4;function aX(){if(X4)return Sy;X4=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},l=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var g=e.call(h,"constructor"),p=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!p)return!1;var x;for(x in h);return typeof x>"u"||e.call(h,x)},o=function(h,g){n&&g.name==="__proto__"?n(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},c=function(h,g){if(g==="__proto__")if(e.call(h,g)){if(a)return a(h,g).value}else return;return h[g]};return Sy=function f(){var h,g,p,x,y,w,j=arguments[0],S=1,k=arguments.length,N=!1;for(typeof j=="boolean"&&(N=j,j=arguments[1]||{},S=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});S<k;++S)if(h=arguments[S],h!=null)for(g in h)p=c(j,g),x=c(h,g),j!==x&&(N&&x&&(l(x)||(y=s(x)))?(y?(y=!1,w=p&&s(p)?p:[]):w=p&&l(p)?p:{},o(j,{name:g,newValue:f(N,w,x)})):typeof x<"u"&&o(j,{name:g,newValue:x}));return j},Sy}var iX=aX();const _y=Ds(iX);function cb(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function sX(){const e=[],t={run:n,use:a};return t;function n(...s){let l=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);c(null,...s);function c(f,...h){const g=e[++l];let p=-1;if(f){o(f);return}for(;++p<s.length;)(h[p]===null||h[p]===void 0)&&(h[p]=s[p]);s=h,g?lX(g,c)(...h):o(null,...h)}}function a(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function lX(e,t){let n;return a;function a(...o){const c=e.length>o.length;let f;c&&o.push(s);try{f=e.apply(this,o)}catch(h){const g=h;if(c&&n)throw g;return s(g)}c||(f&&f.then&&typeof f.then=="function"?f.then(l,s):f instanceof Error?s(f):l(f))}function s(o,...c){n||(n=!0,t(o,...c))}function l(o){s(null,o)}}const fr={basename:oX,dirname:uX,extname:cX,join:dX,sep:"/"};function oX(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');qo(e);let n=0,a=-1,s=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else a<0&&(l=!0,a=s+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let o=-1,c=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else o<0&&(l=!0,o=s+1),c>-1&&(e.codePointAt(s)===t.codePointAt(c--)?c<0&&(a=s):(c=-1,a=o));return n===a?a=o:a<0&&(a=e.length),e.slice(n,a)}function uX(e){if(qo(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function cX(e){qo(e);let t=e.length,n=-1,a=0,s=-1,l=0,o;for(;t--;){const c=e.codePointAt(t);if(c===47){if(o){a=t+1;break}continue}n<0&&(o=!0,n=t+1),c===46?s<0?s=t:l!==1&&(l=1):s>-1&&(l=-1)}return s<0||n<0||l===0||l===1&&s===n-1&&s===a+1?"":e.slice(s,n)}function dX(...e){let t=-1,n;for(;++t<e.length;)qo(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":fX(n)}function fX(e){qo(e);const t=e.codePointAt(0)===47;let n=hX(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function hX(e,t){let n="",a=0,s=-1,l=0,o=-1,c,f;for(;++o<=e.length;){if(o<e.length)c=e.codePointAt(o);else{if(c===47)break;c=47}if(c===47){if(!(s===o-1||l===1))if(s!==o-1&&l===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",a=0):(n=n.slice(0,f),a=n.length-1-n.lastIndexOf("/")),s=o,l=0;continue}}else if(n.length>0){n="",a=0,s=o,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),a=o-s-1;s=o,l=0}else c===46&&l>-1?l++:l=-1}return n}function qo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const mX={cwd:pX};function pX(){return"/"}function db(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function gX(e){if(typeof e=="string")e=new URL(e);else if(!db(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return xX(e)}function xX(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Ny=["history","path","basename","stem","extname","dirname"];class pM{constructor(t){let n;t?db(t)?n={path:t}:typeof t=="string"||yX(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":mX.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Ny.length;){const l=Ny[a];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let s;for(s in n)Ny.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?fr.basename(this.path):void 0}set basename(t){Ey(t,"basename"),Cy(t,"basename"),this.path=fr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?fr.dirname(this.path):void 0}set dirname(t){K4(this.basename,"dirname"),this.path=fr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?fr.extname(this.path):void 0}set extname(t){if(Cy(t,"extname"),K4(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=fr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){db(t)&&(t=gX(t)),Ey(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?fr.basename(this.path,this.extname):void 0}set stem(t){Ey(t,"stem"),Cy(t,"stem"),this.path=fr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const s=this.message(t,n,a);throw s.fatal=!0,s}info(t,n,a){const s=this.message(t,n,a);return s.fatal=void 0,s}message(t,n,a){const s=new en(t,n,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Cy(e,t){if(e&&e.includes(fr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+fr.sep+"`")}function Ey(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function K4(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function yX(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bX=(function(e){const a=this.constructor.prototype,s=a[e],l=function(){return s.apply(l,arguments)};return Object.setPrototypeOf(l,a),l}),vX={}.hasOwnProperty;class vv extends bX{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=sX()}copy(){const t=new vv;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(_y(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(My("data",this.frozen),this.namespace[t]=n,this):vX.call(this.namespace,t)&&this.namespace[t]||void 0:t?(My("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const s=n.call(t,...a);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=fc(t),a=this.parser||this.Parser;return Ty("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),Ty("process",this.parser||this.Parser),Ay("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(l,o){const c=fc(t),f=a.parse(c);a.run(f,c,function(g,p,x){if(g||!p||!x)return h(g);const y=p,w=a.stringify(y,x);kX(w)?x.value=w:x.result=w,h(g,x)});function h(g,p){g||!p?o(g):l?l(p):n(void 0,p)}}}processSync(t){let n=!1,a;return this.freeze(),Ty("processSync",this.parser||this.Parser),Ay("processSync",this.compiler||this.Compiler),this.process(t,s),Q4("processSync","process",n),a;function s(l,o){n=!0,Y4(l),a=o}}run(t,n,a){W4(t),this.freeze();const s=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?l(void 0,a):new Promise(l);function l(o,c){const f=fc(n);s.run(t,f,h);function h(g,p,x){const y=p||t;g?c(g):o?o(y):a(void 0,y,x)}}}runSync(t,n){let a=!1,s;return this.run(t,n,l),Q4("runSync","run",a),s;function l(o,c){Y4(o),s=c,a=!0}}stringify(t,n){this.freeze();const a=fc(n),s=this.compiler||this.Compiler;return Ay("stringify",s),W4(t),s(t,a)}use(t,...n){const a=this.attachers,s=this.namespace;if(My("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(h){if(typeof h=="function")f(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...p]=h;f(g,p)}else o(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function o(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(h.plugins),h.settings&&(s.settings=_y(!0,s.settings,h.settings))}function c(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const p=h[g];l(p)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function f(h,g){let p=-1,x=-1;for(;++p<a.length;)if(a[p][0]===h){x=p;break}if(x===-1)a.push([h,...g]);else if(g.length>0){let[y,...w]=g;const j=a[x][1];cb(j)&&cb(y)&&(y=_y(!0,j,y)),a[x]=[h,y,...w]}}}}const wX=new vv().freeze();function Ty(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ay(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function My(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function W4(e){if(!cb(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Q4(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function fc(e){return jX(e)?e:new pM(e)}function jX(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function kX(e){return typeof e=="string"||SX(e)}function SX(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _X="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Z4=[],J4={allowDangerousHtml:!0},NX=/^(https?|ircs?|mailto|xmpp)$/i,CX=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function EX(e){const t=TX(e),n=AX(e);return MX(t.runSync(t.parse(n),n),e)}function TX(e){const t=e.rehypePlugins||Z4,n=e.remarkPlugins||Z4,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...J4}:J4;return wX().use(uY).use(n).use(rX,a).use(t)}function AX(e){const t=e.children||"",n=new pM;return typeof t=="string"&&(n.value=t),n}function MX(e,t){const n=t.allowedElements,a=t.allowElement,s=t.components,l=t.disallowedElements,o=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||RX;for(const g of CX)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+_X+g.id,void 0);return bv(e,h),V$(e,{Fragment:d.Fragment,components:s,ignoreInvalidStyle:!0,jsx:d.jsx,jsxs:d.jsxs,passKeys:!0,passNode:!0});function h(g,p,x){if(g.type==="raw"&&x&&typeof p=="number")return o?x.children.splice(p,1):x.children[p]={type:"text",value:g.value},p;if(g.type==="element"){let y;for(y in wy)if(Object.hasOwn(wy,y)&&Object.hasOwn(g.properties,y)){const w=g.properties[y],j=wy[y];(j===null||j.includes(g.tagName))&&(g.properties[y]=f(String(w||""),y,g))}}if(g.type==="element"){let y=n?!n.includes(g.tagName):l?l.includes(g.tagName):!1;if(!y&&a&&typeof p=="number"&&(y=!a(g,p,x)),y&&x&&typeof p=="number")return c&&g.children?x.children.splice(p,1,...g.children):x.children.splice(p,1),p}}}function RX(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||a!==-1&&t>a||NX.test(e.slice(0,t))?e:""}function eE(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,s=n.indexOf(t);for(;s!==-1;)a++,s=n.indexOf(t,s+t.length);return a}function LX(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function DX(e,t,n){const s=vd((n||{}).ignore||[]),l=OX(t);let o=-1;for(;++o<l.length;)mM(e,"text",c);function c(h,g){let p=-1,x;for(;++p<g.length;){const y=g[p],w=x?x.children:void 0;if(s(y,w?w.indexOf(y):void 0,x))return;x=y}if(x)return f(h,g)}function f(h,g){const p=g[g.length-1],x=l[o][0],y=l[o][1];let w=0;const S=p.children.indexOf(h);let k=!1,N=[];x.lastIndex=0;let _=x.exec(h.value);for(;_;){const E=_.index,M={index:_.index,input:_.input,stack:[...g,h]};let T=y(..._,M);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1?x.lastIndex=E+1:(w!==E&&N.push({type:"text",value:h.value.slice(w,E)}),Array.isArray(T)?N.push(...T):T&&N.push(T),w=E+_[0].length,k=!0),!x.global)break;_=x.exec(h.value)}return k?(w<h.value.length&&N.push({type:"text",value:h.value.slice(w)}),p.children.splice(S,1,...N)):N=[h],S+N.length}}function OX(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<n.length;){const s=n[a];t.push([zX(s[0]),qX(s[1])])}return t}function zX(e){return typeof e=="string"?new RegExp(LX(e),"g"):e}function qX(e){return typeof e=="function"?e:function(){return e}}const Ry="phrasing",Ly=["autolink","link","image","label"];function IX(){return{transforms:[GX],enter:{literalAutolink:HX,literalAutolinkEmail:Dy,literalAutolinkHttp:Dy,literalAutolinkWww:Dy},exit:{literalAutolink:$X,literalAutolinkEmail:UX,literalAutolinkHttp:PX,literalAutolinkWww:FX}}}function BX(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Ry,notInConstruct:Ly},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Ry,notInConstruct:Ly},{character:":",before:"[ps]",after:"\\/",inConstruct:Ry,notInConstruct:Ly}]}}function HX(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Dy(e){this.config.enter.autolinkProtocol.call(this,e)}function PX(e){this.config.exit.autolinkProtocol.call(this,e)}function FX(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function UX(e){this.config.exit.autolinkEmail.call(this,e)}function $X(e){this.exit(e)}function GX(e){DX(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,VX],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),YX]],{ignore:["link","linkReference"]})}function VX(e,t,n,a,s){let l="";if(!gM(s)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!XX(n)))return!1;const o=KX(n+a);if(!o[0])return!1;const c={type:"link",title:null,url:l+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[c,{type:"text",value:o[1]}]:c}function YX(e,t,n,a){return!gM(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function XX(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function KX(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const s=eE(e,"(");let l=eE(e,")");for(;a!==-1&&s>l;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),l++;return[e,n]}function gM(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||wi(n)||xd(n))&&(!t||n!==47)}xM.peek=aK;function WX(){this.buffer()}function QX(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function ZX(){this.buffer()}function JX(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function eK(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function tK(e){this.exit(e)}function nK(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rK(e){this.exit(e)}function aK(){return"["}function xM(e,t,n,a){const s=n.createTracker(a);let l=s.move("[^");const o=n.enter("footnoteReference"),c=n.enter("reference");return l+=s.move(n.safe(n.associationId(e),{after:"]",before:l})),c(),o(),l+=s.move("]"),l}function iK(){return{enter:{gfmFootnoteCallString:WX,gfmFootnoteCall:QX,gfmFootnoteDefinitionLabelString:ZX,gfmFootnoteDefinition:JX},exit:{gfmFootnoteCallString:eK,gfmFootnoteCall:tK,gfmFootnoteDefinitionLabelString:nK,gfmFootnoteDefinition:rK}}}function sK(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:xM},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,s,l,o){const c=l.createTracker(o);let f=c.move("[^");const h=l.enter("footnoteDefinition"),g=l.enter("label");return f+=c.move(l.safe(l.associationId(a),{before:f,after:"]"})),g(),f+=c.move("]:"),a.children&&a.children.length>0&&(c.shift(4),f+=c.move((t?`
118
+ `:" ")+l.indentLines(l.containerFlow(a,c.current()),t?yM:lK))),h(),f}}function lK(e,t,n){return t===0?e:yM(e,t,n)}function yM(e,t,n){return(n?"":" ")+e}const oK=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];bM.peek=hK;function uK(){return{canContainEols:["delete"],enter:{strikethrough:dK},exit:{strikethrough:fK}}}function cK(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:oK}],handlers:{delete:bM}}}function dK(e){this.enter({type:"delete",children:[]},e)}function fK(e){this.exit(e)}function bM(e,t,n,a){const s=n.createTracker(a),l=n.enter("strikethrough");let o=s.move("~~");return o+=n.containerPhrasing(e,{...s.current(),before:o,after:"~"}),o+=s.move("~~"),l(),o}function hK(){return"~"}function mK(e){return e.length}function pK(e,t){const n=t||{},a=(n.align||[]).concat(),s=n.stringLength||mK,l=[],o=[],c=[],f=[];let h=0,g=-1;for(;++g<e.length;){const j=[],S=[];let k=-1;for(e[g].length>h&&(h=e[g].length);++k<e[g].length;){const N=gK(e[g][k]);if(n.alignDelimiters!==!1){const _=s(N);S[k]=_,(f[k]===void 0||_>f[k])&&(f[k]=_)}j.push(N)}o[g]=j,c[g]=S}let p=-1;if(typeof a=="object"&&"length"in a)for(;++p<h;)l[p]=tE(a[p]);else{const j=tE(a);for(;++p<h;)l[p]=j}p=-1;const x=[],y=[];for(;++p<h;){const j=l[p];let S="",k="";j===99?(S=":",k=":"):j===108?S=":":j===114&&(k=":");let N=n.alignDelimiters===!1?1:Math.max(1,f[p]-S.length-k.length);const _=S+"-".repeat(N)+k;n.alignDelimiters!==!1&&(N=S.length+N+k.length,N>f[p]&&(f[p]=N),y[p]=N),x[p]=_}o.splice(1,0,x),c.splice(1,0,y),g=-1;const w=[];for(;++g<o.length;){const j=o[g],S=c[g];p=-1;const k=[];for(;++p<h;){const N=j[p]||"";let _="",E="";if(n.alignDelimiters!==!1){const M=f[p]-(S[p]||0),T=l[p];T===114?_=" ".repeat(M):T===99?M%2?(_=" ".repeat(M/2+.5),E=" ".repeat(M/2-.5)):(_=" ".repeat(M/2),E=_):E=" ".repeat(M)}n.delimiterStart!==!1&&!p&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||p)&&k.push(" "),n.alignDelimiters!==!1&&k.push(_),k.push(N),n.alignDelimiters!==!1&&k.push(E),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||p!==h-1)&&k.push("|")}w.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return w.join(`
119
+ `)}function gK(e){return e==null?"":String(e)}function tE(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function xK(e,t,n,a){const s=n.enter("blockquote"),l=n.createTracker(a);l.move("> "),l.shift(2);const o=n.indentLines(n.containerFlow(e,l.current()),yK);return s(),o}function yK(e,t,n){return">"+(n?"":" ")+e}function bK(e,t){return nE(e,t.inConstruct,!0)&&!nE(e,t.notInConstruct,!1)}function nE(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function rE(e,t,n,a){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
120
+ `&&bK(n.stack,n.unsafe[s]))return/[ \t]/.test(a.before)?"":" ";return`\\
121
+ `}function vK(e,t){const n=String(e);let a=n.indexOf(t),s=a,l=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===s?++l>o&&(o=l):l=1,s=a+t.length,a=n.indexOf(t,s);return o}function wK(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function jK(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function kK(e,t,n,a){const s=jK(n),l=e.value||"",o=s==="`"?"GraveAccent":"Tilde";if(wK(e,n)){const p=n.enter("codeIndented"),x=n.indentLines(l,SK);return p(),x}const c=n.createTracker(a),f=s.repeat(Math.max(vK(l,s)+1,3)),h=n.enter("codeFenced");let g=c.move(f);if(e.lang){const p=n.enter(`codeFencedLang${o}`);g+=c.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...c.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${o}`);g+=c.move(" "),g+=c.move(n.safe(e.meta,{before:g,after:`
122
+ `,encode:["`"],...c.current()})),p()}return g+=c.move(`
123
+ `),l&&(g+=c.move(l+`
124
+ `)),g+=c.move(f),h(),g}function SK(e,t,n){return(n?"":" ")+e}function wv(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function _K(e,t,n,a){const s=wv(n),l=s==='"'?"Quote":"Apostrophe",o=n.enter("definition");let c=n.enter("label");const f=n.createTracker(a);let h=f.move("[");return h+=f.move(n.safe(n.associationId(e),{before:h,after:"]",...f.current()})),h+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":`
125
+ `,...f.current()}))),c(),e.title&&(c=n.enter(`title${l}`),h+=f.move(" "+s),h+=f.move(n.safe(e.title,{before:h,after:s,...f.current()})),h+=f.move(s),c()),o(),h}function NK(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function yo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function qc(e,t,n){const a=Ls(e),s=Ls(t);return a===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}vM.peek=CK;function vM(e,t,n,a){const s=NK(n),l=n.enter("emphasis"),o=n.createTracker(a),c=o.move(s);let f=o.move(n.containerPhrasing(e,{after:s,before:c,...o.current()}));const h=f.charCodeAt(0),g=qc(a.before.charCodeAt(a.before.length-1),h,s);g.inside&&(f=yo(h)+f.slice(1));const p=f.charCodeAt(f.length-1),x=qc(a.after.charCodeAt(0),p,s);x.inside&&(f=f.slice(0,-1)+yo(p));const y=o.move(s);return l(),n.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},c+f+y}function CK(e,t,n){return n.options.emphasis||"*"}function EK(e,t){let n=!1;return bv(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,ob}),!!((!e.depth||e.depth<3)&&fv(e)&&(t.options.setext||n))}function TK(e,t,n,a){const s=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(a);if(EK(e,n)){const g=n.enter("headingSetext"),p=n.enter("phrasing"),x=n.containerPhrasing(e,{...l.current(),before:`
126
+ `,after:`
127
+ `});return p(),g(),x+`
128
+ `+(s===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
129
+ `))+1))}const o="#".repeat(s),c=n.enter("headingAtx"),f=n.enter("phrasing");l.move(o+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
130
+ `,...l.current()});return/^[\t ]/.test(h)&&(h=yo(h.charCodeAt(0))+h.slice(1)),h=h?o+" "+h:o,n.options.closeAtx&&(h+=" "+o),f(),c(),h}wM.peek=AK;function wM(e){return e.value||""}function AK(){return"<"}jM.peek=MK;function jM(e,t,n,a){const s=wv(n),l=s==='"'?"Quote":"Apostrophe",o=n.enter("image");let c=n.enter("label");const f=n.createTracker(a);let h=f.move("![");return h+=f.move(n.safe(e.alt,{before:h,after:"]",...f.current()})),h+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${l}`),h+=f.move(" "+s),h+=f.move(n.safe(e.title,{before:h,after:s,...f.current()})),h+=f.move(s),c()),h+=f.move(")"),o(),h}function MK(){return"!"}kM.peek=RK;function kM(e,t,n,a){const s=e.referenceType,l=n.enter("imageReference");let o=n.enter("label");const c=n.createTracker(a);let f=c.move("![");const h=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(h+"]["),o();const g=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return o(),n.stack=g,l(),s==="full"||!h||h!==p?f+=c.move(p+"]"):s==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function RK(){return"!"}SM.peek=LK;function SM(e,t,n){let a=e.value||"",s="`",l=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(a);)s+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++l<n.unsafe.length;){const o=n.unsafe[l],c=n.compilePattern(o);let f;if(o.atBreak)for(;f=c.exec(a);){let h=f.index;a.charCodeAt(h)===10&&a.charCodeAt(h-1)===13&&h--,a=a.slice(0,h)+" "+a.slice(f.index+1)}}return s+a+s}function LK(){return"`"}function _M(e,t){const n=fv(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}NM.peek=DK;function NM(e,t,n,a){const s=wv(n),l=s==='"'?"Quote":"Apostrophe",o=n.createTracker(a);let c,f;if(_M(e,n)){const g=n.stack;n.stack=[],c=n.enter("autolink");let p=o.move("<");return p+=o.move(n.containerPhrasing(e,{before:p,after:">",...o.current()})),p+=o.move(">"),c(),n.stack=g,p}c=n.enter("link"),f=n.enter("label");let h=o.move("[");return h+=o.move(n.containerPhrasing(e,{before:h,after:"](",...o.current()})),h+=o.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=o.move("<"),h+=o.move(n.safe(e.url,{before:h,after:">",...o.current()})),h+=o.move(">")):(f=n.enter("destinationRaw"),h+=o.move(n.safe(e.url,{before:h,after:e.title?" ":")",...o.current()}))),f(),e.title&&(f=n.enter(`title${l}`),h+=o.move(" "+s),h+=o.move(n.safe(e.title,{before:h,after:s,...o.current()})),h+=o.move(s),f()),h+=o.move(")"),c(),h}function DK(e,t,n){return _M(e,n)?"<":"["}CM.peek=OK;function CM(e,t,n,a){const s=e.referenceType,l=n.enter("linkReference");let o=n.enter("label");const c=n.createTracker(a);let f=c.move("[");const h=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(h+"]["),o();const g=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return o(),n.stack=g,l(),s==="full"||!h||h!==p?f+=c.move(p+"]"):s==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function OK(){return"["}function jv(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function zK(e){const t=jv(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function qK(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function EM(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function IK(e,t,n,a){const s=n.enter("list"),l=n.bulletCurrent;let o=e.ordered?qK(n):jv(n);const c=e.ordered?o==="."?")":".":zK(n);let f=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&g&&(!g.children||!g.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),EM(n)===o&&g){let p=-1;for(;++p<e.children.length;){const x=e.children[p];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(o=c),n.bulletCurrent=o;const h=n.containerFlow(e,a);return n.bulletLastUsed=o,n.bulletCurrent=l,s(),h}function BK(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function HK(e,t,n,a){const s=BK(n);let l=n.bulletCurrent||jv(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let o=l.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const c=n.createTracker(a);c.move(l+" ".repeat(o-l.length)),c.shift(o);const f=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,c.current()),g);return f(),h;function g(p,x,y){return x?(y?"":" ".repeat(o))+p:(y?l:l+" ".repeat(o-l.length))+p}}function PK(e,t,n,a){const s=n.enter("paragraph"),l=n.enter("phrasing"),o=n.containerPhrasing(e,a);return l(),s(),o}const FK=vd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function UK(e,t,n,a){return(e.children.some(function(o){return FK(o)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function $K(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}TM.peek=GK;function TM(e,t,n,a){const s=$K(n),l=n.enter("strong"),o=n.createTracker(a),c=o.move(s+s);let f=o.move(n.containerPhrasing(e,{after:s,before:c,...o.current()}));const h=f.charCodeAt(0),g=qc(a.before.charCodeAt(a.before.length-1),h,s);g.inside&&(f=yo(h)+f.slice(1));const p=f.charCodeAt(f.length-1),x=qc(a.after.charCodeAt(0),p,s);x.inside&&(f=f.slice(0,-1)+yo(p));const y=o.move(s+s);return l(),n.attentionEncodeSurroundingInfo={after:x.outside,before:g.outside},c+f+y}function GK(e,t,n){return n.options.strong||"*"}function VK(e,t,n,a){return n.safe(e.value,a)}function YK(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function XK(e,t,n){const a=(EM(n)+(n.options.ruleSpaces?" ":"")).repeat(YK(n));return n.options.ruleSpaces?a.slice(0,-1):a}const AM={blockquote:xK,break:rE,code:kK,definition:_K,emphasis:vM,hardBreak:rE,heading:TK,html:wM,image:jM,imageReference:kM,inlineCode:SM,link:NM,linkReference:CM,list:IK,listItem:HK,paragraph:PK,root:UK,strong:TM,text:VK,thematicBreak:XK};function KK(){return{enter:{table:WK,tableData:aE,tableHeader:aE,tableRow:ZK},exit:{codeText:JK,table:QK,tableData:Oy,tableHeader:Oy,tableRow:Oy}}}function WK(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function QK(e){this.exit(e),this.data.inTable=void 0}function ZK(e){this.enter({type:"tableRow",children:[]},e)}function Oy(e){this.exit(e)}function aE(e){this.enter({type:"tableCell",children:[]},e)}function JK(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,eW));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function eW(e,t){return t==="|"?t:e}function tW(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,s=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
131
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:o,tableCell:f,tableRow:c}};function o(y,w,j,S){return h(g(y,j,S),y.align)}function c(y,w,j,S){const k=p(y,j,S),N=h([k]);return N.slice(0,N.indexOf(`
132
+ `))}function f(y,w,j,S){const k=j.enter("tableCell"),N=j.enter("phrasing"),_=j.containerPhrasing(y,{...S,before:l,after:l});return N(),k(),_}function h(y,w){return pK(y,{align:w,alignDelimiters:a,padding:n,stringLength:s})}function g(y,w,j){const S=y.children;let k=-1;const N=[],_=w.enter("table");for(;++k<S.length;)N[k]=p(S[k],w,j);return _(),N}function p(y,w,j){const S=y.children;let k=-1;const N=[],_=w.enter("tableRow");for(;++k<S.length;)N[k]=f(S[k],y,w,j);return _(),N}function x(y,w,j){let S=AM.inlineCode(y,w,j);return j.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function nW(){return{exit:{taskListCheckValueChecked:iE,taskListCheckValueUnchecked:iE,paragraph:aW}}}function rW(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:iW}}}function iE(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function aW(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const s=t.children;let l=-1,o;for(;++l<s.length;){const c=s[l];if(c.type==="paragraph"){o=c;break}}o===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function iW(e,t,n,a){const s=e.children[0],l=typeof e.checked=="boolean"&&s&&s.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",c=n.createTracker(a);l&&c.move(o);let f=AM.listItem(e,t,n,{...a,...c.current()});return l&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),f;function h(g){return g+o}}function sW(){return[IX(),iK(),uK(),KK(),nW()]}function lW(e){return{extensions:[BX(),sK(e),cK(),tW(e),rW()]}}const oW={tokenize:mW,partial:!0},MM={tokenize:pW,partial:!0},RM={tokenize:gW,partial:!0},LM={tokenize:xW,partial:!0},uW={tokenize:yW,partial:!0},DM={name:"wwwAutolink",tokenize:fW,previous:zM},OM={name:"protocolAutolink",tokenize:hW,previous:qM},ta={name:"emailAutolink",tokenize:dW,previous:IM},wr={};function cW(){return{text:wr}}let fi=48;for(;fi<123;)wr[fi]=ta,fi++,fi===58?fi=65:fi===91&&(fi=97);wr[43]=ta;wr[45]=ta;wr[46]=ta;wr[95]=ta;wr[72]=[ta,OM];wr[104]=[ta,OM];wr[87]=[ta,DM];wr[119]=[ta,DM];function dW(e,t,n){const a=this;let s,l;return o;function o(p){return!fb(p)||!IM.call(a,a.previous)||kv(a.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(p))}function c(p){return fb(p)?(e.consume(p),c):p===64?(e.consume(p),f):n(p)}function f(p){return p===46?e.check(uW,g,h)(p):p===45||p===95||Jt(p)?(l=!0,e.consume(p),f):g(p)}function h(p){return e.consume(p),s=!0,f}function g(p){return l&&s&&an(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function fW(e,t,n){const a=this;return s;function s(o){return o!==87&&o!==119||!zM.call(a,a.previous)||kv(a.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(oW,e.attempt(MM,e.attempt(RM,l),n),n)(o))}function l(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function hW(e,t,n){const a=this;let s="",l=!1;return o;function o(p){return(p===72||p===104)&&qM.call(a,a.previous)&&!kv(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),c):n(p)}function c(p){if(an(p)&&s.length<5)return s+=String.fromCodePoint(p),e.consume(p),c;if(p===58){const x=s.toLowerCase();if(x==="http"||x==="https")return e.consume(p),f}return n(p)}function f(p){return p===47?(e.consume(p),l?h:(l=!0,f)):n(p)}function h(p){return p===null||Dc(p)||vt(p)||wi(p)||xd(p)?n(p):e.attempt(MM,e.attempt(RM,g),n)(p)}function g(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function mW(e,t,n){let a=0;return s;function s(o){return(o===87||o===119)&&a<3?(a++,e.consume(o),s):o===46&&a===3?(e.consume(o),l):n(o)}function l(o){return o===null?n(o):t(o)}}function pW(e,t,n){let a,s,l;return o;function o(h){return h===46||h===95?e.check(LM,f,c)(h):h===null||vt(h)||wi(h)||h!==45&&xd(h)?f(h):(l=!0,e.consume(h),o)}function c(h){return h===95?a=!0:(s=a,a=void 0),e.consume(h),o}function f(h){return s||a||!l?n(h):t(h)}}function gW(e,t){let n=0,a=0;return s;function s(o){return o===40?(n++,e.consume(o),s):o===41&&a<n?l(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(LM,t,l)(o):o===null||vt(o)||wi(o)?t(o):(e.consume(o),s)}function l(o){return o===41&&a++,e.consume(o),s}}function xW(e,t,n){return a;function a(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),a):c===38?(e.consume(c),l):c===93?(e.consume(c),s):c===60||c===null||vt(c)||wi(c)?t(c):n(c)}function s(c){return c===null||c===40||c===91||vt(c)||wi(c)?t(c):a(c)}function l(c){return an(c)?o(c):n(c)}function o(c){return c===59?(e.consume(c),a):an(c)?(e.consume(c),o):n(c)}}function yW(e,t,n){return a;function a(l){return e.consume(l),s}function s(l){return Jt(l)?n(l):t(l)}}function zM(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||vt(e)}function qM(e){return!an(e)}function IM(e){return!(e===47||fb(e))}function fb(e){return e===43||e===45||e===46||e===95||Jt(e)}function kv(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const bW={tokenize:CW,partial:!0};function vW(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:SW,continuation:{tokenize:_W},exit:NW}},text:{91:{name:"gfmFootnoteCall",tokenize:kW},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:wW,resolveTo:jW}}}}function wW(e,t,n){const a=this;let s=a.events.length;const l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o;for(;s--;){const f=a.events[s][1];if(f.type==="labelImage"){o=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!o||!o._balanced)return n(f);const h=Jn(a.sliceSerialize({start:o.end,end:a.now()}));return h.codePointAt(0)!==94||!l.includes(h.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function jW(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},c=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...c),e}function kW(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let l=0,o;return c;function c(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),f}function f(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(p){if(l>999||p===93&&!o||p===null||p===91||vt(p))return n(p);if(p===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return s.includes(Jn(a.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return vt(p)||(o=!0),l++,e.consume(p),p===92?g:h}function g(p){return p===91||p===92||p===93?(e.consume(p),l++,h):h(p)}}function SW(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let l,o=0,c;return f;function f(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(w)}function g(w){if(o>999||w===93&&!c||w===null||w===91||vt(w))return n(w);if(w===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return l=Jn(a.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return vt(w)||(c=!0),o++,e.consume(w),w===92?p:g}function p(w){return w===91||w===92||w===93?(e.consume(w),o++,g):g(w)}function x(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),s.includes(l)||s.push(l),at(e,y,"gfmFootnoteDefinitionWhitespace")):n(w)}function y(w){return t(w)}}function _W(e,t,n){return e.check(zo,t,e.attempt(bW,t,n))}function NW(e){e.exit("gfmFootnoteDefinition")}function CW(e,t,n){const a=this;return at(e,s,"gfmFootnoteDefinitionIndent",5);function s(l){const o=a.events[a.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(l):n(l)}}function EW(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:l,resolveAll:s};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(o,c){let f=-1;for(;++f<o.length;)if(o[f][0]==="enter"&&o[f][1].type==="strikethroughSequenceTemporary"&&o[f][1]._close){let h=f;for(;h--;)if(o[h][0]==="exit"&&o[h][1].type==="strikethroughSequenceTemporary"&&o[h][1]._open&&o[f][1].end.offset-o[f][1].start.offset===o[h][1].end.offset-o[h][1].start.offset){o[f][1].type="strikethroughSequence",o[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},o[h][1].start),end:Object.assign({},o[f][1].end)},p={type:"strikethroughText",start:Object.assign({},o[h][1].end),end:Object.assign({},o[f][1].start)},x=[["enter",g,c],["enter",o[h][1],c],["exit",o[h][1],c],["enter",p,c]],y=c.parser.constructs.insideSpan.null;y&&En(x,x.length,0,yd(y,o.slice(h+1,f),c)),En(x,x.length,0,[["exit",p,c],["enter",o[f][1],c],["exit",o[f][1],c],["exit",g,c]]),En(o,h-1,f-h+3,x),f=h+x.length-2;break}}for(f=-1;++f<o.length;)o[f][1].type==="strikethroughSequenceTemporary"&&(o[f][1].type="data");return o}function l(o,c,f){const h=this.previous,g=this.events;let p=0;return x;function x(w){return h===126&&g[g.length-1][1].type!=="characterEscape"?f(w):(o.enter("strikethroughSequenceTemporary"),y(w))}function y(w){const j=Ls(h);if(w===126)return p>1?f(w):(o.consume(w),p++,y);if(p<2&&!n)return f(w);const S=o.exit("strikethroughSequenceTemporary"),k=Ls(w);return S._open=!k||k===2&&!!j,S._close=!j||j===2&&!!k,c(w)}}}class TW{constructor(){this.map=[]}add(t,n,a){AW(this,t,n,a)}consume(t){if(this.map.sort(function(l,o){return l[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let s=a.pop();for(;s;){for(const l of s)t.push(l);s=a.pop()}this.map.length=0}}function AW(e,t,n,a){let s=0;if(!(n===0&&a.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...a);return}s+=1}e.map.push([t,n,a])}}function MW(e,t){let n=!1;const a=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=a.length-1;a[l]=a[l]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function RW(){return{flow:{null:{name:"table",tokenize:LW,resolveAll:DW}}}}function LW(e,t,n){const a=this;let s=0,l=0,o;return c;function c(L){let H=a.events.length-1;for(;H>-1;){const q=a.events[H][1].type;if(q==="lineEnding"||q==="linePrefix")H--;else break}const F=H>-1?a.events[H][1].type:null,G=F==="tableHead"||F==="tableRow"?T:f;return G===T&&a.parser.lazy[a.now().line]?n(L):G(L)}function f(L){return e.enter("tableHead"),e.enter("tableRow"),h(L)}function h(L){return L===124||(o=!0,l+=1),g(L)}function g(L){return L===null?n(L):Pe(L)?l>1?(l=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),y):n(L):Ze(L)?at(e,g,"whitespace")(L):(l+=1,o&&(o=!1,s+=1),L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),o=!0,g):(e.enter("data"),p(L)))}function p(L){return L===null||L===124||vt(L)?(e.exit("data"),g(L)):(e.consume(L),L===92?x:p)}function x(L){return L===92||L===124?(e.consume(L),p):p(L)}function y(L){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(L):(e.enter("tableDelimiterRow"),o=!1,Ze(L)?at(e,w,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):w(L))}function w(L){return L===45||L===58?S(L):L===124?(o=!0,e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),j):M(L)}function j(L){return Ze(L)?at(e,S,"whitespace")(L):S(L)}function S(L){return L===58?(l+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),k):L===45?(l+=1,k(L)):L===null||Pe(L)?E(L):M(L)}function k(L){return L===45?(e.enter("tableDelimiterFiller"),N(L)):M(L)}function N(L){return L===45?(e.consume(L),N):L===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(L),e.exit("tableDelimiterMarker"),_):(e.exit("tableDelimiterFiller"),_(L))}function _(L){return Ze(L)?at(e,E,"whitespace")(L):E(L)}function E(L){return L===124?w(L):L===null||Pe(L)?!o||s!==l?M(L):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(L)):M(L)}function M(L){return n(L)}function T(L){return e.enter("tableRow"),R(L)}function R(L){return L===124?(e.enter("tableCellDivider"),e.consume(L),e.exit("tableCellDivider"),R):L===null||Pe(L)?(e.exit("tableRow"),t(L)):Ze(L)?at(e,R,"whitespace")(L):(e.enter("data"),B(L))}function B(L){return L===null||L===124||vt(L)?(e.exit("data"),R(L)):(e.consume(L),L===92?P:B)}function P(L){return L===92||L===124?(e.consume(L),B):B(L)}}function DW(e,t){let n=-1,a=!0,s=0,l=[0,0,0,0],o=[0,0,0,0],c=!1,f=0,h,g,p;const x=new TW;for(;++n<e.length;){const y=e[n],w=y[1];y[0]==="enter"?w.type==="tableHead"?(c=!1,f!==0&&(sE(x,t,f,h,g),g=void 0,f=0),h={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(n,0,[["enter",h,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(a=!0,p=void 0,l=[0,0,0,0],o=[0,n+1,0,0],c&&(c=!1,g={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},x.add(n,0,[["enter",g,t]])),s=w.type==="tableDelimiterRow"?2:g?3:1):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(a=!1,o[2]===0&&(l[1]!==0&&(o[0]=o[1],p=hc(x,t,l,s,void 0,p),l=[0,0,0,0]),o[2]=n)):w.type==="tableCellDivider"&&(a?a=!1:(l[1]!==0&&(o[0]=o[1],p=hc(x,t,l,s,void 0,p)),l=o,o=[l[1],n,0,0])):w.type==="tableHead"?(c=!0,f=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(f=n,l[1]!==0?(o[0]=o[1],p=hc(x,t,l,s,n,p)):o[1]!==0&&(p=hc(x,t,o,s,n,p)),s=0):s&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(o[3]=n)}for(f!==0&&sE(x,t,f,h,g),x.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=MW(t.events,n))}return e}function hc(e,t,n,a,s,l){const o=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(l.end=Object.assign({},ys(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const f=ys(t.events,n[1]);if(l={type:o,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const h=ys(t.events,n[2]),g=ys(t.events,n[3]),p={type:c,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",p,t]]),a!==2){const x=t.events[n[2]],y=t.events[n[3]];if(x[1].end=Object.assign({},y[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,j=n[3]-n[2]-1;e.add(w,j,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return s!==void 0&&(l.end=Object.assign({},ys(t.events,s)),e.add(s,0,[["exit",l,t]]),l=void 0),l}function sE(e,t,n,a,s){const l=[],o=ys(t.events,n);s&&(s.end=Object.assign({},o),l.push(["exit",s,t])),a.end=Object.assign({},o),l.push(["exit",a,t]),e.add(n+1,0,l)}function ys(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const OW={name:"tasklistCheck",tokenize:qW};function zW(){return{text:{91:OW}}}function qW(e,t,n){const a=this;return s;function s(f){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),l)}function l(f){return vt(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),o):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),o):n(f)}function o(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return Pe(f)?t(f):Ze(f)?e.check({tokenize:IW},t,n)(f):n(f)}}function IW(e,t,n){return at(e,a,"whitespace");function a(s){return s===null?n(s):t(s)}}function BW(e){return KA([cW(),vW(),EW(e),RW(),zW()])}const HW={};function PW(e){const t=this,n=e||HW,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),l=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),o=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(BW(n)),l.push(sW()),o.push(lW(n))}function FW({content:e,className:t}){return d.jsx("div",{className:`markdown-content ${t??""}`,children:d.jsx(EX,{remarkPlugins:[PW],components:{a:({href:n,children:a})=>d.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:a})},children:e})})}const UW={pending:"bg-warm-200 text-warm-600",running:"bg-status-success/10 text-status-success",paused:"bg-amber-100 text-amber-700",completed:"bg-accent/10 text-accent",failed:"bg-status-error/10 text-status-error",merged:"bg-accent/10 text-accent"};function $W(e){try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function lE(e){return e==="pending"||e==="failed"?{canEdit:!0,allowAdvancedFields:!0}:e==="paused"||e==="completed"?{canEdit:!0,allowAdvancedFields:!1}:{canEdit:!1,allowAdvancedFields:!1}}function GW({onEvent:e,connected:t}){const{id:n,discussionId:a}=gb(),{t:s,lang:l}=Ue(),[o,c]=C.useState(null),[f,h]=C.useState([]),[g,p]=C.useState(!0),[x,y]=C.useState(new Map),[w,j]=C.useState(""),[S,k]=C.useState(!1),[N,_]=C.useState(!1),[E,M]=C.useState(!1),[T,R]=C.useState(new Set),[B,P]=C.useState(""),[L,H]=C.useState([]),F=C.useRef(null),G=C.useCallback(se=>{R(Ee=>{const Te=new Set(Ee);return Te.has(se)?Te.delete(se):Te.add(se),Te})},[]),q=C.useCallback(()=>{if(!o)return;const se=new Set(o.messages.filter(Ee=>Ee.content&&Ee.status==="completed").map(Ee=>Ee.id));R(se)},[o]),O=C.useCallback(()=>{R(new Set)},[]),D=se=>{const Ee=se.split(`
133
+ `).find(Te=>Te.trim())||"";return Ee.length>120?`${Ee.slice(0,120)}...`:Ee};C.useEffect(()=>{a&&ui(a).then(c).catch(()=>{}).finally(()=>p(!1))},[a]),C.useEffect(()=>{n&&FE(n).then(h).catch(()=>{})},[n]),C.useEffect(()=>e(se=>{a&&(se.type==="discussion:status-changed"&&se.discussionId===a&&c(Ee=>Ee&&{...Ee,status:se.status,current_round:se.currentRound??Ee.current_round,current_agent_id:se.currentAgentId??Ee.current_agent_id}),se.type==="discussion:message-changed"&&se.discussionId===a&&(c(Ee=>Ee&&{...Ee,messages:Ee.messages.map(Te=>Te.id===se.messageId?{...Te,status:se.status}:Te)}),(se.status==="completed"||se.status==="failed")&&ui(a).then(c).catch(()=>{})),se.type==="discussion:log"&&se.discussionId===a&&se.messageId&&y(Ee=>{const Te=new Map(Ee),Me=se.messageId,we=Te.get(Me)||[];return Te.set(Me,[...we,se.message||""]),Te}))}),[e,a]),C.useEffect(()=>{var se;(se=F.current)==null||se.scrollIntoView({behavior:"smooth"})},[o==null?void 0:o.messages,x]),C.useEffect(()=>{!a||!o||(o.status==="failed"?XO(a).then(se=>H(se.filter(Ee=>Ee.log_type==="error"))).catch(()=>{}):H([]))},[a,o==null?void 0:o.status]);const X=C.useCallback(async()=>{if(!a)return;const se=await UE(a);c(se),P("")},[a]),K=C.useCallback(async()=>{if(!a)return;await $E(a);const se=await ui(a);c(se),P("")},[a]),Z=C.useCallback(async()=>{if(!a||!w.trim())return;await GO(a,w),j("");const se=await ui(a);c(se),P("")},[a,w]),z=C.useCallback(async()=>{if(!a)return;const se=await VO(a);c(se),P("")},[a]),$=C.useCallback(async se=>{if(!a)return;k(!1);const Ee=await YO(a,se);c(Ee),P("")},[a]),Q=C.useCallback(async()=>{if(!a)return;await KO(a);const se=await ui(a);c(se),P("")},[a]),I=C.useCallback(async()=>{if(!a)return;await WO(a);const se=await ui(a);c(se),P("")},[a]),V=C.useCallback(async se=>{if(!(!a||!o)){M(!0);try{const{allowAdvancedFields:Ee}=lE(o.status),Te=Ee?{title:se.title,description:se.description,agent_ids:se.agent_ids,max_rounds:se.max_rounds,auto_implement:se.auto_implement,implement_agent_id:se.auto_implement?se.implement_agent_id:null}:{title:se.title,description:se.description};await UO(a,Te);const Me=await ui(a);c(Me),_(!1),P("")}catch(Ee){P(Ee instanceof Error?Ee.message:l==="ko"?"토론 저장에 실패했습니다.":"Failed to save discussion.")}finally{M(!1)}}},[a,o,l]);if(g)return d.jsx("div",{className:"mx-auto max-w-4xl px-4 py-8 text-center text-warm-500",children:s("detail.loading")});if(!o)return d.jsxs("div",{className:"mx-auto max-w-4xl px-4 py-8 text-center",children:[d.jsx("p",{className:"text-status-error",children:s("discussions.notFound")}),d.jsx(Hn,{to:`/projects/${n}?tab=discussions`,className:"text-sm text-accent mt-2 inline-block",children:s("discussions.back")})]});const te=new Map(o.agents.map(se=>[se.id,se])),ne=o.status==="pending"||o.status==="paused"||o.status==="failed",W=o.status==="running",Y=o.status==="completed"||o.status==="paused",ae=o.status==="completed",he=o.status==="paused"||o.status==="running",ke=!W&&!!o.worktree_path,{canEdit:_e,allowAdvancedFields:oe}=lE(o.status),je={title:o.title,description:o.description,agent_ids:$W(o.agent_ids),max_rounds:o.max_rounds,auto_implement:o.auto_implement===1,implement_agent_id:o.implement_agent_id||""},Se=new Map;for(const se of o.messages){const Ee=Se.get(se.round_number)||[];Ee.push(se),Se.set(se.round_number,Ee)}const Ae=[...Se.keys()].sort((se,Ee)=>se-Ee);return d.jsxs("div",{className:"mx-auto max-w-4xl px-4 sm:px-6 py-6 sm:py-8 flex flex-col",style:{height:"calc(100vh - 2rem)"},children:[d.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[d.jsxs(Hn,{to:`/projects/${n}?tab=discussions`,className:"inline-flex items-center gap-1 text-sm text-warm-500 hover:text-accent transition-colors",children:[d.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),s("discussions.back")]}),d.jsx("span",{className:"text-warm-300",children:"/"}),d.jsx("span",{className:"text-sm font-medium text-warm-700 truncate",children:o.title}),d.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase ${UW[o.status]}`,children:s(`status.${o.status}`)||o.status}),o.status==="running"&&d.jsxs("span",{className:"text-[10px] text-status-success animate-pulse",children:[s("discussions.round")," ",o.current_round,"/",o.max_rounds]}),t&&d.jsx("span",{className:"ml-auto inline-flex items-center gap-1 text-xs text-status-success",children:d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-status-success animate-pulse"})})]}),d.jsxs("div",{className:"mb-4 rounded-xl border border-warm-150 bg-warm-50/80 p-4",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{className:"min-w-0",children:[d.jsx("h1",{className:"text-lg font-semibold text-warm-800",children:o.title}),d.jsx("p",{className:"mt-2 whitespace-pre-wrap text-sm leading-relaxed text-warm-500",children:o.description})]}),_e&&d.jsx("button",{onClick:()=>_(!0),className:"btn-secondary text-xs py-2 flex-shrink-0",children:s("todo.edit")})]}),d.jsxs("div",{className:"mt-3 flex flex-wrap gap-3 text-[11px] text-warm-400",children:[d.jsxs("span",{children:[s("discussions.maxRounds"),": ",o.max_rounds]}),d.jsxs("span",{children:[s("discussions.agents"),": ",o.agents.map(se=>se.name).join(", ")||"-"]}),d.jsxs("span",{children:[s("discussions.autoImplement"),": ",o.auto_implement?l==="ko"?"사용":"Enabled":l==="ko"?"사용 안 함":"Disabled"]})]}),B&&d.jsx("p",{className:"mt-3 text-xs text-status-error",children:B})]}),o.status==="failed"&&(()=>{const se=o.messages.find(Te=>Te.status==="failed"),Ee=se?te.get(se.agent_id):null;return d.jsxs("div",{className:"mb-4 rounded-xl border border-status-error/30 bg-status-error/5 overflow-hidden animate-slide-up",children:[d.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 bg-status-error/10 border-b border-status-error/20",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("svg",{className:"h-4 w-4 text-status-error",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})}),d.jsx("h4",{className:"text-xs font-semibold text-status-error uppercase tracking-wider",children:s("discussions.failureTitle")}),Ee&&d.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-mono px-1.5 py-0.5 rounded bg-status-error/15 text-status-error",children:[d.jsx("span",{className:"w-3 h-3 rounded-full inline-block",style:{backgroundColor:Ee.avatar_color||"#94a3b8"}}),Ee.name]}),se&&d.jsxs("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-status-error/15 text-status-error",children:[s("discussions.round")," ",se.round_number]})]}),d.jsxs("button",{onClick:X,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-status-success/15 text-status-success hover:bg-status-success/25 border border-status-success/30 transition-colors",children:[d.jsx("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h4.586M20 20v-5h-4.586M4.929 9A8 8 0 0119.071 9M19.071 15A8 8 0 014.929 15"})}),s("discussions.retry")]})]}),d.jsx("div",{className:"px-4 py-3 space-y-1.5 max-h-48 overflow-y-auto",children:L.length>0?L.map(Te=>d.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[d.jsx("span",{className:"text-warm-500 font-mono flex-shrink-0",children:new Date(Te.created_at).toLocaleTimeString()}),d.jsx("span",{className:"text-status-error font-mono whitespace-pre-wrap break-all",children:Te.message})]},Te.id)):d.jsx("span",{className:"text-xs text-warm-400 italic",children:s("discussions.noErrorLogs")})})]})})(),d.jsxs("div",{className:"flex items-center gap-2 mb-4 flex-wrap",children:[ne&&d.jsxs("button",{onClick:X,className:"btn-primary text-sm",children:[d.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M8 5v14l11-7z"})}),o.status==="pending"?s("header.runAll"):s("discussions.resume")]}),W&&d.jsxs("button",{onClick:K,className:"btn-danger text-sm",children:[d.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}),s("discussions.pause")]}),W&&d.jsx("button",{onClick:z,className:"btn btn-sm text-xs text-warm-500",children:s("discussions.skipTurn")}),Y&&d.jsxs("button",{onClick:()=>k(!0),className:"btn-primary text-sm",children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),s("discussions.implement")]}),ae&&o.branch_name&&d.jsxs("button",{onClick:Q,className:"btn-primary text-sm",children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})}),s("todos.merge")]}),ke&&d.jsxs("button",{onClick:I,className:"btn-danger text-sm",children:[d.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"})}),s("todo.cleanup")]}),o.messages.some(se=>se.content&&se.status==="completed")&&d.jsx("button",{onClick:T.size>0?O:q,className:"btn btn-sm text-xs text-warm-500",children:T.size>0?s("discussions.expandAll"):s("discussions.collapseAll")}),d.jsx("div",{className:"ml-auto flex items-center gap-1",children:o.agents.map(se=>d.jsx("div",{className:`w-7 h-7 rounded-full flex items-center justify-center text-white text-[10px] font-bold transition-all ${o.current_agent_id===se.id?"ring-2 ring-status-success ring-offset-1 scale-110":"opacity-60"}`,style:{backgroundColor:se.avatar_color||"#6366f1"},title:`${se.name} (${se.role})`,children:se.name.charAt(0)},se.id))})]}),d.jsxs("div",{className:"flex-1 overflow-y-auto space-y-1 pb-4",children:[Ae.map(se=>{const Ee=Se.get(se),Te=se>o.max_rounds;return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-3 my-4",children:[d.jsx("div",{className:"flex-1 h-px bg-warm-200"}),d.jsx("span",{className:"text-[10px] font-semibold text-warm-400 uppercase tracking-wider",children:Te?s("discussions.implementation"):`${s("discussions.round")} ${se}`}),d.jsx("div",{className:"flex-1 h-px bg-warm-200"})]}),Ee.map(Me=>{const we=te.get(Me.agent_id),De=Me.agent_id==="user",Be=Me.status==="running",ie=x.get(Me.id)||[],xe=T.has(Me.id),J=!!Me.content&&Me.status==="completed"&&!De;return d.jsxs("div",{className:`flex gap-3 py-3 ${De?"justify-end":""}`,children:[!De&&d.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center text-white text-xs font-bold flex-shrink-0 ${Be?"ring-2 ring-status-success ring-offset-1 animate-pulse":""}`,style:{backgroundColor:(we==null?void 0:we.avatar_color)||"#94a3b8"},children:Me.agent_name.charAt(0)}),d.jsxs("div",{className:`flex-1 min-w-0 ${De?"max-w-[80%]":""}`,children:[!De&&d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[d.jsx("span",{className:"text-xs font-semibold text-warm-700",children:Me.agent_name}),d.jsx("span",{className:"text-[10px] text-warm-400",children:s(`agents.roles.${Me.role}`)||Me.role}),Me.status==="skipped"&&d.jsx("span",{className:"text-[10px] text-warm-300 italic",children:s("status.skipped")}),J&&d.jsxs("button",{onClick:()=>G(Me.id),className:"text-[10px] text-warm-300 hover:text-accent transition-colors flex items-center gap-0.5",children:[d.jsx("svg",{className:`w-3 h-3 transition-transform ${xe?"":"rotate-90"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),s(xe?"discussions.expand":"discussions.collapse")]})]}),d.jsxs("div",{className:`rounded-xl p-3 text-sm ${De?"bg-accent/10 text-warm-700 ml-auto":Me.status==="failed"?"bg-status-error/5 border border-status-error/20":"bg-warm-50 border border-warm-150"} ${J?"cursor-pointer":""}`,onClick:J?()=>{const fe=window.getSelection();fe&&fe.toString().length>0||G(Me.id)}:void 0,children:[xe&&Me.content&&d.jsx("div",{className:"text-xs text-warm-400 italic truncate",children:D(Me.content)}),!xe&&Me.content&&d.jsx(FW,{content:Me.content}),Be&&ie.length>0&&d.jsx("div",{className:"text-xs text-warm-500 whitespace-pre-wrap leading-relaxed max-h-60 overflow-y-auto font-mono",children:ie.slice(-50).join(`
134
+ `)}),Be&&ie.length===0&&d.jsxs("div",{className:"flex items-center gap-2 text-xs text-status-success",children:[d.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-status-success animate-pulse"}),s("discussions.speaking")]}),Me.status==="pending"&&!Me.content&&d.jsx("div",{className:"text-xs text-warm-300 italic",children:s("discussions.waiting")})]})]}),De&&d.jsx("div",{className:"w-8 h-8 rounded-full bg-warm-300 flex items-center justify-center text-white text-xs font-bold flex-shrink-0",children:"U"})]},Me.id)})]},se)}),d.jsx("div",{ref:F})]}),he&&d.jsxs("div",{className:"border-t border-warm-200 pt-3 flex gap-2",children:[d.jsx("input",{type:"text",value:w,onChange:se=>j(se.target.value),onKeyDown:se=>{se.key==="Enter"&&!se.shiftKey&&(se.preventDefault(),Z())},placeholder:s("discussions.userMessage"),className:"input flex-1 text-sm"}),d.jsx("button",{onClick:Z,disabled:!w.trim(),className:"btn btn-primary btn-sm text-xs",children:s("discussions.inject")})]}),N&&d.jsx("div",{className:"fixed inset-0 bg-black/30 flex items-center justify-center z-50 px-4",onClick:()=>_(!1),children:d.jsx("div",{className:"w-full max-w-2xl max-h-[90vh] overflow-y-auto",onClick:se=>se.stopPropagation(),children:d.jsx(DA,{agents:oe?f:o.agents,initialValues:je,mode:"edit",allowAdvancedFields:oe,submitting:E,onSubmit:V,onCancel:()=>_(!1)})})}),S&&d.jsx("div",{className:"fixed inset-0 bg-black/30 flex items-center justify-center z-50",onClick:()=>k(!1),children:d.jsxs("div",{className:"bg-theme-card rounded-xl p-6 w-80 shadow-xl space-y-4",onClick:se=>se.stopPropagation(),children:[d.jsx("h3",{className:"text-sm font-semibold text-warm-700",children:s("discussions.selectAgent")}),d.jsx("p",{className:"text-xs text-warm-400",children:s("discussions.implementHint")}),d.jsx("div",{className:"space-y-2",children:o.agents.map(se=>d.jsxs("button",{onClick:()=>$(se.id),className:"w-full flex items-center gap-3 p-3 rounded-lg border border-warm-200 hover:border-accent hover:bg-accent/5 transition-colors",children:[d.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-white text-xs font-bold",style:{backgroundColor:se.avatar_color||"#6366f1"},children:se.name.charAt(0)}),d.jsxs("div",{className:"text-left",children:[d.jsx("div",{className:"text-sm font-medium text-warm-700",children:se.name}),d.jsx("div",{className:"text-xs text-warm-400",children:s(`agents.roles.${se.role}`)||se.role})]})]},se.id))}),d.jsx("button",{onClick:()=>k(!1),className:"btn btn-sm text-xs text-warm-500 w-full",children:s("header.cancel")})]})})]})}function VW(){const{authenticated:e,authRequired:t,loading:n,login:a,logout:s}=OD(),{connected:l,onEvent:o,sendMessage:c}=zD(e),{t:f}=Ue();return n?d.jsx("div",{className:"min-h-screen flex items-center justify-center",style:{backgroundColor:"var(--color-bg-primary)"},children:d.jsx("div",{className:"font-medium text-lg animate-fade-in",style:{color:"var(--color-text-muted)"},children:f("detail.loading")})}):e?d.jsx(wD,{children:d.jsx(fO,{onLogout:s,authRequired:t,connected:l,onEvent:o,children:d.jsxs(WL,{children:[d.jsx(Gl,{path:"/",element:d.jsx(gO,{onEvent:o})}),d.jsx(Gl,{path:"/projects/:id",element:d.jsx(d$,{onEvent:o,connected:l,sendMessage:c})}),d.jsx(Gl,{path:"/projects/:id/pipelines/:pipelineId",element:d.jsx(x$,{onEvent:o,connected:l})}),d.jsx(Gl,{path:"/projects/:id/discussions/:discussionId",element:d.jsx(GW,{onEvent:o,connected:l})})]})})}):d.jsx(HD,{onLogin:a})}function YW(e){return rt(`/api/jira/${e}/test`)}function XW(e,t){const n=new URLSearchParams;t!=null&&t.status&&n.set("status",t.status),t!=null&&t.search&&n.set("search",t.search),n.set("maxResults",String(t.maxResults)),t!=null&&t.startAt&&n.set("startAt",String(t.startAt));const a=n.toString();return rt(`/api/jira/${e}/issues${a?`?${a}`:""}`)}function oE(e,t){return rt(`/api/jira/${e}/issue/${t}/transitions`)}function KW(e,t,n){return qe(`/api/jira/${e}/issue/${t}/transition`,{transitionId:n})}function WW(e,t,n){return qe(`/api/jira/${e}/issue/${t}/comment`,{body:n})}function QW(e,t){return qe(`/api/jira/${e}/issues`,t)}function ZW(e,t){return qe(`/api/jira/${e}/import/${t}`)}function JW(e){return rt(`/api/jira/${e}/statuses`)}function eQ({project:e,onImportAsTask:t}){const{t:n}=Ue(),[a,s]=C.useState([]),[l,o]=C.useState(!1),[c,f]=C.useState(0),[h,g]=C.useState(0),[p,x]=C.useState(""),[y,w]=C.useState("all"),[j,S]=C.useState([]),[k,N]=C.useState(null),[_,E]=C.useState(null),[M,T]=C.useState(null),[R,B]=C.useState(!1),P=e.jira_enabled&&e.jira_base_url&&e.jira_email&&e.jira_api_token,L=C.useCallback(async(G=!1)=>{if(P){o(!0);try{const q=G?0:h,O=await XW(e.id,{status:y!=="all"?y:void 0,search:p||void 0,maxResults:20,startAt:q});G?(s(O.issues),g(O.issues.length)):(s(D=>[...D,...O.issues]),g(q+O.issues.length)),f(O.total)}catch{}finally{o(!1)}}},[e.id,P,y,p,h]);C.useEffect(()=>{L(!0)},[e.id,P,y]),C.useEffect(()=>{P&&JW(e.id).then(S).catch(()=>{})},[e.id,P]);const H=()=>{L(!0)},F=async G=>{N(G);try{const q=await ZW(e.id,G);t(q.title,q.description),E(G),setTimeout(()=>E(null),2e3)}catch{}finally{N(null)}};return P?d.jsxs("div",{className:"animate-fade-in",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h2",{className:"text-sm font-semibold text-warm-700",children:n("jira.title")}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:()=>B(!R),className:"btn-primary text-xs",children:n("jira.createIssue")}),d.jsx("button",{onClick:()=>L(!0),disabled:l,className:"btn-ghost text-xs",children:n("jira.refresh")})]})]}),R&&d.jsx(rQ,{projectId:e.id,onCreated:()=>{B(!1),L(!0)},onCancel:()=>B(!1)}),d.jsxs("div",{className:"flex gap-2 mb-4",children:[d.jsxs("div",{className:"flex-1 relative",children:[d.jsx("input",{type:"text",value:p,onChange:G=>x(G.target.value),onKeyDown:G=>G.key==="Enter"&&H(),placeholder:n("jira.search"),className:"input-field text-xs pr-8"}),d.jsx("button",{onClick:H,className:"absolute right-2 top-1/2 -translate-y-1/2 text-warm-400 hover:text-warm-600",children:d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})})]}),d.jsxs("select",{value:y,onChange:G=>w(G.target.value),className:"input-field text-xs w-36",children:[d.jsx("option",{value:"all",children:n("jira.allStatuses")}),j.map(G=>d.jsx("option",{value:G,children:G},G))]})]}),c>0&&d.jsxs("p",{className:"text-xs text-warm-400 mb-3",children:[c," ",n("jira.total")]}),a.length===0&&!l&&d.jsxs("div",{className:"card p-10 text-center",children:[d.jsx("p",{className:"text-warm-400 text-sm",children:n("jira.noIssues")}),d.jsx("p",{className:"text-warm-300 text-xs mt-1",children:n("jira.noIssuesHint")})]}),d.jsx("div",{className:"space-y-2",children:a.map(G=>d.jsx(tQ,{issue:G,projectId:e.id,expanded:M===G.key,onToggle:()=>T(M===G.key?null:G.key),importing:k===G.key,imported:_===G.key,onImport:()=>F(G.key)},G.key))}),a.length<c&&d.jsx("div",{className:"mt-4 text-center",children:d.jsx("button",{onClick:()=>L(!1),disabled:l,className:"btn-ghost text-xs",children:l?"...":n("jira.loadMore")})})]}):d.jsxs("div",{className:"card p-16 text-center animate-fade-in",children:[d.jsx("div",{className:"text-warm-300 mb-3",children:d.jsx("svg",{className:"w-12 h-12 mx-auto",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})})}),d.jsx("p",{className:"text-warm-400 text-sm",children:n("jira.notConfigured")})]})}function tQ({issue:e,projectId:t,expanded:n,onToggle:a,importing:s,imported:l,onImport:o}){var h,g;const{t:c}=Ue(),f=aQ((h=e.fields.status.statusCategory)==null?void 0:h.colorName);return d.jsxs("div",{className:"card p-3 hover:shadow-md transition-shadow",children:[d.jsxs("div",{className:"flex items-start gap-3",children:[e.fields.issuetype.iconUrl&&d.jsx("img",{src:e.fields.issuetype.iconUrl,alt:e.fields.issuetype.name,className:"w-4 h-4 mt-0.5 flex-shrink-0"}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{onClick:a,className:"text-xs font-mono text-blue-600 hover:text-blue-800 font-medium flex-shrink-0",children:e.key}),d.jsx("span",{className:"text-xs text-warm-700 truncate",children:e.fields.summary})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-1.5",children:[d.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium ${f}`,children:e.fields.status.name}),e.fields.priority&&d.jsxs("span",{className:"text-[10px] text-warm-400 flex items-center gap-1",children:[e.fields.priority.iconUrl&&d.jsx("img",{src:e.fields.priority.iconUrl,alt:"",className:"w-3 h-3"}),e.fields.priority.name]}),d.jsx("span",{className:"text-[10px] text-warm-300",children:((g=e.fields.assignee)==null?void 0:g.displayName)||c("jira.unassigned")}),e.fields.labels.length>0&&d.jsx("span",{className:"text-[10px] text-warm-300",children:e.fields.labels.join(", ")}),d.jsx("span",{className:"text-[10px] text-warm-300 ml-auto",children:new Date(e.fields.updated).toLocaleDateString()})]})]}),d.jsx("button",{onClick:o,disabled:s||l,className:`flex-shrink-0 text-xs px-2 py-1 rounded-lg font-medium transition-colors ${l?"bg-status-success/10 text-status-success":"bg-blue-50 text-blue-600 hover:bg-blue-100"}`,title:c("jira.import"),children:c(s?"jira.importing":l?"jira.imported":"jira.import")})]}),n&&d.jsx(nQ,{issueKey:e.key,projectId:t})]})}function nQ({issueKey:e,projectId:t}){const{t:n}=Ue(),[a,s]=C.useState([]),[l,o]=C.useState(!1),[c,f]=C.useState(""),[h,g]=C.useState(!1);C.useEffect(()=>{oE(t,e).then(y=>s(y.transitions)).catch(()=>{})},[t,e]);const p=async y=>{o(!0);try{await KW(t,e,y);const w=await oE(t,e);s(w.transitions)}catch{}finally{o(!1)}},x=async()=>{if(c.trim()){g(!0);try{await WW(t,e,c),f("")}catch{}finally{g(!1)}}};return d.jsxs("div",{className:"mt-3 pt-3 border-t border-warm-100 space-y-3 animate-slide-up",children:[a.length>0&&d.jsxs("div",{children:[d.jsx("p",{className:"text-[10px] font-medium text-warm-500 mb-1.5",children:n("jira.transition")}),d.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map(y=>d.jsx("button",{onClick:()=>p(y.id),disabled:l,className:"text-[10px] px-2 py-1 rounded-md bg-warm-50 text-warm-600 hover:bg-warm-100 transition-colors font-medium",children:y.name},y.id))})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-[10px] font-medium text-warm-500 mb-1.5",children:n("jira.comment")}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("input",{type:"text",value:c,onChange:y=>f(y.target.value),onKeyDown:y=>y.key==="Enter"&&x(),placeholder:n("jira.commentPlaceholder"),className:"input-field text-xs flex-1"}),d.jsx("button",{onClick:x,disabled:h||!c.trim(),className:"btn-primary text-xs",children:h?"...":n("jira.commentSend")})]})]})]})}function rQ({projectId:e,onCreated:t,onCancel:n}){const{t:a}=Ue(),[s,l]=C.useState(""),[o,c]=C.useState(""),[f,h]=C.useState("Task"),[g,p]=C.useState(!1),x=async()=>{if(s.trim()){p(!0);try{await QW(e,{summary:s,description:o||void 0,issueType:f}),t()}catch{}finally{p(!1)}}};return d.jsx("div",{className:"card p-4 mb-4 animate-slide-up",children:d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-1",children:a("jira.createSummary")}),d.jsx("input",{type:"text",value:s,onChange:y=>l(y.target.value),className:"input-field text-xs",autoFocus:!0})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-1",children:a("jira.createDesc")}),d.jsx("textarea",{value:o,onChange:y=>c(y.target.value),className:"input-field text-xs",rows:3})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-1",children:a("jira.createType")}),d.jsxs("select",{value:f,onChange:y=>h(y.target.value),className:"input-field text-xs w-40",children:[d.jsx("option",{value:"Task",children:"Task"}),d.jsx("option",{value:"Bug",children:"Bug"}),d.jsx("option",{value:"Story",children:"Story"}),d.jsx("option",{value:"Epic",children:"Epic"})]})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx("button",{onClick:n,className:"btn-ghost text-xs",children:a("header.cancel")}),d.jsx("button",{onClick:x,disabled:g||!s.trim(),className:"btn-primary text-xs",children:a(g?"jira.creating":"jira.createIssue")})]})]})})}function aQ(e){switch(e){case"blue-gray":case"default":return"bg-warm-100 text-warm-600";case"blue":return"bg-blue-100 text-blue-700";case"green":return"bg-status-success/10 text-status-success";case"yellow":return"bg-amber-100 text-amber-700";default:return"bg-warm-100 text-warm-600"}}function iQ({project:e,config:t,onConfigChange:n}){const{t:a}=Ue(),[s,l]=C.useState(!1),[o,c]=C.useState(null),[f,h]=C.useState(!1),g=t.enabled==="1"||t.enabled===!0,p=async()=>{l(!0),c(null);try{const x=await YW(e.id);c(x.ok?"ok":"fail")}catch{c("fail")}finally{l(!1)}};return d.jsxs("div",{className:"p-4 border border-warm-200 rounded-xl",children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("h4",{className:"text-sm font-semibold text-warm-700",children:a("header.jiraTitle")}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:g,onChange:x=>n({enabled:x.target.checked?"1":"0"}),className:"sr-only peer"}),d.jsx("div",{className:"w-9 h-5 bg-warm-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-warm-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-status-success"})]})]}),d.jsx("p",{className:"text-xs text-warm-400 mb-3",children:a("header.jiraDesc")}),g&&d.jsxs("div",{className:"space-y-3",children:[d.jsxs("button",{type:"button",onClick:()=>h(!f),className:"flex items-center gap-1 text-xs text-accent-dark hover:text-accent transition-colors",children:[d.jsx("span",{className:`inline-block transition-transform ${f?"rotate-90":""}`,children:"▶"}),a("header.jiraGuideToggle")]}),f&&d.jsxs("div",{className:"p-3 bg-warm-50 border border-warm-150 rounded-lg text-xs text-warm-600 space-y-2",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-semibold text-warm-700 mb-1",children:a("header.jiraGuidePrep")}),d.jsxs("ol",{className:"list-decimal list-inside space-y-0.5 ml-1",children:[d.jsx("li",{children:a("header.jiraGuideStep1")}),d.jsx("li",{children:a("header.jiraGuideStep2")})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-semibold text-warm-700 mb-1",children:a("header.jiraGuideSetup")}),d.jsxs("ol",{className:"list-decimal list-inside space-y-0.5 ml-1",children:[d.jsx("li",{children:a("header.jiraGuideSetup1")}),d.jsx("li",{children:a("header.jiraGuideSetup2")}),d.jsx("li",{children:a("header.jiraGuideSetup3")})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-semibold text-warm-700 mb-1",children:a("header.jiraGuideUsage")}),d.jsxs("ol",{className:"list-decimal list-inside space-y-0.5 ml-1",children:[d.jsx("li",{children:a("header.jiraGuideUsage1")}),d.jsx("li",{children:a("header.jiraGuideUsage2")}),d.jsx("li",{children:a("header.jiraGuideUsage3")})]})]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:a("header.jiraBaseUrl")}),d.jsx("input",{type:"text",value:t.base_url??"",onChange:x=>n({base_url:x.target.value||null}),placeholder:a("header.jiraBaseUrlPlaceholder"),className:"w-full px-3 py-1.5 text-xs border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:a("header.jiraProjectKey")}),d.jsx("input",{type:"text",value:t.project_key??"",onChange:x=>n({project_key:x.target.value||null}),placeholder:a("header.jiraProjectKeyPlaceholder"),className:"w-full px-3 py-1.5 text-xs border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:a("header.jiraEmail")}),d.jsx("input",{type:"text",value:t.email??"",onChange:x=>n({email:x.target.value||null}),placeholder:a("header.jiraEmailPlaceholder"),className:"w-full px-3 py-1.5 text-xs border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:a("header.jiraApiToken")}),d.jsx("input",{type:"password",value:t.api_token??"",onChange:x=>n({api_token:x.target.value||null}),placeholder:a("header.jiraApiTokenPlaceholder"),className:"w-full px-3 py-1.5 text-xs border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent"})]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{onClick:p,disabled:s,className:"px-3 py-1 text-xs rounded-lg bg-warm-100 text-warm-600 hover:bg-warm-200 disabled:opacity-50 transition-colors",children:a(s?"header.jiraTesting":"header.jiraTestConnection")}),o==="ok"&&d.jsx("span",{className:"text-xs text-status-success font-medium",children:a("header.jiraConnected")}),o==="fail"&&d.jsx("span",{className:"text-xs text-status-error font-medium",children:a("header.jiraFailed")})]}),d.jsx("p",{className:"text-xs text-warm-300",children:a("header.jiraTokenHint")})]})]})}const sQ={id:"jira",displayName:"Jira",displayNameKo:"Jira",PanelComponent:eQ,SettingsComponent:iQ,hasTab:!0,isEnabled:e=>!!e.jira_enabled,translations:{en:{"tabs.jira":"Jira","jira.title":"Jira Issues","jira.search":"Search issues...","jira.allStatuses":"All Statuses","jira.refresh":"Refresh","jira.import":"Import as Task","jira.importing":"Importing...","jira.imported":"Imported!","jira.noIssues":"No issues found","jira.noIssuesHint":"Try changing the filter or search query.","jira.loadMore":"Load More","jira.total":"total","jira.transition":"Change Status","jira.comment":"Comment","jira.commentPlaceholder":"Add a comment...","jira.commentSend":"Send","jira.createIssue":"Create Issue","jira.createSummary":"Summary","jira.createDesc":"Description","jira.createType":"Issue Type","jira.creating":"Creating...","jira.notConfigured":"Jira is not configured. Enable it in project settings.","jira.assignee":"Assignee","jira.unassigned":"Unassigned","jira.updated":"Updated","header.jiraTitle":"Jira Integration","header.jiraBaseUrl":"Jira URL","header.jiraBaseUrlPlaceholder":"https://your-domain.atlassian.net","header.jiraProjectKey":"Project Key","header.jiraProjectKeyPlaceholder":"e.g. PROJ","header.jiraEmail":"Email","header.jiraEmailPlaceholder":"your@email.com","header.jiraApiToken":"API Token","header.jiraApiTokenPlaceholder":"Jira API token","header.jiraTestConnection":"Test Connection","header.jiraTesting":"Testing...","header.jiraConnected":"Connected!","header.jiraFailed":"Connection failed","header.jiraTokenHint":"Create a token at id.atlassian.com/manage-profile/security/api-tokens","header.jiraDesc":"Browse Jira issues and import them as AI tasks.","header.jiraGuideToggle":"Setup Guide","header.jiraGuidePrep":"Prerequisites","header.jiraGuideStep1":"Go to id.atlassian.com/manage-profile/security/api-tokens and create an API token","header.jiraGuideStep2":"Note your Jira URL (e.g. https://your-domain.atlassian.net) and project key (e.g. PROJ)","header.jiraGuideSetup":"Configuration","header.jiraGuideSetup1":"Enter Jira URL, project key, email, and API token above","header.jiraGuideSetup2":'Click "Test Connection" to verify',"header.jiraGuideSetup3":"Save settings","header.jiraGuideUsage":"Usage","header.jiraGuideUsage1":"Open the Jira tab in the project detail page","header.jiraGuideUsage2":"Browse, search, or filter issues by status","header.jiraGuideUsage3":'Click "Import as Task" to create an AI task from a Jira issue'},ko:{"tabs.jira":"Jira","jira.title":"Jira 이슈","jira.search":"이슈 검색...","jira.allStatuses":"모든 상태","jira.refresh":"새로고침","jira.import":"작업으로 가져오기","jira.importing":"가져오는 중...","jira.imported":"가져옴!","jira.noIssues":"이슈가 없습니다","jira.noIssuesHint":"필터나 검색어를 변경해보세요.","jira.loadMore":"더 보기","jira.total":"건","jira.transition":"상태 변경","jira.comment":"댓글","jira.commentPlaceholder":"댓글 입력...","jira.commentSend":"전송","jira.createIssue":"이슈 생성","jira.createSummary":"제목","jira.createDesc":"설명","jira.createType":"이슈 유형","jira.creating":"생성 중...","jira.notConfigured":"Jira가 설정되지 않았습니다. 프로젝트 설정에서 활성화하세요.","jira.assignee":"담당자","jira.unassigned":"미배정","jira.updated":"업데이트","header.jiraTitle":"Jira 연동","header.jiraBaseUrl":"Jira URL","header.jiraBaseUrlPlaceholder":"https://your-domain.atlassian.net","header.jiraProjectKey":"프로젝트 키","header.jiraProjectKeyPlaceholder":"예: PROJ","header.jiraEmail":"이메일","header.jiraEmailPlaceholder":"your@email.com","header.jiraApiToken":"API 토큰","header.jiraApiTokenPlaceholder":"Jira API 토큰","header.jiraTestConnection":"연결 테스트","header.jiraTesting":"테스트 중...","header.jiraConnected":"연결 성공!","header.jiraFailed":"연결 실패","header.jiraTokenHint":"id.atlassian.com/manage-profile/security/api-tokens에서 토큰을 생성하세요","header.jiraDesc":"Jira 이슈를 조회하고 AI 태스크로 가져옵니다.","header.jiraGuideToggle":"설정 가이드","header.jiraGuidePrep":"사전 준비","header.jiraGuideStep1":"id.atlassian.com/manage-profile/security/api-tokens에서 API 토큰 생성","header.jiraGuideStep2":"Jira URL (예: https://your-domain.atlassian.net)과 프로젝트 키 (예: PROJ) 확인","header.jiraGuideSetup":"설정 방법","header.jiraGuideSetup1":"위 입력란에 Jira URL, 프로젝트 키, 이메일, API 토큰 입력","header.jiraGuideSetup2":'"연결 테스트" 클릭하여 연결 확인',"header.jiraGuideSetup3":"설정 저장","header.jiraGuideUsage":"사용법","header.jiraGuideUsage1":"프로젝트 상세 페이지에서 Jira 탭 진입","header.jiraGuideUsage2":"이슈 검색, 상태 필터링","header.jiraGuideUsage3":'"작업으로 가져오기" 클릭하여 AI 태스크 생성'}}};function lQ(e){return rt(`/api/github/${e}/test`)}function oQ(e,t){const n=new URLSearchParams;t!=null&&t.state&&n.set("state",t.state),t!=null&&t.page&&n.set("page",String(t.page)),n.set("per_page",String(t.per_page)),t!=null&&t.labels&&n.set("labels",t.labels),t!=null&&t.search&&n.set("search",t.search);const a=n.toString();return rt(`/api/github/${e}/issues${a?`?${a}`:""}`)}function uQ(e,t){return rt(`/api/github/${e}/issue/${t}/comments`)}function cQ(e,t){return qe(`/api/github/${e}/issues`,t)}function dQ(e,t){return qe(`/api/github/${e}/import/${t}`)}function fQ({project:e,onImportAsTask:t}){const{t:n}=Ue(),[a,s]=C.useState([]),[l,o]=C.useState(!1),[c,f]=C.useState(1),[h,g]=C.useState(!1),[p,x]=C.useState(""),[y,w]=C.useState("open"),[j,S]=C.useState(null),[k,N]=C.useState(null),[_,E]=C.useState(null),[M,T]=C.useState(!1),R=e.github_enabled&&e.github_token&&e.github_owner&&e.github_repo,B=C.useCallback(async(F=!1)=>{if(R){o(!0);try{const G=F?1:c,q=await oQ(e.id,{state:y,page:G,per_page:20,search:p||void 0});F?(s(q.items),f(1)):s(O=>[...O,...q.items]),g(q.items.length>=20)}catch{}finally{o(!1)}}},[e.id,R,p,y,c]);C.useEffect(()=>{B(!0)},[e.id,R,y]);const P=()=>{B(!0)},L=()=>{f(F=>F+1),setTimeout(()=>B(!1),0)},H=async F=>{S(F);try{const G=await dQ(e.id,F);t(G.title,G.description),N(F),setTimeout(()=>N(null),2e3)}catch{}finally{S(null)}};return R?d.jsxs("div",{className:"animate-fade-in",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h2",{className:"text-sm font-semibold text-warm-700",children:n("github.title")}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:()=>T(!M),className:"btn-primary text-xs",children:n("github.createIssue")}),d.jsx("button",{onClick:()=>B(!0),disabled:l,className:"btn-ghost text-xs",children:n("github.refresh")})]})]}),M&&d.jsx(pQ,{projectId:e.id,onCreated:()=>{T(!1),B(!0)},onCancel:()=>T(!1)}),d.jsxs("div",{className:"flex gap-2 mb-4",children:[d.jsxs("select",{value:y,onChange:F=>w(F.target.value),className:"input-field text-xs w-24",children:[d.jsx("option",{value:"open",children:n("github.open")}),d.jsx("option",{value:"closed",children:n("github.closed")}),d.jsx("option",{value:"all",children:n("github.all")})]}),d.jsxs("div",{className:"flex-1 relative",children:[d.jsx("input",{type:"text",value:p,onChange:F=>x(F.target.value),onKeyDown:F=>F.key==="Enter"&&P(),placeholder:n("github.search"),className:"input-field text-xs pr-8"}),d.jsx("button",{onClick:P,className:"absolute right-2 top-1/2 -translate-y-1/2 text-warm-400 hover:text-warm-600",children:d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})})]})]}),a.length===0&&!l&&d.jsxs("div",{className:"card p-10 text-center",children:[d.jsx("p",{className:"text-warm-400 text-sm",children:n("github.noIssues")}),d.jsx("p",{className:"text-warm-300 text-xs mt-1",children:n("github.noIssuesHint")})]}),d.jsx("div",{className:"space-y-2",children:a.map(F=>d.jsx(hQ,{issue:F,projectId:e.id,expanded:_===F.number,onToggle:()=>E(_===F.number?null:F.number),importing:j===F.number,imported:k===F.number,onImport:()=>H(F.number)},F.number))}),h&&d.jsx("div",{className:"mt-4 text-center",children:d.jsx("button",{onClick:L,disabled:l,className:"btn-ghost text-xs",children:l?"...":n("github.loadMore")})})]}):d.jsxs("div",{className:"card p-16 text-center animate-fade-in",children:[d.jsx("div",{className:"text-warm-300 mb-3",children:d.jsx("svg",{className:"w-12 h-12 mx-auto",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.009-.866-.013-1.7-2.782.604-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.463-1.11-1.463-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.831.092-.646.35-1.086.636-1.336-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.564 9.564 0 0112 6.844a9.59 9.59 0 012.504.337c1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.161 22 16.416 22 12c0-5.523-4.477-10-10-10z"})})}),d.jsx("p",{className:"text-warm-400 text-sm",children:n("github.notConfigured")})]})}function hQ({issue:e,projectId:t,expanded:n,onToggle:a,importing:s,imported:l,onImport:o}){const{t:c}=Ue(),f=new Date(e.updated_at).toLocaleDateString();return d.jsxs("div",{className:"card p-3 hover:shadow-md transition-shadow",children:[d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{className:`w-4 h-4 mt-0.5 flex-shrink-0 ${e.state==="open"?"text-status-success":"text-purple-500"}`,children:e.state==="open"?d.jsxs("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[d.jsx("circle",{cx:"12",cy:"12",r:"9"}),d.jsx("circle",{cx:"12",cy:"12",r:"4",fill:"currentColor"})]}):d.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"flex items-center gap-2",children:d.jsxs("button",{onClick:a,className:"text-xs font-medium text-blue-600 hover:text-blue-800 truncate text-left",children:["#",e.number," ",e.title]})}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-1.5",children:[e.labels.map(h=>d.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium",style:{backgroundColor:`#${h.color}20`,color:`#${h.color}`},children:h.name},h.name)),e.user&&d.jsx("span",{className:"text-[10px] text-warm-400",children:e.user.login}),e.comments>0&&d.jsxs("span",{className:"text-[10px] text-warm-400",children:[e.comments," comments"]}),d.jsx("span",{className:"text-[10px] text-warm-300 ml-auto",children:f})]})]}),d.jsx("button",{onClick:o,disabled:s||l,className:`flex-shrink-0 text-xs px-2 py-1 rounded-lg font-medium transition-colors ${l?"bg-status-success/10 text-status-success":"bg-blue-50 text-blue-600 hover:bg-blue-100"}`,title:c("github.import"),children:c(s?"github.importing":l?"github.imported":"github.import")})]}),n&&d.jsx(mQ,{issueNumber:e.number,projectId:t,body:e.body})]})}function mQ({issueNumber:e,projectId:t,body:n}){const{t:a}=Ue(),[s,l]=C.useState([]),[o,c]=C.useState(!0);return C.useEffect(()=>{c(!0),uQ(t,e).then(f=>l(f||[])).catch(()=>{}).finally(()=>c(!1))},[t,e]),d.jsxs("div",{className:"mt-3 pt-3 border-t border-warm-100 space-y-2 animate-slide-up max-h-64 overflow-y-auto",children:[n?d.jsx("div",{className:"text-xs text-warm-500 whitespace-pre-wrap break-words",children:n}):d.jsx("p",{className:"text-xs text-warm-400 italic",children:a("github.noBody")}),o?d.jsx("p",{className:"text-xs text-warm-400",children:a("github.loadingComments")}):s.length>0?d.jsxs("div",{className:"space-y-2 mt-2",children:[d.jsx("p",{className:"text-[10px] font-semibold text-warm-500 uppercase",children:a("github.comments")}),s.map(f=>{var h;return d.jsxs("div",{className:"pl-3 border-l-2 border-warm-100",children:[d.jsx("p",{className:"text-[10px] text-warm-400 font-medium",children:(h=f.user)==null?void 0:h.login}),d.jsx("p",{className:"text-xs text-warm-500 whitespace-pre-wrap break-words",children:f.body})]},f.id)})]}):null]})}function pQ({projectId:e,onCreated:t,onCancel:n}){const{t:a}=Ue(),[s,l]=C.useState(""),[o,c]=C.useState(""),[f,h]=C.useState(!1),g=async()=>{if(s.trim()){h(!0);try{await cQ(e,{title:s,body:o||void 0}),t()}catch{}finally{h(!1)}}};return d.jsx("div",{className:"card p-4 mb-4 animate-slide-up",children:d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-1",children:a("github.issueTitle")}),d.jsx("input",{type:"text",value:s,onChange:p=>l(p.target.value),onKeyDown:p=>p.key==="Enter"&&g(),className:"input-field text-xs",autoFocus:!0})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-1",children:a("github.issueBody")}),d.jsx("textarea",{value:o,onChange:p=>c(p.target.value),className:"input-field text-xs",rows:3})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx("button",{onClick:n,className:"btn-ghost text-xs",children:a("header.cancel")}),d.jsx("button",{onClick:g,disabled:f||!s.trim(),className:"btn-primary text-xs",children:a(f?"github.creating":"github.createIssue")})]})]})})}function gQ({project:e,config:t,onConfigChange:n}){const{t:a}=Ue(),[s,l]=C.useState(!1),[o,c]=C.useState(null),[f,h]=C.useState(!1),g=t.enabled==="1"||t.enabled===!0,p=async()=>{l(!0),c(null);try{const x=await lQ(e.id);c(x.ok?"ok":"fail")}catch{c("fail")}finally{l(!1)}};return d.jsxs("div",{className:"p-4 border border-warm-200 rounded-xl",children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("h4",{className:"text-sm font-semibold text-warm-700",children:a("header.githubTitle")}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:g,onChange:x=>n({enabled:x.target.checked?"1":"0"}),className:"sr-only peer"}),d.jsx("div",{className:"w-9 h-5 bg-warm-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-warm-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-status-success"})]})]}),d.jsx("p",{className:"text-xs text-warm-400 mb-3",children:a("header.githubDesc")}),g&&d.jsxs("div",{className:"space-y-3",children:[d.jsxs("button",{type:"button",onClick:()=>h(!f),className:"flex items-center gap-1 text-xs text-accent-dark hover:text-accent transition-colors",children:[d.jsx("span",{className:`inline-block transition-transform ${f?"rotate-90":""}`,children:"▶"}),a("header.githubGuideToggle")]}),f&&d.jsxs("div",{className:"p-3 bg-warm-50 border border-warm-150 rounded-lg text-xs text-warm-600 space-y-2",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-semibold text-warm-700 mb-1",children:a("header.githubGuidePrep")}),d.jsxs("ol",{className:"list-decimal list-inside space-y-0.5 ml-1",children:[d.jsx("li",{children:a("header.githubGuideStep1")}),d.jsx("li",{children:a("header.githubGuideStep2")})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-semibold text-warm-700 mb-1",children:a("header.githubGuideSetup")}),d.jsxs("ol",{className:"list-decimal list-inside space-y-0.5 ml-1",children:[d.jsx("li",{children:a("header.githubGuideSetup1")}),d.jsx("li",{children:a("header.githubGuideSetup2")}),d.jsx("li",{children:a("header.githubGuideSetup3")})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-semibold text-warm-700 mb-1",children:a("header.githubGuideUsage")}),d.jsxs("ol",{className:"list-decimal list-inside space-y-0.5 ml-1",children:[d.jsx("li",{children:a("header.githubGuideUsage1")}),d.jsx("li",{children:a("header.githubGuideUsage2")}),d.jsx("li",{children:a("header.githubGuideUsage3")})]})]})]}),d.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:a("header.githubToken")}),d.jsx("input",{type:"password",value:t.token??"",onChange:x=>n({token:x.target.value||null}),placeholder:a("header.githubTokenPlaceholder"),className:"w-full px-3 py-1.5 text-xs border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:a("header.githubOwner")}),d.jsx("input",{type:"text",value:t.owner??"",onChange:x=>n({owner:x.target.value||null}),placeholder:a("header.githubOwnerPlaceholder"),className:"w-full px-3 py-1.5 text-xs border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:a("header.githubRepo")}),d.jsx("input",{type:"text",value:t.repo??"",onChange:x=>n({repo:x.target.value||null}),placeholder:a("header.githubRepoPlaceholder"),className:"w-full px-3 py-1.5 text-xs border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent"})]})]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{onClick:p,disabled:s,className:"px-3 py-1 text-xs rounded-lg bg-warm-100 text-warm-600 hover:bg-warm-200 disabled:opacity-50 transition-colors",children:a(s?"header.githubTesting":"header.githubTestConnection")}),o==="ok"&&d.jsx("span",{className:"text-xs text-status-success font-medium",children:a("header.githubConnected")}),o==="fail"&&d.jsx("span",{className:"text-xs text-status-error font-medium",children:a("header.githubFailed")})]}),d.jsx("p",{className:"text-xs text-warm-300",children:a("header.githubTokenHint")})]})]})}const xQ={id:"github",displayName:"GitHub",displayNameKo:"GitHub",PanelComponent:fQ,SettingsComponent:gQ,hasTab:!0,isEnabled:e=>!!e.github_enabled,translations:{en:{"tabs.github":"GitHub","github.title":"GitHub Issues","github.search":"Search issues...","github.refresh":"Refresh","github.import":"Import as Task","github.importing":"Importing...","github.imported":"Imported!","github.noIssues":"No issues found","github.noIssuesHint":"Try changing the filter or search query.","github.loadMore":"Load More","github.createIssue":"Create Issue","github.issueTitle":"Title","github.issueBody":"Description","github.creating":"Creating...","github.notConfigured":"GitHub is not configured. Enable it in project settings.","github.loadingComments":"Loading comments...","github.comments":"Comments","github.noBody":"No description provided.","github.open":"Open","github.closed":"Closed","github.all":"All","header.githubTitle":"GitHub Integration","header.githubToken":"Personal Access Token","header.githubTokenPlaceholder":"ghp_...","header.githubOwner":"Owner","header.githubOwnerPlaceholder":"e.g. octocat","header.githubRepo":"Repository","header.githubRepoPlaceholder":"e.g. my-repo","header.githubTestConnection":"Test Connection","header.githubTesting":"Testing...","header.githubConnected":"Connected!","header.githubFailed":"Connection failed","header.githubTokenHint":"Create a token at github.com/settings/tokens with repo scope","header.githubDesc":"Browse GitHub issues and import them as AI tasks.","header.githubGuideToggle":"Setup Guide","header.githubGuidePrep":"Prerequisites","header.githubGuideStep1":'Go to github.com/settings/tokens and create a Personal Access Token with "repo" scope',"header.githubGuideStep2":"Note the repository owner (e.g. octocat) and name (e.g. my-repo)","header.githubGuideSetup":"Configuration","header.githubGuideSetup1":"Enter the token, owner, and repository name above","header.githubGuideSetup2":'Click "Test Connection" to verify',"header.githubGuideSetup3":"Save settings","header.githubGuideUsage":"Usage","header.githubGuideUsage1":"Open the GitHub tab in the project detail page","header.githubGuideUsage2":"Browse issues, filter by state (open/closed), or search","header.githubGuideUsage3":'Click "Import as Task" to create an AI task from an issue'},ko:{"tabs.github":"GitHub","github.title":"GitHub 이슈","github.search":"이슈 검색...","github.refresh":"새로고침","github.import":"작업으로 가져오기","github.importing":"가져오는 중...","github.imported":"가져옴!","github.noIssues":"이슈가 없습니다","github.noIssuesHint":"필터나 검색어를 변경해보세요.","github.loadMore":"더 보기","github.createIssue":"이슈 생성","github.issueTitle":"제목","github.issueBody":"설명","github.creating":"생성 중...","github.notConfigured":"GitHub이 설정되지 않았습니다. 프로젝트 설정에서 활성화하세요.","github.loadingComments":"댓글 로딩 중...","github.comments":"댓글","github.noBody":"설명이 없습니다.","github.open":"열림","github.closed":"닫힘","github.all":"전체","header.githubTitle":"GitHub 연동","header.githubToken":"개인 액세스 토큰","header.githubTokenPlaceholder":"ghp_...","header.githubOwner":"소유자","header.githubOwnerPlaceholder":"예: octocat","header.githubRepo":"저장소","header.githubRepoPlaceholder":"예: my-repo","header.githubTestConnection":"연결 테스트","header.githubTesting":"테스트 중...","header.githubConnected":"연결 성공!","header.githubFailed":"연결 실패","header.githubTokenHint":"github.com/settings/tokens에서 repo 권한으로 토큰을 생성하세요","header.githubDesc":"GitHub 이슈를 조회하고 AI 태스크로 가져옵니다.","header.githubGuideToggle":"설정 가이드","header.githubGuidePrep":"사전 준비","header.githubGuideStep1":'github.com/settings/tokens에서 "repo" 권한의 Personal Access Token 생성',"header.githubGuideStep2":"레포지토리 소유자 (예: octocat)와 이름 (예: my-repo) 확인","header.githubGuideSetup":"설정 방법","header.githubGuideSetup1":"위 입력란에 토큰, 소유자, 저장소 이름 입력","header.githubGuideSetup2":'"연결 테스트" 클릭하여 연결 확인',"header.githubGuideSetup3":"설정 저장","header.githubGuideUsage":"사용법","header.githubGuideUsage1":"프로젝트 상세 페이지에서 GitHub 탭 진입","header.githubGuideUsage2":"이슈 검색, open/closed 필터링","header.githubGuideUsage3":'"작업으로 가져오기" 클릭하여 AI 태스크 생성'}}};function yQ(e){return rt(`/api/notion/${e}/test`)}function bQ(e,t){return qe(`/api/notion/${e}/pages`,t||{})}function vQ(e,t){return rt(`/api/notion/${e}/page/${t}/blocks`)}function wQ(e,t){return qe(`/api/notion/${e}/create`,t)}function jQ(e,t){return qe(`/api/notion/${e}/import/${t}`)}function kQ({project:e,onImportAsTask:t}){const{t:n}=Ue(),[a,s]=C.useState([]),[l,o]=C.useState(!1),[c,f]=C.useState(!1),[h,g]=C.useState(null),[p,x]=C.useState(""),[y,w]=C.useState(null),[j,S]=C.useState(null),[k,N]=C.useState(null),[_,E]=C.useState(!1),M=e.notion_enabled&&e.notion_api_key&&e.notion_database_id,T=C.useCallback(async(P=!1)=>{if(M){o(!0);try{const L=await bQ(e.id,{startCursor:P?void 0:h||void 0,search:p||void 0});s(P?L.results:H=>[...H,...L.results]),f(L.has_more),g(L.next_cursor)}catch{}finally{o(!1)}}},[e.id,M,p,h]);C.useEffect(()=>{T(!0)},[e.id,M]);const R=()=>{T(!0)},B=async P=>{w(P);try{const L=await jQ(e.id,P);t(L.title,L.description),S(P),setTimeout(()=>S(null),2e3)}catch{}finally{w(null)}};return M?d.jsxs("div",{className:"animate-fade-in",children:[d.jsxs("div",{className:"flex items-center justify-between mb-4",children:[d.jsx("h2",{className:"text-sm font-semibold text-warm-700",children:n("notion.title")}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx("button",{onClick:()=>E(!_),className:"btn-primary text-xs",children:n("notion.createPage")}),d.jsx("button",{onClick:()=>T(!0),disabled:l,className:"btn-ghost text-xs",children:n("notion.refresh")})]})]}),_&&d.jsx(CQ,{projectId:e.id,onCreated:()=>{E(!1),T(!0)},onCancel:()=>E(!1)}),d.jsx("div",{className:"flex gap-2 mb-4",children:d.jsxs("div",{className:"flex-1 relative",children:[d.jsx("input",{type:"text",value:p,onChange:P=>x(P.target.value),onKeyDown:P=>P.key==="Enter"&&R(),placeholder:n("notion.search"),className:"input-field text-xs pr-8"}),d.jsx("button",{onClick:R,className:"absolute right-2 top-1/2 -translate-y-1/2 text-warm-400 hover:text-warm-600",children:d.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})})]})}),a.length===0&&!l&&d.jsxs("div",{className:"card p-10 text-center",children:[d.jsx("p",{className:"text-warm-400 text-sm",children:n("notion.noPages")}),d.jsx("p",{className:"text-warm-300 text-xs mt-1",children:n("notion.noPagesHint")})]}),d.jsx("div",{className:"space-y-2",children:a.map(P=>d.jsx(SQ,{page:P,projectId:e.id,expanded:k===P.id,onToggle:()=>N(k===P.id?null:P.id),importing:y===P.id,imported:j===P.id,onImport:()=>B(P.id)},P.id))}),c&&d.jsx("div",{className:"mt-4 text-center",children:d.jsx("button",{onClick:()=>T(!1),disabled:l,className:"btn-ghost text-xs",children:l?"...":n("notion.loadMore")})})]}):d.jsxs("div",{className:"card p-16 text-center animate-fade-in",children:[d.jsx("div",{className:"text-warm-300 mb-3",children:d.jsx("svg",{className:"w-12 h-12 mx-auto",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})})}),d.jsx("p",{className:"text-warm-400 text-sm",children:n("notion.notConfigured")})]})}function SQ({page:e,projectId:t,expanded:n,onToggle:a,importing:s,imported:l,onImport:o}){const{t:c}=Ue(),f=EQ(e),h=TQ(e),g=new Date(e.last_edited_time).toLocaleDateString();return d.jsxs("div",{className:"card p-3 hover:shadow-md transition-shadow",children:[d.jsxs("div",{className:"flex items-start gap-3",children:[d.jsx("div",{className:"w-4 h-4 mt-0.5 flex-shrink-0 text-warm-400",children:d.jsx("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})})}),d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsx("div",{className:"flex items-center gap-2",children:d.jsx("button",{onClick:a,className:"text-xs font-medium text-blue-600 hover:text-blue-800 truncate text-left",children:f||"Untitled"})}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-1.5",children:[h&&d.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium ${AQ(h)}`,children:h}),d.jsx("span",{className:"text-[10px] text-warm-300 ml-auto",children:g})]})]}),d.jsx("button",{onClick:o,disabled:s||l,className:`flex-shrink-0 text-xs px-2 py-1 rounded-lg font-medium transition-colors ${l?"bg-status-success/10 text-status-success":"bg-blue-50 text-blue-600 hover:bg-blue-100"}`,title:c("notion.import"),children:c(s?"notion.importing":l?"notion.imported":"notion.import")})]}),n&&d.jsx(_Q,{pageId:e.id,projectId:t})]})}function _Q({pageId:e,projectId:t}){const{t:n}=Ue(),[a,s]=C.useState([]),[l,o]=C.useState(!0);return C.useEffect(()=>{o(!0),vQ(t,e).then(c=>s(c.results||[])).catch(()=>{}).finally(()=>o(!1))},[t,e]),l?d.jsx("div",{className:"mt-3 pt-3 border-t border-warm-100 animate-slide-up",children:d.jsx("p",{className:"text-xs text-warm-400",children:n("notion.loadingContent")})}):a.length===0?d.jsx("div",{className:"mt-3 pt-3 border-t border-warm-100 animate-slide-up",children:d.jsx("p",{className:"text-xs text-warm-400",children:n("notion.noContent")})}):d.jsx("div",{className:"mt-3 pt-3 border-t border-warm-100 space-y-1 animate-slide-up max-h-64 overflow-y-auto",children:a.map(c=>d.jsx(NQ,{block:c},c.id))})}function NQ({block:e}){const t=e.type;if(!t||!e[t])return null;const n=e[t],a=n.rich_text?n.rich_text.map(s=>s.plain_text||"").join(""):"";if(!a&&t!=="divider")return null;switch(t){case"heading_1":return d.jsx("p",{className:"text-xs font-bold text-warm-700",children:a});case"heading_2":return d.jsx("p",{className:"text-xs font-semibold text-warm-600",children:a});case"heading_3":return d.jsx("p",{className:"text-xs font-medium text-warm-600",children:a});case"bulleted_list_item":return d.jsxs("p",{className:"text-xs text-warm-500 pl-3",children:["• ",a]});case"numbered_list_item":return d.jsx("p",{className:"text-xs text-warm-500 pl-3",children:a});case"to_do":return d.jsxs("p",{className:"text-xs text-warm-500 pl-3",children:[n.checked?"☑":"☐"," ",a]});case"code":return d.jsx("pre",{className:"text-[10px] bg-warm-50 p-2 rounded text-warm-600 overflow-x-auto",children:a});case"divider":return d.jsx("hr",{className:"border-warm-100"});default:return d.jsx("p",{className:"text-xs text-warm-500",children:a})}}function CQ({projectId:e,onCreated:t,onCancel:n}){const{t:a}=Ue(),[s,l]=C.useState(""),[o,c]=C.useState(!1),f=async()=>{if(s.trim()){c(!0);try{await wQ(e,{title:s}),t()}catch{}finally{c(!1)}}};return d.jsx("div",{className:"card p-4 mb-4 animate-slide-up",children:d.jsxs("div",{className:"space-y-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-xs font-medium text-warm-500 mb-1",children:a("notion.pageTitle")}),d.jsx("input",{type:"text",value:s,onChange:h=>l(h.target.value),onKeyDown:h=>h.key==="Enter"&&f(),className:"input-field text-xs",autoFocus:!0})]}),d.jsxs("div",{className:"flex justify-end gap-2",children:[d.jsx("button",{onClick:n,className:"btn-ghost text-xs",children:a("header.cancel")}),d.jsx("button",{onClick:f,disabled:o||!s.trim(),className:"btn-primary text-xs",children:a(o?"notion.creating":"notion.createPage")})]})]})})}function EQ(e){var t;if(!e.properties)return"Untitled";for(const n of Object.values(e.properties))if(n.type==="title"&&((t=n.title)==null?void 0:t.length)>0)return n.title.map(a=>a.plain_text||"").join("");return"Untitled"}function TQ(e){if(!e.properties)return null;for(const t of Object.values(e.properties)){if(t.type==="status"&&t.status)return t.status.name;if(t.type==="select"&&t.select)return t.select.name}return null}function AQ(e){const t=e.toLowerCase();return t.includes("done")||t.includes("complete")||t.includes("완료")?"bg-status-success/10 text-status-success":t.includes("progress")||t.includes("진행")||t.includes("doing")?"bg-blue-100 text-blue-700":(t.includes("todo")||t.includes("not started")||t.includes("대기"),"bg-warm-100 text-warm-600")}function MQ({project:e,config:t,onConfigChange:n}){const{t:a}=Ue(),[s,l]=C.useState(!1),[o,c]=C.useState(null),[f,h]=C.useState(!1),g=t.enabled==="1"||t.enabled===!0,p=async()=>{l(!0),c(null);try{const x=await yQ(e.id);c(x.ok?"ok":"fail")}catch{c("fail")}finally{l(!1)}};return d.jsxs("div",{className:"p-4 border border-warm-200 rounded-xl",children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("h4",{className:"text-sm font-semibold text-warm-700",children:a("header.notionTitle")}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:g,onChange:x=>n({enabled:x.target.checked?"1":"0"}),className:"sr-only peer"}),d.jsx("div",{className:"w-9 h-5 bg-warm-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-warm-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-status-success"})]})]}),d.jsx("p",{className:"text-xs text-warm-400 mb-3",children:a("header.notionDesc")}),g&&d.jsxs("div",{className:"space-y-3",children:[d.jsxs("button",{type:"button",onClick:()=>h(!f),className:"flex items-center gap-1 text-xs text-accent-dark hover:text-accent transition-colors",children:[d.jsx("span",{className:`inline-block transition-transform ${f?"rotate-90":""}`,children:"▶"}),a("header.notionGuideToggle")]}),f&&d.jsxs("div",{className:"p-3 bg-warm-50 border border-warm-150 rounded-lg text-xs text-warm-600 space-y-2",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-semibold text-warm-700 mb-1",children:a("header.notionGuidePrep")}),d.jsxs("ol",{className:"list-decimal list-inside space-y-0.5 ml-1",children:[d.jsx("li",{children:a("header.notionGuideStep1")}),d.jsx("li",{children:a("header.notionGuideStep2")}),d.jsx("li",{children:a("header.notionGuideStep3")})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-semibold text-warm-700 mb-1",children:a("header.notionGuideSetup")}),d.jsxs("ol",{className:"list-decimal list-inside space-y-0.5 ml-1",children:[d.jsx("li",{children:a("header.notionGuideSetup1")}),d.jsx("li",{children:a("header.notionGuideSetup2")}),d.jsx("li",{children:a("header.notionGuideSetup3")})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-semibold text-warm-700 mb-1",children:a("header.notionGuideUsage")}),d.jsxs("ol",{className:"list-decimal list-inside space-y-0.5 ml-1",children:[d.jsx("li",{children:a("header.notionGuideUsage1")}),d.jsx("li",{children:a("header.notionGuideUsage2")}),d.jsx("li",{children:a("header.notionGuideUsage3")})]})]})]}),d.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:a("header.notionApiKey")}),d.jsx("input",{type:"password",value:t.api_key??"",onChange:x=>n({api_key:x.target.value||null}),placeholder:a("header.notionApiKeyPlaceholder"),className:"w-full px-3 py-1.5 text-xs border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:a("header.notionDatabaseId")}),d.jsx("input",{type:"text",value:t.database_id??"",onChange:x=>n({database_id:x.target.value||null}),placeholder:a("header.notionDatabaseIdPlaceholder"),className:"w-full px-3 py-1.5 text-xs border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent"})]})]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("button",{onClick:p,disabled:s,className:"px-3 py-1 text-xs rounded-lg bg-warm-100 text-warm-600 hover:bg-warm-200 disabled:opacity-50 transition-colors",children:a(s?"header.notionTesting":"header.notionTestConnection")}),o==="ok"&&d.jsx("span",{className:"text-xs text-status-success font-medium",children:a("header.notionConnected")}),o==="fail"&&d.jsx("span",{className:"text-xs text-status-error font-medium",children:a("header.notionFailed")})]}),d.jsx("p",{className:"text-xs text-warm-300",children:a("header.notionTokenHint")})]})]})}const RQ={id:"notion",displayName:"Notion",displayNameKo:"Notion",PanelComponent:kQ,SettingsComponent:MQ,hasTab:!0,isEnabled:e=>!!e.notion_enabled,translations:{en:{"tabs.notion":"Notion","notion.title":"Notion Pages","notion.search":"Search pages...","notion.refresh":"Refresh","notion.import":"Import as Task","notion.importing":"Importing...","notion.imported":"Imported!","notion.noPages":"No pages found","notion.noPagesHint":"Try changing the search query.","notion.loadMore":"Load More","notion.createPage":"Create Page","notion.pageTitle":"Title","notion.creating":"Creating...","notion.notConfigured":"Notion is not configured. Enable it in project settings.","notion.loadingContent":"Loading content...","notion.noContent":"No content","header.notionTitle":"Notion Integration","header.notionApiKey":"Integration Token","header.notionApiKeyPlaceholder":"secret_...","header.notionDatabaseId":"Database ID","header.notionDatabaseIdPlaceholder":"32-char hex ID from database URL","header.notionTestConnection":"Test Connection","header.notionTesting":"Testing...","header.notionConnected":"Connected!","header.notionFailed":"Connection failed","header.notionTokenHint":"Create an integration at notion.so/my-integrations and share the database with it","header.notionDesc":"Browse Notion pages and import them as AI tasks.","header.notionGuideToggle":"Setup Guide","header.notionGuidePrep":"Prerequisites","header.notionGuideStep1":"Go to notion.so/my-integrations and create an Integration — copy the API key","header.notionGuideStep2":'Open your Notion database page, click "..." > Connections > select the Integration',"header.notionGuideStep3":'Copy the Database ID from the URL (32-char hex string before "?v=")',"header.notionGuideSetup":"Configuration","header.notionGuideSetup1":"Enter the API key and Database ID above","header.notionGuideSetup2":'Click "Test Connection" to verify',"header.notionGuideSetup3":"Save settings","header.notionGuideUsage":"Usage","header.notionGuideUsage1":"Open the Notion tab in the project detail page","header.notionGuideUsage2":"Browse pages, search by title, view block content","header.notionGuideUsage3":'Click "Import as Task" to create an AI task from a page'},ko:{"tabs.notion":"Notion","notion.title":"Notion 페이지","notion.search":"페이지 검색...","notion.refresh":"새로고침","notion.import":"작업으로 가져오기","notion.importing":"가져오는 중...","notion.imported":"가져옴!","notion.noPages":"페이지가 없습니다","notion.noPagesHint":"검색어를 변경해보세요.","notion.loadMore":"더 보기","notion.createPage":"페이지 생성","notion.pageTitle":"제목","notion.creating":"생성 중...","notion.notConfigured":"Notion이 설정되지 않았습니다. 프로젝트 설정에서 활성화하세요.","notion.loadingContent":"콘텐츠 로딩 중...","notion.noContent":"콘텐츠 없음","header.notionTitle":"Notion 연동","header.notionApiKey":"통합 토큰","header.notionApiKeyPlaceholder":"secret_...","header.notionDatabaseId":"데이터베이스 ID","header.notionDatabaseIdPlaceholder":"데이터베이스 URL의 32자 hex ID","header.notionTestConnection":"연결 테스트","header.notionTesting":"테스트 중...","header.notionConnected":"연결 성공!","header.notionFailed":"연결 실패","header.notionTokenHint":"notion.so/my-integrations에서 통합을 생성하고 데이터베이스를 공유하세요","header.notionDesc":"Notion 페이지를 조회하고 AI 태스크로 가져옵니다.","header.notionGuideToggle":"설정 가이드","header.notionGuidePrep":"사전 준비","header.notionGuideStep1":"notion.so/my-integrations에서 Integration 생성 → API 키 복사","header.notionGuideStep2":'Notion 데이터베이스 페이지 → "..." → 연결 → 생성한 Integration 선택',"header.notionGuideStep3":'데이터베이스 URL에서 Database ID 복사 ("?v=" 앞의 32자리 hex)',"header.notionGuideSetup":"설정 방법","header.notionGuideSetup1":"위 입력란에 API 키와 Database ID 입력","header.notionGuideSetup2":'"연결 테스트" 클릭하여 연결 확인',"header.notionGuideSetup3":"설정 저장","header.notionGuideUsage":"사용법","header.notionGuideUsage1":"프로젝트 상세 페이지에서 Notion 탭 진입","header.notionGuideUsage2":"페이지 검색, 블록 콘텐츠 확인","header.notionGuideUsage3":'"작업으로 가져오기" 클릭하여 AI 태스크 생성'}}};function LQ(){return rt("/api/gstack/skills")}function DQ({project:e,config:t,onConfigChange:n}){const{t:a,lang:s}=Ue(),[l,o]=C.useState([]),[c,f]=C.useState(!1);C.useEffect(()=>{LQ().then(o).catch(()=>{})},[]);const h=t.enabled==="1"||t.enabled===!0,g=e.cli_tool==="claude",p=(()=>{try{const y=t.skills;if(!y)return[];const w=typeof y=="string"?JSON.parse(y):y;return Array.isArray(w)?w:[]}catch{return[]}})(),x=y=>{const w=p.includes(y)?p.filter(j=>j!==y):[...p,y];n({skills:w.length>0?JSON.stringify(w):null})};return d.jsxs("div",{className:"p-4 border border-warm-200 rounded-xl",children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsx("h4",{className:"text-sm font-semibold text-warm-700",children:a("header.gstackTitle")}),d.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[d.jsx("input",{type:"checkbox",checked:h,onChange:y=>n({enabled:y.target.checked?"1":"0"}),disabled:!g,className:"sr-only peer"}),d.jsx("div",{className:"w-9 h-5 bg-warm-200 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-warm-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-status-success peer-disabled:opacity-50"})]})]}),d.jsx("p",{className:"text-xs text-warm-400 mb-3",children:a("header.gstackDesc")}),!g&&d.jsx("p",{className:"text-xs text-warm-400 mb-3",children:a("header.gstackClaudeOnly")}),g&&h&&d.jsxs("div",{className:"space-y-3",children:[d.jsxs("button",{type:"button",onClick:()=>f(!c),className:"flex items-center gap-1 text-xs text-accent-dark hover:text-accent transition-colors",children:[d.jsx("span",{className:`inline-block transition-transform ${c?"rotate-90":""}`,children:"▶"}),a("header.gstackGuideToggle")]}),c&&d.jsxs("div",{className:"p-3 bg-warm-50 border border-warm-150 rounded-lg text-xs text-warm-600 space-y-2",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-semibold text-warm-700 mb-1",children:a("header.gstackGuideHow")}),d.jsxs("ol",{className:"list-decimal list-inside space-y-0.5 ml-1",children:[d.jsx("li",{children:a("header.gstackGuideStep1")}),d.jsx("li",{children:a("header.gstackGuideStep2")}),d.jsx("li",{children:a("header.gstackGuideStep3")}),d.jsx("li",{children:a("header.gstackGuideStep4")})]})]}),d.jsx("p",{className:"text-warm-400",children:a("header.gstackGuideNote")})]}),l.length>0&&d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:l.map(y=>d.jsxs("label",{className:"flex items-start gap-2 p-2 rounded-lg hover:bg-warm-50 cursor-pointer transition-colors",children:[d.jsx("input",{type:"checkbox",checked:p.includes(y.id),onChange:()=>x(y.id),className:"mt-0.5 rounded border-warm-300 text-status-success focus:ring-status-success"}),d.jsxs("div",{className:"min-w-0",children:[d.jsx("span",{className:"text-xs font-medium text-warm-700",children:y.name}),d.jsx("p",{className:"text-xs text-warm-400 truncate",children:s==="ko"?y.descriptionKo:y.description})]})]},y.id))})]}),d.jsx("p",{className:"text-xs text-warm-300 mt-3",children:a("header.gstackCredit")})]})}const OQ={id:"gstack",displayName:"Gstack Skills",displayNameKo:"Gstack 스킬",SettingsComponent:DQ,hasTab:!1,isEnabled:e=>!!e.gstack_enabled,translations:{en:{"header.gstackTitle":"gstack Skills","header.gstackEnabled":"Enable gstack skill injection","header.gstackCredit":"Powered by gstack (MIT License, Garry Tan)","header.gstackClaudeOnly":"gstack skills are only available with Claude CLI.","header.gstackDesc":"Inject AI skill files into worktrees to improve Claude CLI task quality.","header.gstackGuideToggle":"How it works","header.gstackGuideHow":"How gstack skills work","header.gstackGuideStep1":"Select the skills you want to use below","header.gstackGuideStep2":"When a task starts, selected skill files are copied to the worktree's .claude/skills/ directory","header.gstackGuideStep3":"Claude CLI automatically recognizes and applies these skills during execution","header.gstackGuideStep4":"Skills are isolated in gstack-* prefixed directories and don't conflict with existing skills","header.gstackGuideNote":"Only works with Claude CLI. Gemini and Codex do not support skill files."},ko:{"header.gstackTitle":"gstack 스킬","header.gstackEnabled":"gstack 스킬 주입 활성화","header.gstackCredit":"gstack 기반 (MIT 라이선스, Garry Tan)","header.gstackClaudeOnly":"gstack 스킬은 Claude CLI에서만 사용 가능합니다.","header.gstackDesc":"AI 스킬 파일을 worktree에 주입하여 Claude CLI 작업 품질을 높입니다.","header.gstackGuideToggle":"동작 방식","header.gstackGuideHow":"gstack 스킬 동작 원리","header.gstackGuideStep1":"아래에서 사용할 스킬을 선택합니다","header.gstackGuideStep2":"태스크 실행 시 선택된 스킬 파일이 worktree의 .claude/skills/ 디렉토리에 복사됩니다","header.gstackGuideStep3":"Claude CLI가 스킬을 자동 인식하여 실행에 적용합니다","header.gstackGuideStep4":"스킬은 gstack-* 접두사 디렉토리에 격리되어 기존 스킬과 충돌하지 않습니다","header.gstackGuideNote":"Claude CLI 전용 기능입니다. Gemini, Codex에서는 지원되지 않습니다."}}};function zQ(){Zu(sQ),Zu(xQ),Zu(RQ),Zu(OQ)}zQ();function qQ(){const e=cO();return d.jsx(DE.Provider,{value:e,children:d.jsx(BD,{children:d.jsx(VW,{})})})}JR.createRoot(document.getElementById("root")).render(d.jsx(uE.StrictMode,{children:d.jsx(qQ,{})}));