@akiojin/gwt 4.1.1 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/README.md +28 -3
  2. package/dist/claude.d.ts +4 -0
  3. package/dist/claude.d.ts.map +1 -1
  4. package/dist/claude.js +13 -1
  5. package/dist/claude.js.map +1 -1
  6. package/dist/cli/ui/components/App.d.ts.map +1 -1
  7. package/dist/cli/ui/components/App.js +68 -68
  8. package/dist/cli/ui/components/App.js.map +1 -1
  9. package/dist/cli/ui/components/common/Select.d.ts +3 -1
  10. package/dist/cli/ui/components/common/Select.d.ts.map +1 -1
  11. package/dist/cli/ui/components/common/Select.js +13 -2
  12. package/dist/cli/ui/components/common/Select.js.map +1 -1
  13. package/dist/cli/ui/components/screens/BranchListScreen.d.ts.map +1 -1
  14. package/dist/cli/ui/components/screens/BranchListScreen.js +6 -1
  15. package/dist/cli/ui/components/screens/BranchListScreen.js.map +1 -1
  16. package/dist/client/assets/index-ChHC-Puh.css +1 -0
  17. package/dist/client/assets/index-PqK9jkug.js +78 -0
  18. package/dist/client/index.html +2 -2
  19. package/dist/config/builtin-tools.d.ts.map +1 -1
  20. package/dist/config/builtin-tools.js +3 -0
  21. package/dist/config/builtin-tools.js.map +1 -1
  22. package/dist/config/tools.d.ts.map +1 -1
  23. package/dist/config/tools.js +10 -1
  24. package/dist/config/tools.js.map +1 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +37 -4
  27. package/dist/index.js.map +1 -1
  28. package/dist/launcher.d.ts.map +1 -1
  29. package/dist/launcher.js +15 -0
  30. package/dist/launcher.js.map +1 -1
  31. package/dist/services/aiToolResolver.d.ts.map +1 -1
  32. package/dist/services/aiToolResolver.js +55 -8
  33. package/dist/services/aiToolResolver.js.map +1 -1
  34. package/dist/services/customToolResolver.d.ts.map +1 -1
  35. package/dist/services/customToolResolver.js +22 -17
  36. package/dist/services/customToolResolver.js.map +1 -1
  37. package/dist/utils/prompt.d.ts +12 -0
  38. package/dist/utils/prompt.d.ts.map +1 -1
  39. package/dist/utils/prompt.js +60 -10
  40. package/dist/utils/prompt.js.map +1 -1
  41. package/dist/utils/webui.js +1 -1
  42. package/dist/web/client/src/components/BranchGraph.d.ts +5 -0
  43. package/dist/web/client/src/components/BranchGraph.d.ts.map +1 -1
  44. package/dist/web/client/src/components/BranchGraph.js +35 -108
  45. package/dist/web/client/src/components/BranchGraph.js.map +1 -1
  46. package/dist/web/client/src/components/graph/BranchDetailPanel.d.ts +15 -0
  47. package/dist/web/client/src/components/graph/BranchDetailPanel.d.ts.map +1 -0
  48. package/dist/web/client/src/components/graph/BranchDetailPanel.js +57 -0
  49. package/dist/web/client/src/components/graph/BranchDetailPanel.js.map +1 -0
  50. package/dist/web/client/src/components/graph/BranchNode.d.ts +13 -0
  51. package/dist/web/client/src/components/graph/BranchNode.d.ts.map +1 -0
  52. package/dist/web/client/src/components/graph/BranchNode.js +103 -0
  53. package/dist/web/client/src/components/graph/BranchNode.js.map +1 -0
  54. package/dist/web/client/src/components/graph/ClusterNode.d.ts +13 -0
  55. package/dist/web/client/src/components/graph/ClusterNode.d.ts.map +1 -0
  56. package/dist/web/client/src/components/graph/ClusterNode.js +109 -0
  57. package/dist/web/client/src/components/graph/ClusterNode.js.map +1 -0
  58. package/dist/web/client/src/components/graph/SynapticCanvas.d.ts +17 -0
  59. package/dist/web/client/src/components/graph/SynapticCanvas.d.ts.map +1 -0
  60. package/dist/web/client/src/components/graph/SynapticCanvas.js +94 -0
  61. package/dist/web/client/src/components/graph/SynapticCanvas.js.map +1 -0
  62. package/dist/web/client/src/components/graph/SynapticEdge.d.ts +13 -0
  63. package/dist/web/client/src/components/graph/SynapticEdge.d.ts.map +1 -0
  64. package/dist/web/client/src/components/graph/SynapticEdge.js +113 -0
  65. package/dist/web/client/src/components/graph/SynapticEdge.js.map +1 -0
  66. package/dist/web/client/src/components/graph/graphUtils.d.ts +67 -0
  67. package/dist/web/client/src/components/graph/graphUtils.d.ts.map +1 -0
  68. package/dist/web/client/src/components/graph/graphUtils.js +175 -0
  69. package/dist/web/client/src/components/graph/graphUtils.js.map +1 -0
  70. package/dist/web/client/src/components/graph/index.d.ts +10 -0
  71. package/dist/web/client/src/components/graph/index.d.ts.map +1 -0
  72. package/dist/web/client/src/components/graph/index.js +10 -0
  73. package/dist/web/client/src/components/graph/index.js.map +1 -0
  74. package/dist/web/client/src/lib/websocket.d.ts.map +1 -1
  75. package/dist/web/client/src/lib/websocket.js +2 -1
  76. package/dist/web/client/src/lib/websocket.js.map +1 -1
  77. package/dist/web/client/vite.config.js +1 -1
  78. package/dist/web/server/env/importer.d.ts.map +1 -1
  79. package/dist/web/server/env/importer.js +4 -0
  80. package/dist/web/server/env/importer.js.map +1 -1
  81. package/dist/web/server/index.d.ts.map +1 -1
  82. package/dist/web/server/index.js +9 -0
  83. package/dist/web/server/index.js.map +1 -1
  84. package/dist/web/server/pty/manager.d.ts.map +1 -1
  85. package/dist/web/server/pty/manager.js +24 -1
  86. package/dist/web/server/pty/manager.js.map +1 -1
  87. package/dist/web/server/routes/sessions.d.ts.map +1 -1
  88. package/dist/web/server/routes/sessions.js +7 -0
  89. package/dist/web/server/routes/sessions.js.map +1 -1
  90. package/dist/web/server/tray.d.ts +1 -1
  91. package/dist/web/server/tray.d.ts.map +1 -1
  92. package/dist/web/server/tray.js +52 -34
  93. package/dist/web/server/tray.js.map +1 -1
  94. package/dist/web/server/websocket/handler.d.ts.map +1 -1
  95. package/dist/web/server/websocket/handler.js +4 -0
  96. package/dist/web/server/websocket/handler.js.map +1 -1
  97. package/package.json +6 -3
  98. package/src/claude.ts +15 -1
  99. package/src/cli/ui/__tests__/components/App.protected-branch.test.tsx +2 -1
  100. package/src/cli/ui/__tests__/components/App.shortcuts.test.tsx +142 -8
  101. package/src/cli/ui/__tests__/components/App.test.tsx +4 -3
  102. package/src/cli/ui/__tests__/components/ModelSelectorScreen.initial.test.tsx +1 -0
  103. package/src/cli/ui/__tests__/components/common/Select.test.tsx +45 -0
  104. package/src/cli/ui/components/App.tsx +91 -81
  105. package/src/cli/ui/components/common/Select.tsx +14 -1
  106. package/src/cli/ui/components/screens/BranchListScreen.tsx +6 -1
  107. package/src/cli/ui/types.ts +1 -1
  108. package/src/config/builtin-tools.ts +3 -0
  109. package/src/config/tools.ts +24 -1
  110. package/src/index.ts +50 -3
  111. package/src/launcher.ts +26 -0
  112. package/src/services/aiToolResolver.ts +75 -9
  113. package/src/services/customToolResolver.ts +32 -17
  114. package/src/utils/__tests__/prompt.test.ts +72 -35
  115. package/src/utils/prompt.ts +79 -10
  116. package/src/utils/webui.ts +1 -1
  117. package/src/web/client/src/components/BranchGraph.tsx +51 -208
  118. package/src/web/client/src/components/graph/BranchDetailPanel.tsx +152 -0
  119. package/src/web/client/src/components/graph/BranchNode.tsx +200 -0
  120. package/src/web/client/src/components/graph/ClusterNode.tsx +211 -0
  121. package/src/web/client/src/components/graph/SynapticCanvas.tsx +171 -0
  122. package/src/web/client/src/components/graph/SynapticEdge.tsx +311 -0
  123. package/src/web/client/src/components/graph/graphUtils.ts +265 -0
  124. package/src/web/client/src/components/graph/index.ts +10 -0
  125. package/src/web/client/src/index.css +314 -29
  126. package/src/web/client/src/lib/websocket.ts +2 -1
  127. package/src/web/client/vite.config.ts +1 -1
  128. package/src/web/server/env/importer.ts +5 -0
  129. package/src/web/server/index.ts +10 -0
  130. package/src/web/server/pty/manager.ts +43 -1
  131. package/src/web/server/routes/sessions.ts +15 -0
  132. package/src/web/server/tray.ts +62 -46
  133. package/src/web/server/websocket/handler.ts +13 -0
  134. package/dist/client/assets/index-DsDNCy5f.css +0 -1
  135. package/dist/client/assets/index-v8smkNOL.js +0 -72
@@ -0,0 +1,78 @@
1
+ function rR(e,n){for(var i=0;i<n.length;i++){const s=n[i];if(typeof s!="string"&&!Array.isArray(s)){for(const a in s)if(a!=="default"&&!(a in e)){const f=Object.getOwnPropertyDescriptor(s,a);f&&Object.defineProperty(e,a,f.get?f:{enumerable:!0,get:()=>s[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const f of a)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function i(a){const f={};return a.integrity&&(f.integrity=a.integrity),a.referrerPolicy&&(f.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?f.credentials="include":a.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function s(a){if(a.ep)return;a.ep=!0;const f=i(a);fetch(a.href,f)}})();function fh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $d={exports:{}},rl={};var Y0;function iR(){if(Y0)return rl;Y0=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(s,a,f){var d=null;if(f!==void 0&&(d=""+f),a.key!==void 0&&(d=""+a.key),"key"in a){f={};for(var l in a)l!=="key"&&(f[l]=a[l])}else f=a;return a=f.ref,{$$typeof:e,type:s,key:d,ref:a!==void 0?a:null,props:f}}return rl.Fragment=n,rl.jsx=i,rl.jsxs=i,rl}var K0;function sR(){return K0||(K0=1,$d.exports=iR()),$d.exports}var D=sR(),Vd={exports:{}},Ie={};var G0;function oR(){if(G0)return Ie;G0=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),d=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),_=Symbol.iterator;function x(B){return B===null||typeof B!="object"?null:(B=_&&B[_]||B["@@iterator"],typeof B=="function"?B:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,p={};function g(B,P,Q){this.props=B,this.context=P,this.refs=p,this.updater=Q||C}g.prototype.isReactComponent={},g.prototype.setState=function(B,P){if(typeof B!="object"&&typeof B!="function"&&B!=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,B,P,"setState")},g.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function b(){}b.prototype=g.prototype;function y(B,P,Q){this.props=B,this.context=P,this.refs=p,this.updater=Q||C}var E=y.prototype=new b;E.constructor=y,S(E,g.prototype),E.isPureReactComponent=!0;var M=Array.isArray;function O(){}var T={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function k(B,P,Q){var J=Q.ref;return{$$typeof:e,type:B,key:P,ref:J!==void 0?J:null,props:Q}}function q(B,P){return k(B.type,P,B.props)}function z(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function I(B){var P={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(Q){return P[Q]})}var W=/\/+/g;function U(B,P){return typeof B=="object"&&B!==null&&B.key!=null?I(""+B.key):P.toString(36)}function G(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(O,O):(B.status="pending",B.then(function(P){B.status==="pending"&&(B.status="fulfilled",B.value=P)},function(P){B.status==="pending"&&(B.status="rejected",B.reason=P)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function H(B,P,Q,J,ae){var Z=typeof B;(Z==="undefined"||Z==="boolean")&&(B=null);var X=!1;if(B===null)X=!0;else switch(Z){case"bigint":case"string":case"number":X=!0;break;case"object":switch(B.$$typeof){case e:case n:X=!0;break;case v:return X=B._init,H(X(B._payload),P,Q,J,ae)}}if(X)return ae=ae(B),X=J===""?"."+U(B,0):J,M(ae)?(Q="",X!=null&&(Q=X.replace(W,"$&/")+"/"),H(ae,P,Q,"",function(de){return de})):ae!=null&&(z(ae)&&(ae=q(ae,Q+(ae.key==null||B&&B.key===ae.key?"":(""+ae.key).replace(W,"$&/")+"/")+X)),P.push(ae)),1;X=0;var V=J===""?".":J+":";if(M(B))for(var ie=0;ie<B.length;ie++)J=B[ie],Z=V+U(J,ie),X+=H(J,P,Q,Z,ae);else if(ie=x(B),typeof ie=="function")for(B=ie.call(B),ie=0;!(J=B.next()).done;)J=J.value,Z=V+U(J,ie++),X+=H(J,P,Q,Z,ae);else if(Z==="object"){if(typeof B.then=="function")return H(G(B),P,Q,J,ae);throw P=String(B),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return X}function K(B,P,Q){if(B==null)return B;var J=[],ae=0;return H(B,J,"","",function(Z){return P.call(Q,Z,ae++)}),J}function F(B){if(B._status===-1){var P=B._result;P=P(),P.then(function(Q){(B._status===0||B._status===-1)&&(B._status=1,B._result=Q)},function(Q){(B._status===0||B._status===-1)&&(B._status=2,B._result=Q)}),B._status===-1&&(B._status=0,B._result=P)}if(B._status===1)return B._result.default;throw B._result}var N=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},$={map:K,forEach:function(B,P,Q){K(B,function(){P.apply(this,arguments)},Q)},count:function(B){var P=0;return K(B,function(){P++}),P},toArray:function(B){return K(B,function(P){return P})||[]},only:function(B){if(!z(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return Ie.Activity=m,Ie.Children=$,Ie.Component=g,Ie.Fragment=i,Ie.Profiler=a,Ie.PureComponent=y,Ie.StrictMode=s,Ie.Suspense=u,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(B){return T.H.useMemoCache(B)}},Ie.cache=function(B){return function(){return B.apply(null,arguments)}},Ie.cacheSignal=function(){return null},Ie.cloneElement=function(B,P,Q){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var J=S({},B.props),ae=B.key;if(P!=null)for(Z in P.key!==void 0&&(ae=""+P.key),P)!A.call(P,Z)||Z==="key"||Z==="__self"||Z==="__source"||Z==="ref"&&P.ref===void 0||(J[Z]=P[Z]);var Z=arguments.length-2;if(Z===1)J.children=Q;else if(1<Z){for(var X=Array(Z),V=0;V<Z;V++)X[V]=arguments[V+2];J.children=X}return k(B.type,ae,J)},Ie.createContext=function(B){return B={$$typeof:d,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:f,_context:B},B},Ie.createElement=function(B,P,Q){var J,ae={},Z=null;if(P!=null)for(J in P.key!==void 0&&(Z=""+P.key),P)A.call(P,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(ae[J]=P[J]);var X=arguments.length-2;if(X===1)ae.children=Q;else if(1<X){for(var V=Array(X),ie=0;ie<X;ie++)V[ie]=arguments[ie+2];ae.children=V}if(B&&B.defaultProps)for(J in X=B.defaultProps,X)ae[J]===void 0&&(ae[J]=X[J]);return k(B,Z,ae)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(B){return{$$typeof:l,render:B}},Ie.isValidElement=z,Ie.lazy=function(B){return{$$typeof:v,_payload:{_status:-1,_result:B},_init:F}},Ie.memo=function(B,P){return{$$typeof:c,type:B,compare:P===void 0?null:P}},Ie.startTransition=function(B){var P=T.T,Q={};T.T=Q;try{var J=B(),ae=T.S;ae!==null&&ae(Q,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(O,N)}catch(Z){N(Z)}finally{P!==null&&Q.types!==null&&(P.types=Q.types),T.T=P}},Ie.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},Ie.use=function(B){return T.H.use(B)},Ie.useActionState=function(B,P,Q){return T.H.useActionState(B,P,Q)},Ie.useCallback=function(B,P){return T.H.useCallback(B,P)},Ie.useContext=function(B){return T.H.useContext(B)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(B,P){return T.H.useDeferredValue(B,P)},Ie.useEffect=function(B,P){return T.H.useEffect(B,P)},Ie.useEffectEvent=function(B){return T.H.useEffectEvent(B)},Ie.useId=function(){return T.H.useId()},Ie.useImperativeHandle=function(B,P,Q){return T.H.useImperativeHandle(B,P,Q)},Ie.useInsertionEffect=function(B,P){return T.H.useInsertionEffect(B,P)},Ie.useLayoutEffect=function(B,P){return T.H.useLayoutEffect(B,P)},Ie.useMemo=function(B,P){return T.H.useMemo(B,P)},Ie.useOptimistic=function(B,P){return T.H.useOptimistic(B,P)},Ie.useReducer=function(B,P,Q){return T.H.useReducer(B,P,Q)},Ie.useRef=function(B){return T.H.useRef(B)},Ie.useState=function(B){return T.H.useState(B)},Ie.useSyncExternalStore=function(B,P,Q){return T.H.useSyncExternalStore(B,P,Q)},Ie.useTransition=function(){return T.H.useTransition()},Ie.version="19.2.3",Ie}var X0;function jl(){return X0||(X0=1,Vd.exports=oR()),Vd.exports}var L=jl();const Or=fh(L),dh=rR({__proto__:null,default:Or},[L]);var qd={exports:{}},il={},Wd={exports:{}},Yd={};var Q0;function aR(){return Q0||(Q0=1,(function(e){function n(H,K){var F=H.length;H.push(K);e:for(;0<F;){var N=F-1>>>1,$=H[N];if(0<a($,K))H[N]=K,H[F]=$,F=N;else break e}}function i(H){return H.length===0?null:H[0]}function s(H){if(H.length===0)return null;var K=H[0],F=H.pop();if(F!==K){H[0]=F;e:for(var N=0,$=H.length,B=$>>>1;N<B;){var P=2*(N+1)-1,Q=H[P],J=P+1,ae=H[J];if(0>a(Q,F))J<$&&0>a(ae,Q)?(H[N]=ae,H[J]=F,N=J):(H[N]=Q,H[P]=F,N=P);else if(J<$&&0>a(ae,F))H[N]=ae,H[J]=F,N=J;else break e}}return K}function a(H,K){var F=H.sortIndex-K.sortIndex;return F!==0?F:H.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;e.unstable_now=function(){return f.now()}}else{var d=Date,l=d.now();e.unstable_now=function(){return d.now()-l}}var u=[],c=[],v=1,m=null,_=3,x=!1,C=!1,S=!1,p=!1,g=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function E(H){for(var K=i(c);K!==null;){if(K.callback===null)s(c);else if(K.startTime<=H)s(c),K.sortIndex=K.expirationTime,n(u,K);else break;K=i(c)}}function M(H){if(S=!1,E(H),!C)if(i(u)!==null)C=!0,O||(O=!0,I());else{var K=i(c);K!==null&&G(M,K.startTime-H)}}var O=!1,T=-1,A=5,k=-1;function q(){return p?!0:!(e.unstable_now()-k<A)}function z(){if(p=!1,O){var H=e.unstable_now();k=H;var K=!0;try{e:{C=!1,S&&(S=!1,b(T),T=-1),x=!0;var F=_;try{t:{for(E(H),m=i(u);m!==null&&!(m.expirationTime>H&&q());){var N=m.callback;if(typeof N=="function"){m.callback=null,_=m.priorityLevel;var $=N(m.expirationTime<=H);if(H=e.unstable_now(),typeof $=="function"){m.callback=$,E(H),K=!0;break t}m===i(u)&&s(u),E(H)}else s(u);m=i(u)}if(m!==null)K=!0;else{var B=i(c);B!==null&&G(M,B.startTime-H),K=!1}}break e}finally{m=null,_=F,x=!1}K=void 0}}finally{K?I():O=!1}}}var I;if(typeof y=="function")I=function(){y(z)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,U=W.port2;W.port1.onmessage=z,I=function(){U.postMessage(null)}}else I=function(){g(z,0)};function G(H,K){T=g(function(){H(e.unstable_now())},K)}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(H){H.callback=null},e.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<H?Math.floor(1e3/H):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(H){switch(_){case 1:case 2:case 3:var K=3;break;default:K=_}var F=_;_=K;try{return H()}finally{_=F}},e.unstable_requestPaint=function(){p=!0},e.unstable_runWithPriority=function(H,K){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var F=_;_=H;try{return K()}finally{_=F}},e.unstable_scheduleCallback=function(H,K,F){var N=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?N+F:N):F=N,H){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=F+$,H={id:v++,callback:K,priorityLevel:H,startTime:F,expirationTime:$,sortIndex:-1},F>N?(H.sortIndex=F,n(c,H),i(u)===null&&H===i(c)&&(S?(b(T),T=-1):S=!0,G(M,F-N))):(H.sortIndex=$,n(u,H),C||x||(C=!0,O||(O=!0,I()))),H},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(H){var K=_;return function(){var F=_;_=K;try{return H.apply(this,arguments)}finally{_=F}}}})(Yd)),Yd}var Z0;function lR(){return Z0||(Z0=1,Wd.exports=aR()),Wd.exports}var Kd={exports:{}},un={};var J0;function cR(){if(J0)return un;J0=1;var e=jl();function n(u){var c="https://react.dev/errors/"+u;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)c+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+u+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var s={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},a=Symbol.for("react.portal");function f(u,c,v){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:u,containerInfo:c,implementation:v}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(u,c){if(u==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return un.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,un.createPortal=function(u,c){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(n(299));return f(u,c,null,v)},un.flushSync=function(u){var c=d.T,v=s.p;try{if(d.T=null,s.p=2,u)return u()}finally{d.T=c,s.p=v,s.d.f()}},un.preconnect=function(u,c){typeof u=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,s.d.C(u,c))},un.prefetchDNS=function(u){typeof u=="string"&&s.d.D(u)},un.preinit=function(u,c){if(typeof u=="string"&&c&&typeof c.as=="string"){var v=c.as,m=l(v,c.crossOrigin),_=typeof c.integrity=="string"?c.integrity:void 0,x=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;v==="style"?s.d.S(u,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:m,integrity:_,fetchPriority:x}):v==="script"&&s.d.X(u,{crossOrigin:m,integrity:_,fetchPriority:x,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},un.preinitModule=function(u,c){if(typeof u=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var v=l(c.as,c.crossOrigin);s.d.M(u,{crossOrigin:v,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&s.d.M(u)},un.preload=function(u,c){if(typeof u=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var v=c.as,m=l(v,c.crossOrigin);s.d.L(u,v,{crossOrigin:m,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},un.preloadModule=function(u,c){if(typeof u=="string")if(c){var v=l(c.as,c.crossOrigin);s.d.m(u,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:v,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else s.d.m(u)},un.requestFormReset=function(u){s.d.r(u)},un.unstable_batchedUpdates=function(u,c){return u(c)},un.useFormState=function(u,c,v){return d.H.useFormState(u,c,v)},un.useFormStatus=function(){return d.H.useHostTransitionStatus()},un.version="19.2.3",un}var ey;function IS(){if(ey)return Kd.exports;ey=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(n){console.error(n)}}return e(),Kd.exports=cR(),Kd.exports}var ty;function uR(){if(ty)return il;ty=1;var e=lR(),n=jl(),i=IS();function s(t){var r="https://react.dev/errors/"+t;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)r+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function f(t){var r=t,o=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(o=r.return),t=r.return;while(t)}return r.tag===3?o:null}function d(t){if(t.tag===13){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function l(t){if(t.tag===31){var r=t.memoizedState;if(r===null&&(t=t.alternate,t!==null&&(r=t.memoizedState)),r!==null)return r.dehydrated}return null}function u(t){if(f(t)!==t)throw Error(s(188))}function c(t){var r=t.alternate;if(!r){if(r=f(t),r===null)throw Error(s(188));return r!==t?null:t}for(var o=t,h=r;;){var w=o.return;if(w===null)break;var R=w.alternate;if(R===null){if(h=w.return,h!==null){o=h;continue}break}if(w.child===R.child){for(R=w.child;R;){if(R===o)return u(w),t;if(R===h)return u(w),r;R=R.sibling}throw Error(s(188))}if(o.return!==h.return)o=w,h=R;else{for(var j=!1,Y=w.child;Y;){if(Y===o){j=!0,o=w,h=R;break}if(Y===h){j=!0,h=w,o=R;break}Y=Y.sibling}if(!j){for(Y=R.child;Y;){if(Y===o){j=!0,o=R,h=w;break}if(Y===h){j=!0,h=R,o=w;break}Y=Y.sibling}if(!j)throw Error(s(189))}}if(o.alternate!==h)throw Error(s(190))}if(o.tag!==3)throw Error(s(188));return o.stateNode.current===o?t:r}function v(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t;for(t=t.child;t!==null;){if(r=v(t),r!==null)return r;t=t.sibling}return null}var m=Object.assign,_=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),b=Symbol.for("react.consumer"),y=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),z=Symbol.iterator;function I(t){return t===null||typeof t!="object"?null:(t=z&&t[z]||t["@@iterator"],typeof t=="function"?t:null)}var W=Symbol.for("react.client.reference");function U(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===W?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case S:return"Fragment";case g:return"Profiler";case p:return"StrictMode";case M:return"Suspense";case O:return"SuspenseList";case k:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case C:return"Portal";case y:return t.displayName||"Context";case b:return(t._context.displayName||"Context")+".Consumer";case E:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case T:return r=t.displayName||null,r!==null?r:U(t.type)||"Memo";case A:r=t._payload,t=t._init;try{return U(t(r))}catch{}}return null}var G=Array.isArray,H=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},N=[],$=-1;function B(t){return{current:t}}function P(t){0>$||(t.current=N[$],N[$]=null,$--)}function Q(t,r){$++,N[$]=t.current,t.current=r}var J=B(null),ae=B(null),Z=B(null),X=B(null);function V(t,r){switch(Q(Z,r),Q(ae,t),Q(J,null),r.nodeType){case 9:case 11:t=(t=r.documentElement)&&(t=t.namespaceURI)?g0(t):0;break;default:if(t=r.tagName,r=r.namespaceURI)r=g0(r),t=v0(r,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}P(J),Q(J,t)}function ie(){P(J),P(ae),P(Z)}function de(t){t.memoizedState!==null&&Q(X,t);var r=J.current,o=v0(r,t.type);r!==o&&(Q(ae,t),Q(J,o))}function re(t){ae.current===t&&(P(J),P(ae)),X.current===t&&(P(X),Ja._currentValue=F)}var le,_e;function Ce(t){if(le===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);le=r&&r[1]||"",_e=-1<o.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+le+t+_e}var He=!1;function Be(t,r){if(!t||He)return"";He=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(r){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 he=me}Reflect.construct(t,[],ve)}else{try{ve.call()}catch(me){he=me}t.call(ve.prototype)}}else{try{throw Error()}catch(me){he=me}(ve=t())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(me){if(me&&he&&typeof me.stack=="string")return[me.stack,he.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var w=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");w&&w.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var R=h.DetermineComponentFrameRoot(),j=R[0],Y=R[1];if(j&&Y){var te=j.split(`
4
+ `),ue=Y.split(`
5
+ `);for(w=h=0;h<te.length&&!te[h].includes("DetermineComponentFrameRoot");)h++;for(;w<ue.length&&!ue[w].includes("DetermineComponentFrameRoot");)w++;if(h===te.length||w===ue.length)for(h=te.length-1,w=ue.length-1;1<=h&&0<=w&&te[h]!==ue[w];)w--;for(;1<=h&&0<=w;h--,w--)if(te[h]!==ue[w]){if(h!==1||w!==1)do if(h--,w--,0>w||te[h]!==ue[w]){var pe=`
6
+ `+te[h].replace(" at new "," at ");return t.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",t.displayName)),pe}while(1<=h&&0<=w);break}}}finally{He=!1,Error.prepareStackTrace=o}return(o=t?t.displayName||t.name:"")?Ce(o):""}function we(t,r){switch(t.tag){case 26:case 27:case 5:return Ce(t.type);case 16:return Ce("Lazy");case 13:return t.child!==r&&r!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return Be(t.type,!1);case 11:return Be(t.type.render,!1);case 1:return Be(t.type,!0);case 31:return Ce("Activity");default:return""}}function Ft(t){try{var r="",o=null;do r+=we(t,o),o=t,t=t.return;while(t);return r}catch(h){return`
7
+ Error generating stack: `+h.message+`
8
+ `+h.stack}}var kt=Object.prototype.hasOwnProperty,en=e.unstable_scheduleCallback,hn=e.unstable_cancelCallback,yn=e.unstable_shouldYield,Rt=e.unstable_requestPaint,it=e.unstable_now,Et=e.unstable_getCurrentPriorityLevel,Kt=e.unstable_ImmediatePriority,an=e.unstable_UserBlockingPriority,gt=e.unstable_NormalPriority,Gt=e.unstable_LowPriority,Xt=e.unstable_IdlePriority,sr=e.log,st=e.unstable_setDisableYieldValue,or=null,_t=null;function Ln(t){if(typeof sr=="function"&&st(t),_t&&typeof _t.setStrictMode=="function")try{_t.setStrictMode(or,t)}catch{}}var Qt=Math.clz32?Math.clz32:to,eo=Math.log,fa=Math.LN2;function to(t){return t>>>=0,t===0?32:31-(eo(t)/fa|0)|0}var ar=256,Wr=262144,wr=4194304;function lr(t){var r=t&42;if(r!==0)return r;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Yr(t,r,o){var h=t.pendingLanes;if(h===0)return 0;var w=0,R=t.suspendedLanes,j=t.pingedLanes;t=t.warmLanes;var Y=h&134217727;return Y!==0?(h=Y&~R,h!==0?w=lr(h):(j&=Y,j!==0?w=lr(j):o||(o=Y&~t,o!==0&&(w=lr(o))))):(Y=h&~R,Y!==0?w=lr(Y):j!==0?w=lr(j):o||(o=h&~t,o!==0&&(w=lr(o)))),w===0?0:r!==0&&r!==w&&(r&R)===0&&(R=w&-w,o=r&-r,R>=o||R===32&&(o&4194048)!==0)?r:w}function Kr(t,r){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&r)===0}function no(t,r){switch(t){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 Gr(){var t=wr;return wr<<=1,(wr&62914560)===0&&(wr=4194304),t}function Cr(t){for(var r=[],o=0;31>o;o++)r.push(t);return r}function Er(t,r){t.pendingLanes|=r,r!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function da(t,r,o,h,w,R){var j=t.pendingLanes;t.pendingLanes=o,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=o,t.entangledLanes&=o,t.errorRecoveryDisabledLanes&=o,t.shellSuspendCounter=0;var Y=t.entanglements,te=t.expirationTimes,ue=t.hiddenUpdates;for(o=j&~o;0<o;){var pe=31-Qt(o),ve=1<<pe;Y[pe]=0,te[pe]=-1;var he=ue[pe];if(he!==null)for(ue[pe]=null,pe=0;pe<he.length;pe++){var me=he[pe];me!==null&&(me.lane&=-536870913)}o&=~ve}h!==0&&ro(t,h,0),R!==0&&w===0&&t.tag!==0&&(t.suspendedLanes|=R&~(j&~r))}function ro(t,r,o){t.pendingLanes|=r,t.suspendedLanes&=~r;var h=31-Qt(r);t.entangledLanes|=r,t.entanglements[h]=t.entanglements[h]|1073741824|o&261930}function ee(t,r){var o=t.entangledLanes|=r;for(t=t.entanglements;o;){var h=31-Qt(o),w=1<<h;w&r|t[h]&r&&(t[h]|=r),o&=~w}}function oe(t,r){var o=r&-r;return o=(o&42)!==0?1:fe(o),(o&(t.suspendedLanes|r))!==0?0:o}function fe(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function ye(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function be(){var t=K.p;return t!==0?t:(t=window.event,t===void 0?32:I0(t.type))}function De(t,r){var o=K.p;try{return K.p=t,r()}finally{K.p=o}}var Ee=Math.random().toString(36).slice(2),Se="__reactFiber$"+Ee,xe="__reactProps$"+Ee,Me="__reactContainer$"+Ee,Oe="__reactEvents$"+Ee,ke="__reactListeners$"+Ee,We="__reactHandles$"+Ee,ot="__reactResources$"+Ee,mt="__reactMarker$"+Ee;function St(t){delete t[Se],delete t[xe],delete t[Oe],delete t[ke],delete t[We]}function Je(t){var r=t[Se];if(r)return r;for(var o=t.parentNode;o;){if(r=o[Me]||o[Se]){if(o=r.alternate,r.child!==null||o!==null&&o.child!==null)for(t=C0(t);t!==null;){if(o=t[Se])return o;t=C0(t)}return r}t=o,o=t.parentNode}return null}function et(t){if(t=t[Se]||t[Me]){var r=t.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return t}return null}function ln(t){var r=t.tag;if(r===5||r===26||r===27||r===6)return t.stateNode;throw Error(s(33))}function bn(t){var r=t[ot];return r||(r=t[ot]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function lt(t){t[mt]=!0}var fn=new Set,Ei={};function dn(t,r){cn(t,r),cn(t+"Capture",r)}function cn(t,r){for(Ei[t]=r,t=0;t<r.length;t++)fn.add(r[t])}var Ri=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]*$"),Rr={},Ve={};function Nt(t){return kt.call(Ve,t)?!0:kt.call(Rr,t)?!1:Ri.test(t)?Ve[t]=!0:(Rr[t]=!0,!1)}function kn(t,r,o){if(Nt(r))if(o===null)t.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":t.removeAttribute(r);return;case"boolean":var h=r.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){t.removeAttribute(r);return}}t.setAttribute(r,""+o)}}function Sn(t,r,o){if(o===null)t.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(r);return}t.setAttribute(r,""+o)}}function tt(t,r,o,h){if(h===null)t.removeAttribute(o);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(o);return}t.setAttributeNS(r,o,""+h)}}function $t(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ds(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function ma(t,r,o){var h=Object.getOwnPropertyDescriptor(t.constructor.prototype,r);if(!t.hasOwnProperty(r)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var w=h.get,R=h.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return w.call(this)},set:function(j){o=""+j,R.call(this,j)}}),Object.defineProperty(t,r,{enumerable:h.enumerable}),{getValue:function(){return o},setValue:function(j){o=""+j},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function io(t){if(!t._valueTracker){var r=ds(t)?"checked":"value";t._valueTracker=ma(t,r,""+t[r])}}function Zl(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var o=r.getValue(),h="";return t&&(h=ds(t)?t.checked?"true":"false":t.value),t=h,t!==o?(r.setValue(t),!0):!1}function ms(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Hh=/[\n"\\]/g;function xn(t){return t.replace(Hh,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function ps(t,r,o,h,w,R,j,Y){t.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?t.type=j:t.removeAttribute("type"),r!=null?j==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+$t(r)):t.value!==""+$t(r)&&(t.value=""+$t(r)):j!=="submit"&&j!=="reset"||t.removeAttribute("value"),r!=null?pa(t,j,$t(r)):o!=null?pa(t,j,$t(o)):h!=null&&t.removeAttribute("value"),w==null&&R!=null&&(t.defaultChecked=!!R),w!=null&&(t.checked=w&&typeof w!="function"&&typeof w!="symbol"),Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"?t.name=""+$t(Y):t.removeAttribute("name")}function Jl(t,r,o,h,w,R,j,Y){if(R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(t.type=R),r!=null||o!=null){if(!(R!=="submit"&&R!=="reset"||r!=null)){io(t);return}o=o!=null?""+$t(o):"",r=r!=null?""+$t(r):o,Y||r===t.value||(t.value=r),t.defaultValue=r}h=h??w,h=typeof h!="function"&&typeof h!="symbol"&&!!h,t.checked=Y?t.checked:!!h,t.defaultChecked=!!h,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(t.name=j),io(t)}function pa(t,r,o){r==="number"&&ms(t.ownerDocument)===t||t.defaultValue===""+o||(t.defaultValue=""+o)}function Xr(t,r,o,h){if(t=t.options,r){r={};for(var w=0;w<o.length;w++)r["$"+o[w]]=!0;for(o=0;o<t.length;o++)w=r.hasOwnProperty("$"+t[o].value),t[o].selected!==w&&(t[o].selected=w),w&&h&&(t[o].defaultSelected=!0)}else{for(o=""+$t(o),r=null,w=0;w<t.length;w++){if(t[w].value===o){t[w].selected=!0,h&&(t[w].defaultSelected=!0);return}r!==null||t[w].disabled||(r=t[w])}r!==null&&(r.selected=!0)}}function hg(t,r,o){if(r!=null&&(r=""+$t(r),r!==t.value&&(t.value=r),o==null)){t.defaultValue!==r&&(t.defaultValue=r);return}t.defaultValue=o!=null?""+$t(o):""}function fg(t,r,o,h){if(r==null){if(h!=null){if(o!=null)throw Error(s(92));if(G(h)){if(1<h.length)throw Error(s(93));h=h[0]}o=h}o==null&&(o=""),r=o}o=$t(r),t.defaultValue=o,h=t.textContent,h===o&&h!==""&&h!==null&&(t.value=h),io(t)}function so(t,r){if(r){var o=t.firstChild;if(o&&o===t.lastChild&&o.nodeType===3){o.nodeValue=r;return}}t.textContent=r}var ZC=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 dg(t,r,o){var h=r.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?h?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="":h?t.setProperty(r,o):typeof o!="number"||o===0||ZC.has(r)?r==="float"?t.cssFloat=o:t[r]=(""+o).trim():t[r]=o+"px"}function mg(t,r,o){if(r!=null&&typeof r!="object")throw Error(s(62));if(t=t.style,o!=null){for(var h in o)!o.hasOwnProperty(h)||r!=null&&r.hasOwnProperty(h)||(h.indexOf("--")===0?t.setProperty(h,""):h==="float"?t.cssFloat="":t[h]="");for(var w in r)h=r[w],r.hasOwnProperty(w)&&o[w]!==h&&dg(t,w,h)}else for(var R in r)r.hasOwnProperty(R)&&dg(t,R,r[R])}function zh(t){if(t.indexOf("-")===-1)return!1;switch(t){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 JC=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"]]),eE=/^[\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 ec(t){return eE.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Qr(){}var Ph=null;function Ih(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var oo=null,ao=null;function pg(t){var r=et(t);if(r&&(t=r.stateNode)){var o=t[xe]||null;e:switch(t=r.stateNode,r.type){case"input":if(ps(t,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),r=o.name,o.type==="radio"&&r!=null){for(o=t;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+xn(""+r)+'"][type="radio"]'),r=0;r<o.length;r++){var h=o[r];if(h!==t&&h.form===t.form){var w=h[xe]||null;if(!w)throw Error(s(90));ps(h,w.value,w.defaultValue,w.defaultValue,w.checked,w.defaultChecked,w.type,w.name)}}for(r=0;r<o.length;r++)h=o[r],h.form===t.form&&Zl(h)}break e;case"textarea":hg(t,o.value,o.defaultValue);break e;case"select":r=o.value,r!=null&&Xr(t,!!o.multiple,r,!1)}}}var Uh=!1;function gg(t,r,o){if(Uh)return t(r,o);Uh=!0;try{var h=t(r);return h}finally{if(Uh=!1,(oo!==null||ao!==null)&&(Uc(),oo&&(r=oo,t=ao,ao=oo=null,pg(r),t)))for(r=0;r<t.length;r++)pg(t[r])}}function ga(t,r){var o=t.stateNode;if(o===null)return null;var h=o[xe]||null;if(h===null)return null;o=h[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(t=t.type,h=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!h;break e;default:t=!1}if(t)return null;if(o&&typeof o!="function")throw Error(s(231,r,typeof o));return o}var Zr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fh=!1;if(Zr)try{var va={};Object.defineProperty(va,"passive",{get:function(){Fh=!0}}),window.addEventListener("test",va,va),window.removeEventListener("test",va,va)}catch{Fh=!1}var Ai=null,$h=null,tc=null;function vg(){if(tc)return tc;var t,r=$h,o=r.length,h,w="value"in Ai?Ai.value:Ai.textContent,R=w.length;for(t=0;t<o&&r[t]===w[t];t++);var j=o-t;for(h=1;h<=j&&r[o-h]===w[R-h];h++);return tc=w.slice(t,1<h?1-h:void 0)}function nc(t){var r=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&r===13&&(t=13)):t=r,t===10&&(t=13),32<=t||t===13?t:0}function rc(){return!0}function _g(){return!1}function wn(t){function r(o,h,w,R,j){this._reactName=o,this._targetInst=w,this.type=h,this.nativeEvent=R,this.target=j,this.currentTarget=null;for(var Y in t)t.hasOwnProperty(Y)&&(o=t[Y],this[Y]=o?o(R):R[Y]);return this.isDefaultPrevented=(R.defaultPrevented!=null?R.defaultPrevented:R.returnValue===!1)?rc:_g,this.isPropagationStopped=_g,this}return m(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=rc)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=rc)},persist:function(){},isPersistent:rc}),r}var gs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ic=wn(gs),_a=m({},gs,{view:0,detail:0}),tE=wn(_a),Vh,qh,ya,sc=m({},_a,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yh,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==ya&&(ya&&t.type==="mousemove"?(Vh=t.screenX-ya.screenX,qh=t.screenY-ya.screenY):qh=Vh=0,ya=t),Vh)},movementY:function(t){return"movementY"in t?t.movementY:qh}}),yg=wn(sc),nE=m({},sc,{dataTransfer:0}),rE=wn(nE),iE=m({},_a,{relatedTarget:0}),Wh=wn(iE),sE=m({},gs,{animationName:0,elapsedTime:0,pseudoElement:0}),oE=wn(sE),aE=m({},gs,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),lE=wn(aE),cE=m({},gs,{data:0}),bg=wn(cE),uE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hE={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"},fE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dE(t){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(t):(t=fE[t])?!!r[t]:!1}function Yh(){return dE}var mE=m({},_a,{key:function(t){if(t.key){var r=uE[t.key]||t.key;if(r!=="Unidentified")return r}return t.type==="keypress"?(t=nc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?hE[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yh,charCode:function(t){return t.type==="keypress"?nc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?nc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),pE=wn(mE),gE=m({},sc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sg=wn(gE),vE=m({},_a,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yh}),_E=wn(vE),yE=m({},gs,{propertyName:0,elapsedTime:0,pseudoElement:0}),bE=wn(yE),SE=m({},sc,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),xE=wn(SE),wE=m({},gs,{newState:0,oldState:0}),CE=wn(wE),EE=[9,13,27,32],Kh=Zr&&"CompositionEvent"in window,ba=null;Zr&&"documentMode"in document&&(ba=document.documentMode);var RE=Zr&&"TextEvent"in window&&!ba,xg=Zr&&(!Kh||ba&&8<ba&&11>=ba),wg=" ",Cg=!1;function Eg(t,r){switch(t){case"keyup":return EE.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var lo=!1;function AE(t,r){switch(t){case"compositionend":return Rg(r);case"keypress":return r.which!==32?null:(Cg=!0,wg);case"textInput":return t=r.data,t===wg&&Cg?null:t;default:return null}}function TE(t,r){if(lo)return t==="compositionend"||!Kh&&Eg(t,r)?(t=vg(),tc=$h=Ai=null,lo=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return xg&&r.locale!=="ko"?null:r.data;default:return null}}var ME={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 Ag(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r==="input"?!!ME[t.type]:r==="textarea"}function Tg(t,r,o,h){oo?ao?ao.push(h):ao=[h]:oo=h,r=Kc(r,"onChange"),0<r.length&&(o=new ic("onChange","change",null,o,h),t.push({event:o,listeners:r}))}var Sa=null,xa=null;function DE(t){u0(t,0)}function oc(t){var r=ln(t);if(Zl(r))return t}function Mg(t,r){if(t==="change")return r}var Dg=!1;if(Zr){var Gh;if(Zr){var Xh="oninput"in document;if(!Xh){var Og=document.createElement("div");Og.setAttribute("oninput","return;"),Xh=typeof Og.oninput=="function"}Gh=Xh}else Gh=!1;Dg=Gh&&(!document.documentMode||9<document.documentMode)}function Lg(){Sa&&(Sa.detachEvent("onpropertychange",kg),xa=Sa=null)}function kg(t){if(t.propertyName==="value"&&oc(xa)){var r=[];Tg(r,xa,t,Ih(t)),gg(DE,r)}}function OE(t,r,o){t==="focusin"?(Lg(),Sa=r,xa=o,Sa.attachEvent("onpropertychange",kg)):t==="focusout"&&Lg()}function LE(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return oc(xa)}function kE(t,r){if(t==="click")return oc(r)}function NE(t,r){if(t==="input"||t==="change")return oc(r)}function BE(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var Nn=typeof Object.is=="function"?Object.is:BE;function wa(t,r){if(Nn(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var o=Object.keys(t),h=Object.keys(r);if(o.length!==h.length)return!1;for(h=0;h<o.length;h++){var w=o[h];if(!kt.call(r,w)||!Nn(t[w],r[w]))return!1}return!0}function Ng(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Bg(t,r){var o=Ng(t);t=0;for(var h;o;){if(o.nodeType===3){if(h=t+o.textContent.length,t<=r&&h>=r)return{node:o,offset:r-t};t=h}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Ng(o)}}function jg(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?jg(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function Hg(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var r=ms(t.document);r instanceof t.HTMLIFrameElement;){try{var o=typeof r.contentWindow.location.href=="string"}catch{o=!1}if(o)t=r.contentWindow;else break;r=ms(t.document)}return r}function Qh(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}var jE=Zr&&"documentMode"in document&&11>=document.documentMode,co=null,Zh=null,Ca=null,Jh=!1;function zg(t,r,o){var h=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Jh||co==null||co!==ms(h)||(h=co,"selectionStart"in h&&Qh(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Ca&&wa(Ca,h)||(Ca=h,h=Kc(Zh,"onSelect"),0<h.length&&(r=new ic("onSelect","select",null,r,o),t.push({event:r,listeners:h}),r.target=co)))}function vs(t,r){var o={};return o[t.toLowerCase()]=r.toLowerCase(),o["Webkit"+t]="webkit"+r,o["Moz"+t]="moz"+r,o}var uo={animationend:vs("Animation","AnimationEnd"),animationiteration:vs("Animation","AnimationIteration"),animationstart:vs("Animation","AnimationStart"),transitionrun:vs("Transition","TransitionRun"),transitionstart:vs("Transition","TransitionStart"),transitioncancel:vs("Transition","TransitionCancel"),transitionend:vs("Transition","TransitionEnd")},ef={},Pg={};Zr&&(Pg=document.createElement("div").style,"AnimationEvent"in window||(delete uo.animationend.animation,delete uo.animationiteration.animation,delete uo.animationstart.animation),"TransitionEvent"in window||delete uo.transitionend.transition);function _s(t){if(ef[t])return ef[t];if(!uo[t])return t;var r=uo[t],o;for(o in r)if(r.hasOwnProperty(o)&&o in Pg)return ef[t]=r[o];return t}var Ig=_s("animationend"),Ug=_s("animationiteration"),Fg=_s("animationstart"),HE=_s("transitionrun"),zE=_s("transitionstart"),PE=_s("transitioncancel"),$g=_s("transitionend"),Vg=new Map,tf="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(" ");tf.push("scrollEnd");function cr(t,r){Vg.set(t,r),dn(r,[t])}var ac=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Wn=[],ho=0,nf=0;function lc(){for(var t=ho,r=nf=ho=0;r<t;){var o=Wn[r];Wn[r++]=null;var h=Wn[r];Wn[r++]=null;var w=Wn[r];Wn[r++]=null;var R=Wn[r];if(Wn[r++]=null,h!==null&&w!==null){var j=h.pending;j===null?w.next=w:(w.next=j.next,j.next=w),h.pending=w}R!==0&&qg(o,w,R)}}function cc(t,r,o,h){Wn[ho++]=t,Wn[ho++]=r,Wn[ho++]=o,Wn[ho++]=h,nf|=h,t.lanes|=h,t=t.alternate,t!==null&&(t.lanes|=h)}function rf(t,r,o,h){return cc(t,r,o,h),uc(t)}function ys(t,r){return cc(t,null,null,r),uc(t)}function qg(t,r,o){t.lanes|=o;var h=t.alternate;h!==null&&(h.lanes|=o);for(var w=!1,R=t.return;R!==null;)R.childLanes|=o,h=R.alternate,h!==null&&(h.childLanes|=o),R.tag===22&&(t=R.stateNode,t===null||t._visibility&1||(w=!0)),t=R,R=R.return;return t.tag===3?(R=t.stateNode,w&&r!==null&&(w=31-Qt(o),t=R.hiddenUpdates,h=t[w],h===null?t[w]=[r]:h.push(r),r.lane=o|536870912),R):null}function uc(t){if(50<Wa)throw Wa=0,dd=null,Error(s(185));for(var r=t.return;r!==null;)t=r,r=t.return;return t.tag===3?t.stateNode:null}var fo={};function IE(t,r,o,h){this.tag=t,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bn(t,r,o,h){return new IE(t,r,o,h)}function sf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Jr(t,r){var o=t.alternate;return o===null?(o=Bn(t.tag,r,t.key,t.mode),o.elementType=t.elementType,o.type=t.type,o.stateNode=t.stateNode,o.alternate=t,t.alternate=o):(o.pendingProps=r,o.type=t.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=t.flags&65011712,o.childLanes=t.childLanes,o.lanes=t.lanes,o.child=t.child,o.memoizedProps=t.memoizedProps,o.memoizedState=t.memoizedState,o.updateQueue=t.updateQueue,r=t.dependencies,o.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},o.sibling=t.sibling,o.index=t.index,o.ref=t.ref,o.refCleanup=t.refCleanup,o}function Wg(t,r){t.flags&=65011714;var o=t.alternate;return o===null?(t.childLanes=0,t.lanes=r,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=o.childLanes,t.lanes=o.lanes,t.child=o.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=o.memoizedProps,t.memoizedState=o.memoizedState,t.updateQueue=o.updateQueue,t.type=o.type,r=o.dependencies,t.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),t}function hc(t,r,o,h,w,R){var j=0;if(h=t,typeof t=="function")sf(t)&&(j=1);else if(typeof t=="string")j=q2(t,o,J.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case k:return t=Bn(31,o,r,w),t.elementType=k,t.lanes=R,t;case S:return bs(o.children,w,R,r);case p:j=8,w|=24;break;case g:return t=Bn(12,o,r,w|2),t.elementType=g,t.lanes=R,t;case M:return t=Bn(13,o,r,w),t.elementType=M,t.lanes=R,t;case O:return t=Bn(19,o,r,w),t.elementType=O,t.lanes=R,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case y:j=10;break e;case b:j=9;break e;case E:j=11;break e;case T:j=14;break e;case A:j=16,h=null;break e}j=29,o=Error(s(130,t===null?"null":typeof t,"")),h=null}return r=Bn(j,o,r,w),r.elementType=t,r.type=h,r.lanes=R,r}function bs(t,r,o,h){return t=Bn(7,t,h,r),t.lanes=o,t}function of(t,r,o){return t=Bn(6,t,null,r),t.lanes=o,t}function Yg(t){var r=Bn(18,null,null,0);return r.stateNode=t,r}function af(t,r,o){return r=Bn(4,t.children!==null?t.children:[],t.key,r),r.lanes=o,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}var Kg=new WeakMap;function Yn(t,r){if(typeof t=="object"&&t!==null){var o=Kg.get(t);return o!==void 0?o:(r={value:t,source:r,stack:Ft(r)},Kg.set(t,r),r)}return{value:t,source:r,stack:Ft(r)}}var mo=[],po=0,fc=null,Ea=0,Kn=[],Gn=0,Ti=null,Ar=1,Tr="";function ei(t,r){mo[po++]=Ea,mo[po++]=fc,fc=t,Ea=r}function Gg(t,r,o){Kn[Gn++]=Ar,Kn[Gn++]=Tr,Kn[Gn++]=Ti,Ti=t;var h=Ar;t=Tr;var w=32-Qt(h)-1;h&=~(1<<w),o+=1;var R=32-Qt(r)+w;if(30<R){var j=w-w%5;R=(h&(1<<j)-1).toString(32),h>>=j,w-=j,Ar=1<<32-Qt(r)+w|o<<w|h,Tr=R+t}else Ar=1<<R|o<<w|h,Tr=t}function lf(t){t.return!==null&&(ei(t,1),Gg(t,1,0))}function cf(t){for(;t===fc;)fc=mo[--po],mo[po]=null,Ea=mo[--po],mo[po]=null;for(;t===Ti;)Ti=Kn[--Gn],Kn[Gn]=null,Tr=Kn[--Gn],Kn[Gn]=null,Ar=Kn[--Gn],Kn[Gn]=null}function Xg(t,r){Kn[Gn++]=Ar,Kn[Gn++]=Tr,Kn[Gn++]=Ti,Ar=r.id,Tr=r.overflow,Ti=t}var tn=null,yt=null,Qe=!1,Mi=null,Xn=!1,uf=Error(s(519));function Di(t){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ra(Yn(r,t)),uf}function Qg(t){var r=t.stateNode,o=t.type,h=t.memoizedProps;switch(r[Se]=t,r[xe]=h,o){case"dialog":Ke("cancel",r),Ke("close",r);break;case"iframe":case"object":case"embed":Ke("load",r);break;case"video":case"audio":for(o=0;o<Ka.length;o++)Ke(Ka[o],r);break;case"source":Ke("error",r);break;case"img":case"image":case"link":Ke("error",r),Ke("load",r);break;case"details":Ke("toggle",r);break;case"input":Ke("invalid",r),Jl(r,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":Ke("invalid",r);break;case"textarea":Ke("invalid",r),fg(r,h.value,h.defaultValue,h.children)}o=h.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||r.textContent===""+o||h.suppressHydrationWarning===!0||m0(r.textContent,o)?(h.popover!=null&&(Ke("beforetoggle",r),Ke("toggle",r)),h.onScroll!=null&&Ke("scroll",r),h.onScrollEnd!=null&&Ke("scrollend",r),h.onClick!=null&&(r.onclick=Qr),r=!0):r=!1,r||Di(t,!0)}function Zg(t){for(tn=t.return;tn;)switch(tn.tag){case 5:case 31:case 13:Xn=!1;return;case 27:case 3:Xn=!0;return;default:tn=tn.return}}function go(t){if(t!==tn)return!1;if(!Qe)return Zg(t),Qe=!0,!1;var r=t.tag,o;if((o=r!==3&&r!==27)&&((o=r===5)&&(o=t.type,o=!(o!=="form"&&o!=="button")||Td(t.type,t.memoizedProps)),o=!o),o&&yt&&Di(t),Zg(t),r===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));yt=w0(t)}else if(r===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));yt=w0(t)}else r===27?(r=yt,Vi(t.type)?(t=kd,kd=null,yt=t):yt=r):yt=tn?Zn(t.stateNode.nextSibling):null;return!0}function Ss(){yt=tn=null,Qe=!1}function hf(){var t=Mi;return t!==null&&(An===null?An=t:An.push.apply(An,t),Mi=null),t}function Ra(t){Mi===null?Mi=[t]:Mi.push(t)}var ff=B(null),xs=null,ti=null;function Oi(t,r,o){Q(ff,r._currentValue),r._currentValue=o}function ni(t){t._currentValue=ff.current,P(ff)}function df(t,r,o){for(;t!==null;){var h=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,h!==null&&(h.childLanes|=r)):h!==null&&(h.childLanes&r)!==r&&(h.childLanes|=r),t===o)break;t=t.return}}function mf(t,r,o,h){var w=t.child;for(w!==null&&(w.return=t);w!==null;){var R=w.dependencies;if(R!==null){var j=w.child;R=R.firstContext;e:for(;R!==null;){var Y=R;R=w;for(var te=0;te<r.length;te++)if(Y.context===r[te]){R.lanes|=o,Y=R.alternate,Y!==null&&(Y.lanes|=o),df(R.return,o,t),h||(j=null);break e}R=Y.next}}else if(w.tag===18){if(j=w.return,j===null)throw Error(s(341));j.lanes|=o,R=j.alternate,R!==null&&(R.lanes|=o),df(j,o,t),j=null}else j=w.child;if(j!==null)j.return=w;else for(j=w;j!==null;){if(j===t){j=null;break}if(w=j.sibling,w!==null){w.return=j.return,j=w;break}j=j.return}w=j}}function vo(t,r,o,h){t=null;for(var w=r,R=!1;w!==null;){if(!R){if((w.flags&524288)!==0)R=!0;else if((w.flags&262144)!==0)break}if(w.tag===10){var j=w.alternate;if(j===null)throw Error(s(387));if(j=j.memoizedProps,j!==null){var Y=w.type;Nn(w.pendingProps.value,j.value)||(t!==null?t.push(Y):t=[Y])}}else if(w===X.current){if(j=w.alternate,j===null)throw Error(s(387));j.memoizedState.memoizedState!==w.memoizedState.memoizedState&&(t!==null?t.push(Ja):t=[Ja])}w=w.return}t!==null&&mf(r,t,o,h),r.flags|=262144}function dc(t){for(t=t.firstContext;t!==null;){if(!Nn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function ws(t){xs=t,ti=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function nn(t){return Jg(xs,t)}function mc(t,r){return xs===null&&ws(t),Jg(t,r)}function Jg(t,r){var o=r._currentValue;if(r={context:r,memoizedValue:o,next:null},ti===null){if(t===null)throw Error(s(308));ti=r,t.dependencies={lanes:0,firstContext:r},t.flags|=524288}else ti=ti.next=r;return o}var UE=typeof AbortController<"u"?AbortController:function(){var t=[],r=this.signal={aborted:!1,addEventListener:function(o,h){t.push(h)}};this.abort=function(){r.aborted=!0,t.forEach(function(o){return o()})}},FE=e.unstable_scheduleCallback,$E=e.unstable_NormalPriority,Bt={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pf(){return{controller:new UE,data:new Map,refCount:0}}function Aa(t){t.refCount--,t.refCount===0&&FE($E,function(){t.controller.abort()})}var Ta=null,gf=0,_o=0,yo=null;function VE(t,r){if(Ta===null){var o=Ta=[];gf=0,_o=yd(),yo={status:"pending",value:void 0,then:function(h){o.push(h)}}}return gf++,r.then(ev,ev),r}function ev(){if(--gf===0&&Ta!==null){yo!==null&&(yo.status="fulfilled");var t=Ta;Ta=null,_o=0,yo=null;for(var r=0;r<t.length;r++)(0,t[r])()}}function qE(t,r){var o=[],h={status:"pending",value:null,reason:null,then:function(w){o.push(w)}};return t.then(function(){h.status="fulfilled",h.value=r;for(var w=0;w<o.length;w++)(0,o[w])(r)},function(w){for(h.status="rejected",h.reason=w,w=0;w<o.length;w++)(0,o[w])(void 0)}),h}var tv=H.S;H.S=function(t,r){z_=it(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&VE(t,r),tv!==null&&tv(t,r)};var Cs=B(null);function vf(){var t=Cs.current;return t!==null?t:pt.pooledCache}function pc(t,r){r===null?Q(Cs,Cs.current):Q(Cs,r.pool)}function nv(){var t=vf();return t===null?null:{parent:Bt._currentValue,pool:t}}var bo=Error(s(460)),_f=Error(s(474)),gc=Error(s(542)),vc={then:function(){}};function rv(t){return t=t.status,t==="fulfilled"||t==="rejected"}function iv(t,r,o){switch(o=t[o],o===void 0?t.push(r):o!==r&&(r.then(Qr,Qr),r=o),r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,ov(t),t;default:if(typeof r.status=="string")r.then(Qr,Qr);else{if(t=pt,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=r,t.status="pending",t.then(function(h){if(r.status==="pending"){var w=r;w.status="fulfilled",w.value=h}},function(h){if(r.status==="pending"){var w=r;w.status="rejected",w.reason=h}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw t=r.reason,ov(t),t}throw Rs=r,bo}}function Es(t){try{var r=t._init;return r(t._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(Rs=o,bo):o}}var Rs=null;function sv(){if(Rs===null)throw Error(s(459));var t=Rs;return Rs=null,t}function ov(t){if(t===bo||t===gc)throw Error(s(483))}var So=null,Ma=0;function _c(t){var r=Ma;return Ma+=1,So===null&&(So=[]),iv(So,t,r)}function Da(t,r){r=r.props.ref,t.ref=r!==void 0?r:null}function yc(t,r){throw r.$$typeof===_?Error(s(525)):(t=Object.prototype.toString.call(r),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t)))}function av(t){function r(se,ne){if(t){var ce=se.deletions;ce===null?(se.deletions=[ne],se.flags|=16):ce.push(ne)}}function o(se,ne){if(!t)return null;for(;ne!==null;)r(se,ne),ne=ne.sibling;return null}function h(se){for(var ne=new Map;se!==null;)se.key!==null?ne.set(se.key,se):ne.set(se.index,se),se=se.sibling;return ne}function w(se,ne){return se=Jr(se,ne),se.index=0,se.sibling=null,se}function R(se,ne,ce){return se.index=ce,t?(ce=se.alternate,ce!==null?(ce=ce.index,ce<ne?(se.flags|=67108866,ne):ce):(se.flags|=67108866,ne)):(se.flags|=1048576,ne)}function j(se){return t&&se.alternate===null&&(se.flags|=67108866),se}function Y(se,ne,ce,ge){return ne===null||ne.tag!==6?(ne=of(ce,se.mode,ge),ne.return=se,ne):(ne=w(ne,ce),ne.return=se,ne)}function te(se,ne,ce,ge){var je=ce.type;return je===S?pe(se,ne,ce.props.children,ge,ce.key):ne!==null&&(ne.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===A&&Es(je)===ne.type)?(ne=w(ne,ce.props),Da(ne,ce),ne.return=se,ne):(ne=hc(ce.type,ce.key,ce.props,null,se.mode,ge),Da(ne,ce),ne.return=se,ne)}function ue(se,ne,ce,ge){return ne===null||ne.tag!==4||ne.stateNode.containerInfo!==ce.containerInfo||ne.stateNode.implementation!==ce.implementation?(ne=af(ce,se.mode,ge),ne.return=se,ne):(ne=w(ne,ce.children||[]),ne.return=se,ne)}function pe(se,ne,ce,ge,je){return ne===null||ne.tag!==7?(ne=bs(ce,se.mode,ge,je),ne.return=se,ne):(ne=w(ne,ce),ne.return=se,ne)}function ve(se,ne,ce){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return ne=of(""+ne,se.mode,ce),ne.return=se,ne;if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case x:return ce=hc(ne.type,ne.key,ne.props,null,se.mode,ce),Da(ce,ne),ce.return=se,ce;case C:return ne=af(ne,se.mode,ce),ne.return=se,ne;case A:return ne=Es(ne),ve(se,ne,ce)}if(G(ne)||I(ne))return ne=bs(ne,se.mode,ce,null),ne.return=se,ne;if(typeof ne.then=="function")return ve(se,_c(ne),ce);if(ne.$$typeof===y)return ve(se,mc(se,ne),ce);yc(se,ne)}return null}function he(se,ne,ce,ge){var je=ne!==null?ne.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return je!==null?null:Y(se,ne,""+ce,ge);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:return ce.key===je?te(se,ne,ce,ge):null;case C:return ce.key===je?ue(se,ne,ce,ge):null;case A:return ce=Es(ce),he(se,ne,ce,ge)}if(G(ce)||I(ce))return je!==null?null:pe(se,ne,ce,ge,null);if(typeof ce.then=="function")return he(se,ne,_c(ce),ge);if(ce.$$typeof===y)return he(se,ne,mc(se,ce),ge);yc(se,ce)}return null}function me(se,ne,ce,ge,je){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return se=se.get(ce)||null,Y(ne,se,""+ge,je);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case x:return se=se.get(ge.key===null?ce:ge.key)||null,te(ne,se,ge,je);case C:return se=se.get(ge.key===null?ce:ge.key)||null,ue(ne,se,ge,je);case A:return ge=Es(ge),me(se,ne,ce,ge,je)}if(G(ge)||I(ge))return se=se.get(ce)||null,pe(ne,se,ge,je,null);if(typeof ge.then=="function")return me(se,ne,ce,_c(ge),je);if(ge.$$typeof===y)return me(se,ne,ce,mc(ne,ge),je);yc(ne,ge)}return null}function Re(se,ne,ce,ge){for(var je=null,nt=null,Le=ne,Fe=ne=0,Xe=null;Le!==null&&Fe<ce.length;Fe++){Le.index>Fe?(Xe=Le,Le=null):Xe=Le.sibling;var rt=he(se,Le,ce[Fe],ge);if(rt===null){Le===null&&(Le=Xe);break}t&&Le&&rt.alternate===null&&r(se,Le),ne=R(rt,ne,Fe),nt===null?je=rt:nt.sibling=rt,nt=rt,Le=Xe}if(Fe===ce.length)return o(se,Le),Qe&&ei(se,Fe),je;if(Le===null){for(;Fe<ce.length;Fe++)Le=ve(se,ce[Fe],ge),Le!==null&&(ne=R(Le,ne,Fe),nt===null?je=Le:nt.sibling=Le,nt=Le);return Qe&&ei(se,Fe),je}for(Le=h(Le);Fe<ce.length;Fe++)Xe=me(Le,se,Fe,ce[Fe],ge),Xe!==null&&(t&&Xe.alternate!==null&&Le.delete(Xe.key===null?Fe:Xe.key),ne=R(Xe,ne,Fe),nt===null?je=Xe:nt.sibling=Xe,nt=Xe);return t&&Le.forEach(function(Gi){return r(se,Gi)}),Qe&&ei(se,Fe),je}function ze(se,ne,ce,ge){if(ce==null)throw Error(s(151));for(var je=null,nt=null,Le=ne,Fe=ne=0,Xe=null,rt=ce.next();Le!==null&&!rt.done;Fe++,rt=ce.next()){Le.index>Fe?(Xe=Le,Le=null):Xe=Le.sibling;var Gi=he(se,Le,rt.value,ge);if(Gi===null){Le===null&&(Le=Xe);break}t&&Le&&Gi.alternate===null&&r(se,Le),ne=R(Gi,ne,Fe),nt===null?je=Gi:nt.sibling=Gi,nt=Gi,Le=Xe}if(rt.done)return o(se,Le),Qe&&ei(se,Fe),je;if(Le===null){for(;!rt.done;Fe++,rt=ce.next())rt=ve(se,rt.value,ge),rt!==null&&(ne=R(rt,ne,Fe),nt===null?je=rt:nt.sibling=rt,nt=rt);return Qe&&ei(se,Fe),je}for(Le=h(Le);!rt.done;Fe++,rt=ce.next())rt=me(Le,se,Fe,rt.value,ge),rt!==null&&(t&&rt.alternate!==null&&Le.delete(rt.key===null?Fe:rt.key),ne=R(rt,ne,Fe),nt===null?je=rt:nt.sibling=rt,nt=rt);return t&&Le.forEach(function(nR){return r(se,nR)}),Qe&&ei(se,Fe),je}function dt(se,ne,ce,ge){if(typeof ce=="object"&&ce!==null&&ce.type===S&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:e:{for(var je=ce.key;ne!==null;){if(ne.key===je){if(je=ce.type,je===S){if(ne.tag===7){o(se,ne.sibling),ge=w(ne,ce.props.children),ge.return=se,se=ge;break e}}else if(ne.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===A&&Es(je)===ne.type){o(se,ne.sibling),ge=w(ne,ce.props),Da(ge,ce),ge.return=se,se=ge;break e}o(se,ne);break}else r(se,ne);ne=ne.sibling}ce.type===S?(ge=bs(ce.props.children,se.mode,ge,ce.key),ge.return=se,se=ge):(ge=hc(ce.type,ce.key,ce.props,null,se.mode,ge),Da(ge,ce),ge.return=se,se=ge)}return j(se);case C:e:{for(je=ce.key;ne!==null;){if(ne.key===je)if(ne.tag===4&&ne.stateNode.containerInfo===ce.containerInfo&&ne.stateNode.implementation===ce.implementation){o(se,ne.sibling),ge=w(ne,ce.children||[]),ge.return=se,se=ge;break e}else{o(se,ne);break}else r(se,ne);ne=ne.sibling}ge=af(ce,se.mode,ge),ge.return=se,se=ge}return j(se);case A:return ce=Es(ce),dt(se,ne,ce,ge)}if(G(ce))return Re(se,ne,ce,ge);if(I(ce)){if(je=I(ce),typeof je!="function")throw Error(s(150));return ce=je.call(ce),ze(se,ne,ce,ge)}if(typeof ce.then=="function")return dt(se,ne,_c(ce),ge);if(ce.$$typeof===y)return dt(se,ne,mc(se,ce),ge);yc(se,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,ne!==null&&ne.tag===6?(o(se,ne.sibling),ge=w(ne,ce),ge.return=se,se=ge):(o(se,ne),ge=of(ce,se.mode,ge),ge.return=se,se=ge),j(se)):o(se,ne)}return function(se,ne,ce,ge){try{Ma=0;var je=dt(se,ne,ce,ge);return So=null,je}catch(Le){if(Le===bo||Le===gc)throw Le;var nt=Bn(29,Le,null,se.mode);return nt.lanes=ge,nt.return=se,nt}finally{}}}var As=av(!0),lv=av(!1),Li=!1;function yf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bf(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ki(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ni(t,r,o){var h=t.updateQueue;if(h===null)return null;if(h=h.shared,(at&2)!==0){var w=h.pending;return w===null?r.next=r:(r.next=w.next,w.next=r),h.pending=r,r=uc(t),qg(t,null,o),r}return cc(t,h,r,o),uc(t)}function Oa(t,r,o){if(r=r.updateQueue,r!==null&&(r=r.shared,(o&4194048)!==0)){var h=r.lanes;h&=t.pendingLanes,o|=h,r.lanes=o,ee(t,o)}}function Sf(t,r){var o=t.updateQueue,h=t.alternate;if(h!==null&&(h=h.updateQueue,o===h)){var w=null,R=null;if(o=o.firstBaseUpdate,o!==null){do{var j={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};R===null?w=R=j:R=R.next=j,o=o.next}while(o!==null);R===null?w=R=r:R=R.next=r}else w=R=r;o={baseState:h.baseState,firstBaseUpdate:w,lastBaseUpdate:R,shared:h.shared,callbacks:h.callbacks},t.updateQueue=o;return}t=o.lastBaseUpdate,t===null?o.firstBaseUpdate=r:t.next=r,o.lastBaseUpdate=r}var xf=!1;function La(){if(xf){var t=yo;if(t!==null)throw t}}function ka(t,r,o,h){xf=!1;var w=t.updateQueue;Li=!1;var R=w.firstBaseUpdate,j=w.lastBaseUpdate,Y=w.shared.pending;if(Y!==null){w.shared.pending=null;var te=Y,ue=te.next;te.next=null,j===null?R=ue:j.next=ue,j=te;var pe=t.alternate;pe!==null&&(pe=pe.updateQueue,Y=pe.lastBaseUpdate,Y!==j&&(Y===null?pe.firstBaseUpdate=ue:Y.next=ue,pe.lastBaseUpdate=te))}if(R!==null){var ve=w.baseState;j=0,pe=ue=te=null,Y=R;do{var he=Y.lane&-536870913,me=he!==Y.lane;if(me?(Ge&he)===he:(h&he)===he){he!==0&&he===_o&&(xf=!0),pe!==null&&(pe=pe.next={lane:0,tag:Y.tag,payload:Y.payload,callback:null,next:null});e:{var Re=t,ze=Y;he=r;var dt=o;switch(ze.tag){case 1:if(Re=ze.payload,typeof Re=="function"){ve=Re.call(dt,ve,he);break e}ve=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=ze.payload,he=typeof Re=="function"?Re.call(dt,ve,he):Re,he==null)break e;ve=m({},ve,he);break e;case 2:Li=!0}}he=Y.callback,he!==null&&(t.flags|=64,me&&(t.flags|=8192),me=w.callbacks,me===null?w.callbacks=[he]:me.push(he))}else me={lane:he,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},pe===null?(ue=pe=me,te=ve):pe=pe.next=me,j|=he;if(Y=Y.next,Y===null){if(Y=w.shared.pending,Y===null)break;me=Y,Y=me.next,me.next=null,w.lastBaseUpdate=me,w.shared.pending=null}}while(!0);pe===null&&(te=ve),w.baseState=te,w.firstBaseUpdate=ue,w.lastBaseUpdate=pe,R===null&&(w.shared.lanes=0),Pi|=j,t.lanes=j,t.memoizedState=ve}}function cv(t,r){if(typeof t!="function")throw Error(s(191,t));t.call(r)}function uv(t,r){var o=t.callbacks;if(o!==null)for(t.callbacks=null,t=0;t<o.length;t++)cv(o[t],r)}var xo=B(null),bc=B(0);function hv(t,r){t=hi,Q(bc,t),Q(xo,r),hi=t|r.baseLanes}function wf(){Q(bc,hi),Q(xo,xo.current)}function Cf(){hi=bc.current,P(xo),P(bc)}var jn=B(null),Qn=null;function Bi(t){var r=t.alternate;Q(Mt,Mt.current&1),Q(jn,t),Qn===null&&(r===null||xo.current!==null||r.memoizedState!==null)&&(Qn=t)}function Ef(t){Q(Mt,Mt.current),Q(jn,t),Qn===null&&(Qn=t)}function fv(t){t.tag===22?(Q(Mt,Mt.current),Q(jn,t),Qn===null&&(Qn=t)):ji()}function ji(){Q(Mt,Mt.current),Q(jn,jn.current)}function Hn(t){P(jn),Qn===t&&(Qn=null),P(Mt)}var Mt=B(0);function Sc(t){for(var r=t;r!==null;){if(r.tag===13){var o=r.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||Od(o)||Ld(o)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var ri=0,Ue=null,ht=null,jt=null,xc=!1,wo=!1,Ts=!1,wc=0,Na=0,Co=null,WE=0;function At(){throw Error(s(321))}function Rf(t,r){if(r===null)return!1;for(var o=0;o<r.length&&o<t.length;o++)if(!Nn(t[o],r[o]))return!1;return!0}function Af(t,r,o,h,w,R){return ri=R,Ue=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,H.H=t===null||t.memoizedState===null?Gv:Ff,Ts=!1,R=o(h,w),Ts=!1,wo&&(R=mv(r,o,h,w)),dv(t),R}function dv(t){H.H=Ha;var r=ht!==null&&ht.next!==null;if(ri=0,jt=ht=Ue=null,xc=!1,Na=0,Co=null,r)throw Error(s(300));t===null||Ht||(t=t.dependencies,t!==null&&dc(t)&&(Ht=!0))}function mv(t,r,o,h){Ue=t;var w=0;do{if(wo&&(Co=null),Na=0,wo=!1,25<=w)throw Error(s(301));if(w+=1,jt=ht=null,t.updateQueue!=null){var R=t.updateQueue;R.lastEffect=null,R.events=null,R.stores=null,R.memoCache!=null&&(R.memoCache.index=0)}H.H=Xv,R=r(o,h)}while(wo);return R}function YE(){var t=H.H,r=t.useState()[0];return r=typeof r.then=="function"?Ba(r):r,t=t.useState()[0],(ht!==null?ht.memoizedState:null)!==t&&(Ue.flags|=1024),r}function Tf(){var t=wc!==0;return wc=0,t}function Mf(t,r,o){r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~o}function Df(t){if(xc){for(t=t.memoizedState;t!==null;){var r=t.queue;r!==null&&(r.pending=null),t=t.next}xc=!1}ri=0,jt=ht=Ue=null,wo=!1,Na=wc=0,Co=null}function mn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?Ue.memoizedState=jt=t:jt=jt.next=t,jt}function Dt(){if(ht===null){var t=Ue.alternate;t=t!==null?t.memoizedState:null}else t=ht.next;var r=jt===null?Ue.memoizedState:jt.next;if(r!==null)jt=r,ht=t;else{if(t===null)throw Ue.alternate===null?Error(s(467)):Error(s(310));ht=t,t={memoizedState:ht.memoizedState,baseState:ht.baseState,baseQueue:ht.baseQueue,queue:ht.queue,next:null},jt===null?Ue.memoizedState=jt=t:jt=jt.next=t}return jt}function Cc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ba(t){var r=Na;return Na+=1,Co===null&&(Co=[]),t=iv(Co,t,r),r=Ue,(jt===null?r.memoizedState:jt.next)===null&&(r=r.alternate,H.H=r===null||r.memoizedState===null?Gv:Ff),t}function Ec(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Ba(t);if(t.$$typeof===y)return nn(t)}throw Error(s(438,String(t)))}function Of(t){var r=null,o=Ue.updateQueue;if(o!==null&&(r=o.memoCache),r==null){var h=Ue.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(r={data:h.data.map(function(w){return w.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),o===null&&(o=Cc(),Ue.updateQueue=o),o.memoCache=r,o=r.data[r.index],o===void 0)for(o=r.data[r.index]=Array(t),h=0;h<t;h++)o[h]=q;return r.index++,o}function ii(t,r){return typeof r=="function"?r(t):r}function Rc(t){var r=Dt();return Lf(r,ht,t)}function Lf(t,r,o){var h=t.queue;if(h===null)throw Error(s(311));h.lastRenderedReducer=o;var w=t.baseQueue,R=h.pending;if(R!==null){if(w!==null){var j=w.next;w.next=R.next,R.next=j}r.baseQueue=w=R,h.pending=null}if(R=t.baseState,w===null)t.memoizedState=R;else{r=w.next;var Y=j=null,te=null,ue=r,pe=!1;do{var ve=ue.lane&-536870913;if(ve!==ue.lane?(Ge&ve)===ve:(ri&ve)===ve){var he=ue.revertLane;if(he===0)te!==null&&(te=te.next={lane:0,revertLane:0,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),ve===_o&&(pe=!0);else if((ri&he)===he){ue=ue.next,he===_o&&(pe=!0);continue}else ve={lane:0,revertLane:ue.revertLane,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},te===null?(Y=te=ve,j=R):te=te.next=ve,Ue.lanes|=he,Pi|=he;ve=ue.action,Ts&&o(R,ve),R=ue.hasEagerState?ue.eagerState:o(R,ve)}else he={lane:ve,revertLane:ue.revertLane,gesture:ue.gesture,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},te===null?(Y=te=he,j=R):te=te.next=he,Ue.lanes|=ve,Pi|=ve;ue=ue.next}while(ue!==null&&ue!==r);if(te===null?j=R:te.next=Y,!Nn(R,t.memoizedState)&&(Ht=!0,pe&&(o=yo,o!==null)))throw o;t.memoizedState=R,t.baseState=j,t.baseQueue=te,h.lastRenderedState=R}return w===null&&(h.lanes=0),[t.memoizedState,h.dispatch]}function kf(t){var r=Dt(),o=r.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=t;var h=o.dispatch,w=o.pending,R=r.memoizedState;if(w!==null){o.pending=null;var j=w=w.next;do R=t(R,j.action),j=j.next;while(j!==w);Nn(R,r.memoizedState)||(Ht=!0),r.memoizedState=R,r.baseQueue===null&&(r.baseState=R),o.lastRenderedState=R}return[R,h]}function pv(t,r,o){var h=Ue,w=Dt(),R=Qe;if(R){if(o===void 0)throw Error(s(407));o=o()}else o=r();var j=!Nn((ht||w).memoizedState,o);if(j&&(w.memoizedState=o,Ht=!0),w=w.queue,jf(_v.bind(null,h,w,t),[t]),w.getSnapshot!==r||j||jt!==null&&jt.memoizedState.tag&1){if(h.flags|=2048,Eo(9,{destroy:void 0},vv.bind(null,h,w,o,r),null),pt===null)throw Error(s(349));R||(ri&127)!==0||gv(h,r,o)}return o}function gv(t,r,o){t.flags|=16384,t={getSnapshot:r,value:o},r=Ue.updateQueue,r===null?(r=Cc(),Ue.updateQueue=r,r.stores=[t]):(o=r.stores,o===null?r.stores=[t]:o.push(t))}function vv(t,r,o,h){r.value=o,r.getSnapshot=h,yv(r)&&bv(t)}function _v(t,r,o){return o(function(){yv(r)&&bv(t)})}function yv(t){var r=t.getSnapshot;t=t.value;try{var o=r();return!Nn(t,o)}catch{return!0}}function bv(t){var r=ys(t,2);r!==null&&Tn(r,t,2)}function Nf(t){var r=mn();if(typeof t=="function"){var o=t;if(t=o(),Ts){Ln(!0);try{o()}finally{Ln(!1)}}}return r.memoizedState=r.baseState=t,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ii,lastRenderedState:t},r}function Sv(t,r,o,h){return t.baseState=o,Lf(t,ht,typeof h=="function"?h:ii)}function KE(t,r,o,h,w){if(Mc(t))throw Error(s(485));if(t=r.action,t!==null){var R={payload:w,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){R.listeners.push(j)}};H.T!==null?o(!0):R.isTransition=!1,h(R),o=r.pending,o===null?(R.next=r.pending=R,xv(r,R)):(R.next=o.next,r.pending=o.next=R)}}function xv(t,r){var o=r.action,h=r.payload,w=t.state;if(r.isTransition){var R=H.T,j={};H.T=j;try{var Y=o(w,h),te=H.S;te!==null&&te(j,Y),wv(t,r,Y)}catch(ue){Bf(t,r,ue)}finally{R!==null&&j.types!==null&&(R.types=j.types),H.T=R}}else try{R=o(w,h),wv(t,r,R)}catch(ue){Bf(t,r,ue)}}function wv(t,r,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(h){Cv(t,r,h)},function(h){return Bf(t,r,h)}):Cv(t,r,o)}function Cv(t,r,o){r.status="fulfilled",r.value=o,Ev(r),t.state=o,r=t.pending,r!==null&&(o=r.next,o===r?t.pending=null:(o=o.next,r.next=o,xv(t,o)))}function Bf(t,r,o){var h=t.pending;if(t.pending=null,h!==null){h=h.next;do r.status="rejected",r.reason=o,Ev(r),r=r.next;while(r!==h)}t.action=null}function Ev(t){t=t.listeners;for(var r=0;r<t.length;r++)(0,t[r])()}function Rv(t,r){return r}function Av(t,r){if(Qe){var o=pt.formState;if(o!==null){e:{var h=Ue;if(Qe){if(yt){t:{for(var w=yt,R=Xn;w.nodeType!==8;){if(!R){w=null;break t}if(w=Zn(w.nextSibling),w===null){w=null;break t}}R=w.data,w=R==="F!"||R==="F"?w:null}if(w){yt=Zn(w.nextSibling),h=w.data==="F!";break e}}Di(h)}h=!1}h&&(r=o[0])}}return o=mn(),o.memoizedState=o.baseState=r,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rv,lastRenderedState:r},o.queue=h,o=Wv.bind(null,Ue,h),h.dispatch=o,h=Nf(!1),R=Uf.bind(null,Ue,!1,h.queue),h=mn(),w={state:r,dispatch:null,action:t,pending:null},h.queue=w,o=KE.bind(null,Ue,w,R,o),w.dispatch=o,h.memoizedState=t,[r,o,!1]}function Tv(t){var r=Dt();return Mv(r,ht,t)}function Mv(t,r,o){if(r=Lf(t,r,Rv)[0],t=Rc(ii)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var h=Ba(r)}catch(j){throw j===bo?gc:j}else h=r;r=Dt();var w=r.queue,R=w.dispatch;return o!==r.memoizedState&&(Ue.flags|=2048,Eo(9,{destroy:void 0},GE.bind(null,w,o),null)),[h,R,t]}function GE(t,r){t.action=r}function Dv(t){var r=Dt(),o=ht;if(o!==null)return Mv(r,o,t);Dt(),r=r.memoizedState,o=Dt();var h=o.queue.dispatch;return o.memoizedState=t,[r,h,!1]}function Eo(t,r,o,h){return t={tag:t,create:o,deps:h,inst:r,next:null},r=Ue.updateQueue,r===null&&(r=Cc(),Ue.updateQueue=r),o=r.lastEffect,o===null?r.lastEffect=t.next=t:(h=o.next,o.next=t,t.next=h,r.lastEffect=t),t}function Ov(){return Dt().memoizedState}function Ac(t,r,o,h){var w=mn();Ue.flags|=t,w.memoizedState=Eo(1|r,{destroy:void 0},o,h===void 0?null:h)}function Tc(t,r,o,h){var w=Dt();h=h===void 0?null:h;var R=w.memoizedState.inst;ht!==null&&h!==null&&Rf(h,ht.memoizedState.deps)?w.memoizedState=Eo(r,R,o,h):(Ue.flags|=t,w.memoizedState=Eo(1|r,R,o,h))}function Lv(t,r){Ac(8390656,8,t,r)}function jf(t,r){Tc(2048,8,t,r)}function XE(t){Ue.flags|=4;var r=Ue.updateQueue;if(r===null)r=Cc(),Ue.updateQueue=r,r.events=[t];else{var o=r.events;o===null?r.events=[t]:o.push(t)}}function kv(t){var r=Dt().memoizedState;return XE({ref:r,nextImpl:t}),function(){if((at&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function Nv(t,r){return Tc(4,2,t,r)}function Bv(t,r){return Tc(4,4,t,r)}function jv(t,r){if(typeof r=="function"){t=t();var o=r(t);return function(){typeof o=="function"?o():r(null)}}if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function Hv(t,r,o){o=o!=null?o.concat([t]):null,Tc(4,4,jv.bind(null,r,t),o)}function Hf(){}function zv(t,r){var o=Dt();r=r===void 0?null:r;var h=o.memoizedState;return r!==null&&Rf(r,h[1])?h[0]:(o.memoizedState=[t,r],t)}function Pv(t,r){var o=Dt();r=r===void 0?null:r;var h=o.memoizedState;if(r!==null&&Rf(r,h[1]))return h[0];if(h=t(),Ts){Ln(!0);try{t()}finally{Ln(!1)}}return o.memoizedState=[h,r],h}function zf(t,r,o){return o===void 0||(ri&1073741824)!==0&&(Ge&261930)===0?t.memoizedState=r:(t.memoizedState=o,t=I_(),Ue.lanes|=t,Pi|=t,o)}function Iv(t,r,o,h){return Nn(o,r)?o:xo.current!==null?(t=zf(t,o,h),Nn(t,r)||(Ht=!0),t):(ri&42)===0||(ri&1073741824)!==0&&(Ge&261930)===0?(Ht=!0,t.memoizedState=o):(t=I_(),Ue.lanes|=t,Pi|=t,r)}function Uv(t,r,o,h,w){var R=K.p;K.p=R!==0&&8>R?R:8;var j=H.T,Y={};H.T=Y,Uf(t,!1,r,o);try{var te=w(),ue=H.S;if(ue!==null&&ue(Y,te),te!==null&&typeof te=="object"&&typeof te.then=="function"){var pe=qE(te,h);ja(t,r,pe,In(t))}else ja(t,r,h,In(t))}catch(ve){ja(t,r,{then:function(){},status:"rejected",reason:ve},In())}finally{K.p=R,j!==null&&Y.types!==null&&(j.types=Y.types),H.T=j}}function QE(){}function Pf(t,r,o,h){if(t.tag!==5)throw Error(s(476));var w=Fv(t).queue;Uv(t,w,r,F,o===null?QE:function(){return $v(t),o(h)})}function Fv(t){var r=t.memoizedState;if(r!==null)return r;r={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ii,lastRenderedState:F},next:null};var o={};return r.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ii,lastRenderedState:o},next:null},t.memoizedState=r,t=t.alternate,t!==null&&(t.memoizedState=r),r}function $v(t){var r=Fv(t);r.next===null&&(r=t.alternate.memoizedState),ja(t,r.next.queue,{},In())}function If(){return nn(Ja)}function Vv(){return Dt().memoizedState}function qv(){return Dt().memoizedState}function ZE(t){for(var r=t.return;r!==null;){switch(r.tag){case 24:case 3:var o=In();t=ki(o);var h=Ni(r,t,o);h!==null&&(Tn(h,r,o),Oa(h,r,o)),r={cache:pf()},t.payload=r;return}r=r.return}}function JE(t,r,o){var h=In();o={lane:h,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Mc(t)?Yv(r,o):(o=rf(t,r,o,h),o!==null&&(Tn(o,t,h),Kv(o,r,h)))}function Wv(t,r,o){var h=In();ja(t,r,o,h)}function ja(t,r,o,h){var w={lane:h,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Mc(t))Yv(r,w);else{var R=t.alternate;if(t.lanes===0&&(R===null||R.lanes===0)&&(R=r.lastRenderedReducer,R!==null))try{var j=r.lastRenderedState,Y=R(j,o);if(w.hasEagerState=!0,w.eagerState=Y,Nn(Y,j))return cc(t,r,w,0),pt===null&&lc(),!1}catch{}finally{}if(o=rf(t,r,w,h),o!==null)return Tn(o,t,h),Kv(o,r,h),!0}return!1}function Uf(t,r,o,h){if(h={lane:2,revertLane:yd(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Mc(t)){if(r)throw Error(s(479))}else r=rf(t,o,h,2),r!==null&&Tn(r,t,2)}function Mc(t){var r=t.alternate;return t===Ue||r!==null&&r===Ue}function Yv(t,r){wo=xc=!0;var o=t.pending;o===null?r.next=r:(r.next=o.next,o.next=r),t.pending=r}function Kv(t,r,o){if((o&4194048)!==0){var h=r.lanes;h&=t.pendingLanes,o|=h,r.lanes=o,ee(t,o)}}var Ha={readContext:nn,use:Ec,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At};Ha.useEffectEvent=At;var Gv={readContext:nn,use:Ec,useCallback:function(t,r){return mn().memoizedState=[t,r===void 0?null:r],t},useContext:nn,useEffect:Lv,useImperativeHandle:function(t,r,o){o=o!=null?o.concat([t]):null,Ac(4194308,4,jv.bind(null,r,t),o)},useLayoutEffect:function(t,r){return Ac(4194308,4,t,r)},useInsertionEffect:function(t,r){Ac(4,2,t,r)},useMemo:function(t,r){var o=mn();r=r===void 0?null:r;var h=t();if(Ts){Ln(!0);try{t()}finally{Ln(!1)}}return o.memoizedState=[h,r],h},useReducer:function(t,r,o){var h=mn();if(o!==void 0){var w=o(r);if(Ts){Ln(!0);try{o(r)}finally{Ln(!1)}}}else w=r;return h.memoizedState=h.baseState=w,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:w},h.queue=t,t=t.dispatch=JE.bind(null,Ue,t),[h.memoizedState,t]},useRef:function(t){var r=mn();return t={current:t},r.memoizedState=t},useState:function(t){t=Nf(t);var r=t.queue,o=Wv.bind(null,Ue,r);return r.dispatch=o,[t.memoizedState,o]},useDebugValue:Hf,useDeferredValue:function(t,r){var o=mn();return zf(o,t,r)},useTransition:function(){var t=Nf(!1);return t=Uv.bind(null,Ue,t.queue,!0,!1),mn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,r,o){var h=Ue,w=mn();if(Qe){if(o===void 0)throw Error(s(407));o=o()}else{if(o=r(),pt===null)throw Error(s(349));(Ge&127)!==0||gv(h,r,o)}w.memoizedState=o;var R={value:o,getSnapshot:r};return w.queue=R,Lv(_v.bind(null,h,R,t),[t]),h.flags|=2048,Eo(9,{destroy:void 0},vv.bind(null,h,R,o,r),null),o},useId:function(){var t=mn(),r=pt.identifierPrefix;if(Qe){var o=Tr,h=Ar;o=(h&~(1<<32-Qt(h)-1)).toString(32)+o,r="_"+r+"R_"+o,o=wc++,0<o&&(r+="H"+o.toString(32)),r+="_"}else o=WE++,r="_"+r+"r_"+o.toString(32)+"_";return t.memoizedState=r},useHostTransitionStatus:If,useFormState:Av,useActionState:Av,useOptimistic:function(t){var r=mn();r.memoizedState=r.baseState=t;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=o,r=Uf.bind(null,Ue,!0,o),o.dispatch=r,[t,r]},useMemoCache:Of,useCacheRefresh:function(){return mn().memoizedState=ZE.bind(null,Ue)},useEffectEvent:function(t){var r=mn(),o={impl:t};return r.memoizedState=o,function(){if((at&2)!==0)throw Error(s(440));return o.impl.apply(void 0,arguments)}}},Ff={readContext:nn,use:Ec,useCallback:zv,useContext:nn,useEffect:jf,useImperativeHandle:Hv,useInsertionEffect:Nv,useLayoutEffect:Bv,useMemo:Pv,useReducer:Rc,useRef:Ov,useState:function(){return Rc(ii)},useDebugValue:Hf,useDeferredValue:function(t,r){var o=Dt();return Iv(o,ht.memoizedState,t,r)},useTransition:function(){var t=Rc(ii)[0],r=Dt().memoizedState;return[typeof t=="boolean"?t:Ba(t),r]},useSyncExternalStore:pv,useId:Vv,useHostTransitionStatus:If,useFormState:Tv,useActionState:Tv,useOptimistic:function(t,r){var o=Dt();return Sv(o,ht,t,r)},useMemoCache:Of,useCacheRefresh:qv};Ff.useEffectEvent=kv;var Xv={readContext:nn,use:Ec,useCallback:zv,useContext:nn,useEffect:jf,useImperativeHandle:Hv,useInsertionEffect:Nv,useLayoutEffect:Bv,useMemo:Pv,useReducer:kf,useRef:Ov,useState:function(){return kf(ii)},useDebugValue:Hf,useDeferredValue:function(t,r){var o=Dt();return ht===null?zf(o,t,r):Iv(o,ht.memoizedState,t,r)},useTransition:function(){var t=kf(ii)[0],r=Dt().memoizedState;return[typeof t=="boolean"?t:Ba(t),r]},useSyncExternalStore:pv,useId:Vv,useHostTransitionStatus:If,useFormState:Dv,useActionState:Dv,useOptimistic:function(t,r){var o=Dt();return ht!==null?Sv(o,ht,t,r):(o.baseState=t,[t,o.queue.dispatch])},useMemoCache:Of,useCacheRefresh:qv};Xv.useEffectEvent=kv;function $f(t,r,o,h){r=t.memoizedState,o=o(h,r),o=o==null?r:m({},r,o),t.memoizedState=o,t.lanes===0&&(t.updateQueue.baseState=o)}var Vf={enqueueSetState:function(t,r,o){t=t._reactInternals;var h=In(),w=ki(h);w.payload=r,o!=null&&(w.callback=o),r=Ni(t,w,h),r!==null&&(Tn(r,t,h),Oa(r,t,h))},enqueueReplaceState:function(t,r,o){t=t._reactInternals;var h=In(),w=ki(h);w.tag=1,w.payload=r,o!=null&&(w.callback=o),r=Ni(t,w,h),r!==null&&(Tn(r,t,h),Oa(r,t,h))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var o=In(),h=ki(o);h.tag=2,r!=null&&(h.callback=r),r=Ni(t,h,o),r!==null&&(Tn(r,t,o),Oa(r,t,o))}};function Qv(t,r,o,h,w,R,j){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(h,R,j):r.prototype&&r.prototype.isPureReactComponent?!wa(o,h)||!wa(w,R):!0}function Zv(t,r,o,h){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(o,h),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(o,h),r.state!==t&&Vf.enqueueReplaceState(r,r.state,null)}function Ms(t,r){var o=r;if("ref"in r){o={};for(var h in r)h!=="ref"&&(o[h]=r[h])}if(t=t.defaultProps){o===r&&(o=m({},o));for(var w in t)o[w]===void 0&&(o[w]=t[w])}return o}function Jv(t){ac(t)}function e_(t){console.error(t)}function t_(t){ac(t)}function Dc(t,r){try{var o=t.onUncaughtError;o(r.value,{componentStack:r.stack})}catch(h){setTimeout(function(){throw h})}}function n_(t,r,o){try{var h=t.onCaughtError;h(o.value,{componentStack:o.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(w){setTimeout(function(){throw w})}}function qf(t,r,o){return o=ki(o),o.tag=3,o.payload={element:null},o.callback=function(){Dc(t,r)},o}function r_(t){return t=ki(t),t.tag=3,t}function i_(t,r,o,h){var w=o.type.getDerivedStateFromError;if(typeof w=="function"){var R=h.value;t.payload=function(){return w(R)},t.callback=function(){n_(r,o,h)}}var j=o.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(t.callback=function(){n_(r,o,h),typeof w!="function"&&(Ii===null?Ii=new Set([this]):Ii.add(this));var Y=h.stack;this.componentDidCatch(h.value,{componentStack:Y!==null?Y:""})})}function e2(t,r,o,h,w){if(o.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(r=o.alternate,r!==null&&vo(r,o,w,!0),o=jn.current,o!==null){switch(o.tag){case 31:case 13:return Qn===null?Fc():o.alternate===null&&Tt===0&&(Tt=3),o.flags&=-257,o.flags|=65536,o.lanes=w,h===vc?o.flags|=16384:(r=o.updateQueue,r===null?o.updateQueue=new Set([h]):r.add(h),gd(t,h,w)),!1;case 22:return o.flags|=65536,h===vc?o.flags|=16384:(r=o.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([h])},o.updateQueue=r):(o=r.retryQueue,o===null?r.retryQueue=new Set([h]):o.add(h)),gd(t,h,w)),!1}throw Error(s(435,o.tag))}return gd(t,h,w),Fc(),!1}if(Qe)return r=jn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=w,h!==uf&&(t=Error(s(422),{cause:h}),Ra(Yn(t,o)))):(h!==uf&&(r=Error(s(423),{cause:h}),Ra(Yn(r,o))),t=t.current.alternate,t.flags|=65536,w&=-w,t.lanes|=w,h=Yn(h,o),w=qf(t.stateNode,h,w),Sf(t,w),Tt!==4&&(Tt=2)),!1;var R=Error(s(520),{cause:h});if(R=Yn(R,o),qa===null?qa=[R]:qa.push(R),Tt!==4&&(Tt=2),r===null)return!0;h=Yn(h,o),o=r;do{switch(o.tag){case 3:return o.flags|=65536,t=w&-w,o.lanes|=t,t=qf(o.stateNode,h,t),Sf(o,t),!1;case 1:if(r=o.type,R=o.stateNode,(o.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||R!==null&&typeof R.componentDidCatch=="function"&&(Ii===null||!Ii.has(R))))return o.flags|=65536,w&=-w,o.lanes|=w,w=r_(w),i_(w,t,o,h),Sf(o,w),!1}o=o.return}while(o!==null);return!1}var Wf=Error(s(461)),Ht=!1;function rn(t,r,o,h){r.child=t===null?lv(r,null,o,h):As(r,t.child,o,h)}function s_(t,r,o,h,w){o=o.render;var R=r.ref;if("ref"in h){var j={};for(var Y in h)Y!=="ref"&&(j[Y]=h[Y])}else j=h;return ws(r),h=Af(t,r,o,j,R,w),Y=Tf(),t!==null&&!Ht?(Mf(t,r,w),si(t,r,w)):(Qe&&Y&&lf(r),r.flags|=1,rn(t,r,h,w),r.child)}function o_(t,r,o,h,w){if(t===null){var R=o.type;return typeof R=="function"&&!sf(R)&&R.defaultProps===void 0&&o.compare===null?(r.tag=15,r.type=R,a_(t,r,R,h,w)):(t=hc(o.type,null,h,r,r.mode,w),t.ref=r.ref,t.return=r,r.child=t)}if(R=t.child,!ed(t,w)){var j=R.memoizedProps;if(o=o.compare,o=o!==null?o:wa,o(j,h)&&t.ref===r.ref)return si(t,r,w)}return r.flags|=1,t=Jr(R,h),t.ref=r.ref,t.return=r,r.child=t}function a_(t,r,o,h,w){if(t!==null){var R=t.memoizedProps;if(wa(R,h)&&t.ref===r.ref)if(Ht=!1,r.pendingProps=h=R,ed(t,w))(t.flags&131072)!==0&&(Ht=!0);else return r.lanes=t.lanes,si(t,r,w)}return Yf(t,r,o,h,w)}function l_(t,r,o,h){var w=h.children,R=t!==null?t.memoizedState:null;if(t===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((r.flags&128)!==0){if(R=R!==null?R.baseLanes|o:o,t!==null){for(h=r.child=t.child,w=0;h!==null;)w=w|h.lanes|h.childLanes,h=h.sibling;h=w&~R}else h=0,r.child=null;return c_(t,r,R,o,h)}if((o&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},t!==null&&pc(r,R!==null?R.cachePool:null),R!==null?hv(r,R):wf(),fv(r);else return h=r.lanes=536870912,c_(t,r,R!==null?R.baseLanes|o:o,o,h)}else R!==null?(pc(r,R.cachePool),hv(r,R),ji(),r.memoizedState=null):(t!==null&&pc(r,null),wf(),ji());return rn(t,r,w,o),r.child}function za(t,r){return t!==null&&t.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function c_(t,r,o,h,w){var R=vf();return R=R===null?null:{parent:Bt._currentValue,pool:R},r.memoizedState={baseLanes:o,cachePool:R},t!==null&&pc(r,null),wf(),fv(r),t!==null&&vo(t,r,h,!0),r.childLanes=w,null}function Oc(t,r){return r=kc({mode:r.mode,children:r.children},t.mode),r.ref=t.ref,t.child=r,r.return=t,r}function u_(t,r,o){return As(r,t.child,null,o),t=Oc(r,r.pendingProps),t.flags|=2,Hn(r),r.memoizedState=null,t}function t2(t,r,o){var h=r.pendingProps,w=(r.flags&128)!==0;if(r.flags&=-129,t===null){if(Qe){if(h.mode==="hidden")return t=Oc(r,h),r.lanes=536870912,za(null,t);if(Ef(r),(t=yt)?(t=x0(t,Xn),t=t!==null&&t.data==="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Ti!==null?{id:Ar,overflow:Tr}:null,retryLane:536870912,hydrationErrors:null},o=Yg(t),o.return=r,r.child=o,tn=r,yt=null)):t=null,t===null)throw Di(r);return r.lanes=536870912,null}return Oc(r,h)}var R=t.memoizedState;if(R!==null){var j=R.dehydrated;if(Ef(r),w)if(r.flags&256)r.flags&=-257,r=u_(t,r,o);else if(r.memoizedState!==null)r.child=t.child,r.flags|=128,r=null;else throw Error(s(558));else if(Ht||vo(t,r,o,!1),w=(o&t.childLanes)!==0,Ht||w){if(h=pt,h!==null&&(j=oe(h,o),j!==0&&j!==R.retryLane))throw R.retryLane=j,ys(t,j),Tn(h,t,j),Wf;Fc(),r=u_(t,r,o)}else t=R.treeContext,yt=Zn(j.nextSibling),tn=r,Qe=!0,Mi=null,Xn=!1,t!==null&&Xg(r,t),r=Oc(r,h),r.flags|=4096;return r}return t=Jr(t.child,{mode:h.mode,children:h.children}),t.ref=r.ref,r.child=t,t.return=r,t}function Lc(t,r){var o=r.ref;if(o===null)t!==null&&t.ref!==null&&(r.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(s(284));(t===null||t.ref!==o)&&(r.flags|=4194816)}}function Yf(t,r,o,h,w){return ws(r),o=Af(t,r,o,h,void 0,w),h=Tf(),t!==null&&!Ht?(Mf(t,r,w),si(t,r,w)):(Qe&&h&&lf(r),r.flags|=1,rn(t,r,o,w),r.child)}function h_(t,r,o,h,w,R){return ws(r),r.updateQueue=null,o=mv(r,h,o,w),dv(t),h=Tf(),t!==null&&!Ht?(Mf(t,r,R),si(t,r,R)):(Qe&&h&&lf(r),r.flags|=1,rn(t,r,o,R),r.child)}function f_(t,r,o,h,w){if(ws(r),r.stateNode===null){var R=fo,j=o.contextType;typeof j=="object"&&j!==null&&(R=nn(j)),R=new o(h,R),r.memoizedState=R.state!==null&&R.state!==void 0?R.state:null,R.updater=Vf,r.stateNode=R,R._reactInternals=r,R=r.stateNode,R.props=h,R.state=r.memoizedState,R.refs={},yf(r),j=o.contextType,R.context=typeof j=="object"&&j!==null?nn(j):fo,R.state=r.memoizedState,j=o.getDerivedStateFromProps,typeof j=="function"&&($f(r,o,j,h),R.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof R.getSnapshotBeforeUpdate=="function"||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(j=R.state,typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount(),j!==R.state&&Vf.enqueueReplaceState(R,R.state,null),ka(r,h,R,w),La(),R.state=r.memoizedState),typeof R.componentDidMount=="function"&&(r.flags|=4194308),h=!0}else if(t===null){R=r.stateNode;var Y=r.memoizedProps,te=Ms(o,Y);R.props=te;var ue=R.context,pe=o.contextType;j=fo,typeof pe=="object"&&pe!==null&&(j=nn(pe));var ve=o.getDerivedStateFromProps;pe=typeof ve=="function"||typeof R.getSnapshotBeforeUpdate=="function",Y=r.pendingProps!==Y,pe||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(Y||ue!==j)&&Zv(r,R,h,j),Li=!1;var he=r.memoizedState;R.state=he,ka(r,h,R,w),La(),ue=r.memoizedState,Y||he!==ue||Li?(typeof ve=="function"&&($f(r,o,ve,h),ue=r.memoizedState),(te=Li||Qv(r,o,te,h,he,ue,j))?(pe||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount()),typeof R.componentDidMount=="function"&&(r.flags|=4194308)):(typeof R.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=h,r.memoizedState=ue),R.props=h,R.state=ue,R.context=j,h=te):(typeof R.componentDidMount=="function"&&(r.flags|=4194308),h=!1)}else{R=r.stateNode,bf(t,r),j=r.memoizedProps,pe=Ms(o,j),R.props=pe,ve=r.pendingProps,he=R.context,ue=o.contextType,te=fo,typeof ue=="object"&&ue!==null&&(te=nn(ue)),Y=o.getDerivedStateFromProps,(ue=typeof Y=="function"||typeof R.getSnapshotBeforeUpdate=="function")||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(j!==ve||he!==te)&&Zv(r,R,h,te),Li=!1,he=r.memoizedState,R.state=he,ka(r,h,R,w),La();var me=r.memoizedState;j!==ve||he!==me||Li||t!==null&&t.dependencies!==null&&dc(t.dependencies)?(typeof Y=="function"&&($f(r,o,Y,h),me=r.memoizedState),(pe=Li||Qv(r,o,pe,h,he,me,te)||t!==null&&t.dependencies!==null&&dc(t.dependencies))?(ue||typeof R.UNSAFE_componentWillUpdate!="function"&&typeof R.componentWillUpdate!="function"||(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(h,me,te),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(h,me,te)),typeof R.componentDidUpdate=="function"&&(r.flags|=4),typeof R.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof R.componentDidUpdate!="function"||j===t.memoizedProps&&he===t.memoizedState||(r.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||j===t.memoizedProps&&he===t.memoizedState||(r.flags|=1024),r.memoizedProps=h,r.memoizedState=me),R.props=h,R.state=me,R.context=te,h=pe):(typeof R.componentDidUpdate!="function"||j===t.memoizedProps&&he===t.memoizedState||(r.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||j===t.memoizedProps&&he===t.memoizedState||(r.flags|=1024),h=!1)}return R=h,Lc(t,r),h=(r.flags&128)!==0,R||h?(R=r.stateNode,o=h&&typeof o.getDerivedStateFromError!="function"?null:R.render(),r.flags|=1,t!==null&&h?(r.child=As(r,t.child,null,w),r.child=As(r,null,o,w)):rn(t,r,o,w),r.memoizedState=R.state,t=r.child):t=si(t,r,w),t}function d_(t,r,o,h){return Ss(),r.flags|=256,rn(t,r,o,h),r.child}var Kf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gf(t){return{baseLanes:t,cachePool:nv()}}function Xf(t,r,o){return t=t!==null?t.childLanes&~o:0,r&&(t|=Pn),t}function m_(t,r,o){var h=r.pendingProps,w=!1,R=(r.flags&128)!==0,j;if((j=R)||(j=t!==null&&t.memoizedState===null?!1:(Mt.current&2)!==0),j&&(w=!0,r.flags&=-129),j=(r.flags&32)!==0,r.flags&=-33,t===null){if(Qe){if(w?Bi(r):ji(),(t=yt)?(t=x0(t,Xn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(r.memoizedState={dehydrated:t,treeContext:Ti!==null?{id:Ar,overflow:Tr}:null,retryLane:536870912,hydrationErrors:null},o=Yg(t),o.return=r,r.child=o,tn=r,yt=null)):t=null,t===null)throw Di(r);return Ld(t)?r.lanes=32:r.lanes=536870912,null}var Y=h.children;return h=h.fallback,w?(ji(),w=r.mode,Y=kc({mode:"hidden",children:Y},w),h=bs(h,w,o,null),Y.return=r,h.return=r,Y.sibling=h,r.child=Y,h=r.child,h.memoizedState=Gf(o),h.childLanes=Xf(t,j,o),r.memoizedState=Kf,za(null,h)):(Bi(r),Qf(r,Y))}var te=t.memoizedState;if(te!==null&&(Y=te.dehydrated,Y!==null)){if(R)r.flags&256?(Bi(r),r.flags&=-257,r=Zf(t,r,o)):r.memoizedState!==null?(ji(),r.child=t.child,r.flags|=128,r=null):(ji(),Y=h.fallback,w=r.mode,h=kc({mode:"visible",children:h.children},w),Y=bs(Y,w,o,null),Y.flags|=2,h.return=r,Y.return=r,h.sibling=Y,r.child=h,As(r,t.child,null,o),h=r.child,h.memoizedState=Gf(o),h.childLanes=Xf(t,j,o),r.memoizedState=Kf,r=za(null,h));else if(Bi(r),Ld(Y)){if(j=Y.nextSibling&&Y.nextSibling.dataset,j)var ue=j.dgst;j=ue,h=Error(s(419)),h.stack="",h.digest=j,Ra({value:h,source:null,stack:null}),r=Zf(t,r,o)}else if(Ht||vo(t,r,o,!1),j=(o&t.childLanes)!==0,Ht||j){if(j=pt,j!==null&&(h=oe(j,o),h!==0&&h!==te.retryLane))throw te.retryLane=h,ys(t,h),Tn(j,t,h),Wf;Od(Y)||Fc(),r=Zf(t,r,o)}else Od(Y)?(r.flags|=192,r.child=t.child,r=null):(t=te.treeContext,yt=Zn(Y.nextSibling),tn=r,Qe=!0,Mi=null,Xn=!1,t!==null&&Xg(r,t),r=Qf(r,h.children),r.flags|=4096);return r}return w?(ji(),Y=h.fallback,w=r.mode,te=t.child,ue=te.sibling,h=Jr(te,{mode:"hidden",children:h.children}),h.subtreeFlags=te.subtreeFlags&65011712,ue!==null?Y=Jr(ue,Y):(Y=bs(Y,w,o,null),Y.flags|=2),Y.return=r,h.return=r,h.sibling=Y,r.child=h,za(null,h),h=r.child,Y=t.child.memoizedState,Y===null?Y=Gf(o):(w=Y.cachePool,w!==null?(te=Bt._currentValue,w=w.parent!==te?{parent:te,pool:te}:w):w=nv(),Y={baseLanes:Y.baseLanes|o,cachePool:w}),h.memoizedState=Y,h.childLanes=Xf(t,j,o),r.memoizedState=Kf,za(t.child,h)):(Bi(r),o=t.child,t=o.sibling,o=Jr(o,{mode:"visible",children:h.children}),o.return=r,o.sibling=null,t!==null&&(j=r.deletions,j===null?(r.deletions=[t],r.flags|=16):j.push(t)),r.child=o,r.memoizedState=null,o)}function Qf(t,r){return r=kc({mode:"visible",children:r},t.mode),r.return=t,t.child=r}function kc(t,r){return t=Bn(22,t,null,r),t.lanes=0,t}function Zf(t,r,o){return As(r,t.child,null,o),t=Qf(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function p_(t,r,o){t.lanes|=r;var h=t.alternate;h!==null&&(h.lanes|=r),df(t.return,r,o)}function Jf(t,r,o,h,w,R){var j=t.memoizedState;j===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:h,tail:o,tailMode:w,treeForkCount:R}:(j.isBackwards=r,j.rendering=null,j.renderingStartTime=0,j.last=h,j.tail=o,j.tailMode=w,j.treeForkCount=R)}function g_(t,r,o){var h=r.pendingProps,w=h.revealOrder,R=h.tail;h=h.children;var j=Mt.current,Y=(j&2)!==0;if(Y?(j=j&1|2,r.flags|=128):j&=1,Q(Mt,j),rn(t,r,h,o),h=Qe?Ea:0,!Y&&t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&p_(t,o,r);else if(t.tag===19)p_(t,o,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(w){case"forwards":for(o=r.child,w=null;o!==null;)t=o.alternate,t!==null&&Sc(t)===null&&(w=o),o=o.sibling;o=w,o===null?(w=r.child,r.child=null):(w=o.sibling,o.sibling=null),Jf(r,!1,w,o,R,h);break;case"backwards":case"unstable_legacy-backwards":for(o=null,w=r.child,r.child=null;w!==null;){if(t=w.alternate,t!==null&&Sc(t)===null){r.child=w;break}t=w.sibling,w.sibling=o,o=w,w=t}Jf(r,!0,o,null,R,h);break;case"together":Jf(r,!1,null,null,void 0,h);break;default:r.memoizedState=null}return r.child}function si(t,r,o){if(t!==null&&(r.dependencies=t.dependencies),Pi|=r.lanes,(o&r.childLanes)===0)if(t!==null){if(vo(t,r,o,!1),(o&r.childLanes)===0)return null}else return null;if(t!==null&&r.child!==t.child)throw Error(s(153));if(r.child!==null){for(t=r.child,o=Jr(t,t.pendingProps),r.child=o,o.return=r;t.sibling!==null;)t=t.sibling,o=o.sibling=Jr(t,t.pendingProps),o.return=r;o.sibling=null}return r.child}function ed(t,r){return(t.lanes&r)!==0?!0:(t=t.dependencies,!!(t!==null&&dc(t)))}function n2(t,r,o){switch(r.tag){case 3:V(r,r.stateNode.containerInfo),Oi(r,Bt,t.memoizedState.cache),Ss();break;case 27:case 5:de(r);break;case 4:V(r,r.stateNode.containerInfo);break;case 10:Oi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Ef(r),null;break;case 13:var h=r.memoizedState;if(h!==null)return h.dehydrated!==null?(Bi(r),r.flags|=128,null):(o&r.child.childLanes)!==0?m_(t,r,o):(Bi(r),t=si(t,r,o),t!==null?t.sibling:null);Bi(r);break;case 19:var w=(t.flags&128)!==0;if(h=(o&r.childLanes)!==0,h||(vo(t,r,o,!1),h=(o&r.childLanes)!==0),w){if(h)return g_(t,r,o);r.flags|=128}if(w=r.memoizedState,w!==null&&(w.rendering=null,w.tail=null,w.lastEffect=null),Q(Mt,Mt.current),h)break;return null;case 22:return r.lanes=0,l_(t,r,o,r.pendingProps);case 24:Oi(r,Bt,t.memoizedState.cache)}return si(t,r,o)}function v_(t,r,o){if(t!==null)if(t.memoizedProps!==r.pendingProps)Ht=!0;else{if(!ed(t,o)&&(r.flags&128)===0)return Ht=!1,n2(t,r,o);Ht=(t.flags&131072)!==0}else Ht=!1,Qe&&(r.flags&1048576)!==0&&Gg(r,Ea,r.index);switch(r.lanes=0,r.tag){case 16:e:{var h=r.pendingProps;if(t=Es(r.elementType),r.type=t,typeof t=="function")sf(t)?(h=Ms(t,h),r.tag=1,r=f_(null,r,t,h,o)):(r.tag=0,r=Yf(null,r,t,h,o));else{if(t!=null){var w=t.$$typeof;if(w===E){r.tag=11,r=s_(null,r,t,h,o);break e}else if(w===T){r.tag=14,r=o_(null,r,t,h,o);break e}}throw r=U(t)||t,Error(s(306,r,""))}}return r;case 0:return Yf(t,r,r.type,r.pendingProps,o);case 1:return h=r.type,w=Ms(h,r.pendingProps),f_(t,r,h,w,o);case 3:e:{if(V(r,r.stateNode.containerInfo),t===null)throw Error(s(387));h=r.pendingProps;var R=r.memoizedState;w=R.element,bf(t,r),ka(r,h,null,o);var j=r.memoizedState;if(h=j.cache,Oi(r,Bt,h),h!==R.cache&&mf(r,[Bt],o,!0),La(),h=j.element,R.isDehydrated)if(R={element:h,isDehydrated:!1,cache:j.cache},r.updateQueue.baseState=R,r.memoizedState=R,r.flags&256){r=d_(t,r,h,o);break e}else if(h!==w){w=Yn(Error(s(424)),r),Ra(w),r=d_(t,r,h,o);break e}else{switch(t=r.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(yt=Zn(t.firstChild),tn=r,Qe=!0,Mi=null,Xn=!0,o=lv(r,null,h,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(Ss(),h===w){r=si(t,r,o);break e}rn(t,r,h,o)}r=r.child}return r;case 26:return Lc(t,r),t===null?(o=T0(r.type,null,r.pendingProps,null))?r.memoizedState=o:Qe||(o=r.type,t=r.pendingProps,h=Gc(Z.current).createElement(o),h[Se]=r,h[xe]=t,sn(h,o,t),lt(h),r.stateNode=h):r.memoizedState=T0(r.type,t.memoizedProps,r.pendingProps,t.memoizedState),null;case 27:return de(r),t===null&&Qe&&(h=r.stateNode=E0(r.type,r.pendingProps,Z.current),tn=r,Xn=!0,w=yt,Vi(r.type)?(kd=w,yt=Zn(h.firstChild)):yt=w),rn(t,r,r.pendingProps.children,o),Lc(t,r),t===null&&(r.flags|=4194304),r.child;case 5:return t===null&&Qe&&((w=h=yt)&&(h=L2(h,r.type,r.pendingProps,Xn),h!==null?(r.stateNode=h,tn=r,yt=Zn(h.firstChild),Xn=!1,w=!0):w=!1),w||Di(r)),de(r),w=r.type,R=r.pendingProps,j=t!==null?t.memoizedProps:null,h=R.children,Td(w,R)?h=null:j!==null&&Td(w,j)&&(r.flags|=32),r.memoizedState!==null&&(w=Af(t,r,YE,null,null,o),Ja._currentValue=w),Lc(t,r),rn(t,r,h,o),r.child;case 6:return t===null&&Qe&&((t=o=yt)&&(o=k2(o,r.pendingProps,Xn),o!==null?(r.stateNode=o,tn=r,yt=null,t=!0):t=!1),t||Di(r)),null;case 13:return m_(t,r,o);case 4:return V(r,r.stateNode.containerInfo),h=r.pendingProps,t===null?r.child=As(r,null,h,o):rn(t,r,h,o),r.child;case 11:return s_(t,r,r.type,r.pendingProps,o);case 7:return rn(t,r,r.pendingProps,o),r.child;case 8:return rn(t,r,r.pendingProps.children,o),r.child;case 12:return rn(t,r,r.pendingProps.children,o),r.child;case 10:return h=r.pendingProps,Oi(r,r.type,h.value),rn(t,r,h.children,o),r.child;case 9:return w=r.type._context,h=r.pendingProps.children,ws(r),w=nn(w),h=h(w),r.flags|=1,rn(t,r,h,o),r.child;case 14:return o_(t,r,r.type,r.pendingProps,o);case 15:return a_(t,r,r.type,r.pendingProps,o);case 19:return g_(t,r,o);case 31:return t2(t,r,o);case 22:return l_(t,r,o,r.pendingProps);case 24:return ws(r),h=nn(Bt),t===null?(w=vf(),w===null&&(w=pt,R=pf(),w.pooledCache=R,R.refCount++,R!==null&&(w.pooledCacheLanes|=o),w=R),r.memoizedState={parent:h,cache:w},yf(r),Oi(r,Bt,w)):((t.lanes&o)!==0&&(bf(t,r),ka(r,null,null,o),La()),w=t.memoizedState,R=r.memoizedState,w.parent!==h?(w={parent:h,cache:h},r.memoizedState=w,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=w),Oi(r,Bt,h)):(h=R.cache,Oi(r,Bt,h),h!==w.cache&&mf(r,[Bt],o,!0))),rn(t,r,r.pendingProps.children,o),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function oi(t){t.flags|=4}function td(t,r,o,h,w){if((r=(t.mode&32)!==0)&&(r=!1),r){if(t.flags|=16777216,(w&335544128)===w)if(t.stateNode.complete)t.flags|=8192;else if(V_())t.flags|=8192;else throw Rs=vc,_f}else t.flags&=-16777217}function __(t,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!k0(r))if(V_())t.flags|=8192;else throw Rs=vc,_f}function Nc(t,r){r!==null&&(t.flags|=4),t.flags&16384&&(r=t.tag!==22?Gr():536870912,t.lanes|=r,Mo|=r)}function Pa(t,r){if(!Qe)switch(t.tailMode){case"hidden":r=t.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?t.tail=null:o.sibling=null;break;case"collapsed":o=t.tail;for(var h=null;o!==null;)o.alternate!==null&&(h=o),o=o.sibling;h===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:h.sibling=null}}function bt(t){var r=t.alternate!==null&&t.alternate.child===t.child,o=0,h=0;if(r)for(var w=t.child;w!==null;)o|=w.lanes|w.childLanes,h|=w.subtreeFlags&65011712,h|=w.flags&65011712,w.return=t,w=w.sibling;else for(w=t.child;w!==null;)o|=w.lanes|w.childLanes,h|=w.subtreeFlags,h|=w.flags,w.return=t,w=w.sibling;return t.subtreeFlags|=h,t.childLanes=o,r}function r2(t,r,o){var h=r.pendingProps;switch(cf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(r),null;case 1:return bt(r),null;case 3:return o=r.stateNode,h=null,t!==null&&(h=t.memoizedState.cache),r.memoizedState.cache!==h&&(r.flags|=2048),ni(Bt),ie(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(t===null||t.child===null)&&(go(r)?oi(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,hf())),bt(r),null;case 26:var w=r.type,R=r.memoizedState;return t===null?(oi(r),R!==null?(bt(r),__(r,R)):(bt(r),td(r,w,null,h,o))):R?R!==t.memoizedState?(oi(r),bt(r),__(r,R)):(bt(r),r.flags&=-16777217):(t=t.memoizedProps,t!==h&&oi(r),bt(r),td(r,w,t,h,o)),null;case 27:if(re(r),o=Z.current,w=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==h&&oi(r);else{if(!h){if(r.stateNode===null)throw Error(s(166));return bt(r),null}t=J.current,go(r)?Qg(r):(t=E0(w,h,o),r.stateNode=t,oi(r))}return bt(r),null;case 5:if(re(r),w=r.type,t!==null&&r.stateNode!=null)t.memoizedProps!==h&&oi(r);else{if(!h){if(r.stateNode===null)throw Error(s(166));return bt(r),null}if(R=J.current,go(r))Qg(r);else{var j=Gc(Z.current);switch(R){case 1:R=j.createElementNS("http://www.w3.org/2000/svg",w);break;case 2:R=j.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;default:switch(w){case"svg":R=j.createElementNS("http://www.w3.org/2000/svg",w);break;case"math":R=j.createElementNS("http://www.w3.org/1998/Math/MathML",w);break;case"script":R=j.createElement("div"),R.innerHTML="<script><\/script>",R=R.removeChild(R.firstChild);break;case"select":R=typeof h.is=="string"?j.createElement("select",{is:h.is}):j.createElement("select"),h.multiple?R.multiple=!0:h.size&&(R.size=h.size);break;default:R=typeof h.is=="string"?j.createElement(w,{is:h.is}):j.createElement(w)}}R[Se]=r,R[xe]=h;e:for(j=r.child;j!==null;){if(j.tag===5||j.tag===6)R.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===r)break e;for(;j.sibling===null;){if(j.return===null||j.return===r)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}r.stateNode=R;e:switch(sn(R,w,h),w){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&oi(r)}}return bt(r),td(r,r.type,t===null?null:t.memoizedProps,r.pendingProps,o),null;case 6:if(t&&r.stateNode!=null)t.memoizedProps!==h&&oi(r);else{if(typeof h!="string"&&r.stateNode===null)throw Error(s(166));if(t=Z.current,go(r)){if(t=r.stateNode,o=r.memoizedProps,h=null,w=tn,w!==null)switch(w.tag){case 27:case 5:h=w.memoizedProps}t[Se]=r,t=!!(t.nodeValue===o||h!==null&&h.suppressHydrationWarning===!0||m0(t.nodeValue,o)),t||Di(r,!0)}else t=Gc(t).createTextNode(h),t[Se]=r,r.stateNode=t}return bt(r),null;case 31:if(o=r.memoizedState,t===null||t.memoizedState!==null){if(h=go(r),o!==null){if(t===null){if(!h)throw Error(s(318));if(t=r.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[Se]=r}else Ss(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;bt(r),t=!1}else o=hf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=o),t=!0;if(!t)return r.flags&256?(Hn(r),r):(Hn(r),null);if((r.flags&128)!==0)throw Error(s(558))}return bt(r),null;case 13:if(h=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(w=go(r),h!==null&&h.dehydrated!==null){if(t===null){if(!w)throw Error(s(318));if(w=r.memoizedState,w=w!==null?w.dehydrated:null,!w)throw Error(s(317));w[Se]=r}else Ss(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;bt(r),w=!1}else w=hf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=w),w=!0;if(!w)return r.flags&256?(Hn(r),r):(Hn(r),null)}return Hn(r),(r.flags&128)!==0?(r.lanes=o,r):(o=h!==null,t=t!==null&&t.memoizedState!==null,o&&(h=r.child,w=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(w=h.alternate.memoizedState.cachePool.pool),R=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(R=h.memoizedState.cachePool.pool),R!==w&&(h.flags|=2048)),o!==t&&o&&(r.child.flags|=8192),Nc(r,r.updateQueue),bt(r),null);case 4:return ie(),t===null&&wd(r.stateNode.containerInfo),bt(r),null;case 10:return ni(r.type),bt(r),null;case 19:if(P(Mt),h=r.memoizedState,h===null)return bt(r),null;if(w=(r.flags&128)!==0,R=h.rendering,R===null)if(w)Pa(h,!1);else{if(Tt!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(R=Sc(t),R!==null){for(r.flags|=128,Pa(h,!1),t=R.updateQueue,r.updateQueue=t,Nc(r,t),r.subtreeFlags=0,t=o,o=r.child;o!==null;)Wg(o,t),o=o.sibling;return Q(Mt,Mt.current&1|2),Qe&&ei(r,h.treeForkCount),r.child}t=t.sibling}h.tail!==null&&it()>Pc&&(r.flags|=128,w=!0,Pa(h,!1),r.lanes=4194304)}else{if(!w)if(t=Sc(R),t!==null){if(r.flags|=128,w=!0,t=t.updateQueue,r.updateQueue=t,Nc(r,t),Pa(h,!0),h.tail===null&&h.tailMode==="hidden"&&!R.alternate&&!Qe)return bt(r),null}else 2*it()-h.renderingStartTime>Pc&&o!==536870912&&(r.flags|=128,w=!0,Pa(h,!1),r.lanes=4194304);h.isBackwards?(R.sibling=r.child,r.child=R):(t=h.last,t!==null?t.sibling=R:r.child=R,h.last=R)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=it(),t.sibling=null,o=Mt.current,Q(Mt,w?o&1|2:o&1),Qe&&ei(r,h.treeForkCount),t):(bt(r),null);case 22:case 23:return Hn(r),Cf(),h=r.memoizedState!==null,t!==null?t.memoizedState!==null!==h&&(r.flags|=8192):h&&(r.flags|=8192),h?(o&536870912)!==0&&(r.flags&128)===0&&(bt(r),r.subtreeFlags&6&&(r.flags|=8192)):bt(r),o=r.updateQueue,o!==null&&Nc(r,o.retryQueue),o=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),h=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(h=r.memoizedState.cachePool.pool),h!==o&&(r.flags|=2048),t!==null&&P(Cs),null;case 24:return o=null,t!==null&&(o=t.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),ni(Bt),bt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function i2(t,r){switch(cf(r),r.tag){case 1:return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return ni(Bt),ie(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 26:case 27:case 5:return re(r),null;case 31:if(r.memoizedState!==null){if(Hn(r),r.alternate===null)throw Error(s(340));Ss()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 13:if(Hn(r),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Ss()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return P(Mt),null;case 4:return ie(),null;case 10:return ni(r.type),null;case 22:case 23:return Hn(r),Cf(),t!==null&&P(Cs),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 24:return ni(Bt),null;case 25:return null;default:return null}}function y_(t,r){switch(cf(r),r.tag){case 3:ni(Bt),ie();break;case 26:case 27:case 5:re(r);break;case 4:ie();break;case 31:r.memoizedState!==null&&Hn(r);break;case 13:Hn(r);break;case 19:P(Mt);break;case 10:ni(r.type);break;case 22:case 23:Hn(r),Cf(),t!==null&&P(Cs);break;case 24:ni(Bt)}}function Ia(t,r){try{var o=r.updateQueue,h=o!==null?o.lastEffect:null;if(h!==null){var w=h.next;o=w;do{if((o.tag&t)===t){h=void 0;var R=o.create,j=o.inst;h=R(),j.destroy=h}o=o.next}while(o!==w)}}catch(Y){ut(r,r.return,Y)}}function Hi(t,r,o){try{var h=r.updateQueue,w=h!==null?h.lastEffect:null;if(w!==null){var R=w.next;h=R;do{if((h.tag&t)===t){var j=h.inst,Y=j.destroy;if(Y!==void 0){j.destroy=void 0,w=r;var te=o,ue=Y;try{ue()}catch(pe){ut(w,te,pe)}}}h=h.next}while(h!==R)}}catch(pe){ut(r,r.return,pe)}}function b_(t){var r=t.updateQueue;if(r!==null){var o=t.stateNode;try{uv(r,o)}catch(h){ut(t,t.return,h)}}}function S_(t,r,o){o.props=Ms(t.type,t.memoizedProps),o.state=t.memoizedState;try{o.componentWillUnmount()}catch(h){ut(t,r,h)}}function Ua(t,r){try{var o=t.ref;if(o!==null){switch(t.tag){case 26:case 27:case 5:var h=t.stateNode;break;case 30:h=t.stateNode;break;default:h=t.stateNode}typeof o=="function"?t.refCleanup=o(h):o.current=h}}catch(w){ut(t,r,w)}}function Mr(t,r){var o=t.ref,h=t.refCleanup;if(o!==null)if(typeof h=="function")try{h()}catch(w){ut(t,r,w)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(w){ut(t,r,w)}else o.current=null}function x_(t){var r=t.type,o=t.memoizedProps,h=t.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":o.autoFocus&&h.focus();break e;case"img":o.src?h.src=o.src:o.srcSet&&(h.srcset=o.srcSet)}}catch(w){ut(t,t.return,w)}}function nd(t,r,o){try{var h=t.stateNode;R2(h,t.type,o,r),h[xe]=r}catch(w){ut(t,t.return,w)}}function w_(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Vi(t.type)||t.tag===4}function rd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||w_(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Vi(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function id(t,r,o){var h=t.tag;if(h===5||h===6)t=t.stateNode,r?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(t,r):(r=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,r.appendChild(t),o=o._reactRootContainer,o!=null||r.onclick!==null||(r.onclick=Qr));else if(h!==4&&(h===27&&Vi(t.type)&&(o=t.stateNode,r=null),t=t.child,t!==null))for(id(t,r,o),t=t.sibling;t!==null;)id(t,r,o),t=t.sibling}function Bc(t,r,o){var h=t.tag;if(h===5||h===6)t=t.stateNode,r?o.insertBefore(t,r):o.appendChild(t);else if(h!==4&&(h===27&&Vi(t.type)&&(o=t.stateNode),t=t.child,t!==null))for(Bc(t,r,o),t=t.sibling;t!==null;)Bc(t,r,o),t=t.sibling}function C_(t){var r=t.stateNode,o=t.memoizedProps;try{for(var h=t.type,w=r.attributes;w.length;)r.removeAttributeNode(w[0]);sn(r,h,o),r[Se]=t,r[xe]=o}catch(R){ut(t,t.return,R)}}var ai=!1,zt=!1,sd=!1,E_=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function s2(t,r){if(t=t.containerInfo,Rd=nu,t=Hg(t),Qh(t)){if("selectionStart"in t)var o={start:t.selectionStart,end:t.selectionEnd};else e:{o=(o=t.ownerDocument)&&o.defaultView||window;var h=o.getSelection&&o.getSelection();if(h&&h.rangeCount!==0){o=h.anchorNode;var w=h.anchorOffset,R=h.focusNode;h=h.focusOffset;try{o.nodeType,R.nodeType}catch{o=null;break e}var j=0,Y=-1,te=-1,ue=0,pe=0,ve=t,he=null;t:for(;;){for(var me;ve!==o||w!==0&&ve.nodeType!==3||(Y=j+w),ve!==R||h!==0&&ve.nodeType!==3||(te=j+h),ve.nodeType===3&&(j+=ve.nodeValue.length),(me=ve.firstChild)!==null;)he=ve,ve=me;for(;;){if(ve===t)break t;if(he===o&&++ue===w&&(Y=j),he===R&&++pe===h&&(te=j),(me=ve.nextSibling)!==null)break;ve=he,he=ve.parentNode}ve=me}o=Y===-1||te===-1?null:{start:Y,end:te}}else o=null}o=o||{start:0,end:0}}else o=null;for(Ad={focusedElem:t,selectionRange:o},nu=!1,Zt=r;Zt!==null;)if(r=Zt,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Zt=t;else for(;Zt!==null;){switch(r=Zt,R=r.alternate,t=r.flags,r.tag){case 0:if((t&4)!==0&&(t=r.updateQueue,t=t!==null?t.events:null,t!==null))for(o=0;o<t.length;o++)w=t[o],w.ref.impl=w.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&R!==null){t=void 0,o=r,w=R.memoizedProps,R=R.memoizedState,h=o.stateNode;try{var Re=Ms(o.type,w);t=h.getSnapshotBeforeUpdate(Re,R),h.__reactInternalSnapshotBeforeUpdate=t}catch(ze){ut(o,o.return,ze)}}break;case 3:if((t&1024)!==0){if(t=r.stateNode.containerInfo,o=t.nodeType,o===9)Dd(t);else if(o===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Dd(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(s(163))}if(t=r.sibling,t!==null){t.return=r.return,Zt=t;break}Zt=r.return}}function R_(t,r,o){var h=o.flags;switch(o.tag){case 0:case 11:case 15:ci(t,o),h&4&&Ia(5,o);break;case 1:if(ci(t,o),h&4)if(t=o.stateNode,r===null)try{t.componentDidMount()}catch(j){ut(o,o.return,j)}else{var w=Ms(o.type,r.memoizedProps);r=r.memoizedState;try{t.componentDidUpdate(w,r,t.__reactInternalSnapshotBeforeUpdate)}catch(j){ut(o,o.return,j)}}h&64&&b_(o),h&512&&Ua(o,o.return);break;case 3:if(ci(t,o),h&64&&(t=o.updateQueue,t!==null)){if(r=null,o.child!==null)switch(o.child.tag){case 27:case 5:r=o.child.stateNode;break;case 1:r=o.child.stateNode}try{uv(t,r)}catch(j){ut(o,o.return,j)}}break;case 27:r===null&&h&4&&C_(o);case 26:case 5:ci(t,o),r===null&&h&4&&x_(o),h&512&&Ua(o,o.return);break;case 12:ci(t,o);break;case 31:ci(t,o),h&4&&M_(t,o);break;case 13:ci(t,o),h&4&&D_(t,o),h&64&&(t=o.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(o=m2.bind(null,o),N2(t,o))));break;case 22:if(h=o.memoizedState!==null||ai,!h){r=r!==null&&r.memoizedState!==null||zt,w=ai;var R=zt;ai=h,(zt=r)&&!R?ui(t,o,(o.subtreeFlags&8772)!==0):ci(t,o),ai=w,zt=R}break;case 30:break;default:ci(t,o)}}function A_(t){var r=t.alternate;r!==null&&(t.alternate=null,A_(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&St(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var xt=null,Cn=!1;function li(t,r,o){for(o=o.child;o!==null;)T_(t,r,o),o=o.sibling}function T_(t,r,o){if(_t&&typeof _t.onCommitFiberUnmount=="function")try{_t.onCommitFiberUnmount(or,o)}catch{}switch(o.tag){case 26:zt||Mr(o,r),li(t,r,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:zt||Mr(o,r);var h=xt,w=Cn;Vi(o.type)&&(xt=o.stateNode,Cn=!1),li(t,r,o),Xa(o.stateNode),xt=h,Cn=w;break;case 5:zt||Mr(o,r);case 6:if(h=xt,w=Cn,xt=null,li(t,r,o),xt=h,Cn=w,xt!==null)if(Cn)try{(xt.nodeType===9?xt.body:xt.nodeName==="HTML"?xt.ownerDocument.body:xt).removeChild(o.stateNode)}catch(R){ut(o,r,R)}else try{xt.removeChild(o.stateNode)}catch(R){ut(o,r,R)}break;case 18:xt!==null&&(Cn?(t=xt,b0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,o.stateNode),Ho(t)):b0(xt,o.stateNode));break;case 4:h=xt,w=Cn,xt=o.stateNode.containerInfo,Cn=!0,li(t,r,o),xt=h,Cn=w;break;case 0:case 11:case 14:case 15:Hi(2,o,r),zt||Hi(4,o,r),li(t,r,o);break;case 1:zt||(Mr(o,r),h=o.stateNode,typeof h.componentWillUnmount=="function"&&S_(o,r,h)),li(t,r,o);break;case 21:li(t,r,o);break;case 22:zt=(h=zt)||o.memoizedState!==null,li(t,r,o),zt=h;break;default:li(t,r,o)}}function M_(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ho(t)}catch(o){ut(r,r.return,o)}}}function D_(t,r){if(r.memoizedState===null&&(t=r.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ho(t)}catch(o){ut(r,r.return,o)}}function o2(t){switch(t.tag){case 31:case 13:case 19:var r=t.stateNode;return r===null&&(r=t.stateNode=new E_),r;case 22:return t=t.stateNode,r=t._retryCache,r===null&&(r=t._retryCache=new E_),r;default:throw Error(s(435,t.tag))}}function jc(t,r){var o=o2(t);r.forEach(function(h){if(!o.has(h)){o.add(h);var w=p2.bind(null,t,h);h.then(w,w)}})}function En(t,r){var o=r.deletions;if(o!==null)for(var h=0;h<o.length;h++){var w=o[h],R=t,j=r,Y=j;e:for(;Y!==null;){switch(Y.tag){case 27:if(Vi(Y.type)){xt=Y.stateNode,Cn=!1;break e}break;case 5:xt=Y.stateNode,Cn=!1;break e;case 3:case 4:xt=Y.stateNode.containerInfo,Cn=!0;break e}Y=Y.return}if(xt===null)throw Error(s(160));T_(R,j,w),xt=null,Cn=!1,R=w.alternate,R!==null&&(R.return=null),w.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)O_(r,t),r=r.sibling}var ur=null;function O_(t,r){var o=t.alternate,h=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:En(r,t),Rn(t),h&4&&(Hi(3,t,t.return),Ia(3,t),Hi(5,t,t.return));break;case 1:En(r,t),Rn(t),h&512&&(zt||o===null||Mr(o,o.return)),h&64&&ai&&(t=t.updateQueue,t!==null&&(h=t.callbacks,h!==null&&(o=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=o===null?h:o.concat(h))));break;case 26:var w=ur;if(En(r,t),Rn(t),h&512&&(zt||o===null||Mr(o,o.return)),h&4){var R=o!==null?o.memoizedState:null;if(h=t.memoizedState,o===null)if(h===null)if(t.stateNode===null){e:{h=t.type,o=t.memoizedProps,w=w.ownerDocument||w;t:switch(h){case"title":R=w.getElementsByTagName("title")[0],(!R||R[mt]||R[Se]||R.namespaceURI==="http://www.w3.org/2000/svg"||R.hasAttribute("itemprop"))&&(R=w.createElement(h),w.head.insertBefore(R,w.querySelector("head > title"))),sn(R,h,o),R[Se]=t,lt(R),h=R;break e;case"link":var j=O0("link","href",w).get(h+(o.href||""));if(j){for(var Y=0;Y<j.length;Y++)if(R=j[Y],R.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&R.getAttribute("rel")===(o.rel==null?null:o.rel)&&R.getAttribute("title")===(o.title==null?null:o.title)&&R.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){j.splice(Y,1);break t}}R=w.createElement(h),sn(R,h,o),w.head.appendChild(R);break;case"meta":if(j=O0("meta","content",w).get(h+(o.content||""))){for(Y=0;Y<j.length;Y++)if(R=j[Y],R.getAttribute("content")===(o.content==null?null:""+o.content)&&R.getAttribute("name")===(o.name==null?null:o.name)&&R.getAttribute("property")===(o.property==null?null:o.property)&&R.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&R.getAttribute("charset")===(o.charSet==null?null:o.charSet)){j.splice(Y,1);break t}}R=w.createElement(h),sn(R,h,o),w.head.appendChild(R);break;default:throw Error(s(468,h))}R[Se]=t,lt(R),h=R}t.stateNode=h}else L0(w,t.type,t.stateNode);else t.stateNode=D0(w,h,t.memoizedProps);else R!==h?(R===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):R.count--,h===null?L0(w,t.type,t.stateNode):D0(w,h,t.memoizedProps)):h===null&&t.stateNode!==null&&nd(t,t.memoizedProps,o.memoizedProps)}break;case 27:En(r,t),Rn(t),h&512&&(zt||o===null||Mr(o,o.return)),o!==null&&h&4&&nd(t,t.memoizedProps,o.memoizedProps);break;case 5:if(En(r,t),Rn(t),h&512&&(zt||o===null||Mr(o,o.return)),t.flags&32){w=t.stateNode;try{so(w,"")}catch(Re){ut(t,t.return,Re)}}h&4&&t.stateNode!=null&&(w=t.memoizedProps,nd(t,w,o!==null?o.memoizedProps:w)),h&1024&&(sd=!0);break;case 6:if(En(r,t),Rn(t),h&4){if(t.stateNode===null)throw Error(s(162));h=t.memoizedProps,o=t.stateNode;try{o.nodeValue=h}catch(Re){ut(t,t.return,Re)}}break;case 3:if(Zc=null,w=ur,ur=Xc(r.containerInfo),En(r,t),ur=w,Rn(t),h&4&&o!==null&&o.memoizedState.isDehydrated)try{Ho(r.containerInfo)}catch(Re){ut(t,t.return,Re)}sd&&(sd=!1,L_(t));break;case 4:h=ur,ur=Xc(t.stateNode.containerInfo),En(r,t),Rn(t),ur=h;break;case 12:En(r,t),Rn(t);break;case 31:En(r,t),Rn(t),h&4&&(h=t.updateQueue,h!==null&&(t.updateQueue=null,jc(t,h)));break;case 13:En(r,t),Rn(t),t.child.flags&8192&&t.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(zc=it()),h&4&&(h=t.updateQueue,h!==null&&(t.updateQueue=null,jc(t,h)));break;case 22:w=t.memoizedState!==null;var te=o!==null&&o.memoizedState!==null,ue=ai,pe=zt;if(ai=ue||w,zt=pe||te,En(r,t),zt=pe,ai=ue,Rn(t),h&8192)e:for(r=t.stateNode,r._visibility=w?r._visibility&-2:r._visibility|1,w&&(o===null||te||ai||zt||Ds(t)),o=null,r=t;;){if(r.tag===5||r.tag===26){if(o===null){te=o=r;try{if(R=te.stateNode,w)j=R.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{Y=te.stateNode;var ve=te.memoizedProps.style,he=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;Y.style.display=he==null||typeof he=="boolean"?"":(""+he).trim()}}catch(Re){ut(te,te.return,Re)}}}else if(r.tag===6){if(o===null){te=r;try{te.stateNode.nodeValue=w?"":te.memoizedProps}catch(Re){ut(te,te.return,Re)}}}else if(r.tag===18){if(o===null){te=r;try{var me=te.stateNode;w?S0(me,!0):S0(te.stateNode,!1)}catch(Re){ut(te,te.return,Re)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;o===r&&(o=null),r=r.return}o===r&&(o=null),r.sibling.return=r.return,r=r.sibling}h&4&&(h=t.updateQueue,h!==null&&(o=h.retryQueue,o!==null&&(h.retryQueue=null,jc(t,o))));break;case 19:En(r,t),Rn(t),h&4&&(h=t.updateQueue,h!==null&&(t.updateQueue=null,jc(t,h)));break;case 30:break;case 21:break;default:En(r,t),Rn(t)}}function Rn(t){var r=t.flags;if(r&2){try{for(var o,h=t.return;h!==null;){if(w_(h)){o=h;break}h=h.return}if(o==null)throw Error(s(160));switch(o.tag){case 27:var w=o.stateNode,R=rd(t);Bc(t,R,w);break;case 5:var j=o.stateNode;o.flags&32&&(so(j,""),o.flags&=-33);var Y=rd(t);Bc(t,Y,j);break;case 3:case 4:var te=o.stateNode.containerInfo,ue=rd(t);id(t,ue,te);break;default:throw Error(s(161))}}catch(pe){ut(t,t.return,pe)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function L_(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var r=t;L_(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),t=t.sibling}}function ci(t,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)R_(t,r.alternate,r),r=r.sibling}function Ds(t){for(t=t.child;t!==null;){var r=t;switch(r.tag){case 0:case 11:case 14:case 15:Hi(4,r,r.return),Ds(r);break;case 1:Mr(r,r.return);var o=r.stateNode;typeof o.componentWillUnmount=="function"&&S_(r,r.return,o),Ds(r);break;case 27:Xa(r.stateNode);case 26:case 5:Mr(r,r.return),Ds(r);break;case 22:r.memoizedState===null&&Ds(r);break;case 30:Ds(r);break;default:Ds(r)}t=t.sibling}}function ui(t,r,o){for(o=o&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var h=r.alternate,w=t,R=r,j=R.flags;switch(R.tag){case 0:case 11:case 15:ui(w,R,o),Ia(4,R);break;case 1:if(ui(w,R,o),h=R,w=h.stateNode,typeof w.componentDidMount=="function")try{w.componentDidMount()}catch(ue){ut(h,h.return,ue)}if(h=R,w=h.updateQueue,w!==null){var Y=h.stateNode;try{var te=w.shared.hiddenCallbacks;if(te!==null)for(w.shared.hiddenCallbacks=null,w=0;w<te.length;w++)cv(te[w],Y)}catch(ue){ut(h,h.return,ue)}}o&&j&64&&b_(R),Ua(R,R.return);break;case 27:C_(R);case 26:case 5:ui(w,R,o),o&&h===null&&j&4&&x_(R),Ua(R,R.return);break;case 12:ui(w,R,o);break;case 31:ui(w,R,o),o&&j&4&&M_(w,R);break;case 13:ui(w,R,o),o&&j&4&&D_(w,R);break;case 22:R.memoizedState===null&&ui(w,R,o),Ua(R,R.return);break;case 30:break;default:ui(w,R,o)}r=r.sibling}}function od(t,r){var o=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(o=t.memoizedState.cachePool.pool),t=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(t=r.memoizedState.cachePool.pool),t!==o&&(t!=null&&t.refCount++,o!=null&&Aa(o))}function ad(t,r){t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Aa(t))}function hr(t,r,o,h){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)k_(t,r,o,h),r=r.sibling}function k_(t,r,o,h){var w=r.flags;switch(r.tag){case 0:case 11:case 15:hr(t,r,o,h),w&2048&&Ia(9,r);break;case 1:hr(t,r,o,h);break;case 3:hr(t,r,o,h),w&2048&&(t=null,r.alternate!==null&&(t=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==t&&(r.refCount++,t!=null&&Aa(t)));break;case 12:if(w&2048){hr(t,r,o,h),t=r.stateNode;try{var R=r.memoizedProps,j=R.id,Y=R.onPostCommit;typeof Y=="function"&&Y(j,r.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(te){ut(r,r.return,te)}}else hr(t,r,o,h);break;case 31:hr(t,r,o,h);break;case 13:hr(t,r,o,h);break;case 23:break;case 22:R=r.stateNode,j=r.alternate,r.memoizedState!==null?R._visibility&2?hr(t,r,o,h):Fa(t,r):R._visibility&2?hr(t,r,o,h):(R._visibility|=2,Ro(t,r,o,h,(r.subtreeFlags&10256)!==0||!1)),w&2048&&od(j,r);break;case 24:hr(t,r,o,h),w&2048&&ad(r.alternate,r);break;default:hr(t,r,o,h)}}function Ro(t,r,o,h,w){for(w=w&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var R=t,j=r,Y=o,te=h,ue=j.flags;switch(j.tag){case 0:case 11:case 15:Ro(R,j,Y,te,w),Ia(8,j);break;case 23:break;case 22:var pe=j.stateNode;j.memoizedState!==null?pe._visibility&2?Ro(R,j,Y,te,w):Fa(R,j):(pe._visibility|=2,Ro(R,j,Y,te,w)),w&&ue&2048&&od(j.alternate,j);break;case 24:Ro(R,j,Y,te,w),w&&ue&2048&&ad(j.alternate,j);break;default:Ro(R,j,Y,te,w)}r=r.sibling}}function Fa(t,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var o=t,h=r,w=h.flags;switch(h.tag){case 22:Fa(o,h),w&2048&&od(h.alternate,h);break;case 24:Fa(o,h),w&2048&&ad(h.alternate,h);break;default:Fa(o,h)}r=r.sibling}}var $a=8192;function Ao(t,r,o){if(t.subtreeFlags&$a)for(t=t.child;t!==null;)N_(t,r,o),t=t.sibling}function N_(t,r,o){switch(t.tag){case 26:Ao(t,r,o),t.flags&$a&&t.memoizedState!==null&&W2(o,ur,t.memoizedState,t.memoizedProps);break;case 5:Ao(t,r,o);break;case 3:case 4:var h=ur;ur=Xc(t.stateNode.containerInfo),Ao(t,r,o),ur=h;break;case 22:t.memoizedState===null&&(h=t.alternate,h!==null&&h.memoizedState!==null?(h=$a,$a=16777216,Ao(t,r,o),$a=h):Ao(t,r,o));break;default:Ao(t,r,o)}}function B_(t){var r=t.alternate;if(r!==null&&(t=r.child,t!==null)){r.child=null;do r=t.sibling,t.sibling=null,t=r;while(t!==null)}}function Va(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var h=r[o];Zt=h,H_(h,t)}B_(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)j_(t),t=t.sibling}function j_(t){switch(t.tag){case 0:case 11:case 15:Va(t),t.flags&2048&&Hi(9,t,t.return);break;case 3:Va(t);break;case 12:Va(t);break;case 22:var r=t.stateNode;t.memoizedState!==null&&r._visibility&2&&(t.return===null||t.return.tag!==13)?(r._visibility&=-3,Hc(t)):Va(t);break;default:Va(t)}}function Hc(t){var r=t.deletions;if((t.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var h=r[o];Zt=h,H_(h,t)}B_(t)}for(t=t.child;t!==null;){switch(r=t,r.tag){case 0:case 11:case 15:Hi(8,r,r.return),Hc(r);break;case 22:o=r.stateNode,o._visibility&2&&(o._visibility&=-3,Hc(r));break;default:Hc(r)}t=t.sibling}}function H_(t,r){for(;Zt!==null;){var o=Zt;switch(o.tag){case 0:case 11:case 15:Hi(8,o,r);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var h=o.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Aa(o.memoizedState.cache)}if(h=o.child,h!==null)h.return=o,Zt=h;else e:for(o=t;Zt!==null;){h=Zt;var w=h.sibling,R=h.return;if(A_(h),h===o){Zt=null;break e}if(w!==null){w.return=R,Zt=w;break e}Zt=R}}}var a2={getCacheForType:function(t){var r=nn(Bt),o=r.data.get(t);return o===void 0&&(o=t(),r.data.set(t,o)),o},cacheSignal:function(){return nn(Bt).controller.signal}},l2=typeof WeakMap=="function"?WeakMap:Map,at=0,pt=null,Ye=null,Ge=0,ct=0,zn=null,zi=!1,To=!1,ld=!1,hi=0,Tt=0,Pi=0,Os=0,cd=0,Pn=0,Mo=0,qa=null,An=null,ud=!1,zc=0,z_=0,Pc=1/0,Ic=null,Ii=null,Vt=0,Ui=null,Do=null,fi=0,hd=0,fd=null,P_=null,Wa=0,dd=null;function In(){return(at&2)!==0&&Ge!==0?Ge&-Ge:H.T!==null?yd():be()}function I_(){if(Pn===0)if((Ge&536870912)===0||Qe){var t=Wr;Wr<<=1,(Wr&3932160)===0&&(Wr=262144),Pn=t}else Pn=536870912;return t=jn.current,t!==null&&(t.flags|=32),Pn}function Tn(t,r,o){(t===pt&&(ct===2||ct===9)||t.cancelPendingCommit!==null)&&(Oo(t,0),Fi(t,Ge,Pn,!1)),Er(t,o),((at&2)===0||t!==pt)&&(t===pt&&((at&2)===0&&(Os|=o),Tt===4&&Fi(t,Ge,Pn,!1)),Dr(t))}function U_(t,r,o){if((at&6)!==0)throw Error(s(327));var h=!o&&(r&127)===0&&(r&t.expiredLanes)===0||Kr(t,r),w=h?h2(t,r):pd(t,r,!0),R=h;do{if(w===0){To&&!h&&Fi(t,r,0,!1);break}else{if(o=t.current.alternate,R&&!c2(o)){w=pd(t,r,!1),R=!1;continue}if(w===2){if(R=r,t.errorRecoveryDisabledLanes&R)var j=0;else j=t.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){r=j;e:{var Y=t;w=qa;var te=Y.current.memoizedState.isDehydrated;if(te&&(Oo(Y,j).flags|=256),j=pd(Y,j,!1),j!==2){if(ld&&!te){Y.errorRecoveryDisabledLanes|=R,Os|=R,w=4;break e}R=An,An=w,R!==null&&(An===null?An=R:An.push.apply(An,R))}w=j}if(R=!1,w!==2)continue}}if(w===1){Oo(t,0),Fi(t,r,0,!0);break}e:{switch(h=t,R=w,R){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:Fi(h,r,Pn,!zi);break e;case 2:An=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(w=zc+300-it(),10<w)){if(Fi(h,r,Pn,!zi),Yr(h,0,!0)!==0)break e;fi=r,h.timeoutHandle=_0(F_.bind(null,h,o,An,Ic,ud,r,Pn,Os,Mo,zi,R,"Throttled",-0,0),w);break e}F_(h,o,An,Ic,ud,r,Pn,Os,Mo,zi,R,null,-0,0)}}break}while(!0);Dr(t)}function F_(t,r,o,h,w,R,j,Y,te,ue,pe,ve,he,me){if(t.timeoutHandle=-1,ve=r.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qr},N_(r,R,ve);var Re=(R&62914560)===R?zc-it():(R&4194048)===R?z_-it():0;if(Re=Y2(ve,Re),Re!==null){fi=R,t.cancelPendingCommit=Re(X_.bind(null,t,r,R,o,h,w,j,Y,te,pe,ve,null,he,me)),Fi(t,R,j,!ue);return}}X_(t,r,R,o,h,w,j,Y,te)}function c2(t){for(var r=t;;){var o=r.tag;if((o===0||o===11||o===15)&&r.flags&16384&&(o=r.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var h=0;h<o.length;h++){var w=o[h],R=w.getSnapshot;w=w.value;try{if(!Nn(R(),w))return!1}catch{return!1}}if(o=r.child,r.subtreeFlags&16384&&o!==null)o.return=r,r=o;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Fi(t,r,o,h){r&=~cd,r&=~Os,t.suspendedLanes|=r,t.pingedLanes&=~r,h&&(t.warmLanes|=r),h=t.expirationTimes;for(var w=r;0<w;){var R=31-Qt(w),j=1<<R;h[R]=-1,w&=~j}o!==0&&ro(t,o,r)}function Uc(){return(at&6)===0?(Ya(0),!1):!0}function md(){if(Ye!==null){if(ct===0)var t=Ye.return;else t=Ye,ti=xs=null,Df(t),So=null,Ma=0,t=Ye;for(;t!==null;)y_(t.alternate,t),t=t.return;Ye=null}}function Oo(t,r){var o=t.timeoutHandle;o!==-1&&(t.timeoutHandle=-1,M2(o)),o=t.cancelPendingCommit,o!==null&&(t.cancelPendingCommit=null,o()),fi=0,md(),pt=t,Ye=o=Jr(t.current,null),Ge=r,ct=0,zn=null,zi=!1,To=Kr(t,r),ld=!1,Mo=Pn=cd=Os=Pi=Tt=0,An=qa=null,ud=!1,(r&8)!==0&&(r|=r&32);var h=t.entangledLanes;if(h!==0)for(t=t.entanglements,h&=r;0<h;){var w=31-Qt(h),R=1<<w;r|=t[w],h&=~R}return hi=r,lc(),o}function $_(t,r){Ue=null,H.H=Ha,r===bo||r===gc?(r=sv(),ct=3):r===_f?(r=sv(),ct=4):ct=r===Wf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,zn=r,Ye===null&&(Tt=1,Dc(t,Yn(r,t.current)))}function V_(){var t=jn.current;return t===null?!0:(Ge&4194048)===Ge?Qn===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?t===Qn:!1}function q_(){var t=H.H;return H.H=Ha,t===null?Ha:t}function W_(){var t=H.A;return H.A=a2,t}function Fc(){Tt=4,zi||(Ge&4194048)!==Ge&&jn.current!==null||(To=!0),(Pi&134217727)===0&&(Os&134217727)===0||pt===null||Fi(pt,Ge,Pn,!1)}function pd(t,r,o){var h=at;at|=2;var w=q_(),R=W_();(pt!==t||Ge!==r)&&(Ic=null,Oo(t,r)),r=!1;var j=Tt;e:do try{if(ct!==0&&Ye!==null){var Y=Ye,te=zn;switch(ct){case 8:md(),j=6;break e;case 3:case 2:case 9:case 6:jn.current===null&&(r=!0);var ue=ct;if(ct=0,zn=null,Lo(t,Y,te,ue),o&&To){j=0;break e}break;default:ue=ct,ct=0,zn=null,Lo(t,Y,te,ue)}}u2(),j=Tt;break}catch(pe){$_(t,pe)}while(!0);return r&&t.shellSuspendCounter++,ti=xs=null,at=h,H.H=w,H.A=R,Ye===null&&(pt=null,Ge=0,lc()),j}function u2(){for(;Ye!==null;)Y_(Ye)}function h2(t,r){var o=at;at|=2;var h=q_(),w=W_();pt!==t||Ge!==r?(Ic=null,Pc=it()+500,Oo(t,r)):To=Kr(t,r);e:do try{if(ct!==0&&Ye!==null){r=Ye;var R=zn;t:switch(ct){case 1:ct=0,zn=null,Lo(t,r,R,1);break;case 2:case 9:if(rv(R)){ct=0,zn=null,K_(r);break}r=function(){ct!==2&&ct!==9||pt!==t||(ct=7),Dr(t)},R.then(r,r);break e;case 3:ct=7;break e;case 4:ct=5;break e;case 7:rv(R)?(ct=0,zn=null,K_(r)):(ct=0,zn=null,Lo(t,r,R,7));break;case 5:var j=null;switch(Ye.tag){case 26:j=Ye.memoizedState;case 5:case 27:var Y=Ye;if(j?k0(j):Y.stateNode.complete){ct=0,zn=null;var te=Y.sibling;if(te!==null)Ye=te;else{var ue=Y.return;ue!==null?(Ye=ue,$c(ue)):Ye=null}break t}}ct=0,zn=null,Lo(t,r,R,5);break;case 6:ct=0,zn=null,Lo(t,r,R,6);break;case 8:md(),Tt=6;break e;default:throw Error(s(462))}}f2();break}catch(pe){$_(t,pe)}while(!0);return ti=xs=null,H.H=h,H.A=w,at=o,Ye!==null?0:(pt=null,Ge=0,lc(),Tt)}function f2(){for(;Ye!==null&&!yn();)Y_(Ye)}function Y_(t){var r=v_(t.alternate,t,hi);t.memoizedProps=t.pendingProps,r===null?$c(t):Ye=r}function K_(t){var r=t,o=r.alternate;switch(r.tag){case 15:case 0:r=h_(o,r,r.pendingProps,r.type,void 0,Ge);break;case 11:r=h_(o,r,r.pendingProps,r.type.render,r.ref,Ge);break;case 5:Df(r);default:y_(o,r),r=Ye=Wg(r,hi),r=v_(o,r,hi)}t.memoizedProps=t.pendingProps,r===null?$c(t):Ye=r}function Lo(t,r,o,h){ti=xs=null,Df(r),So=null,Ma=0;var w=r.return;try{if(e2(t,w,r,o,Ge)){Tt=1,Dc(t,Yn(o,t.current)),Ye=null;return}}catch(R){if(w!==null)throw Ye=w,R;Tt=1,Dc(t,Yn(o,t.current)),Ye=null;return}r.flags&32768?(Qe||h===1?t=!0:To||(Ge&536870912)!==0?t=!1:(zi=t=!0,(h===2||h===9||h===3||h===6)&&(h=jn.current,h!==null&&h.tag===13&&(h.flags|=16384))),G_(r,t)):$c(r)}function $c(t){var r=t;do{if((r.flags&32768)!==0){G_(r,zi);return}t=r.return;var o=r2(r.alternate,r,hi);if(o!==null){Ye=o;return}if(r=r.sibling,r!==null){Ye=r;return}Ye=r=t}while(r!==null);Tt===0&&(Tt=5)}function G_(t,r){do{var o=i2(t.alternate,t);if(o!==null){o.flags&=32767,Ye=o;return}if(o=t.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!r&&(t=t.sibling,t!==null)){Ye=t;return}Ye=t=o}while(t!==null);Tt=6,Ye=null}function X_(t,r,o,h,w,R,j,Y,te){t.cancelPendingCommit=null;do Vc();while(Vt!==0);if((at&6)!==0)throw Error(s(327));if(r!==null){if(r===t.current)throw Error(s(177));if(R=r.lanes|r.childLanes,R|=nf,da(t,o,R,j,Y,te),t===pt&&(Ye=pt=null,Ge=0),Do=r,Ui=t,fi=o,hd=R,fd=w,P_=h,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,g2(gt,function(){return t0(),null})):(t.callbackNode=null,t.callbackPriority=0),h=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||h){h=H.T,H.T=null,w=K.p,K.p=2,j=at,at|=4;try{s2(t,r,o)}finally{at=j,K.p=w,H.T=h}}Vt=1,Q_(),Z_(),J_()}}function Q_(){if(Vt===1){Vt=0;var t=Ui,r=Do,o=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||o){o=H.T,H.T=null;var h=K.p;K.p=2;var w=at;at|=4;try{O_(r,t);var R=Ad,j=Hg(t.containerInfo),Y=R.focusedElem,te=R.selectionRange;if(j!==Y&&Y&&Y.ownerDocument&&jg(Y.ownerDocument.documentElement,Y)){if(te!==null&&Qh(Y)){var ue=te.start,pe=te.end;if(pe===void 0&&(pe=ue),"selectionStart"in Y)Y.selectionStart=ue,Y.selectionEnd=Math.min(pe,Y.value.length);else{var ve=Y.ownerDocument||document,he=ve&&ve.defaultView||window;if(he.getSelection){var me=he.getSelection(),Re=Y.textContent.length,ze=Math.min(te.start,Re),dt=te.end===void 0?ze:Math.min(te.end,Re);!me.extend&&ze>dt&&(j=dt,dt=ze,ze=j);var se=Bg(Y,ze),ne=Bg(Y,dt);if(se&&ne&&(me.rangeCount!==1||me.anchorNode!==se.node||me.anchorOffset!==se.offset||me.focusNode!==ne.node||me.focusOffset!==ne.offset)){var ce=ve.createRange();ce.setStart(se.node,se.offset),me.removeAllRanges(),ze>dt?(me.addRange(ce),me.extend(ne.node,ne.offset)):(ce.setEnd(ne.node,ne.offset),me.addRange(ce))}}}}for(ve=[],me=Y;me=me.parentNode;)me.nodeType===1&&ve.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof Y.focus=="function"&&Y.focus(),Y=0;Y<ve.length;Y++){var ge=ve[Y];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}nu=!!Rd,Ad=Rd=null}finally{at=w,K.p=h,H.T=o}}t.current=r,Vt=2}}function Z_(){if(Vt===2){Vt=0;var t=Ui,r=Do,o=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||o){o=H.T,H.T=null;var h=K.p;K.p=2;var w=at;at|=4;try{R_(t,r.alternate,r)}finally{at=w,K.p=h,H.T=o}}Vt=3}}function J_(){if(Vt===4||Vt===3){Vt=0,Rt();var t=Ui,r=Do,o=fi,h=P_;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Vt=5:(Vt=0,Do=Ui=null,e0(t,t.pendingLanes));var w=t.pendingLanes;if(w===0&&(Ii=null),ye(o),r=r.stateNode,_t&&typeof _t.onCommitFiberRoot=="function")try{_t.onCommitFiberRoot(or,r,void 0,(r.current.flags&128)===128)}catch{}if(h!==null){r=H.T,w=K.p,K.p=2,H.T=null;try{for(var R=t.onRecoverableError,j=0;j<h.length;j++){var Y=h[j];R(Y.value,{componentStack:Y.stack})}}finally{H.T=r,K.p=w}}(fi&3)!==0&&Vc(),Dr(t),w=t.pendingLanes,(o&261930)!==0&&(w&42)!==0?t===dd?Wa++:(Wa=0,dd=t):Wa=0,Ya(0)}}function e0(t,r){(t.pooledCacheLanes&=r)===0&&(r=t.pooledCache,r!=null&&(t.pooledCache=null,Aa(r)))}function Vc(){return Q_(),Z_(),J_(),t0()}function t0(){if(Vt!==5)return!1;var t=Ui,r=hd;hd=0;var o=ye(fi),h=H.T,w=K.p;try{K.p=32>o?32:o,H.T=null,o=fd,fd=null;var R=Ui,j=fi;if(Vt=0,Do=Ui=null,fi=0,(at&6)!==0)throw Error(s(331));var Y=at;if(at|=4,j_(R.current),k_(R,R.current,j,o),at=Y,Ya(0,!1),_t&&typeof _t.onPostCommitFiberRoot=="function")try{_t.onPostCommitFiberRoot(or,R)}catch{}return!0}finally{K.p=w,H.T=h,e0(t,r)}}function n0(t,r,o){r=Yn(o,r),r=qf(t.stateNode,r,2),t=Ni(t,r,2),t!==null&&(Er(t,2),Dr(t))}function ut(t,r,o){if(t.tag===3)n0(t,t,o);else for(;r!==null;){if(r.tag===3){n0(r,t,o);break}else if(r.tag===1){var h=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ii===null||!Ii.has(h))){t=Yn(o,t),o=r_(2),h=Ni(r,o,2),h!==null&&(i_(o,h,r,t),Er(h,2),Dr(h));break}}r=r.return}}function gd(t,r,o){var h=t.pingCache;if(h===null){h=t.pingCache=new l2;var w=new Set;h.set(r,w)}else w=h.get(r),w===void 0&&(w=new Set,h.set(r,w));w.has(o)||(ld=!0,w.add(o),t=d2.bind(null,t,r,o),r.then(t,t))}function d2(t,r,o){var h=t.pingCache;h!==null&&h.delete(r),t.pingedLanes|=t.suspendedLanes&o,t.warmLanes&=~o,pt===t&&(Ge&o)===o&&(Tt===4||Tt===3&&(Ge&62914560)===Ge&&300>it()-zc?(at&2)===0&&Oo(t,0):cd|=o,Mo===Ge&&(Mo=0)),Dr(t)}function r0(t,r){r===0&&(r=Gr()),t=ys(t,r),t!==null&&(Er(t,r),Dr(t))}function m2(t){var r=t.memoizedState,o=0;r!==null&&(o=r.retryLane),r0(t,o)}function p2(t,r){var o=0;switch(t.tag){case 31:case 13:var h=t.stateNode,w=t.memoizedState;w!==null&&(o=w.retryLane);break;case 19:h=t.stateNode;break;case 22:h=t.stateNode._retryCache;break;default:throw Error(s(314))}h!==null&&h.delete(r),r0(t,o)}function g2(t,r){return en(t,r)}var qc=null,ko=null,vd=!1,Wc=!1,_d=!1,$i=0;function Dr(t){t!==ko&&t.next===null&&(ko===null?qc=ko=t:ko=ko.next=t),Wc=!0,vd||(vd=!0,_2())}function Ya(t,r){if(!_d&&Wc){_d=!0;do for(var o=!1,h=qc;h!==null;){if(t!==0){var w=h.pendingLanes;if(w===0)var R=0;else{var j=h.suspendedLanes,Y=h.pingedLanes;R=(1<<31-Qt(42|t)+1)-1,R&=w&~(j&~Y),R=R&201326741?R&201326741|1:R?R|2:0}R!==0&&(o=!0,a0(h,R))}else R=Ge,R=Yr(h,h===pt?R:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(R&3)===0||Kr(h,R)||(o=!0,a0(h,R));h=h.next}while(o);_d=!1}}function v2(){i0()}function i0(){Wc=vd=!1;var t=0;$i!==0&&T2()&&(t=$i);for(var r=it(),o=null,h=qc;h!==null;){var w=h.next,R=s0(h,r);R===0?(h.next=null,o===null?qc=w:o.next=w,w===null&&(ko=o)):(o=h,(t!==0||(R&3)!==0)&&(Wc=!0)),h=w}Vt!==0&&Vt!==5||Ya(t),$i!==0&&($i=0)}function s0(t,r){for(var o=t.suspendedLanes,h=t.pingedLanes,w=t.expirationTimes,R=t.pendingLanes&-62914561;0<R;){var j=31-Qt(R),Y=1<<j,te=w[j];te===-1?((Y&o)===0||(Y&h)!==0)&&(w[j]=no(Y,r)):te<=r&&(t.expiredLanes|=Y),R&=~Y}if(r=pt,o=Ge,o=Yr(t,t===r?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),h=t.callbackNode,o===0||t===r&&(ct===2||ct===9)||t.cancelPendingCommit!==null)return h!==null&&h!==null&&hn(h),t.callbackNode=null,t.callbackPriority=0;if((o&3)===0||Kr(t,o)){if(r=o&-o,r===t.callbackPriority)return r;switch(h!==null&&hn(h),ye(o)){case 2:case 8:o=an;break;case 32:o=gt;break;case 268435456:o=Xt;break;default:o=gt}return h=o0.bind(null,t),o=en(o,h),t.callbackPriority=r,t.callbackNode=o,r}return h!==null&&h!==null&&hn(h),t.callbackPriority=2,t.callbackNode=null,2}function o0(t,r){if(Vt!==0&&Vt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var o=t.callbackNode;if(Vc()&&t.callbackNode!==o)return null;var h=Ge;return h=Yr(t,t===pt?h:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),h===0?null:(U_(t,h,r),s0(t,it()),t.callbackNode!=null&&t.callbackNode===o?o0.bind(null,t):null)}function a0(t,r){if(Vc())return null;U_(t,r,!0)}function _2(){D2(function(){(at&6)!==0?en(Kt,v2):i0()})}function yd(){if($i===0){var t=_o;t===0&&(t=ar,ar<<=1,(ar&261888)===0&&(ar=256)),$i=t}return $i}function l0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:ec(""+t)}function c0(t,r){var o=r.ownerDocument.createElement("input");return o.name=r.name,o.value=r.value,t.id&&o.setAttribute("form",t.id),r.parentNode.insertBefore(o,r),t=new FormData(t),o.parentNode.removeChild(o),t}function y2(t,r,o,h,w){if(r==="submit"&&o&&o.stateNode===w){var R=l0((w[xe]||null).action),j=h.submitter;j&&(r=(r=j[xe]||null)?l0(r.formAction):j.getAttribute("formAction"),r!==null&&(R=r,j=null));var Y=new ic("action","action",null,h,w);t.push({event:Y,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if($i!==0){var te=j?c0(w,j):new FormData(w);Pf(o,{pending:!0,data:te,method:w.method,action:R},null,te)}}else typeof R=="function"&&(Y.preventDefault(),te=j?c0(w,j):new FormData(w),Pf(o,{pending:!0,data:te,method:w.method,action:R},R,te))},currentTarget:w}]})}}for(var bd=0;bd<tf.length;bd++){var Sd=tf[bd],b2=Sd.toLowerCase(),S2=Sd[0].toUpperCase()+Sd.slice(1);cr(b2,"on"+S2)}cr(Ig,"onAnimationEnd"),cr(Ug,"onAnimationIteration"),cr(Fg,"onAnimationStart"),cr("dblclick","onDoubleClick"),cr("focusin","onFocus"),cr("focusout","onBlur"),cr(HE,"onTransitionRun"),cr(zE,"onTransitionStart"),cr(PE,"onTransitionCancel"),cr($g,"onTransitionEnd"),cn("onMouseEnter",["mouseout","mouseover"]),cn("onMouseLeave",["mouseout","mouseover"]),cn("onPointerEnter",["pointerout","pointerover"]),cn("onPointerLeave",["pointerout","pointerover"]),dn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),dn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),dn("onBeforeInput",["compositionend","keypress","textInput","paste"]),dn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),dn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),dn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ka="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(" "),x2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ka));function u0(t,r){r=(r&4)!==0;for(var o=0;o<t.length;o++){var h=t[o],w=h.event;h=h.listeners;e:{var R=void 0;if(r)for(var j=h.length-1;0<=j;j--){var Y=h[j],te=Y.instance,ue=Y.currentTarget;if(Y=Y.listener,te!==R&&w.isPropagationStopped())break e;R=Y,w.currentTarget=ue;try{R(w)}catch(pe){ac(pe)}w.currentTarget=null,R=te}else for(j=0;j<h.length;j++){if(Y=h[j],te=Y.instance,ue=Y.currentTarget,Y=Y.listener,te!==R&&w.isPropagationStopped())break e;R=Y,w.currentTarget=ue;try{R(w)}catch(pe){ac(pe)}w.currentTarget=null,R=te}}}}function Ke(t,r){var o=r[Oe];o===void 0&&(o=r[Oe]=new Set);var h=t+"__bubble";o.has(h)||(h0(r,t,2,!1),o.add(h))}function xd(t,r,o){var h=0;r&&(h|=4),h0(o,t,h,r)}var Yc="_reactListening"+Math.random().toString(36).slice(2);function wd(t){if(!t[Yc]){t[Yc]=!0,fn.forEach(function(o){o!=="selectionchange"&&(x2.has(o)||xd(o,!1,t),xd(o,!0,t))});var r=t.nodeType===9?t:t.ownerDocument;r===null||r[Yc]||(r[Yc]=!0,xd("selectionchange",!1,r))}}function h0(t,r,o,h){switch(I0(r)){case 2:var w=X2;break;case 8:w=Q2;break;default:w=zd}o=w.bind(null,r,o,t),w=void 0,!Fh||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(w=!0),h?w!==void 0?t.addEventListener(r,o,{capture:!0,passive:w}):t.addEventListener(r,o,!0):w!==void 0?t.addEventListener(r,o,{passive:w}):t.addEventListener(r,o,!1)}function Cd(t,r,o,h,w){var R=h;if((r&1)===0&&(r&2)===0&&h!==null)e:for(;;){if(h===null)return;var j=h.tag;if(j===3||j===4){var Y=h.stateNode.containerInfo;if(Y===w)break;if(j===4)for(j=h.return;j!==null;){var te=j.tag;if((te===3||te===4)&&j.stateNode.containerInfo===w)return;j=j.return}for(;Y!==null;){if(j=Je(Y),j===null)return;if(te=j.tag,te===5||te===6||te===26||te===27){h=R=j;continue e}Y=Y.parentNode}}h=h.return}gg(function(){var ue=R,pe=Ih(o),ve=[];e:{var he=Vg.get(t);if(he!==void 0){var me=ic,Re=t;switch(t){case"keypress":if(nc(o)===0)break e;case"keydown":case"keyup":me=pE;break;case"focusin":Re="focus",me=Wh;break;case"focusout":Re="blur",me=Wh;break;case"beforeblur":case"afterblur":me=Wh;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=yg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=rE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=_E;break;case Ig:case Ug:case Fg:me=oE;break;case $g:me=bE;break;case"scroll":case"scrollend":me=tE;break;case"wheel":me=xE;break;case"copy":case"cut":case"paste":me=lE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Sg;break;case"toggle":case"beforetoggle":me=CE}var ze=(r&4)!==0,dt=!ze&&(t==="scroll"||t==="scrollend"),se=ze?he!==null?he+"Capture":null:he;ze=[];for(var ne=ue,ce;ne!==null;){var ge=ne;if(ce=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||ce===null||se===null||(ge=ga(ne,se),ge!=null&&ze.push(Ga(ne,ge,ce))),dt)break;ne=ne.return}0<ze.length&&(he=new me(he,Re,null,o,pe),ve.push({event:he,listeners:ze}))}}if((r&7)===0){e:{if(he=t==="mouseover"||t==="pointerover",me=t==="mouseout"||t==="pointerout",he&&o!==Ph&&(Re=o.relatedTarget||o.fromElement)&&(Je(Re)||Re[Me]))break e;if((me||he)&&(he=pe.window===pe?pe:(he=pe.ownerDocument)?he.defaultView||he.parentWindow:window,me?(Re=o.relatedTarget||o.toElement,me=ue,Re=Re?Je(Re):null,Re!==null&&(dt=f(Re),ze=Re.tag,Re!==dt||ze!==5&&ze!==27&&ze!==6)&&(Re=null)):(me=null,Re=ue),me!==Re)){if(ze=yg,ge="onMouseLeave",se="onMouseEnter",ne="mouse",(t==="pointerout"||t==="pointerover")&&(ze=Sg,ge="onPointerLeave",se="onPointerEnter",ne="pointer"),dt=me==null?he:ln(me),ce=Re==null?he:ln(Re),he=new ze(ge,ne+"leave",me,o,pe),he.target=dt,he.relatedTarget=ce,ge=null,Je(pe)===ue&&(ze=new ze(se,ne+"enter",Re,o,pe),ze.target=ce,ze.relatedTarget=dt,ge=ze),dt=ge,me&&Re)t:{for(ze=w2,se=me,ne=Re,ce=0,ge=se;ge;ge=ze(ge))ce++;ge=0;for(var je=ne;je;je=ze(je))ge++;for(;0<ce-ge;)se=ze(se),ce--;for(;0<ge-ce;)ne=ze(ne),ge--;for(;ce--;){if(se===ne||ne!==null&&se===ne.alternate){ze=se;break t}se=ze(se),ne=ze(ne)}ze=null}else ze=null;me!==null&&f0(ve,he,me,ze,!1),Re!==null&&dt!==null&&f0(ve,dt,Re,ze,!0)}}e:{if(he=ue?ln(ue):window,me=he.nodeName&&he.nodeName.toLowerCase(),me==="select"||me==="input"&&he.type==="file")var nt=Mg;else if(Ag(he))if(Dg)nt=NE;else{nt=LE;var Le=OE}else me=he.nodeName,!me||me.toLowerCase()!=="input"||he.type!=="checkbox"&&he.type!=="radio"?ue&&zh(ue.elementType)&&(nt=Mg):nt=kE;if(nt&&(nt=nt(t,ue))){Tg(ve,nt,o,pe);break e}Le&&Le(t,he,ue),t==="focusout"&&ue&&he.type==="number"&&ue.memoizedProps.value!=null&&pa(he,"number",he.value)}switch(Le=ue?ln(ue):window,t){case"focusin":(Ag(Le)||Le.contentEditable==="true")&&(co=Le,Zh=ue,Ca=null);break;case"focusout":Ca=Zh=co=null;break;case"mousedown":Jh=!0;break;case"contextmenu":case"mouseup":case"dragend":Jh=!1,zg(ve,o,pe);break;case"selectionchange":if(jE)break;case"keydown":case"keyup":zg(ve,o,pe)}var Fe;if(Kh)e:{switch(t){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else lo?Eg(t,o)&&(Xe="onCompositionEnd"):t==="keydown"&&o.keyCode===229&&(Xe="onCompositionStart");Xe&&(xg&&o.locale!=="ko"&&(lo||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&lo&&(Fe=vg()):(Ai=pe,$h="value"in Ai?Ai.value:Ai.textContent,lo=!0)),Le=Kc(ue,Xe),0<Le.length&&(Xe=new bg(Xe,t,null,o,pe),ve.push({event:Xe,listeners:Le}),Fe?Xe.data=Fe:(Fe=Rg(o),Fe!==null&&(Xe.data=Fe)))),(Fe=RE?AE(t,o):TE(t,o))&&(Xe=Kc(ue,"onBeforeInput"),0<Xe.length&&(Le=new bg("onBeforeInput","beforeinput",null,o,pe),ve.push({event:Le,listeners:Xe}),Le.data=Fe)),y2(ve,t,ue,o,pe)}u0(ve,r)})}function Ga(t,r,o){return{instance:t,listener:r,currentTarget:o}}function Kc(t,r){for(var o=r+"Capture",h=[];t!==null;){var w=t,R=w.stateNode;if(w=w.tag,w!==5&&w!==26&&w!==27||R===null||(w=ga(t,o),w!=null&&h.unshift(Ga(t,w,R)),w=ga(t,r),w!=null&&h.push(Ga(t,w,R))),t.tag===3)return h;t=t.return}return[]}function w2(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function f0(t,r,o,h,w){for(var R=r._reactName,j=[];o!==null&&o!==h;){var Y=o,te=Y.alternate,ue=Y.stateNode;if(Y=Y.tag,te!==null&&te===h)break;Y!==5&&Y!==26&&Y!==27||ue===null||(te=ue,w?(ue=ga(o,R),ue!=null&&j.unshift(Ga(o,ue,te))):w||(ue=ga(o,R),ue!=null&&j.push(Ga(o,ue,te)))),o=o.return}j.length!==0&&t.push({event:r,listeners:j})}var C2=/\r\n?/g,E2=/\u0000|\uFFFD/g;function d0(t){return(typeof t=="string"?t:""+t).replace(C2,`
9
+ `).replace(E2,"")}function m0(t,r){return r=d0(r),d0(t)===r}function ft(t,r,o,h,w,R){switch(o){case"children":typeof h=="string"?r==="body"||r==="textarea"&&h===""||so(t,h):(typeof h=="number"||typeof h=="bigint")&&r!=="body"&&so(t,""+h);break;case"className":Sn(t,"class",h);break;case"tabIndex":Sn(t,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Sn(t,o,h);break;case"style":mg(t,h,R);break;case"data":if(r!=="object"){Sn(t,"data",h);break}case"src":case"href":if(h===""&&(r!=="a"||o!=="href")){t.removeAttribute(o);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){t.removeAttribute(o);break}h=ec(""+h),t.setAttribute(o,h);break;case"action":case"formAction":if(typeof h=="function"){t.setAttribute(o,"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 R=="function"&&(o==="formAction"?(r!=="input"&&ft(t,r,"name",w.name,w,null),ft(t,r,"formEncType",w.formEncType,w,null),ft(t,r,"formMethod",w.formMethod,w,null),ft(t,r,"formTarget",w.formTarget,w,null)):(ft(t,r,"encType",w.encType,w,null),ft(t,r,"method",w.method,w,null),ft(t,r,"target",w.target,w,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){t.removeAttribute(o);break}h=ec(""+h),t.setAttribute(o,h);break;case"onClick":h!=null&&(t.onclick=Qr);break;case"onScroll":h!=null&&Ke("scroll",t);break;case"onScrollEnd":h!=null&&Ke("scrollend",t);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(s(61));if(o=h.__html,o!=null){if(w.children!=null)throw Error(s(60));t.innerHTML=o}}break;case"multiple":t.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":t.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){t.removeAttribute("xlink:href");break}o=ec(""+h),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?t.setAttribute(o,""+h):t.removeAttribute(o);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":h&&typeof h!="function"&&typeof h!="symbol"?t.setAttribute(o,""):t.removeAttribute(o);break;case"capture":case"download":h===!0?t.setAttribute(o,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?t.setAttribute(o,h):t.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?t.setAttribute(o,h):t.removeAttribute(o);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?t.removeAttribute(o):t.setAttribute(o,h);break;case"popover":Ke("beforetoggle",t),Ke("toggle",t),kn(t,"popover",h);break;case"xlinkActuate":tt(t,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":tt(t,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":tt(t,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":tt(t,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":tt(t,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":tt(t,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":tt(t,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":tt(t,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":tt(t,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":kn(t,"is",h);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=JC.get(o)||o,kn(t,o,h))}}function Ed(t,r,o,h,w,R){switch(o){case"style":mg(t,h,R);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(s(61));if(o=h.__html,o!=null){if(w.children!=null)throw Error(s(60));t.innerHTML=o}}break;case"children":typeof h=="string"?so(t,h):(typeof h=="number"||typeof h=="bigint")&&so(t,""+h);break;case"onScroll":h!=null&&Ke("scroll",t);break;case"onScrollEnd":h!=null&&Ke("scrollend",t);break;case"onClick":h!=null&&(t.onclick=Qr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ei.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(w=o.endsWith("Capture"),r=o.slice(2,w?o.length-7:void 0),R=t[xe]||null,R=R!=null?R[o]:null,typeof R=="function"&&t.removeEventListener(r,R,w),typeof h=="function")){typeof R!="function"&&R!==null&&(o in t?t[o]=null:t.hasAttribute(o)&&t.removeAttribute(o)),t.addEventListener(r,h,w);break e}o in t?t[o]=h:h===!0?t.setAttribute(o,""):kn(t,o,h)}}}function sn(t,r,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ke("error",t),Ke("load",t);var h=!1,w=!1,R;for(R in o)if(o.hasOwnProperty(R)){var j=o[R];if(j!=null)switch(R){case"src":h=!0;break;case"srcSet":w=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:ft(t,r,R,j,o,null)}}w&&ft(t,r,"srcSet",o.srcSet,o,null),h&&ft(t,r,"src",o.src,o,null);return;case"input":Ke("invalid",t);var Y=R=j=w=null,te=null,ue=null;for(h in o)if(o.hasOwnProperty(h)){var pe=o[h];if(pe!=null)switch(h){case"name":w=pe;break;case"type":j=pe;break;case"checked":te=pe;break;case"defaultChecked":ue=pe;break;case"value":R=pe;break;case"defaultValue":Y=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(s(137,r));break;default:ft(t,r,h,pe,o,null)}}Jl(t,R,Y,te,ue,j,w,!1);return;case"select":Ke("invalid",t),h=j=R=null;for(w in o)if(o.hasOwnProperty(w)&&(Y=o[w],Y!=null))switch(w){case"value":R=Y;break;case"defaultValue":j=Y;break;case"multiple":h=Y;default:ft(t,r,w,Y,o,null)}r=R,o=j,t.multiple=!!h,r!=null?Xr(t,!!h,r,!1):o!=null&&Xr(t,!!h,o,!0);return;case"textarea":Ke("invalid",t),R=w=h=null;for(j in o)if(o.hasOwnProperty(j)&&(Y=o[j],Y!=null))switch(j){case"value":h=Y;break;case"defaultValue":w=Y;break;case"children":R=Y;break;case"dangerouslySetInnerHTML":if(Y!=null)throw Error(s(91));break;default:ft(t,r,j,Y,o,null)}fg(t,h,w,R);return;case"option":for(te in o)if(o.hasOwnProperty(te)&&(h=o[te],h!=null))switch(te){case"selected":t.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:ft(t,r,te,h,o,null)}return;case"dialog":Ke("beforetoggle",t),Ke("toggle",t),Ke("cancel",t),Ke("close",t);break;case"iframe":case"object":Ke("load",t);break;case"video":case"audio":for(h=0;h<Ka.length;h++)Ke(Ka[h],t);break;case"image":Ke("error",t),Ke("load",t);break;case"details":Ke("toggle",t);break;case"embed":case"source":case"link":Ke("error",t),Ke("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ue in o)if(o.hasOwnProperty(ue)&&(h=o[ue],h!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:ft(t,r,ue,h,o,null)}return;default:if(zh(r)){for(pe in o)o.hasOwnProperty(pe)&&(h=o[pe],h!==void 0&&Ed(t,r,pe,h,o,void 0));return}}for(Y in o)o.hasOwnProperty(Y)&&(h=o[Y],h!=null&&ft(t,r,Y,h,o,null))}function R2(t,r,o,h){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var w=null,R=null,j=null,Y=null,te=null,ue=null,pe=null;for(me in o){var ve=o[me];if(o.hasOwnProperty(me)&&ve!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":te=ve;default:h.hasOwnProperty(me)||ft(t,r,me,null,h,ve)}}for(var he in h){var me=h[he];if(ve=o[he],h.hasOwnProperty(he)&&(me!=null||ve!=null))switch(he){case"type":R=me;break;case"name":w=me;break;case"checked":ue=me;break;case"defaultChecked":pe=me;break;case"value":j=me;break;case"defaultValue":Y=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(s(137,r));break;default:me!==ve&&ft(t,r,he,me,h,ve)}}ps(t,j,Y,te,ue,pe,R,w);return;case"select":me=j=Y=he=null;for(R in o)if(te=o[R],o.hasOwnProperty(R)&&te!=null)switch(R){case"value":break;case"multiple":me=te;default:h.hasOwnProperty(R)||ft(t,r,R,null,h,te)}for(w in h)if(R=h[w],te=o[w],h.hasOwnProperty(w)&&(R!=null||te!=null))switch(w){case"value":he=R;break;case"defaultValue":Y=R;break;case"multiple":j=R;default:R!==te&&ft(t,r,w,R,h,te)}r=Y,o=j,h=me,he!=null?Xr(t,!!o,he,!1):!!h!=!!o&&(r!=null?Xr(t,!!o,r,!0):Xr(t,!!o,o?[]:"",!1));return;case"textarea":me=he=null;for(Y in o)if(w=o[Y],o.hasOwnProperty(Y)&&w!=null&&!h.hasOwnProperty(Y))switch(Y){case"value":break;case"children":break;default:ft(t,r,Y,null,h,w)}for(j in h)if(w=h[j],R=o[j],h.hasOwnProperty(j)&&(w!=null||R!=null))switch(j){case"value":he=w;break;case"defaultValue":me=w;break;case"children":break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(s(91));break;default:w!==R&&ft(t,r,j,w,h,R)}hg(t,he,me);return;case"option":for(var Re in o)if(he=o[Re],o.hasOwnProperty(Re)&&he!=null&&!h.hasOwnProperty(Re))switch(Re){case"selected":t.selected=!1;break;default:ft(t,r,Re,null,h,he)}for(te in h)if(he=h[te],me=o[te],h.hasOwnProperty(te)&&he!==me&&(he!=null||me!=null))switch(te){case"selected":t.selected=he&&typeof he!="function"&&typeof he!="symbol";break;default:ft(t,r,te,he,h,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 ze in o)he=o[ze],o.hasOwnProperty(ze)&&he!=null&&!h.hasOwnProperty(ze)&&ft(t,r,ze,null,h,he);for(ue in h)if(he=h[ue],me=o[ue],h.hasOwnProperty(ue)&&he!==me&&(he!=null||me!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(s(137,r));break;default:ft(t,r,ue,he,h,me)}return;default:if(zh(r)){for(var dt in o)he=o[dt],o.hasOwnProperty(dt)&&he!==void 0&&!h.hasOwnProperty(dt)&&Ed(t,r,dt,void 0,h,he);for(pe in h)he=h[pe],me=o[pe],!h.hasOwnProperty(pe)||he===me||he===void 0&&me===void 0||Ed(t,r,pe,he,h,me);return}}for(var se in o)he=o[se],o.hasOwnProperty(se)&&he!=null&&!h.hasOwnProperty(se)&&ft(t,r,se,null,h,he);for(ve in h)he=h[ve],me=o[ve],!h.hasOwnProperty(ve)||he===me||he==null&&me==null||ft(t,r,ve,he,h,me)}function p0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function A2(){if(typeof performance.getEntriesByType=="function"){for(var t=0,r=0,o=performance.getEntriesByType("resource"),h=0;h<o.length;h++){var w=o[h],R=w.transferSize,j=w.initiatorType,Y=w.duration;if(R&&Y&&p0(j)){for(j=0,Y=w.responseEnd,h+=1;h<o.length;h++){var te=o[h],ue=te.startTime;if(ue>Y)break;var pe=te.transferSize,ve=te.initiatorType;pe&&p0(ve)&&(te=te.responseEnd,j+=pe*(te<Y?1:(Y-ue)/(te-ue)))}if(--h,r+=8*(R+j)/(w.duration/1e3),t++,10<t)break}}if(0<t)return r/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Rd=null,Ad=null;function Gc(t){return t.nodeType===9?t:t.ownerDocument}function g0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function v0(t,r){if(t===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&r==="foreignObject"?0:t}function Td(t,r){return t==="textarea"||t==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Md=null;function T2(){var t=window.event;return t&&t.type==="popstate"?t===Md?!1:(Md=t,!0):(Md=null,!1)}var _0=typeof setTimeout=="function"?setTimeout:void 0,M2=typeof clearTimeout=="function"?clearTimeout:void 0,y0=typeof Promise=="function"?Promise:void 0,D2=typeof queueMicrotask=="function"?queueMicrotask:typeof y0<"u"?function(t){return y0.resolve(null).then(t).catch(O2)}:_0;function O2(t){setTimeout(function(){throw t})}function Vi(t){return t==="head"}function b0(t,r){var o=r,h=0;do{var w=o.nextSibling;if(t.removeChild(o),w&&w.nodeType===8)if(o=w.data,o==="/$"||o==="/&"){if(h===0){t.removeChild(w),Ho(r);return}h--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")h++;else if(o==="html")Xa(t.ownerDocument.documentElement);else if(o==="head"){o=t.ownerDocument.head,Xa(o);for(var R=o.firstChild;R;){var j=R.nextSibling,Y=R.nodeName;R[mt]||Y==="SCRIPT"||Y==="STYLE"||Y==="LINK"&&R.rel.toLowerCase()==="stylesheet"||o.removeChild(R),R=j}}else o==="body"&&Xa(t.ownerDocument.body);o=w}while(o);Ho(r)}function S0(t,r){var o=t;t=0;do{var h=o.nextSibling;if(o.nodeType===1?r?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(r?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),h&&h.nodeType===8)if(o=h.data,o==="/$"){if(t===0)break;t--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||t++;o=h}while(o)}function Dd(t){var r=t.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var o=r;switch(r=r.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Dd(o),St(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}t.removeChild(o)}}function L2(t,r,o,h){for(;t.nodeType===1;){var w=o;if(t.nodeName.toLowerCase()!==r.toLowerCase()){if(!h&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(h){if(!t[mt])switch(r){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(R=t.getAttribute("rel"),R==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(R!==w.rel||t.getAttribute("href")!==(w.href==null||w.href===""?null:w.href)||t.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin)||t.getAttribute("title")!==(w.title==null?null:w.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(R=t.getAttribute("src"),(R!==(w.src==null?null:w.src)||t.getAttribute("type")!==(w.type==null?null:w.type)||t.getAttribute("crossorigin")!==(w.crossOrigin==null?null:w.crossOrigin))&&R&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(r==="input"&&t.type==="hidden"){var R=w.name==null?null:""+w.name;if(w.type==="hidden"&&t.getAttribute("name")===R)return t}else return t;if(t=Zn(t.nextSibling),t===null)break}return null}function k2(t,r,o){if(r==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!o||(t=Zn(t.nextSibling),t===null))return null;return t}function x0(t,r){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!r||(t=Zn(t.nextSibling),t===null))return null;return t}function Od(t){return t.data==="$?"||t.data==="$~"}function Ld(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function N2(t,r){var o=t.ownerDocument;if(t.data==="$~")t._reactRetry=r;else if(t.data!=="$?"||o.readyState!=="loading")r();else{var h=function(){r(),o.removeEventListener("DOMContentLoaded",h)};o.addEventListener("DOMContentLoaded",h),t._reactRetry=h}}function Zn(t){for(;t!=null;t=t.nextSibling){var r=t.nodeType;if(r===1||r===3)break;if(r===8){if(r=t.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return t}var kd=null;function w0(t){t=t.nextSibling;for(var r=0;t;){if(t.nodeType===8){var o=t.data;if(o==="/$"||o==="/&"){if(r===0)return Zn(t.nextSibling);r--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||r++}t=t.nextSibling}return null}function C0(t){t=t.previousSibling;for(var r=0;t;){if(t.nodeType===8){var o=t.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(r===0)return t;r--}else o!=="/$"&&o!=="/&"||r++}t=t.previousSibling}return null}function E0(t,r,o){switch(r=Gc(o),t){case"html":if(t=r.documentElement,!t)throw Error(s(452));return t;case"head":if(t=r.head,!t)throw Error(s(453));return t;case"body":if(t=r.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function Xa(t){for(var r=t.attributes;r.length;)t.removeAttributeNode(r[0]);St(t)}var Jn=new Map,R0=new Set;function Xc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var di=K.d;K.d={f:B2,r:j2,D:H2,C:z2,L:P2,m:I2,X:F2,S:U2,M:$2};function B2(){var t=di.f(),r=Uc();return t||r}function j2(t){var r=et(t);r!==null&&r.tag===5&&r.type==="form"?$v(r):di.r(t)}var No=typeof document>"u"?null:document;function A0(t,r,o){var h=No;if(h&&typeof r=="string"&&r){var w=xn(r);w='link[rel="'+t+'"][href="'+w+'"]',typeof o=="string"&&(w+='[crossorigin="'+o+'"]'),R0.has(w)||(R0.add(w),t={rel:t,crossOrigin:o,href:r},h.querySelector(w)===null&&(r=h.createElement("link"),sn(r,"link",t),lt(r),h.head.appendChild(r)))}}function H2(t){di.D(t),A0("dns-prefetch",t,null)}function z2(t,r){di.C(t,r),A0("preconnect",t,r)}function P2(t,r,o){di.L(t,r,o);var h=No;if(h&&t&&r){var w='link[rel="preload"][as="'+xn(r)+'"]';r==="image"&&o&&o.imageSrcSet?(w+='[imagesrcset="'+xn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(w+='[imagesizes="'+xn(o.imageSizes)+'"]')):w+='[href="'+xn(t)+'"]';var R=w;switch(r){case"style":R=Bo(t);break;case"script":R=jo(t)}Jn.has(R)||(t=m({rel:"preload",href:r==="image"&&o&&o.imageSrcSet?void 0:t,as:r},o),Jn.set(R,t),h.querySelector(w)!==null||r==="style"&&h.querySelector(Qa(R))||r==="script"&&h.querySelector(Za(R))||(r=h.createElement("link"),sn(r,"link",t),lt(r),h.head.appendChild(r)))}}function I2(t,r){di.m(t,r);var o=No;if(o&&t){var h=r&&typeof r.as=="string"?r.as:"script",w='link[rel="modulepreload"][as="'+xn(h)+'"][href="'+xn(t)+'"]',R=w;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":R=jo(t)}if(!Jn.has(R)&&(t=m({rel:"modulepreload",href:t},r),Jn.set(R,t),o.querySelector(w)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Za(R)))return}h=o.createElement("link"),sn(h,"link",t),lt(h),o.head.appendChild(h)}}}function U2(t,r,o){di.S(t,r,o);var h=No;if(h&&t){var w=bn(h).hoistableStyles,R=Bo(t);r=r||"default";var j=w.get(R);if(!j){var Y={loading:0,preload:null};if(j=h.querySelector(Qa(R)))Y.loading=5;else{t=m({rel:"stylesheet",href:t,"data-precedence":r},o),(o=Jn.get(R))&&Nd(t,o);var te=j=h.createElement("link");lt(te),sn(te,"link",t),te._p=new Promise(function(ue,pe){te.onload=ue,te.onerror=pe}),te.addEventListener("load",function(){Y.loading|=1}),te.addEventListener("error",function(){Y.loading|=2}),Y.loading|=4,Qc(j,r,h)}j={type:"stylesheet",instance:j,count:1,state:Y},w.set(R,j)}}}function F2(t,r){di.X(t,r);var o=No;if(o&&t){var h=bn(o).hoistableScripts,w=jo(t),R=h.get(w);R||(R=o.querySelector(Za(w)),R||(t=m({src:t,async:!0},r),(r=Jn.get(w))&&Bd(t,r),R=o.createElement("script"),lt(R),sn(R,"link",t),o.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},h.set(w,R))}}function $2(t,r){di.M(t,r);var o=No;if(o&&t){var h=bn(o).hoistableScripts,w=jo(t),R=h.get(w);R||(R=o.querySelector(Za(w)),R||(t=m({src:t,async:!0,type:"module"},r),(r=Jn.get(w))&&Bd(t,r),R=o.createElement("script"),lt(R),sn(R,"link",t),o.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},h.set(w,R))}}function T0(t,r,o,h){var w=(w=Z.current)?Xc(w):null;if(!w)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(r=Bo(o.href),o=bn(w).hoistableStyles,h=o.get(r),h||(h={type:"style",instance:null,count:0,state:null},o.set(r,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){t=Bo(o.href);var R=bn(w).hoistableStyles,j=R.get(t);if(j||(w=w.ownerDocument||w,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},R.set(t,j),(R=w.querySelector(Qa(t)))&&!R._p&&(j.instance=R,j.state.loading=5),Jn.has(t)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Jn.set(t,o),R||V2(w,t,o,j.state))),r&&h===null)throw Error(s(528,""));return j}if(r&&h!==null)throw Error(s(529,""));return null;case"script":return r=o.async,o=o.src,typeof o=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=jo(o),o=bn(w).hoistableScripts,h=o.get(r),h||(h={type:"script",instance:null,count:0,state:null},o.set(r,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function Bo(t){return'href="'+xn(t)+'"'}function Qa(t){return'link[rel="stylesheet"]['+t+"]"}function M0(t){return m({},t,{"data-precedence":t.precedence,precedence:null})}function V2(t,r,o,h){t.querySelector('link[rel="preload"][as="style"]['+r+"]")?h.loading=1:(r=t.createElement("link"),h.preload=r,r.addEventListener("load",function(){return h.loading|=1}),r.addEventListener("error",function(){return h.loading|=2}),sn(r,"link",o),lt(r),t.head.appendChild(r))}function jo(t){return'[src="'+xn(t)+'"]'}function Za(t){return"script[async]"+t}function D0(t,r,o){if(r.count++,r.instance===null)switch(r.type){case"style":var h=t.querySelector('style[data-href~="'+xn(o.href)+'"]');if(h)return r.instance=h,lt(h),h;var w=m({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return h=(t.ownerDocument||t).createElement("style"),lt(h),sn(h,"style",w),Qc(h,o.precedence,t),r.instance=h;case"stylesheet":w=Bo(o.href);var R=t.querySelector(Qa(w));if(R)return r.state.loading|=4,r.instance=R,lt(R),R;h=M0(o),(w=Jn.get(w))&&Nd(h,w),R=(t.ownerDocument||t).createElement("link"),lt(R);var j=R;return j._p=new Promise(function(Y,te){j.onload=Y,j.onerror=te}),sn(R,"link",h),r.state.loading|=4,Qc(R,o.precedence,t),r.instance=R;case"script":return R=jo(o.src),(w=t.querySelector(Za(R)))?(r.instance=w,lt(w),w):(h=o,(w=Jn.get(R))&&(h=m({},o),Bd(h,w)),t=t.ownerDocument||t,w=t.createElement("script"),lt(w),sn(w,"link",h),t.head.appendChild(w),r.instance=w);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(h=r.instance,r.state.loading|=4,Qc(h,o.precedence,t));return r.instance}function Qc(t,r,o){for(var h=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),w=h.length?h[h.length-1]:null,R=w,j=0;j<h.length;j++){var Y=h[j];if(Y.dataset.precedence===r)R=Y;else if(R!==w)break}R?R.parentNode.insertBefore(t,R.nextSibling):(r=o.nodeType===9?o.head:o,r.insertBefore(t,r.firstChild))}function Nd(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.title==null&&(t.title=r.title)}function Bd(t,r){t.crossOrigin==null&&(t.crossOrigin=r.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=r.referrerPolicy),t.integrity==null&&(t.integrity=r.integrity)}var Zc=null;function O0(t,r,o){if(Zc===null){var h=new Map,w=Zc=new Map;w.set(o,h)}else w=Zc,h=w.get(o),h||(h=new Map,w.set(o,h));if(h.has(t))return h;for(h.set(t,null),o=o.getElementsByTagName(t),w=0;w<o.length;w++){var R=o[w];if(!(R[mt]||R[Se]||t==="link"&&R.getAttribute("rel")==="stylesheet")&&R.namespaceURI!=="http://www.w3.org/2000/svg"){var j=R.getAttribute(r)||"";j=t+j;var Y=h.get(j);Y?Y.push(R):h.set(j,[R])}}return h}function L0(t,r,o){t=t.ownerDocument||t,t.head.insertBefore(o,r==="title"?t.querySelector("head > title"):null)}function q2(t,r,o){if(o===1||r.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return t=r.disabled,typeof r.precedence=="string"&&t==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function k0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function W2(t,r,o,h){if(o.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var w=Bo(h.href),R=r.querySelector(Qa(w));if(R){r=R._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(t.count++,t=Jc.bind(t),r.then(t,t)),o.state.loading|=4,o.instance=R,lt(R);return}R=r.ownerDocument||r,h=M0(h),(w=Jn.get(w))&&Nd(h,w),R=R.createElement("link"),lt(R);var j=R;j._p=new Promise(function(Y,te){j.onload=Y,j.onerror=te}),sn(R,"link",h),o.instance=R}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(o,r),(r=o.state.preload)&&(o.state.loading&3)===0&&(t.count++,o=Jc.bind(t),r.addEventListener("load",o),r.addEventListener("error",o))}}var jd=0;function Y2(t,r){return t.stylesheets&&t.count===0&&tu(t,t.stylesheets),0<t.count||0<t.imgCount?function(o){var h=setTimeout(function(){if(t.stylesheets&&tu(t,t.stylesheets),t.unsuspend){var R=t.unsuspend;t.unsuspend=null,R()}},6e4+r);0<t.imgBytes&&jd===0&&(jd=62500*A2());var w=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&tu(t,t.stylesheets),t.unsuspend)){var R=t.unsuspend;t.unsuspend=null,R()}},(t.imgBytes>jd?50:800)+r);return t.unsuspend=o,function(){t.unsuspend=null,clearTimeout(h),clearTimeout(w)}}:null}function Jc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)tu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var eu=null;function tu(t,r){t.stylesheets=null,t.unsuspend!==null&&(t.count++,eu=new Map,r.forEach(K2,t),eu=null,Jc.call(t))}function K2(t,r){if(!(r.state.loading&4)){var o=eu.get(t);if(o)var h=o.get(null);else{o=new Map,eu.set(t,o);for(var w=t.querySelectorAll("link[data-precedence],style[data-precedence]"),R=0;R<w.length;R++){var j=w[R];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(o.set(j.dataset.precedence,j),h=j)}h&&o.set(null,h)}w=r.instance,j=w.getAttribute("data-precedence"),R=o.get(j)||h,R===h&&o.set(null,w),o.set(j,w),this.count++,h=Jc.bind(this),w.addEventListener("load",h),w.addEventListener("error",h),R?R.parentNode.insertBefore(w,R.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(w,t.firstChild)),r.state.loading|=4}}var Ja={$$typeof:y,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function G2(t,r,o,h,w,R,j,Y,te){this.tag=1,this.containerInfo=t,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=Cr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Cr(0),this.hiddenUpdates=Cr(null),this.identifierPrefix=h,this.onUncaughtError=w,this.onCaughtError=R,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=te,this.incompleteTransitions=new Map}function N0(t,r,o,h,w,R,j,Y,te,ue,pe,ve){return t=new G2(t,r,o,j,te,ue,pe,ve,Y),r=1,R===!0&&(r|=24),R=Bn(3,null,null,r),t.current=R,R.stateNode=t,r=pf(),r.refCount++,t.pooledCache=r,r.refCount++,R.memoizedState={element:h,isDehydrated:o,cache:r},yf(R),t}function B0(t){return t?(t=fo,t):fo}function j0(t,r,o,h,w,R){w=B0(w),h.context===null?h.context=w:h.pendingContext=w,h=ki(r),h.payload={element:o},R=R===void 0?null:R,R!==null&&(h.callback=R),o=Ni(t,h,r),o!==null&&(Tn(o,t,r),Oa(o,t,r))}function H0(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var o=t.retryLane;t.retryLane=o!==0&&o<r?o:r}}function Hd(t,r){H0(t,r),(t=t.alternate)&&H0(t,r)}function z0(t){if(t.tag===13||t.tag===31){var r=ys(t,67108864);r!==null&&Tn(r,t,67108864),Hd(t,67108864)}}function P0(t){if(t.tag===13||t.tag===31){var r=In();r=fe(r);var o=ys(t,r);o!==null&&Tn(o,t,r),Hd(t,r)}}var nu=!0;function X2(t,r,o,h){var w=H.T;H.T=null;var R=K.p;try{K.p=2,zd(t,r,o,h)}finally{K.p=R,H.T=w}}function Q2(t,r,o,h){var w=H.T;H.T=null;var R=K.p;try{K.p=8,zd(t,r,o,h)}finally{K.p=R,H.T=w}}function zd(t,r,o,h){if(nu){var w=Pd(h);if(w===null)Cd(t,r,h,ru,o),U0(t,h);else if(J2(w,t,r,o,h))h.stopPropagation();else if(U0(t,h),r&4&&-1<Z2.indexOf(t)){for(;w!==null;){var R=et(w);if(R!==null)switch(R.tag){case 3:if(R=R.stateNode,R.current.memoizedState.isDehydrated){var j=lr(R.pendingLanes);if(j!==0){var Y=R;for(Y.pendingLanes|=2,Y.entangledLanes|=2;j;){var te=1<<31-Qt(j);Y.entanglements[1]|=te,j&=~te}Dr(R),(at&6)===0&&(Pc=it()+500,Ya(0))}}break;case 31:case 13:Y=ys(R,2),Y!==null&&Tn(Y,R,2),Uc(),Hd(R,2)}if(R=Pd(h),R===null&&Cd(t,r,h,ru,o),R===w)break;w=R}w!==null&&h.stopPropagation()}else Cd(t,r,h,null,o)}}function Pd(t){return t=Ih(t),Id(t)}var ru=null;function Id(t){if(ru=null,t=Je(t),t!==null){var r=f(t);if(r===null)t=null;else{var o=r.tag;if(o===13){if(t=d(r),t!==null)return t;t=null}else if(o===31){if(t=l(r),t!==null)return t;t=null}else if(o===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;t=null}else r!==t&&(t=null)}}return ru=t,null}function I0(t){switch(t){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(Et()){case Kt:return 2;case an:return 8;case gt:case Gt:return 32;case Xt:return 268435456;default:return 32}default:return 32}}var Ud=!1,qi=null,Wi=null,Yi=null,el=new Map,tl=new Map,Ki=[],Z2="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 U0(t,r){switch(t){case"focusin":case"focusout":qi=null;break;case"dragenter":case"dragleave":Wi=null;break;case"mouseover":case"mouseout":Yi=null;break;case"pointerover":case"pointerout":el.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":tl.delete(r.pointerId)}}function nl(t,r,o,h,w,R){return t===null||t.nativeEvent!==R?(t={blockedOn:r,domEventName:o,eventSystemFlags:h,nativeEvent:R,targetContainers:[w]},r!==null&&(r=et(r),r!==null&&z0(r)),t):(t.eventSystemFlags|=h,r=t.targetContainers,w!==null&&r.indexOf(w)===-1&&r.push(w),t)}function J2(t,r,o,h,w){switch(r){case"focusin":return qi=nl(qi,t,r,o,h,w),!0;case"dragenter":return Wi=nl(Wi,t,r,o,h,w),!0;case"mouseover":return Yi=nl(Yi,t,r,o,h,w),!0;case"pointerover":var R=w.pointerId;return el.set(R,nl(el.get(R)||null,t,r,o,h,w)),!0;case"gotpointercapture":return R=w.pointerId,tl.set(R,nl(tl.get(R)||null,t,r,o,h,w)),!0}return!1}function F0(t){var r=Je(t.target);if(r!==null){var o=f(r);if(o!==null){if(r=o.tag,r===13){if(r=d(o),r!==null){t.blockedOn=r,De(t.priority,function(){P0(o)});return}}else if(r===31){if(r=l(o),r!==null){t.blockedOn=r,De(t.priority,function(){P0(o)});return}}else if(r===3&&o.stateNode.current.memoizedState.isDehydrated){t.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}t.blockedOn=null}function iu(t){if(t.blockedOn!==null)return!1;for(var r=t.targetContainers;0<r.length;){var o=Pd(t.nativeEvent);if(o===null){o=t.nativeEvent;var h=new o.constructor(o.type,o);Ph=h,o.target.dispatchEvent(h),Ph=null}else return r=et(o),r!==null&&z0(r),t.blockedOn=o,!1;r.shift()}return!0}function $0(t,r,o){iu(t)&&o.delete(r)}function eR(){Ud=!1,qi!==null&&iu(qi)&&(qi=null),Wi!==null&&iu(Wi)&&(Wi=null),Yi!==null&&iu(Yi)&&(Yi=null),el.forEach($0),tl.forEach($0)}function su(t,r){t.blockedOn===r&&(t.blockedOn=null,Ud||(Ud=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,eR)))}var ou=null;function V0(t){ou!==t&&(ou=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ou===t&&(ou=null);for(var r=0;r<t.length;r+=3){var o=t[r],h=t[r+1],w=t[r+2];if(typeof h!="function"){if(Id(h||o)===null)continue;break}var R=et(o);R!==null&&(t.splice(r,3),r-=3,Pf(R,{pending:!0,data:w,method:o.method,action:h},h,w))}}))}function Ho(t){function r(te){return su(te,t)}qi!==null&&su(qi,t),Wi!==null&&su(Wi,t),Yi!==null&&su(Yi,t),el.forEach(r),tl.forEach(r);for(var o=0;o<Ki.length;o++){var h=Ki[o];h.blockedOn===t&&(h.blockedOn=null)}for(;0<Ki.length&&(o=Ki[0],o.blockedOn===null);)F0(o),o.blockedOn===null&&Ki.shift();if(o=(t.ownerDocument||t).$$reactFormReplay,o!=null)for(h=0;h<o.length;h+=3){var w=o[h],R=o[h+1],j=w[xe]||null;if(typeof R=="function")j||V0(o);else if(j){var Y=null;if(R&&R.hasAttribute("formAction")){if(w=R,j=R[xe]||null)Y=j.formAction;else if(Id(w)!==null)continue}else Y=j.action;typeof Y=="function"?o[h+1]=Y:(o.splice(h,3),h-=3),V0(o)}}}function q0(){function t(R){R.canIntercept&&R.info==="react-transition"&&R.intercept({handler:function(){return new Promise(function(j){return w=j})},focusReset:"manual",scroll:"manual"})}function r(){w!==null&&(w(),w=null),h||setTimeout(o,20)}function o(){if(!h&&!navigation.transition){var R=navigation.currentEntry;R&&R.url!=null&&navigation.navigate(R.url,{state:R.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,w=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(o,100),function(){h=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),w!==null&&(w(),w=null)}}}function Fd(t){this._internalRoot=t}au.prototype.render=Fd.prototype.render=function(t){var r=this._internalRoot;if(r===null)throw Error(s(409));var o=r.current,h=In();j0(o,h,t,r,null,null)},au.prototype.unmount=Fd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var r=t.containerInfo;j0(t.current,2,null,t,null,null),Uc(),r[Me]=null}};function au(t){this._internalRoot=t}au.prototype.unstable_scheduleHydration=function(t){if(t){var r=be();t={blockedOn:null,target:t,priority:r};for(var o=0;o<Ki.length&&r!==0&&r<Ki[o].priority;o++);Ki.splice(o,0,t),o===0&&F0(t)}};var W0=n.version;if(W0!=="19.2.3")throw Error(s(527,W0,"19.2.3"));K.findDOMNode=function(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=c(r),t=t!==null?v(t):null,t=t===null?null:t.stateNode,t};var tR={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lu.isDisabled&&lu.supportsFiber)try{or=lu.inject(tR),_t=lu}catch{}}return il.createRoot=function(t,r){if(!a(t))throw Error(s(299));var o=!1,h="",w=Jv,R=e_,j=t_;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(h=r.identifierPrefix),r.onUncaughtError!==void 0&&(w=r.onUncaughtError),r.onCaughtError!==void 0&&(R=r.onCaughtError),r.onRecoverableError!==void 0&&(j=r.onRecoverableError)),r=N0(t,1,!1,null,null,o,h,null,w,R,j,q0),t[Me]=r.current,wd(t),new Fd(r)},il.hydrateRoot=function(t,r,o){if(!a(t))throw Error(s(299));var h=!1,w="",R=Jv,j=e_,Y=t_,te=null;return o!=null&&(o.unstable_strictMode===!0&&(h=!0),o.identifierPrefix!==void 0&&(w=o.identifierPrefix),o.onUncaughtError!==void 0&&(R=o.onUncaughtError),o.onCaughtError!==void 0&&(j=o.onCaughtError),o.onRecoverableError!==void 0&&(Y=o.onRecoverableError),o.formState!==void 0&&(te=o.formState)),r=N0(t,1,!0,r,o??null,h,w,te,R,j,Y,q0),r.context=B0(null),o=r.current,h=In(),h=fe(h),w=ki(h),w.callback=null,Ni(o,w,h),o=h,r.current.lanes=o,Er(r,o),Dr(r),t[Me]=r.current,wd(t),new au(r)},il.version="19.2.3",il}var ny;function hR(){if(ny)return qd.exports;ny=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(n){console.error(n)}}return e(),qd.exports=uR(),qd.exports}var fR=hR();const dR=fh(fR);var oa=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},mR={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},pR=class{#e=mR;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,n){return this.#e.setTimeout(e,n)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,n){return this.#e.setInterval(e,n)}clearInterval(e){this.#e.clearInterval(e)}},Ns=new pR;function gR(e){setTimeout(e,0)}var Is=typeof window>"u"||"Deno"in globalThis;function pn(){}function vR(e,n){return typeof e=="function"?e(n):e}function Am(e){return typeof e=="number"&&e>=0&&e!==1/0}function US(e,n){return Math.max(e+(n||0)-Date.now(),0)}function os(e,n){return typeof e=="function"?e(n):e}function tr(e,n){return typeof e=="function"?e(n):e}function ry(e,n){const{type:i="all",exact:s,fetchStatus:a,predicate:f,queryKey:d,stale:l}=e;if(d){if(s){if(n.queryHash!==up(d,n.options))return!1}else if(!yl(n.queryKey,d))return!1}if(i!=="all"){const u=n.isActive();if(i==="active"&&!u||i==="inactive"&&u)return!1}return!(typeof l=="boolean"&&n.isStale()!==l||a&&a!==n.state.fetchStatus||f&&!f(n))}function iy(e,n){const{exact:i,status:s,predicate:a,mutationKey:f}=e;if(f){if(!n.options.mutationKey)return!1;if(i){if(Us(n.options.mutationKey)!==Us(f))return!1}else if(!yl(n.options.mutationKey,f))return!1}return!(s&&n.state.status!==s||a&&!a(n))}function up(e,n){return(n?.queryKeyHashFn||Us)(e)}function Us(e){return JSON.stringify(e,(n,i)=>Tm(i)?Object.keys(i).sort().reduce((s,a)=>(s[a]=i[a],s),{}):i)}function yl(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(i=>yl(e[i],n[i])):!1}var _R=Object.prototype.hasOwnProperty;function FS(e,n){if(e===n)return e;const i=sy(e)&&sy(n);if(!i&&!(Tm(e)&&Tm(n)))return n;const a=(i?e:Object.keys(e)).length,f=i?n:Object.keys(n),d=f.length,l=i?new Array(d):{};let u=0;for(let c=0;c<d;c++){const v=i?c:f[c],m=e[v],_=n[v];if(m===_){l[v]=m,(i?c<a:_R.call(e,v))&&u++;continue}if(m===null||_===null||typeof m!="object"||typeof _!="object"){l[v]=_;continue}const x=FS(m,_);l[v]=x,x===m&&u++}return a===d&&u===a?e:l}function $u(e,n){if(!n||Object.keys(e).length!==Object.keys(n).length)return!1;for(const i in e)if(e[i]!==n[i])return!1;return!0}function sy(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Tm(e){if(!oy(e))return!1;const n=e.constructor;if(n===void 0)return!0;const i=n.prototype;return!(!oy(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function oy(e){return Object.prototype.toString.call(e)==="[object Object]"}function yR(e){return new Promise(n=>{Ns.setTimeout(n,e)})}function Mm(e,n,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,n):i.structuralSharing!==!1?FS(e,n):n}function bR(e,n,i=0){const s=[...e,n];return i&&s.length>i?s.slice(1):s}function SR(e,n,i=0){const s=[n,...e];return i&&s.length>i?s.slice(0,-1):s}var hp=Symbol();function $S(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===hp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function VS(e,n){return typeof e=="function"?e(...n):!!e}var xR=class extends oa{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Is&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},fp=new xR;function Dm(){let e,n;const i=new Promise((a,f)=>{e=a,n=f});i.status="pending",i.catch(()=>{});function s(a){Object.assign(i,a),delete i.resolve,delete i.reject}return i.resolve=a=>{s({status:"fulfilled",value:a}),e(a)},i.reject=a=>{s({status:"rejected",reason:a}),n(a)},i}var wR=gR;function CR(){let e=[],n=0,i=l=>{l()},s=l=>{l()},a=wR;const f=l=>{n?e.push(l):a(()=>{i(l)})},d=()=>{const l=e;e=[],l.length&&a(()=>{s(()=>{l.forEach(u=>{i(u)})})})};return{batch:l=>{let u;n++;try{u=l()}finally{n--,n||d()}return u},batchCalls:l=>(...u)=>{f(()=>{l(...u)})},schedule:f,setNotifyFunction:l=>{i=l},setBatchNotifyFunction:l=>{s=l},setScheduler:l=>{a=l}}}var Wt=CR(),ER=class extends oa{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Is&&window.addEventListener){const n=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(i=>{i(e)}))}isOnline(){return this.#e}},Vu=new ER;function RR(e){return Math.min(1e3*2**e,3e4)}function qS(e){return(e??"online")==="online"?Vu.isOnline():!0}var Om=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function WS(e){let n=!1,i=0,s;const a=Dm(),f=()=>a.status!=="pending",d=S=>{if(!f()){const p=new Om(S);_(p),e.onCancel?.(p)}},l=()=>{n=!0},u=()=>{n=!1},c=()=>fp.isFocused()&&(e.networkMode==="always"||Vu.isOnline())&&e.canRun(),v=()=>qS(e.networkMode)&&e.canRun(),m=S=>{f()||(s?.(),a.resolve(S))},_=S=>{f()||(s?.(),a.reject(S))},x=()=>new Promise(S=>{s=p=>{(f()||c())&&S(p)},e.onPause?.()}).then(()=>{s=void 0,f()||e.onContinue?.()}),C=()=>{if(f())return;let S;const p=i===0?e.initialPromise:void 0;try{S=p??e.fn()}catch(g){S=Promise.reject(g)}Promise.resolve(S).then(m).catch(g=>{if(f())return;const b=e.retry??(Is?0:3),y=e.retryDelay??RR,E=typeof y=="function"?y(i,g):y,M=b===!0||typeof b=="number"&&i<b||typeof b=="function"&&b(i,g);if(n||!M){_(g);return}i++,e.onFail?.(i,g),yR(E).then(()=>c()?void 0:x()).then(()=>{n?_(g):C()})})};return{promise:a,status:()=>a.status,cancel:d,continue:()=>(s?.(),a),cancelRetry:l,continueRetry:u,canStart:v,start:()=>(v()?C():x().then(C),a)}}var YS=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Am(this.gcTime)&&(this.#e=Ns.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Is?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Ns.clearTimeout(this.#e),this.#e=void 0)}},AR=class extends YS{#e;#t;#n;#i;#r;#o;#a;constructor(e){super(),this.#a=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#n=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=ly(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=ly(this.options);n.data!==void 0&&(this.setState(ay(n.data,n.dataUpdatedAt)),this.#e=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,n){const i=Mm(this.state.data,e,this.options);return this.#s({data:i,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),i}setState(e,n){this.#s({type:"setState",state:e,setStateOptions:n})}cancel(e){const n=this.#r?.promise;return this.#r?.cancel(e),n?n.then(pn).catch(pn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>tr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>os(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!US(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,n){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(u=>u.options.queryFn);l&&this.setOptions(l.options)}const i=new AbortController,s=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#a=!0,i.signal)})},a=()=>{const l=$S(this.options,n),c=(()=>{const v={client:this.#i,queryKey:this.queryKey,meta:this.meta};return s(v),v})();return this.#a=!1,this.options.persister?this.options.persister(l,c,this):l(c)},d=(()=>{const l={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:a};return s(l),l})();this.options.behavior?.onFetch(d,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#s({type:"fetch",meta:d.fetchOptions?.meta}),this.#r=WS({initialPromise:n?.initialPromise,fn:d.fetchFn,onCancel:l=>{l instanceof Om&&l.revert&&this.setState({...this.#t,fetchStatus:"idle"}),i.abort()},onFail:(l,u)=>{this.#s({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const l=await this.#r.start();if(l===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(l),this.#n.config.onSuccess?.(l,this),this.#n.config.onSettled?.(l,this.state.error,this),l}catch(l){if(l instanceof Om){if(l.silent)return this.#r.promise;if(l.revert){if(this.state.data===void 0)throw l;return this.state.data}}throw this.#s({type:"error",error:l}),this.#n.config.onError?.(l,this),this.#n.config.onSettled?.(this.state.data,l,this),l}finally{this.scheduleGc()}}#s(e){const n=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...KS(i.data,this.options),fetchMeta:e.meta??null};case"success":const s={...i,...ay(e.data,e.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const a=e.error;return{...i,error:a,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=n(this.state),Wt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function KS(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qS(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ay(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ly(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,i=n!==void 0,s=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:i?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var TR=class extends oa{constructor(e,n){super(),this.options=n,this.#e=e,this.#s=null,this.#a=Dm(),this.bindMethods(),this.setOptions(n)}#e;#t=void 0;#n=void 0;#i=void 0;#r;#o;#a;#s;#p;#f;#d;#c;#u;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),cy(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Lm(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Lm(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const n=this.options,i=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof tr(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#t.setOptions(this.options),n._defaulted&&!$u(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&uy(this.#t,i,this.options,n)&&this.#h(),this.updateResult(),s&&(this.#t!==i||tr(this.options.enabled,this.#t)!==tr(n.enabled,this.#t)||os(this.options.staleTime,this.#t)!==os(n.staleTime,this.#t))&&this.#g();const a=this.#v();s&&(this.#t!==i||tr(this.options.enabled,this.#t)!==tr(n.enabled,this.#t)||a!==this.#l)&&this.#_(a)}getOptimisticResult(e){const n=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(n,e);return DR(this,i)&&(this.#i=i,this.#o=this.options,this.#r=this.#t.state),i}getCurrentResult(){return this.#i}trackResult(e,n){return new Proxy(e,{get:(i,s)=>(this.trackProp(s),n?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,s))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=this.#e.defaultQueryOptions(e),i=this.#e.getQueryCache().build(this.#e,n);return i.fetch().then(()=>this.createResult(i,n))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#h(e){this.#x();let n=this.#t.fetch(this.options,e);return e?.throwOnError||(n=n.catch(pn)),n}#g(){this.#b();const e=os(this.options.staleTime,this.#t);if(Is||this.#i.isStale||!Am(e))return;const i=US(this.#i.dataUpdatedAt,e)+1;this.#c=Ns.setTimeout(()=>{this.#i.isStale||this.updateResult()},i)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#_(e){this.#S(),this.#l=e,!(Is||tr(this.options.enabled,this.#t)===!1||!Am(this.#l)||this.#l===0)&&(this.#u=Ns.setInterval(()=>{(this.options.refetchIntervalInBackground||fp.isFocused())&&this.#h()},this.#l))}#y(){this.#g(),this.#_(this.#v())}#b(){this.#c&&(Ns.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(Ns.clearInterval(this.#u),this.#u=void 0)}createResult(e,n){const i=this.#t,s=this.options,a=this.#i,f=this.#r,d=this.#o,u=e!==i?e.state:this.#n,{state:c}=e;let v={...c},m=!1,_;if(n._optimisticResults){const A=this.hasListeners(),k=!A&&cy(e,n),q=A&&uy(e,i,n,s);(k||q)&&(v={...v,...KS(c.data,e.options)}),n._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:x,errorUpdatedAt:C,status:S}=v;_=v.data;let p=!1;if(n.placeholderData!==void 0&&_===void 0&&S==="pending"){let A;a?.isPlaceholderData&&n.placeholderData===d?.placeholderData?(A=a.data,p=!0):A=typeof n.placeholderData=="function"?n.placeholderData(this.#d?.state.data,this.#d):n.placeholderData,A!==void 0&&(S="success",_=Mm(a?.data,A,n),m=!0)}if(n.select&&_!==void 0&&!p)if(a&&_===f?.data&&n.select===this.#p)_=this.#f;else try{this.#p=n.select,_=n.select(_),_=Mm(a?.data,_,n),this.#f=_,this.#s=null}catch(A){this.#s=A}this.#s&&(x=this.#s,_=this.#f,C=Date.now(),S="error");const g=v.fetchStatus==="fetching",b=S==="pending",y=S==="error",E=b&&g,M=_!==void 0,T={status:S,fetchStatus:v.fetchStatus,isPending:b,isSuccess:S==="success",isError:y,isInitialLoading:E,isLoading:E,data:_,dataUpdatedAt:v.dataUpdatedAt,error:x,errorUpdatedAt:C,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>u.dataUpdateCount||v.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!b,isLoadingError:y&&!M,isPaused:v.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:y&&M,isStale:dp(e,n),refetch:this.refetch,promise:this.#a,isEnabled:tr(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=z=>{T.status==="error"?z.reject(T.error):T.data!==void 0&&z.resolve(T.data)},k=()=>{const z=this.#a=T.promise=Dm();A(z)},q=this.#a;switch(q.status){case"pending":e.queryHash===i.queryHash&&A(q);break;case"fulfilled":(T.status==="error"||T.data!==q.value)&&k();break;case"rejected":(T.status!=="error"||T.error!==q.reason)&&k();break}}return T}updateResult(){const e=this.#i,n=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#o=this.options,this.#r.data!==void 0&&(this.#d=this.#t),$u(n,e))return;this.#i=n;const i=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!this.#m.size)return!0;const f=new Set(a??this.#m);return this.options.throwOnError&&f.add("error"),Object.keys(this.#i).some(d=>{const l=d;return this.#i[l]!==e[l]&&f.has(l)})};this.#w({listeners:i()})}#x(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const n=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(n?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#w(e){Wt.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function MR(e,n){return tr(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&n.retryOnMount===!1)}function cy(e,n){return MR(e,n)||e.state.data!==void 0&&Lm(e,n,n.refetchOnMount)}function Lm(e,n,i){if(tr(n.enabled,e)!==!1&&os(n.staleTime,e)!=="static"){const s=typeof i=="function"?i(e):i;return s==="always"||s!==!1&&dp(e,n)}return!1}function uy(e,n,i,s){return(e!==n||tr(s.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&dp(e,i)}function dp(e,n){return tr(n.enabled,e)!==!1&&e.isStaleByTime(os(n.staleTime,e))}function DR(e,n){return!$u(e.getCurrentResult(),n)}function hy(e){return{onFetch:(n,i)=>{const s=n.options,a=n.fetchOptions?.meta?.fetchMore?.direction,f=n.state.data?.pages||[],d=n.state.data?.pageParams||[];let l={pages:[],pageParams:[]},u=0;const c=async()=>{let v=!1;const m=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(n.signal.aborted?v=!0:n.signal.addEventListener("abort",()=>{v=!0}),n.signal)})},_=$S(n.options,n.fetchOptions),x=async(C,S,p)=>{if(v)return Promise.reject();if(S==null&&C.pages.length)return Promise.resolve(C);const b=(()=>{const O={client:n.client,queryKey:n.queryKey,pageParam:S,direction:p?"backward":"forward",meta:n.options.meta};return m(O),O})(),y=await _(b),{maxPages:E}=n.options,M=p?SR:bR;return{pages:M(C.pages,y,E),pageParams:M(C.pageParams,S,E)}};if(a&&f.length){const C=a==="backward",S=C?OR:fy,p={pages:f,pageParams:d},g=S(s,p);l=await x(p,g,C)}else{const C=e??f.length;do{const S=u===0?d[0]??s.initialPageParam:fy(s,l);if(u>0&&S==null)break;l=await x(l,S),u++}while(u<C)}return l};n.options.persister?n.fetchFn=()=>n.options.persister?.(c,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},i):n.fetchFn=c}}}function fy(e,{pages:n,pageParams:i}){const s=n.length-1;return n.length>0?e.getNextPageParam(n[s],n,i[s],i):void 0}function OR(e,{pages:n,pageParams:i}){return n.length>0?e.getPreviousPageParam?.(n[0],n,i[0],i):void 0}var LR=class extends YS{#e;#t;#n;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||GS(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(n=>n!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const n=()=>{this.#r({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=WS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(f,d)=>{this.#r({type:"failed",failureCount:f,error:d})},onPause:()=>{this.#r({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",a=!this.#i.canStart();try{if(s)n();else{this.#r({type:"pending",variables:e,isPaused:a}),await this.#n.config.onMutate?.(e,this,i);const d=await this.options.onMutate?.(e,i);d!==this.state.context&&this.#r({type:"pending",context:d,variables:e,isPaused:a})}const f=await this.#i.start();return await this.#n.config.onSuccess?.(f,e,this.state.context,this,i),await this.options.onSuccess?.(f,e,this.state.context,i),await this.#n.config.onSettled?.(f,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(f,null,e,this.state.context,i),this.#r({type:"success",data:f}),f}catch(f){try{throw await this.#n.config.onError?.(f,e,this.state.context,this,i),await this.options.onError?.(f,e,this.state.context,i),await this.#n.config.onSettled?.(void 0,f,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(void 0,f,e,this.state.context,i),f}finally{this.#r({type:"error",error:f})}}finally{this.#n.runNext(this)}}#r(e){const n=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Wt.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function GS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var kR=class extends oa{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,n,i){const s=new LR({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:i});return this.add(s),s}add(e){this.#e.add(e);const n=cu(e);if(typeof n=="string"){const i=this.#t.get(n);i?i.push(e):this.#t.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=cu(e);if(typeof n=="string"){const i=this.#t.get(n);if(i)if(i.length>1){const s=i.indexOf(e);s!==-1&&i.splice(s,1)}else i[0]===e&&this.#t.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=cu(e);if(typeof n=="string"){const s=this.#t.get(n)?.find(a=>a.state.status==="pending");return!s||s===e}else return!0}runNext(e){const n=cu(e);return typeof n=="string"?this.#t.get(n)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Wt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(i=>iy(n,i))}findAll(e={}){return this.getAll().filter(n=>iy(e,n))}notify(e){Wt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Wt.batch(()=>Promise.all(e.map(n=>n.continue().catch(pn))))}};function cu(e){return e.options.scope?.id}var NR=class extends oa{#e;#t=void 0;#n;#i;constructor(n,i){super(),this.#e=n,this.setOptions(i),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){const i=this.options;this.options=this.#e.defaultMutationOptions(n),$u(this.options,i)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),i?.mutationKey&&this.options.mutationKey&&Us(i.mutationKey)!==Us(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(n){this.#r(),this.#o(n)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#o()}mutate(n,i){return this.#i=i,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(n)}#r(){const n=this.#n?.state??GS();this.#t={...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset}}#o(n){Wt.batch(()=>{if(this.#i&&this.hasListeners()){const i=this.#t.variables,s=this.#t.context,a={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};n?.type==="success"?(this.#i.onSuccess?.(n.data,i,s,a),this.#i.onSettled?.(n.data,null,i,s,a)):n?.type==="error"&&(this.#i.onError?.(n.error,i,s,a),this.#i.onSettled?.(void 0,n.error,i,s,a))}this.listeners.forEach(i=>{i(this.#t)})})}},BR=class extends oa{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,i){const s=n.queryKey,a=n.queryHash??up(s,n);let f=this.get(a);return f||(f=new AR({client:e,queryKey:s,queryHash:a,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(s)}),this.add(f)),f}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#e.get(e.queryHash);n&&(e.destroy(),n===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Wt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(i=>ry(n,i))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(i=>ry(e,i)):n}notify(e){Wt.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Wt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Wt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},jR=class{#e;#t;#n;#i;#r;#o;#a;#s;constructor(e={}){this.#e=e.queryCache||new BR,this.#t=e.mutationCache||new kR,this.#n=e.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=fp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Vu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),i=this.#e.build(this,n),s=i.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(os(n.staleTime,i))&&this.prefetchQuery(n),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:i})=>{const s=i.data;return[n,s]})}setQueryData(e,n,i){const s=this.defaultQueryOptions({queryKey:e}),f=this.#e.get(s.queryHash)?.state.data,d=vR(n,f);if(d!==void 0)return this.#e.build(this,s).setData(d,{...i,manual:!0})}setQueriesData(e,n,i){return Wt.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,n,i)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;Wt.batch(()=>{n.findAll(e).forEach(i=>{n.remove(i)})})}resetQueries(e,n){const i=this.#e;return Wt.batch(()=>(i.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const i={revert:!0,...n},s=Wt.batch(()=>this.#e.findAll(e).map(a=>a.cancel(i)));return Promise.all(s).then(pn).catch(pn)}invalidateQueries(e,n={}){return Wt.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const i={...n,cancelRefetch:n.cancelRefetch??!0},s=Wt.batch(()=>this.#e.findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let f=a.fetch(void 0,i);return i.throwOnError||(f=f.catch(pn)),a.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(s).then(pn)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const i=this.#e.build(this,n);return i.isStaleByTime(os(n.staleTime,i))?i.fetch(n):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(pn).catch(pn)}fetchInfiniteQuery(e){return e.behavior=hy(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(pn).catch(pn)}ensureInfiniteQueryData(e){return e.behavior=hy(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Vu.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#i.set(Us(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#i.values()],i={};return n.forEach(s=>{yl(e,s.queryKey)&&Object.assign(i,s.defaultOptions)}),i}setMutationDefaults(e,n){this.#r.set(Us(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#r.values()],i={};return n.forEach(s=>{yl(e,s.mutationKey)&&Object.assign(i,s.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=up(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===hp&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},XS=L.createContext(void 0),Xs=e=>{const n=L.useContext(XS);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},HR=({client:e,children:n})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),D.jsx(XS.Provider,{value:e,children:n})),QS=L.createContext(!1),zR=()=>L.useContext(QS);QS.Provider;function PR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var IR=L.createContext(PR()),UR=()=>L.useContext(IR),FR=(e,n)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(n.isReset()||(e.retryOnMount=!1))},$R=e=>{L.useEffect(()=>{e.clearReset()},[e])},VR=({result:e,errorResetBoundary:n,throwOnError:i,query:s,suspense:a})=>e.isError&&!n.isReset()&&!e.isFetching&&s&&(a&&e.data===void 0||VS(i,[e.error,s])),qR=e=>{if(e.suspense){const i=a=>a==="static"?a:Math.max(a??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...a)=>i(s(...a)):i(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},WR=(e,n)=>e.isLoading&&e.isFetching&&!n,YR=(e,n)=>e?.suspense&&n.isPending,dy=(e,n,i)=>n.fetchOptimistic(e).catch(()=>{i.clearReset()});function KR(e,n,i){const s=zR(),a=UR(),f=Xs(),d=f.defaultQueryOptions(e);f.getDefaultOptions().queries?._experimental_beforeQuery?.(d),d._optimisticResults=s?"isRestoring":"optimistic",qR(d),FR(d,a),$R(a);const l=!f.getQueryCache().get(d.queryHash),[u]=L.useState(()=>new n(f,d)),c=u.getOptimisticResult(d),v=!s&&e.subscribed!==!1;if(L.useSyncExternalStore(L.useCallback(m=>{const _=v?u.subscribe(Wt.batchCalls(m)):pn;return u.updateResult(),_},[u,v]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),L.useEffect(()=>{u.setOptions(d)},[d,u]),YR(d,c))throw dy(d,u,a);if(VR({result:c,errorResetBoundary:a,throwOnError:d.throwOnError,query:f.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw c.error;return f.getDefaultOptions().queries?._experimental_afterQuery?.(d,c),d.experimental_prefetchInRender&&!Is&&WR(c,s)&&(l?dy(d,u,a):f.getQueryCache().get(d.queryHash)?.promise)?.catch(pn).finally(()=>{u.updateResult()}),d.notifyOnChangeProps?c:u.trackResult(c)}function mh(e,n){return KR(e,TR)}function Hl(e,n){const i=Xs(),[s]=L.useState(()=>new NR(i,e));L.useEffect(()=>{s.setOptions(e)},[s,e]);const a=L.useSyncExternalStore(L.useCallback(d=>s.subscribe(Wt.batchCalls(d)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),f=L.useCallback((d,l)=>{s.mutate(d,l).catch(pn)},[s]);if(a.error&&VS(s.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:f,mutateAsync:a.mutate}}var ZS=e=>{throw TypeError(e)},GR=(e,n,i)=>n.has(e)||ZS("Cannot "+i),Gd=(e,n,i)=>(GR(e,n,"read from private field"),i?i.call(e):n.get(e)),XR=(e,n,i)=>n.has(e)?ZS("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,i),my="popstate";function QR(e={}){function n(s,a){let{pathname:f,search:d,hash:l}=s.location;return bl("",{pathname:f,search:d,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function i(s,a){return typeof a=="string"?a:Ir(a)}return JR(n,i,null,e)}function qe(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Ot(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function ZR(){return Math.random().toString(36).substring(2,10)}function py(e,n){return{usr:e.state,key:e.key,idx:n}}function bl(e,n,i=null,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?us(n):n,state:i,key:n&&n.key||s||ZR()}}function Ir({pathname:e="/",search:n="",hash:i=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function us(e){let n={};if(e){let i=e.indexOf("#");i>=0&&(n.hash=e.substring(i),e=e.substring(0,i));let s=e.indexOf("?");s>=0&&(n.search=e.substring(s),e=e.substring(0,s)),e&&(n.pathname=e)}return n}function JR(e,n,i,s={}){let{window:a=document.defaultView,v5Compat:f=!1}=s,d=a.history,l="POP",u=null,c=v();c==null&&(c=0,d.replaceState({...d.state,idx:c},""));function v(){return(d.state||{idx:null}).idx}function m(){l="POP";let p=v(),g=p==null?null:p-c;c=p,u&&u({action:l,location:S.location,delta:g})}function _(p,g){l="PUSH";let b=bl(S.location,p,g);c=v()+1;let y=py(b,c),E=S.createHref(b);try{d.pushState(y,"",E)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;a.location.assign(E)}f&&u&&u({action:l,location:S.location,delta:1})}function x(p,g){l="REPLACE";let b=bl(S.location,p,g);c=v();let y=py(b,c),E=S.createHref(b);d.replaceState(y,"",E),f&&u&&u({action:l,location:S.location,delta:0})}function C(p){return JS(p)}let S={get action(){return l},get location(){return e(a,d)},listen(p){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(my,m),u=p,()=>{a.removeEventListener(my,m),u=null}},createHref(p){return n(a,p)},createURL:C,encodeLocation(p){let g=C(p);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:_,replace:x,go(p){return d.go(p)}};return S}function JS(e,n=!1){let i="http://localhost";typeof window<"u"&&(i=window.location.origin!=="null"?window.location.origin:window.location.href),qe(i,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Ir(e);return s=s.replace(/ $/,"%20"),!n&&s.startsWith("//")&&(s=i+s),new URL(s,i)}var hl,gy=class{constructor(e){if(XR(this,hl,new Map),e)for(let[n,i]of e)this.set(n,i)}get(e){if(Gd(this,hl).has(e))return Gd(this,hl).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,n){Gd(this,hl).set(e,n)}};hl=new WeakMap;var eA=new Set(["lazy","caseSensitive","path","id","index","children"]);function tA(e){return eA.has(e)}var nA=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function rA(e){return nA.has(e)}function iA(e){return e.index===!0}function Sl(e,n,i=[],s={},a=!1){return e.map((f,d)=>{let l=[...i,String(d)],u=typeof f.id=="string"?f.id:l.join("-");if(qe(f.index!==!0||!f.children,"Cannot specify children on an index route"),qe(a||!s[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),iA(f)){let c={...f,id:u};return s[u]=vy(c,n(c)),c}else{let c={...f,id:u,children:void 0};return s[u]=vy(c,n(c)),f.children&&(c.children=Sl(f.children,n,l,s,a)),c}})}function vy(e,n){return Object.assign(e,{...n,...typeof n.lazy=="object"&&n.lazy!=null?{lazy:{...e.lazy,...n.lazy}}:{}})}function es(e,n,i="/"){return fl(e,n,i,!1)}function fl(e,n,i,s){let a=typeof n=="string"?us(n):n,f=ir(a.pathname||"/",i);if(f==null)return null;let d=ex(e);oA(d);let l=null;for(let u=0;l==null&&u<d.length;++u){let c=vA(f);l=pA(d[u],c,s)}return l}function sA(e,n){let{route:i,pathname:s,params:a}=e;return{id:i.id,pathname:s,params:a,data:n[i.id],loaderData:n[i.id],handle:i.handle}}function ex(e,n=[],i=[],s="",a=!1){let f=(d,l,u=a,c)=>{let v={relativePath:c===void 0?d.path||"":c,caseSensitive:d.caseSensitive===!0,childrenIndex:l,route:d};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(s)&&u)return;qe(v.relativePath.startsWith(s),`Absolute route path "${v.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(s.length)}let m=Hr([s,v.relativePath]),_=i.concat(v);d.children&&d.children.length>0&&(qe(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),ex(d.children,n,_,m,u)),!(d.path==null&&!d.index)&&n.push({path:m,score:dA(m,d.index),routesMeta:_})};return e.forEach((d,l)=>{if(d.path===""||!d.path?.includes("?"))f(d,l);else for(let u of tx(d.path))f(d,l,!0,u)}),n}function tx(e){let n=e.split("/");if(n.length===0)return[];let[i,...s]=n,a=i.endsWith("?"),f=i.replace(/\?$/,"");if(s.length===0)return a?[f,""]:[f];let d=tx(s.join("/")),l=[];return l.push(...d.map(u=>u===""?f:[f,u].join("/"))),a&&l.push(...d),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function oA(e){e.sort((n,i)=>n.score!==i.score?i.score-n.score:mA(n.routesMeta.map(s=>s.childrenIndex),i.routesMeta.map(s=>s.childrenIndex)))}var aA=/^:[\w-]+$/,lA=3,cA=2,uA=1,hA=10,fA=-2,_y=e=>e==="*";function dA(e,n){let i=e.split("/"),s=i.length;return i.some(_y)&&(s+=fA),n&&(s+=cA),i.filter(a=>!_y(a)).reduce((a,f)=>a+(aA.test(f)?lA:f===""?uA:hA),s)}function mA(e,n){return e.length===n.length&&e.slice(0,-1).every((s,a)=>s===n[a])?e[e.length-1]-n[n.length-1]:0}function pA(e,n,i=!1){let{routesMeta:s}=e,a={},f="/",d=[];for(let l=0;l<s.length;++l){let u=s[l],c=l===s.length-1,v=f==="/"?n:n.slice(f.length)||"/",m=qu({path:u.relativePath,caseSensitive:u.caseSensitive,end:c},v),_=u.route;if(!m&&c&&i&&!s[s.length-1].route.index&&(m=qu({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},v)),!m)return null;Object.assign(a,m.params),d.push({params:a,pathname:Hr([f,m.pathname]),pathnameBase:SA(Hr([f,m.pathnameBase])),route:_}),m.pathnameBase!=="/"&&(f=Hr([f,m.pathnameBase]))}return d}function qu(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[i,s]=gA(e.path,e.caseSensitive,e.end),a=n.match(i);if(!a)return null;let f=a[0],d=f.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:s.reduce((c,{paramName:v,isOptional:m},_)=>{if(v==="*"){let C=l[_]||"";d=f.slice(0,f.length-C.length).replace(/(.)\/+$/,"$1")}const x=l[_];return m&&!x?c[v]=void 0:c[v]=(x||"").replace(/%2F/g,"/"),c},{}),pathname:f,pathnameBase:d,pattern:e}}function gA(e,n=!1,i=!0){Ot(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 s=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,l,u)=>(s.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,n?void 0:"i"),s]}function vA(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Ot(!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 (${n}).`),e}}function ir(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let i=n.endsWith("/")?n.length-1:n.length,s=e.charAt(i);return s&&s!=="/"?null:e.slice(i)||"/"}function _A({basename:e,pathname:n}){return n==="/"?e:Hr([e,n])}var yA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ph=e=>yA.test(e);function bA(e,n="/"){let{pathname:i,search:s="",hash:a=""}=typeof e=="string"?us(e):e,f;if(i)if(ph(i))f=i;else{if(i.includes("//")){let d=i;i=i.replace(/\/\/+/g,"/"),Ot(!1,`Pathnames cannot have embedded double slashes - normalizing ${d} -> ${i}`)}i.startsWith("/")?f=yy(i.substring(1),"/"):f=yy(i,n)}else f=n;return{pathname:f,search:xA(s),hash:wA(a)}}function yy(e,n){let i=n.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?i.length>1&&i.pop():a!=="."&&i.push(a)}),i.length>1?i.join("/"):"/"}function Xd(e,n,i,s){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function nx(e){return e.filter((n,i)=>i===0||n.route.path&&n.route.path.length>0)}function mp(e){let n=nx(e);return n.map((i,s)=>s===n.length-1?i.pathname:i.pathnameBase)}function pp(e,n,i,s=!1){let a;typeof e=="string"?a=us(e):(a={...e},qe(!a.pathname||!a.pathname.includes("?"),Xd("?","pathname","search",a)),qe(!a.pathname||!a.pathname.includes("#"),Xd("#","pathname","hash",a)),qe(!a.search||!a.search.includes("#"),Xd("#","search","hash",a)));let f=e===""||a.pathname==="",d=f?"/":a.pathname,l;if(d==null)l=i;else{let m=n.length-1;if(!s&&d.startsWith("..")){let _=d.split("/");for(;_[0]==="..";)_.shift(),m-=1;a.pathname=_.join("/")}l=m>=0?n[m]:"/"}let u=bA(a,l),c=d&&d!=="/"&&d.endsWith("/"),v=(f||d===".")&&i.endsWith("/");return!u.pathname.endsWith("/")&&(c||v)&&(u.pathname+="/"),u}var Hr=e=>e.join("/").replace(/\/\/+/g,"/"),SA=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),xA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,gh=class{constructor(e,n,i,s=!1){this.status=e,this.statusText=n||"",this.internal=s,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function xl(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function zl(e){return e.map(n=>n.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var rs=Symbol("Uninstrumented");function CA(e,n){let i={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({id:n.id,index:n.index,path:n.path,instrument(f){let d=Object.keys(i);for(let l of d)f[l]&&i[l].push(f[l])}}));let s={};if(typeof n.lazy=="function"&&i.lazy.length>0){let a=Vo(i.lazy,n.lazy,()=>{});a&&(s.lazy=a)}if(typeof n.lazy=="object"){let a=n.lazy;["middleware","loader","action"].forEach(f=>{let d=a[f],l=i[`lazy.${f}`];if(typeof d=="function"&&l.length>0){let u=Vo(l,d,()=>{});u&&(s.lazy=Object.assign(s.lazy||{},{[f]:u}))}})}return["loader","action"].forEach(a=>{let f=n[a];if(typeof f=="function"&&i[a].length>0){let d=f[rs]??f,l=Vo(i[a],d,(...u)=>by(u[0]));l&&(l[rs]=d,s[a]=l)}}),n.middleware&&n.middleware.length>0&&i.middleware.length>0&&(s.middleware=n.middleware.map(a=>{let f=a[rs]??a,d=Vo(i.middleware,f,(...l)=>by(l[0]));return d?(d[rs]=f,d):a})),s}function EA(e,n){let i={navigate:[],fetch:[]};if(n.forEach(s=>s({instrument(a){let f=Object.keys(a);for(let d of f)a[d]&&i[d].push(a[d])}})),i.navigate.length>0){let s=e.navigate[rs]??e.navigate,a=Vo(i.navigate,s,(...f)=>{let[d,l]=f;return{to:typeof d=="number"||typeof d=="string"?d:d?Ir(d):".",...Sy(e,l??{})}});a&&(a[rs]=s,e.navigate=a)}if(i.fetch.length>0){let s=e.fetch[rs]??e.fetch,a=Vo(i.fetch,s,(...f)=>{let[d,,l,u]=f;return{href:l??".",fetcherKey:d,...Sy(e,u??{})}});a&&(a[rs]=s,e.fetch=a)}return e}function Vo(e,n,i){return e.length===0?null:async(...s)=>{let a=await rx(e,i(...s),()=>n(...s),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function rx(e,n,i,s){let a=e[s],f;if(a){let d,l=async()=>(d?console.error("You cannot call instrumented handlers more than once"):d=rx(e,n,i,s-1),f=await d,qe(f,"Expected a result"),f.type==="error"&&f.value instanceof Error?{status:"error",error:f.value}:{status:"success",error:void 0});try{await a(l,n)}catch(u){console.error("An instrumentation function threw an error:",u)}d||await l(),await d}else try{f={type:"success",value:await i()}}catch(d){f={type:"error",value:d}}return f||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function by(e){let{request:n,context:i,params:s,unstable_pattern:a}=e;return{request:RA(n),params:{...s},unstable_pattern:a,context:AA(i)}}function Sy(e,n){return{currentUrl:Ir(e.state.location),..."formMethod"in n?{formMethod:n.formMethod}:{},..."formEncType"in n?{formEncType:n.formEncType}:{},..."formData"in n?{formData:n.formData}:{},..."body"in n?{body:n.body}:{}}}function RA(e){return{method:e.method,url:e.url,headers:{get:(...n)=>e.headers.get(...n)}}}function AA(e){if(MA(e)){let n={...e};return Object.freeze(n),n}else return{get:n=>e.get(n)}}var TA=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function MA(e){if(e===null||typeof e!="object")return!1;const n=Object.getPrototypeOf(e);return n===Object.prototype||n===null||Object.getOwnPropertyNames(n).sort().join("\0")===TA}var ix=["POST","PUT","PATCH","DELETE"],DA=new Set(ix),OA=["GET",...ix],LA=new Set(OA),kA=new Set([301,302,303,307,308]),NA=new Set([307,308]),Qd={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},BA={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},sl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},jA=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),sx="remix-router-transitions",ox=Symbol("ResetLoaderData");function HA(e){const n=e.window?e.window:typeof window<"u"?window:void 0,i=typeof n<"u"&&typeof n.document<"u"&&typeof n.document.createElement<"u";qe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=e.hydrationRouteProperties||[],a=e.mapRouteProperties||jA,f=a;if(e.unstable_instrumentations){let ee=e.unstable_instrumentations;f=oe=>({...a(oe),...CA(ee.map(fe=>fe.route).filter(Boolean),oe)})}let d={},l=Sl(e.routes,f,void 0,d),u,c=e.basename||"/";c.startsWith("/")||(c=`/${c}`);let v=e.dataStrategy||FA,m={...e.future},_=null,x=new Set,C=null,S=null,p=null,g=e.hydrationData!=null,b=es(l,e.history.location,c),y=!1,E=null,M;if(b==null&&!e.patchRoutesOnNavigation){let ee=er(404,{pathname:e.history.location.pathname}),{matches:oe,route:fe}=uu(l);M=!0,b=oe,E={[fe.id]:ee}}else if(b&&!e.hydrationData&&Gr(b,l,e.history.location.pathname).active&&(b=null),b)if(b.some(ee=>ee.route.lazy))M=!1;else if(!b.some(ee=>gp(ee.route)))M=!0;else{let ee=e.hydrationData?e.hydrationData.loaderData:null,oe=e.hydrationData?e.hydrationData.errors:null;if(oe){let fe=b.findIndex(ye=>oe[ye.route.id]!==void 0);M=b.slice(0,fe+1).every(ye=>!Nm(ye.route,ee,oe))}else M=b.every(fe=>!Nm(fe.route,ee,oe))}else{M=!1,b=[];let ee=Gr(null,l,e.history.location.pathname);ee.active&&ee.matches&&(y=!0,b=ee.matches)}let O,T={historyAction:e.history.action,location:e.history.location,matches:b,initialized:M,navigation:Qd,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||E,fetchers:new Map,blockers:new Map},A="POP",k=null,q=!1,z,I=!1,W=new Map,U=null,G=!1,H=!1,K=new Set,F=new Map,N=0,$=-1,B=new Map,P=new Set,Q=new Map,J=new Map,ae=new Set,Z=new Map,X,V=null;function ie(){if(_=e.history.listen(({action:ee,location:oe,delta:fe})=>{if(X){X(),X=void 0;return}Ot(Z.size===0||fe!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ye=Wr({currentLocation:T.location,nextLocation:oe,historyAction:ee});if(ye&&fe!=null){let be=new Promise(De=>{X=De});e.history.go(fe*-1),ar(ye,{state:"blocked",location:oe,proceed(){ar(ye,{state:"proceeding",proceed:void 0,reset:void 0,location:oe}),be.then(()=>e.history.go(fe))},reset(){let De=new Map(T.blockers);De.set(ye,sl),le({blockers:De})}}),k?.resolve(),k=null;return}return Be(ee,oe)}),i){iT(n,W);let ee=()=>sT(n,W);n.addEventListener("pagehide",ee),U=()=>n.removeEventListener("pagehide",ee)}return T.initialized||Be("POP",T.location,{initialHydration:!0}),O}function de(){_&&_(),U&&U(),x.clear(),z&&z.abort(),T.fetchers.forEach((ee,oe)=>st(oe)),T.blockers.forEach((ee,oe)=>to(oe))}function re(ee){return x.add(ee),()=>x.delete(ee)}function le(ee,oe={}){ee.matches&&(ee.matches=ee.matches.map(be=>{let De=d[be.route.id],Ee=be.route;return Ee.element!==De.element||Ee.errorElement!==De.errorElement||Ee.hydrateFallbackElement!==De.hydrateFallbackElement?{...be,route:De}:be})),T={...T,...ee};let fe=[],ye=[];T.fetchers.forEach((be,De)=>{be.state==="idle"&&(ae.has(De)?fe.push(De):ye.push(De))}),ae.forEach(be=>{!T.fetchers.has(be)&&!F.has(be)&&fe.push(be)}),[...x].forEach(be=>be(T,{deletedFetchers:fe,newErrors:ee.errors??null,viewTransitionOpts:oe.viewTransitionOpts,flushSync:oe.flushSync===!0})),fe.forEach(be=>st(be)),ye.forEach(be=>T.fetchers.delete(be))}function _e(ee,oe,{flushSync:fe}={}){let ye=T.actionData!=null&&T.navigation.formMethod!=null&&gn(T.navigation.formMethod)&&T.navigation.state==="loading"&&ee.state?._isRedirect!==!0,be;oe.actionData?Object.keys(oe.actionData).length>0?be=oe.actionData:be=null:ye?be=T.actionData:be=null;let De=oe.loaderData?Oy(T.loaderData,oe.loaderData,oe.matches||[],oe.errors):T.loaderData,Ee=T.blockers;Ee.size>0&&(Ee=new Map(Ee),Ee.forEach((Oe,ke)=>Ee.set(ke,sl)));let Se=G?!1:no(ee,oe.matches||T.matches),xe=q===!0||T.navigation.formMethod!=null&&gn(T.navigation.formMethod)&&ee.state?._isRedirect!==!0;u&&(l=u,u=void 0),G||A==="POP"||(A==="PUSH"?e.history.push(ee,ee.state):A==="REPLACE"&&e.history.replace(ee,ee.state));let Me;if(A==="POP"){let Oe=W.get(T.location.pathname);Oe&&Oe.has(ee.pathname)?Me={currentLocation:T.location,nextLocation:ee}:W.has(ee.pathname)&&(Me={currentLocation:ee,nextLocation:T.location})}else if(I){let Oe=W.get(T.location.pathname);Oe?Oe.add(ee.pathname):(Oe=new Set([ee.pathname]),W.set(T.location.pathname,Oe)),Me={currentLocation:T.location,nextLocation:ee}}le({...oe,actionData:be,loaderData:De,historyAction:A,location:ee,initialized:!0,navigation:Qd,revalidation:"idle",restoreScrollPosition:Se,preventScrollReset:xe,blockers:Ee},{viewTransitionOpts:Me,flushSync:fe===!0}),A="POP",q=!1,I=!1,G=!1,H=!1,k?.resolve(),k=null,V?.resolve(),V=null}async function Ce(ee,oe){if(k?.resolve(),k=null,typeof ee=="number"){k||(k=By());let ot=k.promise;return e.history.go(ee),ot}let fe=km(T.location,T.matches,c,ee,oe?.fromRouteId,oe?.relative),{path:ye,submission:be,error:De}=xy(!1,fe,oe),Ee=T.location,Se=bl(T.location,ye,oe&&oe.state);Se={...Se,...e.history.encodeLocation(Se)};let xe=oe&&oe.replace!=null?oe.replace:void 0,Me="PUSH";xe===!0?Me="REPLACE":xe===!1||be!=null&&gn(be.formMethod)&&be.formAction===T.location.pathname+T.location.search&&(Me="REPLACE");let Oe=oe&&"preventScrollReset"in oe?oe.preventScrollReset===!0:void 0,ke=(oe&&oe.flushSync)===!0,We=Wr({currentLocation:Ee,nextLocation:Se,historyAction:Me});if(We){ar(We,{state:"blocked",location:Se,proceed(){ar(We,{state:"proceeding",proceed:void 0,reset:void 0,location:Se}),Ce(ee,oe)},reset(){let ot=new Map(T.blockers);ot.set(We,sl),le({blockers:ot})}});return}await Be(Me,Se,{submission:be,pendingError:De,preventScrollReset:Oe,replace:oe&&oe.replace,enableViewTransition:oe&&oe.viewTransition,flushSync:ke})}function He(){V||(V=By()),an(),le({revalidation:"loading"});let ee=V.promise;return T.navigation.state==="submitting"?ee:T.navigation.state==="idle"?(Be(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),ee):(Be(A||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:I===!0}),ee)}async function Be(ee,oe,fe){z&&z.abort(),z=null,A=ee,G=(fe&&fe.startUninterruptedRevalidation)===!0,Kr(T.location,T.matches),q=(fe&&fe.preventScrollReset)===!0,I=(fe&&fe.enableViewTransition)===!0;let ye=u||l,be=fe&&fe.overrideNavigation,De=fe?.initialHydration&&T.matches&&T.matches.length>0&&!y?T.matches:es(ye,oe,c),Ee=(fe&&fe.flushSync)===!0;if(De&&T.initialized&&!H&&XA(T.location,oe)&&!(fe&&fe.submission&&gn(fe.submission.formMethod))){_e(oe,{matches:De},{flushSync:Ee});return}let Se=Gr(De,ye,oe.pathname);if(Se.active&&Se.matches&&(De=Se.matches),!De){let{error:St,notFoundMatches:Je,route:et}=wr(oe.pathname);_e(oe,{matches:Je,loaderData:{},errors:{[et.id]:St}},{flushSync:Ee});return}z=new AbortController;let xe=$o(e.history,oe,z.signal,fe&&fe.submission),Me=e.getContext?await e.getContext():new gy,Oe;if(fe&&fe.pendingError)Oe=[ts(De).route.id,{type:"error",error:fe.pendingError}];else if(fe&&fe.submission&&gn(fe.submission.formMethod)){let St=await we(xe,oe,fe.submission,De,Me,Se.active,fe&&fe.initialHydration===!0,{replace:fe.replace,flushSync:Ee});if(St.shortCircuited)return;if(St.pendingActionResult){let[Je,et]=St.pendingActionResult;if(Un(et)&&xl(et.error)&&et.error.status===404){z=null,_e(oe,{matches:St.matches,loaderData:{},errors:{[Je]:et.error}});return}}De=St.matches||De,Oe=St.pendingActionResult,be=Zd(oe,fe.submission),Ee=!1,Se.active=!1,xe=$o(e.history,xe.url,xe.signal)}let{shortCircuited:ke,matches:We,loaderData:ot,errors:mt}=await Ft(xe,oe,De,Me,Se.active,be,fe&&fe.submission,fe&&fe.fetcherSubmission,fe&&fe.replace,fe&&fe.initialHydration===!0,Ee,Oe);ke||(z=null,_e(oe,{matches:We||De,...Ly(Oe),loaderData:ot,errors:mt}))}async function we(ee,oe,fe,ye,be,De,Ee,Se={}){an();let xe=nT(oe,fe);if(le({navigation:xe},{flushSync:Se.flushSync===!0}),De){let ke=await Cr(ye,oe.pathname,ee.signal);if(ke.type==="aborted")return{shortCircuited:!0};if(ke.type==="error"){if(ke.partialMatches.length===0){let{matches:ot,route:mt}=uu(l);return{matches:ot,pendingActionResult:[mt.id,{type:"error",error:ke.error}]}}let We=ts(ke.partialMatches).route.id;return{matches:ke.partialMatches,pendingActionResult:[We,{type:"error",error:ke.error}]}}else if(ke.matches)ye=ke.matches;else{let{notFoundMatches:We,error:ot,route:mt}=wr(oe.pathname);return{matches:We,pendingActionResult:[mt.id,{type:"error",error:ot}]}}}let Me,Oe=Lu(ye,oe);if(!Oe.route.action&&!Oe.route.lazy)Me={type:"error",error:er(405,{method:ee.method,pathname:oe.pathname,routeId:Oe.route.id})};else{let ke=Yo(f,d,ee,ye,Oe,Ee?[]:s,be),We=await Et(ee,ke,be,null);if(Me=We[Oe.route.id],!Me){for(let ot of ye)if(We[ot.route.id]){Me=We[ot.route.id];break}}if(ee.signal.aborted)return{shortCircuited:!0}}if(Bs(Me)){let ke;return Se&&Se.replace!=null?ke=Se.replace:ke=Ty(Me.response.headers.get("Location"),new URL(ee.url),c)===T.location.pathname+T.location.search,await it(ee,Me,!0,{submission:fe,replace:ke}),{shortCircuited:!0}}if(Un(Me)){let ke=ts(ye,Oe.route.id);return(Se&&Se.replace)!==!0&&(A="PUSH"),{matches:ye,pendingActionResult:[ke.route.id,Me,Oe.route.id]}}return{matches:ye,pendingActionResult:[Oe.route.id,Me]}}async function Ft(ee,oe,fe,ye,be,De,Ee,Se,xe,Me,Oe,ke){let We=De||Zd(oe,Ee),ot=Ee||Se||Ny(We),mt=!G&&!Me;if(be){if(mt){let Nt=kt(ke);le({navigation:We,...Nt!==void 0?{actionData:Nt}:{}},{flushSync:Oe})}let Ve=await Cr(fe,oe.pathname,ee.signal);if(Ve.type==="aborted")return{shortCircuited:!0};if(Ve.type==="error"){if(Ve.partialMatches.length===0){let{matches:kn,route:Sn}=uu(l);return{matches:kn,loaderData:{},errors:{[Sn.id]:Ve.error}}}let Nt=ts(Ve.partialMatches).route.id;return{matches:Ve.partialMatches,loaderData:{},errors:{[Nt]:Ve.error}}}else if(Ve.matches)fe=Ve.matches;else{let{error:Nt,notFoundMatches:kn,route:Sn}=wr(oe.pathname);return{matches:kn,loaderData:{},errors:{[Sn.id]:Nt}}}}let St=u||l,{dsMatches:Je,revalidatingFetchers:et}=wy(ee,ye,f,d,e.history,T,fe,ot,oe,Me?[]:s,Me===!0,H,K,ae,Q,P,St,c,e.patchRoutesOnNavigation!=null,ke);if($=++N,!e.dataStrategy&&!Je.some(Ve=>Ve.shouldLoad)&&!Je.some(Ve=>Ve.route.middleware&&Ve.route.middleware.length>0)&&et.length===0){let Ve=Qt();return _e(oe,{matches:fe,loaderData:{},errors:ke&&Un(ke[1])?{[ke[0]]:ke[1].error}:null,...Ly(ke),...Ve?{fetchers:new Map(T.fetchers)}:{}},{flushSync:Oe}),{shortCircuited:!0}}if(mt){let Ve={};if(!be){Ve.navigation=We;let Nt=kt(ke);Nt!==void 0&&(Ve.actionData=Nt)}et.length>0&&(Ve.fetchers=en(et)),le(Ve,{flushSync:Oe})}et.forEach(Ve=>{_t(Ve.key),Ve.controller&&F.set(Ve.key,Ve.controller)});let ln=()=>et.forEach(Ve=>_t(Ve.key));z&&z.signal.addEventListener("abort",ln);let{loaderResults:bn,fetcherResults:lt}=await Kt(Je,et,ee,ye);if(ee.signal.aborted)return{shortCircuited:!0};z&&z.signal.removeEventListener("abort",ln),et.forEach(Ve=>F.delete(Ve.key));let fn=hu(bn);if(fn)return await it(ee,fn.result,!0,{replace:xe}),{shortCircuited:!0};if(fn=hu(lt),fn)return P.add(fn.key),await it(ee,fn.result,!0,{replace:xe}),{shortCircuited:!0};let{loaderData:Ei,errors:dn}=Dy(T,fe,bn,ke,et,lt);Me&&T.errors&&(dn={...T.errors,...dn});let cn=Qt(),Ri=eo($),Rr=cn||Ri||et.length>0;return{matches:fe,loaderData:Ei,errors:dn,...Rr?{fetchers:new Map(T.fetchers)}:{}}}function kt(ee){if(ee&&!Un(ee[1]))return{[ee[0]]:ee[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function en(ee){return ee.forEach(oe=>{let fe=T.fetchers.get(oe.key),ye=ol(void 0,fe?fe.data:void 0);T.fetchers.set(oe.key,ye)}),new Map(T.fetchers)}async function hn(ee,oe,fe,ye){_t(ee);let be=(ye&&ye.flushSync)===!0,De=u||l,Ee=km(T.location,T.matches,c,fe,oe,ye?.relative),Se=es(De,Ee,c),xe=Gr(Se,De,Ee);if(xe.active&&xe.matches&&(Se=xe.matches),!Se){Gt(ee,oe,er(404,{pathname:Ee}),{flushSync:be});return}let{path:Me,submission:Oe,error:ke}=xy(!0,Ee,ye);if(ke){Gt(ee,oe,ke,{flushSync:be});return}let We=e.getContext?await e.getContext():new gy,ot=(ye&&ye.preventScrollReset)===!0;if(Oe&&gn(Oe.formMethod)){await yn(ee,oe,Me,Se,We,xe.active,be,ot,Oe);return}Q.set(ee,{routeId:oe,path:Me}),await Rt(ee,oe,Me,Se,We,xe.active,be,ot,Oe)}async function yn(ee,oe,fe,ye,be,De,Ee,Se,xe){an(),Q.delete(ee);let Me=T.fetchers.get(ee);gt(ee,rT(xe,Me),{flushSync:Ee});let Oe=new AbortController,ke=$o(e.history,fe,Oe.signal,xe);if(De){let tt=await Cr(ye,new URL(ke.url).pathname,ke.signal,ee);if(tt.type==="aborted")return;if(tt.type==="error"){Gt(ee,oe,tt.error,{flushSync:Ee});return}else if(tt.matches)ye=tt.matches;else{Gt(ee,oe,er(404,{pathname:fe}),{flushSync:Ee});return}}let We=Lu(ye,fe);if(!We.route.action&&!We.route.lazy){let tt=er(405,{method:xe.formMethod,pathname:fe,routeId:oe});Gt(ee,oe,tt,{flushSync:Ee});return}F.set(ee,Oe);let ot=N,mt=Yo(f,d,ke,ye,We,s,be),St=await Et(ke,mt,be,ee),Je=St[We.route.id];if(!Je){for(let tt of mt)if(St[tt.route.id]){Je=St[tt.route.id];break}}if(ke.signal.aborted){F.get(ee)===Oe&&F.delete(ee);return}if(ae.has(ee)){if(Bs(Je)||Un(Je)){gt(ee,gi(void 0));return}}else{if(Bs(Je))if(F.delete(ee),$>ot){gt(ee,gi(void 0));return}else return P.add(ee),gt(ee,ol(xe)),it(ke,Je,!1,{fetcherSubmission:xe,preventScrollReset:Se});if(Un(Je)){Gt(ee,oe,Je.error);return}}let et=T.navigation.location||T.location,ln=$o(e.history,et,Oe.signal),bn=u||l,lt=T.navigation.state!=="idle"?es(bn,T.navigation.location,c):T.matches;qe(lt,"Didn't find any matches after fetcher action");let fn=++N;B.set(ee,fn);let Ei=ol(xe,Je.data);T.fetchers.set(ee,Ei);let{dsMatches:dn,revalidatingFetchers:cn}=wy(ln,be,f,d,e.history,T,lt,xe,et,s,!1,H,K,ae,Q,P,bn,c,e.patchRoutesOnNavigation!=null,[We.route.id,Je]);cn.filter(tt=>tt.key!==ee).forEach(tt=>{let $t=tt.key,ds=T.fetchers.get($t),ma=ol(void 0,ds?ds.data:void 0);T.fetchers.set($t,ma),_t($t),tt.controller&&F.set($t,tt.controller)}),le({fetchers:new Map(T.fetchers)});let Ri=()=>cn.forEach(tt=>_t(tt.key));Oe.signal.addEventListener("abort",Ri);let{loaderResults:Rr,fetcherResults:Ve}=await Kt(dn,cn,ln,be);if(Oe.signal.aborted)return;if(Oe.signal.removeEventListener("abort",Ri),B.delete(ee),F.delete(ee),cn.forEach(tt=>F.delete(tt.key)),T.fetchers.has(ee)){let tt=gi(Je.data);T.fetchers.set(ee,tt)}let Nt=hu(Rr);if(Nt)return it(ln,Nt.result,!1,{preventScrollReset:Se});if(Nt=hu(Ve),Nt)return P.add(Nt.key),it(ln,Nt.result,!1,{preventScrollReset:Se});let{loaderData:kn,errors:Sn}=Dy(T,lt,Rr,void 0,cn,Ve);eo(fn),T.navigation.state==="loading"&&fn>$?(qe(A,"Expected pending action"),z&&z.abort(),_e(T.navigation.location,{matches:lt,loaderData:kn,errors:Sn,fetchers:new Map(T.fetchers)})):(le({errors:Sn,loaderData:Oy(T.loaderData,kn,lt,Sn),fetchers:new Map(T.fetchers)}),H=!1)}async function Rt(ee,oe,fe,ye,be,De,Ee,Se,xe){let Me=T.fetchers.get(ee);gt(ee,ol(xe,Me?Me.data:void 0),{flushSync:Ee});let Oe=new AbortController,ke=$o(e.history,fe,Oe.signal);if(De){let et=await Cr(ye,new URL(ke.url).pathname,ke.signal,ee);if(et.type==="aborted")return;if(et.type==="error"){Gt(ee,oe,et.error,{flushSync:Ee});return}else if(et.matches)ye=et.matches;else{Gt(ee,oe,er(404,{pathname:fe}),{flushSync:Ee});return}}let We=Lu(ye,fe);F.set(ee,Oe);let ot=N,mt=Yo(f,d,ke,ye,We,s,be),Je=(await Et(ke,mt,be,ee))[We.route.id];if(F.get(ee)===Oe&&F.delete(ee),!ke.signal.aborted){if(ae.has(ee)){gt(ee,gi(void 0));return}if(Bs(Je))if($>ot){gt(ee,gi(void 0));return}else{P.add(ee),await it(ke,Je,!1,{preventScrollReset:Se});return}if(Un(Je)){Gt(ee,oe,Je.error);return}gt(ee,gi(Je.data))}}async function it(ee,oe,fe,{submission:ye,fetcherSubmission:be,preventScrollReset:De,replace:Ee}={}){fe||(k?.resolve(),k=null),oe.response.headers.has("X-Remix-Revalidate")&&(H=!0);let Se=oe.response.headers.get("Location");qe(Se,"Expected a Location header on the redirect Response"),Se=Ty(Se,new URL(ee.url),c);let xe=bl(T.location,Se,{_isRedirect:!0});if(i){let mt=!1;if(oe.response.headers.has("X-Remix-Reload-Document"))mt=!0;else if(ph(Se)){const St=JS(Se,!0);mt=St.origin!==n.location.origin||ir(St.pathname,c)==null}if(mt){Ee?n.location.replace(Se):n.location.assign(Se);return}}z=null;let Me=Ee===!0||oe.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Oe,formAction:ke,formEncType:We}=T.navigation;!ye&&!be&&Oe&&ke&&We&&(ye=Ny(T.navigation));let ot=ye||be;if(NA.has(oe.response.status)&&ot&&gn(ot.formMethod))await Be(Me,xe,{submission:{...ot,formAction:Se},preventScrollReset:De||q,enableViewTransition:fe?I:void 0});else{let mt=Zd(xe,ye);await Be(Me,xe,{overrideNavigation:mt,fetcherSubmission:be,preventScrollReset:De||q,enableViewTransition:fe?I:void 0})}}async function Et(ee,oe,fe,ye){let be,De={};try{be=await VA(v,ee,oe,ye,fe,!1)}catch(Ee){return oe.filter(Se=>Se.shouldLoad).forEach(Se=>{De[Se.route.id]={type:"error",error:Ee}}),De}if(ee.signal.aborted)return De;for(let[Ee,Se]of Object.entries(be))if(eT(Se)){let xe=Se.result;De[Ee]={type:"redirect",response:KA(xe,ee,Ee,oe,c)}}else De[Ee]=await YA(Se);return De}async function Kt(ee,oe,fe,ye){let be=Et(fe,ee,ye,null),De=Promise.all(oe.map(async xe=>{if(xe.matches&&xe.match&&xe.request&&xe.controller){let Oe=(await Et(xe.request,xe.matches,ye,xe.key))[xe.match.route.id];return{[xe.key]:Oe}}else return Promise.resolve({[xe.key]:{type:"error",error:er(404,{pathname:xe.path})}})})),Ee=await be,Se=(await De).reduce((xe,Me)=>Object.assign(xe,Me),{});return{loaderResults:Ee,fetcherResults:Se}}function an(){H=!0,Q.forEach((ee,oe)=>{F.has(oe)&&K.add(oe),_t(oe)})}function gt(ee,oe,fe={}){T.fetchers.set(ee,oe),le({fetchers:new Map(T.fetchers)},{flushSync:(fe&&fe.flushSync)===!0})}function Gt(ee,oe,fe,ye={}){let be=ts(T.matches,oe);st(ee),le({errors:{[be.route.id]:fe},fetchers:new Map(T.fetchers)},{flushSync:(ye&&ye.flushSync)===!0})}function Xt(ee){return J.set(ee,(J.get(ee)||0)+1),ae.has(ee)&&ae.delete(ee),T.fetchers.get(ee)||BA}function sr(ee,oe){_t(ee,oe?.reason),gt(ee,gi(null))}function st(ee){let oe=T.fetchers.get(ee);F.has(ee)&&!(oe&&oe.state==="loading"&&B.has(ee))&&_t(ee),Q.delete(ee),B.delete(ee),P.delete(ee),ae.delete(ee),K.delete(ee),T.fetchers.delete(ee)}function or(ee){let oe=(J.get(ee)||0)-1;oe<=0?(J.delete(ee),ae.add(ee)):J.set(ee,oe),le({fetchers:new Map(T.fetchers)})}function _t(ee,oe){let fe=F.get(ee);fe&&(fe.abort(oe),F.delete(ee))}function Ln(ee){for(let oe of ee){let fe=Xt(oe),ye=gi(fe.data);T.fetchers.set(oe,ye)}}function Qt(){let ee=[],oe=!1;for(let fe of P){let ye=T.fetchers.get(fe);qe(ye,`Expected fetcher: ${fe}`),ye.state==="loading"&&(P.delete(fe),ee.push(fe),oe=!0)}return Ln(ee),oe}function eo(ee){let oe=[];for(let[fe,ye]of B)if(ye<ee){let be=T.fetchers.get(fe);qe(be,`Expected fetcher: ${fe}`),be.state==="loading"&&(_t(fe),B.delete(fe),oe.push(fe))}return Ln(oe),oe.length>0}function fa(ee,oe){let fe=T.blockers.get(ee)||sl;return Z.get(ee)!==oe&&Z.set(ee,oe),fe}function to(ee){T.blockers.delete(ee),Z.delete(ee)}function ar(ee,oe){let fe=T.blockers.get(ee)||sl;qe(fe.state==="unblocked"&&oe.state==="blocked"||fe.state==="blocked"&&oe.state==="blocked"||fe.state==="blocked"&&oe.state==="proceeding"||fe.state==="blocked"&&oe.state==="unblocked"||fe.state==="proceeding"&&oe.state==="unblocked",`Invalid blocker state transition: ${fe.state} -> ${oe.state}`);let ye=new Map(T.blockers);ye.set(ee,oe),le({blockers:ye})}function Wr({currentLocation:ee,nextLocation:oe,historyAction:fe}){if(Z.size===0)return;Z.size>1&&Ot(!1,"A router only supports one blocker at a time");let ye=Array.from(Z.entries()),[be,De]=ye[ye.length-1],Ee=T.blockers.get(be);if(!(Ee&&Ee.state==="proceeding")&&De({currentLocation:ee,nextLocation:oe,historyAction:fe}))return be}function wr(ee){let oe=er(404,{pathname:ee}),fe=u||l,{matches:ye,route:be}=uu(fe);return{notFoundMatches:ye,route:be,error:oe}}function lr(ee,oe,fe){if(C=ee,p=oe,S=fe||null,!g&&T.navigation===Qd){g=!0;let ye=no(T.location,T.matches);ye!=null&&le({restoreScrollPosition:ye})}return()=>{C=null,p=null,S=null}}function Yr(ee,oe){return S&&S(ee,oe.map(ye=>sA(ye,T.loaderData)))||ee.key}function Kr(ee,oe){if(C&&p){let fe=Yr(ee,oe);C[fe]=p()}}function no(ee,oe){if(C){let fe=Yr(ee,oe),ye=C[fe];if(typeof ye=="number")return ye}return null}function Gr(ee,oe,fe){if(e.patchRoutesOnNavigation)if(ee){if(Object.keys(ee[0].params).length>0)return{active:!0,matches:fl(oe,fe,c,!0)}}else return{active:!0,matches:fl(oe,fe,c,!0)||[]};return{active:!1,matches:null}}async function Cr(ee,oe,fe,ye){if(!e.patchRoutesOnNavigation)return{type:"success",matches:ee};let be=ee;for(;;){let De=u==null,Ee=u||l,Se=d;try{await e.patchRoutesOnNavigation({signal:fe,path:oe,matches:be,fetcherKey:ye,patch:(Oe,ke)=>{fe.aborted||Cy(Oe,ke,Ee,Se,f,!1)}})}catch(Oe){return{type:"error",error:Oe,partialMatches:be}}finally{De&&!fe.aborted&&(l=[...l])}if(fe.aborted)return{type:"aborted"};let xe=es(Ee,oe,c),Me=null;if(xe){if(Object.keys(xe[0].params).length===0)return{type:"success",matches:xe};if(Me=fl(Ee,oe,c,!0),!(Me&&be.length<Me.length&&Er(be,Me.slice(0,be.length))))return{type:"success",matches:xe}}if(Me||(Me=fl(Ee,oe,c,!0)),!Me||Er(be,Me))return{type:"success",matches:null};be=Me}}function Er(ee,oe){return ee.length===oe.length&&ee.every((fe,ye)=>fe.route.id===oe[ye].route.id)}function da(ee){d={},u=Sl(ee,f,void 0,d)}function ro(ee,oe,fe=!1){let ye=u==null;Cy(ee,oe,u||l,d,f,fe),ye&&(l=[...l],le({}))}return O={get basename(){return c},get future(){return m},get state(){return T},get routes(){return l},get window(){return n},initialize:ie,subscribe:re,enableScrollRestoration:lr,navigate:Ce,fetch:hn,revalidate:He,createHref:ee=>e.history.createHref(ee),encodeLocation:ee=>e.history.encodeLocation(ee),getFetcher:Xt,resetFetcher:sr,deleteFetcher:or,dispose:de,getBlocker:fa,deleteBlocker:to,patchRoutes:ro,_internalFetchControllers:F,_internalSetRoutes:da,_internalSetStateDoNotUseOrYouWillBreakYourApp(ee){le(ee)}},e.unstable_instrumentations&&(O=EA(O,e.unstable_instrumentations.map(ee=>ee.router).filter(Boolean))),O}function zA(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function km(e,n,i,s,a,f){let d,l;if(a){d=[];for(let c of n)if(d.push(c),c.route.id===a){l=c;break}}else d=n,l=n[n.length-1];let u=pp(s||".",mp(d),ir(e.pathname,i)||e.pathname,f==="path");if(s==null&&(u.search=e.search,u.hash=e.hash),(s==null||s===""||s===".")&&l){let c=vp(u.search);if(l.route.index&&!c)u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index";else if(!l.route.index&&c){let v=new URLSearchParams(u.search),m=v.getAll("index");v.delete("index"),m.filter(x=>x).forEach(x=>v.append("index",x));let _=v.toString();u.search=_?`?${_}`:""}}return i!=="/"&&(u.pathname=_A({basename:i,pathname:u.pathname})),Ir(u)}function xy(e,n,i){if(!i||!zA(i))return{path:n};if(i.formMethod&&!tT(i.formMethod))return{path:n,error:er(405,{method:i.formMethod})};let s=()=>({path:n,error:er(400,{type:"invalid-body"})}),f=(i.formMethod||"get").toUpperCase(),d=fx(n);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!gn(f))return s();let m=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((_,[x,C])=>`${_}${x}=${C}
10
+ `,""):String(i.body);return{path:n,submission:{formMethod:f,formAction:d,formEncType:i.formEncType,formData:void 0,json:void 0,text:m}}}else if(i.formEncType==="application/json"){if(!gn(f))return s();try{let m=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:n,submission:{formMethod:f,formAction:d,formEncType:i.formEncType,formData:void 0,json:m,text:void 0}}}catch{return s()}}}qe(typeof FormData=="function","FormData is not available in this environment");let l,u;if(i.formData)l=jm(i.formData),u=i.formData;else if(i.body instanceof FormData)l=jm(i.body),u=i.body;else if(i.body instanceof URLSearchParams)l=i.body,u=My(l);else if(i.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(i.body),u=My(l)}catch{return s()}let c={formMethod:f,formAction:d,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(gn(c.formMethod))return{path:n,submission:c};let v=us(n);return e&&v.search&&vp(v.search)&&l.append("index",""),v.search=`?${l}`,{path:Ir(v),submission:c}}function wy(e,n,i,s,a,f,d,l,u,c,v,m,_,x,C,S,p,g,b,y){let E=y?Un(y[1])?y[1].error:y[1].data:void 0,M=a.createURL(f.location),O=a.createURL(u),T;if(v&&f.errors){let U=Object.keys(f.errors)[0];T=d.findIndex(G=>G.route.id===U)}else if(y&&Un(y[1])){let U=y[0];T=d.findIndex(G=>G.route.id===U)-1}let A=y?y[1].statusCode:void 0,k=A&&A>=400,q={currentUrl:M,currentParams:f.matches[0]?.params||{},nextUrl:O,nextParams:d[0].params,...l,actionResult:E,actionStatus:A},z=zl(d),I=d.map((U,G)=>{let{route:H}=U,K=null;if(T!=null&&G>T?K=!1:H.lazy?K=!0:gp(H)?v?K=Nm(H,f.loaderData,f.errors):PA(f.loaderData,f.matches[G],U)&&(K=!0):K=!1,K!==null)return Bm(i,s,e,z,U,c,n,K);let F=k?!1:m||M.pathname+M.search===O.pathname+O.search||M.search!==O.search||IA(f.matches[G],U),N={...q,defaultShouldRevalidate:F},$=Wu(U,N);return Bm(i,s,e,z,U,c,n,$,N)}),W=[];return C.forEach((U,G)=>{if(v||!d.some(Q=>Q.route.id===U.routeId)||x.has(G))return;let H=f.fetchers.get(G),K=H&&H.state!=="idle"&&H.data===void 0,F=es(p,U.path,g);if(!F){if(b&&K)return;W.push({key:G,routeId:U.routeId,path:U.path,matches:null,match:null,request:null,controller:null});return}if(S.has(G))return;let N=Lu(F,U.path),$=new AbortController,B=$o(a,U.path,$.signal),P=null;if(_.has(G))_.delete(G),P=Yo(i,s,B,F,N,c,n);else if(K)m&&(P=Yo(i,s,B,F,N,c,n));else{let Q={...q,defaultShouldRevalidate:k?!1:m};Wu(N,Q)&&(P=Yo(i,s,B,F,N,c,n,Q))}P&&W.push({key:G,routeId:U.routeId,path:U.path,matches:P,match:N,request:B,controller:$})}),{dsMatches:I,revalidatingFetchers:W}}function gp(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Nm(e,n,i){if(e.lazy)return!0;if(!gp(e))return!1;let s=n!=null&&e.id in n,a=i!=null&&i[e.id]!==void 0;return!s&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!s&&!a}function PA(e,n,i){let s=!n||i.route.id!==n.route.id,a=!e.hasOwnProperty(i.route.id);return s||a}function IA(e,n){let i=e.route.path;return e.pathname!==n.pathname||i!=null&&i.endsWith("*")&&e.params["*"]!==n.params["*"]}function Wu(e,n){if(e.route.shouldRevalidate){let i=e.route.shouldRevalidate(n);if(typeof i=="boolean")return i}return n.defaultShouldRevalidate}function Cy(e,n,i,s,a,f){let d;if(e){let c=s[e];qe(c,`No route found to patch children into: routeId = ${e}`),c.children||(c.children=[]),d=c.children}else d=i;let l=[],u=[];if(n.forEach(c=>{let v=d.find(m=>ax(c,m));v?u.push({existingRoute:v,newRoute:c}):l.push(c)}),l.length>0){let c=Sl(l,a,[e||"_","patch",String(d?.length||"0")],s);d.push(...c)}if(f&&u.length>0)for(let c=0;c<u.length;c++){let{existingRoute:v,newRoute:m}=u[c],_=v,[x]=Sl([m],a,[],{},!0);Object.assign(_,{element:x.element?x.element:_.element,errorElement:x.errorElement?x.errorElement:_.errorElement,hydrateFallbackElement:x.hydrateFallbackElement?x.hydrateFallbackElement:_.hydrateFallbackElement})}}function ax(e,n){return"id"in e&&"id"in n&&e.id===n.id?!0:e.index===n.index&&e.path===n.path&&e.caseSensitive===n.caseSensitive?(!e.children||e.children.length===0)&&(!n.children||n.children.length===0)?!0:e.children.every((i,s)=>n.children?.some(a=>ax(i,a))):!1}var Ey=new WeakMap,lx=({key:e,route:n,manifest:i,mapRouteProperties:s})=>{let a=i[n.id];if(qe(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let f=a.lazy[e];if(!f)return;let d=Ey.get(a);d||(d={},Ey.set(a,d));let l=d[e];if(l)return l;let u=(async()=>{let c=tA(e),m=a[e]!==void 0&&e!=="hasErrorBoundary";if(c)Ot(!c,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),d[e]=Promise.resolve();else if(m)Ot(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let _=await f();_!=null&&(Object.assign(a,{[e]:_}),Object.assign(a,s(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(_=>_===void 0)&&(a.lazy=void 0))})();return d[e]=u,u},Ry=new WeakMap;function UA(e,n,i,s,a){let f=i[e.id];if(qe(f,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let v=Ry.get(f);if(v)return{lazyRoutePromise:v,lazyHandlerPromise:v};let m=(async()=>{qe(typeof e.lazy=="function","No lazy route function found");let _=await e.lazy(),x={};for(let C in _){let S=_[C];if(S===void 0)continue;let p=rA(C),b=f[C]!==void 0&&C!=="hasErrorBoundary";p?Ot(!p,"Route property "+C+" is not a supported property to be returned from a lazy route function. This property will be ignored."):b?Ot(!b,`Route "${f.id}" has a static property "${C}" defined but its lazy function is also returning a value for this property. The lazy route property "${C}" will be ignored.`):x[C]=S}Object.assign(f,x),Object.assign(f,{...s(f),lazy:void 0})})();return Ry.set(f,m),m.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:m}}let d=Object.keys(e.lazy),l=[],u;for(let v of d){if(a&&a.includes(v))continue;let m=lx({key:v,route:e,manifest:i,mapRouteProperties:s});m&&(l.push(m),v===n&&(u=m))}let c=l.length>0?Promise.all(l).then(()=>{}):void 0;return c?.catch(()=>{}),u?.catch(()=>{}),{lazyRoutePromise:c,lazyHandlerPromise:u}}async function Ay(e){let n=e.matches.filter(a=>a.shouldLoad),i={};return(await Promise.all(n.map(a=>a.resolve()))).forEach((a,f)=>{i[n[f].route.id]=a}),i}async function FA(e){return e.matches.some(n=>n.route.middleware)?cx(e,()=>Ay(e)):Ay(e)}function cx(e,n){return $A(e,n,s=>s,ZA,i);function i(s,a,f){if(f)return Promise.resolve(Object.assign(f.value,{[a]:{type:"error",result:s}}));{let{matches:d}=e,l=Math.min(Math.max(d.findIndex(c=>c.route.id===a),0),Math.max(d.findIndex(c=>c.shouldCallHandler()),0)),u=ts(d,d[l].route.id).route.id;return Promise.resolve({[u]:{type:"error",result:s}})}}}async function $A(e,n,i,s,a){let{matches:f,request:d,params:l,context:u,unstable_pattern:c}=e,v=f.flatMap(_=>_.route.middleware?_.route.middleware.map(x=>[_.route.id,x]):[]);return await ux({request:d,params:l,context:u,unstable_pattern:c},v,n,i,s,a)}async function ux(e,n,i,s,a,f,d=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason??new Error(`Request aborted: ${l.method} ${l.url}`);let u=n[d];if(!u)return await i();let[c,v]=u,m,_=async()=>{if(m)throw new Error("You may only call `next()` once per middleware");try{return m={value:await ux(e,n,i,s,a,f,d+1)},m.value}catch(x){return m={value:await f(x,c,m)},m.value}};try{let x=await v(e,_),C=x!=null?s(x):void 0;return a(C)?C:m?C??m.value:(m={value:await _()},m.value)}catch(x){return await f(x,c,m)}}function hx(e,n,i,s,a){let f=lx({key:"middleware",route:s.route,manifest:n,mapRouteProperties:e}),d=UA(s.route,gn(i.method)?"action":"loader",n,e,a);return{middleware:f,route:d.lazyRoutePromise,handler:d.lazyHandlerPromise}}function Bm(e,n,i,s,a,f,d,l,u=null){let c=!1,v=hx(e,n,i,a,f);return{...a,_lazyPromises:v,shouldLoad:l,shouldRevalidateArgs:u,shouldCallHandler(m){return c=!0,u?typeof m=="boolean"?Wu(a,{...u,defaultShouldRevalidate:m}):Wu(a,u):l},resolve(m){let{lazy:_,loader:x,middleware:C}=a.route,S=c||l||m&&!gn(i.method)&&(_||x),p=C&&C.length>0&&!x&&!_;return S&&(gn(i.method)||!p)?qA({request:i,unstable_pattern:s,match:a,lazyHandlerPromise:v?.handler,lazyRoutePromise:v?.route,handlerOverride:m,scopedContext:d}):Promise.resolve({type:"data",result:void 0})}}}function Yo(e,n,i,s,a,f,d,l=null){return s.map(u=>u.route.id!==a.route.id?{...u,shouldLoad:!1,shouldRevalidateArgs:l,shouldCallHandler:()=>!1,_lazyPromises:hx(e,n,i,u,f),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Bm(e,n,i,zl(s),u,f,d,!0,l))}async function VA(e,n,i,s,a,f){i.some(c=>c._lazyPromises?.middleware)&&await Promise.all(i.map(c=>c._lazyPromises?.middleware));let d={request:n,unstable_pattern:zl(i),params:i[0].params,context:a,matches:i},u=await e({...d,fetcherKey:s,runClientMiddleware:c=>{let v=d;return cx(v,()=>c({...v,fetcherKey:s,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(i.flatMap(c=>[c._lazyPromises?.handler,c._lazyPromises?.route]))}catch{}return u}async function qA({request:e,unstable_pattern:n,match:i,lazyHandlerPromise:s,lazyRoutePromise:a,handlerOverride:f,scopedContext:d}){let l,u,c=gn(e.method),v=c?"action":"loader",m=_=>{let x,C=new Promise((g,b)=>x=b);u=()=>x(),e.signal.addEventListener("abort",u);let S=g=>typeof _!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${v}" [routeId: ${i.route.id}]`)):_({request:e,unstable_pattern:n,params:i.params,context:d},...g!==void 0?[g]:[]),p=(async()=>{try{return{type:"data",result:await(f?f(b=>S(b)):S())}}catch(g){return{type:"error",result:g}}})();return Promise.race([p,C])};try{let _=c?i.route.action:i.route.loader;if(s||a)if(_){let x,[C]=await Promise.all([m(_).catch(S=>{x=S}),s,a]);if(x!==void 0)throw x;l=C}else{await s;let x=c?i.route.action:i.route.loader;if(x)[l]=await Promise.all([m(x),a]);else if(v==="action"){let C=new URL(e.url),S=C.pathname+C.search;throw er(405,{method:e.method,pathname:S,routeId:i.route.id})}else return{type:"data",result:void 0}}else if(_)l=await m(_);else{let x=new URL(e.url),C=x.pathname+x.search;throw er(404,{pathname:C})}}catch(_){return{type:"error",result:_}}finally{u&&e.signal.removeEventListener("abort",u)}return l}async function WA(e){let n=e.headers.get("Content-Type");return n&&/\bapplication\/json\b/.test(n)?e.body==null?null:e.json():e.text()}async function YA(e){let{result:n,type:i}=e;if(dx(n)){let s;try{s=await WA(n)}catch(a){return{type:"error",error:a}}return i==="error"?{type:"error",error:new gh(n.status,n.statusText,s),statusCode:n.status,headers:n.headers}:{type:"data",data:s,statusCode:n.status,headers:n.headers}}return i==="error"?ky(n)?n.data instanceof Error?{type:"error",error:n.data,statusCode:n.init?.status,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"error",error:QA(n),statusCode:xl(n)?n.status:void 0,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"error",error:n,statusCode:xl(n)?n.status:void 0}:ky(n)?{type:"data",data:n.data,statusCode:n.init?.status,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"data",data:n}}function KA(e,n,i,s,a){let f=e.headers.get("Location");if(qe(f,"Redirects returned/thrown from loaders/actions must have a Location header"),!ph(f)){let d=s.slice(0,s.findIndex(l=>l.route.id===i)+1);f=km(new URL(n.url),d,a,f),e.headers.set("Location",f)}return e}function Ty(e,n,i){if(ph(e)){let s=e,a=s.startsWith("//")?new URL(n.protocol+s):new URL(s),f=ir(a.pathname,i)!=null;if(a.origin===n.origin&&f)return a.pathname+a.search+a.hash}return e}function $o(e,n,i,s){let a=e.createURL(fx(n)).toString(),f={signal:i};if(s&&gn(s.formMethod)){let{formMethod:d,formEncType:l}=s;f.method=d.toUpperCase(),l==="application/json"?(f.headers=new Headers({"Content-Type":l}),f.body=JSON.stringify(s.json)):l==="text/plain"?f.body=s.text:l==="application/x-www-form-urlencoded"&&s.formData?f.body=jm(s.formData):f.body=s.formData}return new Request(a,f)}function jm(e){let n=new URLSearchParams;for(let[i,s]of e.entries())n.append(i,typeof s=="string"?s:s.name);return n}function My(e){let n=new FormData;for(let[i,s]of e.entries())n.append(i,s);return n}function GA(e,n,i,s=!1,a=!1){let f={},d=null,l,u=!1,c={},v=i&&Un(i[1])?i[1].error:void 0;return e.forEach(m=>{if(!(m.route.id in n))return;let _=m.route.id,x=n[_];if(qe(!Bs(x),"Cannot handle redirect results in processLoaderData"),Un(x)){let C=x.error;if(v!==void 0&&(C=v,v=void 0),d=d||{},a)d[_]=C;else{let S=ts(e,_);d[S.route.id]==null&&(d[S.route.id]=C)}s||(f[_]=ox),u||(u=!0,l=xl(x.error)?x.error.status:500),x.headers&&(c[_]=x.headers)}else f[_]=x.data,x.statusCode&&x.statusCode!==200&&!u&&(l=x.statusCode),x.headers&&(c[_]=x.headers)}),v!==void 0&&i&&(d={[i[0]]:v},i[2]&&(f[i[2]]=void 0)),{loaderData:f,errors:d,statusCode:l||200,loaderHeaders:c}}function Dy(e,n,i,s,a,f){let{loaderData:d,errors:l}=GA(n,i,s);return a.filter(u=>!u.matches||u.matches.some(c=>c.shouldLoad)).forEach(u=>{let{key:c,match:v,controller:m}=u;if(m&&m.signal.aborted)return;let _=f[c];if(qe(_,"Did not find corresponding fetcher result"),Un(_)){let x=ts(e.matches,v?.route.id);l&&l[x.route.id]||(l={...l,[x.route.id]:_.error}),e.fetchers.delete(c)}else if(Bs(_))qe(!1,"Unhandled fetcher revalidation redirect");else{let x=gi(_.data);e.fetchers.set(c,x)}}),{loaderData:d,errors:l}}function Oy(e,n,i,s){let a=Object.entries(n).filter(([,f])=>f!==ox).reduce((f,[d,l])=>(f[d]=l,f),{});for(let f of i){let d=f.route.id;if(!n.hasOwnProperty(d)&&e.hasOwnProperty(d)&&f.route.loader&&(a[d]=e[d]),s&&s.hasOwnProperty(d))break}return a}function Ly(e){return e?Un(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ts(e,n){return(n?e.slice(0,e.findIndex(s=>s.route.id===n)+1):[...e]).reverse().find(s=>s.route.hasErrorBoundary===!0)||e[0]}function uu(e){let n=e.length===1?e[0]:e.find(i=>i.index||!i.path||i.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:n}],route:n}}function er(e,{pathname:n,routeId:i,method:s,type:a,message:f}={}){let d="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(d="Bad Request",s&&n&&i?l=`You made a ${s} request to "${n}" but did not provide a \`loader\` for route "${i}", so there is no way to handle the request.`:a==="invalid-body"&&(l="Unable to encode submission body")):e===403?(d="Forbidden",l=`Route "${i}" does not match URL "${n}"`):e===404?(d="Not Found",l=`No route matches URL "${n}"`):e===405&&(d="Method Not Allowed",s&&n&&i?l=`You made a ${s.toUpperCase()} request to "${n}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:s&&(l=`Invalid request method "${s.toUpperCase()}"`)),new gh(e||500,d,new Error(l),!0)}function hu(e){let n=Object.entries(e);for(let i=n.length-1;i>=0;i--){let[s,a]=n[i];if(Bs(a))return{key:s,result:a}}}function fx(e){let n=typeof e=="string"?us(e):e;return Ir({...n,hash:""})}function XA(e,n){return e.pathname!==n.pathname||e.search!==n.search?!1:e.hash===""?n.hash!=="":e.hash===n.hash?!0:n.hash!==""}function QA(e){return new gh(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function ZA(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([n,i])=>typeof n=="string"&&JA(i))}function JA(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function eT(e){return dx(e.result)&&kA.has(e.result.status)}function Un(e){return e.type==="error"}function Bs(e){return(e&&e.type)==="redirect"}function ky(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function dx(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function tT(e){return LA.has(e.toUpperCase())}function gn(e){return DA.has(e.toUpperCase())}function vp(e){return new URLSearchParams(e).getAll("index").some(n=>n==="")}function Lu(e,n){let i=typeof n=="string"?us(n).search:n.search;if(e[e.length-1].route.index&&vp(i||""))return e[e.length-1];let s=nx(e);return s[s.length-1]}function Ny(e){let{formMethod:n,formAction:i,formEncType:s,text:a,formData:f,json:d}=e;if(!(!n||!i||!s)){if(a!=null)return{formMethod:n,formAction:i,formEncType:s,formData:void 0,json:void 0,text:a};if(f!=null)return{formMethod:n,formAction:i,formEncType:s,formData:f,json:void 0,text:void 0};if(d!==void 0)return{formMethod:n,formAction:i,formEncType:s,formData:void 0,json:d,text:void 0}}}function Zd(e,n){return n?{state:"loading",location:e,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function nT(e,n){return{state:"submitting",location:e,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}}function ol(e,n){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:n}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function rT(e,n){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:n?n.data:void 0}}function gi(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function iT(e,n){try{let i=e.sessionStorage.getItem(sx);if(i){let s=JSON.parse(i);for(let[a,f]of Object.entries(s||{}))f&&Array.isArray(f)&&n.set(a,new Set(f||[]))}}catch{}}function sT(e,n){if(n.size>0){let i={};for(let[s,a]of n)i[s]=[...a];try{e.sessionStorage.setItem(sx,JSON.stringify(i))}catch(s){Ot(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function By(){let e,n,i=new Promise((s,a)=>{e=async f=>{s(f);try{await i}catch{}},n=async f=>{a(f);try{await i}catch{}}});return{promise:i,resolve:e,reject:n}}var Qs=L.createContext(null);Qs.displayName="DataRouter";var Pl=L.createContext(null);Pl.displayName="DataRouterState";L.createContext(!1);var _p=L.createContext({isTransitioning:!1});_p.displayName="ViewTransition";var mx=L.createContext(new Map);mx.displayName="Fetchers";var oT=L.createContext(null);oT.displayName="Await";var Sr=L.createContext(null);Sr.displayName="Navigation";var vh=L.createContext(null);vh.displayName="Location";var $r=L.createContext({outlet:null,matches:[],isDataRoute:!1});$r.displayName="Route";var yp=L.createContext(null);yp.displayName="RouteError";function aT(e,{relative:n}={}){qe(Il(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:s}=L.useContext(Sr),{hash:a,pathname:f,search:d}=Ul(e,{relative:n}),l=f;return i!=="/"&&(l=f==="/"?i:Hr([i,f])),s.createHref({pathname:l,search:d,hash:a})}function Il(){return L.useContext(vh)!=null}function Zs(){return qe(Il(),"useLocation() may be used only in the context of a <Router> component."),L.useContext(vh).location}var px="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function gx(e){L.useContext(Sr).static||L.useLayoutEffect(e)}function lT(){let{isDataRoute:e}=L.useContext($r);return e?xT():cT()}function cT(){qe(Il(),"useNavigate() may be used only in the context of a <Router> component.");let e=L.useContext(Qs),{basename:n,navigator:i}=L.useContext(Sr),{matches:s}=L.useContext($r),{pathname:a}=Zs(),f=JSON.stringify(mp(s)),d=L.useRef(!1);return gx(()=>{d.current=!0}),L.useCallback((u,c={})=>{if(Ot(d.current,px),!d.current)return;if(typeof u=="number"){i.go(u);return}let v=pp(u,JSON.parse(f),a,c.relative==="path");e==null&&n!=="/"&&(v.pathname=v.pathname==="/"?n:Hr([n,v.pathname])),(c.replace?i.replace:i.push)(v,c.state,c)},[n,i,f,a,e])}L.createContext(null);function uT(){let{matches:e}=L.useContext($r),n=e[e.length-1];return n?n.params:{}}function Ul(e,{relative:n}={}){let{matches:i}=L.useContext($r),{pathname:s}=Zs(),a=JSON.stringify(mp(i));return L.useMemo(()=>pp(e,JSON.parse(a),s,n==="path"),[e,a,s,n])}function hT(e,n,i,s,a){qe(Il(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:f}=L.useContext(Sr),{matches:d}=L.useContext($r),l=d[d.length-1],u=l?l.params:{},c=l?l.pathname:"/",v=l?l.pathnameBase:"/",m=l&&l.route;{let b=m&&m.path||"";vx(c,!m||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${b}">) 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.
11
+
12
+ Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let _=Zs(),x;x=_;let C=x.pathname||"/",S=C;if(v!=="/"){let b=v.replace(/^\//,"").split("/");S="/"+C.replace(/^\//,"").split("/").slice(b.length).join("/")}let p=es(e,{pathname:S});return Ot(m||p!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Ot(p==null||p[p.length-1].route.element!==void 0||p[p.length-1].route.Component!==void 0||p[p.length-1].route.lazy!==void 0,`Matched leaf route at location "${x.pathname}${x.search}${x.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.`),gT(p&&p.map(b=>Object.assign({},b,{params:Object.assign({},u,b.params),pathname:Hr([v,f.encodeLocation?f.encodeLocation(b.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?v:Hr([v,f.encodeLocation?f.encodeLocation(b.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:b.pathnameBase])})),d,i,s,a)}function fT(){let e=ST(),n=xl(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),i=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:s},f={padding:"2px 4px",backgroundColor:s},d=null;return console.error("Error handled by React Router default ErrorBoundary:",e),d=L.createElement(L.Fragment,null,L.createElement("p",null,"💿 Hey developer 👋"),L.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",L.createElement("code",{style:f},"ErrorBoundary")," or"," ",L.createElement("code",{style:f},"errorElement")," prop on your route.")),L.createElement(L.Fragment,null,L.createElement("h2",null,"Unexpected Application Error!"),L.createElement("h3",{style:{fontStyle:"italic"}},n),i?L.createElement("pre",{style:a},i):null,d)}var dT=L.createElement(fT,null),mT=class extends L.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,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?L.createElement($r.Provider,{value:this.props.routeContext},L.createElement(yp.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function pT({routeContext:e,match:n,children:i}){let s=L.useContext(Qs);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),L.createElement($r.Provider,{value:e},i)}function gT(e,n=[],i=null,s=null,a=null){if(e==null){if(!i)return null;if(i.errors)e=i.matches;else if(n.length===0&&!i.initialized&&i.matches.length>0)e=i.matches;else return null}let f=e,d=i?.errors;if(d!=null){let v=f.findIndex(m=>m.route.id&&d?.[m.route.id]!==void 0);qe(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),f=f.slice(0,Math.min(f.length,v+1))}let l=!1,u=-1;if(i)for(let v=0;v<f.length;v++){let m=f[v];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(u=v),m.route.id){let{loaderData:_,errors:x}=i,C=m.route.loader&&!_.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||C){l=!0,u>=0?f=f.slice(0,u+1):f=[f[0]];break}}}let c=i&&s?(v,m)=>{s(v,{location:i.location,params:i.matches?.[0]?.params??{},unstable_pattern:zl(i.matches),errorInfo:m})}:void 0;return f.reduceRight((v,m,_)=>{let x,C=!1,S=null,p=null;i&&(x=d&&m.route.id?d[m.route.id]:void 0,S=m.route.errorElement||dT,l&&(u<0&&_===0?(vx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,p=null):u===_&&(C=!0,p=m.route.hydrateFallbackElement||null)));let g=n.concat(f.slice(0,_+1)),b=()=>{let y;return x?y=S:C?y=p:m.route.Component?y=L.createElement(m.route.Component,null):m.route.element?y=m.route.element:y=v,L.createElement(pT,{match:m,routeContext:{outlet:v,matches:g,isDataRoute:i!=null},children:y})};return i&&(m.route.ErrorBoundary||m.route.errorElement||_===0)?L.createElement(mT,{location:i.location,revalidation:i.revalidation,component:S,error:x,children:b(),routeContext:{outlet:null,matches:g,isDataRoute:!0},onError:c}):b()},null)}function bp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function vT(e){let n=L.useContext(Qs);return qe(n,bp(e)),n}function _T(e){let n=L.useContext(Pl);return qe(n,bp(e)),n}function yT(e){let n=L.useContext($r);return qe(n,bp(e)),n}function Sp(e){let n=yT(e),i=n.matches[n.matches.length-1];return qe(i.route.id,`${e} can only be used on routes that contain a unique "id"`),i.route.id}function bT(){return Sp("useRouteId")}function ST(){let e=L.useContext(yp),n=_T("useRouteError"),i=Sp("useRouteError");return e!==void 0?e:n.errors?.[i]}function xT(){let{router:e}=vT("useNavigate"),n=Sp("useNavigate"),i=L.useRef(!1);return gx(()=>{i.current=!0}),L.useCallback(async(a,f={})=>{Ot(i.current,px),i.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:n,...f}))},[e,n])}var jy={};function vx(e,n,i){!n&&!jy[e]&&(jy[e]=!0,Ot(!1,i))}var Hy={};function zy(e,n){!e&&!Hy[n]&&(Hy[n]=!0,console.warn(n))}var wT="useOptimistic",Py=dh[wT],CT=()=>{};function ET(e){return Py?Py(e):[e,CT]}function RT(e){let n={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Ot(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(n,{element:L.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Ot(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(n,{hydrateFallbackElement:L.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Ot(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(n,{errorElement:L.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),n}var AT=["HydrateFallback","hydrateFallbackElement"],TT=class{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=i=>{this.status==="pending"&&(this.status="resolved",e(i))},this.reject=i=>{this.status==="pending"&&(this.status="rejected",n(i))}})}};function MT({router:e,flushSync:n,unstable_onError:i,unstable_useTransitions:s}){let[a,f]=L.useState(e.state),[d,l]=ET(a),[u,c]=L.useState(),[v,m]=L.useState({isTransitioning:!1}),[_,x]=L.useState(),[C,S]=L.useState(),[p,g]=L.useState(),b=L.useRef(new Map),y=L.useCallback((T,{deletedFetchers:A,newErrors:k,flushSync:q,viewTransitionOpts:z})=>{k&&i&&Object.values(k).forEach(W=>i(W,{location:T.location,params:T.matches[0]?.params??{},unstable_pattern:zl(T.matches)})),T.fetchers.forEach((W,U)=>{W.data!==void 0&&b.current.set(U,W.data)}),A.forEach(W=>b.current.delete(W)),zy(q===!1||n!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let I=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(zy(z==null||I,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!z||!I){n&&q?n(()=>f(T)):s===!1?f(T):L.startTransition(()=>{s===!0&&l(W=>Iy(W,T)),f(T)});return}if(n&&q){n(()=>{C&&(_?.resolve(),C.skipTransition()),m({isTransitioning:!0,flushSync:!0,currentLocation:z.currentLocation,nextLocation:z.nextLocation})});let W=e.window.document.startViewTransition(()=>{n(()=>f(T))});W.finished.finally(()=>{n(()=>{x(void 0),S(void 0),c(void 0),m({isTransitioning:!1})})}),n(()=>S(W));return}C?(_?.resolve(),C.skipTransition(),g({state:T,currentLocation:z.currentLocation,nextLocation:z.nextLocation})):(c(T),m({isTransitioning:!0,flushSync:!1,currentLocation:z.currentLocation,nextLocation:z.nextLocation}))},[e.window,n,C,_,s,l,i]);L.useLayoutEffect(()=>e.subscribe(y),[e,y]),L.useEffect(()=>{v.isTransitioning&&!v.flushSync&&x(new TT)},[v]),L.useEffect(()=>{if(_&&u&&e.window){let T=u,A=_.promise,k=e.window.document.startViewTransition(async()=>{s===!1?f(T):L.startTransition(()=>{s===!0&&l(q=>Iy(q,T)),f(T)}),await A});k.finished.finally(()=>{x(void 0),S(void 0),c(void 0),m({isTransitioning:!1})}),S(k)}},[u,_,e.window,s,l]),L.useEffect(()=>{_&&u&&d.location.key===u.location.key&&_.resolve()},[_,C,d.location,u]),L.useEffect(()=>{!v.isTransitioning&&p&&(c(p.state),m({isTransitioning:!0,flushSync:!1,currentLocation:p.currentLocation,nextLocation:p.nextLocation}),g(void 0))},[v.isTransitioning,p]);let E=L.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:T=>e.navigate(T),push:(T,A,k)=>e.navigate(T,{state:A,preventScrollReset:k?.preventScrollReset}),replace:(T,A,k)=>e.navigate(T,{replace:!0,state:A,preventScrollReset:k?.preventScrollReset})}),[e]),M=e.basename||"/",O=L.useMemo(()=>({router:e,navigator:E,static:!1,basename:M,unstable_onError:i}),[e,E,M,i]);return L.createElement(L.Fragment,null,L.createElement(Qs.Provider,{value:O},L.createElement(Pl.Provider,{value:d},L.createElement(mx.Provider,{value:b.current},L.createElement(_p.Provider,{value:v},L.createElement(LT,{basename:M,location:d.location,navigationType:d.historyAction,navigator:E,unstable_useTransitions:s===!0},L.createElement(DT,{routes:e.routes,future:e.future,state:d,unstable_onError:i})))))),null)}function Iy(e,n){return{...e,navigation:n.navigation.state!=="idle"?n.navigation:e.navigation,revalidation:n.revalidation!=="idle"?n.revalidation:e.revalidation,actionData:n.navigation.state!=="submitting"?n.actionData:e.actionData,fetchers:n.fetchers}}var DT=L.memo(OT);function OT({routes:e,future:n,state:i,unstable_onError:s}){return hT(e,void 0,i,s,n)}function LT({basename:e="/",children:n=null,location:i,navigationType:s="POP",navigator:a,static:f=!1,unstable_useTransitions:d}){qe(!Il(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),u=L.useMemo(()=>({basename:l,navigator:a,static:f,unstable_useTransitions:d,future:{}}),[l,a,f,d]);typeof i=="string"&&(i=us(i));let{pathname:c="/",search:v="",hash:m="",state:_=null,key:x="default"}=i,C=L.useMemo(()=>{let S=ir(c,l);return S==null?null:{location:{pathname:S,search:v,hash:m,state:_,key:x},navigationType:s}},[l,c,v,m,_,x,s]);return Ot(C!=null,`<Router basename="${l}"> is not able to match the URL "${c}${v}${m}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:L.createElement(Sr.Provider,{value:u},L.createElement(vh.Provider,{children:n,value:C}))}var ku="get",Nu="application/x-www-form-urlencoded";function _h(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function kT(e){return _h(e)&&e.tagName.toLowerCase()==="button"}function NT(e){return _h(e)&&e.tagName.toLowerCase()==="form"}function BT(e){return _h(e)&&e.tagName.toLowerCase()==="input"}function jT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function HT(e,n){return e.button===0&&(!n||n==="_self")&&!jT(e)}var fu=null;function zT(){if(fu===null)try{new FormData(document.createElement("form"),0),fu=!1}catch{fu=!0}return fu}var PT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Jd(e){return e!=null&&!PT.has(e)?(Ot(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Nu}"`),null):e}function IT(e,n){let i,s,a,f,d;if(NT(e)){let l=e.getAttribute("action");s=l?ir(l,n):null,i=e.getAttribute("method")||ku,a=Jd(e.getAttribute("enctype"))||Nu,f=new FormData(e)}else if(kT(e)||BT(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||l.getAttribute("action");if(s=u?ir(u,n):null,i=e.getAttribute("formmethod")||l.getAttribute("method")||ku,a=Jd(e.getAttribute("formenctype"))||Jd(l.getAttribute("enctype"))||Nu,f=new FormData(l,e),!zT()){let{name:c,type:v,value:m}=e;if(v==="image"){let _=c?`${c}.`:"";f.append(`${_}x`,"0"),f.append(`${_}y`,"0")}else c&&f.append(c,m)}}else{if(_h(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=ku,s=null,a=Nu,d=e}return f&&a==="text/plain"&&(d=f,f=void 0),{action:s,method:i.toLowerCase(),encType:a,formData:f,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function xp(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function UT(e,n,i){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return s.pathname==="/"?s.pathname=`_root.${i}`:n&&ir(s.pathname,n)==="/"?s.pathname=`${n.replace(/\/$/,"")}/_root.${i}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${i}`,s}async function FT(e,n){if(e.id in n)return n[e.id];try{let i=await import(e.module);return n[e.id]=i,i}catch(i){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function $T(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 VT(e,n,i){let s=await Promise.all(e.map(async a=>{let f=n.routes[a.route.id];if(f){let d=await FT(f,i);return d.links?d.links():[]}return[]}));return KT(s.flat(1).filter($T).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function Uy(e,n,i,s,a,f){let d=(u,c)=>i[c]?u.route.id!==i[c].route.id:!0,l=(u,c)=>i[c].pathname!==u.pathname||i[c].route.path?.endsWith("*")&&i[c].params["*"]!==u.params["*"];return f==="assets"?n.filter((u,c)=>d(u,c)||l(u,c)):f==="data"?n.filter((u,c)=>{let v=s.routes[u.route.id];if(!v||!v.hasLoader)return!1;if(d(u,c)||l(u,c))return!0;if(u.route.shouldRevalidate){let m=u.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:i[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function qT(e,n,{includeHydrateFallback:i}={}){return WT(e.map(s=>{let a=n.routes[s.route.id];if(!a)return[];let f=[a.module];return a.clientActionModule&&(f=f.concat(a.clientActionModule)),a.clientLoaderModule&&(f=f.concat(a.clientLoaderModule)),i&&a.hydrateFallbackModule&&(f=f.concat(a.hydrateFallbackModule)),a.imports&&(f=f.concat(a.imports)),f}).flat(1))}function WT(e){return[...new Set(e)]}function YT(e){let n={},i=Object.keys(e).sort();for(let s of i)n[s]=e[s];return n}function KT(e,n){let i=new Set;return new Set(n),e.reduce((s,a)=>{let f=JSON.stringify(YT(a));return i.has(f)||(i.add(f),s.push({key:f,link:a})),s},[])}function _x(){let e=L.useContext(Qs);return xp(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function GT(){let e=L.useContext(Pl);return xp(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var wp=L.createContext(void 0);wp.displayName="FrameworkContext";function yx(){let e=L.useContext(wp);return xp(e,"You must render this element inside a <HydratedRouter> element"),e}function XT(e,n){let i=L.useContext(wp),[s,a]=L.useState(!1),[f,d]=L.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:c,onMouseLeave:v,onTouchStart:m}=n,_=L.useRef(null);L.useEffect(()=>{if(e==="render"&&d(!0),e==="viewport"){let S=g=>{g.forEach(b=>{d(b.isIntersecting)})},p=new IntersectionObserver(S,{threshold:.5});return _.current&&p.observe(_.current),()=>{p.disconnect()}}},[e]),L.useEffect(()=>{if(s){let S=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(S)}}},[s]);let x=()=>{a(!0)},C=()=>{a(!1),d(!1)};return i?e!=="intent"?[f,_,{}]:[f,_,{onFocus:al(l,x),onBlur:al(u,C),onMouseEnter:al(c,x),onMouseLeave:al(v,C),onTouchStart:al(m,x)}]:[!1,_,{}]}function al(e,n){return i=>{e&&e(i),i.defaultPrevented||n(i)}}function QT({page:e,...n}){let{router:i}=_x(),s=L.useMemo(()=>es(i.routes,e,i.basename),[i.routes,e,i.basename]);return s?L.createElement(JT,{page:e,matches:s,...n}):null}function ZT(e){let{manifest:n,routeModules:i}=yx(),[s,a]=L.useState([]);return L.useEffect(()=>{let f=!1;return VT(e,n,i).then(d=>{f||a(d)}),()=>{f=!0}},[e,n,i]),s}function JT({page:e,matches:n,...i}){let s=Zs(),{manifest:a,routeModules:f}=yx(),{basename:d}=_x(),{loaderData:l,matches:u}=GT(),c=L.useMemo(()=>Uy(e,n,u,a,s,"data"),[e,n,u,a,s]),v=L.useMemo(()=>Uy(e,n,u,a,s,"assets"),[e,n,u,a,s]),m=L.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let C=new Set,S=!1;if(n.forEach(g=>{let b=a.routes[g.route.id];!b||!b.hasLoader||(!c.some(y=>y.route.id===g.route.id)&&g.route.id in l&&f[g.route.id]?.shouldRevalidate||b.hasClientLoader?S=!0:C.add(g.route.id))}),C.size===0)return[];let p=UT(e,d,"data");return S&&C.size>0&&p.searchParams.set("_routes",n.filter(g=>C.has(g.route.id)).map(g=>g.route.id).join(",")),[p.pathname+p.search]},[d,l,s,a,c,n,e,f]),_=L.useMemo(()=>qT(v,a),[v,a]),x=ZT(v);return L.createElement(L.Fragment,null,m.map(C=>L.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...i})),_.map(C=>L.createElement("link",{key:C,rel:"modulepreload",href:C,...i})),x.map(({key:C,link:S})=>L.createElement("link",{key:C,nonce:i.nonce,...S})))}function eM(...e){return n=>{e.forEach(i=>{typeof i=="function"?i(n):i!=null&&(i.current=n)})}}var bx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{bx&&(window.__reactRouterVersion="7.10.1")}catch{}function tM(e,n){return HA({basename:n?.basename,getContext:n?.getContext,future:n?.future,history:QR({window:n?.window}),hydrationData:nM(),routes:e,mapRouteProperties:RT,hydrationRouteProperties:AT,dataStrategy:n?.dataStrategy,patchRoutesOnNavigation:n?.patchRoutesOnNavigation,window:n?.window,unstable_instrumentations:n?.unstable_instrumentations}).initialize()}function nM(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:rM(e.errors)}),e}function rM(e){if(!e)return null;let n=Object.entries(e),i={};for(let[s,a]of n)if(a&&a.__type==="RouteErrorResponse")i[s]=new gh(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let f=window[a.__subType];if(typeof f=="function")try{let d=new f(a.message);d.stack="",i[s]=d}catch{}}if(i[s]==null){let f=new Error(a.message);f.stack="",i[s]=f}}else i[s]=a;return i}var Sx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,pr=L.forwardRef(function({onClick:n,discover:i="render",prefetch:s="none",relative:a,reloadDocument:f,replace:d,state:l,target:u,to:c,preventScrollReset:v,viewTransition:m,..._},x){let{basename:C,unstable_useTransitions:S}=L.useContext(Sr),p=typeof c=="string"&&Sx.test(c),g,b=!1;if(typeof c=="string"&&p&&(g=c,bx))try{let q=new URL(window.location.href),z=c.startsWith("//")?new URL(q.protocol+c):new URL(c),I=ir(z.pathname,C);z.origin===q.origin&&I!=null?c=I+z.search+z.hash:b=!0}catch{Ot(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let y=aT(c,{relative:a}),[E,M,O]=XT(s,_),T=aM(c,{replace:d,state:l,target:u,preventScrollReset:v,relative:a,viewTransition:m,unstable_useTransitions:S});function A(q){n&&n(q),q.defaultPrevented||T(q)}let k=L.createElement("a",{..._,...O,href:g||y,onClick:b||f?n:A,ref:eM(x,M),target:u,"data-discover":!p&&i==="render"?"true":void 0});return E&&!p?L.createElement(L.Fragment,null,k,L.createElement(QT,{page:y})):k});pr.displayName="Link";var iM=L.forwardRef(function({"aria-current":n="page",caseSensitive:i=!1,className:s="",end:a=!1,style:f,to:d,viewTransition:l,children:u,...c},v){let m=Ul(d,{relative:c.relative}),_=Zs(),x=L.useContext(Pl),{navigator:C,basename:S}=L.useContext(Sr),p=x!=null&&fM(m)&&l===!0,g=C.encodeLocation?C.encodeLocation(m).pathname:m.pathname,b=_.pathname,y=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;i||(b=b.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&S&&(y=ir(y,S)||y);const E=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let M=b===g||!a&&b.startsWith(g)&&b.charAt(E)==="/",O=y!=null&&(y===g||!a&&y.startsWith(g)&&y.charAt(g.length)==="/"),T={isActive:M,isPending:O,isTransitioning:p},A=M?n:void 0,k;typeof s=="function"?k=s(T):k=[s,M?"active":null,O?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let q=typeof f=="function"?f(T):f;return L.createElement(pr,{...c,"aria-current":A,className:k,ref:v,style:q,to:d,viewTransition:l},typeof u=="function"?u(T):u)});iM.displayName="NavLink";var sM=L.forwardRef(({discover:e="render",fetcherKey:n,navigate:i,reloadDocument:s,replace:a,state:f,method:d=ku,action:l,onSubmit:u,relative:c,preventScrollReset:v,viewTransition:m,..._},x)=>{let{unstable_useTransitions:C}=L.useContext(Sr),S=uM(),p=hM(l,{relative:c}),g=d.toLowerCase()==="get"?"get":"post",b=typeof l=="string"&&Sx.test(l),y=E=>{if(u&&u(E),E.defaultPrevented)return;E.preventDefault();let M=E.nativeEvent.submitter,O=M?.getAttribute("formmethod")||d,T=()=>S(M||E.currentTarget,{fetcherKey:n,method:O,navigate:i,replace:a,state:f,relative:c,preventScrollReset:v,viewTransition:m});C&&i!==!1?L.startTransition(()=>T()):T()};return L.createElement("form",{ref:x,method:g,action:p,onSubmit:s?u:y,..._,"data-discover":!b&&e==="render"?"true":void 0})});sM.displayName="Form";function oM(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xx(e){let n=L.useContext(Qs);return qe(n,oM(e)),n}function aM(e,{target:n,replace:i,state:s,preventScrollReset:a,relative:f,viewTransition:d,unstable_useTransitions:l}={}){let u=lT(),c=Zs(),v=Ul(e,{relative:f});return L.useCallback(m=>{if(HT(m,n)){m.preventDefault();let _=i!==void 0?i:Ir(c)===Ir(v),x=()=>u(e,{replace:_,state:s,preventScrollReset:a,relative:f,viewTransition:d});l?L.startTransition(()=>x()):x()}},[c,u,v,i,s,n,e,a,f,d,l])}var lM=0,cM=()=>`__${String(++lM)}__`;function uM(){let{router:e}=xx("useSubmit"),{basename:n}=L.useContext(Sr),i=bT(),s=e.fetch,a=e.navigate;return L.useCallback(async(f,d={})=>{let{action:l,method:u,encType:c,formData:v,body:m}=IT(f,n);if(d.navigate===!1){let _=d.fetcherKey||cM();await s(_,i,d.action||l,{preventScrollReset:d.preventScrollReset,formData:v,body:m,formMethod:d.method||u,formEncType:d.encType||c,flushSync:d.flushSync})}else await a(d.action||l,{preventScrollReset:d.preventScrollReset,formData:v,body:m,formMethod:d.method||u,formEncType:d.encType||c,replace:d.replace,state:d.state,fromRouteId:i,flushSync:d.flushSync,viewTransition:d.viewTransition})},[s,a,n,i])}function hM(e,{relative:n}={}){let{basename:i}=L.useContext(Sr),s=L.useContext($r);qe(s,"useFormAction must be used inside a RouteContext");let[a]=s.matches.slice(-1),f={...Ul(e||".",{relative:n})},d=Zs();if(e==null){f.search=d.search;let l=new URLSearchParams(f.search),u=l.getAll("index");if(u.some(v=>v==="")){l.delete("index"),u.filter(m=>m).forEach(m=>l.append("index",m));let v=l.toString();f.search=v?`?${v}`:""}}return(!e||e===".")&&a.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(f.pathname=f.pathname==="/"?i:Hr([i,f.pathname])),Ir(f)}function fM(e,{relative:n}={}){let i=L.useContext(_p);qe(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=xx("useViewTransitionState"),a=Ul(e,{relative:n});if(!i.isTransitioning)return!1;let f=ir(i.currentLocation.pathname,s)||i.currentLocation.pathname,d=ir(i.nextLocation.pathname,s)||i.nextLocation.pathname;return qu(a.pathname,d)!=null||qu(a.pathname,f)!=null}var Js=IS();const dM=fh(Js);function mM(e){return L.createElement(MT,{flushSync:Js.flushSync,...e})}const nr="/api";class wx extends Error{constructor(n,i,s){super(n),this.statusCode=i,this.details=s,this.name="ApiError"}}async function rr(e,n){const i=await fetch(e,{...n,headers:{"Content-Type":"application/json",...n?.headers}}),s=await i.json();if(!i.ok||!s.success)throw new wx(s.error||"API request failed",i.status,s.details);return s.data}const Cp={list:async()=>rr(`${nr}/branches`),get:async e=>{const n=encodeURIComponent(e);return rr(`${nr}/branches/${n}`)},sync:async(e,n)=>{const i=encodeURIComponent(e);return rr(`${nr}/branches/${i}/sync`,{method:"POST",body:JSON.stringify(n)})}},pM={list:async()=>rr(`${nr}/worktrees`),create:async e=>rr(`${nr}/worktrees`,{method:"POST",body:JSON.stringify(e)}),delete:async e=>{const n=new URL(`${nr}/worktrees/delete`,window.location.origin);n.searchParams.set("path",e),await rr(n.toString(),{method:"DELETE"})}},Ep={list:async()=>rr(`${nr}/sessions`),start:async e=>rr(`${nr}/sessions`,{method:"POST",body:JSON.stringify(e)}),get:async e=>rr(`${nr}/sessions/${e}`),delete:async e=>{await rr(`${nr}/sessions/${e}`,{method:"DELETE"})}},Cx={get:async()=>rr(`${nr}/config`),update:async e=>rr(`${nr}/config`,{method:"PUT",body:JSON.stringify(e)})};function gM(){return mh({queryKey:["branches"],queryFn:Cp.list})}function vM(e){return mh({queryKey:["branches",e],queryFn:()=>Cp.get(e),enabled:!!e})}function _M(e){const n=Xs();return Hl({mutationFn:i=>Cp.sync(e,i),onSuccess:i=>{n.setQueryData(["branches",e],i.branch),n.invalidateQueries({queryKey:["branches"]})}})}function Ex(e){var n,i,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(n=0;n<a;n++)e[n]&&(i=Ex(e[n]))&&(s&&(s+=" "),s+=i)}else for(i in e)e[i]&&(s&&(s+=" "),s+=i);return s}function Rx(){for(var e,n,i=0,s="",a=arguments.length;i<a;i++)(e=arguments[i])&&(n=Ex(e))&&(s&&(s+=" "),s+=n);return s}const yM=(e,n)=>{const i=new Array(e.length+n.length);for(let s=0;s<e.length;s++)i[s]=e[s];for(let s=0;s<n.length;s++)i[e.length+s]=n[s];return i},bM=(e,n)=>({classGroupId:e,validator:n}),Ax=(e=new Map,n=null,i)=>({nextPart:e,validators:n,classGroupId:i}),Yu="-",Fy=[],SM="arbitrary..",xM=e=>{const n=CM(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return wM(d);const l=d.split(Yu),u=l[0]===""&&l.length>1?1:0;return Tx(l,u,n)},getConflictingClassGroupIds:(d,l)=>{if(l){const u=s[d],c=i[d];return u?c?yM(c,u):u:c||Fy}return i[d]||Fy}}},Tx=(e,n,i)=>{if(e.length-n===0)return i.classGroupId;const a=e[n],f=i.nextPart.get(a);if(f){const c=Tx(e,n+1,f);if(c)return c}const d=i.validators;if(d===null)return;const l=n===0?e.join(Yu):e.slice(n).join(Yu),u=d.length;for(let c=0;c<u;c++){const v=d[c];if(v.validator(l))return v.classGroupId}},wM=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=e.slice(1,-1),i=n.indexOf(":"),s=n.slice(0,i);return s?SM+s:void 0})(),CM=e=>{const{theme:n,classGroups:i}=e;return EM(i,n)},EM=(e,n)=>{const i=Ax();for(const s in e){const a=e[s];Rp(a,i,s,n)}return i},Rp=(e,n,i,s)=>{const a=e.length;for(let f=0;f<a;f++){const d=e[f];RM(d,n,i,s)}},RM=(e,n,i,s)=>{if(typeof e=="string"){AM(e,n,i);return}if(typeof e=="function"){TM(e,n,i,s);return}MM(e,n,i,s)},AM=(e,n,i)=>{const s=e===""?n:Mx(n,e);s.classGroupId=i},TM=(e,n,i,s)=>{if(DM(e)){Rp(e(s),n,i,s);return}n.validators===null&&(n.validators=[]),n.validators.push(bM(i,e))},MM=(e,n,i,s)=>{const a=Object.entries(e),f=a.length;for(let d=0;d<f;d++){const[l,u]=a[d];Rp(u,Mx(n,l),i,s)}},Mx=(e,n)=>{let i=e;const s=n.split(Yu),a=s.length;for(let f=0;f<a;f++){const d=s[f];let l=i.nextPart.get(d);l||(l=Ax(),i.nextPart.set(d,l)),i=l}return i},DM=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,OM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,i=Object.create(null),s=Object.create(null);const a=(f,d)=>{i[f]=d,n++,n>e&&(n=0,s=i,i=Object.create(null))};return{get(f){let d=i[f];if(d!==void 0)return d;if((d=s[f])!==void 0)return a(f,d),d},set(f,d){f in i?i[f]=d:a(f,d)}}},Hm="!",$y=":",LM=[],Vy=(e,n,i,s,a)=>({modifiers:e,hasImportantModifier:n,baseClassName:i,maybePostfixModifierPosition:s,isExternal:a}),kM=e=>{const{prefix:n,experimentalParseClassName:i}=e;let s=a=>{const f=[];let d=0,l=0,u=0,c;const v=a.length;for(let S=0;S<v;S++){const p=a[S];if(d===0&&l===0){if(p===$y){f.push(a.slice(u,S)),u=S+1;continue}if(p==="/"){c=S;continue}}p==="["?d++:p==="]"?d--:p==="("?l++:p===")"&&l--}const m=f.length===0?a:a.slice(u);let _=m,x=!1;m.endsWith(Hm)?(_=m.slice(0,-1),x=!0):m.startsWith(Hm)&&(_=m.slice(1),x=!0);const C=c&&c>u?c-u:void 0;return Vy(f,x,_,C)};if(n){const a=n+$y,f=s;s=d=>d.startsWith(a)?f(d.slice(a.length)):Vy(LM,!1,d,void 0,!0)}if(i){const a=s;s=f=>i({className:f,parseClassName:a})}return s},NM=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((i,s)=>{n.set(i,1e6+s)}),i=>{const s=[];let a=[];for(let f=0;f<i.length;f++){const d=i[f],l=d[0]==="[",u=n.has(d);l||u?(a.length>0&&(a.sort(),s.push(...a),a=[]),s.push(d)):a.push(d)}return a.length>0&&(a.sort(),s.push(...a)),s}},BM=e=>({cache:OM(e.cacheSize),parseClassName:kM(e),sortModifiers:NM(e),...xM(e)}),jM=/\s+/,HM=(e,n)=>{const{parseClassName:i,getClassGroupId:s,getConflictingClassGroupIds:a,sortModifiers:f}=n,d=[],l=e.trim().split(jM);let u="";for(let c=l.length-1;c>=0;c-=1){const v=l[c],{isExternal:m,modifiers:_,hasImportantModifier:x,baseClassName:C,maybePostfixModifierPosition:S}=i(v);if(m){u=v+(u.length>0?" "+u:u);continue}let p=!!S,g=s(p?C.substring(0,S):C);if(!g){if(!p){u=v+(u.length>0?" "+u:u);continue}if(g=s(C),!g){u=v+(u.length>0?" "+u:u);continue}p=!1}const b=_.length===0?"":_.length===1?_[0]:f(_).join(":"),y=x?b+Hm:b,E=y+g;if(d.indexOf(E)>-1)continue;d.push(E);const M=a(g,p);for(let O=0;O<M.length;++O){const T=M[O];d.push(y+T)}u=v+(u.length>0?" "+u:u)}return u},zM=(...e)=>{let n=0,i,s,a="";for(;n<e.length;)(i=e[n++])&&(s=Dx(i))&&(a&&(a+=" "),a+=s);return a},Dx=e=>{if(typeof e=="string")return e;let n,i="";for(let s=0;s<e.length;s++)e[s]&&(n=Dx(e[s]))&&(i&&(i+=" "),i+=n);return i},PM=(e,...n)=>{let i,s,a,f;const d=u=>{const c=n.reduce((v,m)=>m(v),e());return i=BM(c),s=i.cache.get,a=i.cache.set,f=l,l(u)},l=u=>{const c=s(u);if(c)return c;const v=HM(u,i);return a(u,v),v};return f=d,(...u)=>f(zM(...u))},IM=[],qt=e=>{const n=i=>i[e]||IM;return n.isThemeGetter=!0,n},Ox=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Lx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,UM=/^\d+\/\d+$/,FM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$M=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,VM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,WM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,zo=e=>UM.test(e),$e=e=>!!e&&!Number.isNaN(Number(e)),Xi=e=>!!e&&Number.isInteger(Number(e)),em=e=>e.endsWith("%")&&$e(e.slice(0,-1)),mi=e=>FM.test(e),YM=()=>!0,KM=e=>$M.test(e)&&!VM.test(e),kx=()=>!1,GM=e=>qM.test(e),XM=e=>WM.test(e),QM=e=>!Ae(e)&&!Te(e),ZM=e=>aa(e,jx,kx),Ae=e=>Ox.test(e),Ls=e=>aa(e,Hx,KM),tm=e=>aa(e,rD,$e),qy=e=>aa(e,Nx,kx),JM=e=>aa(e,Bx,XM),du=e=>aa(e,zx,GM),Te=e=>Lx.test(e),ll=e=>la(e,Hx),eD=e=>la(e,iD),Wy=e=>la(e,Nx),tD=e=>la(e,jx),nD=e=>la(e,Bx),mu=e=>la(e,zx,!0),aa=(e,n,i)=>{const s=Ox.exec(e);return s?s[1]?n(s[1]):i(s[2]):!1},la=(e,n,i=!1)=>{const s=Lx.exec(e);return s?s[1]?n(s[1]):i:!1},Nx=e=>e==="position"||e==="percentage",Bx=e=>e==="image"||e==="url",jx=e=>e==="length"||e==="size"||e==="bg-size",Hx=e=>e==="length",rD=e=>e==="number",iD=e=>e==="family-name",zx=e=>e==="shadow",sD=()=>{const e=qt("color"),n=qt("font"),i=qt("text"),s=qt("font-weight"),a=qt("tracking"),f=qt("leading"),d=qt("breakpoint"),l=qt("container"),u=qt("spacing"),c=qt("radius"),v=qt("shadow"),m=qt("inset-shadow"),_=qt("text-shadow"),x=qt("drop-shadow"),C=qt("blur"),S=qt("perspective"),p=qt("aspect"),g=qt("ease"),b=qt("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],M=()=>[...E(),Te,Ae],O=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],A=()=>[Te,Ae,u],k=()=>[zo,"full","auto",...A()],q=()=>[Xi,"none","subgrid",Te,Ae],z=()=>["auto",{span:["full",Xi,Te,Ae]},Xi,Te,Ae],I=()=>[Xi,"auto",Te,Ae],W=()=>["auto","min","max","fr",Te,Ae],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...A()],K=()=>[zo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],F=()=>[e,Te,Ae],N=()=>[...E(),Wy,qy,{position:[Te,Ae]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",tD,ZM,{size:[Te,Ae]}],P=()=>[em,ll,Ls],Q=()=>["","none","full",c,Te,Ae],J=()=>["",$e,ll,Ls],ae=()=>["solid","dashed","dotted","double"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[$e,em,Wy,qy],V=()=>["","none",C,Te,Ae],ie=()=>["none",$e,Te,Ae],de=()=>["none",$e,Te,Ae],re=()=>[$e,Te,Ae],le=()=>[zo,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[mi],breakpoint:[mi],color:[YM],container:[mi],"drop-shadow":[mi],ease:["in","out","in-out"],font:[QM],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[mi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[mi],shadow:[mi],spacing:["px",$e],text:[mi],"text-shadow":[mi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",zo,Ae,Te,p]}],container:["container"],columns:[{columns:[$e,Ae,Te,l]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:M()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{start:k()}],end:[{end:k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[Xi,"auto",Te,Ae]}],basis:[{basis:[zo,"full","auto",l,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[$e,zo,"auto","initial","none",Ae]}],grow:[{grow:["",$e,Te,Ae]}],shrink:[{shrink:["",$e,Te,Ae]}],order:[{order:[Xi,"first","last","none",Te,Ae]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],w:[{w:[l,"screen",...K()]}],"min-w":[{"min-w":[l,"screen","none",...K()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[d]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",i,ll,Ls]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,Te,tm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",em,Ae]}],"font-family":[{font:[eD,Ae,n]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Te,Ae]}],"line-clamp":[{"line-clamp":[$e,"none",Te,tm]}],leading:[{leading:[f,...A()]}],"list-image":[{"list-image":["none",Te,Ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Te,Ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:F()}],"text-color":[{text:F()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[$e,"from-font","auto",Te,Ls]}],"text-decoration-color":[{decoration:F()}],"underline-offset":[{"underline-offset":[$e,"auto",Te,Ae]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Te,Ae]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Te,Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Xi,Te,Ae],radial:["",Te,Ae],conic:[Xi,Te,Ae]},nD,JM]}],"bg-color":[{bg:F()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:F()}],"gradient-via":[{via:F()}],"gradient-to":[{to:F()}],rounded:[{rounded:Q()}],"rounded-s":[{"rounded-s":Q()}],"rounded-e":[{"rounded-e":Q()}],"rounded-t":[{"rounded-t":Q()}],"rounded-r":[{"rounded-r":Q()}],"rounded-b":[{"rounded-b":Q()}],"rounded-l":[{"rounded-l":Q()}],"rounded-ss":[{"rounded-ss":Q()}],"rounded-se":[{"rounded-se":Q()}],"rounded-ee":[{"rounded-ee":Q()}],"rounded-es":[{"rounded-es":Q()}],"rounded-tl":[{"rounded-tl":Q()}],"rounded-tr":[{"rounded-tr":Q()}],"rounded-br":[{"rounded-br":Q()}],"rounded-bl":[{"rounded-bl":Q()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:F()}],"border-color-x":[{"border-x":F()}],"border-color-y":[{"border-y":F()}],"border-color-s":[{"border-s":F()}],"border-color-e":[{"border-e":F()}],"border-color-t":[{"border-t":F()}],"border-color-r":[{"border-r":F()}],"border-color-b":[{"border-b":F()}],"border-color-l":[{"border-l":F()}],"divide-color":[{divide:F()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[$e,Te,Ae]}],"outline-w":[{outline:["",$e,ll,Ls]}],"outline-color":[{outline:F()}],shadow:[{shadow:["","none",v,mu,du]}],"shadow-color":[{shadow:F()}],"inset-shadow":[{"inset-shadow":["none",m,mu,du]}],"inset-shadow-color":[{"inset-shadow":F()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:F()}],"ring-offset-w":[{"ring-offset":[$e,Ls]}],"ring-offset-color":[{"ring-offset":F()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":F()}],"text-shadow":[{"text-shadow":["none",_,mu,du]}],"text-shadow-color":[{"text-shadow":F()}],opacity:[{opacity:[$e,Te,Ae]}],"mix-blend":[{"mix-blend":[...Z(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Z()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[$e]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":F()}],"mask-image-linear-to-color":[{"mask-linear-to":F()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":F()}],"mask-image-t-to-color":[{"mask-t-to":F()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":F()}],"mask-image-r-to-color":[{"mask-r-to":F()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":F()}],"mask-image-b-to-color":[{"mask-b-to":F()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":F()}],"mask-image-l-to-color":[{"mask-l-to":F()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":F()}],"mask-image-x-to-color":[{"mask-x-to":F()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":F()}],"mask-image-y-to-color":[{"mask-y-to":F()}],"mask-image-radial":[{"mask-radial":[Te,Ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":F()}],"mask-image-radial-to-color":[{"mask-radial-to":F()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[$e]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":F()}],"mask-image-conic-to-color":[{"mask-conic-to":F()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Te,Ae]}],filter:[{filter:["","none",Te,Ae]}],blur:[{blur:V()}],brightness:[{brightness:[$e,Te,Ae]}],contrast:[{contrast:[$e,Te,Ae]}],"drop-shadow":[{"drop-shadow":["","none",x,mu,du]}],"drop-shadow-color":[{"drop-shadow":F()}],grayscale:[{grayscale:["",$e,Te,Ae]}],"hue-rotate":[{"hue-rotate":[$e,Te,Ae]}],invert:[{invert:["",$e,Te,Ae]}],saturate:[{saturate:[$e,Te,Ae]}],sepia:[{sepia:["",$e,Te,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",Te,Ae]}],"backdrop-blur":[{"backdrop-blur":V()}],"backdrop-brightness":[{"backdrop-brightness":[$e,Te,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[$e,Te,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",$e,Te,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[$e,Te,Ae]}],"backdrop-invert":[{"backdrop-invert":["",$e,Te,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[$e,Te,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[$e,Te,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",$e,Te,Ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Te,Ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[$e,"initial",Te,Ae]}],ease:[{ease:["linear","initial",g,Te,Ae]}],delay:[{delay:[$e,Te,Ae]}],animate:[{animate:["none",b,Te,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Te,Ae]}],"perspective-origin":[{"perspective-origin":M()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:re()}],"skew-x":[{"skew-x":re()}],"skew-y":[{"skew-y":re()}],transform:[{transform:[Te,Ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:M()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":["translate-none"],accent:[{accent:F()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:F()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Te,Ae]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Te,Ae]}],fill:[{fill:["none",...F()]}],"stroke-w":[{stroke:[$e,ll,Ls,tm]}],stroke:[{stroke:["none",...F()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},oD=PM(sD);function Pe(...e){return oD(Rx(e))}const Yt=L.forwardRef(({className:e,...n},i)=>D.jsx("div",{ref:i,className:Pe("rounded-lg border border-border bg-card text-card-foreground shadow",e),...n}));Yt.displayName="Card";const Mn=L.forwardRef(({className:e,...n},i)=>D.jsx("div",{ref:i,className:Pe("flex flex-col space-y-1.5 p-6",e),...n}));Mn.displayName="CardHeader";const aD=L.forwardRef(({className:e,...n},i)=>D.jsx("div",{ref:i,className:Pe("font-semibold leading-none tracking-tight",e),...n}));aD.displayName="CardTitle";const lD=L.forwardRef(({className:e,...n},i)=>D.jsx("div",{ref:i,className:Pe("text-sm text-muted-foreground",e),...n}));lD.displayName="CardDescription";const Jt=L.forwardRef(({className:e,...n},i)=>D.jsx("div",{ref:i,className:Pe("p-6 pt-0",e),...n}));Jt.displayName="CardContent";const Ap=L.forwardRef(({className:e,...n},i)=>D.jsx("div",{ref:i,className:Pe("flex items-center p-6 pt-0",e),...n}));Ap.displayName="CardFooter";const Yy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ky=Rx,Tp=(e,n)=>i=>{var s;if(n?.variants==null)return Ky(e,i?.class,i?.className);const{variants:a,defaultVariants:f}=n,d=Object.keys(a).map(c=>{const v=i?.[c],m=f?.[c];if(v===null)return null;const _=Yy(v)||Yy(m);return a[c][_]}),l=i&&Object.entries(i).reduce((c,v)=>{let[m,_]=v;return _===void 0||(c[m]=_),c},{}),u=n==null||(s=n.compoundVariants)===null||s===void 0?void 0:s.reduce((c,v)=>{let{class:m,className:_,...x}=v;return Object.entries(x).every(C=>{let[S,p]=C;return Array.isArray(p)?p.includes({...f,...l}[S]):{...f,...l}[S]===p})?[...c,m,_]:c},[]);return Ky(e,d,u,i?.class,i?.className)},cD=Tp("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground",success:"border-transparent bg-green-500/15 text-green-400 border-green-500/30",warning:"border-transparent bg-yellow-500/15 text-yellow-400 border-yellow-500/30",local:"border-transparent bg-purple-500/15 text-purple-400 border-purple-500/30",remote:"border-transparent bg-blue-500/15 text-blue-400 border-blue-500/30"}},defaultVariants:{variant:"default"}});function vt({className:e,variant:n,...i}){return D.jsx("div",{className:Pe(cD({variant:n}),e),...i})}function Ut(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let i=0,s;i<e.length;i++)(s=Ut(e[i]))!==""&&(n+=(n&&" ")+s);else for(let i in e)e[i]&&(n+=(n&&" ")+i);return n}var uD={value:()=>{}};function Fl(){for(var e=0,n=arguments.length,i={},s;e<n;++e){if(!(s=arguments[e]+"")||s in i||/[\s.]/.test(s))throw new Error("illegal type: "+s);i[s]=[]}return new Bu(i)}function Bu(e){this._=e}function hD(e,n){return e.trim().split(/^|\s+/).map(function(i){var s="",a=i.indexOf(".");if(a>=0&&(s=i.slice(a+1),i=i.slice(0,a)),i&&!n.hasOwnProperty(i))throw new Error("unknown type: "+i);return{type:i,name:s}})}Bu.prototype=Fl.prototype={constructor:Bu,on:function(e,n){var i=this._,s=hD(e+"",i),a,f=-1,d=s.length;if(arguments.length<2){for(;++f<d;)if((a=(e=s[f]).type)&&(a=fD(i[a],e.name)))return a;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++f<d;)if(a=(e=s[f]).type)i[a]=Gy(i[a],e.name,n);else if(n==null)for(a in i)i[a]=Gy(i[a],e.name,null);return this},copy:function(){var e={},n=this._;for(var i in n)e[i]=n[i].slice();return new Bu(e)},call:function(e,n){if((a=arguments.length-2)>0)for(var i=new Array(a),s=0,a,f;s<a;++s)i[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(f=this._[e],s=0,a=f.length;s<a;++s)f[s].value.apply(n,i)},apply:function(e,n,i){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],a=0,f=s.length;a<f;++a)s[a].value.apply(n,i)}};function fD(e,n){for(var i=0,s=e.length,a;i<s;++i)if((a=e[i]).name===n)return a.value}function Gy(e,n,i){for(var s=0,a=e.length;s<a;++s)if(e[s].name===n){e[s]=uD,e=e.slice(0,s).concat(e.slice(s+1));break}return i!=null&&e.push({name:n,value:i}),e}var zm="http://www.w3.org/1999/xhtml";const Xy={svg:"http://www.w3.org/2000/svg",xhtml:zm,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function yh(e){var n=e+="",i=n.indexOf(":");return i>=0&&(n=e.slice(0,i))!=="xmlns"&&(e=e.slice(i+1)),Xy.hasOwnProperty(n)?{space:Xy[n],local:e}:e}function dD(e){return function(){var n=this.ownerDocument,i=this.namespaceURI;return i===zm&&n.documentElement.namespaceURI===zm?n.createElement(e):n.createElementNS(i,e)}}function mD(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Px(e){var n=yh(e);return(n.local?mD:dD)(n)}function pD(){}function Mp(e){return e==null?pD:function(){return this.querySelector(e)}}function gD(e){typeof e!="function"&&(e=Mp(e));for(var n=this._groups,i=n.length,s=new Array(i),a=0;a<i;++a)for(var f=n[a],d=f.length,l=s[a]=new Array(d),u,c,v=0;v<d;++v)(u=f[v])&&(c=e.call(u,u.__data__,v,f))&&("__data__"in u&&(c.__data__=u.__data__),l[v]=c);return new qn(s,this._parents)}function vD(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function _D(){return[]}function Ix(e){return e==null?_D:function(){return this.querySelectorAll(e)}}function yD(e){return function(){return vD(e.apply(this,arguments))}}function bD(e){typeof e=="function"?e=yD(e):e=Ix(e);for(var n=this._groups,i=n.length,s=[],a=[],f=0;f<i;++f)for(var d=n[f],l=d.length,u,c=0;c<l;++c)(u=d[c])&&(s.push(e.call(u,u.__data__,c,d)),a.push(u));return new qn(s,a)}function Ux(e){return function(){return this.matches(e)}}function Fx(e){return function(n){return n.matches(e)}}var SD=Array.prototype.find;function xD(e){return function(){return SD.call(this.children,e)}}function wD(){return this.firstElementChild}function CD(e){return this.select(e==null?wD:xD(typeof e=="function"?e:Fx(e)))}var ED=Array.prototype.filter;function RD(){return Array.from(this.children)}function AD(e){return function(){return ED.call(this.children,e)}}function TD(e){return this.selectAll(e==null?RD:AD(typeof e=="function"?e:Fx(e)))}function MD(e){typeof e!="function"&&(e=Ux(e));for(var n=this._groups,i=n.length,s=new Array(i),a=0;a<i;++a)for(var f=n[a],d=f.length,l=s[a]=[],u,c=0;c<d;++c)(u=f[c])&&e.call(u,u.__data__,c,f)&&l.push(u);return new qn(s,this._parents)}function $x(e){return new Array(e.length)}function DD(){return new qn(this._enter||this._groups.map($x),this._parents)}function Ku(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Ku.prototype={constructor:Ku,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function OD(e){return function(){return e}}function LD(e,n,i,s,a,f){for(var d=0,l,u=n.length,c=f.length;d<c;++d)(l=n[d])?(l.__data__=f[d],s[d]=l):i[d]=new Ku(e,f[d]);for(;d<u;++d)(l=n[d])&&(a[d]=l)}function kD(e,n,i,s,a,f,d){var l,u,c=new Map,v=n.length,m=f.length,_=new Array(v),x;for(l=0;l<v;++l)(u=n[l])&&(_[l]=x=d.call(u,u.__data__,l,n)+"",c.has(x)?a[l]=u:c.set(x,u));for(l=0;l<m;++l)x=d.call(e,f[l],l,f)+"",(u=c.get(x))?(s[l]=u,u.__data__=f[l],c.delete(x)):i[l]=new Ku(e,f[l]);for(l=0;l<v;++l)(u=n[l])&&c.get(_[l])===u&&(a[l]=u)}function ND(e){return e.__data__}function BD(e,n){if(!arguments.length)return Array.from(this,ND);var i=n?kD:LD,s=this._parents,a=this._groups;typeof e!="function"&&(e=OD(e));for(var f=a.length,d=new Array(f),l=new Array(f),u=new Array(f),c=0;c<f;++c){var v=s[c],m=a[c],_=m.length,x=jD(e.call(v,v&&v.__data__,c,s)),C=x.length,S=l[c]=new Array(C),p=d[c]=new Array(C),g=u[c]=new Array(_);i(v,m,S,p,g,x,n);for(var b=0,y=0,E,M;b<C;++b)if(E=S[b]){for(b>=y&&(y=b+1);!(M=p[y])&&++y<C;);E._next=M||null}}return d=new qn(d,s),d._enter=l,d._exit=u,d}function jD(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function HD(){return new qn(this._exit||this._groups.map($x),this._parents)}function zD(e,n,i){var s=this.enter(),a=this,f=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),n!=null&&(a=n(a),a&&(a=a.selection())),i==null?f.remove():i(f),s&&a?s.merge(a).order():a}function PD(e){for(var n=e.selection?e.selection():e,i=this._groups,s=n._groups,a=i.length,f=s.length,d=Math.min(a,f),l=new Array(a),u=0;u<d;++u)for(var c=i[u],v=s[u],m=c.length,_=l[u]=new Array(m),x,C=0;C<m;++C)(x=c[C]||v[C])&&(_[C]=x);for(;u<a;++u)l[u]=i[u];return new qn(l,this._parents)}function ID(){for(var e=this._groups,n=-1,i=e.length;++n<i;)for(var s=e[n],a=s.length-1,f=s[a],d;--a>=0;)(d=s[a])&&(f&&d.compareDocumentPosition(f)^4&&f.parentNode.insertBefore(d,f),f=d);return this}function UD(e){e||(e=FD);function n(m,_){return m&&_?e(m.__data__,_.__data__):!m-!_}for(var i=this._groups,s=i.length,a=new Array(s),f=0;f<s;++f){for(var d=i[f],l=d.length,u=a[f]=new Array(l),c,v=0;v<l;++v)(c=d[v])&&(u[v]=c);u.sort(n)}return new qn(a,this._parents).order()}function FD(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function $D(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function VD(){return Array.from(this)}function qD(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var s=e[n],a=0,f=s.length;a<f;++a){var d=s[a];if(d)return d}return null}function WD(){let e=0;for(const n of this)++e;return e}function YD(){return!this.node()}function KD(e){for(var n=this._groups,i=0,s=n.length;i<s;++i)for(var a=n[i],f=0,d=a.length,l;f<d;++f)(l=a[f])&&e.call(l,l.__data__,f,a);return this}function GD(e){return function(){this.removeAttribute(e)}}function XD(e){return function(){this.removeAttributeNS(e.space,e.local)}}function QD(e,n){return function(){this.setAttribute(e,n)}}function ZD(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function JD(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttribute(e):this.setAttribute(e,i)}}function e3(e,n){return function(){var i=n.apply(this,arguments);i==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,i)}}function t3(e,n){var i=yh(e);if(arguments.length<2){var s=this.node();return i.local?s.getAttributeNS(i.space,i.local):s.getAttribute(i)}return this.each((n==null?i.local?XD:GD:typeof n=="function"?i.local?e3:JD:i.local?ZD:QD)(i,n))}function Vx(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function n3(e){return function(){this.style.removeProperty(e)}}function r3(e,n,i){return function(){this.style.setProperty(e,n,i)}}function i3(e,n,i){return function(){var s=n.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,i)}}function s3(e,n,i){return arguments.length>1?this.each((n==null?n3:typeof n=="function"?i3:r3)(e,n,i??"")):Zo(this.node(),e)}function Zo(e,n){return e.style.getPropertyValue(n)||Vx(e).getComputedStyle(e,null).getPropertyValue(n)}function o3(e){return function(){delete this[e]}}function a3(e,n){return function(){this[e]=n}}function l3(e,n){return function(){var i=n.apply(this,arguments);i==null?delete this[e]:this[e]=i}}function c3(e,n){return arguments.length>1?this.each((n==null?o3:typeof n=="function"?l3:a3)(e,n)):this.node()[e]}function qx(e){return e.trim().split(/^|\s+/)}function Dp(e){return e.classList||new Wx(e)}function Wx(e){this._node=e,this._names=qx(e.getAttribute("class")||"")}Wx.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Yx(e,n){for(var i=Dp(e),s=-1,a=n.length;++s<a;)i.add(n[s])}function Kx(e,n){for(var i=Dp(e),s=-1,a=n.length;++s<a;)i.remove(n[s])}function u3(e){return function(){Yx(this,e)}}function h3(e){return function(){Kx(this,e)}}function f3(e,n){return function(){(n.apply(this,arguments)?Yx:Kx)(this,e)}}function d3(e,n){var i=qx(e+"");if(arguments.length<2){for(var s=Dp(this.node()),a=-1,f=i.length;++a<f;)if(!s.contains(i[a]))return!1;return!0}return this.each((typeof n=="function"?f3:n?u3:h3)(i,n))}function m3(){this.textContent=""}function p3(e){return function(){this.textContent=e}}function g3(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function v3(e){return arguments.length?this.each(e==null?m3:(typeof e=="function"?g3:p3)(e)):this.node().textContent}function _3(){this.innerHTML=""}function y3(e){return function(){this.innerHTML=e}}function b3(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function S3(e){return arguments.length?this.each(e==null?_3:(typeof e=="function"?b3:y3)(e)):this.node().innerHTML}function x3(){this.nextSibling&&this.parentNode.appendChild(this)}function w3(){return this.each(x3)}function C3(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function E3(){return this.each(C3)}function R3(e){var n=typeof e=="function"?e:Px(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function A3(){return null}function T3(e,n){var i=typeof e=="function"?e:Px(e),s=n==null?A3:typeof n=="function"?n:Mp(n);return this.select(function(){return this.insertBefore(i.apply(this,arguments),s.apply(this,arguments)||null)})}function M3(){var e=this.parentNode;e&&e.removeChild(this)}function D3(){return this.each(M3)}function O3(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function L3(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function k3(e){return this.select(e?L3:O3)}function N3(e){return arguments.length?this.property("__data__",e):this.node().__data__}function B3(e){return function(n){e.call(this,n,this.__data__)}}function j3(e){return e.trim().split(/^|\s+/).map(function(n){var i="",s=n.indexOf(".");return s>=0&&(i=n.slice(s+1),n=n.slice(0,s)),{type:n,name:i}})}function H3(e){return function(){var n=this.__on;if(n){for(var i=0,s=-1,a=n.length,f;i<a;++i)f=n[i],(!e.type||f.type===e.type)&&f.name===e.name?this.removeEventListener(f.type,f.listener,f.options):n[++s]=f;++s?n.length=s:delete this.__on}}}function z3(e,n,i){return function(){var s=this.__on,a,f=B3(n);if(s){for(var d=0,l=s.length;d<l;++d)if((a=s[d]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=f,a.options=i),a.value=n;return}}this.addEventListener(e.type,f,i),a={type:e.type,name:e.name,value:n,listener:f,options:i},s?s.push(a):this.__on=[a]}}function P3(e,n,i){var s=j3(e+""),a,f=s.length,d;if(arguments.length<2){var l=this.node().__on;if(l){for(var u=0,c=l.length,v;u<c;++u)for(a=0,v=l[u];a<f;++a)if((d=s[a]).type===v.type&&d.name===v.name)return v.value}return}for(l=n?z3:H3,a=0;a<f;++a)this.each(l(s[a],n,i));return this}function Gx(e,n,i){var s=Vx(e),a=s.CustomEvent;typeof a=="function"?a=new a(n,i):(a=s.document.createEvent("Event"),i?(a.initEvent(n,i.bubbles,i.cancelable),a.detail=i.detail):a.initEvent(n,!1,!1)),e.dispatchEvent(a)}function I3(e,n){return function(){return Gx(this,e,n)}}function U3(e,n){return function(){return Gx(this,e,n.apply(this,arguments))}}function F3(e,n){return this.each((typeof n=="function"?U3:I3)(e,n))}function*$3(){for(var e=this._groups,n=0,i=e.length;n<i;++n)for(var s=e[n],a=0,f=s.length,d;a<f;++a)(d=s[a])&&(yield d)}var Xx=[null];function qn(e,n){this._groups=e,this._parents=n}function $l(){return new qn([[document.documentElement]],Xx)}function V3(){return this}qn.prototype=$l.prototype={constructor:qn,select:gD,selectAll:bD,selectChild:CD,selectChildren:TD,filter:MD,data:BD,enter:DD,exit:HD,join:zD,merge:PD,selection:V3,order:ID,sort:UD,call:$D,nodes:VD,node:qD,size:WD,empty:YD,each:KD,attr:t3,style:s3,property:c3,classed:d3,text:v3,html:S3,raise:w3,lower:E3,append:R3,insert:T3,remove:D3,clone:k3,datum:N3,on:P3,dispatch:F3,[Symbol.iterator]:$3};function $n(e){return typeof e=="string"?new qn([[document.querySelector(e)]],[document.documentElement]):new qn([[e]],Xx)}function q3(e){let n;for(;n=e.sourceEvent;)e=n;return e}function dr(e,n){if(e=q3(e),n===void 0&&(n=e.currentTarget),n){var i=n.ownerSVGElement||n;if(i.createSVGPoint){var s=i.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(n.getScreenCTM().inverse()),[s.x,s.y]}if(n.getBoundingClientRect){var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}}return[e.pageX,e.pageY]}const W3={passive:!1},wl={capture:!0,passive:!1};function nm(e){e.stopImmediatePropagation()}function Ko(e){e.preventDefault(),e.stopImmediatePropagation()}function Qx(e){var n=e.document.documentElement,i=$n(e).on("dragstart.drag",Ko,wl);"onselectstart"in n?i.on("selectstart.drag",Ko,wl):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Zx(e,n){var i=e.document.documentElement,s=$n(e).on("dragstart.drag",null);n&&(s.on("click.drag",Ko,wl),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in i?s.on("selectstart.drag",null):(i.style.MozUserSelect=i.__noselect,delete i.__noselect)}const pu=e=>()=>e;function Pm(e,{sourceEvent:n,subject:i,target:s,identifier:a,active:f,x:d,y:l,dx:u,dy:c,dispatch:v}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:i,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:f,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:v}})}Pm.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Y3(e){return!e.ctrlKey&&!e.button}function K3(){return this.parentNode}function G3(e,n){return n??{x:e.x,y:e.y}}function X3(){return navigator.maxTouchPoints||"ontouchstart"in this}function Jx(){var e=Y3,n=K3,i=G3,s=X3,a={},f=Fl("start","drag","end"),d=0,l,u,c,v,m=0;function _(E){E.on("mousedown.drag",x).filter(s).on("touchstart.drag",p).on("touchmove.drag",g,W3).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(E,M){if(!(v||!e.call(this,E,M))){var O=y(this,n.call(this,E,M),E,M,"mouse");O&&($n(E.view).on("mousemove.drag",C,wl).on("mouseup.drag",S,wl),Qx(E.view),nm(E),c=!1,l=E.clientX,u=E.clientY,O("start",E))}}function C(E){if(Ko(E),!c){var M=E.clientX-l,O=E.clientY-u;c=M*M+O*O>m}a.mouse("drag",E)}function S(E){$n(E.view).on("mousemove.drag mouseup.drag",null),Zx(E.view,c),Ko(E),a.mouse("end",E)}function p(E,M){if(e.call(this,E,M)){var O=E.changedTouches,T=n.call(this,E,M),A=O.length,k,q;for(k=0;k<A;++k)(q=y(this,T,E,M,O[k].identifier,O[k]))&&(nm(E),q("start",E,O[k]))}}function g(E){var M=E.changedTouches,O=M.length,T,A;for(T=0;T<O;++T)(A=a[M[T].identifier])&&(Ko(E),A("drag",E,M[T]))}function b(E){var M=E.changedTouches,O=M.length,T,A;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),T=0;T<O;++T)(A=a[M[T].identifier])&&(nm(E),A("end",E,M[T]))}function y(E,M,O,T,A,k){var q=f.copy(),z=dr(k||O,M),I,W,U;if((U=i.call(E,new Pm("beforestart",{sourceEvent:O,target:_,identifier:A,active:d,x:z[0],y:z[1],dx:0,dy:0,dispatch:q}),T))!=null)return I=U.x-z[0]||0,W=U.y-z[1]||0,function G(H,K,F){var N=z,$;switch(H){case"start":a[A]=G,$=d++;break;case"end":delete a[A],--d;case"drag":z=dr(F||K,M),$=d;break}q.call(H,E,new Pm(H,{sourceEvent:K,subject:U,target:_,identifier:A,active:$,x:z[0]+I,y:z[1]+W,dx:z[0]-N[0],dy:z[1]-N[1],dispatch:q}),T)}}return _.filter=function(E){return arguments.length?(e=typeof E=="function"?E:pu(!!E),_):e},_.container=function(E){return arguments.length?(n=typeof E=="function"?E:pu(E),_):n},_.subject=function(E){return arguments.length?(i=typeof E=="function"?E:pu(E),_):i},_.touchable=function(E){return arguments.length?(s=typeof E=="function"?E:pu(!!E),_):s},_.on=function(){var E=f.on.apply(f,arguments);return E===f?_:E},_.clickDistance=function(E){return arguments.length?(m=(E=+E)*E,_):Math.sqrt(m)},_}function Op(e,n,i){e.prototype=n.prototype=i,i.constructor=e}function ew(e,n){var i=Object.create(e.prototype);for(var s in n)i[s]=n[s];return i}function Vl(){}var Cl=.7,Gu=1/Cl,Go="\\s*([+-]?\\d+)\\s*",El="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",zr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Q3=/^#([0-9a-f]{3,8})$/,Z3=new RegExp(`^rgb\\(${Go},${Go},${Go}\\)$`),J3=new RegExp(`^rgb\\(${zr},${zr},${zr}\\)$`),eO=new RegExp(`^rgba\\(${Go},${Go},${Go},${El}\\)$`),tO=new RegExp(`^rgba\\(${zr},${zr},${zr},${El}\\)$`),nO=new RegExp(`^hsl\\(${El},${zr},${zr}\\)$`),rO=new RegExp(`^hsla\\(${El},${zr},${zr},${El}\\)$`),Qy={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};Op(Vl,Fs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zy,formatHex:Zy,formatHex8:iO,formatHsl:sO,formatRgb:Jy,toString:Jy});function Zy(){return this.rgb().formatHex()}function iO(){return this.rgb().formatHex8()}function sO(){return tw(this).formatHsl()}function Jy(){return this.rgb().formatRgb()}function Fs(e){var n,i;return e=(e+"").trim().toLowerCase(),(n=Q3.exec(e))?(i=n[1].length,n=parseInt(n[1],16),i===6?eb(n):i===3?new Dn(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):i===8?gu(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):i===4?gu(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=Z3.exec(e))?new Dn(n[1],n[2],n[3],1):(n=J3.exec(e))?new Dn(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=eO.exec(e))?gu(n[1],n[2],n[3],n[4]):(n=tO.exec(e))?gu(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=nO.exec(e))?rb(n[1],n[2]/100,n[3]/100,1):(n=rO.exec(e))?rb(n[1],n[2]/100,n[3]/100,n[4]):Qy.hasOwnProperty(e)?eb(Qy[e]):e==="transparent"?new Dn(NaN,NaN,NaN,0):null}function eb(e){return new Dn(e>>16&255,e>>8&255,e&255,1)}function gu(e,n,i,s){return s<=0&&(e=n=i=NaN),new Dn(e,n,i,s)}function oO(e){return e instanceof Vl||(e=Fs(e)),e?(e=e.rgb(),new Dn(e.r,e.g,e.b,e.opacity)):new Dn}function Im(e,n,i,s){return arguments.length===1?oO(e):new Dn(e,n,i,s??1)}function Dn(e,n,i,s){this.r=+e,this.g=+n,this.b=+i,this.opacity=+s}Op(Dn,Im,ew(Vl,{brighter(e){return e=e==null?Gu:Math.pow(Gu,e),new Dn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Cl:Math.pow(Cl,e),new Dn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Dn(Hs(this.r),Hs(this.g),Hs(this.b),Xu(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:tb,formatHex:tb,formatHex8:aO,formatRgb:nb,toString:nb}));function tb(){return`#${js(this.r)}${js(this.g)}${js(this.b)}`}function aO(){return`#${js(this.r)}${js(this.g)}${js(this.b)}${js((isNaN(this.opacity)?1:this.opacity)*255)}`}function nb(){const e=Xu(this.opacity);return`${e===1?"rgb(":"rgba("}${Hs(this.r)}, ${Hs(this.g)}, ${Hs(this.b)}${e===1?")":`, ${e})`}`}function Xu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Hs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function js(e){return e=Hs(e),(e<16?"0":"")+e.toString(16)}function rb(e,n,i,s){return s<=0?e=n=i=NaN:i<=0||i>=1?e=n=NaN:n<=0&&(e=NaN),new mr(e,n,i,s)}function tw(e){if(e instanceof mr)return new mr(e.h,e.s,e.l,e.opacity);if(e instanceof Vl||(e=Fs(e)),!e)return new mr;if(e instanceof mr)return e;e=e.rgb();var n=e.r/255,i=e.g/255,s=e.b/255,a=Math.min(n,i,s),f=Math.max(n,i,s),d=NaN,l=f-a,u=(f+a)/2;return l?(n===f?d=(i-s)/l+(i<s)*6:i===f?d=(s-n)/l+2:d=(n-i)/l+4,l/=u<.5?f+a:2-f-a,d*=60):l=u>0&&u<1?0:d,new mr(d,l,u,e.opacity)}function lO(e,n,i,s){return arguments.length===1?tw(e):new mr(e,n,i,s??1)}function mr(e,n,i,s){this.h=+e,this.s=+n,this.l=+i,this.opacity=+s}Op(mr,lO,ew(Vl,{brighter(e){return e=e==null?Gu:Math.pow(Gu,e),new mr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Cl:Math.pow(Cl,e),new mr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,s=i+(i<.5?i:1-i)*n,a=2*i-s;return new Dn(rm(e>=240?e-240:e+120,a,s),rm(e,a,s),rm(e<120?e+240:e-120,a,s),this.opacity)},clamp(){return new mr(ib(this.h),vu(this.s),vu(this.l),Xu(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=Xu(this.opacity);return`${e===1?"hsl(":"hsla("}${ib(this.h)}, ${vu(this.s)*100}%, ${vu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function ib(e){return e=(e||0)%360,e<0?e+360:e}function vu(e){return Math.max(0,Math.min(1,e||0))}function rm(e,n,i){return(e<60?n+(i-n)*e/60:e<180?i:e<240?n+(i-n)*(240-e)/60:n)*255}const Lp=e=>()=>e;function cO(e,n){return function(i){return e+i*n}}function uO(e,n,i){return e=Math.pow(e,i),n=Math.pow(n,i)-e,i=1/i,function(s){return Math.pow(e+s*n,i)}}function hO(e){return(e=+e)==1?nw:function(n,i){return i-n?uO(n,i,e):Lp(isNaN(n)?i:n)}}function nw(e,n){var i=n-e;return i?cO(e,i):Lp(isNaN(e)?n:e)}const Qu=(function e(n){var i=hO(n);function s(a,f){var d=i((a=Im(a)).r,(f=Im(f)).r),l=i(a.g,f.g),u=i(a.b,f.b),c=nw(a.opacity,f.opacity);return function(v){return a.r=d(v),a.g=l(v),a.b=u(v),a.opacity=c(v),a+""}}return s.gamma=e,s})(1);function fO(e,n){n||(n=[]);var i=e?Math.min(n.length,e.length):0,s=n.slice(),a;return function(f){for(a=0;a<i;++a)s[a]=e[a]*(1-f)+n[a]*f;return s}}function dO(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function mO(e,n){var i=n?n.length:0,s=e?Math.min(i,e.length):0,a=new Array(s),f=new Array(i),d;for(d=0;d<s;++d)a[d]=vl(e[d],n[d]);for(;d<i;++d)f[d]=n[d];return function(l){for(d=0;d<s;++d)f[d]=a[d](l);return f}}function pO(e,n){var i=new Date;return e=+e,n=+n,function(s){return i.setTime(e*(1-s)+n*s),i}}function Lr(e,n){return e=+e,n=+n,function(i){return e*(1-i)+n*i}}function gO(e,n){var i={},s={},a;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(a in n)a in e?i[a]=vl(e[a],n[a]):s[a]=n[a];return function(f){for(a in i)s[a]=i[a](f);return s}}var Um=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,im=new RegExp(Um.source,"g");function vO(e){return function(){return e}}function _O(e){return function(n){return e(n)+""}}function rw(e,n){var i=Um.lastIndex=im.lastIndex=0,s,a,f,d=-1,l=[],u=[];for(e=e+"",n=n+"";(s=Um.exec(e))&&(a=im.exec(n));)(f=a.index)>i&&(f=n.slice(i,f),l[d]?l[d]+=f:l[++d]=f),(s=s[0])===(a=a[0])?l[d]?l[d]+=a:l[++d]=a:(l[++d]=null,u.push({i:d,x:Lr(s,a)})),i=im.lastIndex;return i<n.length&&(f=n.slice(i),l[d]?l[d]+=f:l[++d]=f),l.length<2?u[0]?_O(u[0].x):vO(n):(n=u.length,function(c){for(var v=0,m;v<n;++v)l[(m=u[v]).i]=m.x(c);return l.join("")})}function vl(e,n){var i=typeof n,s;return n==null||i==="boolean"?Lp(n):(i==="number"?Lr:i==="string"?(s=Fs(n))?(n=s,Qu):rw:n instanceof Fs?Qu:n instanceof Date?pO:dO(n)?fO:Array.isArray(n)?mO:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?gO:Lr)(e,n)}var sb=180/Math.PI,Fm={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function iw(e,n,i,s,a,f){var d,l,u;return(d=Math.sqrt(e*e+n*n))&&(e/=d,n/=d),(u=e*i+n*s)&&(i-=e*u,s-=n*u),(l=Math.sqrt(i*i+s*s))&&(i/=l,s/=l,u/=l),e*s<n*i&&(e=-e,n=-n,u=-u,d=-d),{translateX:a,translateY:f,rotate:Math.atan2(n,e)*sb,skewX:Math.atan(u)*sb,scaleX:d,scaleY:l}}var _u;function yO(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Fm:iw(n.a,n.b,n.c,n.d,n.e,n.f)}function bO(e){return e==null||(_u||(_u=document.createElementNS("http://www.w3.org/2000/svg","g")),_u.setAttribute("transform",e),!(e=_u.transform.baseVal.consolidate()))?Fm:(e=e.matrix,iw(e.a,e.b,e.c,e.d,e.e,e.f))}function sw(e,n,i,s){function a(c){return c.length?c.pop()+" ":""}function f(c,v,m,_,x,C){if(c!==m||v!==_){var S=x.push("translate(",null,n,null,i);C.push({i:S-4,x:Lr(c,m)},{i:S-2,x:Lr(v,_)})}else(m||_)&&x.push("translate("+m+n+_+i)}function d(c,v,m,_){c!==v?(c-v>180?v+=360:v-c>180&&(c+=360),_.push({i:m.push(a(m)+"rotate(",null,s)-2,x:Lr(c,v)})):v&&m.push(a(m)+"rotate("+v+s)}function l(c,v,m,_){c!==v?_.push({i:m.push(a(m)+"skewX(",null,s)-2,x:Lr(c,v)}):v&&m.push(a(m)+"skewX("+v+s)}function u(c,v,m,_,x,C){if(c!==m||v!==_){var S=x.push(a(x)+"scale(",null,",",null,")");C.push({i:S-4,x:Lr(c,m)},{i:S-2,x:Lr(v,_)})}else(m!==1||_!==1)&&x.push(a(x)+"scale("+m+","+_+")")}return function(c,v){var m=[],_=[];return c=e(c),v=e(v),f(c.translateX,c.translateY,v.translateX,v.translateY,m,_),d(c.rotate,v.rotate,m,_),l(c.skewX,v.skewX,m,_),u(c.scaleX,c.scaleY,v.scaleX,v.scaleY,m,_),c=v=null,function(x){for(var C=-1,S=_.length,p;++C<S;)m[(p=_[C]).i]=p.x(x);return m.join("")}}}var SO=sw(yO,"px, ","px)","deg)"),xO=sw(bO,", ",")",")"),wO=1e-12;function ob(e){return((e=Math.exp(e))+1/e)/2}function CO(e){return((e=Math.exp(e))-1/e)/2}function EO(e){return((e=Math.exp(2*e))-1)/(e+1)}const ju=(function e(n,i,s){function a(f,d){var l=f[0],u=f[1],c=f[2],v=d[0],m=d[1],_=d[2],x=v-l,C=m-u,S=x*x+C*C,p,g;if(S<wO)g=Math.log(_/c)/n,p=function(T){return[l+T*x,u+T*C,c*Math.exp(n*T*g)]};else{var b=Math.sqrt(S),y=(_*_-c*c+s*S)/(2*c*i*b),E=(_*_-c*c-s*S)/(2*_*i*b),M=Math.log(Math.sqrt(y*y+1)-y),O=Math.log(Math.sqrt(E*E+1)-E);g=(O-M)/n,p=function(T){var A=T*g,k=ob(M),q=c/(i*b)*(k*EO(n*A+M)-CO(M));return[l+q*x,u+q*C,c*k/ob(n*A+M)]}}return p.duration=g*1e3*n/Math.SQRT2,p}return a.rho=function(f){var d=Math.max(.001,+f),l=d*d,u=l*l;return e(d,l,u)},a})(Math.SQRT2,2,4);var Jo=0,dl=0,cl=0,ow=1e3,Zu,ml,Ju=0,$s=0,bh=0,Rl=typeof performance=="object"&&performance.now?performance:Date,aw=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function kp(){return $s||(aw(RO),$s=Rl.now()+bh)}function RO(){$s=0}function eh(){this._call=this._time=this._next=null}eh.prototype=Np.prototype={constructor:eh,restart:function(e,n,i){if(typeof e!="function")throw new TypeError("callback is not a function");i=(i==null?kp():+i)+(n==null?0:+n),!this._next&&ml!==this&&(ml?ml._next=this:Zu=this,ml=this),this._call=e,this._time=i,$m()},stop:function(){this._call&&(this._call=null,this._time=1/0,$m())}};function Np(e,n,i){var s=new eh;return s.restart(e,n,i),s}function AO(){kp(),++Jo;for(var e=Zu,n;e;)(n=$s-e._time)>=0&&e._call.call(void 0,n),e=e._next;--Jo}function ab(){$s=(Ju=Rl.now())+bh,Jo=dl=0;try{AO()}finally{Jo=0,MO(),$s=0}}function TO(){var e=Rl.now(),n=e-Ju;n>ow&&(bh-=n,Ju=e)}function MO(){for(var e,n=Zu,i,s=1/0;n;)n._call?(s>n._time&&(s=n._time),e=n,n=n._next):(i=n._next,n._next=null,n=e?e._next=i:Zu=i);ml=e,$m(s)}function $m(e){if(!Jo){dl&&(dl=clearTimeout(dl));var n=e-$s;n>24?(e<1/0&&(dl=setTimeout(ab,e-Rl.now()-bh)),cl&&(cl=clearInterval(cl))):(cl||(Ju=Rl.now(),cl=setInterval(TO,ow)),Jo=1,aw(ab))}}function lb(e,n,i){var s=new eh;return n=n==null?0:+n,s.restart(a=>{s.stop(),e(a+n)},n,i),s}var DO=Fl("start","end","cancel","interrupt"),OO=[],lw=0,cb=1,Vm=2,Hu=3,ub=4,qm=5,zu=6;function Sh(e,n,i,s,a,f){var d=e.__transition;if(!d)e.__transition={};else if(i in d)return;LO(e,i,{name:n,index:s,group:a,on:DO,tween:OO,time:f.time,delay:f.delay,duration:f.duration,ease:f.ease,timer:null,state:lw})}function Bp(e,n){var i=xr(e,n);if(i.state>lw)throw new Error("too late; already scheduled");return i}function Vr(e,n){var i=xr(e,n);if(i.state>Hu)throw new Error("too late; already running");return i}function xr(e,n){var i=e.__transition;if(!i||!(i=i[n]))throw new Error("transition not found");return i}function LO(e,n,i){var s=e.__transition,a;s[n]=i,i.timer=Np(f,0,i.time);function f(c){i.state=cb,i.timer.restart(d,i.delay,i.time),i.delay<=c&&d(c-i.delay)}function d(c){var v,m,_,x;if(i.state!==cb)return u();for(v in s)if(x=s[v],x.name===i.name){if(x.state===Hu)return lb(d);x.state===ub?(x.state=zu,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete s[v]):+v<n&&(x.state=zu,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete s[v])}if(lb(function(){i.state===Hu&&(i.state=ub,i.timer.restart(l,i.delay,i.time),l(c))}),i.state=Vm,i.on.call("start",e,e.__data__,i.index,i.group),i.state===Vm){for(i.state=Hu,a=new Array(_=i.tween.length),v=0,m=-1;v<_;++v)(x=i.tween[v].value.call(e,e.__data__,i.index,i.group))&&(a[++m]=x);a.length=m+1}}function l(c){for(var v=c<i.duration?i.ease.call(null,c/i.duration):(i.timer.restart(u),i.state=qm,1),m=-1,_=a.length;++m<_;)a[m].call(e,v);i.state===qm&&(i.on.call("end",e,e.__data__,i.index,i.group),u())}function u(){i.state=zu,i.timer.stop(),delete s[n];for(var c in s)return;delete e.__transition}}function Pu(e,n){var i=e.__transition,s,a,f=!0,d;if(i){n=n==null?null:n+"";for(d in i){if((s=i[d]).name!==n){f=!1;continue}a=s.state>Vm&&s.state<qm,s.state=zu,s.timer.stop(),s.on.call(a?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete i[d]}f&&delete e.__transition}}function kO(e){return this.each(function(){Pu(this,e)})}function NO(e,n){var i,s;return function(){var a=Vr(this,e),f=a.tween;if(f!==i){s=i=f;for(var d=0,l=s.length;d<l;++d)if(s[d].name===n){s=s.slice(),s.splice(d,1);break}}a.tween=s}}function BO(e,n,i){var s,a;if(typeof i!="function")throw new Error;return function(){var f=Vr(this,e),d=f.tween;if(d!==s){a=(s=d).slice();for(var l={name:n,value:i},u=0,c=a.length;u<c;++u)if(a[u].name===n){a[u]=l;break}u===c&&a.push(l)}f.tween=a}}function jO(e,n){var i=this._id;if(e+="",arguments.length<2){for(var s=xr(this.node(),i).tween,a=0,f=s.length,d;a<f;++a)if((d=s[a]).name===e)return d.value;return null}return this.each((n==null?NO:BO)(i,e,n))}function jp(e,n,i){var s=e._id;return e.each(function(){var a=Vr(this,s);(a.value||(a.value={}))[n]=i.apply(this,arguments)}),function(a){return xr(a,s).value[n]}}function cw(e,n){var i;return(typeof n=="number"?Lr:n instanceof Fs?Qu:(i=Fs(n))?(n=i,Qu):rw)(e,n)}function HO(e){return function(){this.removeAttribute(e)}}function zO(e){return function(){this.removeAttributeNS(e.space,e.local)}}function PO(e,n,i){var s,a=i+"",f;return function(){var d=this.getAttribute(e);return d===a?null:d===s?f:f=n(s=d,i)}}function IO(e,n,i){var s,a=i+"",f;return function(){var d=this.getAttributeNS(e.space,e.local);return d===a?null:d===s?f:f=n(s=d,i)}}function UO(e,n,i){var s,a,f;return function(){var d,l=i(this),u;return l==null?void this.removeAttribute(e):(d=this.getAttribute(e),u=l+"",d===u?null:d===s&&u===a?f:(a=u,f=n(s=d,l)))}}function FO(e,n,i){var s,a,f;return function(){var d,l=i(this),u;return l==null?void this.removeAttributeNS(e.space,e.local):(d=this.getAttributeNS(e.space,e.local),u=l+"",d===u?null:d===s&&u===a?f:(a=u,f=n(s=d,l)))}}function $O(e,n){var i=yh(e),s=i==="transform"?xO:cw;return this.attrTween(e,typeof n=="function"?(i.local?FO:UO)(i,s,jp(this,"attr."+e,n)):n==null?(i.local?zO:HO)(i):(i.local?IO:PO)(i,s,n))}function VO(e,n){return function(i){this.setAttribute(e,n.call(this,i))}}function qO(e,n){return function(i){this.setAttributeNS(e.space,e.local,n.call(this,i))}}function WO(e,n){var i,s;function a(){var f=n.apply(this,arguments);return f!==s&&(i=(s=f)&&qO(e,f)),i}return a._value=n,a}function YO(e,n){var i,s;function a(){var f=n.apply(this,arguments);return f!==s&&(i=(s=f)&&VO(e,f)),i}return a._value=n,a}function KO(e,n){var i="attr."+e;if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;var s=yh(e);return this.tween(i,(s.local?WO:YO)(s,n))}function GO(e,n){return function(){Bp(this,e).delay=+n.apply(this,arguments)}}function XO(e,n){return n=+n,function(){Bp(this,e).delay=n}}function QO(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?GO:XO)(n,e)):xr(this.node(),n).delay}function ZO(e,n){return function(){Vr(this,e).duration=+n.apply(this,arguments)}}function JO(e,n){return n=+n,function(){Vr(this,e).duration=n}}function eL(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?ZO:JO)(n,e)):xr(this.node(),n).duration}function tL(e,n){if(typeof n!="function")throw new Error;return function(){Vr(this,e).ease=n}}function nL(e){var n=this._id;return arguments.length?this.each(tL(n,e)):xr(this.node(),n).ease}function rL(e,n){return function(){var i=n.apply(this,arguments);if(typeof i!="function")throw new Error;Vr(this,e).ease=i}}function iL(e){if(typeof e!="function")throw new Error;return this.each(rL(this._id,e))}function sL(e){typeof e!="function"&&(e=Ux(e));for(var n=this._groups,i=n.length,s=new Array(i),a=0;a<i;++a)for(var f=n[a],d=f.length,l=s[a]=[],u,c=0;c<d;++c)(u=f[c])&&e.call(u,u.__data__,c,f)&&l.push(u);return new Si(s,this._parents,this._name,this._id)}function oL(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,i=e._groups,s=n.length,a=i.length,f=Math.min(s,a),d=new Array(s),l=0;l<f;++l)for(var u=n[l],c=i[l],v=u.length,m=d[l]=new Array(v),_,x=0;x<v;++x)(_=u[x]||c[x])&&(m[x]=_);for(;l<s;++l)d[l]=n[l];return new Si(d,this._parents,this._name,this._id)}function aL(e){return(e+"").trim().split(/^|\s+/).every(function(n){var i=n.indexOf(".");return i>=0&&(n=n.slice(0,i)),!n||n==="start"})}function lL(e,n,i){var s,a,f=aL(n)?Bp:Vr;return function(){var d=f(this,e),l=d.on;l!==s&&(a=(s=l).copy()).on(n,i),d.on=a}}function cL(e,n){var i=this._id;return arguments.length<2?xr(this.node(),i).on.on(e):this.each(lL(i,e,n))}function uL(e){return function(){var n=this.parentNode;for(var i in this.__transition)if(+i!==e)return;n&&n.removeChild(this)}}function hL(){return this.on("end.remove",uL(this._id))}function fL(e){var n=this._name,i=this._id;typeof e!="function"&&(e=Mp(e));for(var s=this._groups,a=s.length,f=new Array(a),d=0;d<a;++d)for(var l=s[d],u=l.length,c=f[d]=new Array(u),v,m,_=0;_<u;++_)(v=l[_])&&(m=e.call(v,v.__data__,_,l))&&("__data__"in v&&(m.__data__=v.__data__),c[_]=m,Sh(c[_],n,i,_,c,xr(v,i)));return new Si(f,this._parents,n,i)}function dL(e){var n=this._name,i=this._id;typeof e!="function"&&(e=Ix(e));for(var s=this._groups,a=s.length,f=[],d=[],l=0;l<a;++l)for(var u=s[l],c=u.length,v,m=0;m<c;++m)if(v=u[m]){for(var _=e.call(v,v.__data__,m,u),x,C=xr(v,i),S=0,p=_.length;S<p;++S)(x=_[S])&&Sh(x,n,i,S,_,C);f.push(_),d.push(v)}return new Si(f,d,n,i)}var mL=$l.prototype.constructor;function pL(){return new mL(this._groups,this._parents)}function gL(e,n){var i,s,a;return function(){var f=Zo(this,e),d=(this.style.removeProperty(e),Zo(this,e));return f===d?null:f===i&&d===s?a:a=n(i=f,s=d)}}function uw(e){return function(){this.style.removeProperty(e)}}function vL(e,n,i){var s,a=i+"",f;return function(){var d=Zo(this,e);return d===a?null:d===s?f:f=n(s=d,i)}}function _L(e,n,i){var s,a,f;return function(){var d=Zo(this,e),l=i(this),u=l+"";return l==null&&(u=l=(this.style.removeProperty(e),Zo(this,e))),d===u?null:d===s&&u===a?f:(a=u,f=n(s=d,l))}}function yL(e,n){var i,s,a,f="style."+n,d="end."+f,l;return function(){var u=Vr(this,e),c=u.on,v=u.value[f]==null?l||(l=uw(n)):void 0;(c!==i||a!==v)&&(s=(i=c).copy()).on(d,a=v),u.on=s}}function bL(e,n,i){var s=(e+="")=="transform"?SO:cw;return n==null?this.styleTween(e,gL(e,s)).on("end.style."+e,uw(e)):typeof n=="function"?this.styleTween(e,_L(e,s,jp(this,"style."+e,n))).each(yL(this._id,e)):this.styleTween(e,vL(e,s,n),i).on("end.style."+e,null)}function SL(e,n,i){return function(s){this.style.setProperty(e,n.call(this,s),i)}}function xL(e,n,i){var s,a;function f(){var d=n.apply(this,arguments);return d!==a&&(s=(a=d)&&SL(e,d,i)),s}return f._value=n,f}function wL(e,n,i){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(n==null)return this.tween(s,null);if(typeof n!="function")throw new Error;return this.tween(s,xL(e,n,i??""))}function CL(e){return function(){this.textContent=e}}function EL(e){return function(){var n=e(this);this.textContent=n??""}}function RL(e){return this.tween("text",typeof e=="function"?EL(jp(this,"text",e)):CL(e==null?"":e+""))}function AL(e){return function(n){this.textContent=e.call(this,n)}}function TL(e){var n,i;function s(){var a=e.apply(this,arguments);return a!==i&&(n=(i=a)&&AL(a)),n}return s._value=e,s}function ML(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,TL(e))}function DL(){for(var e=this._name,n=this._id,i=hw(),s=this._groups,a=s.length,f=0;f<a;++f)for(var d=s[f],l=d.length,u,c=0;c<l;++c)if(u=d[c]){var v=xr(u,n);Sh(u,e,i,c,d,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new Si(s,this._parents,e,i)}function OL(){var e,n,i=this,s=i._id,a=i.size();return new Promise(function(f,d){var l={value:d},u={value:function(){--a===0&&f()}};i.each(function(){var c=Vr(this,s),v=c.on;v!==e&&(n=(e=v).copy(),n._.cancel.push(l),n._.interrupt.push(l),n._.end.push(u)),c.on=n}),a===0&&f()})}var LL=0;function Si(e,n,i,s){this._groups=e,this._parents=n,this._name=i,this._id=s}function hw(){return++LL}var pi=$l.prototype;Si.prototype={constructor:Si,select:fL,selectAll:dL,selectChild:pi.selectChild,selectChildren:pi.selectChildren,filter:sL,merge:oL,selection:pL,transition:DL,call:pi.call,nodes:pi.nodes,node:pi.node,size:pi.size,empty:pi.empty,each:pi.each,on:cL,attr:$O,attrTween:KO,style:bL,styleTween:wL,text:RL,textTween:ML,remove:hL,tween:jO,delay:QO,duration:eL,ease:nL,easeVarying:iL,end:OL,[Symbol.iterator]:pi[Symbol.iterator]};function kL(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var NL={time:null,delay:0,duration:250,ease:kL};function BL(e,n){for(var i;!(i=e.__transition)||!(i=i[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return i}function jL(e){var n,i;e instanceof Si?(n=e._id,e=e._name):(n=hw(),(i=NL).time=kp(),e=e==null?null:e+"");for(var s=this._groups,a=s.length,f=0;f<a;++f)for(var d=s[f],l=d.length,u,c=0;c<l;++c)(u=d[c])&&Sh(u,e,n,c,d,i||BL(u,n));return new Si(s,this._parents,e,n)}$l.prototype.interrupt=kO;$l.prototype.transition=jL;const yu=e=>()=>e;function HL(e,{sourceEvent:n,target:i,transform:s,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:a}})}function vi(e,n,i){this.k=e,this.x=n,this.y=i}vi.prototype={constructor:vi,scale:function(e){return e===1?this:new vi(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new vi(this.k,this.x+this.k*e,this.y+this.k*n)},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 xh=new vi(1,0,0);fw.prototype=vi.prototype;function fw(e){for(;!e.__zoom;)if(!(e=e.parentNode))return xh;return e.__zoom}function sm(e){e.stopImmediatePropagation()}function ul(e){e.preventDefault(),e.stopImmediatePropagation()}function zL(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function PL(){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 hb(){return this.__zoom||xh}function IL(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function UL(){return navigator.maxTouchPoints||"ontouchstart"in this}function FL(e,n,i){var s=e.invertX(n[0][0])-i[0][0],a=e.invertX(n[1][0])-i[1][0],f=e.invertY(n[0][1])-i[0][1],d=e.invertY(n[1][1])-i[1][1];return e.translate(a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a),d>f?(f+d)/2:Math.min(0,f)||Math.max(0,d))}function dw(){var e=zL,n=PL,i=FL,s=IL,a=UL,f=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],l=250,u=ju,c=Fl("start","zoom","end"),v,m,_,x=500,C=150,S=0,p=10;function g(U){U.property("__zoom",hb).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",q).filter(a).on("touchstart.zoom",z).on("touchmove.zoom",I).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(U,G,H,K){var F=U.selection?U.selection():U;F.property("__zoom",hb),U!==F?M(U,G,H,K):F.interrupt().each(function(){O(this,arguments).event(K).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},g.scaleBy=function(U,G,H,K){g.scaleTo(U,function(){var F=this.__zoom.k,N=typeof G=="function"?G.apply(this,arguments):G;return F*N},H,K)},g.scaleTo=function(U,G,H,K){g.transform(U,function(){var F=n.apply(this,arguments),N=this.__zoom,$=H==null?E(F):typeof H=="function"?H.apply(this,arguments):H,B=N.invert($),P=typeof G=="function"?G.apply(this,arguments):G;return i(y(b(N,P),$,B),F,d)},H,K)},g.translateBy=function(U,G,H,K){g.transform(U,function(){return i(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof H=="function"?H.apply(this,arguments):H),n.apply(this,arguments),d)},null,K)},g.translateTo=function(U,G,H,K,F){g.transform(U,function(){var N=n.apply(this,arguments),$=this.__zoom,B=K==null?E(N):typeof K=="function"?K.apply(this,arguments):K;return i(xh.translate(B[0],B[1]).scale($.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof H=="function"?-H.apply(this,arguments):-H),N,d)},K,F)};function b(U,G){return G=Math.max(f[0],Math.min(f[1],G)),G===U.k?U:new vi(G,U.x,U.y)}function y(U,G,H){var K=G[0]-H[0]*U.k,F=G[1]-H[1]*U.k;return K===U.x&&F===U.y?U:new vi(U.k,K,F)}function E(U){return[(+U[0][0]+ +U[1][0])/2,(+U[0][1]+ +U[1][1])/2]}function M(U,G,H,K){U.on("start.zoom",function(){O(this,arguments).event(K).start()}).on("interrupt.zoom end.zoom",function(){O(this,arguments).event(K).end()}).tween("zoom",function(){var F=this,N=arguments,$=O(F,N).event(K),B=n.apply(F,N),P=H==null?E(B):typeof H=="function"?H.apply(F,N):H,Q=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),J=F.__zoom,ae=typeof G=="function"?G.apply(F,N):G,Z=u(J.invert(P).concat(Q/J.k),ae.invert(P).concat(Q/ae.k));return function(X){if(X===1)X=ae;else{var V=Z(X),ie=Q/V[2];X=new vi(ie,P[0]-V[0]*ie,P[1]-V[1]*ie)}$.zoom(null,X)}})}function O(U,G,H){return!H&&U.__zooming||new T(U,G)}function T(U,G){this.that=U,this.args=G,this.active=0,this.sourceEvent=null,this.extent=n.apply(U,G),this.taps=0}T.prototype={event:function(U){return U&&(this.sourceEvent=U),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(U,G){return this.mouse&&U!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&U!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&U!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(U){var G=$n(this.that).datum();c.call(U,this.that,new HL(U,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:c}),G)}};function A(U,...G){if(!e.apply(this,arguments))return;var H=O(this,G).event(U),K=this.__zoom,F=Math.max(f[0],Math.min(f[1],K.k*Math.pow(2,s.apply(this,arguments)))),N=dr(U);if(H.wheel)(H.mouse[0][0]!==N[0]||H.mouse[0][1]!==N[1])&&(H.mouse[1]=K.invert(H.mouse[0]=N)),clearTimeout(H.wheel);else{if(K.k===F)return;H.mouse=[N,K.invert(N)],Pu(this),H.start()}ul(U),H.wheel=setTimeout($,C),H.zoom("mouse",i(y(b(K,F),H.mouse[0],H.mouse[1]),H.extent,d));function $(){H.wheel=null,H.end()}}function k(U,...G){if(_||!e.apply(this,arguments))return;var H=U.currentTarget,K=O(this,G,!0).event(U),F=$n(U.view).on("mousemove.zoom",P,!0).on("mouseup.zoom",Q,!0),N=dr(U,H),$=U.clientX,B=U.clientY;Qx(U.view),sm(U),K.mouse=[N,this.__zoom.invert(N)],Pu(this),K.start();function P(J){if(ul(J),!K.moved){var ae=J.clientX-$,Z=J.clientY-B;K.moved=ae*ae+Z*Z>S}K.event(J).zoom("mouse",i(y(K.that.__zoom,K.mouse[0]=dr(J,H),K.mouse[1]),K.extent,d))}function Q(J){F.on("mousemove.zoom mouseup.zoom",null),Zx(J.view,K.moved),ul(J),K.event(J).end()}}function q(U,...G){if(e.apply(this,arguments)){var H=this.__zoom,K=dr(U.changedTouches?U.changedTouches[0]:U,this),F=H.invert(K),N=H.k*(U.shiftKey?.5:2),$=i(y(b(H,N),K,F),n.apply(this,G),d);ul(U),l>0?$n(this).transition().duration(l).call(M,$,K,U):$n(this).call(g.transform,$,K,U)}}function z(U,...G){if(e.apply(this,arguments)){var H=U.touches,K=H.length,F=O(this,G,U.changedTouches.length===K).event(U),N,$,B,P;for(sm(U),$=0;$<K;++$)B=H[$],P=dr(B,this),P=[P,this.__zoom.invert(P),B.identifier],F.touch0?!F.touch1&&F.touch0[2]!==P[2]&&(F.touch1=P,F.taps=0):(F.touch0=P,N=!0,F.taps=1+!!v);v&&(v=clearTimeout(v)),N&&(F.taps<2&&(m=P[0],v=setTimeout(function(){v=null},x)),Pu(this),F.start())}}function I(U,...G){if(this.__zooming){var H=O(this,G).event(U),K=U.changedTouches,F=K.length,N,$,B,P;for(ul(U),N=0;N<F;++N)$=K[N],B=dr($,this),H.touch0&&H.touch0[2]===$.identifier?H.touch0[0]=B:H.touch1&&H.touch1[2]===$.identifier&&(H.touch1[0]=B);if($=H.that.__zoom,H.touch1){var Q=H.touch0[0],J=H.touch0[1],ae=H.touch1[0],Z=H.touch1[1],X=(X=ae[0]-Q[0])*X+(X=ae[1]-Q[1])*X,V=(V=Z[0]-J[0])*V+(V=Z[1]-J[1])*V;$=b($,Math.sqrt(X/V)),B=[(Q[0]+ae[0])/2,(Q[1]+ae[1])/2],P=[(J[0]+Z[0])/2,(J[1]+Z[1])/2]}else if(H.touch0)B=H.touch0[0],P=H.touch0[1];else return;H.zoom("touch",i(y($,B,P),H.extent,d))}}function W(U,...G){if(this.__zooming){var H=O(this,G).event(U),K=U.changedTouches,F=K.length,N,$;for(sm(U),_&&clearTimeout(_),_=setTimeout(function(){_=null},x),N=0;N<F;++N)$=K[N],H.touch0&&H.touch0[2]===$.identifier?delete H.touch0:H.touch1&&H.touch1[2]===$.identifier&&delete H.touch1;if(H.touch1&&!H.touch0&&(H.touch0=H.touch1,delete H.touch1),H.touch0)H.touch0[1]=this.__zoom.invert(H.touch0[0]);else if(H.end(),H.taps===2&&($=dr($,this),Math.hypot(m[0]-$[0],m[1]-$[1])<p)){var B=$n(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return g.wheelDelta=function(U){return arguments.length?(s=typeof U=="function"?U:yu(+U),g):s},g.filter=function(U){return arguments.length?(e=typeof U=="function"?U:yu(!!U),g):e},g.touchable=function(U){return arguments.length?(a=typeof U=="function"?U:yu(!!U),g):a},g.extent=function(U){return arguments.length?(n=typeof U=="function"?U:yu([[+U[0][0],+U[0][1]],[+U[1][0],+U[1][1]]]),g):n},g.scaleExtent=function(U){return arguments.length?(f[0]=+U[0],f[1]=+U[1],g):[f[0],f[1]]},g.translateExtent=function(U){return arguments.length?(d[0][0]=+U[0][0],d[1][0]=+U[1][0],d[0][1]=+U[0][1],d[1][1]=+U[1][1],g):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},g.constrain=function(U){return arguments.length?(i=U,g):i},g.duration=function(U){return arguments.length?(l=+U,g):l},g.interpolate=function(U){return arguments.length?(u=U,g):u},g.on=function(){var U=c.on.apply(c,arguments);return U===c?g:U},g.clickDistance=function(U){return arguments.length?(S=(U=+U)*U,g):Math.sqrt(S)},g.tapDistance=function(U){return arguments.length?(p=+U,g):p},g}const Ur={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:n,sourceHandle:i,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?i:s}", edge id: ${n}.`,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."},Al=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],mw=["Enter"," ","Escape"],pw={"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:n,y:i})=>`Moved selected node ${e}. New position, x: ${n}, y: ${i}`,"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 ea;(function(e){e.Strict="strict",e.Loose="loose"})(ea||(ea={}));var zs;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(zs||(zs={}));var Tl;(function(e){e.Partial="partial",e.Full="full"})(Tl||(Tl={}));const gw={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ns;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ns||(ns={}));var th;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(th||(th={}));var Ne;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ne||(Ne={}));const fb={[Ne.Left]:Ne.Right,[Ne.Right]:Ne.Left,[Ne.Top]:Ne.Bottom,[Ne.Bottom]:Ne.Top};function vw(e){return e===null?null:e?"valid":"invalid"}const _w=e=>"id"in e&&"source"in e&&"target"in e,$L=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Hp=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),ql=(e,n=[0,0])=>{const{width:i,height:s}=Ci(e),a=e.origin??n,f=i*a[0],d=s*a[1];return{x:e.position.x-f,y:e.position.y-d}},VL=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const i=e.reduce((s,a)=>{const f=typeof a=="string";let d=!n.nodeLookup&&!f?a:void 0;n.nodeLookup&&(d=f?n.nodeLookup.get(a):Hp(a)?a:n.nodeLookup.get(a.id));const l=d?nh(d,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return wh(s,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ch(i)},Wl=(e,n={})=>{let i={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return e.forEach(a=>{(n.filter===void 0||n.filter(a))&&(i=wh(i,nh(a)),s=!0)}),s?Ch(i):{x:0,y:0,width:0,height:0}},zp=(e,n,[i,s,a]=[0,0,1],f=!1,d=!1)=>{const l={...Kl(n,[i,s,a]),width:n.width/a,height:n.height/a},u=[];for(const c of e.values()){const{measured:v,selectable:m=!0,hidden:_=!1}=c;if(d&&!m||_)continue;const x=v.width??c.width??c.initialWidth??null,C=v.height??c.height??c.initialHeight??null,S=Ml(l,na(c)),p=(x??0)*(C??0),g=f&&S>0;(!c.internals.handleBounds||g||S>=p||c.dragging)&&u.push(c)}return u},qL=(e,n)=>{const i=new Set;return e.forEach(s=>{i.add(s.id)}),n.filter(s=>i.has(s.source)||i.has(s.target))};function WL(e,n){const i=new Map,s=n?.nodes?new Set(n.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&(n?.includeHiddenNodes||!a.hidden)&&(!s||s.has(a.id))&&i.set(a.id,a)}),i}async function YL({nodes:e,width:n,height:i,panZoom:s,minZoom:a,maxZoom:f},d){if(e.size===0)return Promise.resolve(!0);const l=WL(e,d),u=Wl(l),c=Pp(u,n,i,d?.minZoom??a,d?.maxZoom??f,d?.padding??.1);return await s.setViewport(c,{duration:d?.duration,ease:d?.ease,interpolate:d?.interpolate}),Promise.resolve(!0)}function yw({nodeId:e,nextPosition:n,nodeLookup:i,nodeOrigin:s=[0,0],nodeExtent:a,onError:f}){const d=i.get(e),l=d.parentId?i.get(d.parentId):void 0,{x:u,y:c}=l?l.internals.positionAbsolute:{x:0,y:0},v=d.origin??s;let m=d.extent||a;if(d.extent==="parent"&&!d.expandParent)if(!l)f?.("005",Ur.error005());else{const x=l.measured.width,C=l.measured.height;x&&C&&(m=[[u,c],[u+x,c+C]])}else l&&ra(d.extent)&&(m=[[d.extent[0][0]+u,d.extent[0][1]+c],[d.extent[1][0]+u,d.extent[1][1]+c]]);const _=ra(m)?Vs(n,m,d.measured):n;return(d.measured.width===void 0||d.measured.height===void 0)&&f?.("015",Ur.error015()),{position:{x:_.x-u+(d.measured.width??0)*v[0],y:_.y-c+(d.measured.height??0)*v[1]},positionAbsolute:_}}async function KL({nodesToRemove:e=[],edgesToRemove:n=[],nodes:i,edges:s,onBeforeDelete:a}){const f=new Set(e.map(_=>_.id)),d=[];for(const _ of i){if(_.deletable===!1)continue;const x=f.has(_.id),C=!x&&_.parentId&&d.find(S=>S.id===_.parentId);(x||C)&&d.push(_)}const l=new Set(n.map(_=>_.id)),u=s.filter(_=>_.deletable!==!1),v=qL(d,u);for(const _ of u)l.has(_.id)&&!v.find(C=>C.id===_.id)&&v.push(_);if(!a)return{edges:v,nodes:d};const m=await a({nodes:d,edges:v});return typeof m=="boolean"?m?{edges:v,nodes:d}:{edges:[],nodes:[]}:m}const ta=(e,n=0,i=1)=>Math.min(Math.max(e,n),i),Vs=(e={x:0,y:0},n,i)=>({x:ta(e.x,n[0][0],n[1][0]-(i?.width??0)),y:ta(e.y,n[0][1],n[1][1]-(i?.height??0))});function bw(e,n,i){const{width:s,height:a}=Ci(i),{x:f,y:d}=i.internals.positionAbsolute;return Vs(e,[[f,d],[f+s,d+a]],n)}const db=(e,n,i)=>e<n?ta(Math.abs(e-n),1,n)/n:e>i?-ta(Math.abs(e-i),1,n)/n:0,Sw=(e,n,i=15,s=40)=>{const a=db(e.x,s,n.width-s)*i,f=db(e.y,s,n.height-s)*i;return[a,f]},wh=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),Wm=({x:e,y:n,width:i,height:s})=>({x:e,y:n,x2:e+i,y2:n+s}),Ch=({x:e,y:n,x2:i,y2:s})=>({x:e,y:n,width:i-e,height:s-n}),na=(e,n=[0,0])=>{const{x:i,y:s}=Hp(e)?e.internals.positionAbsolute:ql(e,n);return{x:i,y:s,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},nh=(e,n=[0,0])=>{const{x:i,y:s}=Hp(e)?e.internals.positionAbsolute:ql(e,n);return{x:i,y:s,x2:i+(e.measured?.width??e.width??e.initialWidth??0),y2:s+(e.measured?.height??e.height??e.initialHeight??0)}},xw=(e,n)=>Ch(wh(Wm(e),Wm(n))),Ml=(e,n)=>{const i=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),s=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(i*s)},mb=e=>gr(e.width)&&gr(e.height)&&gr(e.x)&&gr(e.y),gr=e=>!isNaN(e)&&isFinite(e),GL=(e,n)=>{},Yl=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),Kl=({x:e,y:n},[i,s,a],f=!1,d=[1,1])=>{const l={x:(e-i)/a,y:(n-s)/a};return f?Yl(l,d):l},rh=({x:e,y:n},[i,s,a])=>({x:e*a+i,y:n*a+s});function Po(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(i)}if(typeof e=="string"&&e.endsWith("%")){const i=parseFloat(e);if(!Number.isNaN(i))return Math.floor(n*i*.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 XL(e,n,i){if(typeof e=="string"||typeof e=="number"){const s=Po(e,i),a=Po(e,n);return{top:s,right:a,bottom:s,left:a,x:a*2,y:s*2}}if(typeof e=="object"){const s=Po(e.top??e.y??0,i),a=Po(e.bottom??e.y??0,i),f=Po(e.left??e.x??0,n),d=Po(e.right??e.x??0,n);return{top:s,right:d,bottom:a,left:f,x:f+d,y:s+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function QL(e,n,i,s,a,f){const{x:d,y:l}=rh(e,[n,i,s]),{x:u,y:c}=rh({x:e.x+e.width,y:e.y+e.height},[n,i,s]),v=a-u,m=f-c;return{left:Math.floor(d),top:Math.floor(l),right:Math.floor(v),bottom:Math.floor(m)}}const Pp=(e,n,i,s,a,f)=>{const d=XL(f,n,i),l=(n-d.x)/e.width,u=(i-d.y)/e.height,c=Math.min(l,u),v=ta(c,s,a),m=e.x+e.width/2,_=e.y+e.height/2,x=n/2-m*v,C=i/2-_*v,S=QL(e,x,C,v,n,i),p={left:Math.min(S.left-d.left,0),top:Math.min(S.top-d.top,0),right:Math.min(S.right-d.right,0),bottom:Math.min(S.bottom-d.bottom,0)};return{x:x-p.left+p.right,y:C-p.top+p.bottom,zoom:v}},Dl=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function ra(e){return e!=null&&e!=="parent"}function Ci(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function ww(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Cw(e,n={width:0,height:0},i,s,a){const f={...e},d=s.get(i);if(d){const l=d.origin||a;f.x+=d.internals.positionAbsolute.x-(n.width??0)*l[0],f.y+=d.internals.positionAbsolute.y-(n.height??0)*l[1]}return f}function pb(e,n){if(e.size!==n.size)return!1;for(const i of e)if(!n.has(i))return!1;return!0}function ZL(){let e,n;return{promise:new Promise((s,a)=>{e=s,n=a}),resolve:e,reject:n}}function JL(e){return{...pw,...e||{}}}function _l(e,{snapGrid:n=[0,0],snapToGrid:i=!1,transform:s,containerBounds:a}){const{x:f,y:d}=vr(e),l=Kl({x:f-(a?.left??0),y:d-(a?.top??0)},s),{x:u,y:c}=i?Yl(l,n):l;return{xSnapped:u,ySnapped:c,...l}}const Ip=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ew=e=>e?.getRootNode?.()||window?.document,ek=["INPUT","SELECT","TEXTAREA"];function Rw(e){const n=e.composedPath?.()?.[0]||e.target;return n?.nodeType!==1?!1:ek.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const Aw=e=>"clientX"in e,vr=(e,n)=>{const i=Aw(e),s=i?e.clientX:e.touches?.[0].clientX,a=i?e.clientY:e.touches?.[0].clientY;return{x:s-(n?.left??0),y:a-(n?.top??0)}},gb=(e,n,i,s,a)=>{const f=n.querySelectorAll(`.${e}`);return!f||!f.length?null:Array.from(f).map(d=>{const l=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:e,nodeId:a,position:d.getAttribute("data-handlepos"),x:(l.left-i.left)/s,y:(l.top-i.top)/s,...Ip(d)}})};function Tw({sourceX:e,sourceY:n,targetX:i,targetY:s,sourceControlX:a,sourceControlY:f,targetControlX:d,targetControlY:l}){const u=e*.125+a*.375+d*.375+i*.125,c=n*.125+f*.375+l*.375+s*.125,v=Math.abs(u-e),m=Math.abs(c-n);return[u,c,v,m]}function bu(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function vb({pos:e,x1:n,y1:i,x2:s,y2:a,c:f}){switch(e){case Ne.Left:return[n-bu(n-s,f),i];case Ne.Right:return[n+bu(s-n,f),i];case Ne.Top:return[n,i-bu(i-a,f)];case Ne.Bottom:return[n,i+bu(a-i,f)]}}function Up({sourceX:e,sourceY:n,sourcePosition:i=Ne.Bottom,targetX:s,targetY:a,targetPosition:f=Ne.Top,curvature:d=.25}){const[l,u]=vb({pos:i,x1:e,y1:n,x2:s,y2:a,c:d}),[c,v]=vb({pos:f,x1:s,y1:a,x2:e,y2:n,c:d}),[m,_,x,C]=Tw({sourceX:e,sourceY:n,targetX:s,targetY:a,sourceControlX:l,sourceControlY:u,targetControlX:c,targetControlY:v});return[`M${e},${n} C${l},${u} ${c},${v} ${s},${a}`,m,_,x,C]}function Mw({sourceX:e,sourceY:n,targetX:i,targetY:s}){const a=Math.abs(i-e)/2,f=i<e?i+a:i-a,d=Math.abs(s-n)/2,l=s<n?s+d:s-d;return[f,l,a,d]}function tk({sourceNode:e,targetNode:n,selected:i=!1,zIndex:s=0,elevateOnSelect:a=!1,zIndexMode:f="basic"}){if(f==="manual")return s;const d=a&&i?s+1e3:s,l=Math.max(e.parentId||a&&e.selected?e.internals.z:0,n.parentId||a&&n.selected?n.internals.z:0);return d+l}function nk({sourceNode:e,targetNode:n,width:i,height:s,transform:a}){const f=wh(nh(e),nh(n));f.x===f.x2&&(f.x2+=1),f.y===f.y2&&(f.y2+=1);const d={x:-a[0]/a[2],y:-a[1]/a[2],width:i/a[2],height:s/a[2]};return Ml(d,Ch(f))>0}const rk=({source:e,sourceHandle:n,target:i,targetHandle:s})=>`xy-edge__${e}${n||""}-${i}${s||""}`,ik=(e,n)=>n.some(i=>i.source===e.source&&i.target===e.target&&(i.sourceHandle===e.sourceHandle||!i.sourceHandle&&!e.sourceHandle)&&(i.targetHandle===e.targetHandle||!i.targetHandle&&!e.targetHandle)),sk=(e,n,i={})=>{if(!e.source||!e.target)return n;const s=i.getEdgeId||rk;let a;return _w(e)?a={...e}:a={...e,id:s(e)},ik(a,n)?n:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,n.concat(a))};function Dw({sourceX:e,sourceY:n,targetX:i,targetY:s}){const[a,f,d,l]=Mw({sourceX:e,sourceY:n,targetX:i,targetY:s});return[`M ${e},${n}L ${i},${s}`,a,f,d,l]}const _b={[Ne.Left]:{x:-1,y:0},[Ne.Right]:{x:1,y:0},[Ne.Top]:{x:0,y:-1},[Ne.Bottom]:{x:0,y:1}},ok=({source:e,sourcePosition:n=Ne.Bottom,target:i})=>n===Ne.Left||n===Ne.Right?e.x<i.x?{x:1,y:0}:{x:-1,y:0}:e.y<i.y?{x:0,y:1}:{x:0,y:-1},yb=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function ak({source:e,sourcePosition:n=Ne.Bottom,target:i,targetPosition:s=Ne.Top,center:a,offset:f,stepPosition:d}){const l=_b[n],u=_b[s],c={x:e.x+l.x*f,y:e.y+l.y*f},v={x:i.x+u.x*f,y:i.y+u.y*f},m=ok({source:c,sourcePosition:n,target:v}),_=m.x!==0?"x":"y",x=m[_];let C=[],S,p;const g={x:0,y:0},b={x:0,y:0},[,,y,E]=Mw({sourceX:e.x,sourceY:e.y,targetX:i.x,targetY:i.y});if(l[_]*u[_]===-1){_==="x"?(S=a.x??c.x+(v.x-c.x)*d,p=a.y??(c.y+v.y)/2):(S=a.x??(c.x+v.x)/2,p=a.y??c.y+(v.y-c.y)*d);const O=[{x:S,y:c.y},{x:S,y:v.y}],T=[{x:c.x,y:p},{x:v.x,y:p}];l[_]===x?C=_==="x"?O:T:C=_==="x"?T:O}else{const O=[{x:c.x,y:v.y}],T=[{x:v.x,y:c.y}];if(_==="x"?C=l.x===x?T:O:C=l.y===x?O:T,n===s){const I=Math.abs(e[_]-i[_]);if(I<=f){const W=Math.min(f-1,f-I);l[_]===x?g[_]=(c[_]>e[_]?-1:1)*W:b[_]=(v[_]>i[_]?-1:1)*W}}if(n!==s){const I=_==="x"?"y":"x",W=l[_]===u[I],U=c[I]>v[I],G=c[I]<v[I];(l[_]===1&&(!W&&U||W&&G)||l[_]!==1&&(!W&&G||W&&U))&&(C=_==="x"?O:T)}const A={x:c.x+g.x,y:c.y+g.y},k={x:v.x+b.x,y:v.y+b.y},q=Math.max(Math.abs(A.x-C[0].x),Math.abs(k.x-C[0].x)),z=Math.max(Math.abs(A.y-C[0].y),Math.abs(k.y-C[0].y));q>=z?(S=(A.x+k.x)/2,p=C[0].y):(S=C[0].x,p=(A.y+k.y)/2)}return[[e,{x:c.x+g.x,y:c.y+g.y},...C,{x:v.x+b.x,y:v.y+b.y},i],S,p,y,E]}function lk(e,n,i,s){const a=Math.min(yb(e,n)/2,yb(n,i)/2,s),{x:f,y:d}=n;if(e.x===f&&f===i.x||e.y===d&&d===i.y)return`L${f} ${d}`;if(e.y===d){const c=e.x<i.x?-1:1,v=e.y<i.y?1:-1;return`L ${f+a*c},${d}Q ${f},${d} ${f},${d+a*v}`}const l=e.x<i.x?1:-1,u=e.y<i.y?-1:1;return`L ${f},${d+a*u}Q ${f},${d} ${f+a*l},${d}`}function Ym({sourceX:e,sourceY:n,sourcePosition:i=Ne.Bottom,targetX:s,targetY:a,targetPosition:f=Ne.Top,borderRadius:d=5,centerX:l,centerY:u,offset:c=20,stepPosition:v=.5}){const[m,_,x,C,S]=ak({source:{x:e,y:n},sourcePosition:i,target:{x:s,y:a},targetPosition:f,center:{x:l,y:u},offset:c,stepPosition:v});return[m.reduce((g,b,y)=>{let E="";return y>0&&y<m.length-1?E=lk(m[y-1],b,m[y+1],d):E=`${y===0?"M":"L"}${b.x} ${b.y}`,g+=E,g},""),_,x,C,S]}function bb(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function ck(e){const{sourceNode:n,targetNode:i}=e;if(!bb(n)||!bb(i))return null;const s=n.internals.handleBounds||Sb(n.handles),a=i.internals.handleBounds||Sb(i.handles),f=xb(s?.source??[],e.sourceHandle),d=xb(e.connectionMode===ea.Strict?a?.target??[]:(a?.target??[]).concat(a?.source??[]),e.targetHandle);if(!f||!d)return e.onError?.("008",Ur.error008(f?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=f?.position||Ne.Bottom,u=d?.position||Ne.Top,c=qs(n,f,l),v=qs(i,d,u);return{sourceX:c.x,sourceY:c.y,targetX:v.x,targetY:v.y,sourcePosition:l,targetPosition:u}}function Sb(e){if(!e)return null;const n=[],i=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?n.push(s):s.type==="target"&&i.push(s);return{source:n,target:i}}function qs(e,n,i=Ne.Left,s=!1){const a=(n?.x??0)+e.internals.positionAbsolute.x,f=(n?.y??0)+e.internals.positionAbsolute.y,{width:d,height:l}=n??Ci(e);if(s)return{x:a+d/2,y:f+l/2};switch(n?.position??i){case Ne.Top:return{x:a+d/2,y:f};case Ne.Right:return{x:a+d,y:f+l/2};case Ne.Bottom:return{x:a+d/2,y:f+l};case Ne.Left:return{x:a,y:f+l/2}}}function xb(e,n){return e&&(n?e.find(i=>i.id===n):e[0])||null}function Km(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function uk(e,{id:n,defaultColor:i,defaultMarkerStart:s,defaultMarkerEnd:a}){const f=new Set;return e.reduce((d,l)=>([l.markerStart||s,l.markerEnd||a].forEach(u=>{if(u&&typeof u=="object"){const c=Km(u,n);f.has(c)||(d.push({id:c,color:u.color||i,...u}),f.add(c))}}),d),[]).sort((d,l)=>d.id.localeCompare(l.id))}const Ow=1e3,hk=10,Fp={nodeOrigin:[0,0],nodeExtent:Al,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},fk={...Fp,checkEquality:!0};function $p(e,n){const i={...e};for(const s in n)n[s]!==void 0&&(i[s]=n[s]);return i}function dk(e,n,i){const s=$p(Fp,i);for(const a of e.values())if(a.parentId)qp(a,e,n,s);else{const f=ql(a,s.nodeOrigin),d=ra(a.extent)?a.extent:s.nodeExtent,l=Vs(f,d,Ci(a));a.internals.positionAbsolute=l}}function mk(e,n){if(!e.handles)return e.measured?n?.internals.handleBounds:void 0;const i=[],s=[];for(const a of e.handles){const f={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?i.push(f):a.type==="target"&&s.push(f)}return{source:i,target:s}}function Vp(e){return e==="manual"}function Gm(e,n,i,s={}){const a=$p(fk,s),f={i:0},d=new Map(n),l=a?.elevateNodesOnSelect&&!Vp(a.zIndexMode)?Ow:0;let u=e.length>0;n.clear(),i.clear();for(const c of e){let v=d.get(c.id);if(a.checkEquality&&c===v?.internals.userNode)n.set(c.id,v);else{const m=ql(c,a.nodeOrigin),_=ra(c.extent)?c.extent:a.nodeExtent,x=Vs(m,_,Ci(c));v={...a.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:x,handleBounds:mk(c,v),z:Lw(c,l,a.zIndexMode),userNode:c}},n.set(c.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(u=!1),c.parentId&&qp(v,n,i,s,f)}return u}function pk(e,n){if(!e.parentId)return;const i=n.get(e.parentId);i?i.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function qp(e,n,i,s,a){const{elevateNodesOnSelect:f,nodeOrigin:d,nodeExtent:l,zIndexMode:u}=$p(Fp,s),c=e.parentId,v=n.get(c);if(!v){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}pk(e,i),a&&!v.parentId&&v.internals.rootParentIndex===void 0&&u==="auto"&&(v.internals.rootParentIndex=++a.i,v.internals.z=v.internals.z+a.i*hk),a&&v.internals.rootParentIndex!==void 0&&(a.i=v.internals.rootParentIndex);const m=f&&!Vp(u)?Ow:0,{x:_,y:x,z:C}=gk(e,v,d,l,m,u),{positionAbsolute:S}=e.internals,p=_!==S.x||x!==S.y;(p||C!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:p?{x:_,y:x}:S,z:C}})}function Lw(e,n,i){const s=gr(e.zIndex)?e.zIndex:0;return Vp(i)?s:s+(e.selected?n:0)}function gk(e,n,i,s,a,f){const{x:d,y:l}=n.internals.positionAbsolute,u=Ci(e),c=ql(e,i),v=ra(e.extent)?Vs(c,e.extent,u):c;let m=Vs({x:d+v.x,y:l+v.y},s,u);e.extent==="parent"&&(m=bw(m,u,n));const _=Lw(e,a,f),x=n.internals.z??0;return{x:m.x,y:m.y,z:x>=_?x+1:_}}function Wp(e,n,i,s=[0,0]){const a=[],f=new Map;for(const d of e){const l=n.get(d.parentId);if(!l)continue;const u=f.get(d.parentId)?.expandedRect??na(l),c=xw(u,d.rect);f.set(d.parentId,{expandedRect:c,parent:l})}return f.size>0&&f.forEach(({expandedRect:d,parent:l},u)=>{const c=l.internals.positionAbsolute,v=Ci(l),m=l.origin??s,_=d.x<c.x?Math.round(Math.abs(c.x-d.x)):0,x=d.y<c.y?Math.round(Math.abs(c.y-d.y)):0,C=Math.max(v.width,Math.round(d.width)),S=Math.max(v.height,Math.round(d.height)),p=(C-v.width)*m[0],g=(S-v.height)*m[1];(_>0||x>0||p||g)&&(a.push({id:u,type:"position",position:{x:l.position.x-_+p,y:l.position.y-x+g}}),i.get(u)?.forEach(b=>{e.some(y=>y.id===b.id)||a.push({id:b.id,type:"position",position:{x:b.position.x+_,y:b.position.y+x}})})),(v.width<d.width||v.height<d.height||_||x)&&a.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:C+(_?m[0]*_-p:0),height:S+(x?m[1]*x-g:0)}})}),a}function vk(e,n,i,s,a,f,d){const l=s?.querySelector(".xyflow__viewport");let u=!1;if(!l)return{changes:[],updatedInternals:u};const c=[],v=window.getComputedStyle(l),{m22:m}=new window.DOMMatrixReadOnly(v.transform),_=[];for(const x of e.values()){const C=n.get(x.id);if(!C)continue;if(C.hidden){n.set(C.id,{...C,internals:{...C.internals,handleBounds:void 0}}),u=!0;continue}const S=Ip(x.nodeElement),p=C.measured.width!==S.width||C.measured.height!==S.height;if(!!(S.width&&S.height&&(p||!C.internals.handleBounds||x.force))){const b=x.nodeElement.getBoundingClientRect(),y=ra(C.extent)?C.extent:f;let{positionAbsolute:E}=C.internals;C.parentId&&C.extent==="parent"?E=bw(E,S,n.get(C.parentId)):y&&(E=Vs(E,y,S));const M={...C,measured:S,internals:{...C.internals,positionAbsolute:E,handleBounds:{source:gb("source",x.nodeElement,b,m,C.id),target:gb("target",x.nodeElement,b,m,C.id)}}};n.set(C.id,M),C.parentId&&qp(M,n,i,{nodeOrigin:a,zIndexMode:d}),u=!0,p&&(c.push({id:C.id,type:"dimensions",dimensions:S}),C.expandParent&&C.parentId&&_.push({id:C.id,parentId:C.parentId,rect:na(M,a)}))}}if(_.length>0){const x=Wp(_,n,i,a);c.push(...x)}return{changes:c,updatedInternals:u}}async function _k({delta:e,panZoom:n,transform:i,translateExtent:s,width:a,height:f}){if(!n||!e.x&&!e.y)return Promise.resolve(!1);const d=await n.setViewportConstrained({x:i[0]+e.x,y:i[1]+e.y,zoom:i[2]},[[0,0],[a,f]],s),l=!!d&&(d.x!==i[0]||d.y!==i[1]||d.k!==i[2]);return Promise.resolve(l)}function wb(e,n,i,s,a,f){let d=a;const l=s.get(d)||new Map;s.set(d,l.set(i,n)),d=`${a}-${e}`;const u=s.get(d)||new Map;if(s.set(d,u.set(i,n)),f){d=`${a}-${e}-${f}`;const c=s.get(d)||new Map;s.set(d,c.set(i,n))}}function kw(e,n,i){e.clear(),n.clear();for(const s of i){const{source:a,target:f,sourceHandle:d=null,targetHandle:l=null}=s,u={edgeId:s.id,source:a,target:f,sourceHandle:d,targetHandle:l},c=`${a}-${d}--${f}-${l}`,v=`${f}-${l}--${a}-${d}`;wb("source",u,v,e,a,d),wb("target",u,c,e,f,l),n.set(s.id,s)}}function Nw(e,n){if(!e.parentId)return!1;const i=n.get(e.parentId);return i?i.selected?!0:Nw(i,n):!1}function Cb(e,n,i){let s=e;do{if(s?.matches?.(n))return!0;if(s===i)return!1;s=s?.parentElement}while(s);return!1}function yk(e,n,i,s){const a=new Map;for(const[f,d]of e)if((d.selected||d.id===s)&&(!d.parentId||!Nw(d,e))&&(d.draggable||n&&typeof d.draggable>"u")){const l=e.get(f);l&&a.set(f,{id:f,position:l.position||{x:0,y:0},distance:{x:i.x-l.internals.positionAbsolute.x,y:i.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return a}function om({nodeId:e,dragItems:n,nodeLookup:i,dragging:s=!0}){const a=[];for(const[d,l]of n){const u=i.get(d)?.internals.userNode;u&&a.push({...u,position:l.position,dragging:s})}if(!e)return[a[0],a];const f=i.get(e)?.internals.userNode;return[f?{...f,position:n.get(e)?.position||f.position,dragging:s}:a[0],a]}function bk({dragItems:e,snapGrid:n,x:i,y:s}){const a=e.values().next().value;if(!a)return null;const f={x:i-a.distance.x,y:s-a.distance.y},d=Yl(f,n);return{x:d.x-f.x,y:d.y-f.y}}function Sk({onNodeMouseDown:e,getStoreItems:n,onDragStart:i,onDrag:s,onDragStop:a}){let f={x:null,y:null},d=0,l=new Map,u=!1,c={x:0,y:0},v=null,m=!1,_=null,x=!1,C=!1,S=null;function p({noDragClassName:b,handleSelector:y,domNode:E,isSelectable:M,nodeId:O,nodeClickDistance:T=0}){_=$n(E);function A({x:I,y:W}){const{nodeLookup:U,nodeExtent:G,snapGrid:H,snapToGrid:K,nodeOrigin:F,onNodeDrag:N,onSelectionDrag:$,onError:B,updateNodePositions:P}=n();f={x:I,y:W};let Q=!1;const J=l.size>1,ae=J&&G?Wm(Wl(l)):null,Z=J&&K?bk({dragItems:l,snapGrid:H,x:I,y:W}):null;for(const[X,V]of l){if(!U.has(X))continue;let ie={x:I-V.distance.x,y:W-V.distance.y};K&&(ie=Z?{x:Math.round(ie.x+Z.x),y:Math.round(ie.y+Z.y)}:Yl(ie,H));let de=null;if(J&&G&&!V.extent&&ae){const{positionAbsolute:_e}=V.internals,Ce=_e.x-ae.x+G[0][0],He=_e.x+V.measured.width-ae.x2+G[1][0],Be=_e.y-ae.y+G[0][1],we=_e.y+V.measured.height-ae.y2+G[1][1];de=[[Ce,Be],[He,we]]}const{position:re,positionAbsolute:le}=yw({nodeId:X,nextPosition:ie,nodeLookup:U,nodeExtent:de||G,nodeOrigin:F,onError:B});Q=Q||V.position.x!==re.x||V.position.y!==re.y,V.position=re,V.internals.positionAbsolute=le}if(C=C||Q,!!Q&&(P(l,!0),S&&(s||N||!O&&$))){const[X,V]=om({nodeId:O,dragItems:l,nodeLookup:U});s?.(S,l,X,V),N?.(S,X,V),O||$?.(S,V)}}async function k(){if(!v)return;const{transform:I,panBy:W,autoPanSpeed:U,autoPanOnNodeDrag:G}=n();if(!G){u=!1,cancelAnimationFrame(d);return}const[H,K]=Sw(c,v,U);(H!==0||K!==0)&&(f.x=(f.x??0)-H/I[2],f.y=(f.y??0)-K/I[2],await W({x:H,y:K})&&A(f)),d=requestAnimationFrame(k)}function q(I){const{nodeLookup:W,multiSelectionActive:U,nodesDraggable:G,transform:H,snapGrid:K,snapToGrid:F,selectNodesOnDrag:N,onNodeDragStart:$,onSelectionDragStart:B,unselectNodesAndEdges:P}=n();m=!0,(!N||!M)&&!U&&O&&(W.get(O)?.selected||P()),M&&N&&O&&e?.(O);const Q=_l(I.sourceEvent,{transform:H,snapGrid:K,snapToGrid:F,containerBounds:v});if(f=Q,l=yk(W,G,Q,O),l.size>0&&(i||$||!O&&B)){const[J,ae]=om({nodeId:O,dragItems:l,nodeLookup:W});i?.(I.sourceEvent,l,J,ae),$?.(I.sourceEvent,J,ae),O||B?.(I.sourceEvent,ae)}}const z=Jx().clickDistance(T).on("start",I=>{const{domNode:W,nodeDragThreshold:U,transform:G,snapGrid:H,snapToGrid:K}=n();v=W?.getBoundingClientRect()||null,x=!1,C=!1,S=I.sourceEvent,U===0&&q(I),f=_l(I.sourceEvent,{transform:G,snapGrid:H,snapToGrid:K,containerBounds:v}),c=vr(I.sourceEvent,v)}).on("drag",I=>{const{autoPanOnNodeDrag:W,transform:U,snapGrid:G,snapToGrid:H,nodeDragThreshold:K,nodeLookup:F}=n(),N=_l(I.sourceEvent,{transform:U,snapGrid:G,snapToGrid:H,containerBounds:v});if(S=I.sourceEvent,(I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1||O&&!F.has(O))&&(x=!0),!x){if(!u&&W&&m&&(u=!0,k()),!m){const $=vr(I.sourceEvent,v),B=$.x-c.x,P=$.y-c.y;Math.sqrt(B*B+P*P)>K&&q(I)}(f.x!==N.xSnapped||f.y!==N.ySnapped)&&l&&m&&(c=vr(I.sourceEvent,v),A(N))}}).on("end",I=>{if(!(!m||x)&&(u=!1,m=!1,cancelAnimationFrame(d),l.size>0)){const{nodeLookup:W,updateNodePositions:U,onNodeDragStop:G,onSelectionDragStop:H}=n();if(C&&(U(l,!1),C=!1),a||G||!O&&H){const[K,F]=om({nodeId:O,dragItems:l,nodeLookup:W,dragging:!1});a?.(I.sourceEvent,l,K,F),G?.(I.sourceEvent,K,F),O||H?.(I.sourceEvent,F)}}}).filter(I=>{const W=I.target;return!I.button&&(!b||!Cb(W,`.${b}`,E))&&(!y||Cb(W,y,E))});_.call(z)}function g(){_?.on(".drag",null)}return{update:p,destroy:g}}function xk(e,n,i){const s=[],a={x:e.x-i,y:e.y-i,width:i*2,height:i*2};for(const f of n.values())Ml(a,na(f))>0&&s.push(f);return s}const wk=250;function Ck(e,n,i,s){let a=[],f=1/0;const d=xk(e,i,n+wk);for(const l of d){const u=[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]];for(const c of u){if(s.nodeId===c.nodeId&&s.type===c.type&&s.id===c.id)continue;const{x:v,y:m}=qs(l,c,c.position,!0),_=Math.sqrt(Math.pow(v-e.x,2)+Math.pow(m-e.y,2));_>n||(_<f?(a=[{...c,x:v,y:m}],f=_):_===f&&a.push({...c,x:v,y:m}))}}if(!a.length)return null;if(a.length>1){const l=s.type==="source"?"target":"source";return a.find(u=>u.type===l)??a[0]}return a[0]}function Bw(e,n,i,s,a,f=!1){const d=s.get(e);if(!d)return null;const l=a==="strict"?d.internals.handleBounds?.[n]:[...d.internals.handleBounds?.source??[],...d.internals.handleBounds?.target??[]],u=(i?l?.find(c=>c.id===i):l?.[0])??null;return u&&f?{...u,...qs(d,u,u.position,!0)}:u}function jw(e,n){return e||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function Ek(e,n){let i=null;return n?i=!0:e&&!n&&(i=!1),i}const Hw=()=>!0;function Rk(e,{connectionMode:n,connectionRadius:i,handleId:s,nodeId:a,edgeUpdaterType:f,isTarget:d,domNode:l,nodeLookup:u,lib:c,autoPanOnConnect:v,flowId:m,panBy:_,cancelConnection:x,onConnectStart:C,onConnect:S,onConnectEnd:p,isValidConnection:g=Hw,onReconnectEnd:b,updateConnection:y,getTransform:E,getFromHandle:M,autoPanSpeed:O,dragThreshold:T=1,handleDomNode:A}){const k=Ew(e.target);let q=0,z;const{x:I,y:W}=vr(e),U=jw(f,A),G=l?.getBoundingClientRect();let H=!1;if(!G||!U)return;const K=Bw(a,U,s,u,n);if(!K)return;let F=vr(e,G),N=!1,$=null,B=!1,P=null;function Q(){if(!v||!G)return;const[re,le]=Sw(F,G,O);_({x:re,y:le}),q=requestAnimationFrame(Q)}const J={...K,nodeId:a,type:U,position:K.position},ae=u.get(a);let X={inProgress:!0,isValid:null,from:qs(ae,J,Ne.Left,!0),fromHandle:J,fromPosition:J.position,fromNode:ae,to:F,toHandle:null,toPosition:fb[J.position],toNode:null,pointer:F};function V(){H=!0,y(X),C?.(e,{nodeId:a,handleId:s,handleType:U})}T===0&&V();function ie(re){if(!H){const{x:we,y:Ft}=vr(re),kt=we-I,en=Ft-W;if(!(kt*kt+en*en>T*T))return;V()}if(!M()||!J){de(re);return}const le=E();F=vr(re,G),z=Ck(Kl(F,le,!1,[1,1]),i,u,J),N||(Q(),N=!0);const _e=zw(re,{handle:z,connectionMode:n,fromNodeId:a,fromHandleId:s,fromType:d?"target":"source",isValidConnection:g,doc:k,lib:c,flowId:m,nodeLookup:u});P=_e.handleDomNode,$=_e.connection,B=Ek(!!z,_e.isValid);const Ce=u.get(a),He=Ce?qs(Ce,J,Ne.Left,!0):X.from,Be={...X,from:He,isValid:B,to:_e.toHandle&&B?rh({x:_e.toHandle.x,y:_e.toHandle.y},le):F,toHandle:_e.toHandle,toPosition:B&&_e.toHandle?_e.toHandle.position:fb[J.position],toNode:_e.toHandle?u.get(_e.toHandle.nodeId):null,pointer:F};y(Be),X=Be}function de(re){if(!("touches"in re&&re.touches.length>0)){if(H){(z||P)&&$&&B&&S?.($);const{inProgress:le,..._e}=X,Ce={..._e,toPosition:X.toHandle?X.toPosition:null};p?.(re,Ce),f&&b?.(re,Ce)}x(),cancelAnimationFrame(q),N=!1,B=!1,$=null,P=null,k.removeEventListener("mousemove",ie),k.removeEventListener("mouseup",de),k.removeEventListener("touchmove",ie),k.removeEventListener("touchend",de)}}k.addEventListener("mousemove",ie),k.addEventListener("mouseup",de),k.addEventListener("touchmove",ie),k.addEventListener("touchend",de)}function zw(e,{handle:n,connectionMode:i,fromNodeId:s,fromHandleId:a,fromType:f,doc:d,lib:l,flowId:u,isValidConnection:c=Hw,nodeLookup:v}){const m=f==="target",_=n?d.querySelector(`.${l}-flow__handle[data-id="${u}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x,y:C}=vr(e),S=d.elementFromPoint(x,C),p=S?.classList.contains(`${l}-flow__handle`)?S:_,g={handleDomNode:p,isValid:!1,connection:null,toHandle:null};if(p){const b=jw(void 0,p),y=p.getAttribute("data-nodeid"),E=p.getAttribute("data-handleid"),M=p.classList.contains("connectable"),O=p.classList.contains("connectableend");if(!y||!b)return g;const T={source:m?y:s,sourceHandle:m?E:a,target:m?s:y,targetHandle:m?a:E};g.connection=T;const k=M&&O&&(i===ea.Strict?m&&b==="source"||!m&&b==="target":y!==s||E!==a);g.isValid=k&&c(T),g.toHandle=Bw(y,b,E,v,i,!0)}return g}const Xm={onPointerDown:Rk,isValid:zw};function Ak({domNode:e,panZoom:n,getTransform:i,getViewScale:s}){const a=$n(e);function f({translateExtent:l,width:u,height:c,zoomStep:v=1,pannable:m=!0,zoomable:_=!0,inversePan:x=!1}){const C=y=>{if(y.sourceEvent.type!=="wheel"||!n)return;const E=i(),M=y.sourceEvent.ctrlKey&&Dl()?10:1,O=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*v,T=E[2]*Math.pow(2,O*M);n.scaleTo(T)};let S=[0,0];const p=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(S=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},g=y=>{const E=i();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!n)return;const M=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],O=[M[0]-S[0],M[1]-S[1]];S=M;const T=s()*Math.max(E[2],Math.log(E[2]))*(x?-1:1),A={x:E[0]-O[0]*T,y:E[1]-O[1]*T},k=[[0,0],[u,c]];n.setViewportConstrained({x:A.x,y:A.y,zoom:E[2]},k,l)},b=dw().on("start",p).on("zoom",m?g:null).on("zoom.wheel",_?C:null);a.call(b,{})}function d(){a.on("zoom",null)}return{update:f,destroy:d,pointer:dr}}const Eh=e=>({x:e.x,y:e.y,zoom:e.k}),am=({x:e,y:n,zoom:i})=>xh.translate(e,n).scale(i),qo=(e,n)=>e.target.closest(`.${n}`),Pw=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),Tk=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,lm=(e,n=0,i=Tk,s=()=>{})=>{const a=typeof n=="number"&&n>0;return a||s(),a?e.transition().duration(n).ease(i).on("end",s):e},Iw=e=>{const n=e.ctrlKey&&Dl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function Mk({zoomPanValues:e,noWheelClassName:n,d3Selection:i,d3Zoom:s,panOnScrollMode:a,panOnScrollSpeed:f,zoomOnPinch:d,onPanZoomStart:l,onPanZoom:u,onPanZoomEnd:c}){return v=>{if(qo(v,n))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const m=i.property("__zoom").k||1;if(v.ctrlKey&&d){const p=dr(v),g=Iw(v),b=m*Math.pow(2,g);s.scaleTo(i,b,p,v);return}const _=v.deltaMode===1?20:1;let x=a===zs.Vertical?0:v.deltaX*_,C=a===zs.Horizontal?0:v.deltaY*_;!Dl()&&v.shiftKey&&a!==zs.Vertical&&(x=v.deltaY*_,C=0),s.translateBy(i,-(x/m)*f,-(C/m)*f,{internal:!0});const S=Eh(i.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(u?.(v,S),e.panScrollTimeout=setTimeout(()=>{c?.(v,S),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l?.(v,S))}}function Dk({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:i}){return function(s,a){const f=s.type==="wheel",d=!n&&f&&!s.ctrlKey,l=qo(s,e);if(s.ctrlKey&&f&&l&&s.preventDefault(),d||l)return null;s.preventDefault(),i.call(this,s,a)}}function Ok({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:i}){return s=>{if(s.sourceEvent?.internal)return;const a=Eh(s.transform);e.mouseButton=s.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=a,s.sourceEvent?.type==="mousedown"&&n(!0),i&&i?.(s.sourceEvent,a)}}function Lk({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:i,onTransformChange:s,onPanZoom:a}){return f=>{e.usedRightMouseButton=!!(i&&Pw(n,e.mouseButton??0)),f.sourceEvent?.sync||s([f.transform.x,f.transform.y,f.transform.k]),a&&!f.sourceEvent?.internal&&a?.(f.sourceEvent,Eh(f.transform))}}function kk({zoomPanValues:e,panOnDrag:n,panOnScroll:i,onDraggingChange:s,onPanZoomEnd:a,onPaneContextMenu:f}){return d=>{if(!d.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,f&&Pw(n,e.mouseButton??0)&&!e.usedRightMouseButton&&d.sourceEvent&&f(d.sourceEvent),e.usedRightMouseButton=!1,s(!1),a)){const l=Eh(d.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a?.(d.sourceEvent,l)},i?150:0)}}}function Nk({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:i,panOnDrag:s,panOnScroll:a,zoomOnDoubleClick:f,userSelectionActive:d,noWheelClassName:l,noPanClassName:u,lib:c,connectionInProgress:v}){return m=>{const _=e||n,x=i&&m.ctrlKey,C=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(qo(m,`${c}-flow__node`)||qo(m,`${c}-flow__edge`)))return!0;if(!s&&!_&&!a&&!f&&!i||d||v&&!C||qo(m,l)&&C||qo(m,u)&&(!C||a&&C&&!e)||!i&&m.ctrlKey&&C)return!1;if(!i&&m.type==="touchstart"&&m.touches?.length>1)return m.preventDefault(),!1;if(!_&&!a&&!x&&C||!s&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(s)&&!s.includes(m.button)&&m.type==="mousedown")return!1;const S=Array.isArray(s)&&s.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||C)&&S}}function Bk({domNode:e,minZoom:n,maxZoom:i,translateExtent:s,viewport:a,onPanZoom:f,onPanZoomStart:d,onPanZoomEnd:l,onDraggingChange:u}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=e.getBoundingClientRect(),m=dw().scaleExtent([n,i]).translateExtent(s),_=$n(e).call(m);b({x:a.x,y:a.y,zoom:ta(a.zoom,n,i)},[[0,0],[v.width,v.height]],s);const x=_.on("wheel.zoom"),C=_.on("dblclick.zoom");m.wheelDelta(Iw);function S(z,I){return _?new Promise(W=>{m?.interpolate(I?.interpolate==="linear"?vl:ju).transform(lm(_,I?.duration,I?.ease,()=>W(!0)),z)}):Promise.resolve(!1)}function p({noWheelClassName:z,noPanClassName:I,onPaneContextMenu:W,userSelectionActive:U,panOnScroll:G,panOnDrag:H,panOnScrollMode:K,panOnScrollSpeed:F,preventScrolling:N,zoomOnPinch:$,zoomOnScroll:B,zoomOnDoubleClick:P,zoomActivationKeyPressed:Q,lib:J,onTransformChange:ae,connectionInProgress:Z,paneClickDistance:X,selectionOnDrag:V}){U&&!c.isZoomingOrPanning&&g();const ie=G&&!Q&&!U;m.clickDistance(V?1/0:!gr(X)||X<0?0:X);const de=ie?Mk({zoomPanValues:c,noWheelClassName:z,d3Selection:_,d3Zoom:m,panOnScrollMode:K,panOnScrollSpeed:F,zoomOnPinch:$,onPanZoomStart:d,onPanZoom:f,onPanZoomEnd:l}):Dk({noWheelClassName:z,preventScrolling:N,d3ZoomHandler:x});if(_.on("wheel.zoom",de,{passive:!1}),!U){const le=Ok({zoomPanValues:c,onDraggingChange:u,onPanZoomStart:d});m.on("start",le);const _e=Lk({zoomPanValues:c,panOnDrag:H,onPaneContextMenu:!!W,onPanZoom:f,onTransformChange:ae});m.on("zoom",_e);const Ce=kk({zoomPanValues:c,panOnDrag:H,panOnScroll:G,onPaneContextMenu:W,onPanZoomEnd:l,onDraggingChange:u});m.on("end",Ce)}const re=Nk({zoomActivationKeyPressed:Q,panOnDrag:H,zoomOnScroll:B,panOnScroll:G,zoomOnDoubleClick:P,zoomOnPinch:$,userSelectionActive:U,noPanClassName:I,noWheelClassName:z,lib:J,connectionInProgress:Z});m.filter(re),P?_.on("dblclick.zoom",C):_.on("dblclick.zoom",null)}function g(){m.on("zoom",null)}async function b(z,I,W){const U=am(z),G=m?.constrain()(U,I,W);return G&&await S(G),new Promise(H=>H(G))}async function y(z,I){const W=am(z);return await S(W,I),new Promise(U=>U(W))}function E(z){if(_){const I=am(z),W=_.property("__zoom");(W.k!==z.zoom||W.x!==z.x||W.y!==z.y)&&m?.transform(_,I,null,{sync:!0})}}function M(){const z=_?fw(_.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}function O(z,I){return _?new Promise(W=>{m?.interpolate(I?.interpolate==="linear"?vl:ju).scaleTo(lm(_,I?.duration,I?.ease,()=>W(!0)),z)}):Promise.resolve(!1)}function T(z,I){return _?new Promise(W=>{m?.interpolate(I?.interpolate==="linear"?vl:ju).scaleBy(lm(_,I?.duration,I?.ease,()=>W(!0)),z)}):Promise.resolve(!1)}function A(z){m?.scaleExtent(z)}function k(z){m?.translateExtent(z)}function q(z){const I=!gr(z)||z<0?0:z;m?.clickDistance(I)}return{update:p,destroy:g,setViewport:y,setViewportConstrained:b,getViewport:M,scaleTo:O,scaleBy:T,setScaleExtent:A,setTranslateExtent:k,syncViewport:E,setClickDistance:q}}var ia;(function(e){e.Line="line",e.Handle="handle"})(ia||(ia={}));function jk({width:e,prevWidth:n,height:i,prevHeight:s,affectsX:a,affectsY:f}){const d=e-n,l=i-s,u=[d>0?1:d<0?-1:0,l>0?1:l<0?-1:0];return d&&a&&(u[0]=u[0]*-1),l&&f&&(u[1]=u[1]*-1),u}function Eb(e){const n=e.includes("right")||e.includes("left"),i=e.includes("bottom")||e.includes("top"),s=e.includes("left"),a=e.includes("top");return{isHorizontal:n,isVertical:i,affectsX:s,affectsY:a}}function Qi(e,n){return Math.max(0,n-e)}function Zi(e,n){return Math.max(0,e-n)}function Su(e,n,i){return Math.max(0,n-e,e-i)}function Rb(e,n){return e?!n:n}function Hk(e,n,i,s,a,f,d,l){let{affectsX:u,affectsY:c}=n;const{isHorizontal:v,isVertical:m}=n,_=v&&m,{xSnapped:x,ySnapped:C}=i,{minWidth:S,maxWidth:p,minHeight:g,maxHeight:b}=s,{x:y,y:E,width:M,height:O,aspectRatio:T}=e;let A=Math.floor(v?x-e.pointerX:0),k=Math.floor(m?C-e.pointerY:0);const q=M+(u?-A:A),z=O+(c?-k:k),I=-f[0]*M,W=-f[1]*O;let U=Su(q,S,p),G=Su(z,g,b);if(d){let F=0,N=0;u&&A<0?F=Qi(y+A+I,d[0][0]):!u&&A>0&&(F=Zi(y+q+I,d[1][0])),c&&k<0?N=Qi(E+k+W,d[0][1]):!c&&k>0&&(N=Zi(E+z+W,d[1][1])),U=Math.max(U,F),G=Math.max(G,N)}if(l){let F=0,N=0;u&&A>0?F=Zi(y+A,l[0][0]):!u&&A<0&&(F=Qi(y+q,l[1][0])),c&&k>0?N=Zi(E+k,l[0][1]):!c&&k<0&&(N=Qi(E+z,l[1][1])),U=Math.max(U,F),G=Math.max(G,N)}if(a){if(v){const F=Su(q/T,g,b)*T;if(U=Math.max(U,F),d){let N=0;!u&&!c||u&&!c&&_?N=Zi(E+W+q/T,d[1][1])*T:N=Qi(E+W+(u?A:-A)/T,d[0][1])*T,U=Math.max(U,N)}if(l){let N=0;!u&&!c||u&&!c&&_?N=Qi(E+q/T,l[1][1])*T:N=Zi(E+(u?A:-A)/T,l[0][1])*T,U=Math.max(U,N)}}if(m){const F=Su(z*T,S,p)/T;if(G=Math.max(G,F),d){let N=0;!u&&!c||c&&!u&&_?N=Zi(y+z*T+I,d[1][0])/T:N=Qi(y+(c?k:-k)*T+I,d[0][0])/T,G=Math.max(G,N)}if(l){let N=0;!u&&!c||c&&!u&&_?N=Qi(y+z*T,l[1][0])/T:N=Zi(y+(c?k:-k)*T,l[0][0])/T,G=Math.max(G,N)}}}k=k+(k<0?G:-G),A=A+(A<0?U:-U),a&&(_?q>z*T?k=(Rb(u,c)?-A:A)/T:A=(Rb(u,c)?-k:k)*T:v?(k=A/T,c=u):(A=k*T,u=c));const H=u?y+A:y,K=c?E+k:E;return{width:M+(u?-A:A),height:O+(c?-k:k),x:f[0]*A*(u?-1:1)+H,y:f[1]*k*(c?-1:1)+K}}const Uw={width:0,height:0,x:0,y:0},zk={...Uw,pointerX:0,pointerY:0,aspectRatio:1};function Pk(e){return[[0,0],[e.measured.width,e.measured.height]]}function Ik(e,n,i){const s=n.position.x+e.position.x,a=n.position.y+e.position.y,f=e.measured.width??0,d=e.measured.height??0,l=i[0]*f,u=i[1]*d;return[[s-l,a-u],[s+f-l,a+d-u]]}function Uk({domNode:e,nodeId:n,getStoreItems:i,onChange:s,onEnd:a}){const f=$n(e);let d={controlDirection:Eb("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:c,boundaries:v,keepAspectRatio:m,resizeDirection:_,onResizeStart:x,onResize:C,onResizeEnd:S,shouldResize:p}){let g={...Uw},b={...zk};d={boundaries:v,resizeDirection:_,keepAspectRatio:m,controlDirection:Eb(c)};let y,E=null,M=[],O,T,A,k=!1;const q=Jx().on("start",z=>{const{nodeLookup:I,transform:W,snapGrid:U,snapToGrid:G,nodeOrigin:H,paneDomNode:K}=i();if(y=I.get(n),!y)return;E=K?.getBoundingClientRect()??null;const{xSnapped:F,ySnapped:N}=_l(z.sourceEvent,{transform:W,snapGrid:U,snapToGrid:G,containerBounds:E});g={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},b={...g,pointerX:F,pointerY:N,aspectRatio:g.width/g.height},O=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(O=I.get(y.parentId),T=O&&y.extent==="parent"?Pk(O):void 0),M=[],A=void 0;for(const[$,B]of I)if(B.parentId===n&&(M.push({id:$,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const P=Ik(B,y,B.origin??H);A?A=[[Math.min(P[0][0],A[0][0]),Math.min(P[0][1],A[0][1])],[Math.max(P[1][0],A[1][0]),Math.max(P[1][1],A[1][1])]]:A=P}x?.(z,{...g})}).on("drag",z=>{const{transform:I,snapGrid:W,snapToGrid:U,nodeOrigin:G}=i(),H=_l(z.sourceEvent,{transform:I,snapGrid:W,snapToGrid:U,containerBounds:E}),K=[];if(!y)return;const{x:F,y:N,width:$,height:B}=g,P={},Q=y.origin??G,{width:J,height:ae,x:Z,y:X}=Hk(b,d.controlDirection,H,d.boundaries,d.keepAspectRatio,Q,T,A),V=J!==$,ie=ae!==B,de=Z!==F&&V,re=X!==N&&ie;if(!de&&!re&&!V&&!ie)return;if((de||re||Q[0]===1||Q[1]===1)&&(P.x=de?Z:g.x,P.y=re?X:g.y,g.x=P.x,g.y=P.y,M.length>0)){const He=Z-F,Be=X-N;for(const we of M)we.position={x:we.position.x-He+Q[0]*(J-$),y:we.position.y-Be+Q[1]*(ae-B)},K.push(we)}if((V||ie)&&(P.width=V&&(!d.resizeDirection||d.resizeDirection==="horizontal")?J:g.width,P.height=ie&&(!d.resizeDirection||d.resizeDirection==="vertical")?ae:g.height,g.width=P.width,g.height=P.height),O&&y.expandParent){const He=Q[0]*(P.width??0);P.x&&P.x<He&&(g.x=He,b.x=b.x-(P.x-He));const Be=Q[1]*(P.height??0);P.y&&P.y<Be&&(g.y=Be,b.y=b.y-(P.y-Be))}const le=jk({width:g.width,prevWidth:$,height:g.height,prevHeight:B,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),_e={...g,direction:le};p?.(z,_e)!==!1&&(k=!0,C?.(z,_e),s(P,K))}).on("end",z=>{k&&(S?.(z,{...g}),a?.({...g}),k=!1)});f.call(q)}function u(){f.on(".drag",null)}return{update:l,destroy:u}}var cm={exports:{}},um={},hm={exports:{}},fm={};var Ab;function Fk(){if(Ab)return fm;Ab=1;var e=jl();function n(m,_){return m===_&&(m!==0||1/m===1/_)||m!==m&&_!==_}var i=typeof Object.is=="function"?Object.is:n,s=e.useState,a=e.useEffect,f=e.useLayoutEffect,d=e.useDebugValue;function l(m,_){var x=_(),C=s({inst:{value:x,getSnapshot:_}}),S=C[0].inst,p=C[1];return f(function(){S.value=x,S.getSnapshot=_,u(S)&&p({inst:S})},[m,x,_]),a(function(){return u(S)&&p({inst:S}),m(function(){u(S)&&p({inst:S})})},[m]),d(x),x}function u(m){var _=m.getSnapshot;m=m.value;try{var x=_();return!i(m,x)}catch{return!0}}function c(m,_){return _()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:l;return fm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,fm}var Tb;function $k(){return Tb||(Tb=1,hm.exports=Fk()),hm.exports}var Mb;function Vk(){if(Mb)return um;Mb=1;var e=jl(),n=$k();function i(c,v){return c===v&&(c!==0||1/c===1/v)||c!==c&&v!==v}var s=typeof Object.is=="function"?Object.is:i,a=n.useSyncExternalStore,f=e.useRef,d=e.useEffect,l=e.useMemo,u=e.useDebugValue;return um.useSyncExternalStoreWithSelector=function(c,v,m,_,x){var C=f(null);if(C.current===null){var S={hasValue:!1,value:null};C.current=S}else S=C.current;C=l(function(){function g(O){if(!b){if(b=!0,y=O,O=_(O),x!==void 0&&S.hasValue){var T=S.value;if(x(T,O))return E=T}return E=O}if(T=E,s(y,O))return T;var A=_(O);return x!==void 0&&x(T,A)?(y=O,T):(y=O,E=A)}var b=!1,y,E,M=m===void 0?null:m;return[function(){return g(v())},M===null?void 0:function(){return g(M())}]},[v,m,_,x]);var p=a(c,C[0],C[1]);return d(function(){S.hasValue=!0,S.value=p},[p]),u(p),p},um}var Db;function qk(){return Db||(Db=1,cm.exports=Vk()),cm.exports}var Wk=qk();const Yk=fh(Wk),Kk={},Ob=e=>{let n;const i=new Set,s=(v,m)=>{const _=typeof v=="function"?v(n):v;if(!Object.is(_,n)){const x=n;n=m??(typeof _!="object"||_===null)?_:Object.assign({},n,_),i.forEach(C=>C(n,x))}},a=()=>n,u={setState:s,getState:a,getInitialState:()=>c,subscribe:v=>(i.add(v),()=>i.delete(v)),destroy:()=>{(Kk?"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."),i.clear()}},c=n=e(s,a,u);return u},Gk=e=>e?Ob(e):Ob,{useDebugValue:Xk}=Or,{useSyncExternalStoreWithSelector:Qk}=Yk,Zk=e=>e;function Fw(e,n=Zk,i){const s=Qk(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,i);return Xk(s),s}const Lb=(e,n)=>{const i=Gk(e),s=(a,f=n)=>Fw(i,a,f);return Object.assign(s,i),s},Jk=(e,n)=>e?Lb(e,n):Lb;function wt(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[s,a]of e)if(!Object.is(a,n.get(s)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const s of e)if(!n.has(s))return!1;return!0}const i=Object.keys(e);if(i.length!==Object.keys(n).length)return!1;for(const s of i)if(!Object.prototype.hasOwnProperty.call(n,s)||!Object.is(e[s],n[s]))return!1;return!0}const Rh=L.createContext(null),eN=Rh.Provider,$w=Ur.error001();function Ze(e,n){const i=L.useContext(Rh);if(i===null)throw new Error($w);return Fw(i,e,n)}function Ct(){const e=L.useContext(Rh);if(e===null)throw new Error($w);return L.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const kb={display:"none"},tN={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Vw="react-flow__node-desc",qw="react-flow__edge-desc",nN="react-flow__aria-live",rN=e=>e.ariaLiveMessage,iN=e=>e.ariaLabelConfig;function sN({rfId:e}){const n=Ze(rN);return D.jsx("div",{id:`${nN}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:tN,children:n})}function oN({rfId:e,disableKeyboardA11y:n}){const i=Ze(iN);return D.jsxs(D.Fragment,{children:[D.jsx("div",{id:`${Vw}-${e}`,style:kb,children:n?i["node.a11yDescription.default"]:i["node.a11yDescription.keyboardDisabled"]}),D.jsx("div",{id:`${qw}-${e}`,style:kb,children:i["edge.a11yDescription.default"]}),!n&&D.jsx(sN,{rfId:e})]})}const Ah=L.forwardRef(({position:e="top-left",children:n,className:i,style:s,...a},f)=>{const d=`${e}`.split("-");return D.jsx("div",{className:Ut(["react-flow__panel",i,...d]),style:s,ref:f,...a,children:n})});Ah.displayName="Panel";function aN({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:D.jsx(Ah,{position:n,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 lN=e=>{const n=[],i=[];for(const[,s]of e.nodeLookup)s.selected&&n.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&i.push(s);return{selectedNodes:n,selectedEdges:i}},xu=e=>e.id;function cN(e,n){return wt(e.selectedNodes.map(xu),n.selectedNodes.map(xu))&&wt(e.selectedEdges.map(xu),n.selectedEdges.map(xu))}function uN({onSelectionChange:e}){const n=Ct(),{selectedNodes:i,selectedEdges:s}=Ze(lN,cN);return L.useEffect(()=>{const a={nodes:i,edges:s};e?.(a),n.getState().onSelectionChangeHandlers.forEach(f=>f(a))},[i,s,e]),null}const hN=e=>!!e.onSelectionChangeHandlers;function fN({onSelectionChange:e}){const n=Ze(hN);return e||n?D.jsx(uN,{onSelectionChange:e}):null}const Ww=[0,0],dN={x:0,y:0,zoom:1},mN=["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"],Nb=[...mN,"rfId"],pN=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}),Bb={translateExtent:Al,nodeOrigin:Ww,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function gN(e){const{setNodes:n,setEdges:i,setMinZoom:s,setMaxZoom:a,setTranslateExtent:f,setNodeExtent:d,reset:l,setDefaultNodesAndEdges:u}=Ze(pN,wt),c=Ct();L.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{v.current=Bb,l()}),[]);const v=L.useRef(Bb);return L.useEffect(()=>{for(const m of Nb){const _=e[m],x=v.current[m];_!==x&&(typeof e[m]>"u"||(m==="nodes"?n(_):m==="edges"?i(_):m==="minZoom"?s(_):m==="maxZoom"?a(_):m==="translateExtent"?f(_):m==="nodeExtent"?d(_):m==="ariaLabelConfig"?c.setState({ariaLabelConfig:JL(_)}):m==="fitView"?c.setState({fitViewQueued:_}):m==="fitViewOptions"?c.setState({fitViewOptions:_}):c.setState({[m]:_})))}v.current=e},Nb.map(m=>e[m])),null}function jb(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function vN(e){const[n,i]=L.useState(e==="system"?null:e);return L.useEffect(()=>{if(e!=="system"){i(e);return}const s=jb(),a=()=>i(s?.matches?"dark":"light");return a(),s?.addEventListener("change",a),()=>{s?.removeEventListener("change",a)}},[e]),n!==null?n:jb()?.matches?"dark":"light"}const Hb=typeof document<"u"?document:null;function Ol(e=null,n={target:Hb,actInsideInputWithModifier:!0}){const[i,s]=L.useState(!1),a=L.useRef(!1),f=L.useRef(new Set([])),[d,l]=L.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
13
+ `).replace(`
14
+
15
+ `,`
16
+ +`).split(`
17
+ `)),v=c.reduce((m,_)=>m.concat(..._),[]);return[c,v]}return[[],[]]},[e]);return L.useEffect(()=>{const u=n?.target??Hb,c=n?.actInsideInputWithModifier??!0;if(e!==null){const v=x=>{if(a.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!a.current||a.current&&!c)&&Rw(x))return!1;const S=Pb(x.code,l);if(f.current.add(x[S]),zb(d,f.current,!1)){const p=x.composedPath?.()?.[0]||x.target,g=p?.nodeName==="BUTTON"||p?.nodeName==="A";n.preventDefault!==!1&&(a.current||!g)&&x.preventDefault(),s(!0)}},m=x=>{const C=Pb(x.code,l);zb(d,f.current,!0)?(s(!1),f.current.clear()):f.current.delete(x[C]),x.key==="Meta"&&f.current.clear(),a.current=!1},_=()=>{f.current.clear(),s(!1)};return u?.addEventListener("keydown",v),u?.addEventListener("keyup",m),window.addEventListener("blur",_),window.addEventListener("contextmenu",_),()=>{u?.removeEventListener("keydown",v),u?.removeEventListener("keyup",m),window.removeEventListener("blur",_),window.removeEventListener("contextmenu",_)}}},[e,s]),i}function zb(e,n,i){return e.filter(s=>i||s.length===n.size).some(s=>s.every(a=>n.has(a)))}function Pb(e,n){return n.includes(e)?"code":"key"}const _N=()=>{const e=Ct();return L.useMemo(()=>({zoomIn:n=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomOut:n=>{const{panZoom:i}=e.getState();return i?i.scaleBy(1/1.2,{duration:n?.duration}):Promise.resolve(!1)},zoomTo:(n,i)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(n,{duration:i?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(n,i)=>{const{transform:[s,a,f],panZoom:d}=e.getState();return d?(await d.setViewport({x:n.x??s,y:n.y??a,zoom:n.zoom??f},i),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[n,i,s]=e.getState().transform;return{x:n,y:i,zoom:s}},setCenter:async(n,i,s)=>e.getState().setCenter(n,i,s),fitBounds:async(n,i)=>{const{width:s,height:a,minZoom:f,maxZoom:d,panZoom:l}=e.getState(),u=Pp(n,s,a,f,d,i?.padding??.1);return l?(await l.setViewport(u,{duration:i?.duration,ease:i?.ease,interpolate:i?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(n,i={})=>{const{transform:s,snapGrid:a,snapToGrid:f,domNode:d}=e.getState();if(!d)return n;const{x:l,y:u}=d.getBoundingClientRect(),c={x:n.x-l,y:n.y-u},v=i.snapGrid??a,m=i.snapToGrid??f;return Kl(c,s,m,v)},flowToScreenPosition:n=>{const{transform:i,domNode:s}=e.getState();if(!s)return n;const{x:a,y:f}=s.getBoundingClientRect(),d=rh(n,i);return{x:d.x+a,y:d.y+f}}}),[])};function Yw(e,n){const i=[],s=new Map,a=[];for(const f of e)if(f.type==="add"){a.push(f);continue}else if(f.type==="remove"||f.type==="replace")s.set(f.id,[f]);else{const d=s.get(f.id);d?d.push(f):s.set(f.id,[f])}for(const f of n){const d=s.get(f.id);if(!d){i.push(f);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){i.push({...d[0].item});continue}const l={...f};for(const u of d)yN(u,l);i.push(l)}return a.length&&a.forEach(f=>{f.index!==void 0?i.splice(f.index,0,{...f.item}):i.push({...f.item})}),i}function yN(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function Kw(e,n){return Yw(e,n)}function Gw(e,n){return Yw(e,n)}function ks(e,n){return{id:e,type:"select",selected:n}}function Wo(e,n=new Set,i=!1){const s=[];for(const[a,f]of e){const d=n.has(a);!(f.selected===void 0&&!d)&&f.selected!==d&&(i&&(f.selected=d),s.push(ks(f.id,d)))}return s}function Ib({items:e=[],lookup:n}){const i=[],s=new Map(e.map(a=>[a.id,a]));for(const[a,f]of e.entries()){const d=n.get(f.id),l=d?.internals?.userNode??d;l!==void 0&&l!==f&&i.push({id:f.id,item:f,type:"replace"}),l===void 0&&i.push({item:f,type:"add",index:a})}for(const[a]of n)s.get(a)===void 0&&i.push({id:a,type:"remove"});return i}function Ub(e){return{id:e.id,type:"remove"}}const Fb=e=>$L(e),bN=e=>_w(e);function Xw(e){return L.forwardRef(e)}const SN=typeof window<"u"?L.useLayoutEffect:L.useEffect;function $b(e){const[n,i]=L.useState(BigInt(0)),[s]=L.useState(()=>xN(()=>i(a=>a+BigInt(1))));return SN(()=>{const a=s.get();a.length&&(e(a),s.reset())},[n]),s}function xN(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:i=>{n.push(i),e()}}}const Qw=L.createContext(null);function wN({children:e}){const n=Ct(),i=L.useCallback(l=>{const{nodes:u=[],setNodes:c,hasDefaultNodes:v,onNodesChange:m,nodeLookup:_,fitViewQueued:x,onNodesChangeMiddlewareMap:C}=n.getState();let S=u;for(const g of l)S=typeof g=="function"?g(S):g;let p=Ib({items:S,lookup:_});for(const g of C.values())p=g(p);v&&c(S),p.length>0?m?.(p):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:b,setNodes:y}=n.getState();g&&y(b)})},[]),s=$b(i),a=L.useCallback(l=>{const{edges:u=[],setEdges:c,hasDefaultEdges:v,onEdgesChange:m,edgeLookup:_}=n.getState();let x=u;for(const C of l)x=typeof C=="function"?C(x):C;v?c(x):m&&m(Ib({items:x,lookup:_}))},[]),f=$b(a),d=L.useMemo(()=>({nodeQueue:s,edgeQueue:f}),[]);return D.jsx(Qw.Provider,{value:d,children:e})}function CN(){const e=L.useContext(Qw);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const EN=e=>!!e.panZoom;function Yp(){const e=_N(),n=Ct(),i=CN(),s=Ze(EN),a=L.useMemo(()=>{const f=m=>n.getState().nodeLookup.get(m),d=m=>{i.nodeQueue.push(m)},l=m=>{i.edgeQueue.push(m)},u=m=>{const{nodeLookup:_,nodeOrigin:x}=n.getState(),C=Fb(m)?m:_.get(m.id),S=C.parentId?Cw(C.position,C.measured,C.parentId,_,x):C.position,p={...C,position:S,width:C.measured?.width??C.width,height:C.measured?.height??C.height};return na(p)},c=(m,_,x={replace:!1})=>{d(C=>C.map(S=>{if(S.id===m){const p=typeof _=="function"?_(S):_;return x.replace&&Fb(p)?p:{...S,...p}}return S}))},v=(m,_,x={replace:!1})=>{l(C=>C.map(S=>{if(S.id===m){const p=typeof _=="function"?_(S):_;return x.replace&&bN(p)?p:{...S,...p}}return S}))};return{getNodes:()=>n.getState().nodes.map(m=>({...m})),getNode:m=>f(m)?.internals.userNode,getInternalNode:f,getEdges:()=>{const{edges:m=[]}=n.getState();return m.map(_=>({..._}))},getEdge:m=>n.getState().edgeLookup.get(m),setNodes:d,setEdges:l,addNodes:m=>{const _=Array.isArray(m)?m:[m];i.nodeQueue.push(x=>[...x,..._])},addEdges:m=>{const _=Array.isArray(m)?m:[m];i.edgeQueue.push(x=>[...x,..._])},toObject:()=>{const{nodes:m=[],edges:_=[],transform:x}=n.getState(),[C,S,p]=x;return{nodes:m.map(g=>({...g})),edges:_.map(g=>({...g})),viewport:{x:C,y:S,zoom:p}}},deleteElements:async({nodes:m=[],edges:_=[]})=>{const{nodes:x,edges:C,onNodesDelete:S,onEdgesDelete:p,triggerNodeChanges:g,triggerEdgeChanges:b,onDelete:y,onBeforeDelete:E}=n.getState(),{nodes:M,edges:O}=await KL({nodesToRemove:m,edgesToRemove:_,nodes:x,edges:C,onBeforeDelete:E}),T=O.length>0,A=M.length>0;if(T){const k=O.map(Ub);p?.(O),b(k)}if(A){const k=M.map(Ub);S?.(M),g(k)}return(A||T)&&y?.({nodes:M,edges:O}),{deletedNodes:M,deletedEdges:O}},getIntersectingNodes:(m,_=!0,x)=>{const C=mb(m),S=C?m:u(m),p=x!==void 0;return S?(x||n.getState().nodes).filter(g=>{const b=n.getState().nodeLookup.get(g.id);if(b&&!C&&(g.id===m.id||!b.internals.positionAbsolute))return!1;const y=na(p?g:b),E=Ml(y,S);return _&&E>0||E>=y.width*y.height||E>=S.width*S.height}):[]},isNodeIntersecting:(m,_,x=!0)=>{const S=mb(m)?m:u(m);if(!S)return!1;const p=Ml(S,_);return x&&p>0||p>=_.width*_.height||p>=S.width*S.height},updateNode:c,updateNodeData:(m,_,x={replace:!1})=>{c(m,C=>{const S=typeof _=="function"?_(C):_;return x.replace?{...C,data:S}:{...C,data:{...C.data,...S}}},x)},updateEdge:v,updateEdgeData:(m,_,x={replace:!1})=>{v(m,C=>{const S=typeof _=="function"?_(C):_;return x.replace?{...C,data:S}:{...C,data:{...C.data,...S}}},x)},getNodesBounds:m=>{const{nodeLookup:_,nodeOrigin:x}=n.getState();return VL(m,{nodeLookup:_,nodeOrigin:x})},getHandleConnections:({type:m,id:_,nodeId:x})=>Array.from(n.getState().connectionLookup.get(`${x}-${m}${_?`-${_}`:""}`)?.values()??[]),getNodeConnections:({type:m,handleId:_,nodeId:x})=>Array.from(n.getState().connectionLookup.get(`${x}${m?_?`-${m}-${_}`:`-${m}`:""}`)?.values()??[]),fitView:async m=>{const _=n.getState().fitViewResolver??ZL();return n.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:_}),i.nodeQueue.push(x=>[...x]),_.promise}}},[]);return L.useMemo(()=>({...a,...e,viewportInitialized:s}),[s])}const Vb=e=>e.selected,RN=typeof window<"u"?window:void 0;function AN({deleteKeyCode:e,multiSelectionKeyCode:n}){const i=Ct(),{deleteElements:s}=Yp(),a=Ol(e,{actInsideInputWithModifier:!1}),f=Ol(n,{target:RN});L.useEffect(()=>{if(a){const{edges:d,nodes:l}=i.getState();s({nodes:l.filter(Vb),edges:d.filter(Vb)}),i.setState({nodesSelectionActive:!1})}},[a]),L.useEffect(()=>{i.setState({multiSelectionActive:f})},[f])}function TN(e){const n=Ct();L.useEffect(()=>{const i=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const s=Ip(e.current);(s.height===0||s.width===0)&&n.getState().onError?.("004",Ur.error004()),n.setState({width:s.width||500,height:s.height||500})};if(e.current){i(),window.addEventListener("resize",i);const s=new ResizeObserver(()=>i());return s.observe(e.current),()=>{window.removeEventListener("resize",i),s&&e.current&&s.unobserve(e.current)}}},[])}const Th={position:"absolute",width:"100%",height:"100%",top:0,left:0},MN=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function DN({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:f=zs.Free,zoomOnDoubleClick:d=!0,panOnDrag:l=!0,defaultViewport:u,translateExtent:c,minZoom:v,maxZoom:m,zoomActivationKeyCode:_,preventScrolling:x=!0,children:C,noWheelClassName:S,noPanClassName:p,onViewportChange:g,isControlledViewport:b,paneClickDistance:y,selectionOnDrag:E}){const M=Ct(),O=L.useRef(null),{userSelectionActive:T,lib:A,connectionInProgress:k}=Ze(MN,wt),q=Ol(_),z=L.useRef();TN(O);const I=L.useCallback(W=>{g?.({x:W[0],y:W[1],zoom:W[2]}),b||M.setState({transform:W})},[g,b]);return L.useEffect(()=>{if(O.current){z.current=Bk({domNode:O.current,minZoom:v,maxZoom:m,translateExtent:c,viewport:u,onDraggingChange:H=>M.setState({paneDragging:H}),onPanZoomStart:(H,K)=>{const{onViewportChangeStart:F,onMoveStart:N}=M.getState();N?.(H,K),F?.(K)},onPanZoom:(H,K)=>{const{onViewportChange:F,onMove:N}=M.getState();N?.(H,K),F?.(K)},onPanZoomEnd:(H,K)=>{const{onViewportChangeEnd:F,onMoveEnd:N}=M.getState();N?.(H,K),F?.(K)}});const{x:W,y:U,zoom:G}=z.current.getViewport();return M.setState({panZoom:z.current,transform:[W,U,G],domNode:O.current.closest(".react-flow")}),()=>{z.current?.destroy()}}},[]),L.useEffect(()=>{z.current?.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:i,panOnScroll:s,panOnScrollSpeed:a,panOnScrollMode:f,zoomOnDoubleClick:d,panOnDrag:l,zoomActivationKeyPressed:q,preventScrolling:x,noPanClassName:p,userSelectionActive:T,noWheelClassName:S,lib:A,onTransformChange:I,connectionInProgress:k,selectionOnDrag:E,paneClickDistance:y})},[e,n,i,s,a,f,d,l,q,x,p,T,S,A,I,k,E,y]),D.jsx("div",{className:"react-flow__renderer",ref:O,style:Th,children:C})}const ON=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function LN(){const{userSelectionActive:e,userSelectionRect:n}=Ze(ON,wt);return e&&n?D.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const dm=(e,n)=>i=>{i.target===n.current&&e?.(i)},kN=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function NN({isSelecting:e,selectionKeyPressed:n,selectionMode:i=Tl.Full,panOnDrag:s,paneClickDistance:a,selectionOnDrag:f,onSelectionStart:d,onSelectionEnd:l,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:v,onPaneMouseEnter:m,onPaneMouseMove:_,onPaneMouseLeave:x,children:C}){const S=Ct(),{userSelectionActive:p,elementsSelectable:g,dragging:b,connectionInProgress:y}=Ze(kN,wt),E=g&&(e||p),M=L.useRef(null),O=L.useRef(),T=L.useRef(new Set),A=L.useRef(new Set),k=L.useRef(!1),q=F=>{if(k.current||y){k.current=!1;return}u?.(F),S.getState().resetSelectedElements(),S.setState({nodesSelectionActive:!1})},z=F=>{if(Array.isArray(s)&&s?.includes(2)){F.preventDefault();return}c?.(F)},I=v?F=>v(F):void 0,W=F=>{k.current&&(F.stopPropagation(),k.current=!1)},U=F=>{const{domNode:N}=S.getState();if(O.current=N?.getBoundingClientRect(),!O.current)return;const $=F.target===M.current;if(!$&&!!F.target.closest(".nokey")||!e||!(f&&$||n)||F.button!==0||!F.isPrimary)return;F.target?.setPointerCapture?.(F.pointerId),k.current=!1;const{x:Q,y:J}=vr(F.nativeEvent,O.current);S.setState({userSelectionRect:{width:0,height:0,startX:Q,startY:J,x:Q,y:J}}),$||(F.stopPropagation(),F.preventDefault())},G=F=>{const{userSelectionRect:N,transform:$,nodeLookup:B,edgeLookup:P,connectionLookup:Q,triggerNodeChanges:J,triggerEdgeChanges:ae,defaultEdgeOptions:Z,resetSelectedElements:X}=S.getState();if(!O.current||!N)return;const{x:V,y:ie}=vr(F.nativeEvent,O.current),{startX:de,startY:re}=N;if(!k.current){const Be=n?0:a;if(Math.hypot(V-de,ie-re)<=Be)return;X(),d?.(F)}k.current=!0;const le={startX:de,startY:re,x:V<de?V:de,y:ie<re?ie:re,width:Math.abs(V-de),height:Math.abs(ie-re)},_e=T.current,Ce=A.current;T.current=new Set(zp(B,le,$,i===Tl.Partial,!0).map(Be=>Be.id)),A.current=new Set;const He=Z?.selectable??!0;for(const Be of T.current){const we=Q.get(Be);if(we)for(const{edgeId:Ft}of we.values()){const kt=P.get(Ft);kt&&(kt.selectable??He)&&A.current.add(Ft)}}if(!pb(_e,T.current)){const Be=Wo(B,T.current,!0);J(Be)}if(!pb(Ce,A.current)){const Be=Wo(P,A.current);ae(Be)}S.setState({userSelectionRect:le,userSelectionActive:!0,nodesSelectionActive:!1})},H=F=>{F.button===0&&(F.target?.releasePointerCapture?.(F.pointerId),!p&&F.target===M.current&&S.getState().userSelectionRect&&q?.(F),S.setState({userSelectionActive:!1,userSelectionRect:null}),k.current&&(l?.(F),S.setState({nodesSelectionActive:T.current.size>0})))},K=s===!0||Array.isArray(s)&&s.includes(0);return D.jsxs("div",{className:Ut(["react-flow__pane",{draggable:K,dragging:b,selection:e}]),onClick:E?void 0:dm(q,M),onContextMenu:dm(z,M),onWheel:dm(I,M),onPointerEnter:E?void 0:m,onPointerMove:E?G:_,onPointerUp:E?H:void 0,onPointerDownCapture:E?U:void 0,onClickCapture:E?W:void 0,onPointerLeave:x,ref:M,style:Th,children:[C,D.jsx(LN,{})]})}function Qm({id:e,store:n,unselect:i=!1,nodeRef:s}){const{addSelectedNodes:a,unselectNodesAndEdges:f,multiSelectionActive:d,nodeLookup:l,onError:u}=n.getState(),c=l.get(e);if(!c){u?.("012",Ur.error012(e));return}n.setState({nodesSelectionActive:!1}),c.selected?(i||c.selected&&d)&&(f({nodes:[c],edges:[]}),requestAnimationFrame(()=>s?.current?.blur())):a([e])}function Zw({nodeRef:e,disabled:n=!1,noDragClassName:i,handleSelector:s,nodeId:a,isSelectable:f,nodeClickDistance:d}){const l=Ct(),[u,c]=L.useState(!1),v=L.useRef();return L.useEffect(()=>{v.current=Sk({getStoreItems:()=>l.getState(),onNodeMouseDown:m=>{Qm({id:m,store:l,nodeRef:e})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),L.useEffect(()=>{if(n)v.current?.destroy();else if(e.current)return v.current?.update({noDragClassName:i,handleSelector:s,domNode:e.current,isSelectable:f,nodeId:a,nodeClickDistance:d}),()=>{v.current?.destroy()}},[i,s,n,f,e,a]),u}const BN=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function Jw(){const e=Ct();return L.useCallback(i=>{const{nodeExtent:s,snapToGrid:a,snapGrid:f,nodesDraggable:d,onError:l,updateNodePositions:u,nodeLookup:c,nodeOrigin:v}=e.getState(),m=new Map,_=BN(d),x=a?f[0]:5,C=a?f[1]:5,S=i.direction.x*x*i.factor,p=i.direction.y*C*i.factor;for(const[,g]of c){if(!_(g))continue;let b={x:g.internals.positionAbsolute.x+S,y:g.internals.positionAbsolute.y+p};a&&(b=Yl(b,f));const{position:y,positionAbsolute:E}=yw({nodeId:g.id,nextPosition:b,nodeLookup:c,nodeExtent:s,nodeOrigin:v,onError:l});g.position=y,g.internals.positionAbsolute=E,m.set(g.id,g)}u(m)},[])}const Kp=L.createContext(null),jN=Kp.Provider;Kp.Consumer;const e1=()=>L.useContext(Kp),HN=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),zN=(e,n,i)=>s=>{const{connectionClickStartHandle:a,connectionMode:f,connection:d}=s,{fromHandle:l,toHandle:u,isValid:c}=d,v=u?.nodeId===e&&u?.id===n&&u?.type===i;return{connectingFrom:l?.nodeId===e&&l?.id===n&&l?.type===i,connectingTo:v,clickConnecting:a?.nodeId===e&&a?.id===n&&a?.type===i,isPossibleEndHandle:f===ea.Strict?l?.type!==i:e!==l?.nodeId||n!==l?.id,connectionInProcess:!!l,clickConnectionInProcess:!!a,valid:v&&c}};function PN({type:e="source",position:n=Ne.Top,isValidConnection:i,isConnectable:s=!0,isConnectableStart:a=!0,isConnectableEnd:f=!0,id:d,onConnect:l,children:u,className:c,onMouseDown:v,onTouchStart:m,..._},x){const C=d||null,S=e==="target",p=Ct(),g=e1(),{connectOnClick:b,noPanClassName:y,rfId:E}=Ze(HN,wt),{connectingFrom:M,connectingTo:O,clickConnecting:T,isPossibleEndHandle:A,connectionInProcess:k,clickConnectionInProcess:q,valid:z}=Ze(zN(g,C,e),wt);g||p.getState().onError?.("010",Ur.error010());const I=G=>{const{defaultEdgeOptions:H,onConnect:K,hasDefaultEdges:F}=p.getState(),N={...H,...G};if(F){const{edges:$,setEdges:B}=p.getState();B(sk(N,$))}K?.(N),l?.(N)},W=G=>{if(!g)return;const H=Aw(G.nativeEvent);if(a&&(H&&G.button===0||!H)){const K=p.getState();Xm.onPointerDown(G.nativeEvent,{handleDomNode:G.currentTarget,autoPanOnConnect:K.autoPanOnConnect,connectionMode:K.connectionMode,connectionRadius:K.connectionRadius,domNode:K.domNode,nodeLookup:K.nodeLookup,lib:K.lib,isTarget:S,handleId:C,nodeId:g,flowId:K.rfId,panBy:K.panBy,cancelConnection:K.cancelConnection,onConnectStart:K.onConnectStart,onConnectEnd:K.onConnectEnd,updateConnection:K.updateConnection,onConnect:I,isValidConnection:i||K.isValidConnection,getTransform:()=>p.getState().transform,getFromHandle:()=>p.getState().connection.fromHandle,autoPanSpeed:K.autoPanSpeed,dragThreshold:K.connectionDragThreshold})}H?v?.(G):m?.(G)},U=G=>{const{onClickConnectStart:H,onClickConnectEnd:K,connectionClickStartHandle:F,connectionMode:N,isValidConnection:$,lib:B,rfId:P,nodeLookup:Q,connection:J}=p.getState();if(!g||!F&&!a)return;if(!F){H?.(G.nativeEvent,{nodeId:g,handleId:C,handleType:e}),p.setState({connectionClickStartHandle:{nodeId:g,type:e,id:C}});return}const ae=Ew(G.target),Z=i||$,{connection:X,isValid:V}=Xm.isValid(G.nativeEvent,{handle:{nodeId:g,id:C,type:e},connectionMode:N,fromNodeId:F.nodeId,fromHandleId:F.id||null,fromType:F.type,isValidConnection:Z,flowId:P,doc:ae,lib:B,nodeLookup:Q});V&&X&&I(X);const ie=structuredClone(J);delete ie.inProgress,ie.toPosition=ie.toHandle?ie.toHandle.position:null,K?.(G,ie),p.setState({connectionClickStartHandle:null})};return D.jsx("div",{"data-handleid":C,"data-nodeid":g,"data-handlepos":n,"data-id":`${E}-${g}-${C}-${e}`,className:Ut(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",y,c,{source:!S,target:S,connectable:s,connectablestart:a,connectableend:f,clickconnecting:T,connectingfrom:M,connectingto:O,valid:z,connectionindicator:s&&(!k||A)&&(k||q?f:a)}]),onMouseDown:W,onTouchStart:W,onClick:b?U:void 0,ref:x,..._,children:u})}const as=L.memo(Xw(PN));function IN({data:e,isConnectable:n,sourcePosition:i=Ne.Bottom}){return D.jsxs(D.Fragment,{children:[e?.label,D.jsx(as,{type:"source",position:i,isConnectable:n})]})}function UN({data:e,isConnectable:n,targetPosition:i=Ne.Top,sourcePosition:s=Ne.Bottom}){return D.jsxs(D.Fragment,{children:[D.jsx(as,{type:"target",position:i,isConnectable:n}),e?.label,D.jsx(as,{type:"source",position:s,isConnectable:n})]})}function FN(){return null}function $N({data:e,isConnectable:n,targetPosition:i=Ne.Top}){return D.jsxs(D.Fragment,{children:[D.jsx(as,{type:"target",position:i,isConnectable:n}),e?.label]})}const ih={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},qb={input:IN,default:UN,output:$N,group:FN};function VN(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const qN=e=>{const{width:n,height:i,x:s,y:a}=Wl(e.nodeLookup,{filter:f=>!!f.selected});return{width:gr(n)?n:null,height:gr(i)?i:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${a}px)`}};function WN({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:i}){const s=Ct(),{width:a,height:f,transformString:d,userSelectionActive:l}=Ze(qN,wt),u=Jw(),c=L.useRef(null);if(L.useEffect(()=>{i||c.current?.focus({preventScroll:!0})},[i]),Zw({nodeRef:c}),l||!a||!f)return null;const v=e?_=>{const x=s.getState().nodes.filter(C=>C.selected);e(_,x)}:void 0,m=_=>{Object.prototype.hasOwnProperty.call(ih,_.key)&&(_.preventDefault(),u({direction:ih[_.key],factor:_.shiftKey?4:1}))};return D.jsx("div",{className:Ut(["react-flow__nodesselection","react-flow__container",n]),style:{transform:d},children:D.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:v,tabIndex:i?void 0:-1,onKeyDown:i?void 0:m,style:{width:a,height:f}})})}const Wb=typeof window<"u"?window:void 0,YN=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function t1({children:e,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:f,onPaneScroll:d,paneClickDistance:l,deleteKeyCode:u,selectionKeyCode:c,selectionOnDrag:v,selectionMode:m,onSelectionStart:_,onSelectionEnd:x,multiSelectionKeyCode:C,panActivationKeyCode:S,zoomActivationKeyCode:p,elementsSelectable:g,zoomOnScroll:b,zoomOnPinch:y,panOnScroll:E,panOnScrollSpeed:M,panOnScrollMode:O,zoomOnDoubleClick:T,panOnDrag:A,defaultViewport:k,translateExtent:q,minZoom:z,maxZoom:I,preventScrolling:W,onSelectionContextMenu:U,noWheelClassName:G,noPanClassName:H,disableKeyboardA11y:K,onViewportChange:F,isControlledViewport:N}){const{nodesSelectionActive:$,userSelectionActive:B}=Ze(YN,wt),P=Ol(c,{target:Wb}),Q=Ol(S,{target:Wb}),J=Q||A,ae=Q||E,Z=v&&J!==!0,X=P||B||Z;return AN({deleteKeyCode:u,multiSelectionKeyCode:C}),D.jsx(DN,{onPaneContextMenu:f,elementsSelectable:g,zoomOnScroll:b,zoomOnPinch:y,panOnScroll:ae,panOnScrollSpeed:M,panOnScrollMode:O,zoomOnDoubleClick:T,panOnDrag:!P&&J,defaultViewport:k,translateExtent:q,minZoom:z,maxZoom:I,zoomActivationKeyCode:p,preventScrolling:W,noWheelClassName:G,noPanClassName:H,onViewportChange:F,isControlledViewport:N,paneClickDistance:l,selectionOnDrag:Z,children:D.jsxs(NN,{onSelectionStart:_,onSelectionEnd:x,onPaneClick:n,onPaneMouseEnter:i,onPaneMouseMove:s,onPaneMouseLeave:a,onPaneContextMenu:f,onPaneScroll:d,panOnDrag:J,isSelecting:!!X,selectionMode:m,selectionKeyPressed:P,paneClickDistance:l,selectionOnDrag:Z,children:[e,$&&D.jsx(WN,{onSelectionContextMenu:U,noPanClassName:H,disableKeyboardA11y:K})]})})}t1.displayName="FlowRenderer";const KN=L.memo(t1),GN=e=>n=>e?zp(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(i=>i.id):Array.from(n.nodeLookup.keys());function XN(e){return Ze(L.useCallback(GN(e),[e]),wt)}const QN=e=>e.updateNodeInternals;function ZN(){const e=Ze(QN),[n]=L.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(i=>{const s=new Map;i.forEach(a=>{const f=a.target.getAttribute("data-id");s.set(f,{id:f,nodeElement:a.target,force:!0})}),e(s)}));return L.useEffect(()=>()=>{n?.disconnect()},[n]),n}function JN({node:e,nodeType:n,hasDimensions:i,resizeObserver:s}){const a=Ct(),f=L.useRef(null),d=L.useRef(null),l=L.useRef(e.sourcePosition),u=L.useRef(e.targetPosition),c=L.useRef(n),v=i&&!!e.internals.handleBounds;return L.useEffect(()=>{f.current&&!e.hidden&&(!v||d.current!==f.current)&&(d.current&&s?.unobserve(d.current),s?.observe(f.current),d.current=f.current)},[v,e.hidden]),L.useEffect(()=>()=>{d.current&&(s?.unobserve(d.current),d.current=null)},[]),L.useEffect(()=>{if(f.current){const m=c.current!==n,_=l.current!==e.sourcePosition,x=u.current!==e.targetPosition;(m||_||x)&&(c.current=n,l.current=e.sourcePosition,u.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:f.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),f}function e5({id:e,onClick:n,onMouseEnter:i,onMouseMove:s,onMouseLeave:a,onContextMenu:f,onDoubleClick:d,nodesDraggable:l,elementsSelectable:u,nodesConnectable:c,nodesFocusable:v,resizeObserver:m,noDragClassName:_,noPanClassName:x,disableKeyboardA11y:C,rfId:S,nodeTypes:p,nodeClickDistance:g,onError:b}){const{node:y,internals:E,isParent:M}=Ze(V=>{const ie=V.nodeLookup.get(e),de=V.parentLookup.has(e);return{node:ie,internals:ie.internals,isParent:de}},wt);let O=y.type||"default",T=p?.[O]||qb[O];T===void 0&&(b?.("003",Ur.error003(O)),O="default",T=p?.default||qb.default);const A=!!(y.draggable||l&&typeof y.draggable>"u"),k=!!(y.selectable||u&&typeof y.selectable>"u"),q=!!(y.connectable||c&&typeof y.connectable>"u"),z=!!(y.focusable||v&&typeof y.focusable>"u"),I=Ct(),W=ww(y),U=JN({node:y,nodeType:O,hasDimensions:W,resizeObserver:m}),G=Zw({nodeRef:U,disabled:y.hidden||!A,noDragClassName:_,handleSelector:y.dragHandle,nodeId:e,isSelectable:k,nodeClickDistance:g}),H=Jw();if(y.hidden)return null;const K=Ci(y),F=VN(y),N=k||A||n||i||s||a,$=i?V=>i(V,{...E.userNode}):void 0,B=s?V=>s(V,{...E.userNode}):void 0,P=a?V=>a(V,{...E.userNode}):void 0,Q=f?V=>f(V,{...E.userNode}):void 0,J=d?V=>d(V,{...E.userNode}):void 0,ae=V=>{const{selectNodesOnDrag:ie,nodeDragThreshold:de}=I.getState();k&&(!ie||!A||de>0)&&Qm({id:e,store:I,nodeRef:U}),n&&n(V,{...E.userNode})},Z=V=>{if(!(Rw(V.nativeEvent)||C)){if(mw.includes(V.key)&&k){const ie=V.key==="Escape";Qm({id:e,store:I,unselect:ie,nodeRef:U})}else if(A&&y.selected&&Object.prototype.hasOwnProperty.call(ih,V.key)){V.preventDefault();const{ariaLabelConfig:ie}=I.getState();I.setState({ariaLiveMessage:ie["node.a11yDescription.ariaLiveMessage"]({direction:V.key.replace("Arrow","").toLowerCase(),x:~~E.positionAbsolute.x,y:~~E.positionAbsolute.y})}),H({direction:ih[V.key],factor:V.shiftKey?4:1})}}},X=()=>{if(C||!U.current?.matches(":focus-visible"))return;const{transform:V,width:ie,height:de,autoPanOnNodeFocus:re,setCenter:le}=I.getState();if(!re)return;zp(new Map([[e,y]]),{x:0,y:0,width:ie,height:de},V,!0).length>0||le(y.position.x+K.width/2,y.position.y+K.height/2,{zoom:V[2]})};return D.jsx("div",{className:Ut(["react-flow__node",`react-flow__node-${O}`,{[x]:A},y.className,{selected:y.selected,selectable:k,parent:M,draggable:A,dragging:G}]),ref:U,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:N?"all":"none",visibility:W?"visible":"hidden",...y.style,...F},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:$,onMouseMove:B,onMouseLeave:P,onContextMenu:Q,onClick:ae,onDoubleClick:J,onKeyDown:z?Z:void 0,tabIndex:z?0:void 0,onFocus:z?X:void 0,role:y.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":C?void 0:`${Vw}-${S}`,"aria-label":y.ariaLabel,...y.domAttributes,children:D.jsx(jN,{value:e,children:D.jsx(T,{id:e,data:y.data,type:O,positionAbsoluteX:E.positionAbsolute.x,positionAbsoluteY:E.positionAbsolute.y,selected:y.selected??!1,selectable:k,draggable:A,deletable:y.deletable??!0,isConnectable:q,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:G,dragHandle:y.dragHandle,zIndex:E.z,parentId:y.parentId,...K})})})}var t5=L.memo(e5);const n5=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function n1(e){const{nodesDraggable:n,nodesConnectable:i,nodesFocusable:s,elementsSelectable:a,onError:f}=Ze(n5,wt),d=XN(e.onlyRenderVisibleElements),l=ZN();return D.jsx("div",{className:"react-flow__nodes",style:Th,children:d.map(u=>D.jsx(t5,{id:u,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:l,nodesDraggable:n,nodesConnectable:i,nodesFocusable:s,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:f},u))})}n1.displayName="NodeRenderer";const r5=L.memo(n1);function i5(e){return Ze(L.useCallback(i=>{if(!e)return i.edges.map(a=>a.id);const s=[];if(i.width&&i.height)for(const a of i.edges){const f=i.nodeLookup.get(a.source),d=i.nodeLookup.get(a.target);f&&d&&nk({sourceNode:f,targetNode:d,width:i.width,height:i.height,transform:i.transform})&&s.push(a.id)}return s},[e]),wt)}const s5=({color:e="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...e&&{stroke:e}};return D.jsx("polyline",{className:"arrow",style:i,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},o5=({color:e="none",strokeWidth:n=1})=>{const i={strokeWidth:n,...e&&{stroke:e,fill:e}};return D.jsx("polyline",{className:"arrowclosed",style:i,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Yb={[th.Arrow]:s5,[th.ArrowClosed]:o5};function a5(e){const n=Ct();return L.useMemo(()=>Object.prototype.hasOwnProperty.call(Yb,e)?Yb[e]:(n.getState().onError?.("009",Ur.error009(e)),null),[e])}const l5=({id:e,type:n,color:i,width:s=12.5,height:a=12.5,markerUnits:f="strokeWidth",strokeWidth:d,orient:l="auto-start-reverse"})=>{const u=a5(n);return u?D.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:f,orient:l,refX:"0",refY:"0",children:D.jsx(u,{color:i,strokeWidth:d})}):null},r1=({defaultColor:e,rfId:n})=>{const i=Ze(f=>f.edges),s=Ze(f=>f.defaultEdgeOptions),a=L.useMemo(()=>uk(i,{id:n,defaultColor:e,defaultMarkerStart:s?.markerStart,defaultMarkerEnd:s?.markerEnd}),[i,s,n,e]);return a.length?D.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:D.jsx("defs",{children:a.map(f=>D.jsx(l5,{id:f.id,type:f.type,color:f.color,width:f.width,height:f.height,markerUnits:f.markerUnits,strokeWidth:f.strokeWidth,orient:f.orient},f.id))})}):null};r1.displayName="MarkerDefinitions";var c5=L.memo(r1);function i1({x:e,y:n,label:i,labelStyle:s,labelShowBg:a=!0,labelBgStyle:f,labelBgPadding:d=[2,4],labelBgBorderRadius:l=2,children:u,className:c,...v}){const[m,_]=L.useState({x:1,y:0,width:0,height:0}),x=Ut(["react-flow__edge-textwrapper",c]),C=L.useRef(null);return L.useEffect(()=>{if(C.current){const S=C.current.getBBox();_({x:S.x,y:S.y,width:S.width,height:S.height})}},[i]),i?D.jsxs("g",{transform:`translate(${e-m.width/2} ${n-m.height/2})`,className:x,visibility:m.width?"visible":"hidden",...v,children:[a&&D.jsx("rect",{width:m.width+2*d[0],x:-d[0],y:-d[1],height:m.height+2*d[1],className:"react-flow__edge-textbg",style:f,rx:l,ry:l}),D.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:C,style:s,children:i}),u]}):null}i1.displayName="EdgeText";const u5=L.memo(i1);function is({path:e,labelX:n,labelY:i,label:s,labelStyle:a,labelShowBg:f,labelBgStyle:d,labelBgPadding:l,labelBgBorderRadius:u,interactionWidth:c=20,...v}){return D.jsxs(D.Fragment,{children:[D.jsx("path",{...v,d:e,fill:"none",className:Ut(["react-flow__edge-path",v.className])}),c?D.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,s&&gr(n)&&gr(i)?D.jsx(u5,{x:n,y:i,label:s,labelStyle:a,labelShowBg:f,labelBgStyle:d,labelBgPadding:l,labelBgBorderRadius:u}):null]})}function Kb({pos:e,x1:n,y1:i,x2:s,y2:a}){return e===Ne.Left||e===Ne.Right?[.5*(n+s),i]:[n,.5*(i+a)]}function s1({sourceX:e,sourceY:n,sourcePosition:i=Ne.Bottom,targetX:s,targetY:a,targetPosition:f=Ne.Top}){const[d,l]=Kb({pos:i,x1:e,y1:n,x2:s,y2:a}),[u,c]=Kb({pos:f,x1:s,y1:a,x2:e,y2:n}),[v,m,_,x]=Tw({sourceX:e,sourceY:n,targetX:s,targetY:a,sourceControlX:d,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${n} C${d},${l} ${u},${c} ${s},${a}`,v,m,_,x]}function o1(e){return L.memo(({id:n,sourceX:i,sourceY:s,targetX:a,targetY:f,sourcePosition:d,targetPosition:l,label:u,labelStyle:c,labelShowBg:v,labelBgStyle:m,labelBgPadding:_,labelBgBorderRadius:x,style:C,markerEnd:S,markerStart:p,interactionWidth:g})=>{const[b,y,E]=s1({sourceX:i,sourceY:s,sourcePosition:d,targetX:a,targetY:f,targetPosition:l}),M=e.isInternal?void 0:n;return D.jsx(is,{id:M,path:b,labelX:y,labelY:E,label:u,labelStyle:c,labelShowBg:v,labelBgStyle:m,labelBgPadding:_,labelBgBorderRadius:x,style:C,markerEnd:S,markerStart:p,interactionWidth:g})})}const h5=o1({isInternal:!1}),a1=o1({isInternal:!0});h5.displayName="SimpleBezierEdge";a1.displayName="SimpleBezierEdgeInternal";function l1(e){return L.memo(({id:n,sourceX:i,sourceY:s,targetX:a,targetY:f,label:d,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:v,labelBgBorderRadius:m,style:_,sourcePosition:x=Ne.Bottom,targetPosition:C=Ne.Top,markerEnd:S,markerStart:p,pathOptions:g,interactionWidth:b})=>{const[y,E,M]=Ym({sourceX:i,sourceY:s,sourcePosition:x,targetX:a,targetY:f,targetPosition:C,borderRadius:g?.borderRadius,offset:g?.offset,stepPosition:g?.stepPosition}),O=e.isInternal?void 0:n;return D.jsx(is,{id:O,path:y,labelX:E,labelY:M,label:d,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:v,labelBgBorderRadius:m,style:_,markerEnd:S,markerStart:p,interactionWidth:b})})}const c1=l1({isInternal:!1}),u1=l1({isInternal:!0});c1.displayName="SmoothStepEdge";u1.displayName="SmoothStepEdgeInternal";function h1(e){return L.memo(({id:n,...i})=>{const s=e.isInternal?void 0:n;return D.jsx(c1,{...i,id:s,pathOptions:L.useMemo(()=>({borderRadius:0,offset:i.pathOptions?.offset}),[i.pathOptions?.offset])})})}const f5=h1({isInternal:!1}),f1=h1({isInternal:!0});f5.displayName="StepEdge";f1.displayName="StepEdgeInternal";function d1(e){return L.memo(({id:n,sourceX:i,sourceY:s,targetX:a,targetY:f,label:d,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:v,labelBgBorderRadius:m,style:_,markerEnd:x,markerStart:C,interactionWidth:S})=>{const[p,g,b]=Dw({sourceX:i,sourceY:s,targetX:a,targetY:f}),y=e.isInternal?void 0:n;return D.jsx(is,{id:y,path:p,labelX:g,labelY:b,label:d,labelStyle:l,labelShowBg:u,labelBgStyle:c,labelBgPadding:v,labelBgBorderRadius:m,style:_,markerEnd:x,markerStart:C,interactionWidth:S})})}const d5=d1({isInternal:!1}),m1=d1({isInternal:!0});d5.displayName="StraightEdge";m1.displayName="StraightEdgeInternal";function p1(e){return L.memo(({id:n,sourceX:i,sourceY:s,targetX:a,targetY:f,sourcePosition:d=Ne.Bottom,targetPosition:l=Ne.Top,label:u,labelStyle:c,labelShowBg:v,labelBgStyle:m,labelBgPadding:_,labelBgBorderRadius:x,style:C,markerEnd:S,markerStart:p,pathOptions:g,interactionWidth:b})=>{const[y,E,M]=Up({sourceX:i,sourceY:s,sourcePosition:d,targetX:a,targetY:f,targetPosition:l,curvature:g?.curvature}),O=e.isInternal?void 0:n;return D.jsx(is,{id:O,path:y,labelX:E,labelY:M,label:u,labelStyle:c,labelShowBg:v,labelBgStyle:m,labelBgPadding:_,labelBgBorderRadius:x,style:C,markerEnd:S,markerStart:p,interactionWidth:b})})}const m5=p1({isInternal:!1}),g1=p1({isInternal:!0});m5.displayName="BezierEdge";g1.displayName="BezierEdgeInternal";const Gb={default:g1,straight:m1,step:f1,smoothstep:u1,simplebezier:a1},Xb={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},p5=(e,n,i)=>i===Ne.Left?e-n:i===Ne.Right?e+n:e,g5=(e,n,i)=>i===Ne.Top?e-n:i===Ne.Bottom?e+n:e,Qb="react-flow__edgeupdater";function Zb({position:e,centerX:n,centerY:i,radius:s=10,onMouseDown:a,onMouseEnter:f,onMouseOut:d,type:l}){return D.jsx("circle",{onMouseDown:a,onMouseEnter:f,onMouseOut:d,className:Ut([Qb,`${Qb}-${l}`]),cx:p5(n,s,e),cy:g5(i,s,e),r:s,stroke:"transparent",fill:"transparent"})}function v5({isReconnectable:e,reconnectRadius:n,edge:i,sourceX:s,sourceY:a,targetX:f,targetY:d,sourcePosition:l,targetPosition:u,onReconnect:c,onReconnectStart:v,onReconnectEnd:m,setReconnecting:_,setUpdateHover:x}){const C=Ct(),S=(E,M)=>{if(E.button!==0)return;const{autoPanOnConnect:O,domNode:T,isValidConnection:A,connectionMode:k,connectionRadius:q,lib:z,onConnectStart:I,onConnectEnd:W,cancelConnection:U,nodeLookup:G,rfId:H,panBy:K,updateConnection:F}=C.getState(),N=M.type==="target",$=(Q,J)=>{_(!1),m?.(Q,i,M.type,J)},B=Q=>c?.(i,Q),P=(Q,J)=>{_(!0),v?.(E,i,M.type),I?.(Q,J)};Xm.onPointerDown(E.nativeEvent,{autoPanOnConnect:O,connectionMode:k,connectionRadius:q,domNode:T,handleId:M.id,nodeId:M.nodeId,nodeLookup:G,isTarget:N,edgeUpdaterType:M.type,lib:z,flowId:H,cancelConnection:U,panBy:K,isValidConnection:A,onConnect:B,onConnectStart:P,onConnectEnd:W,onReconnectEnd:$,updateConnection:F,getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,dragThreshold:C.getState().connectionDragThreshold,handleDomNode:E.currentTarget})},p=E=>S(E,{nodeId:i.target,id:i.targetHandle??null,type:"target"}),g=E=>S(E,{nodeId:i.source,id:i.sourceHandle??null,type:"source"}),b=()=>x(!0),y=()=>x(!1);return D.jsxs(D.Fragment,{children:[(e===!0||e==="source")&&D.jsx(Zb,{position:l,centerX:s,centerY:a,radius:n,onMouseDown:p,onMouseEnter:b,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&D.jsx(Zb,{position:u,centerX:f,centerY:d,radius:n,onMouseDown:g,onMouseEnter:b,onMouseOut:y,type:"target"})]})}function _5({id:e,edgesFocusable:n,edgesReconnectable:i,elementsSelectable:s,onClick:a,onDoubleClick:f,onContextMenu:d,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,reconnectRadius:v,onReconnect:m,onReconnectStart:_,onReconnectEnd:x,rfId:C,edgeTypes:S,noPanClassName:p,onError:g,disableKeyboardA11y:b}){let y=Ze(le=>le.edgeLookup.get(e));const E=Ze(le=>le.defaultEdgeOptions);y=E?{...E,...y}:y;let M=y.type||"default",O=S?.[M]||Gb[M];O===void 0&&(g?.("011",Ur.error011(M)),M="default",O=S?.default||Gb.default);const T=!!(y.focusable||n&&typeof y.focusable>"u"),A=typeof m<"u"&&(y.reconnectable||i&&typeof y.reconnectable>"u"),k=!!(y.selectable||s&&typeof y.selectable>"u"),q=L.useRef(null),[z,I]=L.useState(!1),[W,U]=L.useState(!1),G=Ct(),{zIndex:H,sourceX:K,sourceY:F,targetX:N,targetY:$,sourcePosition:B,targetPosition:P}=Ze(L.useCallback(le=>{const _e=le.nodeLookup.get(y.source),Ce=le.nodeLookup.get(y.target);if(!_e||!Ce)return{zIndex:y.zIndex,...Xb};const He=ck({id:e,sourceNode:_e,targetNode:Ce,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:le.connectionMode,onError:g});return{zIndex:tk({selected:y.selected,zIndex:y.zIndex,sourceNode:_e,targetNode:Ce,elevateOnSelect:le.elevateEdgesOnSelect,zIndexMode:le.zIndexMode}),...He||Xb}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),wt),Q=L.useMemo(()=>y.markerStart?`url('#${Km(y.markerStart,C)}')`:void 0,[y.markerStart,C]),J=L.useMemo(()=>y.markerEnd?`url('#${Km(y.markerEnd,C)}')`:void 0,[y.markerEnd,C]);if(y.hidden||K===null||F===null||N===null||$===null)return null;const ae=le=>{const{addSelectedEdges:_e,unselectNodesAndEdges:Ce,multiSelectionActive:He}=G.getState();k&&(G.setState({nodesSelectionActive:!1}),y.selected&&He?(Ce({nodes:[],edges:[y]}),q.current?.blur()):_e([e])),a&&a(le,y)},Z=f?le=>{f(le,{...y})}:void 0,X=d?le=>{d(le,{...y})}:void 0,V=l?le=>{l(le,{...y})}:void 0,ie=u?le=>{u(le,{...y})}:void 0,de=c?le=>{c(le,{...y})}:void 0,re=le=>{if(!b&&mw.includes(le.key)&&k){const{unselectNodesAndEdges:_e,addSelectedEdges:Ce}=G.getState();le.key==="Escape"?(q.current?.blur(),_e({edges:[y]})):Ce([e])}};return D.jsx("svg",{style:{zIndex:H},children:D.jsxs("g",{className:Ut(["react-flow__edge",`react-flow__edge-${M}`,y.className,p,{selected:y.selected,animated:y.animated,inactive:!k&&!a,updating:z,selectable:k}]),onClick:ae,onDoubleClick:Z,onContextMenu:X,onMouseEnter:V,onMouseMove:ie,onMouseLeave:de,onKeyDown:T?re:void 0,tabIndex:T?0:void 0,role:y.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":T?`${qw}-${C}`:void 0,ref:q,...y.domAttributes,children:[!W&&D.jsx(O,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:k,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:K,sourceY:F,targetX:N,targetY:$,sourcePosition:B,targetPosition:P,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:Q,markerEnd:J,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),A&&D.jsx(v5,{edge:y,isReconnectable:A,reconnectRadius:v,onReconnect:m,onReconnectStart:_,onReconnectEnd:x,sourceX:K,sourceY:F,targetX:N,targetY:$,sourcePosition:B,targetPosition:P,setUpdateHover:I,setReconnecting:U})]})})}var y5=L.memo(_5);const b5=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function v1({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:i,edgeTypes:s,noPanClassName:a,onReconnect:f,onEdgeContextMenu:d,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:v,reconnectRadius:m,onEdgeDoubleClick:_,onReconnectStart:x,onReconnectEnd:C,disableKeyboardA11y:S}){const{edgesFocusable:p,edgesReconnectable:g,elementsSelectable:b,onError:y}=Ze(b5,wt),E=i5(n);return D.jsxs("div",{className:"react-flow__edges",children:[D.jsx(c5,{defaultColor:e,rfId:i}),E.map(M=>D.jsx(y5,{id:M,edgesFocusable:p,edgesReconnectable:g,elementsSelectable:b,noPanClassName:a,onReconnect:f,onContextMenu:d,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,onClick:v,reconnectRadius:m,onDoubleClick:_,onReconnectStart:x,onReconnectEnd:C,rfId:i,onError:y,edgeTypes:s,disableKeyboardA11y:S},M))]})}v1.displayName="EdgeRenderer";const S5=L.memo(v1),x5=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function w5({children:e}){const n=Ze(x5);return D.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function C5(e){const n=Yp(),i=L.useRef(!1);L.useEffect(()=>{!i.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),i.current=!0)},[e,n.viewportInitialized])}const E5=e=>e.panZoom?.syncViewport;function R5(e){const n=Ze(E5),i=Ct();return L.useEffect(()=>{e&&(n?.(e),i.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function A5(e){return e.connection.inProgress?{...e.connection,to:Kl(e.connection.to,e.transform)}:{...e.connection}}function T5(e){return A5}function M5(e){const n=T5();return Ze(n,wt)}const D5=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function O5({containerStyle:e,style:n,type:i,component:s}){const{nodesConnectable:a,width:f,height:d,isValid:l,inProgress:u}=Ze(D5,wt);return!(f&&a&&u)?null:D.jsx("svg",{style:e,width:f,height:d,className:"react-flow__connectionline react-flow__container",children:D.jsx("g",{className:Ut(["react-flow__connection",vw(l)]),children:D.jsx(_1,{style:n,type:i,CustomComponent:s,isValid:l})})})}const _1=({style:e,type:n=ns.Bezier,CustomComponent:i,isValid:s})=>{const{inProgress:a,from:f,fromNode:d,fromHandle:l,fromPosition:u,to:c,toNode:v,toHandle:m,toPosition:_,pointer:x}=M5();if(!a)return;if(i)return D.jsx(i,{connectionLineType:n,connectionLineStyle:e,fromNode:d,fromHandle:l,fromX:f.x,fromY:f.y,toX:c.x,toY:c.y,fromPosition:u,toPosition:_,connectionStatus:vw(s),toNode:v,toHandle:m,pointer:x});let C="";const S={sourceX:f.x,sourceY:f.y,sourcePosition:u,targetX:c.x,targetY:c.y,targetPosition:_};switch(n){case ns.Bezier:[C]=Up(S);break;case ns.SimpleBezier:[C]=s1(S);break;case ns.Step:[C]=Ym({...S,borderRadius:0});break;case ns.SmoothStep:[C]=Ym(S);break;default:[C]=Dw(S)}return D.jsx("path",{d:C,fill:"none",className:"react-flow__connection-path",style:e})};_1.displayName="ConnectionLine";const L5={};function Jb(e=L5){L.useRef(e),Ct(),L.useEffect(()=>{},[e])}function k5(){Ct(),L.useRef(!1),L.useEffect(()=>{},[])}function y1({nodeTypes:e,edgeTypes:n,onInit:i,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:f,onEdgeDoubleClick:d,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:v,onSelectionContextMenu:m,onSelectionStart:_,onSelectionEnd:x,connectionLineType:C,connectionLineStyle:S,connectionLineComponent:p,connectionLineContainerStyle:g,selectionKeyCode:b,selectionOnDrag:y,selectionMode:E,multiSelectionKeyCode:M,panActivationKeyCode:O,zoomActivationKeyCode:T,deleteKeyCode:A,onlyRenderVisibleElements:k,elementsSelectable:q,defaultViewport:z,translateExtent:I,minZoom:W,maxZoom:U,preventScrolling:G,defaultMarkerColor:H,zoomOnScroll:K,zoomOnPinch:F,panOnScroll:N,panOnScrollSpeed:$,panOnScrollMode:B,zoomOnDoubleClick:P,panOnDrag:Q,onPaneClick:J,onPaneMouseEnter:ae,onPaneMouseMove:Z,onPaneMouseLeave:X,onPaneScroll:V,onPaneContextMenu:ie,paneClickDistance:de,nodeClickDistance:re,onEdgeContextMenu:le,onEdgeMouseEnter:_e,onEdgeMouseMove:Ce,onEdgeMouseLeave:He,reconnectRadius:Be,onReconnect:we,onReconnectStart:Ft,onReconnectEnd:kt,noDragClassName:en,noWheelClassName:hn,noPanClassName:yn,disableKeyboardA11y:Rt,nodeExtent:it,rfId:Et,viewport:Kt,onViewportChange:an}){return Jb(e),Jb(n),k5(),C5(i),R5(Kt),D.jsx(KN,{onPaneClick:J,onPaneMouseEnter:ae,onPaneMouseMove:Z,onPaneMouseLeave:X,onPaneContextMenu:ie,onPaneScroll:V,paneClickDistance:de,deleteKeyCode:A,selectionKeyCode:b,selectionOnDrag:y,selectionMode:E,onSelectionStart:_,onSelectionEnd:x,multiSelectionKeyCode:M,panActivationKeyCode:O,zoomActivationKeyCode:T,elementsSelectable:q,zoomOnScroll:K,zoomOnPinch:F,zoomOnDoubleClick:P,panOnScroll:N,panOnScrollSpeed:$,panOnScrollMode:B,panOnDrag:Q,defaultViewport:z,translateExtent:I,minZoom:W,maxZoom:U,onSelectionContextMenu:m,preventScrolling:G,noDragClassName:en,noWheelClassName:hn,noPanClassName:yn,disableKeyboardA11y:Rt,onViewportChange:an,isControlledViewport:!!Kt,children:D.jsxs(w5,{children:[D.jsx(S5,{edgeTypes:n,onEdgeClick:a,onEdgeDoubleClick:d,onReconnect:we,onReconnectStart:Ft,onReconnectEnd:kt,onlyRenderVisibleElements:k,onEdgeContextMenu:le,onEdgeMouseEnter:_e,onEdgeMouseMove:Ce,onEdgeMouseLeave:He,reconnectRadius:Be,defaultMarkerColor:H,noPanClassName:yn,disableKeyboardA11y:Rt,rfId:Et}),D.jsx(O5,{style:S,type:C,component:p,containerStyle:g}),D.jsx("div",{className:"react-flow__edgelabel-renderer"}),D.jsx(r5,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:f,onNodeMouseEnter:l,onNodeMouseMove:u,onNodeMouseLeave:c,onNodeContextMenu:v,nodeClickDistance:re,onlyRenderVisibleElements:k,noPanClassName:yn,noDragClassName:en,disableKeyboardA11y:Rt,nodeExtent:it,rfId:Et}),D.jsx("div",{className:"react-flow__viewport-portal"})]})})}y1.displayName="GraphView";const N5=L.memo(y1),eS=({nodes:e,edges:n,defaultNodes:i,defaultEdges:s,width:a,height:f,fitView:d,fitViewOptions:l,minZoom:u=.5,maxZoom:c=2,nodeOrigin:v,nodeExtent:m,zIndexMode:_="basic"}={})=>{const x=new Map,C=new Map,S=new Map,p=new Map,g=s??n??[],b=i??e??[],y=v??[0,0],E=m??Al;kw(S,p,g);const M=Gm(b,x,C,{nodeOrigin:y,nodeExtent:E,zIndexMode:_});let O=[0,0,1];if(d&&a&&f){const T=Wl(x,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:A,y:k,zoom:q}=Pp(T,a,f,u,c,l?.padding??.1);O=[A,k,q]}return{rfId:"1",width:a??0,height:f??0,transform:O,nodes:b,nodesInitialized:M,nodeLookup:x,parentLookup:C,edges:g,edgeLookup:p,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:i!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:u,maxZoom:c,translateExtent:Al,nodeExtent:E,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ea.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,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:d??!1,fitViewOptions:l,fitViewResolver:null,connection:{...gw},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:GL,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:pw,zIndexMode:_,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},B5=({nodes:e,edges:n,defaultNodes:i,defaultEdges:s,width:a,height:f,fitView:d,fitViewOptions:l,minZoom:u,maxZoom:c,nodeOrigin:v,nodeExtent:m,zIndexMode:_})=>Jk((x,C)=>{async function S(){const{nodeLookup:p,panZoom:g,fitViewOptions:b,fitViewResolver:y,width:E,height:M,minZoom:O,maxZoom:T}=C();g&&(await YL({nodes:p,width:E,height:M,panZoom:g,minZoom:O,maxZoom:T},b),y?.resolve(!0),x({fitViewResolver:null}))}return{...eS({nodes:e,edges:n,width:a,height:f,fitView:d,fitViewOptions:l,minZoom:u,maxZoom:c,nodeOrigin:v,nodeExtent:m,defaultNodes:i,defaultEdges:s,zIndexMode:_}),setNodes:p=>{const{nodeLookup:g,parentLookup:b,nodeOrigin:y,elevateNodesOnSelect:E,fitViewQueued:M,zIndexMode:O}=C(),T=Gm(p,g,b,{nodeOrigin:y,nodeExtent:m,elevateNodesOnSelect:E,checkEquality:!0,zIndexMode:O});M&&T?(S(),x({nodes:p,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0})):x({nodes:p,nodesInitialized:T})},setEdges:p=>{const{connectionLookup:g,edgeLookup:b}=C();kw(g,b,p),x({edges:p})},setDefaultNodesAndEdges:(p,g)=>{if(p){const{setNodes:b}=C();b(p),x({hasDefaultNodes:!0})}if(g){const{setEdges:b}=C();b(g),x({hasDefaultEdges:!0})}},updateNodeInternals:p=>{const{triggerNodeChanges:g,nodeLookup:b,parentLookup:y,domNode:E,nodeOrigin:M,nodeExtent:O,debug:T,fitViewQueued:A,zIndexMode:k}=C(),{changes:q,updatedInternals:z}=vk(p,b,y,E,M,O,k);z&&(dk(b,y,{nodeOrigin:M,nodeExtent:O,zIndexMode:k}),A?(S(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),q?.length>0&&(T&&console.log("React Flow: trigger node changes",q),g?.(q)))},updateNodePositions:(p,g=!1)=>{const b=[];let y=[];const{nodeLookup:E,triggerNodeChanges:M,connection:O,updateConnection:T,onNodesChangeMiddlewareMap:A}=C();for(const[k,q]of p){const z=E.get(k),I=!!(z?.expandParent&&z?.parentId&&q?.position),W={id:k,type:"position",position:I?{x:Math.max(0,q.position.x),y:Math.max(0,q.position.y)}:q.position,dragging:g};if(z&&O.inProgress&&O.fromNode.id===z.id){const U=qs(z,O.fromHandle,Ne.Left,!0);T({...O,from:U})}I&&z.parentId&&b.push({id:k,parentId:z.parentId,rect:{...q.internals.positionAbsolute,width:q.measured.width??0,height:q.measured.height??0}}),y.push(W)}if(b.length>0){const{parentLookup:k,nodeOrigin:q}=C(),z=Wp(b,E,k,q);y.push(...z)}for(const k of A.values())y=k(y);M(y)},triggerNodeChanges:p=>{const{onNodesChange:g,setNodes:b,nodes:y,hasDefaultNodes:E,debug:M}=C();if(p?.length){if(E){const O=Kw(p,y);b(O)}M&&console.log("React Flow: trigger node changes",p),g?.(p)}},triggerEdgeChanges:p=>{const{onEdgesChange:g,setEdges:b,edges:y,hasDefaultEdges:E,debug:M}=C();if(p?.length){if(E){const O=Gw(p,y);b(O)}M&&console.log("React Flow: trigger edge changes",p),g?.(p)}},addSelectedNodes:p=>{const{multiSelectionActive:g,edgeLookup:b,nodeLookup:y,triggerNodeChanges:E,triggerEdgeChanges:M}=C();if(g){const O=p.map(T=>ks(T,!0));E(O);return}E(Wo(y,new Set([...p]),!0)),M(Wo(b))},addSelectedEdges:p=>{const{multiSelectionActive:g,edgeLookup:b,nodeLookup:y,triggerNodeChanges:E,triggerEdgeChanges:M}=C();if(g){const O=p.map(T=>ks(T,!0));M(O);return}M(Wo(b,new Set([...p]))),E(Wo(y,new Set,!0))},unselectNodesAndEdges:({nodes:p,edges:g}={})=>{const{edges:b,nodes:y,nodeLookup:E,triggerNodeChanges:M,triggerEdgeChanges:O}=C(),T=p||y,A=g||b,k=T.map(z=>{const I=E.get(z.id);return I&&(I.selected=!1),ks(z.id,!1)}),q=A.map(z=>ks(z.id,!1));M(k),O(q)},setMinZoom:p=>{const{panZoom:g,maxZoom:b}=C();g?.setScaleExtent([p,b]),x({minZoom:p})},setMaxZoom:p=>{const{panZoom:g,minZoom:b}=C();g?.setScaleExtent([b,p]),x({maxZoom:p})},setTranslateExtent:p=>{C().panZoom?.setTranslateExtent(p),x({translateExtent:p})},resetSelectedElements:()=>{const{edges:p,nodes:g,triggerNodeChanges:b,triggerEdgeChanges:y,elementsSelectable:E}=C();if(!E)return;const M=g.reduce((T,A)=>A.selected?[...T,ks(A.id,!1)]:T,[]),O=p.reduce((T,A)=>A.selected?[...T,ks(A.id,!1)]:T,[]);b(M),y(O)},setNodeExtent:p=>{const{nodes:g,nodeLookup:b,parentLookup:y,nodeOrigin:E,elevateNodesOnSelect:M,nodeExtent:O,zIndexMode:T}=C();p[0][0]===O[0][0]&&p[0][1]===O[0][1]&&p[1][0]===O[1][0]&&p[1][1]===O[1][1]||(Gm(g,b,y,{nodeOrigin:E,nodeExtent:p,elevateNodesOnSelect:M,checkEquality:!1,zIndexMode:T}),x({nodeExtent:p}))},panBy:p=>{const{transform:g,width:b,height:y,panZoom:E,translateExtent:M}=C();return _k({delta:p,panZoom:E,transform:g,translateExtent:M,width:b,height:y})},setCenter:async(p,g,b)=>{const{width:y,height:E,maxZoom:M,panZoom:O}=C();if(!O)return Promise.resolve(!1);const T=typeof b?.zoom<"u"?b.zoom:M;return await O.setViewport({x:y/2-p*T,y:E/2-g*T,zoom:T},{duration:b?.duration,ease:b?.ease,interpolate:b?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{x({connection:{...gw}})},updateConnection:p=>{x({connection:p})},reset:()=>x({...eS()})}},Object.is);function j5({initialNodes:e,initialEdges:n,defaultNodes:i,defaultEdges:s,initialWidth:a,initialHeight:f,initialMinZoom:d,initialMaxZoom:l,initialFitViewOptions:u,fitView:c,nodeOrigin:v,nodeExtent:m,zIndexMode:_,children:x}){const[C]=L.useState(()=>B5({nodes:e,edges:n,defaultNodes:i,defaultEdges:s,width:a,height:f,fitView:c,minZoom:d,maxZoom:l,fitViewOptions:u,nodeOrigin:v,nodeExtent:m,zIndexMode:_}));return D.jsx(eN,{value:C,children:D.jsx(wN,{children:x})})}function H5({children:e,nodes:n,edges:i,defaultNodes:s,defaultEdges:a,width:f,height:d,fitView:l,fitViewOptions:u,minZoom:c,maxZoom:v,nodeOrigin:m,nodeExtent:_,zIndexMode:x}){return L.useContext(Rh)?D.jsx(D.Fragment,{children:e}):D.jsx(j5,{initialNodes:n,initialEdges:i,defaultNodes:s,defaultEdges:a,initialWidth:f,initialHeight:d,fitView:l,initialFitViewOptions:u,initialMinZoom:c,initialMaxZoom:v,nodeOrigin:m,nodeExtent:_,zIndexMode:x,children:e})}const z5={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function P5({nodes:e,edges:n,defaultNodes:i,defaultEdges:s,className:a,nodeTypes:f,edgeTypes:d,onNodeClick:l,onEdgeClick:u,onInit:c,onMove:v,onMoveStart:m,onMoveEnd:_,onConnect:x,onConnectStart:C,onConnectEnd:S,onClickConnectStart:p,onClickConnectEnd:g,onNodeMouseEnter:b,onNodeMouseMove:y,onNodeMouseLeave:E,onNodeContextMenu:M,onNodeDoubleClick:O,onNodeDragStart:T,onNodeDrag:A,onNodeDragStop:k,onNodesDelete:q,onEdgesDelete:z,onDelete:I,onSelectionChange:W,onSelectionDragStart:U,onSelectionDrag:G,onSelectionDragStop:H,onSelectionContextMenu:K,onSelectionStart:F,onSelectionEnd:N,onBeforeDelete:$,connectionMode:B,connectionLineType:P=ns.Bezier,connectionLineStyle:Q,connectionLineComponent:J,connectionLineContainerStyle:ae,deleteKeyCode:Z="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:V=!1,selectionMode:ie=Tl.Full,panActivationKeyCode:de="Space",multiSelectionKeyCode:re=Dl()?"Meta":"Control",zoomActivationKeyCode:le=Dl()?"Meta":"Control",snapToGrid:_e,snapGrid:Ce,onlyRenderVisibleElements:He=!1,selectNodesOnDrag:Be,nodesDraggable:we,autoPanOnNodeFocus:Ft,nodesConnectable:kt,nodesFocusable:en,nodeOrigin:hn=Ww,edgesFocusable:yn,edgesReconnectable:Rt,elementsSelectable:it=!0,defaultViewport:Et=dN,minZoom:Kt=.5,maxZoom:an=2,translateExtent:gt=Al,preventScrolling:Gt=!0,nodeExtent:Xt,defaultMarkerColor:sr="#b1b1b7",zoomOnScroll:st=!0,zoomOnPinch:or=!0,panOnScroll:_t=!1,panOnScrollSpeed:Ln=.5,panOnScrollMode:Qt=zs.Free,zoomOnDoubleClick:eo=!0,panOnDrag:fa=!0,onPaneClick:to,onPaneMouseEnter:ar,onPaneMouseMove:Wr,onPaneMouseLeave:wr,onPaneScroll:lr,onPaneContextMenu:Yr,paneClickDistance:Kr=1,nodeClickDistance:no=0,children:Gr,onReconnect:Cr,onReconnectStart:Er,onReconnectEnd:da,onEdgeContextMenu:ro,onEdgeDoubleClick:ee,onEdgeMouseEnter:oe,onEdgeMouseMove:fe,onEdgeMouseLeave:ye,reconnectRadius:be=10,onNodesChange:De,onEdgesChange:Ee,noDragClassName:Se="nodrag",noWheelClassName:xe="nowheel",noPanClassName:Me="nopan",fitView:Oe,fitViewOptions:ke,connectOnClick:We,attributionPosition:ot,proOptions:mt,defaultEdgeOptions:St,elevateNodesOnSelect:Je=!0,elevateEdgesOnSelect:et=!1,disableKeyboardA11y:ln=!1,autoPanOnConnect:bn,autoPanOnNodeDrag:lt,autoPanSpeed:fn,connectionRadius:Ei,isValidConnection:dn,onError:cn,style:Ri,id:Rr,nodeDragThreshold:Ve,connectionDragThreshold:Nt,viewport:kn,onViewportChange:Sn,width:tt,height:$t,colorMode:ds="light",debug:ma,onScroll:io,ariaLabelConfig:Zl,zIndexMode:ms="basic",...Hh},xn){const ps=Rr||"1",Jl=vN(ds),pa=L.useCallback(Xr=>{Xr.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),io?.(Xr)},[io]);return D.jsx("div",{"data-testid":"rf__wrapper",...Hh,onScroll:pa,style:{...Ri,...z5},ref:xn,className:Ut(["react-flow",a,Jl]),id:Rr,role:"application",children:D.jsxs(H5,{nodes:e,edges:n,width:tt,height:$t,fitView:Oe,fitViewOptions:ke,minZoom:Kt,maxZoom:an,nodeOrigin:hn,nodeExtent:Xt,zIndexMode:ms,children:[D.jsx(N5,{onInit:c,onNodeClick:l,onEdgeClick:u,onNodeMouseEnter:b,onNodeMouseMove:y,onNodeMouseLeave:E,onNodeContextMenu:M,onNodeDoubleClick:O,nodeTypes:f,edgeTypes:d,connectionLineType:P,connectionLineStyle:Q,connectionLineComponent:J,connectionLineContainerStyle:ae,selectionKeyCode:X,selectionOnDrag:V,selectionMode:ie,deleteKeyCode:Z,multiSelectionKeyCode:re,panActivationKeyCode:de,zoomActivationKeyCode:le,onlyRenderVisibleElements:He,defaultViewport:Et,translateExtent:gt,minZoom:Kt,maxZoom:an,preventScrolling:Gt,zoomOnScroll:st,zoomOnPinch:or,zoomOnDoubleClick:eo,panOnScroll:_t,panOnScrollSpeed:Ln,panOnScrollMode:Qt,panOnDrag:fa,onPaneClick:to,onPaneMouseEnter:ar,onPaneMouseMove:Wr,onPaneMouseLeave:wr,onPaneScroll:lr,onPaneContextMenu:Yr,paneClickDistance:Kr,nodeClickDistance:no,onSelectionContextMenu:K,onSelectionStart:F,onSelectionEnd:N,onReconnect:Cr,onReconnectStart:Er,onReconnectEnd:da,onEdgeContextMenu:ro,onEdgeDoubleClick:ee,onEdgeMouseEnter:oe,onEdgeMouseMove:fe,onEdgeMouseLeave:ye,reconnectRadius:be,defaultMarkerColor:sr,noDragClassName:Se,noWheelClassName:xe,noPanClassName:Me,rfId:ps,disableKeyboardA11y:ln,nodeExtent:Xt,viewport:kn,onViewportChange:Sn}),D.jsx(gN,{nodes:e,edges:n,defaultNodes:i,defaultEdges:s,onConnect:x,onConnectStart:C,onConnectEnd:S,onClickConnectStart:p,onClickConnectEnd:g,nodesDraggable:we,autoPanOnNodeFocus:Ft,nodesConnectable:kt,nodesFocusable:en,edgesFocusable:yn,edgesReconnectable:Rt,elementsSelectable:it,elevateNodesOnSelect:Je,elevateEdgesOnSelect:et,minZoom:Kt,maxZoom:an,nodeExtent:Xt,onNodesChange:De,onEdgesChange:Ee,snapToGrid:_e,snapGrid:Ce,connectionMode:B,translateExtent:gt,connectOnClick:We,defaultEdgeOptions:St,fitView:Oe,fitViewOptions:ke,onNodesDelete:q,onEdgesDelete:z,onDelete:I,onNodeDragStart:T,onNodeDrag:A,onNodeDragStop:k,onSelectionDrag:G,onSelectionDragStart:U,onSelectionDragStop:H,onMove:v,onMoveStart:m,onMoveEnd:_,noPanClassName:Me,nodeOrigin:hn,rfId:ps,autoPanOnConnect:bn,autoPanOnNodeDrag:lt,autoPanSpeed:fn,onError:cn,connectionRadius:Ei,isValidConnection:dn,selectNodesOnDrag:Be,nodeDragThreshold:Ve,connectionDragThreshold:Nt,onBeforeDelete:$,debug:ma,ariaLabelConfig:Zl,zIndexMode:ms}),D.jsx(fN,{onSelectionChange:W}),Gr,D.jsx(aN,{proOptions:mt,position:ot}),D.jsx(oN,{rfId:ps,disableKeyboardA11y:ln})]})})}var I5=Xw(P5);const U5=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function mm({children:e}){const n=Ze(U5);return n?Js.createPortal(e,n):null}function F5(e){const[n,i]=L.useState(e),s=L.useCallback(a=>i(f=>Kw(a,f)),[]);return[n,i,s]}function $5(e){const[n,i]=L.useState(e),s=L.useCallback(a=>i(f=>Gw(a,f)),[]);return[n,i,s]}function V5({dimensions:e,lineWidth:n,variant:i,className:s}){return D.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ut(["react-flow__background-pattern",i,s])})}function q5({radius:e,className:n}){return D.jsx("circle",{cx:e,cy:e,r:e,className:Ut(["react-flow__background-pattern","dots",n])})}var _i;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(_i||(_i={}));const W5={[_i.Dots]:1,[_i.Lines]:1,[_i.Cross]:6},Y5=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function b1({id:e,variant:n=_i.Dots,gap:i=20,size:s,lineWidth:a=1,offset:f=0,color:d,bgColor:l,style:u,className:c,patternClassName:v}){const m=L.useRef(null),{transform:_,patternId:x}=Ze(Y5,wt),C=s||W5[n],S=n===_i.Dots,p=n===_i.Cross,g=Array.isArray(i)?i:[i,i],b=[g[0]*_[2]||1,g[1]*_[2]||1],y=C*_[2],E=Array.isArray(f)?f:[f,f],M=p?[y,y]:b,O=[E[0]*_[2]||1+M[0]/2,E[1]*_[2]||1+M[1]/2],T=`${x}${e||""}`;return D.jsxs("svg",{className:Ut(["react-flow__background",c]),style:{...u,...Th,"--xy-background-color-props":l,"--xy-background-pattern-color-props":d},ref:m,"data-testid":"rf__background",children:[D.jsx("pattern",{id:T,x:_[0]%b[0],y:_[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${O[0]},-${O[1]})`,children:S?D.jsx(q5,{radius:y/2,className:v}):D.jsx(V5,{dimensions:M,lineWidth:a,variant:n,className:v})}),D.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}b1.displayName="Background";const K5=L.memo(b1);function G5(){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 X5(){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 Q5(){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 Z5(){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 J5(){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 wu({children:e,className:n,...i}){return D.jsx("button",{type:"button",className:Ut(["react-flow__controls-button",n]),...i,children:e})}const e4=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function S1({style:e,showZoom:n=!0,showFitView:i=!0,showInteractive:s=!0,fitViewOptions:a,onZoomIn:f,onZoomOut:d,onFitView:l,onInteractiveChange:u,className:c,children:v,position:m="bottom-left",orientation:_="vertical","aria-label":x}){const C=Ct(),{isInteractive:S,minZoomReached:p,maxZoomReached:g,ariaLabelConfig:b}=Ze(e4,wt),{zoomIn:y,zoomOut:E,fitView:M}=Yp(),O=()=>{y(),f?.()},T=()=>{E(),d?.()},A=()=>{M(a),l?.()},k=()=>{C.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),u?.(!S)},q=_==="horizontal"?"horizontal":"vertical";return D.jsxs(Ah,{className:Ut(["react-flow__controls",q,c]),position:m,style:e,"data-testid":"rf__controls","aria-label":x??b["controls.ariaLabel"],children:[n&&D.jsxs(D.Fragment,{children:[D.jsx(wu,{onClick:O,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:g,children:D.jsx(G5,{})}),D.jsx(wu,{onClick:T,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:p,children:D.jsx(X5,{})})]}),i&&D.jsx(wu,{className:"react-flow__controls-fitview",onClick:A,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:D.jsx(Q5,{})}),s&&D.jsx(wu,{className:"react-flow__controls-interactive",onClick:k,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:S?D.jsx(J5,{}):D.jsx(Z5,{})}),v]})}S1.displayName="Controls";const t4=L.memo(S1);function n4({id:e,x:n,y:i,width:s,height:a,style:f,color:d,strokeColor:l,strokeWidth:u,className:c,borderRadius:v,shapeRendering:m,selected:_,onClick:x}){const{background:C,backgroundColor:S}=f||{},p=d||C||S;return D.jsx("rect",{className:Ut(["react-flow__minimap-node",{selected:_},c]),x:n,y:i,rx:v,ry:v,width:s,height:a,style:{fill:p,stroke:l,strokeWidth:u},shapeRendering:m,onClick:x?g=>x(g,e):void 0})}const r4=L.memo(n4),i4=e=>e.nodes.map(n=>n.id),pm=e=>e instanceof Function?e:()=>e;function s4({nodeStrokeColor:e,nodeColor:n,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:a,nodeComponent:f=r4,onClick:d}){const l=Ze(i4,wt),u=pm(n),c=pm(e),v=pm(i),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return D.jsx(D.Fragment,{children:l.map(_=>D.jsx(a4,{id:_,nodeColorFunc:u,nodeStrokeColorFunc:c,nodeClassNameFunc:v,nodeBorderRadius:s,nodeStrokeWidth:a,NodeComponent:f,onClick:d,shapeRendering:m},_))})}function o4({id:e,nodeColorFunc:n,nodeStrokeColorFunc:i,nodeClassNameFunc:s,nodeBorderRadius:a,nodeStrokeWidth:f,shapeRendering:d,NodeComponent:l,onClick:u}){const{node:c,x:v,y:m,width:_,height:x}=Ze(C=>{const{internals:S}=C.nodeLookup.get(e),p=S.userNode,{x:g,y:b}=S.positionAbsolute,{width:y,height:E}=Ci(p);return{node:p,x:g,y:b,width:y,height:E}},wt);return!c||c.hidden||!ww(c)?null:D.jsx(l,{x:v,y:m,width:_,height:x,style:c.style,selected:!!c.selected,className:s(c),color:n(c),borderRadius:a,strokeColor:i(c),strokeWidth:f,shapeRendering:d,onClick:u,id:c.id})}const a4=L.memo(o4);var l4=L.memo(s4);const c4=200,u4=150,h4=e=>!e.hidden,f4=e=>{const n={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:n,boundingRect:e.nodeLookup.size>0?xw(Wl(e.nodeLookup,{filter:h4}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},d4="react-flow__minimap-desc";function x1({style:e,className:n,nodeStrokeColor:i,nodeColor:s,nodeClassName:a="",nodeBorderRadius:f=5,nodeStrokeWidth:d,nodeComponent:l,bgColor:u,maskColor:c,maskStrokeColor:v,maskStrokeWidth:m,position:_="bottom-right",onClick:x,onNodeClick:C,pannable:S=!1,zoomable:p=!1,ariaLabel:g,inversePan:b,zoomStep:y=1,offsetScale:E=5}){const M=Ct(),O=L.useRef(null),{boundingRect:T,viewBB:A,rfId:k,panZoom:q,translateExtent:z,flowWidth:I,flowHeight:W,ariaLabelConfig:U}=Ze(f4,wt),G=e?.width??c4,H=e?.height??u4,K=T.width/G,F=T.height/H,N=Math.max(K,F),$=N*G,B=N*H,P=E*N,Q=T.x-($-T.width)/2-P,J=T.y-(B-T.height)/2-P,ae=$+P*2,Z=B+P*2,X=`${d4}-${k}`,V=L.useRef(0),ie=L.useRef();V.current=N,L.useEffect(()=>{if(O.current&&q)return ie.current=Ak({domNode:O.current,panZoom:q,getTransform:()=>M.getState().transform,getViewScale:()=>V.current}),()=>{ie.current?.destroy()}},[q]),L.useEffect(()=>{ie.current?.update({translateExtent:z,width:I,height:W,inversePan:b,pannable:S,zoomStep:y,zoomable:p})},[S,p,b,y,z,I,W]);const de=x?_e=>{const[Ce,He]=ie.current?.pointer(_e)||[0,0];x(_e,{x:Ce,y:He})}:void 0,re=C?L.useCallback((_e,Ce)=>{const He=M.getState().nodeLookup.get(Ce).internals.userNode;C(_e,He)},[]):void 0,le=g??U["minimap.ariaLabel"];return D.jsx(Ah,{position:_,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*N:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-width-props":typeof d=="number"?d:void 0},className:Ut(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:D.jsxs("svg",{width:G,height:H,viewBox:`${Q} ${J} ${ae} ${Z}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":X,ref:O,onClick:de,children:[le&&D.jsx("title",{id:X,children:le}),D.jsx(l4,{onClick:re,nodeColor:s,nodeStrokeColor:i,nodeBorderRadius:f,nodeClassName:a,nodeStrokeWidth:d,nodeComponent:l}),D.jsx("path",{className:"react-flow__minimap-mask",d:`M${Q-P},${J-P}h${ae+P*2}v${Z+P*2}h${-ae-P*2}z
18
+ M${A.x},${A.y}h${A.width}v${A.height}h${-A.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}x1.displayName="MiniMap";const m4=L.memo(x1),p4=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,g4={[ia.Line]:"right",[ia.Handle]:"bottom-right"};function v4({nodeId:e,position:n,variant:i=ia.Handle,className:s,style:a=void 0,children:f,color:d,minWidth:l=10,minHeight:u=10,maxWidth:c=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:_,autoScale:x=!0,shouldResize:C,onResizeStart:S,onResize:p,onResizeEnd:g}){const b=e1(),y=typeof e=="string"?e:b,E=Ct(),M=L.useRef(null),O=i===ia.Handle,T=Ze(L.useCallback(p4(O&&x),[O,x]),wt),A=L.useRef(null),k=n??g4[i];L.useEffect(()=>{if(!(!M.current||!y))return A.current||(A.current=Uk({domNode:M.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:z,transform:I,snapGrid:W,snapToGrid:U,nodeOrigin:G,domNode:H}=E.getState();return{nodeLookup:z,transform:I,snapGrid:W,snapToGrid:U,nodeOrigin:G,paneDomNode:H}},onChange:(z,I)=>{const{triggerNodeChanges:W,nodeLookup:U,parentLookup:G,nodeOrigin:H}=E.getState(),K=[],F={x:z.x,y:z.y},N=U.get(y);if(N&&N.expandParent&&N.parentId){const $=N.origin??H,B=z.width??N.measured.width??0,P=z.height??N.measured.height??0,Q={id:N.id,parentId:N.parentId,rect:{width:B,height:P,...Cw({x:z.x??N.position.x,y:z.y??N.position.y},{width:B,height:P},N.parentId,U,$)}},J=Wp([Q],U,G,H);K.push(...J),F.x=z.x?Math.max($[0]*B,z.x):void 0,F.y=z.y?Math.max($[1]*P,z.y):void 0}if(F.x!==void 0&&F.y!==void 0){const $={id:y,type:"position",position:{...F}};K.push($)}if(z.width!==void 0&&z.height!==void 0){const B={id:y,type:"dimensions",resizing:!0,setAttributes:_?_==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};K.push(B)}for(const $ of I){const B={...$,type:"position"};K.push(B)}W(K)},onEnd:({width:z,height:I})=>{const W={id:y,type:"dimensions",resizing:!1,dimensions:{width:z,height:I}};E.getState().triggerNodeChanges([W])}})),A.current.update({controlPosition:k,boundaries:{minWidth:l,minHeight:u,maxWidth:c,maxHeight:v},keepAspectRatio:m,resizeDirection:_,onResizeStart:S,onResize:p,onResizeEnd:g,shouldResize:C}),()=>{A.current?.destroy()}},[k,l,u,c,v,m,S,p,g,C]);const q=k.split("-");return D.jsx("div",{className:Ut(["react-flow__resize-control","nodrag",...q,i,s]),ref:M,style:{...a,scale:T,...d&&{[O?"backgroundColor":"borderColor"]:d}},children:f})}L.memo(v4);function _4(e,n){var i,s=1;e==null&&(e=0),n==null&&(n=0);function a(){var f,d=i.length,l,u=0,c=0;for(f=0;f<d;++f)l=i[f],u+=l.x,c+=l.y;for(u=(u/d-e)*s,c=(c/d-n)*s,f=0;f<d;++f)l=i[f],l.x-=u,l.y-=c}return a.initialize=function(f){i=f},a.x=function(f){return arguments.length?(e=+f,a):e},a.y=function(f){return arguments.length?(n=+f,a):n},a.strength=function(f){return arguments.length?(s=+f,a):s},a}function y4(e){const n=+this._x.call(null,e),i=+this._y.call(null,e);return w1(this.cover(n,i),n,i,e)}function w1(e,n,i,s){if(isNaN(n)||isNaN(i))return e;var a,f=e._root,d={data:s},l=e._x0,u=e._y0,c=e._x1,v=e._y1,m,_,x,C,S,p,g,b;if(!f)return e._root=d,e;for(;f.length;)if((S=n>=(m=(l+c)/2))?l=m:c=m,(p=i>=(_=(u+v)/2))?u=_:v=_,a=f,!(f=f[g=p<<1|S]))return a[g]=d,e;if(x=+e._x.call(null,f.data),C=+e._y.call(null,f.data),n===x&&i===C)return d.next=f,a?a[g]=d:e._root=d,e;do a=a?a[g]=new Array(4):e._root=new Array(4),(S=n>=(m=(l+c)/2))?l=m:c=m,(p=i>=(_=(u+v)/2))?u=_:v=_;while((g=p<<1|S)===(b=(C>=_)<<1|x>=m));return a[b]=f,a[g]=d,e}function b4(e){var n,i,s=e.length,a,f,d=new Array(s),l=new Array(s),u=1/0,c=1/0,v=-1/0,m=-1/0;for(i=0;i<s;++i)isNaN(a=+this._x.call(null,n=e[i]))||isNaN(f=+this._y.call(null,n))||(d[i]=a,l[i]=f,a<u&&(u=a),a>v&&(v=a),f<c&&(c=f),f>m&&(m=f));if(u>v||c>m)return this;for(this.cover(u,c).cover(v,m),i=0;i<s;++i)w1(this,d[i],l[i],e[i]);return this}function S4(e,n){if(isNaN(e=+e)||isNaN(n=+n))return this;var i=this._x0,s=this._y0,a=this._x1,f=this._y1;if(isNaN(i))a=(i=Math.floor(e))+1,f=(s=Math.floor(n))+1;else{for(var d=a-i||1,l=this._root,u,c;i>e||e>=a||s>n||n>=f;)switch(c=(n<s)<<1|e<i,u=new Array(4),u[c]=l,l=u,d*=2,c){case 0:a=i+d,f=s+d;break;case 1:i=a-d,f=s+d;break;case 2:a=i+d,s=f-d;break;case 3:i=a-d,s=f-d;break}this._root&&this._root.length&&(this._root=l)}return this._x0=i,this._y0=s,this._x1=a,this._y1=f,this}function x4(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function w4(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function vn(e,n,i,s,a){this.node=e,this.x0=n,this.y0=i,this.x1=s,this.y1=a}function C4(e,n,i){var s,a=this._x0,f=this._y0,d,l,u,c,v=this._x1,m=this._y1,_=[],x=this._root,C,S;for(x&&_.push(new vn(x,a,f,v,m)),i==null?i=1/0:(a=e-i,f=n-i,v=e+i,m=n+i,i*=i);C=_.pop();)if(!(!(x=C.node)||(d=C.x0)>v||(l=C.y0)>m||(u=C.x1)<a||(c=C.y1)<f))if(x.length){var p=(d+u)/2,g=(l+c)/2;_.push(new vn(x[3],p,g,u,c),new vn(x[2],d,g,p,c),new vn(x[1],p,l,u,g),new vn(x[0],d,l,p,g)),(S=(n>=g)<<1|e>=p)&&(C=_[_.length-1],_[_.length-1]=_[_.length-1-S],_[_.length-1-S]=C)}else{var b=e-+this._x.call(null,x.data),y=n-+this._y.call(null,x.data),E=b*b+y*y;if(E<i){var M=Math.sqrt(i=E);a=e-M,f=n-M,v=e+M,m=n+M,s=x.data}}return s}function E4(e){if(isNaN(v=+this._x.call(null,e))||isNaN(m=+this._y.call(null,e)))return this;var n,i=this._root,s,a,f,d=this._x0,l=this._y0,u=this._x1,c=this._y1,v,m,_,x,C,S,p,g;if(!i)return this;if(i.length)for(;;){if((C=v>=(_=(d+u)/2))?d=_:u=_,(S=m>=(x=(l+c)/2))?l=x:c=x,n=i,!(i=i[p=S<<1|C]))return this;if(!i.length)break;(n[p+1&3]||n[p+2&3]||n[p+3&3])&&(s=n,g=p)}for(;i.data!==e;)if(a=i,!(i=i.next))return this;return(f=i.next)&&delete i.next,a?(f?a.next=f:delete a.next,this):n?(f?n[p]=f:delete n[p],(i=n[0]||n[1]||n[2]||n[3])&&i===(n[3]||n[2]||n[1]||n[0])&&!i.length&&(s?s[g]=i:this._root=i),this):(this._root=f,this)}function R4(e){for(var n=0,i=e.length;n<i;++n)this.remove(e[n]);return this}function A4(){return this._root}function T4(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function M4(e){var n=[],i,s=this._root,a,f,d,l,u;for(s&&n.push(new vn(s,this._x0,this._y0,this._x1,this._y1));i=n.pop();)if(!e(s=i.node,f=i.x0,d=i.y0,l=i.x1,u=i.y1)&&s.length){var c=(f+l)/2,v=(d+u)/2;(a=s[3])&&n.push(new vn(a,c,v,l,u)),(a=s[2])&&n.push(new vn(a,f,v,c,u)),(a=s[1])&&n.push(new vn(a,c,d,l,v)),(a=s[0])&&n.push(new vn(a,f,d,c,v))}return this}function D4(e){var n=[],i=[],s;for(this._root&&n.push(new vn(this._root,this._x0,this._y0,this._x1,this._y1));s=n.pop();){var a=s.node;if(a.length){var f,d=s.x0,l=s.y0,u=s.x1,c=s.y1,v=(d+u)/2,m=(l+c)/2;(f=a[0])&&n.push(new vn(f,d,l,v,m)),(f=a[1])&&n.push(new vn(f,v,l,u,m)),(f=a[2])&&n.push(new vn(f,d,m,v,c)),(f=a[3])&&n.push(new vn(f,v,m,u,c))}i.push(s)}for(;s=i.pop();)e(s.node,s.x0,s.y0,s.x1,s.y1);return this}function O4(e){return e[0]}function L4(e){return arguments.length?(this._x=e,this):this._x}function k4(e){return e[1]}function N4(e){return arguments.length?(this._y=e,this):this._y}function Gp(e,n,i){var s=new Xp(n??O4,i??k4,NaN,NaN,NaN,NaN);return e==null?s:s.addAll(e)}function Xp(e,n,i,s,a,f){this._x=e,this._y=n,this._x0=i,this._y0=s,this._x1=a,this._y1=f,this._root=void 0}function tS(e){for(var n={data:e.data},i=n;e=e.next;)i=i.next={data:e.data};return n}var _n=Gp.prototype=Xp.prototype;_n.copy=function(){var e=new Xp(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,i,s;if(!n)return e;if(!n.length)return e._root=tS(n),e;for(i=[{source:n,target:e._root=new Array(4)}];n=i.pop();)for(var a=0;a<4;++a)(s=n.source[a])&&(s.length?i.push({source:s,target:n.target[a]=new Array(4)}):n.target[a]=tS(s));return e};_n.add=y4;_n.addAll=b4;_n.cover=S4;_n.data=x4;_n.extent=w4;_n.find=C4;_n.remove=E4;_n.removeAll=R4;_n.root=A4;_n.size=T4;_n.visit=M4;_n.visitAfter=D4;_n.x=L4;_n.y=N4;function Ps(e){return function(){return e}}function ss(e){return(e()-.5)*1e-6}function B4(e){return e.x+e.vx}function j4(e){return e.y+e.vy}function H4(e){var n,i,s,a=1,f=1;typeof e!="function"&&(e=Ps(e==null?1:+e));function d(){for(var c,v=n.length,m,_,x,C,S,p,g=0;g<f;++g)for(m=Gp(n,B4,j4).visitAfter(l),c=0;c<v;++c)_=n[c],S=i[_.index],p=S*S,x=_.x+_.vx,C=_.y+_.vy,m.visit(b);function b(y,E,M,O,T){var A=y.data,k=y.r,q=S+k;if(A){if(A.index>_.index){var z=x-A.x-A.vx,I=C-A.y-A.vy,W=z*z+I*I;W<q*q&&(z===0&&(z=ss(s),W+=z*z),I===0&&(I=ss(s),W+=I*I),W=(q-(W=Math.sqrt(W)))/W*a,_.vx+=(z*=W)*(q=(k*=k)/(p+k)),_.vy+=(I*=W)*q,A.vx-=z*(q=1-q),A.vy-=I*q)}return}return E>x+q||O<x-q||M>C+q||T<C-q}}function l(c){if(c.data)return c.r=i[c.data.index];for(var v=c.r=0;v<4;++v)c[v]&&c[v].r>c.r&&(c.r=c[v].r)}function u(){if(n){var c,v=n.length,m;for(i=new Array(v),c=0;c<v;++c)m=n[c],i[m.index]=+e(m,c,n)}}return d.initialize=function(c,v){n=c,s=v,u()},d.iterations=function(c){return arguments.length?(f=+c,d):f},d.strength=function(c){return arguments.length?(a=+c,d):a},d.radius=function(c){return arguments.length?(e=typeof c=="function"?c:Ps(+c),u(),d):e},d}function z4(e){return e.index}function nS(e,n){var i=e.get(n);if(!i)throw new Error("node not found: "+n);return i}function P4(e){var n=z4,i=m,s,a=Ps(30),f,d,l,u,c,v=1;e==null&&(e=[]);function m(p){return 1/Math.min(l[p.source.index],l[p.target.index])}function _(p){for(var g=0,b=e.length;g<v;++g)for(var y=0,E,M,O,T,A,k,q;y<b;++y)E=e[y],M=E.source,O=E.target,T=O.x+O.vx-M.x-M.vx||ss(c),A=O.y+O.vy-M.y-M.vy||ss(c),k=Math.sqrt(T*T+A*A),k=(k-f[y])/k*p*s[y],T*=k,A*=k,O.vx-=T*(q=u[y]),O.vy-=A*q,M.vx+=T*(q=1-q),M.vy+=A*q}function x(){if(d){var p,g=d.length,b=e.length,y=new Map(d.map((M,O)=>[n(M,O,d),M])),E;for(p=0,l=new Array(g);p<b;++p)E=e[p],E.index=p,typeof E.source!="object"&&(E.source=nS(y,E.source)),typeof E.target!="object"&&(E.target=nS(y,E.target)),l[E.source.index]=(l[E.source.index]||0)+1,l[E.target.index]=(l[E.target.index]||0)+1;for(p=0,u=new Array(b);p<b;++p)E=e[p],u[p]=l[E.source.index]/(l[E.source.index]+l[E.target.index]);s=new Array(b),C(),f=new Array(b),S()}}function C(){if(d)for(var p=0,g=e.length;p<g;++p)s[p]=+i(e[p],p,e)}function S(){if(d)for(var p=0,g=e.length;p<g;++p)f[p]=+a(e[p],p,e)}return _.initialize=function(p,g){d=p,c=g,x()},_.links=function(p){return arguments.length?(e=p,x(),_):e},_.id=function(p){return arguments.length?(n=p,_):n},_.iterations=function(p){return arguments.length?(v=+p,_):v},_.strength=function(p){return arguments.length?(i=typeof p=="function"?p:Ps(+p),C(),_):i},_.distance=function(p){return arguments.length?(a=typeof p=="function"?p:Ps(+p),S(),_):a},_}const I4=1664525,U4=1013904223,rS=4294967296;function F4(){let e=1;return()=>(e=(I4*e+U4)%rS)/rS}function $4(e){return e.x}function V4(e){return e.y}var q4=10,W4=Math.PI*(3-Math.sqrt(5));function Y4(e){var n,i=1,s=.001,a=1-Math.pow(s,1/300),f=0,d=.6,l=new Map,u=Np(m),c=Fl("tick","end"),v=F4();e==null&&(e=[]);function m(){_(),c.call("tick",n),i<s&&(u.stop(),c.call("end",n))}function _(S){var p,g=e.length,b;S===void 0&&(S=1);for(var y=0;y<S;++y)for(i+=(f-i)*a,l.forEach(function(E){E(i)}),p=0;p<g;++p)b=e[p],b.fx==null?b.x+=b.vx*=d:(b.x=b.fx,b.vx=0),b.fy==null?b.y+=b.vy*=d:(b.y=b.fy,b.vy=0);return n}function x(){for(var S=0,p=e.length,g;S<p;++S){if(g=e[S],g.index=S,g.fx!=null&&(g.x=g.fx),g.fy!=null&&(g.y=g.fy),isNaN(g.x)||isNaN(g.y)){var b=q4*Math.sqrt(.5+S),y=S*W4;g.x=b*Math.cos(y),g.y=b*Math.sin(y)}(isNaN(g.vx)||isNaN(g.vy))&&(g.vx=g.vy=0)}}function C(S){return S.initialize&&S.initialize(e,v),S}return x(),n={tick:_,restart:function(){return u.restart(m),n},stop:function(){return u.stop(),n},nodes:function(S){return arguments.length?(e=S,x(),l.forEach(C),n):e},alpha:function(S){return arguments.length?(i=+S,n):i},alphaMin:function(S){return arguments.length?(s=+S,n):s},alphaDecay:function(S){return arguments.length?(a=+S,n):+a},alphaTarget:function(S){return arguments.length?(f=+S,n):f},velocityDecay:function(S){return arguments.length?(d=1-S,n):1-d},randomSource:function(S){return arguments.length?(v=S,l.forEach(C),n):v},force:function(S,p){return arguments.length>1?(p==null?l.delete(S):l.set(S,C(p)),n):l.get(S)},find:function(S,p,g){var b=0,y=e.length,E,M,O,T,A;for(g==null?g=1/0:g*=g,b=0;b<y;++b)T=e[b],E=S-T.x,M=p-T.y,O=E*E+M*M,O<g&&(A=T,g=O);return A},on:function(S,p){return arguments.length>1?(c.on(S,p),n):c.on(S)}}}function K4(){var e,n,i,s,a=Ps(-30),f,d=1,l=1/0,u=.81;function c(x){var C,S=e.length,p=Gp(e,$4,V4).visitAfter(m);for(s=x,C=0;C<S;++C)n=e[C],p.visit(_)}function v(){if(e){var x,C=e.length,S;for(f=new Array(C),x=0;x<C;++x)S=e[x],f[S.index]=+a(S,x,e)}}function m(x){var C=0,S,p,g=0,b,y,E;if(x.length){for(b=y=E=0;E<4;++E)(S=x[E])&&(p=Math.abs(S.value))&&(C+=S.value,g+=p,b+=p*S.x,y+=p*S.y);x.x=b/g,x.y=y/g}else{S=x,S.x=S.data.x,S.y=S.data.y;do C+=f[S.data.index];while(S=S.next)}x.value=C}function _(x,C,S,p){if(!x.value)return!0;var g=x.x-n.x,b=x.y-n.y,y=p-C,E=g*g+b*b;if(y*y/u<E)return E<l&&(g===0&&(g=ss(i),E+=g*g),b===0&&(b=ss(i),E+=b*b),E<d&&(E=Math.sqrt(d*E)),n.vx+=g*x.value*s/E,n.vy+=b*x.value*s/E),!0;if(x.length||E>=l)return;(x.data!==n||x.next)&&(g===0&&(g=ss(i),E+=g*g),b===0&&(b=ss(i),E+=b*b),E<d&&(E=Math.sqrt(d*E)));do x.data!==n&&(y=f[x.data.index]*s/E,n.vx+=g*y,n.vy+=b*y);while(x=x.next)}return c.initialize=function(x,C){e=x,i=C,v()},c.strength=function(x){return arguments.length?(a=typeof x=="function"?x:Ps(+x),v(),c):a},c.distanceMin=function(x){return arguments.length?(d=x*x,c):Math.sqrt(d)},c.distanceMax=function(x){return arguments.length?(l=x*x,c):Math.sqrt(l)},c.theta=function(x){return arguments.length?(u=x*x,c):Math.sqrt(u)},c}function G4(e){const n=new Map;for(const i of e){const s=i.baseBranch??"__root__";n.has(s)||n.set(s,{id:`cluster-${s}`,baseBranch:s,branches:[],isExpanded:!1}),n.get(s)?.branches.push(i)}return Array.from(n.values()).sort((i,s)=>i.baseBranch==="__root__"?-1:s.baseBranch==="__root__"?1:s.branches.length-i.branches.length)}function X4(e,n,i,s){return new Promise(a=>{const f=Y4(e).force("link",P4(n).id(d=>d.id).distance(120).strength(.8)).force("charge",K4().strength(-400)).force("center",_4(i/2,s/2)).force("collide",H4().radius(60).strength(.7));for(let d=0;d<100;d++)f.tick();f.stop(),a(e)})}async function Q4(e,n,i,s){const a=G4(e);new Map(e.map(m=>[m.name,m]));const f=[],d=[],l=new Map;for(const m of a){const _=n.has(m.id);if(m.branches.length===1||_)for(const x of m.branches)l.set(x.name,x.name);else for(const x of m.branches)l.set(x.name,m.id)}for(const m of a){const _=n.has(m.id);if(m.branches.length===1||_){for(const x of m.branches)if(f.push({id:x.name,branch:x,isCluster:!1}),x.baseBranch){const C=l.get(x.baseBranch);C&&C!==x.name&&d.push({source:C,target:x.name})}}else if(f.push({id:m.id,isCluster:!0,clusterSize:m.branches.length}),m.baseBranch!=="__root__"){const x=l.get(m.baseBranch);x&&x!==m.id&&d.push({source:x,target:m.id})}}const c=(await X4(f,d,i,s)).map(m=>({id:m.id,type:m.isCluster?"cluster":"branch",position:{x:m.x??0,y:m.y??0},data:{branch:m.branch,isCluster:m.isCluster,clusterSize:m.clusterSize??0,expanded:n.has(m.id)}})),v=d.map((m,_)=>{const x=typeof m.source=="string"?m.source:m.source.id,C=typeof m.target=="string"?m.target:m.target.id;return{id:`edge-${_}`,source:x,target:C,type:"synaptic",animated:!0,data:{strength:1}}});return{nodes:c,edges:v}}function Z4(e){return e.worktreePath?"hsl(var(--success))":e.type==="local"?"hsl(var(--local))":"hsl(var(--remote))"}function J4(e){if(!e.divergence)return 40;const i=e.divergence.ahead+e.divergence.behind;return Math.min(40+i*2,80)}const eB=L.memo(function({data:n,selected:i}){const{branch:s}=n;if(!s)return null;const a=J4(s);Z4(s);const f=!!s.worktreePath,d=s.mergeStatus==="merged",l=L.useMemo(()=>s.name.length>18?`${s.name.slice(0,15)}...`:s.name,[s.name]),u=L.useMemo(()=>f?{primary:"hsl(160 90% 45%)",glow:"hsl(160 90% 45% / 0.4)",inner:"hsl(160 90% 50% / 0.2)"}:s.type==="local"?{primary:"hsl(280 85% 65%)",glow:"hsl(280 85% 65% / 0.4)",inner:"hsl(280 85% 70% / 0.2)"}:{primary:"hsl(200 90% 55%)",glow:"hsl(200 90% 55% / 0.4)",inner:"hsl(200 90% 60% / 0.2)"},[f,s.type]);return D.jsxs(D.Fragment,{children:[D.jsx(as,{type:"target",position:Ne.Top,className:"!h-3 !w-3 !rounded-full !border-2 !bg-transparent transition-all duration-300",style:{borderColor:u.primary,boxShadow:`0 0 8px ${u.glow}`}}),D.jsxs("div",{className:Pe("group relative flex cursor-pointer items-center justify-center rounded-full","transition-all duration-500 ease-out",f&&"animate-active-synapse",!f&&"animate-soma-pulse",i&&"ring-2 ring-offset-4 ring-offset-background",d&&"opacity-50"),style:{width:a,height:a,background:`radial-gradient(circle at 30% 30%, ${u.inner}, transparent 60%)`,border:`2px solid ${u.primary}`,boxShadow:i?`0 0 30px ${u.glow}, inset 0 0 20px ${u.inner}, 0 0 0 4px ${u.primary}`:void 0},children:[D.jsx("div",{className:"absolute -inset-2 rounded-full opacity-30 blur-md",style:{backgroundColor:u.primary}}),D.jsx("div",{className:"absolute inset-2 rounded-full border opacity-40",style:{borderColor:u.primary}}),D.jsx("div",{className:"relative z-10 flex items-center justify-center rounded-full shadow-lg",style:{width:a*.45,height:a*.45,background:`linear-gradient(135deg, ${u.primary}, ${u.inner})`,boxShadow:`0 0 15px ${u.glow}`},children:D.jsx("span",{className:"text-xs font-bold text-background",children:s.type==="local"?"L":"R"})}),!d&&D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"absolute h-1.5 w-1.5 rounded-full animate-vesicle-release",style:{backgroundColor:u.primary,top:"20%",right:"25%",animationDelay:"0s"}}),D.jsx("div",{className:"absolute h-1 w-1 rounded-full animate-vesicle-release",style:{backgroundColor:u.primary,bottom:"25%",left:"20%",animationDelay:"0.7s"}})]}),f&&D.jsx("div",{className:"absolute -right-1 -top-1 flex h-4 w-4 items-center justify-center rounded-full animate-synapse-spark",style:{backgroundColor:"hsl(160 90% 45%)",boxShadow:"0 0 10px hsl(160 90% 45% / 0.8)"},children:D.jsx("span",{className:"text-[8px] font-bold text-background",children:"W"})}),d&&D.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-full bg-background/60 backdrop-blur-sm",children:D.jsx("span",{className:"text-[10px] font-medium text-muted-foreground",children:"merged"})}),D.jsxs("div",{className:Pe("absolute -bottom-12 left-1/2 z-50 -translate-x-1/2","rounded-lg border border-border/50 bg-card/95 px-3 py-1.5 backdrop-blur-md","opacity-0 shadow-xl transition-all duration-300","group-hover:opacity-100 group-hover:-translate-y-1"),style:{boxShadow:`0 4px 20px hsl(220 30% 0% / 0.5), 0 0 20px ${u.glow}`},children:[D.jsx("p",{className:"whitespace-nowrap text-xs font-medium text-foreground",children:l}),D.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[s.type==="local"?"Local":"Remote",f&&" • Active"]})]})]}),D.jsx(as,{type:"source",position:Ne.Bottom,className:"!h-3 !w-3 !rounded-full !border-2 !bg-transparent transition-all duration-300",style:{borderColor:u.primary,boxShadow:`0 0 8px ${u.glow}`}})]})}),tB=L.memo(function({data:n,selected:i}){const{clusterSize:s=0,expanded:a}=n,d=Math.min(70+s*5,120),l=Math.min(s,8),u=L.useMemo(()=>Array.from({length:l}).map((c,v)=>{const m=360/l*v,_=v*.5,x=d*.28;return{angle:m,delay:_,orbitRadius:x}}),[l,d]);return D.jsxs(D.Fragment,{children:[D.jsx(as,{type:"target",position:Ne.Top,className:"!h-3 !w-3 !rounded-full !border-2 !bg-transparent transition-all duration-300",style:{borderColor:"hsl(185 100% 65%)",boxShadow:"0 0 8px hsl(185 100% 65% / 0.4)"}}),D.jsxs("div",{className:Pe("group relative flex cursor-pointer items-center justify-center","transition-all duration-500 ease-out","animate-membrane-morph",i&&"ring-2 ring-primary ring-offset-4 ring-offset-background"),style:{width:d,height:d,background:a?"radial-gradient(circle at 40% 40%, hsl(185 100% 65% / 0.15), hsl(310 85% 60% / 0.08) 50%, transparent 70%)":"radial-gradient(circle at 40% 40%, hsl(220 30% 15% / 0.8), hsl(220 25% 10% / 0.6) 60%, transparent 80%)",border:a?"2px solid hsl(185 100% 65% / 0.6)":"2px dashed hsl(200 30% 30%)",boxShadow:a?"0 0 30px hsl(185 100% 65% / 0.3), inset 0 0 30px hsl(185 100% 65% / 0.1)":"0 0 20px hsl(220 30% 0% / 0.5), inset 0 0 20px hsl(220 30% 5% / 0.5)"},children:[D.jsx("div",{className:Pe("absolute -inset-3 rounded-full blur-lg transition-opacity duration-500",a?"opacity-40":"opacity-20"),style:{backgroundColor:a?"hsl(185 100% 65%)":"hsl(200 30% 40%)",borderRadius:"inherit"}}),D.jsx("div",{className:"absolute inset-3 rounded-full border border-dashed opacity-30",style:{borderColor:a?"hsl(185 100% 65%)":"hsl(200 30% 40%)",borderRadius:"inherit"}}),D.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:u.map((c,v)=>D.jsx("div",{className:"absolute animate-nucleus-orbit",style:{animationDelay:`${-c.delay}s`,animationDuration:`${8+v*.5}s`},children:D.jsx("div",{className:"h-2.5 w-2.5 rounded-full animate-vesicle-release",style:{backgroundColor:a?`hsl(${185+v*15} 80% 60%)`:`hsl(${200+v*10} 50% 50%)`,boxShadow:a?`0 0 8px hsl(${185+v*15} 80% 60% / 0.8)`:`0 0 4px hsl(${200+v*10} 50% 50% / 0.5)`,animationDelay:`${c.delay*.3}s`,transform:`translateX(${c.orbitRadius}px)`}})},v))}),D.jsx("div",{className:Pe("relative z-10 flex items-center justify-center rounded-full","border-2 backdrop-blur-sm transition-all duration-300"),style:{width:d*.4,height:d*.4,backgroundColor:a?"hsl(220 30% 8% / 0.9)":"hsl(220 30% 10% / 0.95)",borderColor:a?"hsl(185 100% 65% / 0.8)":"hsl(200 30% 35%)",boxShadow:a?"0 0 20px hsl(185 100% 65% / 0.4), inset 0 0 15px hsl(185 100% 65% / 0.1)":"0 0 10px hsl(220 30% 0% / 0.5)"},children:D.jsx("span",{className:Pe("text-sm font-bold transition-colors duration-300",a?"text-primary":"text-muted-foreground"),children:s})}),D.jsx("div",{className:Pe("absolute -right-2 -top-2 flex h-6 w-6 items-center justify-center rounded-full","border-2 text-xs font-bold transition-all duration-300"),style:{backgroundColor:a?"hsl(185 100% 65%)":"hsl(220 30% 12%)",borderColor:a?"hsl(185 100% 70%)":"hsl(200 30% 25%)",color:a?"hsl(220 30% 5%)":"hsl(185 100% 65%)",boxShadow:a?"0 0 15px hsl(185 100% 65% / 0.6)":"0 0 8px hsl(220 30% 0% / 0.5)"},children:a?"−":"+"}),D.jsxs("div",{className:Pe("absolute -bottom-14 left-1/2 z-50 -translate-x-1/2","rounded-lg border border-border/50 bg-card/95 px-3 py-2 backdrop-blur-md","opacity-0 shadow-xl transition-all duration-300","group-hover:opacity-100 group-hover:-translate-y-1"),style:{boxShadow:"0 4px 20px hsl(220 30% 0% / 0.5), 0 0 20px hsl(185 100% 65% / 0.2)"},children:[D.jsxs("p",{className:"whitespace-nowrap text-xs font-medium text-foreground",children:[s," branches"]}),D.jsxs("p",{className:"text-[10px] text-muted-foreground",children:["Click to ",a?"collapse":"expand"]})]})]}),D.jsx(as,{type:"source",position:Ne.Bottom,className:"!h-3 !w-3 !rounded-full !border-2 !bg-transparent transition-all duration-300",style:{borderColor:a?"hsl(185 100% 65%)":"hsl(200 30% 40%)",boxShadow:a?"0 0 8px hsl(185 100% 65% / 0.4)":"0 0 6px hsl(200 30% 40% / 0.3)"}})]})}),nB=L.memo(function({id:n,sourceX:i,sourceY:s,targetX:a,targetY:f,sourcePosition:d,targetPosition:l,style:u={},markerEnd:c}){const[v,m,_]=Up({sourceX:i,sourceY:s,sourcePosition:d,targetX:a,targetY:f,targetPosition:l,curvature:.25}),x=L.useMemo(()=>{const S=a-i,p=f-s;return Math.sqrt(S*S+p*p)},[i,s,a,f]),C=Math.max(2,Math.min(4,Math.floor(x/100)));return D.jsxs(D.Fragment,{children:[D.jsx(is,{id:`${n}-outer-glow`,path:v,style:{...u,strokeWidth:12,stroke:"hsl(185 100% 65% / 0.08)",filter:"blur(8px)"}}),D.jsx(is,{id:`${n}-mid-glow`,path:v,style:{...u,strokeWidth:6,stroke:"hsl(185 100% 65% / 0.15)",filter:"blur(4px)"}}),D.jsx(is,{id:n,path:v,...c?{markerEnd:c}:{},style:{...u,strokeWidth:2,stroke:"hsl(185 100% 65% / 0.5)",strokeLinecap:"round"}}),D.jsx(is,{id:`${n}-core`,path:v,style:{...u,strokeWidth:1,stroke:"hsl(185 100% 75% / 0.6)",strokeLinecap:"round"}}),D.jsx(mm,{children:D.jsxs("svg",{style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},children:[D.jsxs("defs",{children:[D.jsxs("linearGradient",{id:`vesicle-pulse-${n}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[D.jsx("stop",{offset:"0%",stopColor:"transparent",children:D.jsx("animate",{attributeName:"offset",values:"-0.3;1",dur:"2.5s",repeatCount:"indefinite"})}),D.jsx("stop",{offset:"5%",stopColor:"hsl(185 100% 70% / 0.3)",children:D.jsx("animate",{attributeName:"offset",values:"-0.25;1.05",dur:"2.5s",repeatCount:"indefinite"})}),D.jsx("stop",{offset:"10%",stopColor:"hsl(185 100% 80%)",children:D.jsx("animate",{attributeName:"offset",values:"-0.2;1.1",dur:"2.5s",repeatCount:"indefinite"})}),D.jsx("stop",{offset:"15%",stopColor:"hsl(185 100% 70% / 0.3)",children:D.jsx("animate",{attributeName:"offset",values:"-0.15;1.15",dur:"2.5s",repeatCount:"indefinite"})}),D.jsx("stop",{offset:"20%",stopColor:"transparent",children:D.jsx("animate",{attributeName:"offset",values:"-0.1;1.2",dur:"2.5s",repeatCount:"indefinite"})})]}),D.jsxs("linearGradient",{id:`synapse-pulse-${n}`,x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[D.jsx("stop",{offset:"0%",stopColor:"transparent",children:D.jsx("animate",{attributeName:"offset",values:"-0.4;1",dur:"3s",begin:"0.8s",repeatCount:"indefinite"})}),D.jsx("stop",{offset:"8%",stopColor:"hsl(310 85% 65% / 0.6)",children:D.jsx("animate",{attributeName:"offset",values:"-0.32;1.08",dur:"3s",begin:"0.8s",repeatCount:"indefinite"})}),D.jsx("stop",{offset:"16%",stopColor:"transparent",children:D.jsx("animate",{attributeName:"offset",values:"-0.24;1.16",dur:"3s",begin:"0.8s",repeatCount:"indefinite"})})]}),D.jsxs("filter",{id:`glow-${n}`,x:"-50%",y:"-50%",width:"200%",height:"200%",children:[D.jsx("feGaussianBlur",{stdDeviation:"2",result:"coloredBlur"}),D.jsxs("feMerge",{children:[D.jsx("feMergeNode",{in:"coloredBlur"}),D.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),D.jsx("path",{d:v,fill:"none",stroke:`url(#vesicle-pulse-${n})`,strokeWidth:4,strokeLinecap:"round",filter:`url(#glow-${n})`,style:{mixBlendMode:"screen"}}),D.jsx("path",{d:v,fill:"none",stroke:`url(#synapse-pulse-${n})`,strokeWidth:3,strokeLinecap:"round",style:{mixBlendMode:"screen"}})]})}),D.jsx(mm,{children:D.jsx("svg",{style:{position:"absolute",left:0,top:0,width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},children:Array.from({length:C}).map((S,p)=>D.jsxs("circle",{r:3-p*.3,fill:"hsl(185 100% 80%)",opacity:0,children:[D.jsx("animateMotion",{dur:`${2+p*.3}s`,repeatCount:"indefinite",path:v,begin:`${p*.6}s`}),D.jsx("animate",{attributeName:"opacity",values:"0;1;1;0",keyTimes:"0;0.1;0.9;1",dur:`${2+p*.3}s`,repeatCount:"indefinite",begin:`${p*.6}s`})]},p))})}),D.jsx(mm,{children:D.jsxs("div",{className:"absolute",style:{transform:`translate(-50%, -50%) translate(${m}px, ${_}px)`},children:[D.jsx("div",{className:"absolute -inset-3 rounded-full opacity-30",style:{background:"radial-gradient(circle, hsl(185 100% 65%) 0%, transparent 70%)",animation:"synapse-spark 3s ease-in-out infinite"}}),D.jsx("div",{className:"h-2 w-2 rounded-full",style:{background:"radial-gradient(circle at 30% 30%, hsl(185 100% 80%), hsl(185 100% 60%))",boxShadow:"0 0 10px hsl(185 100% 65% / 0.8), 0 0 20px hsl(185 100% 65% / 0.4)",animation:"vesicle-release 2s ease-in-out infinite"}})]})})]})}),rB={branch:eB,cluster:tB},iB={synaptic:nB};function sB({branches:e,onNodeClick:n,className:i}){const[s,a,f]=F5([]),[d,l,u]=$5([]),[c,v]=L.useState(new Set),[m,_]=L.useState(!1);L.useEffect(()=>{if(e.length===0)return;_(!0),Q4(e,c,800,600).then(({nodes:g,edges:b})=>{a(g),l(b)}).catch(g=>{console.error("Failed to calculate graph layout:",g)}).finally(()=>{_(!1)})},[e,c,a,l]);const x=L.useCallback((S,p)=>{p.data.isCluster?v(g=>{const b=new Set(g);return b.has(p.id)?b.delete(p.id):b.add(p.id),b}):n?.(p.data.branch??null)},[n]),C=L.useCallback(S=>S.data.isCluster?"hsl(var(--muted-foreground))":S.data.branch?.worktreePath?"hsl(var(--success))":S.data.branch?.type==="local"?"hsl(var(--local))":"hsl(var(--remote))",[]);return D.jsxs("div",{className:i,style:{width:"100%",height:"100%"},children:[D.jsxs(I5,{nodes:s,edges:d,onNodesChange:f,onEdgesChange:u,onNodeClick:x,nodeTypes:rB,edgeTypes:iB,fitView:!0,fitViewOptions:{padding:.2,maxZoom:1.5},minZoom:.1,maxZoom:2,attributionPosition:"bottom-left",proOptions:{hideAttribution:!0},className:"bg-gradient-to-br from-background via-background to-muted/20",children:[D.jsx(K5,{variant:_i.Dots,gap:20,size:1,color:"hsl(var(--muted-foreground) / 0.15)"}),D.jsx(t4,{showInteractive:!1,className:"!bg-card !border !border-border !shadow-md"}),D.jsx(m4,{nodeColor:C,maskColor:"hsl(var(--background) / 0.8)",className:"!bg-card !border !border-border !shadow-md"})]}),m&&D.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50 backdrop-blur-sm",children:D.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-card px-4 py-2 shadow-lg",children:[D.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent"}),D.jsx("span",{className:"text-sm text-muted-foreground",children:"Calculating layout..."})]})})]})}const oB=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),aB=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,i,s)=>s?s.toUpperCase():i.toLowerCase()),iS=e=>{const n=aB(e);return n.charAt(0).toUpperCase()+n.slice(1)},C1=(...e)=>e.filter((n,i,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===i).join(" ").trim(),lB=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};var cB={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const uB=L.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:i=2,absoluteStrokeWidth:s,className:a="",children:f,iconNode:d,...l},u)=>L.createElement("svg",{ref:u,...cB,width:n,height:n,stroke:e,strokeWidth:s?Number(i)*24/Number(n):i,className:C1("lucide",a),...!f&&!lB(l)&&{"aria-hidden":"true"},...l},[...d.map(([c,v])=>L.createElement(c,v)),...Array.isArray(f)?f:[f]]));const Gl=(e,n)=>{const i=L.forwardRef(({className:s,...a},f)=>L.createElement(uB,{ref:f,iconNode:n,className:C1(`lucide-${oB(iS(e))}`,`lucide-${e}`,s),...a}));return i.displayName=iS(e),i};const hB=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fB=Gl("check",hB);const dB=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],E1=Gl("chevron-down",dB);const mB=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],pB=Gl("chevron-up",mB);const gB=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],vB=Gl("search",gB);const _B=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],yB=Gl("x",_B);function sS(e,n){if(typeof e=="function")return e(n);e!=null&&(e.current=n)}function Xl(...e){return n=>{let i=!1;const s=e.map(a=>{const f=sS(a,n);return!i&&typeof f=="function"&&(i=!0),f});if(i)return()=>{for(let a=0;a<s.length;a++){const f=s[a];typeof f=="function"?f():sS(e[a],null)}}}}function on(...e){return L.useCallback(Xl(...e),e)}var bB=Symbol.for("react.lazy"),sh=dh[" use ".trim().toString()];function SB(e){return typeof e=="object"&&e!==null&&"then"in e}function R1(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===bB&&"_payload"in e&&SB(e._payload)}function xB(e){const n=CB(e),i=L.forwardRef((s,a)=>{let{children:f,...d}=s;R1(f)&&typeof sh=="function"&&(f=sh(f._payload));const l=L.Children.toArray(f),u=l.find(RB);if(u){const c=u.props.children,v=l.map(m=>m===u?L.Children.count(c)>1?L.Children.only(null):L.isValidElement(c)?c.props.children:null:m);return D.jsx(n,{...d,ref:a,children:L.isValidElement(c)?L.cloneElement(c,void 0,v):null})}return D.jsx(n,{...d,ref:a,children:f})});return i.displayName=`${e}.Slot`,i}var wB=xB("Slot");function CB(e){const n=L.forwardRef((i,s)=>{let{children:a,...f}=i;if(R1(a)&&typeof sh=="function"&&(a=sh(a._payload)),L.isValidElement(a)){const d=TB(a),l=AB(f,a.props);return a.type!==L.Fragment&&(l.ref=s?Xl(s,d):d),L.cloneElement(a,l)}return L.Children.count(a)>1?L.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var EB=Symbol("radix.slottable");function RB(e){return L.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===EB}function AB(e,n){const i={...n};for(const s in n){const a=e[s],f=n[s];/^on[A-Z]/.test(s)?a&&f?i[s]=(...l)=>{const u=f(...l);return a(...l),u}:a&&(i[s]=a):s==="style"?i[s]={...a,...f}:s==="className"&&(i[s]=[a,f].filter(Boolean).join(" "))}return{...e,...i}}function TB(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}const MB=Tp("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),It=L.forwardRef(({className:e,variant:n,size:i,asChild:s=!1,...a},f)=>{const d=s?wB:"button";return D.jsx(d,{className:Pe(MB({variant:n,size:i,className:e})),ref:f,...a})});It.displayName="Button";function DB({branch:e,onClose:n,className:i}){if(!e)return null;const s=!!e.worktreePath;return D.jsx("div",{className:Pe("absolute right-0 top-0 h-full w-80 border-l bg-card/95 backdrop-blur-sm","animate-in slide-in-from-right duration-300",i),children:D.jsxs(Yt,{className:"h-full rounded-none border-0",children:[D.jsxs(Mn,{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:[D.jsxs("div",{className:"flex items-center gap-2",children:[D.jsx(vt,{variant:e.type==="local"?"local":"remote",children:e.type==="local"?"Local":"Remote"}),s&&D.jsx(vt,{variant:"success",children:"Worktree"})]}),D.jsx(It,{variant:"ghost",size:"icon",onClick:n,className:"h-8 w-8",children:D.jsx(yB,{className:"h-4 w-4"})})]}),D.jsxs(Jt,{className:"space-y-4",children:[D.jsxs("div",{children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Branch Name"}),D.jsx("p",{className:"mt-1 break-all font-mono text-sm",children:e.name})]}),D.jsxs("div",{children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Base Branch"}),D.jsx("p",{className:"mt-1 font-mono text-sm",children:e.baseBranch??"Unknown"})]}),D.jsxs("div",{children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Last Commit"}),D.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:e.commitMessage??"No commit message"})]}),e.divergence&&D.jsxs("div",{children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Divergence"}),D.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[D.jsxs(vt,{variant:"outline",className:"text-xs",children:["↑ ",e.divergence.ahead," ahead"]}),D.jsxs(vt,{variant:"outline",className:"text-xs",children:["↓ ",e.divergence.behind," behind"]}),D.jsx(vt,{variant:e.divergence.upToDate?"success":"warning",className:"text-xs",children:e.divergence.upToDate?"Up to date":"Needs sync"})]})]}),s&&D.jsxs("div",{children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Worktree Path"}),D.jsx("p",{className:"mt-1 break-all font-mono text-xs text-muted-foreground",children:e.worktreePath})]}),e.mergeStatus&&D.jsxs("div",{children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Merge Status"}),D.jsx(vt,{variant:e.mergeStatus==="merged"?"success":"outline",className:"mt-1",children:e.mergeStatus})]})]}),D.jsx(Ap,{className:"flex flex-col gap-2",children:D.jsx(It,{asChild:!0,className:"w-full",children:D.jsx(pr,{to:`/${encodeURIComponent(e.name)}`,children:"View Details"})})})]})})}function OB({branches:e}){const[n,i]=L.useState(null),s=L.useCallback(f=>{i(f)},[]),a=L.useCallback(()=>{i(null)},[]);return e.length?D.jsxs(Yt,{className:"relative overflow-hidden",children:[D.jsx(Mn,{className:"pb-4",children:D.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[D.jsxs("div",{children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"SYNAPTIC GRAPH"}),D.jsx("h2",{className:"mt-1 text-lg font-semibold",children:"ブランチネットワーク"}),D.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"クリックでノードを展開・詳細表示。ドラッグで移動、スクロールでズーム。"})]}),D.jsxs("div",{className:"flex flex-wrap gap-2",children:[D.jsxs(vt,{variant:"outline",className:"flex items-center gap-1",children:[D.jsx("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/30"}),"Cluster"]}),D.jsxs(vt,{variant:"local",className:"flex items-center gap-1",children:[D.jsx("span",{className:"h-2 w-2 rounded-full bg-local"}),"Local"]}),D.jsxs(vt,{variant:"remote",className:"flex items-center gap-1",children:[D.jsx("span",{className:"h-2 w-2 rounded-full bg-remote"}),"Remote"]}),D.jsxs(vt,{variant:"success",className:"flex items-center gap-1",children:[D.jsx("span",{className:"h-2 w-2 rounded-full bg-success"}),"Worktree"]})]})]})}),D.jsx(Jt,{className:"relative p-0",children:D.jsxs("div",{className:"relative h-[500px] w-full",children:[D.jsx(sB,{branches:e,onNodeClick:s,className:"h-full w-full"}),D.jsx(DB,{branch:n,onClose:a})]})})]}):D.jsx(Yt,{className:"border-dashed",children:D.jsxs(Jt,{className:"flex flex-col items-center justify-center py-12 text-center",children:[D.jsx("p",{className:"text-muted-foreground",children:"グラフ表示できるブランチがありません。"}),D.jsx("p",{className:"text-sm text-muted-foreground",children:"fetch済みのブランチやWorktreeを追加すると関係図が表示されます。"})]})})}function _r({eyebrow:e,title:n,subtitle:i,actions:s,children:a,className:f}){return D.jsx("header",{className:Pe("border-b border-border bg-card/50 px-6 py-8",f),children:D.jsxs("div",{className:"mx-auto max-w-7xl",children:[e&&D.jsx("p",{className:"mb-2 text-xs font-medium uppercase tracking-widest text-muted-foreground",children:e}),D.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[D.jsxs("div",{children:[D.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:n}),i&&D.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:i}),a]}),s&&D.jsx("div",{className:"flex gap-2",children:s})]})]})})}function Cu({label:e,value:n,hint:i,className:s}){return D.jsxs(Yt,{className:Pe("p-5",s),children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:e}),D.jsx("p",{className:"mt-1 text-3xl font-semibold tabular-nums",children:n}),i&&D.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i})]})}const Ll=L.forwardRef(({className:e,type:n,...i},s)=>D.jsx("input",{type:n,className:Pe("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:s,...i}));Ll.displayName="Input";function LB({value:e,onChange:n,placeholder:i="Search...",className:s,count:a}){return D.jsxs("div",{className:Pe("flex items-center gap-3",s),children:[D.jsxs("div",{className:"relative flex-1",children:[D.jsx(vB,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),D.jsx(Ll,{type:"text",value:e,onChange:f=>n(f.target.value),placeholder:i,className:"pl-9"})]}),a&&D.jsxs("span",{className:"text-sm text-muted-foreground",children:[a.filtered," / ",a.total]})]})}const kB=Tp("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",success:"border-green-500/50 bg-green-500/10 text-green-400 [&>svg]:text-green-400",warning:"border-yellow-500/50 bg-yellow-500/10 text-yellow-400 [&>svg]:text-yellow-400",info:"border-blue-500/50 bg-blue-500/10 text-blue-400 [&>svg]:text-blue-400"}},defaultVariants:{variant:"default"}}),yi=L.forwardRef(({className:e,variant:n,...i},s)=>D.jsx("div",{ref:s,role:"alert",className:Pe(kB({variant:n}),e),...i}));yi.displayName="Alert";const NB=L.forwardRef(({className:e,...n},i)=>D.jsx("h5",{ref:i,className:Pe("mb-1 font-medium leading-none tracking-tight",e),...n}));NB.displayName="AlertTitle";const bi=L.forwardRef(({className:e,...n},i)=>D.jsx("div",{ref:i,className:Pe("text-sm [&_p]:leading-relaxed",e),...n}));bi.displayName="AlertDescription";const Eu=new Intl.NumberFormat("ja-JP");function BB(){const{data:e,isLoading:n,error:i}=gM(),[s,a]=L.useState(""),f=e??[],d=L.useMemo(()=>{const c=f.filter(_=>!!_.worktreePath).length,v=f.filter(_=>_.type==="remote").length,m=f.filter(_=>_.divergence?.upToDate).length;return{total:f.length,worktrees:c,remote:v,healthy:m}},[f]),l=s.trim().toLowerCase(),u=L.useMemo(()=>l?f.filter(c=>[c.name,c.type,c.mergeStatus,c.commitMessage??"",c.worktreePath??""].join(" ").toLowerCase().includes(l)):f,[f,l]);return n?D.jsxs("div",{className:"min-h-screen bg-background",children:[D.jsx(_r,{eyebrow:"WORKTREE DASHBOARD",title:"gwt Control Center",subtitle:"Loading branch data..."}),D.jsx("main",{className:"mx-auto max-w-7xl px-6 py-8",children:D.jsx("div",{className:"flex items-center justify-center py-20",children:D.jsxs("div",{className:"text-center",children:[D.jsx("div",{className:"mb-4 text-4xl",children:"⏳"}),D.jsx("p",{className:"text-muted-foreground",children:"Loading branches..."})]})})})]}):i?D.jsxs("div",{className:"min-h-screen bg-background",children:[D.jsx(_r,{eyebrow:"WORKTREE DASHBOARD",title:"gwt Control Center"}),D.jsx("main",{className:"mx-auto max-w-7xl px-6 py-8",children:D.jsx(yi,{variant:"destructive",children:D.jsx(bi,{children:i instanceof Error?i.message:"Failed to load branches"})})})]}):f.length?D.jsxs("div",{className:"min-h-screen bg-background",children:[D.jsx(_r,{eyebrow:"WORKTREE DASHBOARD",title:"gwt Control Center",subtitle:"Manage Git branches and AI tools from your browser"}),D.jsxs("main",{className:"mx-auto max-w-7xl space-y-6 px-6 py-8",children:[u.length>0&&D.jsx(OB,{branches:u}),D.jsxs("section",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[D.jsx(Cu,{label:"Total Branches",value:Eu.format(d.total),hint:"Local + Remote"}),D.jsx(Cu,{label:"Active Worktrees",value:Eu.format(d.worktrees),hint:"Ready for AI tools"}),D.jsx(Cu,{label:"Remote Tracking",value:Eu.format(d.remote),hint:"Synced with origin"}),D.jsx(Cu,{label:"Up to Date",value:Eu.format(d.healthy),hint:"No divergence"})]}),D.jsx(LB,{value:s,onChange:a,placeholder:"Search branches by name, type, or commit...",count:{filtered:u.length,total:d.total}}),u.length===0?D.jsx(Yt,{className:"border-dashed",children:D.jsxs(Jt,{className:"flex flex-col items-center justify-center py-12",children:[D.jsx("h3",{className:"mb-2 text-lg font-semibold",children:"No matching branches"}),D.jsx("p",{className:"text-sm text-muted-foreground",children:"Try a different search term or clear the filter."})]})}):D.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:u.map(c=>D.jsx(jB,{branch:c},c.name))})]})]}):D.jsxs("div",{className:"min-h-screen bg-background",children:[D.jsx(_r,{eyebrow:"WORKTREE DASHBOARD",title:"gwt Control Center"}),D.jsx("main",{className:"mx-auto max-w-7xl px-6 py-8",children:D.jsx(Yt,{className:"border-dashed",children:D.jsxs(Jt,{className:"flex flex-col items-center justify-center py-12",children:[D.jsx("div",{className:"mb-4 text-4xl",children:"📭"}),D.jsx("h3",{className:"mb-2 text-lg font-semibold",children:"No branches found"}),D.jsxs("p",{className:"text-sm text-muted-foreground",children:["Try running"," ",D.jsx("code",{className:"rounded bg-muted px-1",children:"git fetch origin"})," ","to sync branches."]})]})})})]})}function jB({branch:e}){return D.jsxs(Yt,{className:"flex flex-col transition-colors hover:border-muted-foreground/50",children:[D.jsx(Mn,{className:"pb-3",children:D.jsxs("div",{className:"flex items-start justify-between gap-2",children:[D.jsxs("div",{className:"min-w-0 flex-1",children:[D.jsxs("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[e.type==="local"?"Local":"Remote"," Branch"]}),D.jsx("h3",{className:"mt-1 truncate font-semibold",title:e.name,children:e.name})]}),D.jsxs("div",{className:"flex flex-wrap justify-end gap-1",children:[D.jsx(vt,{variant:e.type==="local"?"local":"remote",children:e.type==="local"?"L":"R"}),e.worktreePath&&D.jsx(vt,{variant:"success",children:"WT"})]})]})}),D.jsxs(Jt,{className:"flex-1 pb-3",children:[D.jsx("p",{className:"line-clamp-2 text-sm text-muted-foreground",children:e.commitMessage??"No commit message"}),e.divergence&&D.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[e.divergence.ahead>0&&D.jsxs(vt,{variant:"outline",className:"text-xs",children:["↑ ",e.divergence.ahead]}),e.divergence.behind>0&&D.jsxs(vt,{variant:"outline",className:"text-xs",children:["↓ ",e.divergence.behind]}),D.jsx(vt,{variant:e.divergence.upToDate?"success":"warning",className:"text-xs",children:e.divergence.upToDate?"Up to date":"Needs sync"})]})]}),D.jsx(Ap,{className:"pt-0",children:D.jsx(It,{variant:"ghost",size:"sm",asChild:!0,className:"w-full",children:D.jsx(pr,{to:`/${encodeURIComponent(e.name)}`,children:"View Details →"})})})]})}function HB(){const e=Xs();return Hl({mutationFn:n=>pM.create(n),onSuccess:()=>{e.invalidateQueries({queryKey:["worktrees"]}),e.invalidateQueries({queryKey:["branches"]})}})}function zB(){return mh({queryKey:["sessions"],queryFn:Ep.list})}function PB(){const e=Xs();return Hl({mutationFn:n=>Ep.start(n),onSuccess:n=>{e.setQueryData(["sessions"],i=>{const s=i?.filter(a=>a.sessionId!==n.sessionId)??[];return[n,...s]}),e.invalidateQueries({queryKey:["sessions"]})}})}function IB(){const e=Xs();return Hl({mutationFn:n=>Ep.delete(n),onSuccess:()=>{e.invalidateQueries({queryKey:["sessions"]})}})}function A1(){return mh({queryKey:["config"],queryFn:Cx.get})}function UB(){const e=Xs();return Hl({mutationFn:Cx.update,onSuccess:n=>{e.setQueryData(["config"],n)}})}const Qp=L.forwardRef(({className:e,...n},i)=>D.jsx("div",{className:"relative w-full overflow-auto",children:D.jsx("table",{ref:i,className:Pe("w-full caption-bottom text-sm",e),...n})}));Qp.displayName="Table";const Zp=L.forwardRef(({className:e,...n},i)=>D.jsx("thead",{ref:i,className:Pe("[&_tr]:border-b",e),...n}));Zp.displayName="TableHeader";const Jp=L.forwardRef(({className:e,...n},i)=>D.jsx("tbody",{ref:i,className:Pe("[&_tr:last-child]:border-0",e),...n}));Jp.displayName="TableBody";const FB=L.forwardRef(({className:e,...n},i)=>D.jsx("tfoot",{ref:i,className:Pe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...n}));FB.displayName="TableFooter";const kl=L.forwardRef(({className:e,...n},i)=>D.jsx("tr",{ref:i,className:Pe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...n}));kl.displayName="TableRow";const kr=L.forwardRef(({className:e,...n},i)=>D.jsx("th",{ref:i,className:Pe("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...n}));kr.displayName="TableHead";const Nr=L.forwardRef(({className:e,...n},i)=>D.jsx("td",{ref:i,className:Pe("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...n}));Nr.displayName="TableCell";const $B=L.forwardRef(({className:e,...n},i)=>D.jsx("caption",{ref:i,className:Pe("mt-4 text-sm text-muted-foreground",e),...n}));$B.displayName="TableCaption";const VB={pending:"outline",running:"success",completed:"default",failed:"destructive"},qB={pending:"Pending",running:"Running",completed:"Completed",failed:"Failed"};function oS(e){if(!e)return"--";try{return new Intl.DateTimeFormat("ja-JP",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(e))}catch{return e}}function WB(e,n){return e==="custom"?n??"Custom":e==="codex-cli"?"Codex CLI":"Claude Code"}function YB({sessions:e,isLoading:n,terminatingSessionId:i,isDeleting:s,onTerminate:a,onSelectSession:f}){return D.jsxs(Yt,{children:[D.jsxs(Mn,{className:"pb-3",children:[D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsxs("div",{children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Session History"}),D.jsx("h3",{className:"mt-1 text-lg font-semibold",children:"セッション履歴"})]}),n&&D.jsx(vt,{variant:"outline",className:"animate-pulse",children:"読み込み中..."})]}),D.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"この Worktree に紐づいた AI セッション履歴です。CLI からの起動分も共有されます。"})]}),D.jsx(Jt,{children:e.length===0?D.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"セッション履歴はまだありません。"}):D.jsx("div",{className:"overflow-x-auto rounded-md border",children:D.jsxs(Qp,{children:[D.jsx(Zp,{children:D.jsxs(kl,{children:[D.jsx(kr,{className:"w-24",children:"状態"}),D.jsx(kr,{children:"ツール"}),D.jsx(kr,{className:"w-20",children:"モード"}),D.jsx(kr,{children:"開始"}),D.jsx(kr,{children:"終了"}),D.jsx(kr,{className:"w-24 text-right",children:"操作"})]})}),D.jsx(Jp,{children:e.slice(0,5).map(d=>D.jsxs(kl,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>{d.status==="running"&&f(d.sessionId)},children:[D.jsx(Nr,{children:D.jsx(vt,{variant:VB[d.status],children:qB[d.status]})}),D.jsx(Nr,{className:"font-medium",children:WB(d.toolType,d.toolName)}),D.jsx(Nr,{children:D.jsx("span",{className:"text-muted-foreground",children:d.mode})}),D.jsx(Nr,{className:"text-muted-foreground",children:oS(d.startedAt)}),D.jsx(Nr,{className:"text-muted-foreground",children:oS(d.endedAt)}),D.jsx(Nr,{className:"text-right",children:d.status==="running"?D.jsx(It,{variant:"ghost",size:"sm",onClick:l=>{l.stopPropagation(),a(d.sessionId)},disabled:i===d.sessionId||s,children:i===d.sessionId?"終了中...":"終了"}):D.jsx("span",{className:"text-sm text-muted-foreground",children:"--"})})]},d.sessionId))})]})})})]})}function aS(e,[n,i]){return Math.min(i,Math.max(n,e))}function Pt(e,n,{checkForDefaultPrevented:i=!0}={}){return function(a){if(e?.(a),i===!1||!a.defaultPrevented)return n?.(a)}}function eg(e,n=[]){let i=[];function s(f,d){const l=L.createContext(d),u=i.length;i=[...i,d];const c=m=>{const{scope:_,children:x,...C}=m,S=_?.[e]?.[u]||l,p=L.useMemo(()=>C,Object.values(C));return D.jsx(S.Provider,{value:p,children:x})};c.displayName=f+"Provider";function v(m,_){const x=_?.[e]?.[u]||l,C=L.useContext(x);if(C)return C;if(d!==void 0)return d;throw new Error(`\`${m}\` must be used within \`${f}\``)}return[c,v]}const a=()=>{const f=i.map(d=>L.createContext(d));return function(l){const u=l?.[e]||f;return L.useMemo(()=>({[`__scope${e}`]:{...l,[e]:u}}),[l,u])}};return a.scopeName=e,[s,KB(a,...n)]}function KB(...e){const n=e[0];if(e.length===1)return n;const i=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(f){const d=s.reduce((l,{useScope:u,scopeName:c})=>{const m=u(f)[`__scope${c}`];return{...l,...m}},{});return L.useMemo(()=>({[`__scope${n.scopeName}`]:d}),[d])}};return i.scopeName=n.scopeName,i}function lS(e){const n=GB(e),i=L.forwardRef((s,a)=>{const{children:f,...d}=s,l=L.Children.toArray(f),u=l.find(QB);if(u){const c=u.props.children,v=l.map(m=>m===u?L.Children.count(c)>1?L.Children.only(null):L.isValidElement(c)?c.props.children:null:m);return D.jsx(n,{...d,ref:a,children:L.isValidElement(c)?L.cloneElement(c,void 0,v):null})}return D.jsx(n,{...d,ref:a,children:f})});return i.displayName=`${e}.Slot`,i}function GB(e){const n=L.forwardRef((i,s)=>{const{children:a,...f}=i;if(L.isValidElement(a)){const d=JB(a),l=ZB(f,a.props);return a.type!==L.Fragment&&(l.ref=s?Xl(s,d):d),L.cloneElement(a,l)}return L.Children.count(a)>1?L.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var XB=Symbol("radix.slottable");function QB(e){return L.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===XB}function ZB(e,n){const i={...n};for(const s in n){const a=e[s],f=n[s];/^on[A-Z]/.test(s)?a&&f?i[s]=(...l)=>{const u=f(...l);return a(...l),u}:a&&(i[s]=a):s==="style"?i[s]={...a,...f}:s==="className"&&(i[s]=[a,f].filter(Boolean).join(" "))}return{...e,...i}}function JB(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}function e6(e){const n=e+"CollectionProvider",[i,s]=eg(n),[a,f]=i(n,{collectionRef:{current:null},itemMap:new Map}),d=S=>{const{scope:p,children:g}=S,b=Or.useRef(null),y=Or.useRef(new Map).current;return D.jsx(a,{scope:p,itemMap:y,collectionRef:b,children:g})};d.displayName=n;const l=e+"CollectionSlot",u=lS(l),c=Or.forwardRef((S,p)=>{const{scope:g,children:b}=S,y=f(l,g),E=on(p,y.collectionRef);return D.jsx(u,{ref:E,children:b})});c.displayName=l;const v=e+"CollectionItemSlot",m="data-radix-collection-item",_=lS(v),x=Or.forwardRef((S,p)=>{const{scope:g,children:b,...y}=S,E=Or.useRef(null),M=on(p,E),O=f(v,g);return Or.useEffect(()=>(O.itemMap.set(E,{ref:E,...y}),()=>void O.itemMap.delete(E))),D.jsx(_,{[m]:"",ref:M,children:b})});x.displayName=v;function C(S){const p=f(e+"CollectionConsumer",S);return Or.useCallback(()=>{const b=p.collectionRef.current;if(!b)return[];const y=Array.from(b.querySelectorAll(`[${m}]`));return Array.from(p.itemMap.values()).sort((O,T)=>y.indexOf(O.ref.current)-y.indexOf(T.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:d,Slot:c,ItemSlot:x},C,s]}var t6=L.createContext(void 0);function n6(e){const n=L.useContext(t6);return e||n||"ltr"}function r6(e){const n=i6(e),i=L.forwardRef((s,a)=>{const{children:f,...d}=s,l=L.Children.toArray(f),u=l.find(o6);if(u){const c=u.props.children,v=l.map(m=>m===u?L.Children.count(c)>1?L.Children.only(null):L.isValidElement(c)?c.props.children:null:m);return D.jsx(n,{...d,ref:a,children:L.isValidElement(c)?L.cloneElement(c,void 0,v):null})}return D.jsx(n,{...d,ref:a,children:f})});return i.displayName=`${e}.Slot`,i}function i6(e){const n=L.forwardRef((i,s)=>{const{children:a,...f}=i;if(L.isValidElement(a)){const d=l6(a),l=a6(f,a.props);return a.type!==L.Fragment&&(l.ref=s?Xl(s,d):d),L.cloneElement(a,l)}return L.Children.count(a)>1?L.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var s6=Symbol("radix.slottable");function o6(e){return L.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===s6}function a6(e,n){const i={...n};for(const s in n){const a=e[s],f=n[s];/^on[A-Z]/.test(s)?a&&f?i[s]=(...l)=>{const u=f(...l);return a(...l),u}:a&&(i[s]=a):s==="style"?i[s]={...a,...f}:s==="className"&&(i[s]=[a,f].filter(Boolean).join(" "))}return{...e,...i}}function l6(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}var c6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Lt=c6.reduce((e,n)=>{const i=r6(`Primitive.${n}`),s=L.forwardRef((a,f)=>{const{asChild:d,...l}=a,u=d?i:n;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),D.jsx(u,{...l,ref:f})});return s.displayName=`Primitive.${n}`,{...e,[n]:s}},{});function u6(e,n){e&&Js.flushSync(()=>e.dispatchEvent(n))}function Ws(e){const n=L.useRef(e);return L.useEffect(()=>{n.current=e}),L.useMemo(()=>(...i)=>n.current?.(...i),[])}function h6(e,n=globalThis?.document){const i=Ws(e);L.useEffect(()=>{const s=a=>{a.key==="Escape"&&i(a)};return n.addEventListener("keydown",s,{capture:!0}),()=>n.removeEventListener("keydown",s,{capture:!0})},[i,n])}var f6="DismissableLayer",Zm="dismissableLayer.update",d6="dismissableLayer.pointerDownOutside",m6="dismissableLayer.focusOutside",cS,T1=L.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),M1=L.forwardRef((e,n)=>{const{disableOutsidePointerEvents:i=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:f,onInteractOutside:d,onDismiss:l,...u}=e,c=L.useContext(T1),[v,m]=L.useState(null),_=v?.ownerDocument??globalThis?.document,[,x]=L.useState({}),C=on(n,T=>m(T)),S=Array.from(c.layers),[p]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=S.indexOf(p),b=v?S.indexOf(v):-1,y=c.layersWithOutsidePointerEventsDisabled.size>0,E=b>=g,M=v6(T=>{const A=T.target,k=[...c.branches].some(q=>q.contains(A));!E||k||(a?.(T),d?.(T),T.defaultPrevented||l?.())},_),O=_6(T=>{const A=T.target;[...c.branches].some(q=>q.contains(A))||(f?.(T),d?.(T),T.defaultPrevented||l?.())},_);return h6(T=>{b===c.layers.size-1&&(s?.(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},_),L.useEffect(()=>{if(v)return i&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(cS=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(v)),c.layers.add(v),uS(),()=>{i&&c.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=cS)}},[v,_,i,c]),L.useEffect(()=>()=>{v&&(c.layers.delete(v),c.layersWithOutsidePointerEventsDisabled.delete(v),uS())},[v,c]),L.useEffect(()=>{const T=()=>x({});return document.addEventListener(Zm,T),()=>document.removeEventListener(Zm,T)},[]),D.jsx(Lt.div,{...u,ref:C,style:{pointerEvents:y?E?"auto":"none":void 0,...e.style},onFocusCapture:Pt(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Pt(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Pt(e.onPointerDownCapture,M.onPointerDownCapture)})});M1.displayName=f6;var p6="DismissableLayerBranch",g6=L.forwardRef((e,n)=>{const i=L.useContext(T1),s=L.useRef(null),a=on(n,s);return L.useEffect(()=>{const f=s.current;if(f)return i.branches.add(f),()=>{i.branches.delete(f)}},[i.branches]),D.jsx(Lt.div,{...e,ref:a})});g6.displayName=p6;function v6(e,n=globalThis?.document){const i=Ws(e),s=L.useRef(!1),a=L.useRef(()=>{});return L.useEffect(()=>{const f=l=>{if(l.target&&!s.current){let u=function(){D1(d6,i,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(n.removeEventListener("click",a.current),a.current=u,n.addEventListener("click",a.current,{once:!0})):u()}else n.removeEventListener("click",a.current);s.current=!1},d=window.setTimeout(()=>{n.addEventListener("pointerdown",f)},0);return()=>{window.clearTimeout(d),n.removeEventListener("pointerdown",f),n.removeEventListener("click",a.current)}},[n,i]),{onPointerDownCapture:()=>s.current=!0}}function _6(e,n=globalThis?.document){const i=Ws(e),s=L.useRef(!1);return L.useEffect(()=>{const a=f=>{f.target&&!s.current&&D1(m6,i,{originalEvent:f},{discrete:!1})};return n.addEventListener("focusin",a),()=>n.removeEventListener("focusin",a)},[n,i]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function uS(){const e=new CustomEvent(Zm);document.dispatchEvent(e)}function D1(e,n,i,{discrete:s}){const a=i.originalEvent.target,f=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:i});n&&a.addEventListener(e,n,{once:!0}),s?u6(a,f):a.dispatchEvent(f)}var gm=0;function y6(){L.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??hS()),document.body.insertAdjacentElement("beforeend",e[1]??hS()),gm++,()=>{gm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(n=>n.remove()),gm--}},[])}function hS(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var vm="focusScope.autoFocusOnMount",_m="focusScope.autoFocusOnUnmount",fS={bubbles:!1,cancelable:!0},b6="FocusScope",O1=L.forwardRef((e,n)=>{const{loop:i=!1,trapped:s=!1,onMountAutoFocus:a,onUnmountAutoFocus:f,...d}=e,[l,u]=L.useState(null),c=Ws(a),v=Ws(f),m=L.useRef(null),_=on(n,S=>u(S)),x=L.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;L.useEffect(()=>{if(s){let S=function(y){if(x.paused||!l)return;const E=y.target;l.contains(E)?m.current=E:Ji(m.current,{select:!0})},p=function(y){if(x.paused||!l)return;const E=y.relatedTarget;E!==null&&(l.contains(E)||Ji(m.current,{select:!0}))},g=function(y){if(document.activeElement===document.body)for(const M of y)M.removedNodes.length>0&&Ji(l)};document.addEventListener("focusin",S),document.addEventListener("focusout",p);const b=new MutationObserver(g);return l&&b.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",p),b.disconnect()}}},[s,l,x.paused]),L.useEffect(()=>{if(l){mS.add(x);const S=document.activeElement;if(!l.contains(S)){const g=new CustomEvent(vm,fS);l.addEventListener(vm,c),l.dispatchEvent(g),g.defaultPrevented||(S6(R6(L1(l)),{select:!0}),document.activeElement===S&&Ji(l))}return()=>{l.removeEventListener(vm,c),setTimeout(()=>{const g=new CustomEvent(_m,fS);l.addEventListener(_m,v),l.dispatchEvent(g),g.defaultPrevented||Ji(S??document.body,{select:!0}),l.removeEventListener(_m,v),mS.remove(x)},0)}}},[l,c,v,x]);const C=L.useCallback(S=>{if(!i&&!s||x.paused)return;const p=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,g=document.activeElement;if(p&&g){const b=S.currentTarget,[y,E]=x6(b);y&&E?!S.shiftKey&&g===E?(S.preventDefault(),i&&Ji(y,{select:!0})):S.shiftKey&&g===y&&(S.preventDefault(),i&&Ji(E,{select:!0})):g===b&&S.preventDefault()}},[i,s,x.paused]);return D.jsx(Lt.div,{tabIndex:-1,...d,ref:_,onKeyDown:C})});O1.displayName=b6;function S6(e,{select:n=!1}={}){const i=document.activeElement;for(const s of e)if(Ji(s,{select:n}),document.activeElement!==i)return}function x6(e){const n=L1(e),i=dS(n,e),s=dS(n.reverse(),e);return[i,s]}function L1(e){const n=[],i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const a=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||a?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)n.push(i.currentNode);return n}function dS(e,n){for(const i of e)if(!w6(i,{upTo:n}))return i}function w6(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function C6(e){return e instanceof HTMLInputElement&&"select"in e}function Ji(e,{select:n=!1}={}){if(e&&e.focus){const i=document.activeElement;e.focus({preventScroll:!0}),e!==i&&C6(e)&&n&&e.select()}}var mS=E6();function E6(){let e=[];return{add(n){const i=e[0];n!==i&&i?.pause(),e=pS(e,n),e.unshift(n)},remove(n){e=pS(e,n),e[0]?.resume()}}}function pS(e,n){const i=[...e],s=i.indexOf(n);return s!==-1&&i.splice(s,1),i}function R6(e){return e.filter(n=>n.tagName!=="A")}var On=globalThis?.document?L.useLayoutEffect:()=>{},A6=dh[" useId ".trim().toString()]||(()=>{}),T6=0;function tg(e){const[n,i]=L.useState(A6());return On(()=>{i(s=>s??String(T6++))},[e]),n?`radix-${n}`:""}const M6=["top","right","bottom","left"],ls=Math.min,Fn=Math.max,oh=Math.round,Ru=Math.floor,Pr=e=>({x:e,y:e}),D6={left:"right",right:"left",bottom:"top",top:"bottom"},O6={start:"end",end:"start"};function Jm(e,n,i){return Fn(e,ls(n,i))}function xi(e,n){return typeof e=="function"?e(n):e}function wi(e){return e.split("-")[0]}function ca(e){return e.split("-")[1]}function ng(e){return e==="x"?"y":"x"}function rg(e){return e==="y"?"height":"width"}const L6=new Set(["top","bottom"]);function jr(e){return L6.has(wi(e))?"y":"x"}function ig(e){return ng(jr(e))}function k6(e,n,i){i===void 0&&(i=!1);const s=ca(e),a=ig(e),f=rg(a);let d=a==="x"?s===(i?"end":"start")?"right":"left":s==="start"?"bottom":"top";return n.reference[f]>n.floating[f]&&(d=ah(d)),[d,ah(d)]}function N6(e){const n=ah(e);return[ep(e),n,ep(n)]}function ep(e){return e.replace(/start|end/g,n=>O6[n])}const gS=["left","right"],vS=["right","left"],B6=["top","bottom"],j6=["bottom","top"];function H6(e,n,i){switch(e){case"top":case"bottom":return i?n?vS:gS:n?gS:vS;case"left":case"right":return n?B6:j6;default:return[]}}function z6(e,n,i,s){const a=ca(e);let f=H6(wi(e),i==="start",s);return a&&(f=f.map(d=>d+"-"+a),n&&(f=f.concat(f.map(ep)))),f}function ah(e){return e.replace(/left|right|bottom|top/g,n=>D6[n])}function P6(e){return{top:0,right:0,bottom:0,left:0,...e}}function k1(e){return typeof e!="number"?P6(e):{top:e,right:e,bottom:e,left:e}}function lh(e){const{x:n,y:i,width:s,height:a}=e;return{width:s,height:a,top:i,left:n,right:n+s,bottom:i+a,x:n,y:i}}function _S(e,n,i){let{reference:s,floating:a}=e;const f=jr(n),d=ig(n),l=rg(d),u=wi(n),c=f==="y",v=s.x+s.width/2-a.width/2,m=s.y+s.height/2-a.height/2,_=s[l]/2-a[l]/2;let x;switch(u){case"top":x={x:v,y:s.y-a.height};break;case"bottom":x={x:v,y:s.y+s.height};break;case"right":x={x:s.x+s.width,y:m};break;case"left":x={x:s.x-a.width,y:m};break;default:x={x:s.x,y:s.y}}switch(ca(n)){case"start":x[d]-=_*(i&&c?-1:1);break;case"end":x[d]+=_*(i&&c?-1:1);break}return x}const I6=async(e,n,i)=>{const{placement:s="bottom",strategy:a="absolute",middleware:f=[],platform:d}=i,l=f.filter(Boolean),u=await(d.isRTL==null?void 0:d.isRTL(n));let c=await d.getElementRects({reference:e,floating:n,strategy:a}),{x:v,y:m}=_S(c,s,u),_=s,x={},C=0;for(let S=0;S<l.length;S++){const{name:p,fn:g}=l[S],{x:b,y,data:E,reset:M}=await g({x:v,y:m,initialPlacement:s,placement:_,strategy:a,middlewareData:x,rects:c,platform:d,elements:{reference:e,floating:n}});v=b??v,m=y??m,x={...x,[p]:{...x[p],...E}},M&&C<=50&&(C++,typeof M=="object"&&(M.placement&&(_=M.placement),M.rects&&(c=M.rects===!0?await d.getElementRects({reference:e,floating:n,strategy:a}):M.rects),{x:v,y:m}=_S(c,_,u)),S=-1)}return{x:v,y:m,placement:_,strategy:a,middlewareData:x}};async function Nl(e,n){var i;n===void 0&&(n={});const{x:s,y:a,platform:f,rects:d,elements:l,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:v="viewport",elementContext:m="floating",altBoundary:_=!1,padding:x=0}=xi(n,e),C=k1(x),p=l[_?m==="floating"?"reference":"floating":m],g=lh(await f.getClippingRect({element:(i=await(f.isElement==null?void 0:f.isElement(p)))==null||i?p:p.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(l.floating)),boundary:c,rootBoundary:v,strategy:u})),b=m==="floating"?{x:s,y:a,width:d.floating.width,height:d.floating.height}:d.reference,y=await(f.getOffsetParent==null?void 0:f.getOffsetParent(l.floating)),E=await(f.isElement==null?void 0:f.isElement(y))?await(f.getScale==null?void 0:f.getScale(y))||{x:1,y:1}:{x:1,y:1},M=lh(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:y,strategy:u}):b);return{top:(g.top-M.top+C.top)/E.y,bottom:(M.bottom-g.bottom+C.bottom)/E.y,left:(g.left-M.left+C.left)/E.x,right:(M.right-g.right+C.right)/E.x}}const U6=e=>({name:"arrow",options:e,async fn(n){const{x:i,y:s,placement:a,rects:f,platform:d,elements:l,middlewareData:u}=n,{element:c,padding:v=0}=xi(e,n)||{};if(c==null)return{};const m=k1(v),_={x:i,y:s},x=ig(a),C=rg(x),S=await d.getDimensions(c),p=x==="y",g=p?"top":"left",b=p?"bottom":"right",y=p?"clientHeight":"clientWidth",E=f.reference[C]+f.reference[x]-_[x]-f.floating[C],M=_[x]-f.reference[x],O=await(d.getOffsetParent==null?void 0:d.getOffsetParent(c));let T=O?O[y]:0;(!T||!await(d.isElement==null?void 0:d.isElement(O)))&&(T=l.floating[y]||f.floating[C]);const A=E/2-M/2,k=T/2-S[C]/2-1,q=ls(m[g],k),z=ls(m[b],k),I=q,W=T-S[C]-z,U=T/2-S[C]/2+A,G=Jm(I,U,W),H=!u.arrow&&ca(a)!=null&&U!==G&&f.reference[C]/2-(U<I?q:z)-S[C]/2<0,K=H?U<I?U-I:U-W:0;return{[x]:_[x]+K,data:{[x]:G,centerOffset:U-G-K,...H&&{alignmentOffset:K}},reset:H}}}),F6=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var i,s;const{placement:a,middlewareData:f,rects:d,initialPlacement:l,platform:u,elements:c}=n,{mainAxis:v=!0,crossAxis:m=!0,fallbackPlacements:_,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:S=!0,...p}=xi(e,n);if((i=f.arrow)!=null&&i.alignmentOffset)return{};const g=wi(a),b=jr(l),y=wi(l)===l,E=await(u.isRTL==null?void 0:u.isRTL(c.floating)),M=_||(y||!S?[ah(l)]:N6(l)),O=C!=="none";!_&&O&&M.push(...z6(l,S,C,E));const T=[l,...M],A=await Nl(n,p),k=[];let q=((s=f.flip)==null?void 0:s.overflows)||[];if(v&&k.push(A[g]),m){const U=k6(a,d,E);k.push(A[U[0]],A[U[1]])}if(q=[...q,{placement:a,overflows:k}],!k.every(U=>U<=0)){var z,I;const U=(((z=f.flip)==null?void 0:z.index)||0)+1,G=T[U];if(G&&(!(m==="alignment"?b!==jr(G):!1)||q.every(F=>jr(F.placement)===b?F.overflows[0]>0:!0)))return{data:{index:U,overflows:q},reset:{placement:G}};let H=(I=q.filter(K=>K.overflows[0]<=0).sort((K,F)=>K.overflows[1]-F.overflows[1])[0])==null?void 0:I.placement;if(!H)switch(x){case"bestFit":{var W;const K=(W=q.filter(F=>{if(O){const N=jr(F.placement);return N===b||N==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(N=>N>0).reduce((N,$)=>N+$,0)]).sort((F,N)=>F[1]-N[1])[0])==null?void 0:W[0];K&&(H=K);break}case"initialPlacement":H=l;break}if(a!==H)return{reset:{placement:H}}}return{}}}};function yS(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function bS(e){return M6.some(n=>e[n]>=0)}const $6=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(n){const{rects:i}=n,{strategy:s="referenceHidden",...a}=xi(e,n);switch(s){case"referenceHidden":{const f=await Nl(n,{...a,elementContext:"reference"}),d=yS(f,i.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:bS(d)}}}case"escaped":{const f=await Nl(n,{...a,altBoundary:!0}),d=yS(f,i.floating);return{data:{escapedOffsets:d,escaped:bS(d)}}}default:return{}}}}},N1=new Set(["left","top"]);async function V6(e,n){const{placement:i,platform:s,elements:a}=e,f=await(s.isRTL==null?void 0:s.isRTL(a.floating)),d=wi(i),l=ca(i),u=jr(i)==="y",c=N1.has(d)?-1:1,v=f&&u?-1:1,m=xi(n,e);let{mainAxis:_,crossAxis:x,alignmentAxis:C}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return l&&typeof C=="number"&&(x=l==="end"?C*-1:C),u?{x:x*v,y:_*c}:{x:_*c,y:x*v}}const q6=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var i,s;const{x:a,y:f,placement:d,middlewareData:l}=n,u=await V6(n,e);return d===((i=l.offset)==null?void 0:i.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:a+u.x,y:f+u.y,data:{...u,placement:d}}}}},W6=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:i,y:s,placement:a}=n,{mainAxis:f=!0,crossAxis:d=!1,limiter:l={fn:p=>{let{x:g,y:b}=p;return{x:g,y:b}}},...u}=xi(e,n),c={x:i,y:s},v=await Nl(n,u),m=jr(wi(a)),_=ng(m);let x=c[_],C=c[m];if(f){const p=_==="y"?"top":"left",g=_==="y"?"bottom":"right",b=x+v[p],y=x-v[g];x=Jm(b,x,y)}if(d){const p=m==="y"?"top":"left",g=m==="y"?"bottom":"right",b=C+v[p],y=C-v[g];C=Jm(b,C,y)}const S=l.fn({...n,[_]:x,[m]:C});return{...S,data:{x:S.x-i,y:S.y-s,enabled:{[_]:f,[m]:d}}}}}},Y6=function(e){return e===void 0&&(e={}),{options:e,fn(n){const{x:i,y:s,placement:a,rects:f,middlewareData:d}=n,{offset:l=0,mainAxis:u=!0,crossAxis:c=!0}=xi(e,n),v={x:i,y:s},m=jr(a),_=ng(m);let x=v[_],C=v[m];const S=xi(l,n),p=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(u){const y=_==="y"?"height":"width",E=f.reference[_]-f.floating[y]+p.mainAxis,M=f.reference[_]+f.reference[y]-p.mainAxis;x<E?x=E:x>M&&(x=M)}if(c){var g,b;const y=_==="y"?"width":"height",E=N1.has(wi(a)),M=f.reference[m]-f.floating[y]+(E&&((g=d.offset)==null?void 0:g[m])||0)+(E?0:p.crossAxis),O=f.reference[m]+f.reference[y]+(E?0:((b=d.offset)==null?void 0:b[m])||0)-(E?p.crossAxis:0);C<M?C=M:C>O&&(C=O)}return{[_]:x,[m]:C}}}},K6=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(n){var i,s;const{placement:a,rects:f,platform:d,elements:l}=n,{apply:u=()=>{},...c}=xi(e,n),v=await Nl(n,c),m=wi(a),_=ca(a),x=jr(a)==="y",{width:C,height:S}=f.floating;let p,g;m==="top"||m==="bottom"?(p=m,g=_===(await(d.isRTL==null?void 0:d.isRTL(l.floating))?"start":"end")?"left":"right"):(g=m,p=_==="end"?"top":"bottom");const b=S-v.top-v.bottom,y=C-v.left-v.right,E=ls(S-v[p],b),M=ls(C-v[g],y),O=!n.middlewareData.shift;let T=E,A=M;if((i=n.middlewareData.shift)!=null&&i.enabled.x&&(A=y),(s=n.middlewareData.shift)!=null&&s.enabled.y&&(T=b),O&&!_){const q=Fn(v.left,0),z=Fn(v.right,0),I=Fn(v.top,0),W=Fn(v.bottom,0);x?A=C-2*(q!==0||z!==0?q+z:Fn(v.left,v.right)):T=S-2*(I!==0||W!==0?I+W:Fn(v.top,v.bottom))}await u({...n,availableWidth:A,availableHeight:T});const k=await d.getDimensions(l.floating);return C!==k.width||S!==k.height?{reset:{rects:!0}}:{}}}};function Mh(){return typeof window<"u"}function ua(e){return B1(e)?(e.nodeName||"").toLowerCase():"#document"}function Vn(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function qr(e){var n;return(n=(B1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function B1(e){return Mh()?e instanceof Node||e instanceof Vn(e).Node:!1}function yr(e){return Mh()?e instanceof Element||e instanceof Vn(e).Element:!1}function Fr(e){return Mh()?e instanceof HTMLElement||e instanceof Vn(e).HTMLElement:!1}function SS(e){return!Mh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Vn(e).ShadowRoot}const G6=new Set(["inline","contents"]);function Ql(e){const{overflow:n,overflowX:i,overflowY:s,display:a}=br(e);return/auto|scroll|overlay|hidden|clip/.test(n+s+i)&&!G6.has(a)}const X6=new Set(["table","td","th"]);function Q6(e){return X6.has(ua(e))}const Z6=[":popover-open",":modal"];function Dh(e){return Z6.some(n=>{try{return e.matches(n)}catch{return!1}})}const J6=["transform","translate","scale","rotate","perspective"],ej=["transform","translate","scale","rotate","perspective","filter"],tj=["paint","layout","strict","content"];function sg(e){const n=og(),i=yr(e)?br(e):e;return J6.some(s=>i[s]?i[s]!=="none":!1)||(i.containerType?i.containerType!=="normal":!1)||!n&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!n&&(i.filter?i.filter!=="none":!1)||ej.some(s=>(i.willChange||"").includes(s))||tj.some(s=>(i.contain||"").includes(s))}function nj(e){let n=cs(e);for(;Fr(n)&&!sa(n);){if(sg(n))return n;if(Dh(n))return null;n=cs(n)}return null}function og(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const rj=new Set(["html","body","#document"]);function sa(e){return rj.has(ua(e))}function br(e){return Vn(e).getComputedStyle(e)}function Oh(e){return yr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function cs(e){if(ua(e)==="html")return e;const n=e.assignedSlot||e.parentNode||SS(e)&&e.host||qr(e);return SS(n)?n.host:n}function j1(e){const n=cs(e);return sa(n)?e.ownerDocument?e.ownerDocument.body:e.body:Fr(n)&&Ql(n)?n:j1(n)}function Bl(e,n,i){var s;n===void 0&&(n=[]),i===void 0&&(i=!0);const a=j1(e),f=a===((s=e.ownerDocument)==null?void 0:s.body),d=Vn(a);if(f){const l=tp(d);return n.concat(d,d.visualViewport||[],Ql(a)?a:[],l&&i?Bl(l):[])}return n.concat(a,Bl(a,[],i))}function tp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function H1(e){const n=br(e);let i=parseFloat(n.width)||0,s=parseFloat(n.height)||0;const a=Fr(e),f=a?e.offsetWidth:i,d=a?e.offsetHeight:s,l=oh(i)!==f||oh(s)!==d;return l&&(i=f,s=d),{width:i,height:s,$:l}}function ag(e){return yr(e)?e:e.contextElement}function Xo(e){const n=ag(e);if(!Fr(n))return Pr(1);const i=n.getBoundingClientRect(),{width:s,height:a,$:f}=H1(n);let d=(f?oh(i.width):i.width)/s,l=(f?oh(i.height):i.height)/a;return(!d||!Number.isFinite(d))&&(d=1),(!l||!Number.isFinite(l))&&(l=1),{x:d,y:l}}const ij=Pr(0);function z1(e){const n=Vn(e);return!og()||!n.visualViewport?ij:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function sj(e,n,i){return n===void 0&&(n=!1),!i||n&&i!==Vn(e)?!1:n}function Ys(e,n,i,s){n===void 0&&(n=!1),i===void 0&&(i=!1);const a=e.getBoundingClientRect(),f=ag(e);let d=Pr(1);n&&(s?yr(s)&&(d=Xo(s)):d=Xo(e));const l=sj(f,i,s)?z1(f):Pr(0);let u=(a.left+l.x)/d.x,c=(a.top+l.y)/d.y,v=a.width/d.x,m=a.height/d.y;if(f){const _=Vn(f),x=s&&yr(s)?Vn(s):s;let C=_,S=tp(C);for(;S&&s&&x!==C;){const p=Xo(S),g=S.getBoundingClientRect(),b=br(S),y=g.left+(S.clientLeft+parseFloat(b.paddingLeft))*p.x,E=g.top+(S.clientTop+parseFloat(b.paddingTop))*p.y;u*=p.x,c*=p.y,v*=p.x,m*=p.y,u+=y,c+=E,C=Vn(S),S=tp(C)}}return lh({width:v,height:m,x:u,y:c})}function Lh(e,n){const i=Oh(e).scrollLeft;return n?n.left+i:Ys(qr(e)).left+i}function P1(e,n){const i=e.getBoundingClientRect(),s=i.left+n.scrollLeft-Lh(e,i),a=i.top+n.scrollTop;return{x:s,y:a}}function oj(e){let{elements:n,rect:i,offsetParent:s,strategy:a}=e;const f=a==="fixed",d=qr(s),l=n?Dh(n.floating):!1;if(s===d||l&&f)return i;let u={scrollLeft:0,scrollTop:0},c=Pr(1);const v=Pr(0),m=Fr(s);if((m||!m&&!f)&&((ua(s)!=="body"||Ql(d))&&(u=Oh(s)),Fr(s))){const x=Ys(s);c=Xo(s),v.x=x.x+s.clientLeft,v.y=x.y+s.clientTop}const _=d&&!m&&!f?P1(d,u):Pr(0);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-u.scrollLeft*c.x+v.x+_.x,y:i.y*c.y-u.scrollTop*c.y+v.y+_.y}}function aj(e){return Array.from(e.getClientRects())}function lj(e){const n=qr(e),i=Oh(e),s=e.ownerDocument.body,a=Fn(n.scrollWidth,n.clientWidth,s.scrollWidth,s.clientWidth),f=Fn(n.scrollHeight,n.clientHeight,s.scrollHeight,s.clientHeight);let d=-i.scrollLeft+Lh(e);const l=-i.scrollTop;return br(s).direction==="rtl"&&(d+=Fn(n.clientWidth,s.clientWidth)-a),{width:a,height:f,x:d,y:l}}const xS=25;function cj(e,n){const i=Vn(e),s=qr(e),a=i.visualViewport;let f=s.clientWidth,d=s.clientHeight,l=0,u=0;if(a){f=a.width,d=a.height;const v=og();(!v||v&&n==="fixed")&&(l=a.offsetLeft,u=a.offsetTop)}const c=Lh(s);if(c<=0){const v=s.ownerDocument,m=v.body,_=getComputedStyle(m),x=v.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,C=Math.abs(s.clientWidth-m.clientWidth-x);C<=xS&&(f-=C)}else c<=xS&&(f+=c);return{width:f,height:d,x:l,y:u}}const uj=new Set(["absolute","fixed"]);function hj(e,n){const i=Ys(e,!0,n==="fixed"),s=i.top+e.clientTop,a=i.left+e.clientLeft,f=Fr(e)?Xo(e):Pr(1),d=e.clientWidth*f.x,l=e.clientHeight*f.y,u=a*f.x,c=s*f.y;return{width:d,height:l,x:u,y:c}}function wS(e,n,i){let s;if(n==="viewport")s=cj(e,i);else if(n==="document")s=lj(qr(e));else if(yr(n))s=hj(n,i);else{const a=z1(e);s={x:n.x-a.x,y:n.y-a.y,width:n.width,height:n.height}}return lh(s)}function I1(e,n){const i=cs(e);return i===n||!yr(i)||sa(i)?!1:br(i).position==="fixed"||I1(i,n)}function fj(e,n){const i=n.get(e);if(i)return i;let s=Bl(e,[],!1).filter(l=>yr(l)&&ua(l)!=="body"),a=null;const f=br(e).position==="fixed";let d=f?cs(e):e;for(;yr(d)&&!sa(d);){const l=br(d),u=sg(d);!u&&l.position==="fixed"&&(a=null),(f?!u&&!a:!u&&l.position==="static"&&!!a&&uj.has(a.position)||Ql(d)&&!u&&I1(e,d))?s=s.filter(v=>v!==d):a=l,d=cs(d)}return n.set(e,s),s}function dj(e){let{element:n,boundary:i,rootBoundary:s,strategy:a}=e;const d=[...i==="clippingAncestors"?Dh(n)?[]:fj(n,this._c):[].concat(i),s],l=d[0],u=d.reduce((c,v)=>{const m=wS(n,v,a);return c.top=Fn(m.top,c.top),c.right=ls(m.right,c.right),c.bottom=ls(m.bottom,c.bottom),c.left=Fn(m.left,c.left),c},wS(n,l,a));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function mj(e){const{width:n,height:i}=H1(e);return{width:n,height:i}}function pj(e,n,i){const s=Fr(n),a=qr(n),f=i==="fixed",d=Ys(e,!0,f,n);let l={scrollLeft:0,scrollTop:0};const u=Pr(0);function c(){u.x=Lh(a)}if(s||!s&&!f)if((ua(n)!=="body"||Ql(a))&&(l=Oh(n)),s){const x=Ys(n,!0,f,n);u.x=x.x+n.clientLeft,u.y=x.y+n.clientTop}else a&&c();f&&!s&&a&&c();const v=a&&!s&&!f?P1(a,l):Pr(0),m=d.left+l.scrollLeft-u.x-v.x,_=d.top+l.scrollTop-u.y-v.y;return{x:m,y:_,width:d.width,height:d.height}}function ym(e){return br(e).position==="static"}function CS(e,n){if(!Fr(e)||br(e).position==="fixed")return null;if(n)return n(e);let i=e.offsetParent;return qr(e)===i&&(i=i.ownerDocument.body),i}function U1(e,n){const i=Vn(e);if(Dh(e))return i;if(!Fr(e)){let a=cs(e);for(;a&&!sa(a);){if(yr(a)&&!ym(a))return a;a=cs(a)}return i}let s=CS(e,n);for(;s&&Q6(s)&&ym(s);)s=CS(s,n);return s&&sa(s)&&ym(s)&&!sg(s)?i:s||nj(e)||i}const gj=async function(e){const n=this.getOffsetParent||U1,i=this.getDimensions,s=await i(e.floating);return{reference:pj(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function vj(e){return br(e).direction==="rtl"}const _j={convertOffsetParentRelativeRectToViewportRelativeRect:oj,getDocumentElement:qr,getClippingRect:dj,getOffsetParent:U1,getElementRects:gj,getClientRects:aj,getDimensions:mj,getScale:Xo,isElement:yr,isRTL:vj};function F1(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function yj(e,n){let i=null,s;const a=qr(e);function f(){var l;clearTimeout(s),(l=i)==null||l.disconnect(),i=null}function d(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),f();const c=e.getBoundingClientRect(),{left:v,top:m,width:_,height:x}=c;if(l||n(),!_||!x)return;const C=Ru(m),S=Ru(a.clientWidth-(v+_)),p=Ru(a.clientHeight-(m+x)),g=Ru(v),y={rootMargin:-C+"px "+-S+"px "+-p+"px "+-g+"px",threshold:Fn(0,ls(1,u))||1};let E=!0;function M(O){const T=O[0].intersectionRatio;if(T!==u){if(!E)return d();T?d(!1,T):s=setTimeout(()=>{d(!1,1e-7)},1e3)}T===1&&!F1(c,e.getBoundingClientRect())&&d(),E=!1}try{i=new IntersectionObserver(M,{...y,root:a.ownerDocument})}catch{i=new IntersectionObserver(M,y)}i.observe(e)}return d(!0),f}function bj(e,n,i,s){s===void 0&&(s={});const{ancestorScroll:a=!0,ancestorResize:f=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=s,c=ag(e),v=a||f?[...c?Bl(c):[],...Bl(n)]:[];v.forEach(g=>{a&&g.addEventListener("scroll",i,{passive:!0}),f&&g.addEventListener("resize",i)});const m=c&&l?yj(c,i):null;let _=-1,x=null;d&&(x=new ResizeObserver(g=>{let[b]=g;b&&b.target===c&&x&&(x.unobserve(n),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var y;(y=x)==null||y.observe(n)})),i()}),c&&!u&&x.observe(c),x.observe(n));let C,S=u?Ys(e):null;u&&p();function p(){const g=Ys(e);S&&!F1(S,g)&&i(),S=g,C=requestAnimationFrame(p)}return i(),()=>{var g;v.forEach(b=>{a&&b.removeEventListener("scroll",i),f&&b.removeEventListener("resize",i)}),m?.(),(g=x)==null||g.disconnect(),x=null,u&&cancelAnimationFrame(C)}}const Sj=q6,xj=W6,wj=F6,Cj=K6,Ej=$6,ES=U6,Rj=Y6,Aj=(e,n,i)=>{const s=new Map,a={platform:_j,...i},f={...a.platform,_c:s};return I6(e,n,{...a,platform:f})};var Tj=typeof document<"u",Mj=function(){},Iu=Tj?L.useLayoutEffect:Mj;function ch(e,n){if(e===n)return!0;if(typeof e!=typeof n)return!1;if(typeof e=="function"&&e.toString()===n.toString())return!0;let i,s,a;if(e&&n&&typeof e=="object"){if(Array.isArray(e)){if(i=e.length,i!==n.length)return!1;for(s=i;s--!==0;)if(!ch(e[s],n[s]))return!1;return!0}if(a=Object.keys(e),i=a.length,i!==Object.keys(n).length)return!1;for(s=i;s--!==0;)if(!{}.hasOwnProperty.call(n,a[s]))return!1;for(s=i;s--!==0;){const f=a[s];if(!(f==="_owner"&&e.$$typeof)&&!ch(e[f],n[f]))return!1}return!0}return e!==e&&n!==n}function $1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function RS(e,n){const i=$1(e);return Math.round(n*i)/i}function bm(e){const n=L.useRef(e);return Iu(()=>{n.current=e}),n}function Dj(e){e===void 0&&(e={});const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:a,elements:{reference:f,floating:d}={},transform:l=!0,whileElementsMounted:u,open:c}=e,[v,m]=L.useState({x:0,y:0,strategy:i,placement:n,middlewareData:{},isPositioned:!1}),[_,x]=L.useState(s);ch(_,s)||x(s);const[C,S]=L.useState(null),[p,g]=L.useState(null),b=L.useCallback(F=>{F!==O.current&&(O.current=F,S(F))},[]),y=L.useCallback(F=>{F!==T.current&&(T.current=F,g(F))},[]),E=f||C,M=d||p,O=L.useRef(null),T=L.useRef(null),A=L.useRef(v),k=u!=null,q=bm(u),z=bm(a),I=bm(c),W=L.useCallback(()=>{if(!O.current||!T.current)return;const F={placement:n,strategy:i,middleware:_};z.current&&(F.platform=z.current),Aj(O.current,T.current,F).then(N=>{const $={...N,isPositioned:I.current!==!1};U.current&&!ch(A.current,$)&&(A.current=$,Js.flushSync(()=>{m($)}))})},[_,n,i,z,I]);Iu(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,m(F=>({...F,isPositioned:!1})))},[c]);const U=L.useRef(!1);Iu(()=>(U.current=!0,()=>{U.current=!1}),[]),Iu(()=>{if(E&&(O.current=E),M&&(T.current=M),E&&M){if(q.current)return q.current(E,M,W);W()}},[E,M,W,q,k]);const G=L.useMemo(()=>({reference:O,floating:T,setReference:b,setFloating:y}),[b,y]),H=L.useMemo(()=>({reference:E,floating:M}),[E,M]),K=L.useMemo(()=>{const F={position:i,left:0,top:0};if(!H.floating)return F;const N=RS(H.floating,v.x),$=RS(H.floating,v.y);return l?{...F,transform:"translate("+N+"px, "+$+"px)",...$1(H.floating)>=1.5&&{willChange:"transform"}}:{position:i,left:N,top:$}},[i,l,H.floating,v.x,v.y]);return L.useMemo(()=>({...v,update:W,refs:G,elements:H,floatingStyles:K}),[v,W,G,H,K])}const Oj=e=>{function n(i){return{}.hasOwnProperty.call(i,"current")}return{name:"arrow",options:e,fn(i){const{element:s,padding:a}=typeof e=="function"?e(i):e;return s&&n(s)?s.current!=null?ES({element:s.current,padding:a}).fn(i):{}:s?ES({element:s,padding:a}).fn(i):{}}}},Lj=(e,n)=>({...Sj(e),options:[e,n]}),kj=(e,n)=>({...xj(e),options:[e,n]}),Nj=(e,n)=>({...Rj(e),options:[e,n]}),Bj=(e,n)=>({...wj(e),options:[e,n]}),jj=(e,n)=>({...Cj(e),options:[e,n]}),Hj=(e,n)=>({...Ej(e),options:[e,n]}),zj=(e,n)=>({...Oj(e),options:[e,n]});var Pj="Arrow",V1=L.forwardRef((e,n)=>{const{children:i,width:s=10,height:a=5,...f}=e;return D.jsx(Lt.svg,{...f,ref:n,width:s,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?i:D.jsx("polygon",{points:"0,0 30,0 15,10"})})});V1.displayName=Pj;var Ij=V1;function Uj(e){const[n,i]=L.useState(void 0);return On(()=>{if(e){i({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const f=a[0];let d,l;if("borderBoxSize"in f){const u=f.borderBoxSize,c=Array.isArray(u)?u[0]:u;d=c.inlineSize,l=c.blockSize}else d=e.offsetWidth,l=e.offsetHeight;i({width:d,height:l})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else i(void 0)},[e]),n}var lg="Popper",[q1,W1]=eg(lg),[Fj,Y1]=q1(lg),K1=e=>{const{__scopePopper:n,children:i}=e,[s,a]=L.useState(null);return D.jsx(Fj,{scope:n,anchor:s,onAnchorChange:a,children:i})};K1.displayName=lg;var G1="PopperAnchor",X1=L.forwardRef((e,n)=>{const{__scopePopper:i,virtualRef:s,...a}=e,f=Y1(G1,i),d=L.useRef(null),l=on(n,d),u=L.useRef(null);return L.useEffect(()=>{const c=u.current;u.current=s?.current||d.current,c!==u.current&&f.onAnchorChange(u.current)}),s?null:D.jsx(Lt.div,{...a,ref:l})});X1.displayName=G1;var cg="PopperContent",[$j,Vj]=q1(cg),Q1=L.forwardRef((e,n)=>{const{__scopePopper:i,side:s="bottom",sideOffset:a=0,align:f="center",alignOffset:d=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:v=0,sticky:m="partial",hideWhenDetached:_=!1,updatePositionStrategy:x="optimized",onPlaced:C,...S}=e,p=Y1(cg,i),[g,b]=L.useState(null),y=on(n,X=>b(X)),[E,M]=L.useState(null),O=Uj(E),T=O?.width??0,A=O?.height??0,k=s+(f!=="center"?"-"+f:""),q=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},z=Array.isArray(c)?c:[c],I=z.length>0,W={padding:q,boundary:z.filter(Wj),altBoundary:I},{refs:U,floatingStyles:G,placement:H,isPositioned:K,middlewareData:F}=Dj({strategy:"fixed",placement:k,whileElementsMounted:(...X)=>bj(...X,{animationFrame:x==="always"}),elements:{reference:p.anchor},middleware:[Lj({mainAxis:a+A,alignmentAxis:d}),u&&kj({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?Nj():void 0,...W}),u&&Bj({...W}),jj({...W,apply:({elements:X,rects:V,availableWidth:ie,availableHeight:de})=>{const{width:re,height:le}=V.reference,_e=X.floating.style;_e.setProperty("--radix-popper-available-width",`${ie}px`),_e.setProperty("--radix-popper-available-height",`${de}px`),_e.setProperty("--radix-popper-anchor-width",`${re}px`),_e.setProperty("--radix-popper-anchor-height",`${le}px`)}}),E&&zj({element:E,padding:l}),Yj({arrowWidth:T,arrowHeight:A}),_&&Hj({strategy:"referenceHidden",...W})]}),[N,$]=eC(H),B=Ws(C);On(()=>{K&&B?.()},[K,B]);const P=F.arrow?.x,Q=F.arrow?.y,J=F.arrow?.centerOffset!==0,[ae,Z]=L.useState();return On(()=>{g&&Z(window.getComputedStyle(g).zIndex)},[g]),D.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:K?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:D.jsx($j,{scope:i,placedSide:N,onArrowChange:M,arrowX:P,arrowY:Q,shouldHideArrow:J,children:D.jsx(Lt.div,{"data-side":N,"data-align":$,...S,ref:y,style:{...S.style,animation:K?void 0:"none"}})})})});Q1.displayName=cg;var Z1="PopperArrow",qj={top:"bottom",right:"left",bottom:"top",left:"right"},J1=L.forwardRef(function(n,i){const{__scopePopper:s,...a}=n,f=Vj(Z1,s),d=qj[f.placedSide];return D.jsx("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:D.jsx(Ij,{...a,ref:i,style:{...a.style,display:"block"}})})});J1.displayName=Z1;function Wj(e){return e!==null}var Yj=e=>({name:"transformOrigin",options:e,fn(n){const{placement:i,rects:s,middlewareData:a}=n,d=a.arrow?.centerOffset!==0,l=d?0:e.arrowWidth,u=d?0:e.arrowHeight,[c,v]=eC(i),m={start:"0%",center:"50%",end:"100%"}[v],_=(a.arrow?.x??0)+l/2,x=(a.arrow?.y??0)+u/2;let C="",S="";return c==="bottom"?(C=d?m:`${_}px`,S=`${-u}px`):c==="top"?(C=d?m:`${_}px`,S=`${s.floating.height+u}px`):c==="right"?(C=`${-u}px`,S=d?m:`${x}px`):c==="left"&&(C=`${s.floating.width+u}px`,S=d?m:`${x}px`),{data:{x:C,y:S}}}});function eC(e){const[n,i="center"]=e.split("-");return[n,i]}var Kj=K1,Gj=X1,Xj=Q1,Qj=J1,Zj="Portal",tC=L.forwardRef((e,n)=>{const{container:i,...s}=e,[a,f]=L.useState(!1);On(()=>f(!0),[]);const d=i||a&&globalThis?.document?.body;return d?dM.createPortal(D.jsx(Lt.div,{...s,ref:n}),d):null});tC.displayName=Zj;function Jj(e){const n=e8(e),i=L.forwardRef((s,a)=>{const{children:f,...d}=s,l=L.Children.toArray(f),u=l.find(n8);if(u){const c=u.props.children,v=l.map(m=>m===u?L.Children.count(c)>1?L.Children.only(null):L.isValidElement(c)?c.props.children:null:m);return D.jsx(n,{...d,ref:a,children:L.isValidElement(c)?L.cloneElement(c,void 0,v):null})}return D.jsx(n,{...d,ref:a,children:f})});return i.displayName=`${e}.Slot`,i}function e8(e){const n=L.forwardRef((i,s)=>{const{children:a,...f}=i;if(L.isValidElement(a)){const d=i8(a),l=r8(f,a.props);return a.type!==L.Fragment&&(l.ref=s?Xl(s,d):d),L.cloneElement(a,l)}return L.Children.count(a)>1?L.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var t8=Symbol("radix.slottable");function n8(e){return L.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===t8}function r8(e,n){const i={...n};for(const s in n){const a=e[s],f=n[s];/^on[A-Z]/.test(s)?a&&f?i[s]=(...l)=>{const u=f(...l);return a(...l),u}:a&&(i[s]=a):s==="style"?i[s]={...a,...f}:s==="className"&&(i[s]=[a,f].filter(Boolean).join(" "))}return{...e,...i}}function i8(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?e.ref:(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?e.props.ref:e.props.ref||e.ref)}var s8=dh[" useInsertionEffect ".trim().toString()]||On;function AS({prop:e,defaultProp:n,onChange:i=()=>{},caller:s}){const[a,f,d]=o8({defaultProp:n,onChange:i}),l=e!==void 0,u=l?e:a;{const v=L.useRef(e!==void 0);L.useEffect(()=>{const m=v.current;m!==l&&console.warn(`${s} is changing from ${m?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=l},[l,s])}const c=L.useCallback(v=>{if(l){const m=a8(v)?v(e):v;m!==e&&d.current?.(m)}else f(v)},[l,e,f,d]);return[u,c]}function o8({defaultProp:e,onChange:n}){const[i,s]=L.useState(e),a=L.useRef(i),f=L.useRef(n);return s8(()=>{f.current=n},[n]),L.useEffect(()=>{a.current!==i&&(f.current?.(i),a.current=i)},[i,a]),[i,s,f]}function a8(e){return typeof e=="function"}function l8(e){const n=L.useRef({value:e,previous:e});return L.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}var nC=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),c8="VisuallyHidden",u8=L.forwardRef((e,n)=>D.jsx(Lt.span,{...e,ref:n,style:{...nC,...e.style}}));u8.displayName=c8;var h8=function(e){if(typeof document>"u")return null;var n=Array.isArray(e)?e[0]:e;return n.ownerDocument.body},Io=new WeakMap,Au=new WeakMap,Tu={},Sm=0,rC=function(e){return e&&(e.host||rC(e.parentNode))},f8=function(e,n){return n.map(function(i){if(e.contains(i))return i;var s=rC(i);return s&&e.contains(s)?s:(console.error("aria-hidden",i,"in not contained inside",e,". Doing nothing"),null)}).filter(function(i){return!!i})},d8=function(e,n,i,s){var a=f8(n,Array.isArray(e)?e:[e]);Tu[i]||(Tu[i]=new WeakMap);var f=Tu[i],d=[],l=new Set,u=new Set(a),c=function(m){!m||l.has(m)||(l.add(m),c(m.parentNode))};a.forEach(c);var v=function(m){!m||u.has(m)||Array.prototype.forEach.call(m.children,function(_){if(l.has(_))v(_);else try{var x=_.getAttribute(s),C=x!==null&&x!=="false",S=(Io.get(_)||0)+1,p=(f.get(_)||0)+1;Io.set(_,S),f.set(_,p),d.push(_),S===1&&C&&Au.set(_,!0),p===1&&_.setAttribute(i,"true"),C||_.setAttribute(s,"true")}catch(g){console.error("aria-hidden: cannot operate on ",_,g)}})};return v(n),l.clear(),Sm++,function(){d.forEach(function(m){var _=Io.get(m)-1,x=f.get(m)-1;Io.set(m,_),f.set(m,x),_||(Au.has(m)||m.removeAttribute(s),Au.delete(m)),x||m.removeAttribute(i)}),Sm--,Sm||(Io=new WeakMap,Io=new WeakMap,Au=new WeakMap,Tu={})}},m8=function(e,n,i){i===void 0&&(i="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),a=h8(e);return a?(s.push.apply(s,Array.from(a.querySelectorAll("[aria-live], script"))),d8(s,a,i,"aria-hidden")):function(){return null}},Br=function(){return Br=Object.assign||function(n){for(var i,s=1,a=arguments.length;s<a;s++){i=arguments[s];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(n[f]=i[f])}return n},Br.apply(this,arguments)};function iC(e,n){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&n.indexOf(s)<0&&(i[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(e);a<s.length;a++)n.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(e,s[a])&&(i[s[a]]=e[s[a]]);return i}function p8(e,n,i){if(i||arguments.length===2)for(var s=0,a=n.length,f;s<a;s++)(f||!(s in n))&&(f||(f=Array.prototype.slice.call(n,0,s)),f[s]=n[s]);return e.concat(f||Array.prototype.slice.call(n))}var Uu="right-scroll-bar-position",Fu="width-before-scroll-bar",g8="with-scroll-bars-hidden",v8="--removed-body-scroll-bar-size";function xm(e,n){return typeof e=="function"?e(n):e&&(e.current=n),e}function _8(e,n){var i=L.useState(function(){return{value:e,callback:n,facade:{get current(){return i.value},set current(s){var a=i.value;a!==s&&(i.value=s,i.callback(s,a))}}}})[0];return i.callback=n,i.facade}var y8=typeof window<"u"?L.useLayoutEffect:L.useEffect,TS=new WeakMap;function b8(e,n){var i=_8(null,function(s){return e.forEach(function(a){return xm(a,s)})});return y8(function(){var s=TS.get(i);if(s){var a=new Set(s),f=new Set(e),d=i.current;a.forEach(function(l){f.has(l)||xm(l,null)}),f.forEach(function(l){a.has(l)||xm(l,d)})}TS.set(i,e)},[e]),i}function S8(e){return e}function x8(e,n){n===void 0&&(n=S8);var i=[],s=!1,a={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:e},useMedium:function(f){var d=n(f,s);return i.push(d),function(){i=i.filter(function(l){return l!==d})}},assignSyncMedium:function(f){for(s=!0;i.length;){var d=i;i=[],d.forEach(f)}i={push:function(l){return f(l)},filter:function(){return i}}},assignMedium:function(f){s=!0;var d=[];if(i.length){var l=i;i=[],l.forEach(f),d=i}var u=function(){var v=d;d=[],v.forEach(f)},c=function(){return Promise.resolve().then(u)};c(),i={push:function(v){d.push(v),c()},filter:function(v){return d=d.filter(v),i}}}};return a}function w8(e){e===void 0&&(e={});var n=x8(null);return n.options=Br({async:!0,ssr:!1},e),n}var sC=function(e){var n=e.sideCar,i=iC(e,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=n.read();if(!s)throw new Error("Sidecar medium not found");return L.createElement(s,Br({},i))};sC.isSideCarExport=!0;function C8(e,n){return e.useMedium(n),sC}var oC=w8(),wm=function(){},kh=L.forwardRef(function(e,n){var i=L.useRef(null),s=L.useState({onScrollCapture:wm,onWheelCapture:wm,onTouchMoveCapture:wm}),a=s[0],f=s[1],d=e.forwardProps,l=e.children,u=e.className,c=e.removeScrollBar,v=e.enabled,m=e.shards,_=e.sideCar,x=e.noRelative,C=e.noIsolation,S=e.inert,p=e.allowPinchZoom,g=e.as,b=g===void 0?"div":g,y=e.gapMode,E=iC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=_,O=b8([i,n]),T=Br(Br({},E),a);return L.createElement(L.Fragment,null,v&&L.createElement(M,{sideCar:oC,removeScrollBar:c,shards:m,noRelative:x,noIsolation:C,inert:S,setCallbacks:f,allowPinchZoom:!!p,lockRef:i,gapMode:y}),d?L.cloneElement(L.Children.only(l),Br(Br({},T),{ref:O})):L.createElement(b,Br({},T,{className:u,ref:O}),l))});kh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};kh.classNames={fullWidth:Fu,zeroRight:Uu};var E8=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function R8(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var n=E8();return n&&e.setAttribute("nonce",n),e}function A8(e,n){e.styleSheet?e.styleSheet.cssText=n:e.appendChild(document.createTextNode(n))}function T8(e){var n=document.head||document.getElementsByTagName("head")[0];n.appendChild(e)}var M8=function(){var e=0,n=null;return{add:function(i){e==0&&(n=R8())&&(A8(n,i),T8(n)),e++},remove:function(){e--,!e&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}},D8=function(){var e=M8();return function(n,i){L.useEffect(function(){return e.add(n),function(){e.remove()}},[n&&i])}},aC=function(){var e=D8(),n=function(i){var s=i.styles,a=i.dynamic;return e(s,a),null};return n},O8={left:0,top:0,right:0,gap:0},Cm=function(e){return parseInt(e||"",10)||0},L8=function(e){var n=window.getComputedStyle(document.body),i=n[e==="padding"?"paddingLeft":"marginLeft"],s=n[e==="padding"?"paddingTop":"marginTop"],a=n[e==="padding"?"paddingRight":"marginRight"];return[Cm(i),Cm(s),Cm(a)]},k8=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return O8;var n=L8(e),i=document.documentElement.clientWidth,s=window.innerWidth;return{left:n[0],top:n[1],right:n[2],gap:Math.max(0,s-i+n[2]-n[0])}},N8=aC(),Qo="data-scroll-locked",B8=function(e,n,i,s){var a=e.left,f=e.top,d=e.right,l=e.gap;return i===void 0&&(i="margin"),`
19
+ .`.concat(g8,` {
20
+ overflow: hidden `).concat(s,`;
21
+ padding-right: `).concat(l,"px ").concat(s,`;
22
+ }
23
+ body[`).concat(Qo,`] {
24
+ overflow: hidden `).concat(s,`;
25
+ overscroll-behavior: contain;
26
+ `).concat([n&&"position: relative ".concat(s,";"),i==="margin"&&`
27
+ padding-left: `.concat(a,`px;
28
+ padding-top: `).concat(f,`px;
29
+ padding-right: `).concat(d,`px;
30
+ margin-left:0;
31
+ margin-top:0;
32
+ margin-right: `).concat(l,"px ").concat(s,`;
33
+ `),i==="padding"&&"padding-right: ".concat(l,"px ").concat(s,";")].filter(Boolean).join(""),`
34
+ }
35
+
36
+ .`).concat(Uu,` {
37
+ right: `).concat(l,"px ").concat(s,`;
38
+ }
39
+
40
+ .`).concat(Fu,` {
41
+ margin-right: `).concat(l,"px ").concat(s,`;
42
+ }
43
+
44
+ .`).concat(Uu," .").concat(Uu,` {
45
+ right: 0 `).concat(s,`;
46
+ }
47
+
48
+ .`).concat(Fu," .").concat(Fu,` {
49
+ margin-right: 0 `).concat(s,`;
50
+ }
51
+
52
+ body[`).concat(Qo,`] {
53
+ `).concat(v8,": ").concat(l,`px;
54
+ }
55
+ `)},MS=function(){var e=parseInt(document.body.getAttribute(Qo)||"0",10);return isFinite(e)?e:0},j8=function(){L.useEffect(function(){return document.body.setAttribute(Qo,(MS()+1).toString()),function(){var e=MS()-1;e<=0?document.body.removeAttribute(Qo):document.body.setAttribute(Qo,e.toString())}},[])},H8=function(e){var n=e.noRelative,i=e.noImportant,s=e.gapMode,a=s===void 0?"margin":s;j8();var f=L.useMemo(function(){return k8(a)},[a]);return L.createElement(N8,{styles:B8(f,!n,a,i?"":"!important")})},np=!1;if(typeof window<"u")try{var Mu=Object.defineProperty({},"passive",{get:function(){return np=!0,!0}});window.addEventListener("test",Mu,Mu),window.removeEventListener("test",Mu,Mu)}catch{np=!1}var Uo=np?{passive:!1}:!1,z8=function(e){return e.tagName==="TEXTAREA"},lC=function(e,n){if(!(e instanceof Element))return!1;var i=window.getComputedStyle(e);return i[n]!=="hidden"&&!(i.overflowY===i.overflowX&&!z8(e)&&i[n]==="visible")},P8=function(e){return lC(e,"overflowY")},I8=function(e){return lC(e,"overflowX")},DS=function(e,n){var i=n.ownerDocument,s=n;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var a=cC(e,s);if(a){var f=uC(e,s),d=f[1],l=f[2];if(d>l)return!0}s=s.parentNode}while(s&&s!==i.body);return!1},U8=function(e){var n=e.scrollTop,i=e.scrollHeight,s=e.clientHeight;return[n,i,s]},F8=function(e){var n=e.scrollLeft,i=e.scrollWidth,s=e.clientWidth;return[n,i,s]},cC=function(e,n){return e==="v"?P8(n):I8(n)},uC=function(e,n){return e==="v"?U8(n):F8(n)},$8=function(e,n){return e==="h"&&n==="rtl"?-1:1},V8=function(e,n,i,s,a){var f=$8(e,window.getComputedStyle(n).direction),d=f*s,l=i.target,u=n.contains(l),c=!1,v=d>0,m=0,_=0;do{if(!l)break;var x=uC(e,l),C=x[0],S=x[1],p=x[2],g=S-p-f*C;(C||g)&&cC(e,l)&&(m+=g,_+=C);var b=l.parentNode;l=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!u&&l!==document.body||u&&(n.contains(l)||n===l));return(v&&Math.abs(m)<1||!v&&Math.abs(_)<1)&&(c=!0),c},Du=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},OS=function(e){return[e.deltaX,e.deltaY]},LS=function(e){return e&&"current"in e?e.current:e},q8=function(e,n){return e[0]===n[0]&&e[1]===n[1]},W8=function(e){return`
56
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
57
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
58
+ `)},Y8=0,Fo=[];function K8(e){var n=L.useRef([]),i=L.useRef([0,0]),s=L.useRef(),a=L.useState(Y8++)[0],f=L.useState(aC)[0],d=L.useRef(e);L.useEffect(function(){d.current=e},[e]),L.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var S=p8([e.lockRef.current],(e.shards||[]).map(LS),!0).filter(Boolean);return S.forEach(function(p){return p.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),S.forEach(function(p){return p.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=L.useCallback(function(S,p){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!d.current.allowPinchZoom;var g=Du(S),b=i.current,y="deltaX"in S?S.deltaX:b[0]-g[0],E="deltaY"in S?S.deltaY:b[1]-g[1],M,O=S.target,T=Math.abs(y)>Math.abs(E)?"h":"v";if("touches"in S&&T==="h"&&O.type==="range")return!1;var A=window.getSelection(),k=A&&A.anchorNode,q=k?k===O||k.contains(O):!1;if(q)return!1;var z=DS(T,O);if(!z)return!0;if(z?M=T:(M=T==="v"?"h":"v",z=DS(T,O)),!z)return!1;if(!s.current&&"changedTouches"in S&&(y||E)&&(s.current=M),!M)return!0;var I=s.current||M;return V8(I,p,S,I==="h"?y:E)},[]),u=L.useCallback(function(S){var p=S;if(!(!Fo.length||Fo[Fo.length-1]!==f)){var g="deltaY"in p?OS(p):Du(p),b=n.current.filter(function(M){return M.name===p.type&&(M.target===p.target||p.target===M.shadowParent)&&q8(M.delta,g)})[0];if(b&&b.should){p.cancelable&&p.preventDefault();return}if(!b){var y=(d.current.shards||[]).map(LS).filter(Boolean).filter(function(M){return M.contains(p.target)}),E=y.length>0?l(p,y[0]):!d.current.noIsolation;E&&p.cancelable&&p.preventDefault()}}},[]),c=L.useCallback(function(S,p,g,b){var y={name:S,delta:p,target:g,should:b,shadowParent:G8(g)};n.current.push(y),setTimeout(function(){n.current=n.current.filter(function(E){return E!==y})},1)},[]),v=L.useCallback(function(S){i.current=Du(S),s.current=void 0},[]),m=L.useCallback(function(S){c(S.type,OS(S),S.target,l(S,e.lockRef.current))},[]),_=L.useCallback(function(S){c(S.type,Du(S),S.target,l(S,e.lockRef.current))},[]);L.useEffect(function(){return Fo.push(f),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:_}),document.addEventListener("wheel",u,Uo),document.addEventListener("touchmove",u,Uo),document.addEventListener("touchstart",v,Uo),function(){Fo=Fo.filter(function(S){return S!==f}),document.removeEventListener("wheel",u,Uo),document.removeEventListener("touchmove",u,Uo),document.removeEventListener("touchstart",v,Uo)}},[]);var x=e.removeScrollBar,C=e.inert;return L.createElement(L.Fragment,null,C?L.createElement(f,{styles:W8(a)}):null,x?L.createElement(H8,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function G8(e){for(var n=null;e!==null;)e instanceof ShadowRoot&&(n=e.host,e=e.host),e=e.parentNode;return n}const X8=C8(oC,K8);var hC=L.forwardRef(function(e,n){return L.createElement(kh,Br({},e,{ref:n,sideCar:X8}))});hC.classNames=kh.classNames;var Q8=[" ","Enter","ArrowUp","ArrowDown"],Z8=[" ","Enter"],Ks="Select",[Nh,Bh,J8]=e6(Ks),[ha]=eg(Ks,[J8,W1]),jh=W1(),[eH,hs]=ha(Ks),[tH,nH]=ha(Ks),fC=e=>{const{__scopeSelect:n,children:i,open:s,defaultOpen:a,onOpenChange:f,value:d,defaultValue:l,onValueChange:u,dir:c,name:v,autoComplete:m,disabled:_,required:x,form:C}=e,S=jh(n),[p,g]=L.useState(null),[b,y]=L.useState(null),[E,M]=L.useState(!1),O=n6(c),[T,A]=AS({prop:s,defaultProp:a??!1,onChange:f,caller:Ks}),[k,q]=AS({prop:d,defaultProp:l,onChange:u,caller:Ks}),z=L.useRef(null),I=p?C||!!p.closest("form"):!0,[W,U]=L.useState(new Set),G=Array.from(W).map(H=>H.props.value).join(";");return D.jsx(Kj,{...S,children:D.jsxs(eH,{required:x,scope:n,trigger:p,onTriggerChange:g,valueNode:b,onValueNodeChange:y,valueNodeHasChildren:E,onValueNodeHasChildrenChange:M,contentId:tg(),value:k,onValueChange:q,open:T,onOpenChange:A,dir:O,triggerPointerDownPosRef:z,disabled:_,children:[D.jsx(Nh.Provider,{scope:n,children:D.jsx(tH,{scope:e.__scopeSelect,onNativeOptionAdd:L.useCallback(H=>{U(K=>new Set(K).add(H))},[]),onNativeOptionRemove:L.useCallback(H=>{U(K=>{const F=new Set(K);return F.delete(H),F})},[]),children:i})}),I?D.jsxs(jC,{"aria-hidden":!0,required:x,tabIndex:-1,name:v,autoComplete:m,value:k,onChange:H=>q(H.target.value),disabled:_,form:C,children:[k===void 0?D.jsx("option",{value:""}):null,Array.from(W)]},G):null]})})};fC.displayName=Ks;var dC="SelectTrigger",mC=L.forwardRef((e,n)=>{const{__scopeSelect:i,disabled:s=!1,...a}=e,f=jh(i),d=hs(dC,i),l=d.disabled||s,u=on(n,d.onTriggerChange),c=Bh(i),v=L.useRef("touch"),[m,_,x]=zC(S=>{const p=c().filter(y=>!y.disabled),g=p.find(y=>y.value===d.value),b=PC(p,S,g);b!==void 0&&d.onValueChange(b.value)}),C=S=>{l||(d.onOpenChange(!0),x()),S&&(d.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return D.jsx(Gj,{asChild:!0,...f,children:D.jsx(Lt.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":HC(d.value)?"":void 0,...a,ref:u,onClick:Pt(a.onClick,S=>{S.currentTarget.focus(),v.current!=="mouse"&&C(S)}),onPointerDown:Pt(a.onPointerDown,S=>{v.current=S.pointerType;const p=S.target;p.hasPointerCapture(S.pointerId)&&p.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(C(S),S.preventDefault())}),onKeyDown:Pt(a.onKeyDown,S=>{const p=m.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&_(S.key),!(p&&S.key===" ")&&Q8.includes(S.key)&&(C(),S.preventDefault())})})})});mC.displayName=dC;var pC="SelectValue",gC=L.forwardRef((e,n)=>{const{__scopeSelect:i,className:s,style:a,children:f,placeholder:d="",...l}=e,u=hs(pC,i),{onValueNodeHasChildrenChange:c}=u,v=f!==void 0,m=on(n,u.onValueNodeChange);return On(()=>{c(v)},[c,v]),D.jsx(Lt.span,{...l,ref:m,style:{pointerEvents:"none"},children:HC(u.value)?D.jsx(D.Fragment,{children:d}):f})});gC.displayName=pC;var rH="SelectIcon",vC=L.forwardRef((e,n)=>{const{__scopeSelect:i,children:s,...a}=e;return D.jsx(Lt.span,{"aria-hidden":!0,...a,ref:n,children:s||"▼"})});vC.displayName=rH;var iH="SelectPortal",_C=e=>D.jsx(tC,{asChild:!0,...e});_C.displayName=iH;var Gs="SelectContent",yC=L.forwardRef((e,n)=>{const i=hs(Gs,e.__scopeSelect),[s,a]=L.useState();if(On(()=>{a(new DocumentFragment)},[]),!i.open){const f=s;return f?Js.createPortal(D.jsx(bC,{scope:e.__scopeSelect,children:D.jsx(Nh.Slot,{scope:e.__scopeSelect,children:D.jsx("div",{children:e.children})})}),f):null}return D.jsx(SC,{...e,ref:n})});yC.displayName=Gs;var fr=10,[bC,fs]=ha(Gs),sH="SelectContentImpl",oH=Jj("SelectContent.RemoveScroll"),SC=L.forwardRef((e,n)=>{const{__scopeSelect:i,position:s="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:f,onPointerDownOutside:d,side:l,sideOffset:u,align:c,alignOffset:v,arrowPadding:m,collisionBoundary:_,collisionPadding:x,sticky:C,hideWhenDetached:S,avoidCollisions:p,...g}=e,b=hs(Gs,i),[y,E]=L.useState(null),[M,O]=L.useState(null),T=on(n,X=>E(X)),[A,k]=L.useState(null),[q,z]=L.useState(null),I=Bh(i),[W,U]=L.useState(!1),G=L.useRef(!1);L.useEffect(()=>{if(y)return m8(y)},[y]),y6();const H=L.useCallback(X=>{const[V,...ie]=I().map(le=>le.ref.current),[de]=ie.slice(-1),re=document.activeElement;for(const le of X)if(le===re||(le?.scrollIntoView({block:"nearest"}),le===V&&M&&(M.scrollTop=0),le===de&&M&&(M.scrollTop=M.scrollHeight),le?.focus(),document.activeElement!==re))return},[I,M]),K=L.useCallback(()=>H([A,y]),[H,A,y]);L.useEffect(()=>{W&&K()},[W,K]);const{onOpenChange:F,triggerPointerDownPosRef:N}=b;L.useEffect(()=>{if(y){let X={x:0,y:0};const V=de=>{X={x:Math.abs(Math.round(de.pageX)-(N.current?.x??0)),y:Math.abs(Math.round(de.pageY)-(N.current?.y??0))}},ie=de=>{X.x<=10&&X.y<=10?de.preventDefault():y.contains(de.target)||F(!1),document.removeEventListener("pointermove",V),N.current=null};return N.current!==null&&(document.addEventListener("pointermove",V),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",ie,{capture:!0})}}},[y,F,N]),L.useEffect(()=>{const X=()=>F(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[F]);const[$,B]=zC(X=>{const V=I().filter(re=>!re.disabled),ie=V.find(re=>re.ref.current===document.activeElement),de=PC(V,X,ie);de&&setTimeout(()=>de.ref.current.focus())}),P=L.useCallback((X,V,ie)=>{const de=!G.current&&!ie;(b.value!==void 0&&b.value===V||de)&&(k(X),de&&(G.current=!0))},[b.value]),Q=L.useCallback(()=>y?.focus(),[y]),J=L.useCallback((X,V,ie)=>{const de=!G.current&&!ie;(b.value!==void 0&&b.value===V||de)&&z(X)},[b.value]),ae=s==="popper"?rp:xC,Z=ae===rp?{side:l,sideOffset:u,align:c,alignOffset:v,arrowPadding:m,collisionBoundary:_,collisionPadding:x,sticky:C,hideWhenDetached:S,avoidCollisions:p}:{};return D.jsx(bC,{scope:i,content:y,viewport:M,onViewportChange:O,itemRefCallback:P,selectedItem:A,onItemLeave:Q,itemTextRefCallback:J,focusSelectedItem:K,selectedItemText:q,position:s,isPositioned:W,searchRef:$,children:D.jsx(hC,{as:oH,allowPinchZoom:!0,children:D.jsx(O1,{asChild:!0,trapped:b.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:Pt(a,X=>{b.trigger?.focus({preventScroll:!0}),X.preventDefault()}),children:D.jsx(M1,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:D.jsx(ae,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:X=>X.preventDefault(),...g,...Z,onPlaced:()=>U(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:Pt(g.onKeyDown,X=>{const V=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!V&&X.key.length===1&&B(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let de=I().filter(re=>!re.disabled).map(re=>re.ref.current);if(["ArrowUp","End"].includes(X.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const re=X.target,le=de.indexOf(re);de=de.slice(le+1)}setTimeout(()=>H(de)),X.preventDefault()}})})})})})})});SC.displayName=sH;var aH="SelectItemAlignedPosition",xC=L.forwardRef((e,n)=>{const{__scopeSelect:i,onPlaced:s,...a}=e,f=hs(Gs,i),d=fs(Gs,i),[l,u]=L.useState(null),[c,v]=L.useState(null),m=on(n,T=>v(T)),_=Bh(i),x=L.useRef(!1),C=L.useRef(!0),{viewport:S,selectedItem:p,selectedItemText:g,focusSelectedItem:b}=d,y=L.useCallback(()=>{if(f.trigger&&f.valueNode&&l&&c&&S&&p&&g){const T=f.trigger.getBoundingClientRect(),A=c.getBoundingClientRect(),k=f.valueNode.getBoundingClientRect(),q=g.getBoundingClientRect();if(f.dir!=="rtl"){const re=q.left-A.left,le=k.left-re,_e=T.left-le,Ce=T.width+_e,He=Math.max(Ce,A.width),Be=window.innerWidth-fr,we=aS(le,[fr,Math.max(fr,Be-He)]);l.style.minWidth=Ce+"px",l.style.left=we+"px"}else{const re=A.right-q.right,le=window.innerWidth-k.right-re,_e=window.innerWidth-T.right-le,Ce=T.width+_e,He=Math.max(Ce,A.width),Be=window.innerWidth-fr,we=aS(le,[fr,Math.max(fr,Be-He)]);l.style.minWidth=Ce+"px",l.style.right=we+"px"}const z=_(),I=window.innerHeight-fr*2,W=S.scrollHeight,U=window.getComputedStyle(c),G=parseInt(U.borderTopWidth,10),H=parseInt(U.paddingTop,10),K=parseInt(U.borderBottomWidth,10),F=parseInt(U.paddingBottom,10),N=G+H+W+F+K,$=Math.min(p.offsetHeight*5,N),B=window.getComputedStyle(S),P=parseInt(B.paddingTop,10),Q=parseInt(B.paddingBottom,10),J=T.top+T.height/2-fr,ae=I-J,Z=p.offsetHeight/2,X=p.offsetTop+Z,V=G+H+X,ie=N-V;if(V<=J){const re=z.length>0&&p===z[z.length-1].ref.current;l.style.bottom="0px";const le=c.clientHeight-S.offsetTop-S.offsetHeight,_e=Math.max(ae,Z+(re?Q:0)+le+K),Ce=V+_e;l.style.height=Ce+"px"}else{const re=z.length>0&&p===z[0].ref.current;l.style.top="0px";const _e=Math.max(J,G+S.offsetTop+(re?P:0)+Z)+ie;l.style.height=_e+"px",S.scrollTop=V-J+S.offsetTop}l.style.margin=`${fr}px 0`,l.style.minHeight=$+"px",l.style.maxHeight=I+"px",s?.(),requestAnimationFrame(()=>x.current=!0)}},[_,f.trigger,f.valueNode,l,c,S,p,g,f.dir,s]);On(()=>y(),[y]);const[E,M]=L.useState();On(()=>{c&&M(window.getComputedStyle(c).zIndex)},[c]);const O=L.useCallback(T=>{T&&C.current===!0&&(y(),b?.(),C.current=!1)},[y,b]);return D.jsx(cH,{scope:i,contentWrapper:l,shouldExpandOnScrollRef:x,onScrollButtonChange:O,children:D.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:D.jsx(Lt.div,{...a,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});xC.displayName=aH;var lH="SelectPopperPosition",rp=L.forwardRef((e,n)=>{const{__scopeSelect:i,align:s="start",collisionPadding:a=fr,...f}=e,d=jh(i);return D.jsx(Xj,{...d,...f,ref:n,align:s,collisionPadding:a,style:{boxSizing:"border-box",...f.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});rp.displayName=lH;var[cH,ug]=ha(Gs,{}),ip="SelectViewport",wC=L.forwardRef((e,n)=>{const{__scopeSelect:i,nonce:s,...a}=e,f=fs(ip,i),d=ug(ip,i),l=on(n,f.onViewportChange),u=L.useRef(0);return D.jsxs(D.Fragment,{children:[D.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),D.jsx(Nh.Slot,{scope:i,children:D.jsx(Lt.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Pt(a.onScroll,c=>{const v=c.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:_}=d;if(_?.current&&m){const x=Math.abs(u.current-v.scrollTop);if(x>0){const C=window.innerHeight-fr*2,S=parseFloat(m.style.minHeight),p=parseFloat(m.style.height),g=Math.max(S,p);if(g<C){const b=g+x,y=Math.min(C,b),E=b-y;m.style.height=y+"px",m.style.bottom==="0px"&&(v.scrollTop=E>0?E:0,m.style.justifyContent="flex-end")}}}u.current=v.scrollTop})})})]})});wC.displayName=ip;var CC="SelectGroup",[uH,hH]=ha(CC),fH=L.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e,a=tg();return D.jsx(uH,{scope:i,id:a,children:D.jsx(Lt.div,{role:"group","aria-labelledby":a,...s,ref:n})})});fH.displayName=CC;var EC="SelectLabel",RC=L.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e,a=hH(EC,i);return D.jsx(Lt.div,{id:a.id,...s,ref:n})});RC.displayName=EC;var uh="SelectItem",[dH,AC]=ha(uh),TC=L.forwardRef((e,n)=>{const{__scopeSelect:i,value:s,disabled:a=!1,textValue:f,...d}=e,l=hs(uh,i),u=fs(uh,i),c=l.value===s,[v,m]=L.useState(f??""),[_,x]=L.useState(!1),C=on(n,b=>u.itemRefCallback?.(b,s,a)),S=tg(),p=L.useRef("touch"),g=()=>{a||(l.onValueChange(s),l.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return D.jsx(dH,{scope:i,value:s,disabled:a,textId:S,isSelected:c,onItemTextChange:L.useCallback(b=>{m(y=>y||(b?.textContent??"").trim())},[]),children:D.jsx(Nh.ItemSlot,{scope:i,value:s,disabled:a,textValue:v,children:D.jsx(Lt.div,{role:"option","aria-labelledby":S,"data-highlighted":_?"":void 0,"aria-selected":c&&_,"data-state":c?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...d,ref:C,onFocus:Pt(d.onFocus,()=>x(!0)),onBlur:Pt(d.onBlur,()=>x(!1)),onClick:Pt(d.onClick,()=>{p.current!=="mouse"&&g()}),onPointerUp:Pt(d.onPointerUp,()=>{p.current==="mouse"&&g()}),onPointerDown:Pt(d.onPointerDown,b=>{p.current=b.pointerType}),onPointerMove:Pt(d.onPointerMove,b=>{p.current=b.pointerType,a?u.onItemLeave?.():p.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Pt(d.onPointerLeave,b=>{b.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Pt(d.onKeyDown,b=>{u.searchRef?.current!==""&&b.key===" "||(Z8.includes(b.key)&&g(),b.key===" "&&b.preventDefault())})})})})});TC.displayName=uh;var pl="SelectItemText",MC=L.forwardRef((e,n)=>{const{__scopeSelect:i,className:s,style:a,...f}=e,d=hs(pl,i),l=fs(pl,i),u=AC(pl,i),c=nH(pl,i),[v,m]=L.useState(null),_=on(n,g=>m(g),u.onItemTextChange,g=>l.itemTextRefCallback?.(g,u.value,u.disabled)),x=v?.textContent,C=L.useMemo(()=>D.jsx("option",{value:u.value,disabled:u.disabled,children:x},u.value),[u.disabled,u.value,x]),{onNativeOptionAdd:S,onNativeOptionRemove:p}=c;return On(()=>(S(C),()=>p(C)),[S,p,C]),D.jsxs(D.Fragment,{children:[D.jsx(Lt.span,{id:u.textId,...f,ref:_}),u.isSelected&&d.valueNode&&!d.valueNodeHasChildren?Js.createPortal(f.children,d.valueNode):null]})});MC.displayName=pl;var DC="SelectItemIndicator",OC=L.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e;return AC(DC,i).isSelected?D.jsx(Lt.span,{"aria-hidden":!0,...s,ref:n}):null});OC.displayName=DC;var sp="SelectScrollUpButton",LC=L.forwardRef((e,n)=>{const i=fs(sp,e.__scopeSelect),s=ug(sp,e.__scopeSelect),[a,f]=L.useState(!1),d=on(n,s.onScrollButtonChange);return On(()=>{if(i.viewport&&i.isPositioned){let l=function(){const c=u.scrollTop>0;f(c)};const u=i.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[i.viewport,i.isPositioned]),a?D.jsx(NC,{...e,ref:d,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=i;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});LC.displayName=sp;var op="SelectScrollDownButton",kC=L.forwardRef((e,n)=>{const i=fs(op,e.__scopeSelect),s=ug(op,e.__scopeSelect),[a,f]=L.useState(!1),d=on(n,s.onScrollButtonChange);return On(()=>{if(i.viewport&&i.isPositioned){let l=function(){const c=u.scrollHeight-u.clientHeight,v=Math.ceil(u.scrollTop)<c;f(v)};const u=i.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[i.viewport,i.isPositioned]),a?D.jsx(NC,{...e,ref:d,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=i;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});kC.displayName=op;var NC=L.forwardRef((e,n)=>{const{__scopeSelect:i,onAutoScroll:s,...a}=e,f=fs("SelectScrollButton",i),d=L.useRef(null),l=Bh(i),u=L.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return L.useEffect(()=>()=>u(),[u]),On(()=>{l().find(v=>v.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),D.jsx(Lt.div,{"aria-hidden":!0,...a,ref:n,style:{flexShrink:0,...a.style},onPointerDown:Pt(a.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(s,50))}),onPointerMove:Pt(a.onPointerMove,()=>{f.onItemLeave?.(),d.current===null&&(d.current=window.setInterval(s,50))}),onPointerLeave:Pt(a.onPointerLeave,()=>{u()})})}),mH="SelectSeparator",BC=L.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e;return D.jsx(Lt.div,{"aria-hidden":!0,...s,ref:n})});BC.displayName=mH;var ap="SelectArrow",pH=L.forwardRef((e,n)=>{const{__scopeSelect:i,...s}=e,a=jh(i),f=hs(ap,i),d=fs(ap,i);return f.open&&d.position==="popper"?D.jsx(Qj,{...a,...s,ref:n}):null});pH.displayName=ap;var gH="SelectBubbleInput",jC=L.forwardRef(({__scopeSelect:e,value:n,...i},s)=>{const a=L.useRef(null),f=on(s,a),d=l8(n);return L.useEffect(()=>{const l=a.current;if(!l)return;const u=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(u,"value").set;if(d!==n&&v){const m=new Event("change",{bubbles:!0});v.call(l,n),l.dispatchEvent(m)}},[d,n]),D.jsx(Lt.select,{...i,style:{...nC,...i.style},ref:f,defaultValue:n})});jC.displayName=gH;function HC(e){return e===""||e===void 0}function zC(e){const n=Ws(e),i=L.useRef(""),s=L.useRef(0),a=L.useCallback(d=>{const l=i.current+d;n(l),(function u(c){i.current=c,window.clearTimeout(s.current),c!==""&&(s.current=window.setTimeout(()=>u(""),1e3))})(l)},[n]),f=L.useCallback(()=>{i.current="",window.clearTimeout(s.current)},[]);return L.useEffect(()=>()=>window.clearTimeout(s.current),[]),[i,a,f]}function PC(e,n,i){const a=n.length>1&&Array.from(n).every(c=>c===n[0])?n[0]:n,f=i?e.indexOf(i):-1;let d=vH(e,Math.max(f,0));a.length===1&&(d=d.filter(c=>c!==i));const u=d.find(c=>c.textValue.toLowerCase().startsWith(a.toLowerCase()));return u!==i?u:void 0}function vH(e,n){return e.map((i,s)=>e[(n+s)%e.length])}var _H=fC,IC=mC,yH=gC,bH=vC,SH=_C,UC=yC,xH=wC,FC=RC,$C=TC,wH=MC,CH=OC,VC=LC,qC=kC,WC=BC;const kS=_H,NS=yH,lp=L.forwardRef(({className:e,children:n,...i},s)=>D.jsxs(IC,{ref:s,className:Pe("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...i,children:[n,D.jsx(bH,{asChild:!0,children:D.jsx(E1,{className:"h-4 w-4 opacity-50"})})]}));lp.displayName=IC.displayName;const YC=L.forwardRef(({className:e,...n},i)=>D.jsx(VC,{ref:i,className:Pe("flex cursor-default items-center justify-center py-1",e),...n,children:D.jsx(pB,{className:"h-4 w-4"})}));YC.displayName=VC.displayName;const KC=L.forwardRef(({className:e,...n},i)=>D.jsx(qC,{ref:i,className:Pe("flex cursor-default items-center justify-center py-1",e),...n,children:D.jsx(E1,{className:"h-4 w-4"})}));KC.displayName=qC.displayName;const cp=L.forwardRef(({className:e,children:n,position:i="popper",...s},a)=>D.jsx(SH,{children:D.jsxs(UC,{ref:a,className:Pe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",i==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:i,...s,children:[D.jsx(YC,{}),D.jsx(xH,{className:Pe("p-1",i==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),D.jsx(KC,{})]})}));cp.displayName=UC.displayName;const EH=L.forwardRef(({className:e,...n},i)=>D.jsx(FC,{ref:i,className:Pe("px-2 py-1.5 text-sm font-semibold",e),...n}));EH.displayName=FC.displayName;const gl=L.forwardRef(({className:e,children:n,...i},s)=>D.jsxs($C,{ref:s,className:Pe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...i,children:[D.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:D.jsx(CH,{children:D.jsx(fB,{className:"h-4 w-4"})})}),D.jsx(wH,{children:n})]}));gl.displayName=$C.displayName;const RH=L.forwardRef(({className:e,...n},i)=>D.jsx(WC,{ref:i,className:Pe("-mx-1 my-1 h-px bg-muted",e),...n}));RH.displayName=WC.displayName;const AH={"claude-code":{command:"claude",defaultArgs:[],modeArgs:{normal:[],continue:["-c"],resume:["-r"]},permissionSkipArgs:["--dangerously-skip-permissions"]},"codex-cli":{command:"codex",defaultArgs:["--auto-approve","--verbose"],modeArgs:{normal:[],continue:["resume","--last"],resume:["resume"]}}};function TH({branch:e,availableTools:n,selectedToolId:i,selectedMode:s,skipPermissions:a,extraArgsText:f,isConfigLoading:d,configError:l,isStartingSession:u,isSyncingBranch:c,needsRemoteSync:v,hasBlockingDivergence:m,onToolChange:_,onModeChange:x,onSkipPermissionsChange:C,onExtraArgsChange:S,onStartSession:p,onSyncBranch:g}){const b=!!e.worktreePath,y=n.find(O=>O.id===i),E=L.useMemo(()=>y?y.target==="custom"?{command:y.definition.command,defaultArgs:y.definition.defaultArgs??null,modeArgs:y.definition.modeArgs,permissionSkipArgs:y.definition.permissionSkipArgs??null}:AH[y.id]??null:null,[y]),M=L.useMemo(()=>{if(!E)return null;const O=[];E.defaultArgs?.length&&O.push(...E.defaultArgs);const T=E.modeArgs?.[s];T?.length&&O.push(...T),a&&E.permissionSkipArgs?.length&&O.push(...E.permissionSkipArgs);const A=f.split(/\s+/).map(k=>k.trim()).filter(Boolean);return A.length&&O.push(...A),{command:E.command,args:O}},[E,s,a,f]);return D.jsxs(Yt,{children:[D.jsxs(Mn,{className:"pb-3",children:[D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsxs("div",{children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Tool Launcher"}),D.jsx("h3",{className:"mt-1 text-lg font-semibold",children:"AIツール起動"})]}),l&&D.jsx(vt,{variant:"warning",children:"設定の取得に失敗"})]}),D.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Web UI から直接AIツールを起動できます。設定したカスタムツールも一覧に表示されます。"})]}),D.jsx(Jt,{className:"space-y-4",children:b?D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[D.jsxs("div",{className:"space-y-2",children:[D.jsx("label",{className:"text-sm font-medium",children:"AIツール"}),D.jsxs(kS,{value:i,onValueChange:_,disabled:d??!1,children:[D.jsx(lp,{children:D.jsx(NS,{placeholder:"ツールを選択"})}),D.jsx(cp,{children:n.map(O=>D.jsx(gl,{value:O.id,children:O.label},O.id))})]})]}),D.jsxs("div",{className:"space-y-2",children:[D.jsx("label",{className:"text-sm font-medium",children:"起動モード"}),D.jsxs(kS,{value:s,onValueChange:O=>x(O),children:[D.jsx(lp,{children:D.jsx(NS,{})}),D.jsxs(cp,{children:[D.jsx(gl,{value:"normal",children:"Normal"}),D.jsx(gl,{value:"continue",children:"Continue"}),D.jsx(gl,{value:"resume",children:"Resume"})]})]})]}),D.jsxs("div",{className:"space-y-2 sm:col-span-2 lg:col-span-1",children:[D.jsx("label",{className:"text-sm font-medium",children:"追加引数"}),D.jsx(Ll,{type:"text",value:f,onChange:O=>S(O.target.value),placeholder:"--flag value"})]})]}),D.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[D.jsx("input",{type:"checkbox",checked:a,onChange:O=>C(O.target.checked),className:"h-4 w-4 rounded border-border"}),D.jsx("span",{children:"権限チェックをスキップ (自己責任)"})]}),a&&D.jsx(yi,{variant:"warning",children:D.jsx(bi,{children:"権限チェックをスキップすることで、CLI での `--dangerously-skip-permissions` 指定と同様のリスクを負います。"})}),v&&D.jsx(yi,{variant:"info","data-testid":"sync-required",children:D.jsxs(bi,{children:[D.jsxs("p",{children:["リモートに未取得の更新 (",e.divergence?.behind??0," ","commits) があるため、AIツールを起動する前に同期してください。"]}),D.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"CLI の `git fetch --all` と `git pull --ff-only` と同じ処理を Web UI から実行できます。"})]})}),m&&D.jsx(yi,{variant:"warning","data-testid":"divergence-warning",children:D.jsxs(bi,{children:[D.jsx("p",{children:"リモートとローカルの両方に未解決の差分があるため、起動をブロックしています。"}),D.jsxs("ul",{className:"mt-2 list-inside list-disc text-xs text-muted-foreground",children:[D.jsxs("li",{children:["git fetch && git pull --ff-only origin ",e.name]}),D.jsxs("li",{children:["git push origin ",e.name," でローカル進捗を共有"]})]})]})}),D.jsxs("div",{className:"flex flex-wrap gap-2 pt-2",children:[D.jsx(It,{onClick:p,disabled:u||!y||m||v||c,children:u?"起動中...":"セッションを起動"}),D.jsx(It,{variant:"secondary",onClick:g,disabled:!e.worktreePath||c,children:c?"同期中...":"最新の変更を同期"}),D.jsx(It,{variant:"ghost",asChild:!0,children:D.jsx(pr,{to:"/config",children:"設定を編集"})})]}),E&&D.jsxs("div",{className:"space-y-2 rounded-lg border bg-muted/30 p-4",children:[D.jsxs("div",{className:"grid gap-2 text-sm sm:grid-cols-2",children:[D.jsxs("div",{children:[D.jsx("span",{className:"text-muted-foreground",children:"コマンド:"})," ",D.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono",children:E.command})]}),D.jsxs("div",{children:[D.jsx("span",{className:"text-muted-foreground",children:"defaultArgs:"})," ",D.jsx("span",{className:Pe(!E.defaultArgs?.length&&"text-muted-foreground/50"),children:E.defaultArgs?.join(" ")||"未設定"})]})]}),M&&D.jsxs("div",{className:"border-t pt-2",children:[D.jsx("span",{className:"text-xs text-muted-foreground",children:"最終コマンド:"}),D.jsxs("pre",{className:"mt-1 overflow-x-auto rounded bg-background p-2 font-mono text-sm",children:[M.command," ",M.args.join(" ")]})]})]})]}):D.jsx("p",{className:"py-4 text-center text-sm text-muted-foreground",children:"Worktreeが未作成のため、先にWorktreeを作成してください。"})})]})}function MH(e,n){return e==="claude-code"?"Claude":e==="codex-cli"?"Codex":e==="gemini-cli"?"Gemini":n||"Custom"}function DH(e){const n=e.mode==="normal"?"New":e.mode==="continue"?"Continue":e.mode==="resume"?"Resume":null;return[MH(e.toolId,e.toolLabel),n,e.model].filter(Boolean).join(" | ")}function OH(e){try{return new Intl.DateTimeFormat("ja-JP",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(e))}catch{return"--"}}function LH({branch:e,formattedCommitDate:n,latestToolUsage:i}){return D.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[D.jsxs(Yt,{children:[D.jsxs(Mn,{className:"pb-2",children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Branch Insights"}),D.jsx("h3",{className:"text-lg font-semibold",children:"ブランチインサイト"})]}),D.jsx(Jt,{children:D.jsxs("dl",{className:"grid gap-3 text-sm",children:[D.jsxs("div",{className:"flex justify-between border-b border-border/50 pb-2",children:[D.jsx("dt",{className:"text-muted-foreground",children:"コミット"}),D.jsx("dd",{className:"font-mono text-xs",children:e.commitHash})]}),D.jsxs("div",{className:"flex justify-between border-b border-border/50 pb-2",children:[D.jsx("dt",{className:"text-muted-foreground",children:"Author"}),D.jsx("dd",{children:e.author??"N/A"})]}),D.jsxs("div",{className:"flex justify-between border-b border-border/50 pb-2",children:[D.jsx("dt",{className:"text-muted-foreground",children:"更新日"}),D.jsx("dd",{children:n})]}),D.jsxs("div",{className:"flex justify-between",children:[D.jsx("dt",{className:"text-muted-foreground",children:"Worktree"}),D.jsx("dd",{className:"max-w-[200px] truncate text-right",title:e.worktreePath??void 0,children:e.worktreePath??"未作成"})]})]})})]}),D.jsxs(Yt,{children:[D.jsxs(Mn,{className:"pb-2",children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Latest Commit"}),D.jsx("h3",{className:"text-lg font-semibold",children:"コミット情報"})]}),D.jsx(Jt,{children:D.jsx("p",{className:"text-sm text-muted-foreground",children:e.commitMessage??"コミットメッセージがありません。"})})]}),e.divergence&&D.jsxs(Yt,{children:[D.jsxs(Mn,{className:"pb-2",children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Divergence"}),D.jsx("h3",{className:"text-lg font-semibold",children:"差分状況"})]}),D.jsx(Jt,{children:D.jsxs("div",{className:"flex flex-wrap gap-2",children:[D.jsxs(vt,{variant:"outline",children:["↑ Ahead ",e.divergence.ahead]}),D.jsxs(vt,{variant:"outline",children:["↓ Behind ",e.divergence.behind]}),D.jsx(vt,{variant:e.divergence.upToDate?"success":"warning",children:e.divergence.upToDate?"最新":"更新あり"})]})})]}),D.jsxs(Yt,{children:[D.jsxs(Mn,{className:"pb-2",children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Worktree"}),D.jsx("h3",{className:"text-lg font-semibold",children:"Worktree情報"})]}),D.jsxs(Jt,{className:"space-y-2 text-sm text-muted-foreground",children:[D.jsxs("p",{children:["パス:"," ",D.jsx("strong",{className:"text-foreground",children:e.worktreePath??"未作成"})]}),D.jsxs("ul",{className:"list-inside list-disc space-y-1 text-xs",children:[D.jsx("li",{children:"AIツールの起動にはクリーンなワークツリーであることを推奨"}),D.jsx("li",{children:"Worktree再作成で既存のローカル変更が失われる可能性あり"})]})]})]}),i&&D.jsxs(Yt,{className:"lg:col-span-2",children:[D.jsxs(Mn,{className:"pb-2",children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Last Activity"}),D.jsx("h3",{className:"text-lg font-semibold",children:"最終ツール使用"})]}),D.jsx(Jt,{children:D.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[D.jsx(vt,{variant:"outline",children:DH(i)}),D.jsx("span",{className:"text-muted-foreground",children:OH(i.timestamp)}),i.worktreePath&&D.jsxs("span",{className:"text-xs text-muted-foreground",children:["@ ",i.worktreePath]})]})})]})]})}var Em={exports:{}},BS;function kH(){return BS||(BS=1,(function(e,n){(function(i,s){e.exports=s()})(globalThis,(()=>(()=>{var i={4567:function(d,l,u){var c=this&&this.__decorate||function(g,b,y,E){var M,O=arguments.length,T=O<3?b:E===null?E=Object.getOwnPropertyDescriptor(b,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(g,b,y,E);else for(var A=g.length-1;A>=0;A--)(M=g[A])&&(T=(O<3?M(T):O>3?M(b,y,T):M(b,y))||T);return O>3&&T&&Object.defineProperty(b,y,T),T},v=this&&this.__param||function(g,b){return function(y,E){b(y,E,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const m=u(9042),_=u(9924),x=u(844),C=u(4725),S=u(2585);let p=l.AccessibilityManager=class extends x.Disposable{constructor(g,b,y,E){super(),this._terminal=g,this._coreBrowserService=y,this._renderService=E,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let M=0;M<this._terminal.rows;M++)this._rowElements[M]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[M]);if(this._topBoundaryFocusListener=M=>this._handleBoundaryFocus(M,0),this._bottomBoundaryFocusListener=M=>this._handleBoundaryFocus(M,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((M=>this._handleResize(M.rows)))),this.register(this._terminal.onRender((M=>this._refreshRows(M.start,M.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((M=>this._handleChar(M)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
59
+ `)))),this.register(this._terminal.onA11yTab((M=>this._handleTab(M)))),this.register(this._terminal.onKey((M=>this._handleKey(M.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(g){for(let b=0;b<g;b++)this._handleChar(" ")}_handleChar(g){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==g&&(this._charsToAnnounce+=g):this._charsToAnnounce+=g,g===`
60
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=m.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(g){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(g)||this._charsToConsume.push(g)}_refreshRows(g,b){this._liveRegionDebouncer.refresh(g,b,this._terminal.rows)}_renderRows(g,b){const y=this._terminal.buffer,E=y.lines.length.toString();for(let M=g;M<=b;M++){const O=y.translateBufferLineToString(y.ydisp+M,!0),T=(y.ydisp+M+1).toString(),A=this._rowElements[M];A&&(O.length===0?A.innerText=" ":A.textContent=O,A.setAttribute("aria-posinset",T),A.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(g,b){const y=g.target,E=this._rowElements[b===0?1:this._rowElements.length-2];if(y.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||g.relatedTarget!==E)return;let M,O;if(b===0?(M=y,O=this._rowElements.pop(),this._rowContainer.removeChild(O)):(M=this._rowElements.shift(),O=y,this._rowContainer.removeChild(M)),M.removeEventListener("focus",this._topBoundaryFocusListener),O.removeEventListener("focus",this._bottomBoundaryFocusListener),b===0){const T=this._createAccessibilityTreeNode();this._rowElements.unshift(T),this._rowContainer.insertAdjacentElement("afterbegin",T)}else{const T=this._createAccessibilityTreeNode();this._rowElements.push(T),this._rowContainer.appendChild(T)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),g.preventDefault(),g.stopImmediatePropagation()}_handleResize(g){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);for(;this._rowElements.length>g;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const g=this._coreBrowserService.mainDocument.createElement("div");return g.setAttribute("role","listitem"),g.tabIndex=-1,this._refreshRowDimensions(g),g}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let g=0;g<this._terminal.rows;g++)this._refreshRowDimensions(this._rowElements[g])}}_refreshRowDimensions(g){g.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=p=c([v(1,S.IInstantiationService),v(2,C.ICoreBrowserService),v(3,C.IRenderService)],p)},3614:(d,l)=>{function u(_){return _.replace(/\r?\n/g,"\r")}function c(_,x){return x?"\x1B[200~"+_+"\x1B[201~":_}function v(_,x,C,S){_=c(_=u(_),C.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(_,!0),x.value=""}function m(_,x,C){const S=C.getBoundingClientRect(),p=_.clientX-S.left-10,g=_.clientY-S.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${p}px`,x.style.top=`${g}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=u,l.bracketTextForPaste=c,l.copyHandler=function(_,x){_.clipboardData&&_.clipboardData.setData("text/plain",x.selectionText),_.preventDefault()},l.handlePasteEvent=function(_,x,C,S){_.stopPropagation(),_.clipboardData&&v(_.clipboardData.getData("text/plain"),x,C,S)},l.paste=v,l.moveTextAreaUnderMouseCursor=m,l.rightClickHandler=function(_,x,C,S,p){m(_,x,C),p&&S.rightClickSelect(_),x.value=S.selectionText,x.select()}},7239:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const c=u(1505);l.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(v,m,_){this._css.set(v,m,_)}getCss(v,m){return this._css.get(v,m)}setColor(v,m,_){this._color.set(v,m,_)}getColor(v,m){return this._color.get(v,m)}clear(){this._color.clear(),this._css.clear()}}},3656:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(u,c,v,m){u.addEventListener(c,v,m);let _=!1;return{dispose:()=>{_||(_=!0,u.removeEventListener(c,v,m))}}}},6465:function(d,l,u){var c=this&&this.__decorate||function(p,g,b,y){var E,M=arguments.length,O=M<3?g:y===null?y=Object.getOwnPropertyDescriptor(g,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(p,g,b,y);else for(var T=p.length-1;T>=0;T--)(E=p[T])&&(O=(M<3?E(O):M>3?E(g,b,O):E(g,b))||O);return M>3&&O&&Object.defineProperty(g,b,O),O},v=this&&this.__param||function(p,g){return function(b,y){g(b,y,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier2=void 0;const m=u(3656),_=u(8460),x=u(844),C=u(2585);let S=l.Linkifier2=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(p){super(),this._bufferService=p,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{this._lastMouseEvent=void 0}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0})))}registerLinkProvider(p){return this._linkProviders.push(p),{dispose:()=>{const g=this._linkProviders.indexOf(p);g!==-1&&this._linkProviders.splice(g,1)}}}attachToDom(p,g,b){this._element=p,this._mouseService=g,this._renderService=b,this.register((0,m.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,m.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,m.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,m.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(p){if(this._lastMouseEvent=p,!this._element||!this._mouseService)return;const g=this._positionFromMouseEvent(p,this._element,this._mouseService);if(!g)return;this._isMouseOut=!1;const b=p.composedPath();for(let y=0;y<b.length;y++){const E=b[y];if(E.classList.contains("xterm"))break;if(E.classList.contains("xterm-hover"))return}this._lastBufferCell&&g.x===this._lastBufferCell.x&&g.y===this._lastBufferCell.y||(this._handleHover(g),this._lastBufferCell=g)}_handleHover(p){if(this._activeLine!==p.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(p,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,p)||(this._clearCurrentLink(),this._askForLink(p,!0))}_askForLink(p,g){this._activeProviderReplies&&g||(this._activeProviderReplies?.forEach((y=>{y?.forEach((E=>{E.link.dispose&&E.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=p.y);let b=!1;for(const[y,E]of this._linkProviders.entries())g?this._activeProviderReplies?.get(y)&&(b=this._checkLinkProviderResult(y,p,b)):E.provideLinks(p.y,(M=>{if(this._isMouseOut)return;const O=M?.map((T=>({link:T})));this._activeProviderReplies?.set(y,O),b=this._checkLinkProviderResult(y,p,b),this._activeProviderReplies?.size===this._linkProviders.length&&this._removeIntersectingLinks(p.y,this._activeProviderReplies)}))}_removeIntersectingLinks(p,g){const b=new Set;for(let y=0;y<g.size;y++){const E=g.get(y);if(E)for(let M=0;M<E.length;M++){const O=E[M],T=O.link.range.start.y<p?0:O.link.range.start.x,A=O.link.range.end.y>p?this._bufferService.cols:O.link.range.end.x;for(let k=T;k<=A;k++){if(b.has(k)){E.splice(M--,1);break}b.add(k)}}}}_checkLinkProviderResult(p,g,b){if(!this._activeProviderReplies)return b;const y=this._activeProviderReplies.get(p);let E=!1;for(let M=0;M<p;M++)this._activeProviderReplies.has(M)&&!this._activeProviderReplies.get(M)||(E=!0);if(!E&&y){const M=y.find((O=>this._linkAtPosition(O.link,g)));M&&(b=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviders.length&&!b)for(let M=0;M<this._activeProviderReplies.size;M++){const O=this._activeProviderReplies.get(M)?.find((T=>this._linkAtPosition(T.link,g)));if(O){b=!0,this._handleNewLink(O);break}}return b}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(p){if(!this._element||!this._mouseService||!this._currentLink)return;const g=this._positionFromMouseEvent(p,this._element,this._mouseService);g&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,g)&&this._currentLink.link.activate(p,this._currentLink.link.text)}_clearCurrentLink(p,g){this._element&&this._currentLink&&this._lastMouseEvent&&(!p||!g||this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=g)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(p){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const g=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);g&&this._linkAtPosition(p.link,g)&&(this._currentLink=p,this._currentLink.state={decorations:{underline:p.link.decorations===void 0||p.link.decorations.underline,pointerCursor:p.link.decorations===void 0||p.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,p.link,this._lastMouseEvent),p.link.decorations={},Object.defineProperties(p.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:b=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==b&&(this._currentLink.state.decorations.pointerCursor=b,this._currentLink.state.isHovered&&this._element?.classList.toggle("xterm-cursor-pointer",b))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:b=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==b&&(this._currentLink.state.decorations.underline=b,this._currentLink.state.isHovered&&this._fireUnderlineEvent(p.link,b))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((b=>{if(!this._currentLink)return;const y=b.start===0?0:b.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+b.end;if(this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(y,E),this._lastMouseEvent&&this._element)){const M=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);M&&this._askForLink(M,!1)}}))))}_linkHover(p,g,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!0),this._currentLink.state.decorations.pointerCursor&&p.classList.add("xterm-cursor-pointer")),g.hover&&g.hover(b,g.text)}_fireUnderlineEvent(p,g){const b=p.range,y=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(b.start.x-1,b.start.y-y-1,b.end.x,b.end.y-y-1,void 0);(g?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(p,g,b){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!1),this._currentLink.state.decorations.pointerCursor&&p.classList.remove("xterm-cursor-pointer")),g.leave&&g.leave(b,g.text)}_linkAtPosition(p,g){const b=p.range.start.y*this._bufferService.cols+p.range.start.x,y=p.range.end.y*this._bufferService.cols+p.range.end.x,E=g.y*this._bufferService.cols+g.x;return b<=E&&E<=y}_positionFromMouseEvent(p,g,b){const y=b.getCoords(p,g,this._bufferService.cols,this._bufferService.rows);if(y)return{x:y[0],y:y[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(p,g,b,y,E){return{x1:p,y1:g,x2:b,y2:y,cols:this._bufferService.cols,fg:E}}};l.Linkifier2=S=c([v(0,C.IBufferService)],S)},9042:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(d,l,u){var c=this&&this.__decorate||function(S,p,g,b){var y,E=arguments.length,M=E<3?p:b===null?b=Object.getOwnPropertyDescriptor(p,g):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(S,p,g,b);else for(var O=S.length-1;O>=0;O--)(y=S[O])&&(M=(E<3?y(M):E>3?y(p,g,M):y(p,g))||M);return E>3&&M&&Object.defineProperty(p,g,M),M},v=this&&this.__param||function(S,p){return function(g,b){p(g,b,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const m=u(511),_=u(2585);let x=l.OscLinkProvider=class{constructor(S,p,g){this._bufferService=S,this._optionsService=p,this._oscLinkService=g}provideLinks(S,p){const g=this._bufferService.buffer.lines.get(S-1);if(!g)return void p(void 0);const b=[],y=this._optionsService.rawOptions.linkHandler,E=new m.CellData,M=g.getTrimmedLength();let O=-1,T=-1,A=!1;for(let k=0;k<M;k++)if(T!==-1||g.hasContent(k)){if(g.loadCell(k,E),E.hasExtendedAttrs()&&E.extended.urlId){if(T===-1){T=k,O=E.extended.urlId;continue}A=E.extended.urlId!==O}else T!==-1&&(A=!0);if(A||T!==-1&&k===M-1){const q=this._oscLinkService.getLinkData(O)?.uri;if(q){const z={start:{x:T+1,y:S},end:{x:k+(A||k!==M-1?0:1),y:S}};let I=!1;if(!y?.allowNonHttpProtocols)try{const W=new URL(q);["http:","https:"].includes(W.protocol)||(I=!0)}catch{I=!0}I||b.push({text:q,range:z,activate:(W,U)=>y?y.activate(W,U,z):C(0,U),hover:(W,U)=>y?.hover?.(W,U,z),leave:(W,U)=>y?.leave?.(W,U,z)})}A=!1,E.hasExtendedAttrs()&&E.extended.urlId?(T=k,O=E.extended.urlId):(T=-1,O=-1)}}p(b)}};function C(S,p){if(confirm(`Do you want to navigate to ${p}?
61
+
62
+ WARNING: This link could potentially be dangerous`)){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=x=c([v(0,_.IBufferService),v(1,_.IOptionsService),v(2,_.IOscLinkService)],x)},6193:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(u,c){this._parentWindow=u,this._renderCallback=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,c,v){this._rowCount=v,u=u!==void 0?u:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const c=u(3614),v=u(3656),m=u(6465),_=u(9042),x=u(3730),C=u(1680),S=u(3107),p=u(5744),g=u(2950),b=u(1296),y=u(428),E=u(4269),M=u(5114),O=u(8934),T=u(3230),A=u(9312),k=u(4725),q=u(6731),z=u(8055),I=u(8969),W=u(8460),U=u(844),G=u(6114),H=u(8437),K=u(2584),F=u(7399),N=u(5941),$=u(9074),B=u(2585),P=u(5435),Q=u(4567);class J extends I.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Z={}){super(Z),this.browser=G,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new U.MutableDisposable),this._onCursorMove=this.register(new W.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new W.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new W.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new W.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new W.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new W.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new W.EventEmitter),this._onBlur=this.register(new W.EventEmitter),this._onA11yCharEmitter=this.register(new W.EventEmitter),this._onA11yTabEmitter=this.register(new W.EventEmitter),this._onWillOpen=this.register(new W.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(m.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance($.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((X,V)=>this.refresh(X,V)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((X=>this._reportWindowsOptions(X)))),this.register(this._inputHandler.onColor((X=>this._handleColorEvent(X)))),this.register((0,W.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,W.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,W.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,W.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((X=>this._afterResize(X.cols,X.rows)))),this.register((0,U.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(Z){if(this._themeService)for(const X of Z){let V,ie="";switch(X.index){case 256:V="foreground",ie="10";break;case 257:V="background",ie="11";break;case 258:V="cursor",ie="12";break;default:V="ansi",ie="4;"+X.index}switch(X.type){case 0:const de=z.color.toColorRGB(V==="ansi"?this._themeService.colors.ansi[X.index]:this._themeService.colors[V]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${ie};${(0,N.toRgbString)(de)}${K.C1_ESCAPED.ST}`);break;case 1:if(V==="ansi")this._themeService.modifyColors((re=>re.ansi[X.index]=z.rgba.toColor(...X.color)));else{const re=V;this._themeService.modifyColors((le=>le[re]=z.rgba.toColor(...X.color)))}break;case 2:this._themeService.restoreColor(X.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Z){Z?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Z){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.C0.ESC+"[I"),this.updateCursorStyle(Z),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Z=this.buffer.ybase+this.buffer.y,X=this.buffer.lines.get(Z);if(!X)return;const V=Math.min(this.buffer.x,this.cols-1),ie=this._renderService.dimensions.css.cell.height,de=X.getWidth(V),re=this._renderService.dimensions.css.cell.width*de,le=this.buffer.y*this._renderService.dimensions.css.cell.height,_e=V*this._renderService.dimensions.css.cell.width;this.textarea.style.left=_e+"px",this.textarea.style.top=le+"px",this.textarea.style.width=re+"px",this.textarea.style.height=ie+"px",this.textarea.style.lineHeight=ie+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,v.addDisposableDomListener)(this.element,"copy",(X=>{this.hasSelection()&&(0,c.copyHandler)(X,this._selectionService)})));const Z=X=>(0,c.handlePasteEvent)(X,this.textarea,this.coreService,this.optionsService);this.register((0,v.addDisposableDomListener)(this.textarea,"paste",Z)),this.register((0,v.addDisposableDomListener)(this.element,"paste",Z)),G.isFirefox?this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(X=>{X.button===2&&(0,c.rightClickHandler)(X,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,v.addDisposableDomListener)(this.element,"contextmenu",(X=>{(0,c.rightClickHandler)(X,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),G.isLinux&&this.register((0,v.addDisposableDomListener)(this.element,"auxclick",(X=>{X.button===1&&(0,c.moveTextAreaUnderMouseCursor)(X,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,v.addDisposableDomListener)(this.textarea,"keyup",(Z=>this._keyUp(Z)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keydown",(Z=>this._keyDown(Z)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"keypress",(Z=>this._keyPress(Z)),!0)),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionupdate",(Z=>this._compositionHelper.compositionupdate(Z)))),this.register((0,v.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,v.addDisposableDomListener)(this.textarea,"input",(Z=>this._inputEvent(Z)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Z){if(!Z)throw new Error("Terminal requires a parent element.");if(Z.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Z.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),Z.appendChild(this.element);const X=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),X.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),X.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),G.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(M.CoreBrowserService,this.textarea,Z.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(k.ICoreBrowserService,this._coreBrowserService),this.register((0,v.addDisposableDomListener)(this.textarea,"focus",(V=>this._handleTextAreaFocus(V)))),this.register((0,v.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(q.ThemeService),this._instantiationService.setService(k.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(k.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(k.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((V=>this._onRender.fire(V)))),this.onResize((V=>this._renderService.resize(V.cols,V.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(g.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(X);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(O.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((V=>this.scrollLines(V.amount,V.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(A.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(k.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((V=>this.scrollLines(V.amount,V.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((V=>this._renderService.handleSelectionChanged(V.start,V.end,V.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((V=>{this.textarea.value=V,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((V=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,v.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,v.addDisposableDomListener)(this.element,"mousedown",(V=>this._selectionService.handleMouseDown(V)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Q.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(V=>this._handleScreenReaderModeOptionChange(V)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(p.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(V=>{!this._overviewRulerRenderer&&V&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(p.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(b.DomRenderer,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier2)}bindMouse(){const Z=this,X=this.element;function V(re){const le=Z._mouseService.getMouseReportCoords(re,Z.screenElement);if(!le)return!1;let _e,Ce;switch(re.overrideType||re.type){case"mousemove":Ce=32,re.buttons===void 0?(_e=3,re.button!==void 0&&(_e=re.button<3?re.button:3)):_e=1&re.buttons?0:4&re.buttons?1:2&re.buttons?2:3;break;case"mouseup":Ce=0,_e=re.button<3?re.button:3;break;case"mousedown":Ce=1,_e=re.button<3?re.button:3;break;case"wheel":if(Z.viewport.getLinesScrolled(re)===0)return!1;Ce=re.deltaY<0?0:1,_e=4;break;default:return!1}return!(Ce===void 0||_e===void 0||_e>4)&&Z.coreMouseService.triggerMouseEvent({col:le.col,row:le.row,x:le.x,y:le.y,button:_e,action:Ce,ctrl:re.ctrlKey,alt:re.altKey,shift:re.shiftKey})}const ie={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de={mouseup:re=>(V(re),re.buttons||(this._document.removeEventListener("mouseup",ie.mouseup),ie.mousedrag&&this._document.removeEventListener("mousemove",ie.mousedrag)),this.cancel(re)),wheel:re=>(V(re),this.cancel(re,!0)),mousedrag:re=>{re.buttons&&V(re)},mousemove:re=>{re.buttons||V(re)}};this.register(this.coreMouseService.onProtocolChange((re=>{re?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(re)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&re?ie.mousemove||(X.addEventListener("mousemove",de.mousemove),ie.mousemove=de.mousemove):(X.removeEventListener("mousemove",ie.mousemove),ie.mousemove=null),16&re?ie.wheel||(X.addEventListener("wheel",de.wheel,{passive:!1}),ie.wheel=de.wheel):(X.removeEventListener("wheel",ie.wheel),ie.wheel=null),2&re?ie.mouseup||(ie.mouseup=de.mouseup):(this._document.removeEventListener("mouseup",ie.mouseup),ie.mouseup=null),4&re?ie.mousedrag||(ie.mousedrag=de.mousedrag):(this._document.removeEventListener("mousemove",ie.mousedrag),ie.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,v.addDisposableDomListener)(X,"mousedown",(re=>{if(re.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(re))return V(re),ie.mouseup&&this._document.addEventListener("mouseup",ie.mouseup),ie.mousedrag&&this._document.addEventListener("mousemove",ie.mousedrag),this.cancel(re)}))),this.register((0,v.addDisposableDomListener)(X,"wheel",(re=>{if(!ie.wheel){if(!this.buffer.hasScrollback){const le=this.viewport.getLinesScrolled(re);if(le===0)return;const _e=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(re.deltaY<0?"A":"B");let Ce="";for(let He=0;He<Math.abs(le);He++)Ce+=_e;return this.coreService.triggerDataEvent(Ce,!0),this.cancel(re,!0)}return this.viewport.handleWheel(re)?this.cancel(re):void 0}}),{passive:!1})),this.register((0,v.addDisposableDomListener)(X,"touchstart",(re=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(re),this.cancel(re)}),{passive:!0})),this.register((0,v.addDisposableDomListener)(X,"touchmove",(re=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(re)?void 0:this.cancel(re)}),{passive:!1}))}refresh(Z,X){this._renderService?.refreshRows(Z,X)}updateCursorStyle(Z){this._selectionService?.shouldColumnSelect(Z)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(Z,X,V=0){V===1?(super.scrollLines(Z,X,V),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(Z)}paste(Z){(0,c.paste)(Z,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Z){this._customKeyEventHandler=Z}registerLinkProvider(Z){return this.linkifier2.registerLinkProvider(Z)}registerCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const X=this._characterJoinerService.register(Z);return this.refresh(0,this.rows-1),X}deregisterCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Z)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Z){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Z)}registerDecoration(Z){return this._decorationService.registerDecoration(Z)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Z,X,V){this._selectionService.setSelection(Z,X,V)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(Z,X){this._selectionService?.selectLines(Z,X)}_keyDown(Z){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;const X=this.browser.isMac&&this.options.macOptionIsMeta&&Z.altKey;if(!X&&!this._compositionHelper.keydown(Z))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;X||Z.key!=="Dead"&&Z.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const V=(0,F.evaluateKeyboardEvent)(Z,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Z),V.type===3||V.type===2){const ie=this.rows-1;return this.scrollLines(V.type===2?-ie:ie),this.cancel(Z,!0)}return V.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Z)||(V.cancel&&this.cancel(Z,!0),!V.key||!!(Z.key&&!Z.ctrlKey&&!Z.altKey&&!Z.metaKey&&Z.key.length===1&&Z.key.charCodeAt(0)>=65&&Z.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(V.key!==K.C0.ETX&&V.key!==K.C0.CR||(this.textarea.value=""),this._onKey.fire({key:V.key,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(V.key,!0),!this.optionsService.rawOptions.screenReaderMode||Z.altKey||Z.ctrlKey?this.cancel(Z,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Z,X){const V=Z.isMac&&!this.options.macOptionIsMeta&&X.altKey&&!X.ctrlKey&&!X.metaKey||Z.isWindows&&X.altKey&&X.ctrlKey&&!X.metaKey||Z.isWindows&&X.getModifierState("AltGraph");return X.type==="keypress"?V:V&&(!X.keyCode||X.keyCode>47)}_keyUp(Z){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1||((function(X){return X.keyCode===16||X.keyCode===17||X.keyCode===18})(Z)||this.focus(),this.updateCursorStyle(Z),this._keyPressHandled=!1)}_keyPress(Z){let X;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;if(this.cancel(Z),Z.charCode)X=Z.charCode;else if(Z.which===null||Z.which===void 0)X=Z.keyCode;else{if(Z.which===0||Z.charCode===0)return!1;X=Z.which}return!(!X||(Z.altKey||Z.ctrlKey||Z.metaKey)&&!this._isThirdLevelShift(this.browser,Z)||(X=String.fromCharCode(X),this._onKey.fire({key:X,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(X,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Z){if(Z.data&&Z.inputType==="insertText"&&(!Z.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const X=Z.data;return this.coreService.triggerDataEvent(X,!0),this.cancel(Z),!0}return!1}resize(Z,X){Z!==this.cols||X!==this.rows?super.resize(Z,X):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Z,X){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let Z=1;Z<this.rows;Z++)this.buffer.lines.push(this.buffer.getBlankLine(H.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const Z=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=Z,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(Z){if(this._renderService)switch(Z){case P.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const X=this._renderService.dimensions.css.canvas.width.toFixed(0),V=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${V};${X}t`);break;case P.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ie=this._renderService.dimensions.css.cell.width.toFixed(0),de=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${de};${ie}t`)}}cancel(Z,X){if(this.options.cancelEvents||X)return Z.preventDefault(),Z.stopPropagation(),!1}}l.Terminal=J},9924:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(u,c=1e3){this._renderCallback=u,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,c,v){this._rowCount=v,u=u!==void 0?u:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const m=Date.now();if(m-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=m,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=m-this._lastRefreshMs,x=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,c)}}},1680:function(d,l,u){var c=this&&this.__decorate||function(g,b,y,E){var M,O=arguments.length,T=O<3?b:E===null?E=Object.getOwnPropertyDescriptor(b,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(g,b,y,E);else for(var A=g.length-1;A>=0;A--)(M=g[A])&&(T=(O<3?M(T):O>3?M(b,y,T):M(b,y))||T);return O>3&&T&&Object.defineProperty(b,y,T),T},v=this&&this.__param||function(g,b){return function(y,E){b(y,E,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const m=u(3656),_=u(4725),x=u(8460),C=u(844),S=u(2585);let p=l.Viewport=class extends C.Disposable{constructor(g,b,y,E,M,O,T,A){super(),this._viewportElement=g,this._scrollArea=b,this._bufferService=y,this._optionsService=E,this._charSizeService=M,this._renderService=O,this._coreBrowserService=T,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((k=>this._activeBuffer=k.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((k=>this._renderDimensions=k))),this._handleThemeChange(A.colors),this.register(A.onChangeColors((k=>this._handleThemeChange(k)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(g){this._viewportElement.style.backgroundColor=g.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(g){if(g)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const b=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==b&&(this._lastRecordedBufferHeight=b,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const g=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==g&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=g),this._refreshAnimationFrame=null}syncScrollArea(g=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(g);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(g)}_handleScroll(g){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const b=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:b,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const g=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(g*(this._smoothScrollState.target-this._smoothScrollState.origin)),g<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(g,b){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(b<0&&this._viewportElement.scrollTop!==0||b>0&&y<this._lastRecordedBufferHeight)||(g.cancelable&&g.preventDefault(),!1)}handleWheel(g){const b=this._getPixelsScrolled(g);return b!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+b:this._smoothScrollState.target+=b,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=b,this._bubbleScroll(g,b))}scrollLines(g){if(g!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const b=g*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+b,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!1})}_getPixelsScrolled(g){if(g.deltaY===0||g.shiftKey)return 0;let b=this._applyScrollModifier(g.deltaY,g);return g.deltaMode===WheelEvent.DOM_DELTA_LINE?b*=this._currentRowHeight:g.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(b*=this._currentRowHeight*this._bufferService.rows),b}getBufferElements(g,b){let y,E="";const M=[],O=b??this._bufferService.buffer.lines.length,T=this._bufferService.buffer.lines;for(let A=g;A<O;A++){const k=T.get(A);if(!k)continue;const q=T.get(A+1)?.isWrapped;if(E+=k.translateToString(!q),!q||A===T.length-1){const z=document.createElement("div");z.textContent=E,M.push(z),E.length>0&&(y=z),E=""}}return{bufferElements:M,cursorElement:y}}getLinesScrolled(g){if(g.deltaY===0||g.shiftKey)return 0;let b=this._applyScrollModifier(g.deltaY,g);return g.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(b/=this._currentRowHeight+0,this._wheelPartialScroll+=b,b=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):g.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(b*=this._bufferService.rows),b}_applyScrollModifier(g,b){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&b.altKey||y==="ctrl"&&b.ctrlKey||y==="shift"&&b.shiftKey?g*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:g*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(g){this._lastTouchY=g.touches[0].pageY}handleTouchMove(g){const b=this._lastTouchY-g.touches[0].pageY;return this._lastTouchY=g.touches[0].pageY,b!==0&&(this._viewportElement.scrollTop+=b,this._bubbleScroll(g,b))}};l.Viewport=p=c([v(2,S.IBufferService),v(3,S.IOptionsService),v(4,_.ICharSizeService),v(5,_.IRenderService),v(6,_.ICoreBrowserService),v(7,_.IThemeService)],p)},3107:function(d,l,u){var c=this&&this.__decorate||function(S,p,g,b){var y,E=arguments.length,M=E<3?p:b===null?b=Object.getOwnPropertyDescriptor(p,g):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(S,p,g,b);else for(var O=S.length-1;O>=0;O--)(y=S[O])&&(M=(E<3?y(M):E>3?y(p,g,M):y(p,g))||M);return E>3&&M&&Object.defineProperty(p,g,M),M},v=this&&this.__param||function(S,p){return function(g,b){p(g,b,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const m=u(4725),_=u(844),x=u(2585);let C=l.BufferDecorationRenderer=class extends _.Disposable{constructor(S,p,g,b,y){super(),this._screenElement=S,this._bufferService=p,this._coreBrowserService=g,this._decorationService=b,this._renderService=y,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((E=>this._removeDecoration(E)))),this.register((0,_.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const S of this._decorationService.decorations)this._renderDecoration(S);this._dimensionsChanged=!1}_renderDecoration(S){this._refreshStyle(S),this._dimensionsChanged&&this._refreshXPosition(S)}_createElement(S){const p=this._coreBrowserService.mainDocument.createElement("div");p.classList.add("xterm-decoration"),p.classList.toggle("xterm-decoration-top-layer",S?.options?.layer==="top"),p.style.width=`${Math.round((S.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,p.style.height=(S.options.height||1)*this._renderService.dimensions.css.cell.height+"px",p.style.top=(S.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",p.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const g=S.options.x??0;return g&&g>this._bufferService.cols&&(p.style.display="none"),this._refreshXPosition(S,p),p}_refreshStyle(S){const p=S.marker.line-this._bufferService.buffers.active.ydisp;if(p<0||p>=this._bufferService.rows)S.element&&(S.element.style.display="none",S.onRenderEmitter.fire(S.element));else{let g=this._decorationElements.get(S);g||(g=this._createElement(S),S.element=g,this._decorationElements.set(S,g),this._container.appendChild(g),S.onDispose((()=>{this._decorationElements.delete(S),g.remove()}))),g.style.top=p*this._renderService.dimensions.css.cell.height+"px",g.style.display=this._altBufferIsActive?"none":"block",S.onRenderEmitter.fire(g)}}_refreshXPosition(S,p=S.element){if(!p)return;const g=S.options.x??0;(S.options.anchor||"left")==="right"?p.style.right=g?g*this._renderService.dimensions.css.cell.width+"px":"":p.style.left=g?g*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(S){this._decorationElements.get(S)?.remove(),this._decorationElements.delete(S),S.dispose()}};l.BufferDecorationRenderer=C=c([v(1,x.IBufferService),v(2,m.ICoreBrowserService),v(3,x.IDecorationService),v(4,m.IRenderService)],C)},5871:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const c of this._zones)if(c.color===u.options.overviewRulerOptions.color&&c.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,u.marker.line))return;if(this._lineAdjacentToZone(c,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(c,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,c){return c>=u.startBufferLine&&c<=u.endBufferLine}_lineAdjacentToZone(u,c,v){return c>=u.startBufferLine-this._linePadding[v||"full"]&&c<=u.endBufferLine+this._linePadding[v||"full"]}_addLineToZone(u,c){u.startBufferLine=Math.min(u.startBufferLine,c),u.endBufferLine=Math.max(u.endBufferLine,c)}}},5744:function(d,l,u){var c=this&&this.__decorate||function(y,E,M,O){var T,A=arguments.length,k=A<3?E:O===null?O=Object.getOwnPropertyDescriptor(E,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(y,E,M,O);else for(var q=y.length-1;q>=0;q--)(T=y[q])&&(k=(A<3?T(k):A>3?T(E,M,k):T(E,M))||k);return A>3&&k&&Object.defineProperty(E,M,k),k},v=this&&this.__param||function(y,E){return function(M,O){E(M,O,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const m=u(5871),_=u(4725),x=u(844),C=u(2585),S={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0},g={full:0,left:0,center:0,right:0};let b=l.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,E,M,O,T,A,k){super(),this._viewportElement=y,this._screenElement=E,this._bufferService=M,this._decorationService=O,this._renderService=T,this._optionsService=A,this._coreBrowserService=k,this._colorZoneStore=new m.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const q=this._canvas.getContext("2d");if(!q)throw new Error("Ctx cannot be null");this._ctx=q,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const y=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);p.full=this._canvas.width,p.left=y,p.center=E,p.right=y,this._refreshDrawHeightConstants(),g.full=0,g.left=0,g.center=p.left,g.right=p.left+p.center}_refreshDrawHeightConstants(){S.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);S.left=E,S.center=E,S.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const E of y)E.position!=="full"&&this._renderColorZone(E);for(const E of y)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(g[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-S[y.position||"full"]/2),p[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+S[y.position||"full"]))}_queueRefresh(y,E){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=b=c([v(2,C.IBufferService),v(3,C.IDecorationService),v(4,_.IRenderService),v(5,C.IOptionsService),v(6,_.ICoreBrowserService)],b)},2950:function(d,l,u){var c=this&&this.__decorate||function(S,p,g,b){var y,E=arguments.length,M=E<3?p:b===null?b=Object.getOwnPropertyDescriptor(p,g):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(S,p,g,b);else for(var O=S.length-1;O>=0;O--)(y=S[O])&&(M=(E<3?y(M):E>3?y(p,g,M):y(p,g))||M);return E>3&&M&&Object.defineProperty(p,g,M),M},v=this&&this.__param||function(S,p){return function(g,b){p(g,b,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const m=u(4725),_=u(2585),x=u(2584);let C=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,p,g,b,y,E){this._textarea=S,this._compositionView=p,this._bufferService=g,this._optionsService=b,this._coreService=y,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(S){this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(S){if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){const p={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let g;this._isSendingComposition=!1,p.start+=this._dataAlreadySent.length,g=this._isComposing?this._textarea.value.substring(p.start,p.end):this._textarea.value.substring(p.start),g.length>0&&this._coreService.triggerDataEvent(g,!0)}}),0)}else{this._isSendingComposition=!1;const p=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(p,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const p=this._textarea.value,g=p.replace(S,"");this._dataAlreadySent=g,p.length>S.length?this._coreService.triggerDataEvent(g,!0):p.length<S.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):p.length===S.length&&p!==S&&this._coreService.triggerDataEvent(p,!0)}}),0)}updateCompositionElements(S){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const p=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),g=this._renderService.dimensions.css.cell.height,b=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=p*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=b+"px",this._compositionView.style.height=g+"px",this._compositionView.style.lineHeight=g+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=b+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}S||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=C=c([v(2,_.IBufferService),v(3,_.IOptionsService),v(4,_.ICoreService),v(5,m.IRenderService)],C)},9806:(d,l)=>{function u(c,v,m){const _=m.getBoundingClientRect(),x=c.getComputedStyle(m),C=parseInt(x.getPropertyValue("padding-left")),S=parseInt(x.getPropertyValue("padding-top"));return[v.clientX-_.left-C,v.clientY-_.top-S]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=u,l.getCoords=function(c,v,m,_,x,C,S,p,g){if(!C)return;const b=u(c,v,m);return b?(b[0]=Math.ceil((b[0]+(g?S/2:0))/S),b[1]=Math.ceil(b[1]/p),b[0]=Math.min(Math.max(b[0],1),_+(g?1:0)),b[1]=Math.min(Math.max(b[1],1),x),b):void 0}},9504:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const c=u(2584);function v(p,g,b,y){const E=p-m(p,b),M=g-m(g,b),O=Math.abs(E-M)-(function(T,A,k){let q=0;const z=T-m(T,k),I=A-m(A,k);for(let W=0;W<Math.abs(z-I);W++){const U=_(T,A)==="A"?-1:1;k.buffer.lines.get(z+U*W)?.isWrapped&&q++}return q})(p,g,b);return S(O,C(_(p,g),y))}function m(p,g){let b=0,y=g.buffer.lines.get(p),E=y?.isWrapped;for(;E&&p>=0&&p<g.rows;)b++,y=g.buffer.lines.get(--p),E=y?.isWrapped;return b}function _(p,g){return p>g?"A":"B"}function x(p,g,b,y,E,M){let O=p,T=g,A="";for(;O!==b||T!==y;)O+=E?1:-1,E&&O>M.cols-1?(A+=M.buffer.translateBufferLineToString(T,!1,p,O),O=0,p=0,T++):!E&&O<0&&(A+=M.buffer.translateBufferLineToString(T,!1,0,p+1),O=M.cols-1,p=O,T--);return A+M.buffer.translateBufferLineToString(T,!1,p,O)}function C(p,g){const b=g?"O":"[";return c.C0.ESC+b+p}function S(p,g){p=Math.floor(p);let b="";for(let y=0;y<p;y++)b+=g;return b}l.moveToCellSequence=function(p,g,b,y){const E=b.buffer.x,M=b.buffer.y;if(!b.buffer.hasScrollback)return(function(A,k,q,z,I,W){return v(k,z,I,W).length===0?"":S(x(A,k,A,k-m(k,I),!1,I).length,C("D",W))})(E,M,0,g,b,y)+v(M,g,b,y)+(function(A,k,q,z,I,W){let U;U=v(k,z,I,W).length>0?z-m(z,I):k;const G=z,H=(function(K,F,N,$,B,P){let Q;return Q=v(N,$,B,P).length>0?$-m($,B):F,K<N&&Q<=$||K>=N&&Q<$?"C":"D"})(A,k,q,z,I,W);return S(x(A,U,q,G,H==="C",I).length,C(H,W))})(E,M,p,g,b,y);let O;if(M===g)return O=E>p?"D":"C",S(Math.abs(E-p),C(O,y));O=M>g?"D":"C";const T=Math.abs(M-g);return S((function(A,k){return k.cols-A})(M>g?p:E,b)+(T-1)*b.cols+1+((M>g?E:p)-1),C(O,y))}},1296:function(d,l,u){var c=this&&this.__decorate||function(I,W,U,G){var H,K=arguments.length,F=K<3?W:G===null?G=Object.getOwnPropertyDescriptor(W,U):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(I,W,U,G);else for(var N=I.length-1;N>=0;N--)(H=I[N])&&(F=(K<3?H(F):K>3?H(W,U,F):H(W,U))||F);return K>3&&F&&Object.defineProperty(W,U,F),F},v=this&&this.__param||function(I,W){return function(U,G){W(U,G,I)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const m=u(3787),_=u(2550),x=u(2223),C=u(6171),S=u(4725),p=u(8055),g=u(8460),b=u(844),y=u(2585),E="xterm-dom-renderer-owner-",M="xterm-rows",O="xterm-fg-",T="xterm-bg-",A="xterm-focus",k="xterm-selection";let q=1,z=l.DomRenderer=class extends b.Disposable{constructor(I,W,U,G,H,K,F,N,$,B,P,Q){super(),this._document=I,this._element=W,this._screenElement=U,this._viewportElement=G,this._helperContainer=H,this._linkifier2=K,this._charSizeService=N,this._optionsService=$,this._bufferService=B,this._coreBrowserService=P,this._themeService=Q,this._terminalClass=q++,this._rowElements=[],this.onRequestRedraw=this.register(new g.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(M),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(k),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((J=>this._injectCss(J)))),this._injectCss(this._themeService.colors),this._rowFactory=F.createInstance(m.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((J=>this._handleLinkHover(J)))),this.register(this._linkifier2.onHideLinkUnderline((J=>this._handleLinkLeave(J)))),this.register((0,b.toDisposable)((()=>{this._element.classList.remove(E+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new _.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const I=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*I,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*I),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/I),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/I),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const U of this._rowElements)U.style.width=`${this.dimensions.css.canvas.width}px`,U.style.height=`${this.dimensions.css.cell.height}px`,U.style.lineHeight=`${this.dimensions.css.cell.height}px`,U.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const W=`${this._terminalSelector} .${M} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=W,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(I){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let W=`${this._terminalSelector} .${M} { color: ${I.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;W+=`${this._terminalSelector} .${M} .xterm-dim { color: ${p.color.multiplyOpacity(I.foreground,.5).css};}`,W+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`,W+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",W+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css}; } 50% { background-color: inherit; color: ${I.cursor.css}; }}`,W+=`${this._terminalSelector} .${M}.${A} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${M}.${A} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-block { background-color: ${I.cursor.css} !important; color: ${I.cursorAccent.css} !important;}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${I.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${I.cursor.css} inset;}${this._terminalSelector} .${M} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${I.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,W+=`${this._terminalSelector} .${k} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${k} div { position: absolute; background-color: ${I.selectionBackgroundOpaque.css};}${this._terminalSelector} .${k} div { position: absolute; background-color: ${I.selectionInactiveBackgroundOpaque.css};}`;for(const[U,G]of I.ansi.entries())W+=`${this._terminalSelector} .${O}${U} { color: ${G.css}; }${this._terminalSelector} .${O}${U}.xterm-dim { color: ${p.color.multiplyOpacity(G,.5).css}; }${this._terminalSelector} .${T}${U} { background-color: ${G.css}; }`;W+=`${this._terminalSelector} .${O}${x.INVERTED_DEFAULT_COLOR} { color: ${p.color.opaque(I.background).css}; }${this._terminalSelector} .${O}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${p.color.multiplyOpacity(p.color.opaque(I.background),.5).css}; }${this._terminalSelector} .${T}${x.INVERTED_DEFAULT_COLOR} { background-color: ${I.foreground.css}; }`,this._themeStyleElement.textContent=W}_setDefaultSpacing(){const I=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${I}px`,this._rowFactory.defaultSpacing=I}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(I,W){for(let U=this._rowElements.length;U<=W;U++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>W;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(I,W){this._refreshRowElements(I,W),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(A),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(A),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(I,W,U){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(I,W,U),this.renderRows(0,this._bufferService.rows-1),!I||!W)return;const G=I[1]-this._bufferService.buffer.ydisp,H=W[1]-this._bufferService.buffer.ydisp,K=Math.max(G,0),F=Math.min(H,this._bufferService.rows-1);if(K>=this._bufferService.rows||F<0)return;const N=this._document.createDocumentFragment();if(U){const $=I[0]>W[0];N.appendChild(this._createSelectionElement(K,$?W[0]:I[0],$?I[0]:W[0],F-K+1))}else{const $=G===K?I[0]:0,B=K===H?W[0]:this._bufferService.cols;N.appendChild(this._createSelectionElement(K,$,B));const P=F-K-1;if(N.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,P)),K!==F){const Q=H===F?W[0]:this._bufferService.cols;N.appendChild(this._createSelectionElement(F,0,Q))}}this._selectionContainer.appendChild(N)}_createSelectionElement(I,W,U,G=1){const H=this._document.createElement("div");return H.style.height=G*this.dimensions.css.cell.height+"px",H.style.top=I*this.dimensions.css.cell.height+"px",H.style.left=W*this.dimensions.css.cell.width+"px",H.style.width=this.dimensions.css.cell.width*(U-W)+"px",H}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const I of this._rowElements)I.replaceChildren()}renderRows(I,W){const U=this._bufferService.buffer,G=U.ybase+U.y,H=Math.min(U.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,F=this._optionsService.rawOptions.cursorStyle,N=this._optionsService.rawOptions.cursorInactiveStyle;for(let $=I;$<=W;$++){const B=$+U.ydisp,P=this._rowElements[$],Q=U.lines.get(B);if(!P||!Q)break;P.replaceChildren(...this._rowFactory.createRow(Q,B,B===G,F,N,H,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!0)}_handleLinkLeave(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!1)}_setCellUnderline(I,W,U,G,H,K){U<0&&(I=0),G<0&&(W=0);const F=this._bufferService.rows-1;U=Math.max(Math.min(U,F),0),G=Math.max(Math.min(G,F),0),H=Math.min(H,this._bufferService.cols);const N=this._bufferService.buffer,$=N.ybase+N.y,B=Math.min(N.x,H-1),P=this._optionsService.rawOptions.cursorBlink,Q=this._optionsService.rawOptions.cursorStyle,J=this._optionsService.rawOptions.cursorInactiveStyle;for(let ae=U;ae<=G;++ae){const Z=ae+N.ydisp,X=this._rowElements[ae],V=N.lines.get(Z);if(!X||!V)break;X.replaceChildren(...this._rowFactory.createRow(V,Z,Z===$,Q,J,B,P,this.dimensions.css.cell.width,this._widthCache,K?ae===U?I:0:-1,K?(ae===G?W:H)-1:-1))}}};l.DomRenderer=z=c([v(6,y.IInstantiationService),v(7,S.ICharSizeService),v(8,y.IOptionsService),v(9,y.IBufferService),v(10,S.ICoreBrowserService),v(11,S.IThemeService)],z)},3787:function(d,l,u){var c=this&&this.__decorate||function(O,T,A,k){var q,z=arguments.length,I=z<3?T:k===null?k=Object.getOwnPropertyDescriptor(T,A):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(O,T,A,k);else for(var W=O.length-1;W>=0;W--)(q=O[W])&&(I=(z<3?q(I):z>3?q(T,A,I):q(T,A))||I);return z>3&&I&&Object.defineProperty(T,A,I),I},v=this&&this.__param||function(O,T){return function(A,k){T(A,k,O)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const m=u(2223),_=u(643),x=u(511),C=u(2585),S=u(8055),p=u(4725),g=u(4269),b=u(6171),y=u(3734);let E=l.DomRendererRowFactory=class{constructor(O,T,A,k,q,z,I){this._document=O,this._characterJoinerService=T,this._optionsService=A,this._coreBrowserService=k,this._coreService=q,this._decorationService=z,this._themeService=I,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(O,T,A){this._selectionStart=O,this._selectionEnd=T,this._columnSelectMode=A}createRow(O,T,A,k,q,z,I,W,U,G,H){const K=[],F=this._characterJoinerService.getJoinedCharacters(T),N=this._themeService.colors;let $,B=O.getNoBgTrimmedLength();A&&B<z+1&&(B=z+1);let P=0,Q="",J=0,ae=0,Z=0,X=!1,V=0,ie=!1,de=0;const re=[],le=G!==-1&&H!==-1;for(let _e=0;_e<B;_e++){O.loadCell(_e,this._workCell);let Ce=this._workCell.getWidth();if(Ce===0)continue;let He=!1,Be=_e,we=this._workCell;if(F.length>0&&_e===F[0][0]){He=!0;const st=F.shift();we=new g.JoinedCellData(this._workCell,O.translateToString(!0,st[0],st[1]),st[1]-st[0]),Be=st[1]-1,Ce=we.getWidth()}const Ft=this._isCellInSelection(_e,T),kt=A&&_e===z,en=le&&_e>=G&&_e<=H;let hn=!1;this._decorationService.forEachDecorationAtCell(_e,T,void 0,(st=>{hn=!0}));let yn=we.getChars()||_.WHITESPACE_CELL_CHAR;if(yn===" "&&(we.isUnderline()||we.isOverline())&&(yn=" "),de=Ce*W-U.get(yn,we.isBold(),we.isItalic()),$){if(P&&(Ft&&ie||!Ft&&!ie&&we.bg===J)&&(Ft&&ie&&N.selectionForeground||we.fg===ae)&&we.extended.ext===Z&&en===X&&de===V&&!kt&&!He&&!hn){we.isInvisible()?Q+=_.WHITESPACE_CELL_CHAR:Q+=yn,P++;continue}P&&($.textContent=Q),$=this._document.createElement("span"),P=0,Q=""}else $=this._document.createElement("span");if(J=we.bg,ae=we.fg,Z=we.extended.ext,X=en,V=de,ie=Ft,He&&z>=_e&&z<=Be&&(z=_e),!this._coreService.isCursorHidden&&kt&&this._coreService.isCursorInitialized){if(re.push("xterm-cursor"),this._coreBrowserService.isFocused)I&&re.push("xterm-cursor-blink"),re.push(k==="bar"?"xterm-cursor-bar":k==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(q)switch(q){case"outline":re.push("xterm-cursor-outline");break;case"block":re.push("xterm-cursor-block");break;case"bar":re.push("xterm-cursor-bar");break;case"underline":re.push("xterm-cursor-underline")}}if(we.isBold()&&re.push("xterm-bold"),we.isItalic()&&re.push("xterm-italic"),we.isDim()&&re.push("xterm-dim"),Q=we.isInvisible()?_.WHITESPACE_CELL_CHAR:we.getChars()||_.WHITESPACE_CELL_CHAR,we.isUnderline()&&(re.push(`xterm-underline-${we.extended.underlineStyle}`),Q===" "&&(Q=" "),!we.isUnderlineColorDefault()))if(we.isUnderlineColorRGB())$.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(we.getUnderlineColor()).join(",")})`;else{let st=we.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&we.isBold()&&st<8&&(st+=8),$.style.textDecorationColor=N.ansi[st].css}we.isOverline()&&(re.push("xterm-overline"),Q===" "&&(Q=" ")),we.isStrikethrough()&&re.push("xterm-strikethrough"),en&&($.style.textDecoration="underline");let Rt=we.getFgColor(),it=we.getFgColorMode(),Et=we.getBgColor(),Kt=we.getBgColorMode();const an=!!we.isInverse();if(an){const st=Rt;Rt=Et,Et=st;const or=it;it=Kt,Kt=or}let gt,Gt,Xt,sr=!1;switch(this._decorationService.forEachDecorationAtCell(_e,T,void 0,(st=>{st.options.layer!=="top"&&sr||(st.backgroundColorRGB&&(Kt=50331648,Et=st.backgroundColorRGB.rgba>>8&16777215,gt=st.backgroundColorRGB),st.foregroundColorRGB&&(it=50331648,Rt=st.foregroundColorRGB.rgba>>8&16777215,Gt=st.foregroundColorRGB),sr=st.options.layer==="top")})),!sr&&Ft&&(gt=this._coreBrowserService.isFocused?N.selectionBackgroundOpaque:N.selectionInactiveBackgroundOpaque,Et=gt.rgba>>8&16777215,Kt=50331648,sr=!0,N.selectionForeground&&(it=50331648,Rt=N.selectionForeground.rgba>>8&16777215,Gt=N.selectionForeground)),sr&&re.push("xterm-decoration-top"),Kt){case 16777216:case 33554432:Xt=N.ansi[Et],re.push(`xterm-bg-${Et}`);break;case 50331648:Xt=S.rgba.toColor(Et>>16,Et>>8&255,255&Et),this._addStyle($,`background-color:#${M((Et>>>0).toString(16),"0",6)}`);break;default:an?(Xt=N.foreground,re.push(`xterm-bg-${m.INVERTED_DEFAULT_COLOR}`)):Xt=N.background}switch(gt||we.isDim()&&(gt=S.color.multiplyOpacity(Xt,.5)),it){case 16777216:case 33554432:we.isBold()&&Rt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Rt+=8),this._applyMinimumContrast($,Xt,N.ansi[Rt],we,gt,void 0)||re.push(`xterm-fg-${Rt}`);break;case 50331648:const st=S.rgba.toColor(Rt>>16&255,Rt>>8&255,255&Rt);this._applyMinimumContrast($,Xt,st,we,gt,Gt)||this._addStyle($,`color:#${M(Rt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast($,Xt,N.foreground,we,gt,Gt)||an&&re.push(`xterm-fg-${m.INVERTED_DEFAULT_COLOR}`)}re.length&&($.className=re.join(" "),re.length=0),kt||He||hn?$.textContent=Q:P++,de!==this.defaultSpacing&&($.style.letterSpacing=`${de}px`),K.push($),_e=Be}return $&&P&&($.textContent=Q),K}_applyMinimumContrast(O,T,A,k,q,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,b.excludeFromContrastRatioDemands)(k.getCode()))return!1;const I=this._getContrastCache(k);let W;if(q||z||(W=I.getColor(T.rgba,A.rgba)),W===void 0){const U=this._optionsService.rawOptions.minimumContrastRatio/(k.isDim()?2:1);W=S.color.ensureContrastRatio(q||T,z||A,U),I.setColor((q||T).rgba,(z||A).rgba,W??null)}return!!W&&(this._addStyle(O,`color:${W.css}`),!0)}_getContrastCache(O){return O.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(O,T){O.setAttribute("style",`${O.getAttribute("style")||""}${T};`)}_isCellInSelection(O,T){const A=this._selectionStart,k=this._selectionEnd;return!(!A||!k)&&(this._columnSelectMode?A[0]<=k[0]?O>=A[0]&&T>=A[1]&&O<k[0]&&T<=k[1]:O<A[0]&&T>=A[1]&&O>=k[0]&&T<=k[1]:T>A[1]&&T<k[1]||A[1]===k[1]&&T===A[1]&&O>=A[0]&&O<k[0]||A[1]<k[1]&&T===k[1]&&O<k[0]||A[1]<k[1]&&T===A[1]&&O>=A[0])}};function M(O,T,A){for(;O.length<A;)O=T+O;return O}l.DomRendererRowFactory=E=c([v(1,p.ICharacterJoinerService),v(2,C.IOptionsService),v(3,p.ICoreBrowserService),v(4,C.ICoreService),v(5,C.IDecorationService),v(6,p.IThemeService)],E)},2550:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(u,c){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const v=u.createElement("span");v.classList.add("xterm-char-measure-element");const m=u.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold";const _=u.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const x=u.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[v,m,_,x],this._container.appendChild(v),this._container.appendChild(m),this._container.appendChild(_),this._container.appendChild(x),c.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(u,c,v,m){u===this._font&&c===this._fontSize&&v===this._weight&&m===this._weightBold||(this._font=u,this._fontSize=c,this._weight=v,this._weightBold=m,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${v}`,this._measureElements[1].style.fontWeight=`${m}`,this._measureElements[2].style.fontWeight=`${v}`,this._measureElements[3].style.fontWeight=`${m}`,this.clear())}get(u,c,v){let m=0;if(!c&&!v&&u.length===1&&(m=u.charCodeAt(0))<256)return this._flat[m]!==-9999?this._flat[m]:this._flat[m]=this._measure(u,0);let _=u;c&&(_+="B"),v&&(_+="I");let x=this._holey.get(_);if(x===void 0){let C=0;c&&(C|=1),v&&(C|=2),x=this._measure(u,C),this._holey.set(_,x)}return x}_measure(u,c){const v=this._measureElements[c];return v.textContent=u.repeat(32),v.offsetWidth/32}}},2223:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const c=u(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(d,l)=>{function u(c){return 57508<=c&&c<=57558}Object.defineProperty(l,"__esModule",{value:!0}),l.createRenderDimensions=l.excludeFromContrastRatioDemands=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},l.isPowerlineGlyph=u,l.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},l.excludeFromContrastRatioDemands=function(c){return u(c)||(function(v){return 9472<=v&&v<=9631})(c)},l.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,c=this.selectionEnd;return!(!u||!c)&&(u[1]>c[1]||u[1]===c[1]&&u[0]>c[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(d,l,u){var c=this&&this.__decorate||function(p,g,b,y){var E,M=arguments.length,O=M<3?g:y===null?y=Object.getOwnPropertyDescriptor(g,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(p,g,b,y);else for(var T=p.length-1;T>=0;T--)(E=p[T])&&(O=(M<3?E(O):M>3?E(g,b,O):E(g,b))||O);return M>3&&O&&Object.defineProperty(g,b,O),O},v=this&&this.__param||function(p,g){return function(b,y){g(b,y,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const m=u(2585),_=u(8460),x=u(844);let C=l.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(p,g,b){super(),this._optionsService=b,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new S(p,g,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const p=this._measureStrategy.measure();p.width===this.width&&p.height===this.height||(this.width=p.width,this.height=p.height,this._onCharSizeChange.fire())}};l.CharSizeService=C=c([v(2,m.IOptionsService)],C);class S{constructor(g,b,y){this._document=g,this._parentElement=b,this._optionsService=y,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const g={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return g.width!==0&&g.height!==0&&(this._result.width=g.width/32,this._result.height=Math.ceil(g.height)),this._result}}},4269:function(d,l,u){var c=this&&this.__decorate||function(g,b,y,E){var M,O=arguments.length,T=O<3?b:E===null?E=Object.getOwnPropertyDescriptor(b,y):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(g,b,y,E);else for(var A=g.length-1;A>=0;A--)(M=g[A])&&(T=(O<3?M(T):O>3?M(b,y,T):M(b,y))||T);return O>3&&T&&Object.defineProperty(b,y,T),T},v=this&&this.__param||function(g,b){return function(y,E){b(y,E,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const m=u(3734),_=u(643),x=u(511),C=u(2585);class S extends m.AttributeData{constructor(b,y,E){super(),this.content=0,this.combinedData="",this.fg=b.fg,this.bg=b.bg,this.combinedData=y,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(b){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=S;let p=l.CharacterJoinerService=class GC{constructor(b){this._bufferService=b,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(b){const y={id:this._nextCharacterJoinerId++,handler:b};return this._characterJoiners.push(y),y.id}deregister(b){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===b)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(b){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(b);if(!y||y.length===0)return[];const E=[],M=y.translateToString(!0);let O=0,T=0,A=0,k=y.getFg(0),q=y.getBg(0);for(let z=0;z<y.getTrimmedLength();z++)if(y.loadCell(z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==q){if(z-O>1){const I=this._getJoinedRanges(M,A,T,y,O);for(let W=0;W<I.length;W++)E.push(I[W])}O=z,A=T,k=this._workCell.fg,q=this._workCell.bg}T+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-O>1){const z=this._getJoinedRanges(M,A,T,y,O);for(let I=0;I<z.length;I++)E.push(z[I])}return E}_getJoinedRanges(b,y,E,M,O){const T=b.substring(y,E);let A=[];try{A=this._characterJoiners[0].handler(T)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const q=this._characterJoiners[k].handler(T);for(let z=0;z<q.length;z++)GC._mergeRanges(A,q[z])}catch(q){console.error(q)}return this._stringRangesToCellRanges(A,M,O),A}_stringRangesToCellRanges(b,y,E){let M=0,O=!1,T=0,A=b[M];if(A){for(let k=E;k<this._bufferService.cols;k++){const q=y.getWidth(k),z=y.getString(k).length||_.WHITESPACE_CELL_CHAR.length;if(q!==0){if(!O&&A[0]<=T&&(A[0]=k,O=!0),A[1]<=T){if(A[1]=k,A=b[++M],!A)break;A[0]<=T?(A[0]=k,O=!0):O=!1}T+=z}}A&&(A[1]=this._bufferService.cols)}}static _mergeRanges(b,y){let E=!1;for(let M=0;M<b.length;M++){const O=b[M];if(E){if(y[1]<=O[0])return b[M-1][1]=y[1],b;if(y[1]<=O[1])return b[M-1][1]=Math.max(y[1],O[1]),b.splice(M,1),b;b.splice(M,1),M--}else{if(y[1]<=O[0])return b.splice(M,0,y),b;if(y[1]<=O[1])return O[0]=Math.min(y[0],O[0]),b;y[0]<O[1]&&(O[0]=Math.min(y[0],O[0]),E=!0)}}return E?b[b.length-1][1]=y[1]:b.push(y),b}};l.CharacterJoinerService=p=c([v(0,C.IBufferService)],p)},5114:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const c=u(844),v=u(8460),m=u(3656);class _ extends c.Disposable{constructor(S,p,g){super(),this._textarea=S,this._window=p,this.mainDocument=g,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(this._window),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new v.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((b=>this._screenDprMonitor.setWindow(b)))),this.register((0,v.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(S){this._window!==S&&(this._window=S,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}l.CoreBrowserService=_;class x extends c.Disposable{constructor(S){super(),this._parentWindow=S,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new v.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,c.toDisposable)((()=>this.clearListener())))}setWindow(S){this._parentWindow=S,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,m.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},8934:function(d,l,u){var c=this&&this.__decorate||function(C,S,p,g){var b,y=arguments.length,E=y<3?S:g===null?g=Object.getOwnPropertyDescriptor(S,p):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(C,S,p,g);else for(var M=C.length-1;M>=0;M--)(b=C[M])&&(E=(y<3?b(E):y>3?b(S,p,E):b(S,p))||E);return y>3&&E&&Object.defineProperty(S,p,E),E},v=this&&this.__param||function(C,S){return function(p,g){S(p,g,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const m=u(4725),_=u(9806);let x=l.MouseService=class{constructor(C,S){this._renderService=C,this._charSizeService=S}getCoords(C,S,p,g,b){return(0,_.getCoords)(window,C,S,p,g,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,b)}getMouseReportCoords(C,S){const p=(0,_.getCoordsRelativeToElement)(window,C,S);if(this._charSizeService.hasValidSize)return p[0]=Math.min(Math.max(p[0],0),this._renderService.dimensions.css.canvas.width-1),p[1]=Math.min(Math.max(p[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(p[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(p[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(p[0]),y:Math.floor(p[1])}}};l.MouseService=x=c([v(0,m.IRenderService),v(1,m.ICharSizeService)],x)},3230:function(d,l,u){var c=this&&this.__decorate||function(b,y,E,M){var O,T=arguments.length,A=T<3?y:M===null?M=Object.getOwnPropertyDescriptor(y,E):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(b,y,E,M);else for(var k=b.length-1;k>=0;k--)(O=b[k])&&(A=(T<3?O(A):T>3?O(y,E,A):O(y,E))||A);return T>3&&A&&Object.defineProperty(y,E,A),A},v=this&&this.__param||function(b,y){return function(E,M){y(E,M,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const m=u(6193),_=u(4725),x=u(8460),C=u(844),S=u(7226),p=u(2585);let g=l.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(b,y,E,M,O,T,A,k,q){if(super(),this._rowCount=b,this._charSizeService=M,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new S.DebouncedIdleTask,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new m.RenderDebouncer(A.window,((z,I)=>this._renderRows(z,I))),this.register(this._renderDebouncer),this.register(A.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(O.onDecorationRegistered((()=>this._fullRefresh()))),this.register(O.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],(()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(q.onChangeColors((()=>this._fullRefresh()))),"IntersectionObserver"in A.window){const z=new A.window.IntersectionObserver((I=>this._handleIntersectionChange(I[I.length-1])),{threshold:0});z.observe(y),this.register({dispose:()=>z.disconnect()})}}_handleIntersectionChange(b){this._isPaused=b.isIntersecting===void 0?b.intersectionRatio===0:!b.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(b,y,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(b,y,this._rowCount))}_renderRows(b,y){this._renderer.value&&(b=Math.min(b,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(b,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:b,end:y}),this._onRender.fire({start:b,end:y}),this._isNextRenderRedrawOnly=!0)}resize(b,y){this._rowCount=y,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(b){this._renderer.value=b,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(b){return this._renderDebouncer.addRefreshCallback(b)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(b,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value.handleResize(b,y))):this._renderer.value.handleResize(b,y),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(b,y,E){this._selectionState.start=b,this._selectionState.end=y,this._selectionState.columnSelectMode=E,this._renderer.value?.handleSelectionChanged(b,y,E)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};l.RenderService=g=c([v(2,p.IOptionsService),v(3,_.ICharSizeService),v(4,p.IDecorationService),v(5,p.IBufferService),v(6,_.ICoreBrowserService),v(7,p.IInstantiationService),v(8,_.IThemeService)],g)},9312:function(d,l,u){var c=this&&this.__decorate||function(A,k,q,z){var I,W=arguments.length,U=W<3?k:z===null?z=Object.getOwnPropertyDescriptor(k,q):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(A,k,q,z);else for(var G=A.length-1;G>=0;G--)(I=A[G])&&(U=(W<3?I(U):W>3?I(k,q,U):I(k,q))||U);return W>3&&U&&Object.defineProperty(k,q,U),U},v=this&&this.__param||function(A,k){return function(q,z){k(q,z,A)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const m=u(9806),_=u(9504),x=u(456),C=u(4725),S=u(8460),p=u(844),g=u(6114),b=u(4841),y=u(511),E=u(2585),M=" ",O=new RegExp(M,"g");let T=l.SelectionService=class extends p.Disposable{constructor(A,k,q,z,I,W,U,G,H){super(),this._element=A,this._screenElement=k,this._linkifier=q,this._bufferService=z,this._coreService=I,this._mouseService=W,this._optionsService=U,this._renderService=G,this._coreBrowserService=H,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new S.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new S.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new S.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=K=>this._handleMouseMove(K),this._mouseUpListener=K=>this._handleMouseUp(K),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((K=>this._handleTrim(K))),this.register(this._bufferService.buffers.onBufferActivate((K=>this._handleBufferActivate(K)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,p.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const A=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!A||!k||A[0]===k[0]&&A[1]===k[1])}get selectionText(){const A=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;if(!A||!k)return"";const q=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(A[0]===k[0])return"";const I=A[0]<k[0]?A[0]:k[0],W=A[0]<k[0]?k[0]:A[0];for(let U=A[1];U<=k[1];U++){const G=q.translateBufferLineToString(U,!0,I,W);z.push(G)}}else{const I=A[1]===k[1]?k[0]:void 0;z.push(q.translateBufferLineToString(A[1],!0,A[0],I));for(let W=A[1]+1;W<=k[1]-1;W++){const U=q.lines.get(W),G=q.translateBufferLineToString(W,!0);U?.isWrapped?z[z.length-1]+=G:z.push(G)}if(A[1]!==k[1]){const W=q.lines.get(k[1]),U=q.translateBufferLineToString(k[1],!0,0,k[0]);W&&W.isWrapped?z[z.length-1]+=U:z.push(U)}}return z.map((I=>I.replace(O," "))).join(g.isWindows?`\r
63
+ `:`
64
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(A){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),g.isLinux&&A&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(A){const k=this._getMouseBufferCoords(A),q=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(q&&z&&k)&&this._areCoordsInSelection(k,q,z)}isCellInSelection(A,k){const q=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!q||!z)&&this._areCoordsInSelection([A,k],q,z)}_areCoordsInSelection(A,k,q){return A[1]>k[1]&&A[1]<q[1]||k[1]===q[1]&&A[1]===k[1]&&A[0]>=k[0]&&A[0]<q[0]||k[1]<q[1]&&A[1]===q[1]&&A[0]<q[0]||k[1]<q[1]&&A[1]===k[1]&&A[0]>=k[0]}_selectWordAtCursor(A,k){const q=this._linkifier.currentLink?.link?.range;if(q)return this._model.selectionStart=[q.start.x-1,q.start.y-1],this._model.selectionStartLength=(0,b.getRangeLength)(q,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const z=this._getMouseBufferCoords(A);return!!z&&(this._selectWordAt(z,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(A,k){this._model.clearSelection(),A=Math.max(A,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,A],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(A){this._model.handleTrim(A)&&this.refresh()}_getMouseBufferCoords(A){const k=this._mouseService.getCoords(A,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(A){let k=(0,m.getCoordsRelativeToElement)(this._coreBrowserService.window,A,this._screenElement)[1];const q=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=q?0:(k>q&&(k-=q),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}shouldForceSelection(A){return g.isMac?A.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:A.shiftKey}handleMouseDown(A){if(this._mouseDownTimeStamp=A.timeStamp,(A.button!==2||!this.hasSelection)&&A.button===0){if(!this._enabled){if(!this.shouldForceSelection(A))return;A.stopPropagation()}A.preventDefault(),this._dragScrollAmount=0,this._enabled&&A.shiftKey?this._handleIncrementalClick(A):A.detail===1?this._handleSingleClick(A):A.detail===2?this._handleDoubleClick(A):A.detail===3&&this._handleTripleClick(A),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(A){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(A))}_handleSingleClick(A){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(A)?3:0,this._model.selectionStart=this._getMouseBufferCoords(A),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const k=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);k&&k.length!==this._model.selectionStart[0]&&k.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(A){this._selectWordAtCursor(A,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(A){const k=this._getMouseBufferCoords(A);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(A){return A.altKey&&!(g.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(A){if(A.stopImmediatePropagation(),!this._model.selectionStart)return;const k=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(A),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(A),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const q=this._bufferService.buffer;if(this._model.selectionEnd[1]<q.lines.length){const z=q.lines.get(this._model.selectionEnd[1]);z&&z.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}k&&k[0]===this._model.selectionEnd[0]&&k[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const A=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(A.ydisp+this._bufferService.rows,A.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=A.ydisp),this.refresh()}}_handleMouseUp(A){const k=A.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<500&&A.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const q=this._mouseService.getCoords(A,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(q&&q[0]!==void 0&&q[1]!==void 0){const z=(0,_.moveToCellSequence)(q[0]-1,q[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const A=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,q=!(!A||!k||A[0]===k[0]&&A[1]===k[1]);q?A&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&A[0]===this._oldSelectionStart[0]&&A[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(A,k,q)):this._oldHasSelection&&this._fireOnSelectionChange(A,k,q)}_fireOnSelectionChange(A,k,q){this._oldSelectionStart=A,this._oldSelectionEnd=k,this._oldHasSelection=q,this._onSelectionChange.fire()}_handleBufferActivate(A){this.clearSelection(),this._trimListener.dispose(),this._trimListener=A.activeBuffer.lines.onTrim((k=>this._handleTrim(k)))}_convertViewportColToCharacterIndex(A,k){let q=k;for(let z=0;k>=z;z++){const I=A.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?q--:I>1&&k!==z&&(q+=I-1)}return q}setSelection(A,k,q){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[A,k],this._model.selectionStartLength=q,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(A){this._isClickInSelection(A)||(this._selectWordAtCursor(A,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(A,k,q=!0,z=!0){if(A[0]>=this._bufferService.cols)return;const I=this._bufferService.buffer,W=I.lines.get(A[1]);if(!W)return;const U=I.translateBufferLineToString(A[1],!1);let G=this._convertViewportColToCharacterIndex(W,A[0]),H=G;const K=A[0]-G;let F=0,N=0,$=0,B=0;if(U.charAt(G)===" "){for(;G>0&&U.charAt(G-1)===" ";)G--;for(;H<U.length&&U.charAt(H+1)===" ";)H++}else{let J=A[0],ae=A[0];W.getWidth(J)===0&&(F++,J--),W.getWidth(ae)===2&&(N++,ae++);const Z=W.getString(ae).length;for(Z>1&&(B+=Z-1,H+=Z-1);J>0&&G>0&&!this._isCharWordSeparator(W.loadCell(J-1,this._workCell));){W.loadCell(J-1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===0?(F++,J--):X>1&&($+=X-1,G-=X-1),G--,J--}for(;ae<W.length&&H+1<U.length&&!this._isCharWordSeparator(W.loadCell(ae+1,this._workCell));){W.loadCell(ae+1,this._workCell);const X=this._workCell.getChars().length;this._workCell.getWidth()===2?(N++,ae++):X>1&&(B+=X-1,H+=X-1),H++,ae++}}H++;let P=G+K-F+$,Q=Math.min(this._bufferService.cols,H-G+F+N-$-B);if(k||U.slice(G,H).trim()!==""){if(q&&P===0&&W.getCodePoint(0)!==32){const J=I.lines.get(A[1]-1);if(J&&W.isWrapped&&J.getCodePoint(this._bufferService.cols-1)!==32){const ae=this._getWordAt([this._bufferService.cols-1,A[1]-1],!1,!0,!1);if(ae){const Z=this._bufferService.cols-ae.start;P-=Z,Q+=Z}}}if(z&&P+Q===this._bufferService.cols&&W.getCodePoint(this._bufferService.cols-1)!==32){const J=I.lines.get(A[1]+1);if(J?.isWrapped&&J.getCodePoint(0)!==32){const ae=this._getWordAt([0,A[1]+1],!1,!1,!0);ae&&(Q+=ae.length)}}return{start:P,length:Q}}}_selectWordAt(A,k){const q=this._getWordAt(A,k);if(q){for(;q.start<0;)q.start+=this._bufferService.cols,A[1]--;this._model.selectionStart=[q.start,A[1]],this._model.selectionStartLength=q.length}}_selectToWordAt(A){const k=this._getWordAt(A,!0);if(k){let q=A[1];for(;k.start<0;)k.start+=this._bufferService.cols,q--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,q++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,q]}}_isCharWordSeparator(A){return A.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(A.getChars())>=0}_selectLineAt(A){const k=this._bufferService.buffer.getWrappedRangeForLine(A),q={start:{x:0,y:k.first},end:{x:this._bufferService.cols-1,y:k.last}};this._model.selectionStart=[0,k.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,b.getRangeLength)(q,this._bufferService.cols)}};l.SelectionService=T=c([v(3,E.IBufferService),v(4,E.ICoreService),v(5,C.IMouseService),v(6,E.IOptionsService),v(7,C.IRenderService),v(8,C.ICoreBrowserService)],T)},4725:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const c=u(8343);l.ICharSizeService=(0,c.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),l.IMouseService=(0,c.createDecorator)("MouseService"),l.IRenderService=(0,c.createDecorator)("RenderService"),l.ISelectionService=(0,c.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,c.createDecorator)("ThemeService")},6731:function(d,l,u){var c=this&&this.__decorate||function(T,A,k,q){var z,I=arguments.length,W=I<3?A:q===null?q=Object.getOwnPropertyDescriptor(A,k):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(T,A,k,q);else for(var U=T.length-1;U>=0;U--)(z=T[U])&&(W=(I<3?z(W):I>3?z(A,k,W):z(A,k))||W);return I>3&&W&&Object.defineProperty(A,k,W),W},v=this&&this.__param||function(T,A){return function(k,q){A(k,q,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const m=u(7239),_=u(8055),x=u(8460),C=u(844),S=u(2585),p=_.css.toColor("#ffffff"),g=_.css.toColor("#000000"),b=_.css.toColor("#ffffff"),y=_.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],A=[0,95,135,175,215,255];for(let k=0;k<216;k++){const q=A[k/36%6|0],z=A[k/6%6|0],I=A[k%6];T.push({css:_.channels.toCss(q,z,I),rgba:_.channels.toRgba(q,z,I)})}for(let k=0;k<24;k++){const q=8+10*k;T.push({css:_.channels.toCss(q,q,q),rgba:_.channels.toRgba(q,q,q)})}return T})());let M=l.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new m.ColorContrastCache,this._halfContrastCache=new m.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:p,background:g,cursor:b,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:_.color.blend(g,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:_.color.blend(g,E),ansi:l.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const A=this._colors;if(A.foreground=O(T.foreground,p),A.background=O(T.background,g),A.cursor=O(T.cursor,b),A.cursorAccent=O(T.cursorAccent,y),A.selectionBackgroundTransparent=O(T.selectionBackground,E),A.selectionBackgroundOpaque=_.color.blend(A.background,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundTransparent=O(T.selectionInactiveBackground,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundOpaque=_.color.blend(A.background,A.selectionInactiveBackgroundTransparent),A.selectionForeground=T.selectionForeground?O(T.selectionForeground,_.NULL_COLOR):void 0,A.selectionForeground===_.NULL_COLOR&&(A.selectionForeground=void 0),_.color.isOpaque(A.selectionBackgroundTransparent)&&(A.selectionBackgroundTransparent=_.color.opacity(A.selectionBackgroundTransparent,.3)),_.color.isOpaque(A.selectionInactiveBackgroundTransparent)&&(A.selectionInactiveBackgroundTransparent=_.color.opacity(A.selectionInactiveBackgroundTransparent,.3)),A.ansi=l.DEFAULT_ANSI_COLORS.slice(),A.ansi[0]=O(T.black,l.DEFAULT_ANSI_COLORS[0]),A.ansi[1]=O(T.red,l.DEFAULT_ANSI_COLORS[1]),A.ansi[2]=O(T.green,l.DEFAULT_ANSI_COLORS[2]),A.ansi[3]=O(T.yellow,l.DEFAULT_ANSI_COLORS[3]),A.ansi[4]=O(T.blue,l.DEFAULT_ANSI_COLORS[4]),A.ansi[5]=O(T.magenta,l.DEFAULT_ANSI_COLORS[5]),A.ansi[6]=O(T.cyan,l.DEFAULT_ANSI_COLORS[6]),A.ansi[7]=O(T.white,l.DEFAULT_ANSI_COLORS[7]),A.ansi[8]=O(T.brightBlack,l.DEFAULT_ANSI_COLORS[8]),A.ansi[9]=O(T.brightRed,l.DEFAULT_ANSI_COLORS[9]),A.ansi[10]=O(T.brightGreen,l.DEFAULT_ANSI_COLORS[10]),A.ansi[11]=O(T.brightYellow,l.DEFAULT_ANSI_COLORS[11]),A.ansi[12]=O(T.brightBlue,l.DEFAULT_ANSI_COLORS[12]),A.ansi[13]=O(T.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),A.ansi[14]=O(T.brightCyan,l.DEFAULT_ANSI_COLORS[14]),A.ansi[15]=O(T.brightWhite,l.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const k=Math.min(A.ansi.length-16,T.extendedAnsi.length);for(let q=0;q<k;q++)A.ansi[q+16]=O(T.extendedAnsi[q],l.DEFAULT_ANSI_COLORS[q+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(T){this._restoreColor(T),this._onChangeColors.fire(this.colors)}_restoreColor(T){if(T!==void 0)switch(T){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[T]=this._restoreColors.ansi[T]}else for(let A=0;A<this._restoreColors.ansi.length;++A)this._colors.ansi[A]=this._restoreColors.ansi[A]}modifyColors(T){T(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function O(T,A){if(T!==void 0)try{return _.css.toColor(T)}catch{}return A}l.ThemeService=M=c([v(0,S.IOptionsService)],M)},6349:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const c=u(8460),v=u(844);class m extends v.Disposable{constructor(x){super(),this._maxLength=x,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(x){if(this._maxLength===x)return;const C=new Array(x);for(let S=0;S<Math.min(x,this.length);S++)C[S]=this._array[this._getCyclicIndex(S)];this._array=C,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let C=this._length;C<x;C++)this._array[C]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,C){this._array[this._getCyclicIndex(x)]=C}push(x){this._array[this._getCyclicIndex(this._length)]=x,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(x,C,...S){if(C){for(let p=x;p<this._length-C;p++)this._array[this._getCyclicIndex(p)]=this._array[this._getCyclicIndex(p+C)];this._length-=C,this.onDeleteEmitter.fire({index:x,amount:C})}for(let p=this._length-1;p>=x;p--)this._array[this._getCyclicIndex(p+S.length)]=this._array[this._getCyclicIndex(p)];for(let p=0;p<S.length;p++)this._array[this._getCyclicIndex(x+p)]=S[p];if(S.length&&this.onInsertEmitter.fire({index:x,amount:S.length}),this._length+S.length>this._maxLength){const p=this._length+S.length-this._maxLength;this._startIndex+=p,this._length=this._maxLength,this.onTrimEmitter.fire(p)}else this._length+=S.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,C,S){if(!(C<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let g=C-1;g>=0;g--)this.set(x+g+S,this.get(x+g));const p=x+C+S-this._length;if(p>0)for(this._length+=p;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let p=0;p<C;p++)this.set(x+p+S,this.get(x+p))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}l.CircularList=m},1439:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function u(c,v=5){if(typeof c!="object")return c;const m=Array.isArray(c)?[]:{};for(const _ in c)m[_]=v<=1?c[_]:c[_]&&u(c[_],v-1);return m}},8055:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;const c=u(6114);let v=0,m=0,_=0,x=0;var C,S,p,g,b;function y(M){const O=M.toString(16);return O.length<2?"0"+O:O}function E(M,O){return M<O?(O+.05)/(M+.05):(M+.05)/(O+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(M){M.toCss=function(O,T,A,k){return k!==void 0?`#${y(O)}${y(T)}${y(A)}${y(k)}`:`#${y(O)}${y(T)}${y(A)}`},M.toRgba=function(O,T,A,k=255){return(O<<24|T<<16|A<<8|k)>>>0}})(C||(l.channels=C={})),(function(M){function O(T,A){return x=Math.round(255*A),[v,m,_]=b.toChannels(T.rgba),{css:C.toCss(v,m,_,x),rgba:C.toRgba(v,m,_,x)}}M.blend=function(T,A){if(x=(255&A.rgba)/255,x===1)return{css:A.css,rgba:A.rgba};const k=A.rgba>>24&255,q=A.rgba>>16&255,z=A.rgba>>8&255,I=T.rgba>>24&255,W=T.rgba>>16&255,U=T.rgba>>8&255;return v=I+Math.round((k-I)*x),m=W+Math.round((q-W)*x),_=U+Math.round((z-U)*x),{css:C.toCss(v,m,_),rgba:C.toRgba(v,m,_)}},M.isOpaque=function(T){return(255&T.rgba)==255},M.ensureContrastRatio=function(T,A,k){const q=b.ensureContrastRatio(T.rgba,A.rgba,k);if(q)return b.toColor(q>>24&255,q>>16&255,q>>8&255)},M.opaque=function(T){const A=(255|T.rgba)>>>0;return[v,m,_]=b.toChannels(A),{css:C.toCss(v,m,_),rgba:A}},M.opacity=O,M.multiplyOpacity=function(T,A){return x=255&T.rgba,O(T,x*A/255)},M.toColorRGB=function(T){return[T.rgba>>24&255,T.rgba>>16&255,T.rgba>>8&255]}})(S||(l.color=S={})),(function(M){let O,T;if(!c.isNode){const A=document.createElement("canvas");A.width=1,A.height=1;const k=A.getContext("2d",{willReadFrequently:!0});k&&(O=k,O.globalCompositeOperation="copy",T=O.createLinearGradient(0,0,1,1))}M.toColor=function(A){if(A.match(/#[\da-f]{3,8}/i))switch(A.length){case 4:return v=parseInt(A.slice(1,2).repeat(2),16),m=parseInt(A.slice(2,3).repeat(2),16),_=parseInt(A.slice(3,4).repeat(2),16),b.toColor(v,m,_);case 5:return v=parseInt(A.slice(1,2).repeat(2),16),m=parseInt(A.slice(2,3).repeat(2),16),_=parseInt(A.slice(3,4).repeat(2),16),x=parseInt(A.slice(4,5).repeat(2),16),b.toColor(v,m,_,x);case 7:return{css:A,rgba:(parseInt(A.slice(1),16)<<8|255)>>>0};case 9:return{css:A,rgba:parseInt(A.slice(1),16)>>>0}}const k=A.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(k)return v=parseInt(k[1]),m=parseInt(k[2]),_=parseInt(k[3]),x=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),b.toColor(v,m,_,x);if(!O||!T)throw new Error("css.toColor: Unsupported css format");if(O.fillStyle=T,O.fillStyle=A,typeof O.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(O.fillRect(0,0,1,1),[v,m,_,x]=O.getImageData(0,0,1,1).data,x!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(v,m,_,x),css:A}}})(p||(l.css=p={})),(function(M){function O(T,A,k){const q=T/255,z=A/255,I=k/255;return .2126*(q<=.03928?q/12.92:Math.pow((q+.055)/1.055,2.4))+.7152*(z<=.03928?z/12.92:Math.pow((z+.055)/1.055,2.4))+.0722*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))}M.relativeLuminance=function(T){return O(T>>16&255,T>>8&255,255&T)},M.relativeLuminance2=O})(g||(l.rgb=g={})),(function(M){function O(A,k,q){const z=A>>24&255,I=A>>16&255,W=A>>8&255;let U=k>>24&255,G=k>>16&255,H=k>>8&255,K=E(g.relativeLuminance2(U,G,H),g.relativeLuminance2(z,I,W));for(;K<q&&(U>0||G>0||H>0);)U-=Math.max(0,Math.ceil(.1*U)),G-=Math.max(0,Math.ceil(.1*G)),H-=Math.max(0,Math.ceil(.1*H)),K=E(g.relativeLuminance2(U,G,H),g.relativeLuminance2(z,I,W));return(U<<24|G<<16|H<<8|255)>>>0}function T(A,k,q){const z=A>>24&255,I=A>>16&255,W=A>>8&255;let U=k>>24&255,G=k>>16&255,H=k>>8&255,K=E(g.relativeLuminance2(U,G,H),g.relativeLuminance2(z,I,W));for(;K<q&&(U<255||G<255||H<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),G=Math.min(255,G+Math.ceil(.1*(255-G))),H=Math.min(255,H+Math.ceil(.1*(255-H))),K=E(g.relativeLuminance2(U,G,H),g.relativeLuminance2(z,I,W));return(U<<24|G<<16|H<<8|255)>>>0}M.ensureContrastRatio=function(A,k,q){const z=g.relativeLuminance(A>>8),I=g.relativeLuminance(k>>8);if(E(z,I)<q){if(I<z){const G=O(A,k,q),H=E(z,g.relativeLuminance(G>>8));if(H<q){const K=T(A,k,q);return H>E(z,g.relativeLuminance(K>>8))?G:K}return G}const W=T(A,k,q),U=E(z,g.relativeLuminance(W>>8));if(U<q){const G=O(A,k,q);return U>E(z,g.relativeLuminance(G>>8))?W:G}return W}},M.reduceLuminance=O,M.increaseLuminance=T,M.toChannels=function(A){return[A>>24&255,A>>16&255,A>>8&255,255&A]},M.toColor=function(A,k,q,z){return{css:C.toCss(A,k,q,z),rgba:C.toRgba(A,k,q,z)}}})(b||(l.rgba=b={})),l.toPaddedHex=y,l.contrastRatio=E},8969:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const c=u(844),v=u(2585),m=u(4348),_=u(7866),x=u(744),C=u(7302),S=u(6975),p=u(8460),g=u(1753),b=u(1480),y=u(7994),E=u(9282),M=u(5435),O=u(5981),T=u(2660);let A=!1;class k extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new p.EventEmitter),this._onScroll.event((z=>{this._onScrollApi?.fire(z.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(z){for(const I in z)this.optionsService.options[I]=z[I]}constructor(z){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new p.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new p.EventEmitter),this._instantiationService=new m.InstantiationService,this.optionsService=this.register(new C.OptionsService(z)),this._instantiationService.setService(v.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(v.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(v.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.CoreService)),this._instantiationService.setService(v.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(g.CoreMouseService)),this._instantiationService.setService(v.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(b.UnicodeService)),this._instantiationService.setService(v.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(v.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(v.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new M.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,p.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,p.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,p.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,p.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((I=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((I=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new O.WriteBuffer(((I,W)=>this._inputHandler.parse(I,W)))),this.register((0,p.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,I){this._writeBuffer.write(z,I)}writeSync(z,I){this._logService.logLevel<=v.LogLevelEnum.WARN&&!A&&(this._logService.warn("writeSync is unreliable and will be removed soon."),A=!0),this._writeBuffer.writeSync(z,I)}resize(z,I){isNaN(z)||isNaN(I)||(z=Math.max(z,x.MINIMUM_COLS),I=Math.max(I,x.MINIMUM_ROWS),this._bufferService.resize(z,I))}scroll(z,I=!1){this._bufferService.scroll(z,I)}scrollLines(z,I,W){this._bufferService.scrollLines(z,I,W)}scrollPages(z){this.scrollLines(z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(z){const I=z-this._bufferService.buffer.ydisp;I!==0&&this.scrollLines(I)}registerEscHandler(z,I){return this._inputHandler.registerEscHandler(z,I)}registerDcsHandler(z,I){return this._inputHandler.registerDcsHandler(z,I)}registerCsiHandler(z,I){return this._inputHandler.registerCsiHandler(z,I)}registerOscHandler(z,I){return this._inputHandler.registerOscHandler(z,I)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const I=this.optionsService.rawOptions.windowsPty;I&&I.buildNumber!==void 0&&I.buildNumber!==void 0?z=I.backend==="conpty"&&I.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(z=!0),z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const z=[];z.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)((()=>{for(const I of z)I.dispose()}))}}}l.CoreTerminal=k},8460:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let c=0;c<this._listeners.length;c++)if(this._listeners[c]===u)return void this._listeners.splice(c,1)}}})),this._event}fire(u,c){const v=[];for(let m=0;m<this._listeners.length;m++)v.push(this._listeners[m]);for(let m=0;m<v.length;m++)v[m].call(void 0,u,c)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(u,c){return u((v=>c.fire(v)))},l.runAndSubscribe=function(u,c){return c(void 0),u((v=>c(v)))}},5435:function(d,l,u){var c=this&&this.__decorate||function(F,N,$,B){var P,Q=arguments.length,J=Q<3?N:B===null?B=Object.getOwnPropertyDescriptor(N,$):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(F,N,$,B);else for(var ae=F.length-1;ae>=0;ae--)(P=F[ae])&&(J=(Q<3?P(J):Q>3?P(N,$,J):P(N,$))||J);return Q>3&&J&&Object.defineProperty(N,$,J),J},v=this&&this.__param||function(F,N){return function($,B){N($,B,F)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const m=u(2584),_=u(7116),x=u(2015),C=u(844),S=u(482),p=u(8437),g=u(8460),b=u(643),y=u(511),E=u(3734),M=u(2585),O=u(1480),T=u(6242),A=u(6351),k=u(5941),q={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function I(F,N){if(F>24)return N.setWinLines||!1;switch(F){case 1:return!!N.restoreWin;case 2:return!!N.minimizeWin;case 3:return!!N.setWinPosition;case 4:return!!N.setWinSizePixels;case 5:return!!N.raiseWin;case 6:return!!N.lowerWin;case 7:return!!N.refreshWin;case 8:return!!N.setWinSizeChars;case 9:return!!N.maximizeWin;case 10:return!!N.fullscreenWin;case 11:return!!N.getWinState;case 13:return!!N.getWinPosition;case 14:return!!N.getWinSizePixels;case 15:return!!N.getScreenSizePixels;case 16:return!!N.getCellSizePixels;case 18:return!!N.getWinSizeChars;case 19:return!!N.getScreenSizeChars;case 20:return!!N.getIconTitle;case 21:return!!N.getWinTitle;case 22:return!!N.pushTitle;case 23:return!!N.popTitle;case 24:return!!N.setWinLines}return!1}var W;(function(F){F[F.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",F[F.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(W||(l.WindowsOptionsReportType=W={}));let U=0;class G extends C.Disposable{getAttrData(){return this._curAttrData}constructor(N,$,B,P,Q,J,ae,Z,X=new x.EscapeSequenceParser){super(),this._bufferService=N,this._charsetService=$,this._coreService=B,this._logService=P,this._optionsService=Q,this._oscLinkService=J,this._coreMouseService=ae,this._unicodeService=Z,this._parser=X,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=p.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=p.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new g.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new g.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new g.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new g.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new g.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new g.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new g.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new g.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new g.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new g.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new g.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new g.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new g.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new H(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((V=>this._activeBuffer=V.activeBuffer))),this._parser.setCsiHandlerFallback(((V,ie)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(V),params:ie.toArray()})})),this._parser.setEscHandlerFallback((V=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(V)})})),this._parser.setExecuteHandlerFallback((V=>{this._logService.debug("Unknown EXECUTE code: ",{code:V})})),this._parser.setOscHandlerFallback(((V,ie,de)=>{this._logService.debug("Unknown OSC code: ",{identifier:V,action:ie,data:de})})),this._parser.setDcsHandlerFallback(((V,ie,de)=>{ie==="HOOK"&&(de=de.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(V),action:ie,payload:de})})),this._parser.setPrintHandler(((V,ie,de)=>this.print(V,ie,de))),this._parser.registerCsiHandler({final:"@"},(V=>this.insertChars(V))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(V=>this.scrollLeft(V))),this._parser.registerCsiHandler({final:"A"},(V=>this.cursorUp(V))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(V=>this.scrollRight(V))),this._parser.registerCsiHandler({final:"B"},(V=>this.cursorDown(V))),this._parser.registerCsiHandler({final:"C"},(V=>this.cursorForward(V))),this._parser.registerCsiHandler({final:"D"},(V=>this.cursorBackward(V))),this._parser.registerCsiHandler({final:"E"},(V=>this.cursorNextLine(V))),this._parser.registerCsiHandler({final:"F"},(V=>this.cursorPrecedingLine(V))),this._parser.registerCsiHandler({final:"G"},(V=>this.cursorCharAbsolute(V))),this._parser.registerCsiHandler({final:"H"},(V=>this.cursorPosition(V))),this._parser.registerCsiHandler({final:"I"},(V=>this.cursorForwardTab(V))),this._parser.registerCsiHandler({final:"J"},(V=>this.eraseInDisplay(V,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(V=>this.eraseInDisplay(V,!0))),this._parser.registerCsiHandler({final:"K"},(V=>this.eraseInLine(V,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(V=>this.eraseInLine(V,!0))),this._parser.registerCsiHandler({final:"L"},(V=>this.insertLines(V))),this._parser.registerCsiHandler({final:"M"},(V=>this.deleteLines(V))),this._parser.registerCsiHandler({final:"P"},(V=>this.deleteChars(V))),this._parser.registerCsiHandler({final:"S"},(V=>this.scrollUp(V))),this._parser.registerCsiHandler({final:"T"},(V=>this.scrollDown(V))),this._parser.registerCsiHandler({final:"X"},(V=>this.eraseChars(V))),this._parser.registerCsiHandler({final:"Z"},(V=>this.cursorBackwardTab(V))),this._parser.registerCsiHandler({final:"`"},(V=>this.charPosAbsolute(V))),this._parser.registerCsiHandler({final:"a"},(V=>this.hPositionRelative(V))),this._parser.registerCsiHandler({final:"b"},(V=>this.repeatPrecedingCharacter(V))),this._parser.registerCsiHandler({final:"c"},(V=>this.sendDeviceAttributesPrimary(V))),this._parser.registerCsiHandler({prefix:">",final:"c"},(V=>this.sendDeviceAttributesSecondary(V))),this._parser.registerCsiHandler({final:"d"},(V=>this.linePosAbsolute(V))),this._parser.registerCsiHandler({final:"e"},(V=>this.vPositionRelative(V))),this._parser.registerCsiHandler({final:"f"},(V=>this.hVPosition(V))),this._parser.registerCsiHandler({final:"g"},(V=>this.tabClear(V))),this._parser.registerCsiHandler({final:"h"},(V=>this.setMode(V))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(V=>this.setModePrivate(V))),this._parser.registerCsiHandler({final:"l"},(V=>this.resetMode(V))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(V=>this.resetModePrivate(V))),this._parser.registerCsiHandler({final:"m"},(V=>this.charAttributes(V))),this._parser.registerCsiHandler({final:"n"},(V=>this.deviceStatus(V))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(V=>this.deviceStatusPrivate(V))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(V=>this.softReset(V))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(V=>this.setCursorStyle(V))),this._parser.registerCsiHandler({final:"r"},(V=>this.setScrollRegion(V))),this._parser.registerCsiHandler({final:"s"},(V=>this.saveCursor(V))),this._parser.registerCsiHandler({final:"t"},(V=>this.windowOptions(V))),this._parser.registerCsiHandler({final:"u"},(V=>this.restoreCursor(V))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(V=>this.insertColumns(V))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(V=>this.deleteColumns(V))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(V=>this.selectProtected(V))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(V=>this.requestMode(V,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(V=>this.requestMode(V,!1))),this._parser.setExecuteHandler(m.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(m.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(m.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(m.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(m.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(m.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(m.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(m.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(m.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((V=>(this.setTitle(V),this.setIconName(V),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((V=>this.setIconName(V)))),this._parser.registerOscHandler(2,new T.OscHandler((V=>this.setTitle(V)))),this._parser.registerOscHandler(4,new T.OscHandler((V=>this.setOrReportIndexedColor(V)))),this._parser.registerOscHandler(8,new T.OscHandler((V=>this.setHyperlink(V)))),this._parser.registerOscHandler(10,new T.OscHandler((V=>this.setOrReportFgColor(V)))),this._parser.registerOscHandler(11,new T.OscHandler((V=>this.setOrReportBgColor(V)))),this._parser.registerOscHandler(12,new T.OscHandler((V=>this.setOrReportCursorColor(V)))),this._parser.registerOscHandler(104,new T.OscHandler((V=>this.restoreIndexedColor(V)))),this._parser.registerOscHandler(110,new T.OscHandler((V=>this.restoreFgColor(V)))),this._parser.registerOscHandler(111,new T.OscHandler((V=>this.restoreBgColor(V)))),this._parser.registerOscHandler(112,new T.OscHandler((V=>this.restoreCursorColor(V)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const V in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:V},(()=>this.selectCharset("("+V))),this._parser.registerEscHandler({intermediates:")",final:V},(()=>this.selectCharset(")"+V))),this._parser.registerEscHandler({intermediates:"*",final:V},(()=>this.selectCharset("*"+V))),this._parser.registerEscHandler({intermediates:"+",final:V},(()=>this.selectCharset("+"+V))),this._parser.registerEscHandler({intermediates:"-",final:V},(()=>this.selectCharset("-"+V))),this._parser.registerEscHandler({intermediates:".",final:V},(()=>this.selectCharset("."+V))),this._parser.registerEscHandler({intermediates:"/",final:V},(()=>this.selectCharset("/"+V)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((V=>(this._logService.error("Parsing error: ",V),V))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new A.DcsHandler(((V,ie)=>this.requestStatusString(V,ie))))}_preserveStack(N,$,B,P){this._parseStack.paused=!0,this._parseStack.cursorStartX=N,this._parseStack.cursorStartY=$,this._parseStack.decodedLength=B,this._parseStack.position=P}_logSlowResolvingAsync(N){this._logService.logLevel<=M.LogLevelEnum.WARN&&Promise.race([N,new Promise((($,B)=>setTimeout((()=>B("#SLOW_TIMEOUT")),5e3)))]).catch(($=>{if($!=="#SLOW_TIMEOUT")throw $;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(N,$){let B,P=this._activeBuffer.x,Q=this._activeBuffer.y,J=0;const ae=this._parseStack.paused;if(ae){if(B=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,$))return this._logSlowResolvingAsync(B),B;P=this._parseStack.cursorStartX,Q=this._parseStack.cursorStartY,this._parseStack.paused=!1,N.length>z&&(J=this._parseStack.position+z)}if(this._logService.logLevel<=M.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof N=="string"?` "${N}"`:` "${Array.prototype.map.call(N,(V=>String.fromCharCode(V))).join("")}"`),typeof N=="string"?N.split("").map((V=>V.charCodeAt(0))):N),this._parseBuffer.length<N.length&&this._parseBuffer.length<z&&(this._parseBuffer=new Uint32Array(Math.min(N.length,z))),ae||this._dirtyRowTracker.clearRange(),N.length>z)for(let V=J;V<N.length;V+=z){const ie=V+z<N.length?V+z:N.length,de=typeof N=="string"?this._stringDecoder.decode(N.substring(V,ie),this._parseBuffer):this._utf8Decoder.decode(N.subarray(V,ie),this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,de))return this._preserveStack(P,Q,de,V),this._logSlowResolvingAsync(B),B}else if(!ae){const V=typeof N=="string"?this._stringDecoder.decode(N,this._parseBuffer):this._utf8Decoder.decode(N,this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,V))return this._preserveStack(P,Q,V,0),this._logSlowResolvingAsync(B),B}this._activeBuffer.x===P&&this._activeBuffer.y===Q||this._onCursorMove.fire();const Z=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),X=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);X<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(X,this._bufferService.rows-1),Math.min(Z,this._bufferService.rows-1))}print(N,$,B){let P,Q;const J=this._charsetService.charset,ae=this._optionsService.rawOptions.screenReaderMode,Z=this._bufferService.cols,X=this._coreService.decPrivateModes.wraparound,V=this._coreService.modes.insertMode,ie=this._curAttrData;let de=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&B-$>0&&de.getWidth(this._activeBuffer.x-1)===2&&de.setCellFromCodePoint(this._activeBuffer.x-1,0,1,ie.fg,ie.bg,ie.extended);let re=this._parser.precedingJoinState;for(let le=$;le<B;++le){if(P=N[le],P<127&&J){const Be=J[String.fromCharCode(P)];Be&&(P=Be.charCodeAt(0))}const _e=this._unicodeService.charProperties(P,re);Q=O.UnicodeService.extractWidth(_e);const Ce=O.UnicodeService.extractShouldJoin(_e),He=Ce?O.UnicodeService.extractWidth(re):0;if(re=_e,ae&&this._onA11yChar.fire((0,S.stringFromCodePoint)(P)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Q-He>Z){if(X){const Be=de;let we=this._activeBuffer.x-He;for(this._activeBuffer.x=He,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),de=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),He>0&&de instanceof p.BufferLine&&de.copyCellsFrom(Be,we,0,He,!1);we<Z;)Be.setCellFromCodePoint(we++,0,1,ie.fg,ie.bg,ie.extended)}else if(this._activeBuffer.x=Z-1,Q===2)continue}if(Ce&&this._activeBuffer.x){const Be=de.getWidth(this._activeBuffer.x-1)?1:2;de.addCodepointToCell(this._activeBuffer.x-Be,P,Q);for(let we=Q-He;--we>=0;)de.setCellFromCodePoint(this._activeBuffer.x++,0,0,ie.fg,ie.bg,ie.extended)}else if(V&&(de.insertCells(this._activeBuffer.x,Q-He,this._activeBuffer.getNullCell(ie),ie),de.getWidth(Z-1)===2&&de.setCellFromCodePoint(Z-1,b.NULL_CELL_CODE,b.NULL_CELL_WIDTH,ie.fg,ie.bg,ie.extended)),de.setCellFromCodePoint(this._activeBuffer.x++,P,Q,ie.fg,ie.bg,ie.extended),Q>0)for(;--Q;)de.setCellFromCodePoint(this._activeBuffer.x++,0,0,ie.fg,ie.bg,ie.extended)}this._parser.precedingJoinState=re,this._activeBuffer.x<Z&&B-$>0&&de.getWidth(this._activeBuffer.x)===0&&!de.hasContent(this._activeBuffer.x)&&de.setCellFromCodePoint(this._activeBuffer.x,0,1,ie.fg,ie.bg,ie.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(N,$){return N.final!=="t"||N.prefix||N.intermediates?this._parser.registerCsiHandler(N,$):this._parser.registerCsiHandler(N,(B=>!I(B.params[0],this._optionsService.rawOptions.windowOptions)||$(B)))}registerDcsHandler(N,$){return this._parser.registerDcsHandler(N,new A.DcsHandler($))}registerEscHandler(N,$){return this._parser.registerEscHandler(N,$)}registerOscHandler(N,$){return this._parser.registerOscHandler(N,new T.OscHandler($))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);N.hasWidth(this._activeBuffer.x)&&!N.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const N=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-N),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(N=this._bufferService.cols-1){this._activeBuffer.x=Math.min(N,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(N,$){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=N,this._activeBuffer.y=this._activeBuffer.scrollTop+$):(this._activeBuffer.x=N,this._activeBuffer.y=$),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(N,$){this._restrictCursor(),this._setCursor(this._activeBuffer.x+N,this._activeBuffer.y+$)}cursorUp(N){const $=this._activeBuffer.y-this._activeBuffer.scrollTop;return $>=0?this._moveCursor(0,-Math.min($,N.params[0]||1)):this._moveCursor(0,-(N.params[0]||1)),!0}cursorDown(N){const $=this._activeBuffer.scrollBottom-this._activeBuffer.y;return $>=0?this._moveCursor(0,Math.min($,N.params[0]||1)):this._moveCursor(0,N.params[0]||1),!0}cursorForward(N){return this._moveCursor(N.params[0]||1,0),!0}cursorBackward(N){return this._moveCursor(-(N.params[0]||1),0),!0}cursorNextLine(N){return this.cursorDown(N),this._activeBuffer.x=0,!0}cursorPrecedingLine(N){return this.cursorUp(N),this._activeBuffer.x=0,!0}cursorCharAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(N){return this._setCursor(N.length>=2?(N.params[1]||1)-1:0,(N.params[0]||1)-1),!0}charPosAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(N){return this._moveCursor(N.params[0]||1,0),!0}linePosAbsolute(N){return this._setCursor(this._activeBuffer.x,(N.params[0]||1)-1),!0}vPositionRelative(N){return this._moveCursor(0,N.params[0]||1),!0}hVPosition(N){return this.cursorPosition(N),!0}tabClear(N){const $=N.params[0];return $===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:$===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=N.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let $=N.params[0]||1;for(;$--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(N){const $=N.params[0];return $===1&&(this._curAttrData.bg|=536870912),$!==2&&$!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(N,$,B,P=!1,Q=!1){const J=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);J.replaceCells($,B,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),Q),P&&(J.isWrapped=!1)}_resetBufferLine(N,$=!1){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);B&&(B.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),$),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+N),B.isWrapped=!1)}eraseInDisplay(N,$=!1){let B;switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,$);B<this._bufferService.rows;B++)this._resetBufferLine(B,$);this._dirtyRowTracker.markDirty(B);break;case 1:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B,0,this._activeBuffer.x+1,!0,$),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(B+1).isWrapped=!1);B--;)this._resetBufferLine(B,$);this._dirtyRowTracker.markDirty(0);break;case 2:for(B=this._bufferService.rows,this._dirtyRowTracker.markDirty(B-1);B--;)this._resetBufferLine(B,$);this._dirtyRowTracker.markDirty(0);break;case 3:const P=this._activeBuffer.lines.length-this._bufferService.rows;P>0&&(this._activeBuffer.lines.trimStart(P),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-P,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-P,0),this._onScroll.fire(0))}return!0}eraseInLine(N,$=!1){switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,$);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,$);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,$)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(N){this._restrictCursor();let $=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y,P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Q=this._bufferService.rows-1+this._activeBuffer.ybase-P+1;for(;$--;)this._activeBuffer.lines.splice(Q-1,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(N){this._restrictCursor();let $=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y;let P;for(P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-P;$--;)this._activeBuffer.lines.splice(B,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(N){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.insertCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(N){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.deleteCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(N){let $=N.params[0]||1;for(;$--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(N){let $=N.params[0]||1;for(;$--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(p.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=N.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);P.deleteCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=N.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);P.insertCells(0,$,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=N.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);P.insertCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const $=N.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);P.deleteCells(this._activeBuffer.x,$,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(N){this._restrictCursor();const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return $&&($.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(N.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(N){const $=this._parser.precedingJoinState;if(!$)return!0;const B=N.params[0]||1,P=O.UnicodeService.extractWidth($),Q=this._activeBuffer.x-P,J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Q),ae=new Uint32Array(J.length*B);let Z=0;for(let V=0;V<J.length;){const ie=J.codePointAt(V)||0;ae[Z++]=ie,V+=ie>65535?2:1}let X=Z;for(let V=1;V<B;++V)ae.copyWithin(X,0,Z),X+=Z;return this.print(ae,0,X),!0}sendDeviceAttributesPrimary(N){return N.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(m.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(m.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(N){return N.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(m.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(m.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(N.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(m.C0.ESC+"[>83;40003;0c")),!0}_is(N){return(this._optionsService.rawOptions.termName+"").indexOf(N)===0}setMode(N){for(let $=0;$<N.length;$++)switch(N.params[$]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(N){for(let $=0;$<N.length;$++)switch(N.params[$]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(N){for(let $=0;$<N.length;$++)switch(N.params[$]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(N){for(let $=0;$<N.length;$++)switch(N.params[$]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),N.params[$]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(N,$){const B=this._coreService.decPrivateModes,{activeProtocol:P,activeEncoding:Q}=this._coreMouseService,J=this._coreService,{buffers:ae,cols:Z}=this._bufferService,{active:X,alt:V}=ae,ie=this._optionsService.rawOptions,de=Ce=>Ce?1:2,re=N.params[0];return le=re,_e=$?re===2?4:re===4?de(J.modes.insertMode):re===12?3:re===20?de(ie.convertEol):0:re===1?de(B.applicationCursorKeys):re===3?ie.windowOptions.setWinLines?Z===80?2:Z===132?1:0:0:re===6?de(B.origin):re===7?de(B.wraparound):re===8?3:re===9?de(P==="X10"):re===12?de(ie.cursorBlink):re===25?de(!J.isCursorHidden):re===45?de(B.reverseWraparound):re===66?de(B.applicationKeypad):re===67?4:re===1e3?de(P==="VT200"):re===1002?de(P==="DRAG"):re===1003?de(P==="ANY"):re===1004?de(B.sendFocus):re===1005?4:re===1006?de(Q==="SGR"):re===1015?4:re===1016?de(Q==="SGR_PIXELS"):re===1048?1:re===47||re===1047||re===1049?de(X===V):re===2004?de(B.bracketedPasteMode):0,J.triggerDataEvent(`${m.C0.ESC}[${$?"":"?"}${le};${_e}$y`),!0;var le,_e}_updateAttrColor(N,$,B,P,Q){return $===2?(N|=50331648,N&=-16777216,N|=E.AttributeData.fromColorRGB([B,P,Q])):$===5&&(N&=-50331904,N|=33554432|255&B),N}_extractColor(N,$,B){const P=[0,0,-1,0,0,0];let Q=0,J=0;do{if(P[J+Q]=N.params[$+J],N.hasSubParams($+J)){const ae=N.getSubParams($+J);let Z=0;do P[1]===5&&(Q=1),P[J+Z+1+Q]=ae[Z];while(++Z<ae.length&&Z+J+1+Q<P.length);break}if(P[1]===5&&J+Q>=2||P[1]===2&&J+Q>=5)break;P[1]&&(Q=1)}while(++J+$<N.length&&J+Q<P.length);for(let ae=2;ae<P.length;++ae)P[ae]===-1&&(P[ae]=0);switch(P[0]){case 38:B.fg=this._updateAttrColor(B.fg,P[1],P[3],P[4],P[5]);break;case 48:B.bg=this._updateAttrColor(B.bg,P[1],P[3],P[4],P[5]);break;case 58:B.extended=B.extended.clone(),B.extended.underlineColor=this._updateAttrColor(B.extended.underlineColor,P[1],P[3],P[4],P[5])}return J}_processUnderline(N,$){$.extended=$.extended.clone(),(!~N||N>5)&&(N=1),$.extended.underlineStyle=N,$.fg|=268435456,N===0&&($.fg&=-268435457),$.updateExtended()}_processSGR0(N){N.fg=p.DEFAULT_ATTR_DATA.fg,N.bg=p.DEFAULT_ATTR_DATA.bg,N.extended=N.extended.clone(),N.extended.underlineStyle=0,N.extended.underlineColor&=-67108864,N.updateExtended()}charAttributes(N){if(N.length===1&&N.params[0]===0)return this._processSGR0(this._curAttrData),!0;const $=N.length;let B;const P=this._curAttrData;for(let Q=0;Q<$;Q++)B=N.params[Q],B>=30&&B<=37?(P.fg&=-50331904,P.fg|=16777216|B-30):B>=40&&B<=47?(P.bg&=-50331904,P.bg|=16777216|B-40):B>=90&&B<=97?(P.fg&=-50331904,P.fg|=16777224|B-90):B>=100&&B<=107?(P.bg&=-50331904,P.bg|=16777224|B-100):B===0?this._processSGR0(P):B===1?P.fg|=134217728:B===3?P.bg|=67108864:B===4?(P.fg|=268435456,this._processUnderline(N.hasSubParams(Q)?N.getSubParams(Q)[0]:1,P)):B===5?P.fg|=536870912:B===7?P.fg|=67108864:B===8?P.fg|=1073741824:B===9?P.fg|=2147483648:B===2?P.bg|=134217728:B===21?this._processUnderline(2,P):B===22?(P.fg&=-134217729,P.bg&=-134217729):B===23?P.bg&=-67108865:B===24?(P.fg&=-268435457,this._processUnderline(0,P)):B===25?P.fg&=-536870913:B===27?P.fg&=-67108865:B===28?P.fg&=-1073741825:B===29?P.fg&=2147483647:B===39?(P.fg&=-67108864,P.fg|=16777215&p.DEFAULT_ATTR_DATA.fg):B===49?(P.bg&=-67108864,P.bg|=16777215&p.DEFAULT_ATTR_DATA.bg):B===38||B===48||B===58?Q+=this._extractColor(N,Q,P):B===53?P.bg|=1073741824:B===55?P.bg&=-1073741825:B===59?(P.extended=P.extended.clone(),P.extended.underlineColor=-1,P.updateExtended()):B===100?(P.fg&=-67108864,P.fg|=16777215&p.DEFAULT_ATTR_DATA.fg,P.bg&=-67108864,P.bg|=16777215&p.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",B);return!0}deviceStatus(N){switch(N.params[0]){case 5:this._coreService.triggerDataEvent(`${m.C0.ESC}[0n`);break;case 6:const $=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${m.C0.ESC}[${$};${B}R`)}return!0}deviceStatusPrivate(N){if(N.params[0]===6){const $=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${m.C0.ESC}[?${$};${B}R`)}return!0}softReset(N){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=p.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(N){const $=N.params[0]||1;switch($){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const B=$%2==1;return this._optionsService.options.cursorBlink=B,!0}setScrollRegion(N){const $=N.params[0]||1;let B;return(N.length<2||(B=N.params[1])>this._bufferService.rows||B===0)&&(B=this._bufferService.rows),B>$&&(this._activeBuffer.scrollTop=$-1,this._activeBuffer.scrollBottom=B-1,this._setCursor(0,0)),!0}windowOptions(N){if(!I(N.params[0],this._optionsService.rawOptions.windowOptions))return!0;const $=N.length>1?N.params[1]:0;switch(N.params[0]){case 14:$!==2&&this._onRequestWindowsOptionsReport.fire(W.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(W.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${m.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:$!==0&&$!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),$!==0&&$!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:$!==0&&$!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),$!==0&&$!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(N){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(N){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(N){return this._windowTitle=N,this._onTitleChange.fire(N),!0}setIconName(N){return this._iconName=N,!0}setOrReportIndexedColor(N){const $=[],B=N.split(";");for(;B.length>1;){const P=B.shift(),Q=B.shift();if(/^\d+$/.exec(P)){const J=parseInt(P);if(K(J))if(Q==="?")$.push({type:0,index:J});else{const ae=(0,k.parseColor)(Q);ae&&$.push({type:1,index:J,color:ae})}}}return $.length&&this._onColor.fire($),!0}setHyperlink(N){const $=N.split(";");return!($.length<2)&&($[1]?this._createHyperlink($[0],$[1]):!$[0]&&this._finishHyperlink())}_createHyperlink(N,$){this._getCurrentLinkId()&&this._finishHyperlink();const B=N.split(":");let P;const Q=B.findIndex((J=>J.startsWith("id=")));return Q!==-1&&(P=B[Q].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:P,uri:$}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(N,$){const B=N.split(";");for(let P=0;P<B.length&&!($>=this._specialColors.length);++P,++$)if(B[P]==="?")this._onColor.fire([{type:0,index:this._specialColors[$]}]);else{const Q=(0,k.parseColor)(B[P]);Q&&this._onColor.fire([{type:1,index:this._specialColors[$],color:Q}])}return!0}setOrReportFgColor(N){return this._setOrReportSpecialColor(N,0)}setOrReportBgColor(N){return this._setOrReportSpecialColor(N,1)}setOrReportCursorColor(N){return this._setOrReportSpecialColor(N,2)}restoreIndexedColor(N){if(!N)return this._onColor.fire([{type:2}]),!0;const $=[],B=N.split(";");for(let P=0;P<B.length;++P)if(/^\d+$/.exec(B[P])){const Q=parseInt(B[P]);K(Q)&&$.push({type:2,index:Q})}return $.length&&this._onColor.fire($),!0}restoreFgColor(N){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(N){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(N){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),!0}selectCharset(N){return N.length!==2?(this.selectDefaultCharset(),!0):(N[0]==="/"||this._charsetService.setgCharset(q[N[0]],_.CHARSETS[N[1]]||_.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const N=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,N,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=p.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=p.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(N){return this._charsetService.setgLevel(N),!0}screenAlignmentPattern(){const N=new y.CellData;N.content=4194373,N.fg=this._curAttrData.fg,N.bg=this._curAttrData.bg,this._setCursor(0,0);for(let $=0;$<this._bufferService.rows;++$){const B=this._activeBuffer.ybase+this._activeBuffer.y+$,P=this._activeBuffer.lines.get(B);P&&(P.fill(N),P.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(N,$){const B=this._bufferService.buffer,P=this._optionsService.rawOptions;return(Q=>(this._coreService.triggerDataEvent(`${m.C0.ESC}${Q}${m.C0.ESC}\\`),!0))(N==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:N==='"p'?'P1$r61;1"p':N==="r"?`P1$r${B.scrollTop+1};${B.scrollBottom+1}r`:N==="m"?"P1$r0m":N===" q"?`P1$r${{block:2,underline:4,bar:6}[P.cursorStyle]-(P.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(N,$){this._dirtyRowTracker.markRangeDirty(N,$)}}l.InputHandler=G;let H=class{constructor(F){this._bufferService=F,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(F){F<this.start?this.start=F:F>this.end&&(this.end=F)}markRangeDirty(F,N){F>N&&(U=F,F=N,N=U),F<this.start&&(this.start=F),N>this.end&&(this.end=N)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(F){return 0<=F&&F<256}H=c([v(0,M.IBufferService)],H)},844:(d,l)=>{function u(c){for(const v of c)v.dispose();c.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const v=this._disposables.indexOf(c);v!==-1&&this._disposables.splice(v,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){this._isDisposed||c===this._value||(this._value?.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},l.toDisposable=function(c){return{dispose:c}},l.disposeArray=u,l.getDisposeArrayDisposable=function(c){return{dispose:()=>u(c)}}},1505:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(v,m,_){this._data[v]||(this._data[v]={}),this._data[v][m]=_}get(v,m){return this._data[v]?this._data[v][m]:void 0}clear(){this._data={}}}l.TwoKeyMap=u,l.FourKeyMap=class{constructor(){this._data=new u}set(c,v,m,_,x){this._data.get(c,v)||this._data.set(c,v,new u),this._data.get(c,v).set(m,_,x)}get(c,v,m,_){return this._data.get(c,v)?.get(m,_)}clear(){this._data.clear()}}},6114:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u";const u=l.isNode?"node":navigator.userAgent,c=l.isNode?"node":navigator.platform;l.isFirefox=u.includes("Firefox"),l.isLegacyEdge=u.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(u),l.getSafariVersion=function(){if(!l.isSafari)return 0;const v=u.match(/Version\/(\d+)/);return v===null||v.length<2?0:parseInt(v[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),l.isIpad=c==="iPad",l.isIphone=c==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),l.isLinux=c.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(u)},6106:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let u=0;l.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(u=this._search(this._getKey(c)),this._array.splice(u,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const v=this._getKey(c);if(v===void 0||(u=this._search(v),u===-1)||this._getKey(this._array[u])!==v)return!1;do if(this._array[u]===c)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===v);return!1}*getKeyIterator(c){if(this._array.length!==0&&(u=this._search(c),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===c))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===c)}forEachByKey(c,v){if(this._array.length!==0&&(u=this._search(c),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===c))do v(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===c)}values(){return[...this._array].values()}_search(c){let v=0,m=this._array.length-1;for(;m>=v;){let _=v+m>>1;const x=this._getKey(this._array[_]);if(x>c)m=_-1;else{if(!(x<c)){for(;_>0&&this._getKey(this._array[_-1])===c;)_--;return _}v=_+1}}return v}}},7226:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const c=u(6114);class v{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let C=0,S=0,p=x.timeRemaining(),g=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),S=Math.max(C,S),g=x.timeRemaining(),1.5*S>g)return p-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(p-C))}ms`),void this._start();p=g}this.clear()}}class m extends v{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const C=Date.now()+x;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}l.PriorityTaskQueue=m,l.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends v{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:m,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const c=u(643);l.updateWindowsModeWrappedState=function(v){const m=v.buffer.lines.get(v.buffer.ybase+v.buffer.y-1),_=m?.get(v.cols-1),x=v.buffer.lines.get(v.buffer.ybase+v.buffer.y);x&&_&&(x.isWrapped=_[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&_[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(m){return[m>>>16&255,m>>>8&255,255&m]}static fromColorRGB(m){return(255&m[0])<<16|(255&m[1])<<8|255&m[2]}clone(){const m=new u;return m.fg=this.fg,m.bg=this.bg,m.extended=this.extended.clone(),m}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}l.AttributeData=u;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(m){this._ext=m}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(m){this._ext&=-469762049,this._ext|=m<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(m){this._ext&=-67108864,this._ext|=67108863&m}get urlId(){return this._urlId}set urlId(m){this._urlId=m}constructor(m=0,_=0){this._ext=0,this._urlId=0,this._ext=m,this._urlId=_}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=c},9092:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const c=u(6349),v=u(7226),m=u(3734),_=u(8437),x=u(4634),C=u(511),S=u(643),p=u(4863),g=u(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(b,y,E){this._hasScrollback=b,this._optionsService=y,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=g.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new v.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(b){return b?(this._nullCell.fg=b.fg,this._nullCell.bg=b.bg,this._nullCell.extended=b.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new m.ExtendedAttrs),this._nullCell}getWhitespaceCell(b){return b?(this._whitespaceCell.fg=b.fg,this._whitespaceCell.bg=b.bg,this._whitespaceCell.extended=b.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new m.ExtendedAttrs),this._whitespaceCell}getBlankLine(b,y){return new _.BufferLine(this._bufferService.cols,this.getNullCell(b),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const b=this.ybase+this.y-this.ydisp;return b>=0&&b<this._rows}_getCorrectBufferLength(b){if(!this._hasScrollback)return b;const y=b+this._optionsService.rawOptions.scrollback;return y>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:y}fillViewportRows(b){if(this.lines.length===0){b===void 0&&(b=_.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(b))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(b,y){const E=this.getNullCell(_.DEFAULT_ATTR_DATA);let M=0;const O=this._getCorrectBufferLength(y);if(O>this.lines.maxLength&&(this.lines.maxLength=O),this.lines.length>0){if(this._cols<b)for(let A=0;A<this.lines.length;A++)M+=+this.lines.get(A).resize(b,E);let T=0;if(this._rows<y)for(let A=this._rows;A<y;A++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(b,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(b,E)));else for(let A=this._rows;A>y;A--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(O<this.lines.maxLength){const A=this.lines.length-O;A>0&&(this.lines.trimStart(A),this.ybase=Math.max(this.ybase-A,0),this.ydisp=Math.max(this.ydisp-A,0),this.savedY=Math.max(this.savedY-A,0)),this.lines.maxLength=O}this.x=Math.min(this.x,b-1),this.y=Math.min(this.y,y-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,b-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(b,y),this._cols>b))for(let T=0;T<this.lines.length;T++)M+=+this.lines.get(T).resize(b,E);this._cols=b,this._rows=y,this._memoryCleanupQueue.clear(),M>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let b=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,b=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return b}get _isReflowEnabled(){const b=this._optionsService.rawOptions.windowsPty;return b&&b.buildNumber?this._hasScrollback&&b.backend==="conpty"&&b.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(b,y){this._cols!==b&&(b>this._cols?this._reflowLarger(b,y):this._reflowSmaller(b,y))}_reflowLarger(b,y){const E=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,b,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(E.length>0){const M=(0,x.reflowLargerCreateNewLayout)(this.lines,E);(0,x.reflowLargerApplyNewLayout)(this.lines,M.layout),this._reflowLargerAdjustViewport(b,y,M.countRemoved)}}_reflowLargerAdjustViewport(b,y,E){const M=this.getNullCell(_.DEFAULT_ATTR_DATA);let O=E;for(;O-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new _.BufferLine(b,M))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(b,y){const E=this.getNullCell(_.DEFAULT_ATTR_DATA),M=[];let O=0;for(let T=this.lines.length-1;T>=0;T--){let A=this.lines.get(T);if(!A||!A.isWrapped&&A.getTrimmedLength()<=b)continue;const k=[A];for(;A.isWrapped&&T>0;)A=this.lines.get(--T),k.unshift(A);const q=this.ybase+this.y;if(q>=T&&q<T+k.length)continue;const z=k[k.length-1].getTrimmedLength(),I=(0,x.reflowSmallerGetNewLineLengths)(k,this._cols,b),W=I.length-k.length;let U;U=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+W):Math.max(0,this.lines.length-this.lines.maxLength+W);const G=[];for(let B=0;B<W;B++){const P=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);G.push(P)}G.length>0&&(M.push({start:T+k.length+O,newLines:G}),O+=G.length),k.push(...G);let H=I.length-1,K=I[H];K===0&&(H--,K=I[H]);let F=k.length-W-1,N=z;for(;F>=0;){const B=Math.min(N,K);if(k[H]===void 0)break;if(k[H].copyCellsFrom(k[F],N-B,K-B,B,!0),K-=B,K===0&&(H--,K=I[H]),N-=B,N===0){F--;const P=Math.max(F,0);N=(0,x.getWrappedLineTrimmedLength)(k,P,this._cols)}}for(let B=0;B<k.length;B++)I[B]<b&&k[B].setCell(I[B],E);let $=W-U;for(;$-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+O)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+W,this.ybase+y-1)}if(M.length>0){const T=[],A=[];for(let H=0;H<this.lines.length;H++)A.push(this.lines.get(H));const k=this.lines.length;let q=k-1,z=0,I=M[z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+O);let W=0;for(let H=Math.min(this.lines.maxLength-1,k+O-1);H>=0;H--)if(I&&I.start>q+W){for(let K=I.newLines.length-1;K>=0;K--)this.lines.set(H--,I.newLines[K]);H++,T.push({index:q+1,amount:I.newLines.length}),W+=I.newLines.length,I=M[++z]}else this.lines.set(H,A[q--]);let U=0;for(let H=T.length-1;H>=0;H--)T[H].index+=U,this.lines.onInsertEmitter.fire(T[H]),U+=T[H].amount;const G=Math.max(0,k+O-this.lines.maxLength);G>0&&this.lines.onTrimEmitter.fire(G)}}translateBufferLineToString(b,y,E=0,M){const O=this.lines.get(b);return O?O.translateToString(y,E,M):""}getWrappedRangeForLine(b){let y=b,E=b;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:y,last:E}}setupTabStops(b){for(b!=null?this.tabs[b]||(b=this.prevStop(b)):(this.tabs={},b=0);b<this._cols;b+=this._optionsService.rawOptions.tabStopWidth)this.tabs[b]=!0}prevStop(b){for(b==null&&(b=this.x);!this.tabs[--b]&&b>0;);return b>=this._cols?this._cols-1:b<0?0:b}nextStop(b){for(b==null&&(b=this.x);!this.tabs[++b]&&b<this._cols;);return b>=this._cols?this._cols-1:b<0?0:b}clearMarkers(b){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===b&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let b=0;b<this.markers.length;b++)this.markers[b].dispose(),this.markers.splice(b--,1);this._isClearing=!1}addMarker(b){const y=new p.Marker(b);return this.markers.push(y),y.register(this.lines.onTrim((E=>{y.line-=E,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((E=>{y.line>=E.index&&(y.line+=E.amount)}))),y.register(this.lines.onDelete((E=>{y.line>=E.index&&y.line<E.index+E.amount&&y.dispose(),y.line>E.index&&(y.line-=E.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(b){this._isClearing||this.markers.splice(this.markers.indexOf(b),1)}}},8437:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const c=u(3734),v=u(511),m=u(643),_=u(482);l.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let x=0;class C{constructor(p,g,b=!1){this.isWrapped=b,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*p);const y=g||v.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]);for(let E=0;E<p;++E)this.setCell(E,y);this.length=p}get(p){const g=this._data[3*p+0],b=2097151&g;return[this._data[3*p+1],2097152&g?this._combined[p]:b?(0,_.stringFromCodePoint)(b):"",g>>22,2097152&g?this._combined[p].charCodeAt(this._combined[p].length-1):b]}set(p,g){this._data[3*p+1]=g[m.CHAR_DATA_ATTR_INDEX],g[m.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[p]=g[1],this._data[3*p+0]=2097152|p|g[m.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*p+0]=g[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[m.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(p){return this._data[3*p+0]>>22}hasWidth(p){return 12582912&this._data[3*p+0]}getFg(p){return this._data[3*p+1]}getBg(p){return this._data[3*p+2]}hasContent(p){return 4194303&this._data[3*p+0]}getCodePoint(p){const g=this._data[3*p+0];return 2097152&g?this._combined[p].charCodeAt(this._combined[p].length-1):2097151&g}isCombined(p){return 2097152&this._data[3*p+0]}getString(p){const g=this._data[3*p+0];return 2097152&g?this._combined[p]:2097151&g?(0,_.stringFromCodePoint)(2097151&g):""}isProtected(p){return 536870912&this._data[3*p+2]}loadCell(p,g){return x=3*p,g.content=this._data[x+0],g.fg=this._data[x+1],g.bg=this._data[x+2],2097152&g.content&&(g.combinedData=this._combined[p]),268435456&g.bg&&(g.extended=this._extendedAttrs[p]),g}setCell(p,g){2097152&g.content&&(this._combined[p]=g.combinedData),268435456&g.bg&&(this._extendedAttrs[p]=g.extended),this._data[3*p+0]=g.content,this._data[3*p+1]=g.fg,this._data[3*p+2]=g.bg}setCellFromCodePoint(p,g,b,y,E,M){268435456&E&&(this._extendedAttrs[p]=M),this._data[3*p+0]=g|b<<22,this._data[3*p+1]=y,this._data[3*p+2]=E}addCodepointToCell(p,g,b){let y=this._data[3*p+0];2097152&y?this._combined[p]+=(0,_.stringFromCodePoint)(g):2097151&y?(this._combined[p]=(0,_.stringFromCodePoint)(2097151&y)+(0,_.stringFromCodePoint)(g),y&=-2097152,y|=2097152):y=g|4194304,b&&(y&=-12582913,y|=b<<22),this._data[3*p+0]=y}insertCells(p,g,b,y){if((p%=this.length)&&this.getWidth(p-1)===2&&this.setCellFromCodePoint(p-1,0,1,y?.fg||0,y?.bg||0,y?.extended||new c.ExtendedAttrs),g<this.length-p){const E=new v.CellData;for(let M=this.length-p-g-1;M>=0;--M)this.setCell(p+g+M,this.loadCell(p+M,E));for(let M=0;M<g;++M)this.setCell(p+M,b)}else for(let E=p;E<this.length;++E)this.setCell(E,b);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,y?.fg||0,y?.bg||0,y?.extended||new c.ExtendedAttrs)}deleteCells(p,g,b,y){if(p%=this.length,g<this.length-p){const E=new v.CellData;for(let M=0;M<this.length-p-g;++M)this.setCell(p+M,this.loadCell(p+g+M,E));for(let M=this.length-g;M<this.length;++M)this.setCell(M,b)}else for(let E=p;E<this.length;++E)this.setCell(E,b);p&&this.getWidth(p-1)===2&&this.setCellFromCodePoint(p-1,0,1,y?.fg||0,y?.bg||0,y?.extended||new c.ExtendedAttrs),this.getWidth(p)!==0||this.hasContent(p)||this.setCellFromCodePoint(p,0,1,y?.fg||0,y?.bg||0,y?.extended||new c.ExtendedAttrs)}replaceCells(p,g,b,y,E=!1){if(E)for(p&&this.getWidth(p-1)===2&&!this.isProtected(p-1)&&this.setCellFromCodePoint(p-1,0,1,y?.fg||0,y?.bg||0,y?.extended||new c.ExtendedAttrs),g<this.length&&this.getWidth(g-1)===2&&!this.isProtected(g)&&this.setCellFromCodePoint(g,0,1,y?.fg||0,y?.bg||0,y?.extended||new c.ExtendedAttrs);p<g&&p<this.length;)this.isProtected(p)||this.setCell(p,b),p++;else for(p&&this.getWidth(p-1)===2&&this.setCellFromCodePoint(p-1,0,1,y?.fg||0,y?.bg||0,y?.extended||new c.ExtendedAttrs),g<this.length&&this.getWidth(g-1)===2&&this.setCellFromCodePoint(g,0,1,y?.fg||0,y?.bg||0,y?.extended||new c.ExtendedAttrs);p<g&&p<this.length;)this.setCell(p++,b)}resize(p,g){if(p===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const b=3*p;if(p>this.length){if(this._data.buffer.byteLength>=4*b)this._data=new Uint32Array(this._data.buffer,0,b);else{const y=new Uint32Array(b);y.set(this._data),this._data=y}for(let y=this.length;y<p;++y)this.setCell(y,g)}else{this._data=this._data.subarray(0,b);const y=Object.keys(this._combined);for(let M=0;M<y.length;M++){const O=parseInt(y[M],10);O>=p&&delete this._combined[O]}const E=Object.keys(this._extendedAttrs);for(let M=0;M<E.length;M++){const O=parseInt(E[M],10);O>=p&&delete this._extendedAttrs[O]}}return this.length=p,4*b*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const p=new Uint32Array(this._data.length);return p.set(this._data),this._data=p,1}return 0}fill(p,g=!1){if(g)for(let b=0;b<this.length;++b)this.isProtected(b)||this.setCell(b,p);else{this._combined={},this._extendedAttrs={};for(let b=0;b<this.length;++b)this.setCell(b,p)}}copyFrom(p){this.length!==p.length?this._data=new Uint32Array(p._data):this._data.set(p._data),this.length=p.length,this._combined={};for(const g in p._combined)this._combined[g]=p._combined[g];this._extendedAttrs={};for(const g in p._extendedAttrs)this._extendedAttrs[g]=p._extendedAttrs[g];this.isWrapped=p.isWrapped}clone(){const p=new C(0);p._data=new Uint32Array(this._data),p.length=this.length;for(const g in this._combined)p._combined[g]=this._combined[g];for(const g in this._extendedAttrs)p._extendedAttrs[g]=this._extendedAttrs[g];return p.isWrapped=this.isWrapped,p}getTrimmedLength(){for(let p=this.length-1;p>=0;--p)if(4194303&this._data[3*p+0])return p+(this._data[3*p+0]>>22);return 0}getNoBgTrimmedLength(){for(let p=this.length-1;p>=0;--p)if(4194303&this._data[3*p+0]||50331648&this._data[3*p+2])return p+(this._data[3*p+0]>>22);return 0}copyCellsFrom(p,g,b,y,E){const M=p._data;if(E)for(let T=y-1;T>=0;T--){for(let A=0;A<3;A++)this._data[3*(b+T)+A]=M[3*(g+T)+A];268435456&M[3*(g+T)+2]&&(this._extendedAttrs[b+T]=p._extendedAttrs[g+T])}else for(let T=0;T<y;T++){for(let A=0;A<3;A++)this._data[3*(b+T)+A]=M[3*(g+T)+A];268435456&M[3*(g+T)+2]&&(this._extendedAttrs[b+T]=p._extendedAttrs[g+T])}const O=Object.keys(p._combined);for(let T=0;T<O.length;T++){const A=parseInt(O[T],10);A>=g&&(this._combined[A-g+b]=p._combined[A])}}translateToString(p=!1,g=0,b=this.length){p&&(b=Math.min(b,this.getTrimmedLength()));let y="";for(;g<b;){const E=this._data[3*g+0],M=2097151&E;y+=2097152&E?this._combined[g]:M?(0,_.stringFromCodePoint)(M):m.WHITESPACE_CELL_CHAR,g+=E>>22||1}return y}}l.BufferLine=C},4841:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(u,c){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return c*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(d,l)=>{function u(c,v,m){if(v===c.length-1)return c[v].getTrimmedLength();const _=!c[v].hasContent(m-1)&&c[v].getWidth(m-1)===1,x=c[v+1].getWidth(0)===2;return _&&x?m-1:m}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(c,v,m,_,x){const C=[];for(let S=0;S<c.length-1;S++){let p=S,g=c.get(++p);if(!g.isWrapped)continue;const b=[c.get(S)];for(;p<c.length&&g.isWrapped;)b.push(g),g=c.get(++p);if(_>=S&&_<p){S+=b.length-1;continue}let y=0,E=u(b,y,v),M=1,O=0;for(;M<b.length;){const A=u(b,M,v),k=A-O,q=m-E,z=Math.min(k,q);b[y].copyCellsFrom(b[M],O,E,z,!1),E+=z,E===m&&(y++,E=0),O+=z,O===A&&(M++,O=0),E===0&&y!==0&&b[y-1].getWidth(m-1)===2&&(b[y].copyCellsFrom(b[y-1],m-1,E++,1,!1),b[y-1].setCell(m-1,x))}b[y].replaceCells(E,m,x);let T=0;for(let A=b.length-1;A>0&&(A>y||b[A].getTrimmedLength()===0);A--)T++;T>0&&(C.push(S+b.length-T),C.push(T)),S+=b.length-1}return C},l.reflowLargerCreateNewLayout=function(c,v){const m=[];let _=0,x=v[_],C=0;for(let S=0;S<c.length;S++)if(x===S){const p=v[++_];c.onDeleteEmitter.fire({index:S-C,amount:p}),S+=p-1,C+=p,x=v[++_]}else m.push(S);return{layout:m,countRemoved:C}},l.reflowLargerApplyNewLayout=function(c,v){const m=[];for(let _=0;_<v.length;_++)m.push(c.get(v[_]));for(let _=0;_<m.length;_++)c.set(_,m[_]);c.length=v.length},l.reflowSmallerGetNewLineLengths=function(c,v,m){const _=[],x=c.map(((g,b)=>u(c,b,v))).reduce(((g,b)=>g+b));let C=0,S=0,p=0;for(;p<x;){if(x-p<m){_.push(x-p);break}C+=m;const g=u(c,S,v);C>g&&(C-=g,S++);const b=c[S].getWidth(C-1)===2;b&&C--;const y=b?m-1:m;_.push(y),p+=y}return _},l.getWrappedLineTrimmedLength=u},5295:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const c=u(8460),v=u(844),m=u(9092);class _ extends v.Disposable{constructor(C,S){super(),this._optionsService=C,this._bufferService=S,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new m.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new m.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(C,S){this._normal.resize(C,S),this._alt.resize(C,S),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}l.BufferSet=_},511:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const c=u(482),v=u(643),m=u(3734);class _ extends m.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new m.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const S=new _;return S.setFromCharData(C),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[v.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(C[v.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(C[v.CHAR_DATA_CHAR_INDEX].length===2){const p=C[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=p&&p<=56319){const g=C[v.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=g&&g<=57343?this.content=1024*(p-55296)+g-56320+65536|C[v.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=C[v.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[v.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=C[v.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[v.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=_},643:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const c=u(8460),v=u(844);class m{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=m._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,v.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}l.Marker=m,m._nextId=1},7116:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(d,l)=>{var u,c,v;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(m){m.NUL="\0",m.SOH="",m.STX="",m.ETX="",m.EOT="",m.ENQ="",m.ACK="",m.BEL="\x07",m.BS="\b",m.HT=" ",m.LF=`
65
+ `,m.VT="\v",m.FF="\f",m.CR="\r",m.SO="",m.SI="",m.DLE="",m.DC1="",m.DC2="",m.DC3="",m.DC4="",m.NAK="",m.SYN="",m.ETB="",m.CAN="",m.EM="",m.SUB="",m.ESC="\x1B",m.FS="",m.GS="",m.RS="",m.US="",m.SP=" ",m.DEL=""})(u||(l.C0=u={})),(function(m){m.PAD="€",m.HOP="",m.BPH="‚",m.NBH="ƒ",m.IND="„",m.NEL="…",m.SSA="†",m.ESA="‡",m.HTS="ˆ",m.HTJ="‰",m.VTS="Š",m.PLD="‹",m.PLU="Œ",m.RI="",m.SS2="Ž",m.SS3="",m.DCS="",m.PU1="‘",m.PU2="’",m.STS="“",m.CCH="”",m.MW="•",m.SPA="–",m.EPA="—",m.SOS="˜",m.SGCI="™",m.SCI="š",m.CSI="›",m.ST="œ",m.OSC="",m.PM="ž",m.APC="Ÿ"})(c||(l.C1=c={})),(function(m){m.ST=`${u.ESC}\\`})(v||(l.C1_ESCAPED=v={}))},7399:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const c=u(2584),v={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};l.evaluateKeyboardEvent=function(m,_,x,C){const S={type:0,cancel:!1,key:void 0},p=(m.shiftKey?1:0)|(m.altKey?2:0)|(m.ctrlKey?4:0)|(m.metaKey?8:0);switch(m.keyCode){case 0:m.key==="UIKeyInputUpArrow"?S.key=_?c.C0.ESC+"OA":c.C0.ESC+"[A":m.key==="UIKeyInputLeftArrow"?S.key=_?c.C0.ESC+"OD":c.C0.ESC+"[D":m.key==="UIKeyInputRightArrow"?S.key=_?c.C0.ESC+"OC":c.C0.ESC+"[C":m.key==="UIKeyInputDownArrow"&&(S.key=_?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:if(m.altKey){S.key=c.C0.ESC+c.C0.DEL;break}S.key=c.C0.DEL;break;case 9:if(m.shiftKey){S.key=c.C0.ESC+"[Z";break}S.key=c.C0.HT,S.cancel=!0;break;case 13:S.key=m.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,S.cancel=!0;break;case 27:S.key=c.C0.ESC,m.altKey&&(S.key=c.C0.ESC+c.C0.ESC),S.cancel=!0;break;case 37:if(m.metaKey)break;p?(S.key=c.C0.ESC+"[1;"+(p+1)+"D",S.key===c.C0.ESC+"[1;3D"&&(S.key=c.C0.ESC+(x?"b":"[1;5D"))):S.key=_?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(m.metaKey)break;p?(S.key=c.C0.ESC+"[1;"+(p+1)+"C",S.key===c.C0.ESC+"[1;3C"&&(S.key=c.C0.ESC+(x?"f":"[1;5C"))):S.key=_?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(m.metaKey)break;p?(S.key=c.C0.ESC+"[1;"+(p+1)+"A",x||S.key!==c.C0.ESC+"[1;3A"||(S.key=c.C0.ESC+"[1;5A")):S.key=_?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(m.metaKey)break;p?(S.key=c.C0.ESC+"[1;"+(p+1)+"B",x||S.key!==c.C0.ESC+"[1;3B"||(S.key=c.C0.ESC+"[1;5B")):S.key=_?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:m.shiftKey||m.ctrlKey||(S.key=c.C0.ESC+"[2~");break;case 46:S.key=p?c.C0.ESC+"[3;"+(p+1)+"~":c.C0.ESC+"[3~";break;case 36:S.key=p?c.C0.ESC+"[1;"+(p+1)+"H":_?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:S.key=p?c.C0.ESC+"[1;"+(p+1)+"F":_?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:m.shiftKey?S.type=2:m.ctrlKey?S.key=c.C0.ESC+"[5;"+(p+1)+"~":S.key=c.C0.ESC+"[5~";break;case 34:m.shiftKey?S.type=3:m.ctrlKey?S.key=c.C0.ESC+"[6;"+(p+1)+"~":S.key=c.C0.ESC+"[6~";break;case 112:S.key=p?c.C0.ESC+"[1;"+(p+1)+"P":c.C0.ESC+"OP";break;case 113:S.key=p?c.C0.ESC+"[1;"+(p+1)+"Q":c.C0.ESC+"OQ";break;case 114:S.key=p?c.C0.ESC+"[1;"+(p+1)+"R":c.C0.ESC+"OR";break;case 115:S.key=p?c.C0.ESC+"[1;"+(p+1)+"S":c.C0.ESC+"OS";break;case 116:S.key=p?c.C0.ESC+"[15;"+(p+1)+"~":c.C0.ESC+"[15~";break;case 117:S.key=p?c.C0.ESC+"[17;"+(p+1)+"~":c.C0.ESC+"[17~";break;case 118:S.key=p?c.C0.ESC+"[18;"+(p+1)+"~":c.C0.ESC+"[18~";break;case 119:S.key=p?c.C0.ESC+"[19;"+(p+1)+"~":c.C0.ESC+"[19~";break;case 120:S.key=p?c.C0.ESC+"[20;"+(p+1)+"~":c.C0.ESC+"[20~";break;case 121:S.key=p?c.C0.ESC+"[21;"+(p+1)+"~":c.C0.ESC+"[21~";break;case 122:S.key=p?c.C0.ESC+"[23;"+(p+1)+"~":c.C0.ESC+"[23~";break;case 123:S.key=p?c.C0.ESC+"[24;"+(p+1)+"~":c.C0.ESC+"[24~";break;default:if(!m.ctrlKey||m.shiftKey||m.altKey||m.metaKey)if(x&&!C||!m.altKey||m.metaKey)!x||m.altKey||m.ctrlKey||m.shiftKey||!m.metaKey?m.key&&!m.ctrlKey&&!m.altKey&&!m.metaKey&&m.keyCode>=48&&m.key.length===1?S.key=m.key:m.key&&m.ctrlKey&&(m.key==="_"&&(S.key=c.C0.US),m.key==="@"&&(S.key=c.C0.NUL)):m.keyCode===65&&(S.type=1);else{const g=v[m.keyCode],b=g?.[m.shiftKey?1:0];if(b)S.key=c.C0.ESC+b;else if(m.keyCode>=65&&m.keyCode<=90){const y=m.ctrlKey?m.keyCode-64:m.keyCode+32;let E=String.fromCharCode(y);m.shiftKey&&(E=E.toUpperCase()),S.key=c.C0.ESC+E}else if(m.keyCode===32)S.key=c.C0.ESC+(m.ctrlKey?c.C0.NUL:" ");else if(m.key==="Dead"&&m.code.startsWith("Key")){let y=m.code.slice(3,4);m.shiftKey||(y=y.toLowerCase()),S.key=c.C0.ESC+y,S.cancel=!0}}else m.keyCode>=65&&m.keyCode<=90?S.key=String.fromCharCode(m.keyCode-64):m.keyCode===32?S.key=c.C0.NUL:m.keyCode>=51&&m.keyCode<=55?S.key=String.fromCharCode(m.keyCode-51+27):m.keyCode===56?S.key=c.C0.DEL:m.keyCode===219?S.key=c.C0.ESC:m.keyCode===220?S.key=c.C0.FS:m.keyCode===221&&(S.key=c.C0.GS)}return S}},482:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},l.utf32ToString=function(u,c=0,v=u.length){let m="";for(let _=c;_<v;++_){let x=u[_];x>65535?(x-=65536,m+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):m+=String.fromCharCode(x)}return m},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,c){const v=u.length;if(!v)return 0;let m=0,_=0;if(this._interim){const x=u.charCodeAt(_++);56320<=x&&x<=57343?c[m++]=1024*(this._interim-55296)+x-56320+65536:(c[m++]=this._interim,c[m++]=x),this._interim=0}for(let x=_;x<v;++x){const C=u.charCodeAt(x);if(55296<=C&&C<=56319){if(++x>=v)return this._interim=C,m;const S=u.charCodeAt(x);56320<=S&&S<=57343?c[m++]=1024*(C-55296)+S-56320+65536:(c[m++]=C,c[m++]=S)}else C!==65279&&(c[m++]=C)}return m}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,c){const v=u.length;if(!v)return 0;let m,_,x,C,S=0,p=0,g=0;if(this.interim[0]){let E=!1,M=this.interim[0];M&=(224&M)==192?31:(240&M)==224?15:7;let O,T=0;for(;(O=63&this.interim[++T])&&T<4;)M<<=6,M|=O;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=A-T;for(;g<k;){if(g>=v)return 0;if(O=u[g++],(192&O)!=128){g--,E=!0;break}this.interim[T++]=O,M<<=6,M|=63&O}E||(A===2?M<128?g--:c[S++]=M:A===3?M<2048||M>=55296&&M<=57343||M===65279||(c[S++]=M):M<65536||M>1114111||(c[S++]=M)),this.interim.fill(0)}const b=v-4;let y=g;for(;y<v;){for(;!(!(y<b)||128&(m=u[y])||128&(_=u[y+1])||128&(x=u[y+2])||128&(C=u[y+3]));)c[S++]=m,c[S++]=_,c[S++]=x,c[S++]=C,y+=4;if(m=u[y++],m<128)c[S++]=m;else if((224&m)==192){if(y>=v)return this.interim[0]=m,S;if(_=u[y++],(192&_)!=128){y--;continue}if(p=(31&m)<<6|63&_,p<128){y--;continue}c[S++]=p}else if((240&m)==224){if(y>=v)return this.interim[0]=m,S;if(_=u[y++],(192&_)!=128){y--;continue}if(y>=v)return this.interim[0]=m,this.interim[1]=_,S;if(x=u[y++],(192&x)!=128){y--;continue}if(p=(15&m)<<12|(63&_)<<6|63&x,p<2048||p>=55296&&p<=57343||p===65279)continue;c[S++]=p}else if((248&m)==240){if(y>=v)return this.interim[0]=m,S;if(_=u[y++],(192&_)!=128){y--;continue}if(y>=v)return this.interim[0]=m,this.interim[1]=_,S;if(x=u[y++],(192&x)!=128){y--;continue}if(y>=v)return this.interim[0]=m,this.interim[1]=_,this.interim[2]=x,S;if(C=u[y++],(192&C)!=128){y--;continue}if(p=(7&m)<<18|(63&_)<<12|(63&x)<<6|63&C,p<65536||p>1114111)continue;c[S++]=p}}return S}}},225:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const c=u(1480),v=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],m=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let _;l.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let x=0;x<v.length;++x)_.fill(0,v[x][0],v[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?_[x]:(function(C,S){let p,g=0,b=S.length-1;if(C<S[0][0]||C>S[b][1])return!1;for(;b>=g;)if(p=g+b>>1,C>S[p][1])g=p+1;else{if(!(C<S[p][0]))return!0;b=p-1}return!1})(x,m)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,C){let S=this.wcwidth(x),p=S===0&&C!==0;if(p){const g=c.UnicodeService.extractWidth(C);g===0?p=!1:g>S&&(S=g)}return c.UnicodeService.createPropertyValue(0,S,p)}}},5981:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const c=u(8460),v=u(844);class m extends v.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const p=this._callbacks.shift();p&&p()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(C)}_innerWrite(x=0,C=!0){const S=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const p=this._writeBuffer[this._bufferOffset],g=this._action(p,C);if(g){const y=E=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(S,E);return void g.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(y)}const b=this._callbacks[this._bufferOffset];if(b&&b(),this._bufferOffset++,this._pendingData-=p.length,Date.now()-S>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}l.WriteBuffer=m},5941:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function v(m,_){const x=m.toString(16),C=x.length<2?"0"+x:x;switch(_){case 4:return x[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}l.parseColor=function(m){if(!m)return;let _=m.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const x=u.exec(_);if(x){const C=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/C*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/C*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/C*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),c.exec(_)&&[3,6,9,12].includes(_.length))){const x=_.length/3,C=[0,0,0];for(let S=0;S<3;++S){const p=parseInt(_.slice(x*S,x*S+x),16);C[S]=x===1?p<<4:x===2?p:x===3?p>>4:p>>8}return C}},l.toRgbString=function(m,_=16){const[x,C,S]=m;return`rgb:${v(x,_)}/${v(C,_)}/${v(S,_)}`}},5770:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const c=u(482),v=u(8742),m=u(5770),_=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(C,S){this._handlers[C]===void 0&&(this._handlers[C]=[]);const p=this._handlers[C];return p.push(S),{dispose:()=>{const g=p.indexOf(S);g!==-1&&p.splice(g,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(C,S){if(this.reset(),this._ident=C,this._active=this._handlers[C]||_,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(C,S,p){if(this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].put(C,S,p);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(C,S,p))}unhook(C,S=!0){if(this._active.length){let p=!1,g=this._active.length-1,b=!1;if(this._stack.paused&&(g=this._stack.loopPosition-1,p=S,b=this._stack.fallThrough,this._stack.paused=!1),!b&&p===!1){for(;g>=0&&(p=this._active[g].unhook(C),p!==!0);g--)if(p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!1,p;g--}for(;g>=0;g--)if(p=this._active[g].unhook(!1),p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!0,p}else this._handlerFb(this._ident,"UNHOOK",C);this._active=_,this._ident=0}};const x=new v.Params;x.addParam(0),l.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=x,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():x,this._data="",this._hitLimit=!1}put(C,S,p){this._hitLimit||(this._data+=(0,c.utf32ToString)(C,S,p),this._data.length>m.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let S=!1;if(this._hitLimit)S=!1;else if(C&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((p=>(this._params=x,this._data="",this._hitLimit=!1,p)));return this._params=x,this._data="",this._hitLimit=!1,S}}},2015:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const c=u(844),v=u(8742),m=u(6242),_=u(6351);class x{constructor(g){this.table=new Uint8Array(g)}setDefault(g,b){this.table.fill(g<<4|b)}add(g,b,y,E){this.table[b<<8|g]=y<<4|E}addMany(g,b,y,E){for(let M=0;M<g.length;M++)this.table[b<<8|g[M]]=y<<4|E}}l.TransitionTable=x;const C=160;l.VT500_TRANSITION_TABLE=(function(){const p=new x(4095),g=Array.apply(null,Array(256)).map(((T,A)=>A)),b=(T,A)=>g.slice(T,A),y=b(32,127),E=b(0,24);E.push(25),E.push.apply(E,b(28,32));const M=b(0,14);let O;for(O in p.setDefault(1,0),p.addMany(y,0,2,0),M)p.addMany([24,26,153,154],O,3,0),p.addMany(b(128,144),O,3,0),p.addMany(b(144,152),O,3,0),p.add(156,O,0,0),p.add(27,O,11,1),p.add(157,O,4,8),p.addMany([152,158,159],O,0,7),p.add(155,O,11,3),p.add(144,O,11,9);return p.addMany(E,0,3,0),p.addMany(E,1,3,1),p.add(127,1,0,1),p.addMany(E,8,0,8),p.addMany(E,3,3,3),p.add(127,3,0,3),p.addMany(E,4,3,4),p.add(127,4,0,4),p.addMany(E,6,3,6),p.addMany(E,5,3,5),p.add(127,5,0,5),p.addMany(E,2,3,2),p.add(127,2,0,2),p.add(93,1,4,8),p.addMany(y,8,5,8),p.add(127,8,5,8),p.addMany([156,27,24,26,7],8,6,0),p.addMany(b(28,32),8,0,8),p.addMany([88,94,95],1,0,7),p.addMany(y,7,0,7),p.addMany(E,7,0,7),p.add(156,7,0,0),p.add(127,7,0,7),p.add(91,1,11,3),p.addMany(b(64,127),3,7,0),p.addMany(b(48,60),3,8,4),p.addMany([60,61,62,63],3,9,4),p.addMany(b(48,60),4,8,4),p.addMany(b(64,127),4,7,0),p.addMany([60,61,62,63],4,0,6),p.addMany(b(32,64),6,0,6),p.add(127,6,0,6),p.addMany(b(64,127),6,0,0),p.addMany(b(32,48),3,9,5),p.addMany(b(32,48),5,9,5),p.addMany(b(48,64),5,0,6),p.addMany(b(64,127),5,7,0),p.addMany(b(32,48),4,9,5),p.addMany(b(32,48),1,9,2),p.addMany(b(32,48),2,9,2),p.addMany(b(48,127),2,10,0),p.addMany(b(48,80),1,10,0),p.addMany(b(81,88),1,10,0),p.addMany([89,90,92],1,10,0),p.addMany(b(96,127),1,10,0),p.add(80,1,11,9),p.addMany(E,9,0,9),p.add(127,9,0,9),p.addMany(b(28,32),9,0,9),p.addMany(b(32,48),9,9,12),p.addMany(b(48,60),9,8,10),p.addMany([60,61,62,63],9,9,10),p.addMany(E,11,0,11),p.addMany(b(32,128),11,0,11),p.addMany(b(28,32),11,0,11),p.addMany(E,10,0,10),p.add(127,10,0,10),p.addMany(b(28,32),10,0,10),p.addMany(b(48,60),10,8,10),p.addMany([60,61,62,63],10,0,11),p.addMany(b(32,48),10,9,12),p.addMany(E,12,0,12),p.add(127,12,0,12),p.addMany(b(28,32),12,0,12),p.addMany(b(32,48),12,9,12),p.addMany(b(48,64),12,0,11),p.addMany(b(64,127),12,12,13),p.addMany(b(64,127),10,12,13),p.addMany(b(64,127),9,12,13),p.addMany(E,13,13,13),p.addMany(y,13,13,13),p.add(127,13,0,13),p.addMany([27,156,24,26],13,14,0),p.add(C,0,2,0),p.add(C,8,5,8),p.add(C,6,0,6),p.add(C,11,0,11),p.add(C,13,13,13),p})();class S extends c.Disposable{constructor(g=l.VT500_TRANSITION_TABLE){super(),this._transitions=g,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new v.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(b,y,E)=>{},this._executeHandlerFb=b=>{},this._csiHandlerFb=(b,y)=>{},this._escHandlerFb=b=>{},this._errorHandlerFb=b=>b,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new m.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(g,b=[64,126]){let y=0;if(g.prefix){if(g.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=g.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(g.intermediates){if(g.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let M=0;M<g.intermediates.length;++M){const O=g.intermediates.charCodeAt(M);if(32>O||O>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=O}}if(g.final.length!==1)throw new Error("final must be a single byte");const E=g.final.charCodeAt(0);if(b[0]>E||E>b[1])throw new Error(`final must be in range ${b[0]} .. ${b[1]}`);return y<<=8,y|=E,y}identToString(g){const b=[];for(;g;)b.push(String.fromCharCode(255&g)),g>>=8;return b.reverse().join("")}setPrintHandler(g){this._printHandler=g}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(g,b){const y=this._identifier(g,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const E=this._escHandlers[y];return E.push(b),{dispose:()=>{const M=E.indexOf(b);M!==-1&&E.splice(M,1)}}}clearEscHandler(g){this._escHandlers[this._identifier(g,[48,126])]&&delete this._escHandlers[this._identifier(g,[48,126])]}setEscHandlerFallback(g){this._escHandlerFb=g}setExecuteHandler(g,b){this._executeHandlers[g.charCodeAt(0)]=b}clearExecuteHandler(g){this._executeHandlers[g.charCodeAt(0)]&&delete this._executeHandlers[g.charCodeAt(0)]}setExecuteHandlerFallback(g){this._executeHandlerFb=g}registerCsiHandler(g,b){const y=this._identifier(g);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const E=this._csiHandlers[y];return E.push(b),{dispose:()=>{const M=E.indexOf(b);M!==-1&&E.splice(M,1)}}}clearCsiHandler(g){this._csiHandlers[this._identifier(g)]&&delete this._csiHandlers[this._identifier(g)]}setCsiHandlerFallback(g){this._csiHandlerFb=g}registerDcsHandler(g,b){return this._dcsParser.registerHandler(this._identifier(g),b)}clearDcsHandler(g){this._dcsParser.clearHandler(this._identifier(g))}setDcsHandlerFallback(g){this._dcsParser.setHandlerFallback(g)}registerOscHandler(g,b){return this._oscParser.registerHandler(g,b)}clearOscHandler(g){this._oscParser.clearHandler(g)}setOscHandlerFallback(g){this._oscParser.setHandlerFallback(g)}setErrorHandler(g){this._errorHandler=g}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(g,b,y,E,M){this._parseStack.state=g,this._parseStack.handlers=b,this._parseStack.handlerPos=y,this._parseStack.transition=E,this._parseStack.chunkPos=M}parse(g,b,y){let E,M=0,O=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const A=this._parseStack.handlers;let k=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&k>-1){for(;k>=0&&(E=A[k](this._params),E!==!0);k--)if(E instanceof Promise)return this._parseStack.handlerPos=k,E}this._parseStack.handlers=[];break;case 4:if(y===!1&&k>-1){for(;k>=0&&(E=A[k](),E!==!0);k--)if(E instanceof Promise)return this._parseStack.handlerPos=k,E}this._parseStack.handlers=[];break;case 6:if(M=g[this._parseStack.chunkPos],E=this._dcsParser.unhook(M!==24&&M!==26,y),E)return E;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(M=g[this._parseStack.chunkPos],E=this._oscParser.end(M!==24&&M!==26,y),E)return E;M===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let A=T;A<b;++A){switch(M=g[A],O=this._transitions.table[this.currentState<<8|(M<160?M:C)],O>>4){case 2:for(let W=A+1;;++W){if(W>=b||(M=g[W])<32||M>126&&M<C){this._printHandler(g,A,W),A=W-1;break}if(++W>=b||(M=g[W])<32||M>126&&M<C){this._printHandler(g,A,W),A=W-1;break}if(++W>=b||(M=g[W])<32||M>126&&M<C){this._printHandler(g,A,W),A=W-1;break}if(++W>=b||(M=g[W])<32||M>126&&M<C){this._printHandler(g,A,W),A=W-1;break}}break;case 3:this._executeHandlers[M]?this._executeHandlers[M]():this._executeHandlerFb(M),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:A,code:M,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const k=this._csiHandlers[this._collect<<8|M];let q=k?k.length-1:-1;for(;q>=0&&(E=k[q](this._params),E!==!0);q--)if(E instanceof Promise)return this._preserveStack(3,k,q,O,A),E;q<0&&this._csiHandlerFb(this._collect<<8|M,this._params),this.precedingJoinState=0;break;case 8:do switch(M){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(M-48)}while(++A<b&&(M=g[A])>47&&M<60);A--;break;case 9:this._collect<<=8,this._collect|=M;break;case 10:const z=this._escHandlers[this._collect<<8|M];let I=z?z.length-1:-1;for(;I>=0&&(E=z[I](),E!==!0);I--)if(E instanceof Promise)return this._preserveStack(4,z,I,O,A),E;I<0&&this._escHandlerFb(this._collect<<8|M),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|M,this._params);break;case 13:for(let W=A+1;;++W)if(W>=b||(M=g[W])===24||M===26||M===27||M>127&&M<C){this._dcsParser.put(g,A,W),A=W-1;break}break;case 14:if(E=this._dcsParser.unhook(M!==24&&M!==26),E)return this._preserveStack(6,[],0,O,A),E;M===27&&(O|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let W=A+1;;W++)if(W>=b||(M=g[W])<32||M>127&&M<C){this._oscParser.put(g,A,W),A=W-1;break}break;case 6:if(E=this._oscParser.end(M!==24&&M!==26),E)return this._preserveStack(5,[],0,O,A),E;M===27&&(O|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&O}}}l.EscapeSequenceParser=S},6242:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const c=u(5770),v=u(482),m=[];l.OscParser=class{constructor(){this._state=0,this._active=m,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,x){this._handlers[_]===void 0&&(this._handlers[_]=[]);const C=this._handlers[_];return C.push(x),{dispose:()=>{const S=C.indexOf(x);S!==-1&&C.splice(S,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=m,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||m,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,x,C){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(_,x,C);else this._handlerFb(this._id,"PUT",(0,v.utf32ToString)(_,x,C))}start(){this.reset(),this._state=1}put(_,x,C){if(this._state!==3){if(this._state===1)for(;x<C;){const S=_[x++];if(S===59){this._state=2,this._start();break}if(S<48||57<S)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+S-48}this._state===2&&C-x>0&&this._put(_,x,C)}}end(_,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,S=this._active.length-1,p=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,C=x,p=this._stack.fallThrough,this._stack.paused=!1),!p&&C===!1){for(;S>=0&&(C=this._active[S].end(_),C!==!0);S--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,C;S--}for(;S>=0;S--)if(C=this._active[S].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",_);this._active=m,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,x,C){this._hitLimit||(this._data+=(0,v.utf32ToString)(_,x,C),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let x=!1;if(this._hitLimit)x=!1;else if(_&&(x=this._handler(this._data),x instanceof Promise))return x.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,x}}},8742:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const u=2147483647;class c{static fromArray(m){const _=new c;if(!m.length)return _;for(let x=Array.isArray(m[0])?1:0;x<m.length;++x){const C=m[x];if(Array.isArray(C))for(let S=0;S<C.length;++S)_.addSubParam(C[S]);else _.addParam(C)}return _}constructor(m=32,_=32){if(this.maxLength=m,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(m),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(m),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const m=new c(this.maxLength,this.maxSubParamsLength);return m.params.set(this.params),m.length=this.length,m._subParams.set(this._subParams),m._subParamsLength=this._subParamsLength,m._subParamsIdx.set(this._subParamsIdx),m._rejectDigits=this._rejectDigits,m._rejectSubDigits=this._rejectSubDigits,m._digitIsSub=this._digitIsSub,m}toArray(){const m=[];for(let _=0;_<this.length;++_){m.push(this.params[_]);const x=this._subParamsIdx[_]>>8,C=255&this._subParamsIdx[_];C-x>0&&m.push(Array.prototype.slice.call(this._subParams,x,C))}return m}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(m){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(m<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=m>u?u:m}}addSubParam(m){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(m<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=m>u?u:m,this._subParamsIdx[this.length-1]++}}hasSubParams(m){return(255&this._subParamsIdx[m])-(this._subParamsIdx[m]>>8)>0}getSubParams(m){const _=this._subParamsIdx[m]>>8,x=255&this._subParamsIdx[m];return x-_>0?this._subParams.subarray(_,x):null}getSubParamsAll(){const m={};for(let _=0;_<this.length;++_){const x=this._subParamsIdx[_]>>8,C=255&this._subParamsIdx[_];C-x>0&&(m[_]=this._subParams.slice(x,C))}return m}addDigit(m){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,C=x[_-1];x[_-1]=~C?Math.min(10*C+m,u):m}}l.Params=c},5741:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,c){const v={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(v),c.dispose=()=>this._wrappedAddonDispose(v),c.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let c=-1;for(let v=0;v<this._addons.length;v++)if(this._addons[v]===u){c=v;break}if(c===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(c,1)}}},8771:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const c=u(3785),v=u(511);l.BufferApiView=class{constructor(m,_){this._buffer=m,this.type=_}init(m){return this._buffer=m,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(m){const _=this._buffer.lines.get(m);if(_)return new c.BufferLineApiView(_)}getNullCell(){return new v.CellData}}},3785:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const c=u(511);l.BufferLineApiView=class{constructor(v){this._line=v}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(v,m){if(!(v<0||v>=this._line.length))return m?(this._line.loadCell(v,m),m):this._line.loadCell(v,new c.CellData)}translateToString(v,m,_){return this._line.translateToString(v,m,_)}}},8285:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const c=u(8771),v=u(8460),m=u(844);class _ extends m.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new v.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}l.BufferNamespaceApi=_},7975:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,c){return this._core.registerCsiHandler(u,(v=>c(v.toArray())))}addCsiHandler(u,c){return this.registerCsiHandler(u,c)}registerDcsHandler(u,c){return this._core.registerDcsHandler(u,((v,m)=>c(v,m.toArray())))}addDcsHandler(u,c){return this.registerDcsHandler(u,c)}registerEscHandler(u,c){return this._core.registerEscHandler(u,c)}addEscHandler(u,c){return this.registerEscHandler(u,c)}registerOscHandler(u,c){return this._core.registerOscHandler(u,c)}addOscHandler(u,c){return this.registerOscHandler(u,c)}}},7090:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(d,l,u){var c=this&&this.__decorate||function(p,g,b,y){var E,M=arguments.length,O=M<3?g:y===null?y=Object.getOwnPropertyDescriptor(g,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(p,g,b,y);else for(var T=p.length-1;T>=0;T--)(E=p[T])&&(O=(M<3?E(O):M>3?E(g,b,O):E(g,b))||O);return M>3&&O&&Object.defineProperty(g,b,O),O},v=this&&this.__param||function(p,g){return function(b,y){g(b,y,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const m=u(8460),_=u(844),x=u(5295),C=u(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let S=l.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(p){super(),this.isUserScrolling=!1,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new m.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(p.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(p.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(p,this))}resize(p,g){this.cols=p,this.rows=g,this.buffers.resize(p,g),this._onResize.fire({cols:p,rows:g})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(p,g=!1){const b=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===p.fg&&y.getBg(0)===p.bg||(y=b.getBlankLine(p,g),this._cachedBlankLine=y),y.isWrapped=g;const E=b.ybase+b.scrollTop,M=b.ybase+b.scrollBottom;if(b.scrollTop===0){const O=b.lines.isFull;M===b.lines.length-1?O?b.lines.recycle().copyFrom(y):b.lines.push(y.clone()):b.lines.splice(M+1,0,y.clone()),O?this.isUserScrolling&&(b.ydisp=Math.max(b.ydisp-1,0)):(b.ybase++,this.isUserScrolling||b.ydisp++)}else{const O=M-E+1;b.lines.shiftElements(E+1,O-1,-1),b.lines.set(M,y.clone())}this.isUserScrolling||(b.ydisp=b.ybase),this._onScroll.fire(b.ydisp)}scrollLines(p,g,b){const y=this.buffer;if(p<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else p+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const E=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+p,y.ybase),0),E!==y.ydisp&&(g||this._onScroll.fire(y.ydisp))}};l.BufferService=S=c([v(0,C.IOptionsService)],S)},7994:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,c){this._charsets[u]=c,this.glevel===u&&(this.charset=c)}}},1753:function(d,l,u){var c=this&&this.__decorate||function(y,E,M,O){var T,A=arguments.length,k=A<3?E:O===null?O=Object.getOwnPropertyDescriptor(E,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(y,E,M,O);else for(var q=y.length-1;q>=0;q--)(T=y[q])&&(k=(A<3?T(k):A>3?T(E,M,k):T(E,M))||k);return A>3&&k&&Object.defineProperty(E,M,k),k},v=this&&this.__param||function(y,E){return function(M,O){E(M,O,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const m=u(2585),_=u(8460),x=u(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function S(y,E){let M=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(M|=64,M|=y.action):(M|=3&y.button,4&y.button&&(M|=64),8&y.button&&(M|=128),y.action===32?M|=32:y.action!==0||E||(M|=3)),M}const p=String.fromCharCode,g={DEFAULT:y=>{const E=[S(y,!1)+32,y.col+32,y.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${p(E[0])}${p(E[1])}${p(E[2])}`},SGR:y=>{const E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.col};${y.row}${E}`},SGR_PIXELS:y=>{const E=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${S(y,!0)};${y.x};${y.y}${E}`}};let b=l.CoreMouseService=class extends x.Disposable{constructor(y,E){super(),this._bufferService=y,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const M of Object.keys(C))this.addProtocol(M,C[M]);for(const M of Object.keys(g))this.addEncoding(M,g[M]);this.reset()}addProtocol(y,E){this._protocols[y]=E}addEncoding(y,E){this._encodings[y]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const E=this._encodings[this._activeEncoding](y);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,E,M){if(M){if(y.x!==E.x||y.y!==E.y)return!1}else if(y.col!==E.col||y.row!==E.row)return!1;return y.button===E.button&&y.action===E.action&&y.ctrl===E.ctrl&&y.alt===E.alt&&y.shift===E.shift}};l.CoreMouseService=b=c([v(0,m.IBufferService),v(1,m.ICoreService)],b)},6975:function(d,l,u){var c=this&&this.__decorate||function(b,y,E,M){var O,T=arguments.length,A=T<3?y:M===null?M=Object.getOwnPropertyDescriptor(y,E):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(b,y,E,M);else for(var k=b.length-1;k>=0;k--)(O=b[k])&&(A=(T<3?O(A):T>3?O(y,E,A):O(y,E))||A);return T>3&&A&&Object.defineProperty(y,E,A),A},v=this&&this.__param||function(b,y){return function(E,M){y(E,M,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const m=u(1439),_=u(8460),x=u(844),C=u(2585),S=Object.freeze({insertMode:!1}),p=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let g=l.CoreService=class extends x.Disposable{constructor(b,y,E){super(),this._bufferService=b,this._logService=y,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,m.clone)(S),this.decPrivateModes=(0,m.clone)(p)}reset(){this.modes=(0,m.clone)(S),this.decPrivateModes=(0,m.clone)(p)}triggerDataEvent(b,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${b}"`,(()=>b.split("").map((M=>M.charCodeAt(0))))),this._onData.fire(b)}triggerBinaryEvent(b){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${b}"`,(()=>b.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(b))}};l.CoreService=g=c([v(0,C.IBufferService),v(1,C.ILogService),v(2,C.IOptionsService)],g)},9074:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const c=u(8055),v=u(8460),m=u(844),_=u(6106);let x=0,C=0;class S extends m.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList((b=>b?.marker.line)),this._onDecorationRegistered=this.register(new v.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new v.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,m.toDisposable)((()=>this.reset())))}registerDecoration(b){if(b.marker.isDisposed)return;const y=new p(b);if(y){const E=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),E.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const b of this._decorations.values())b.dispose();this._decorations.clear()}*getDecorationsAtCell(b,y,E){let M=0,O=0;for(const T of this._decorations.getKeyIterator(y))M=T.options.x??0,O=M+(T.options.width??1),b>=M&&b<O&&(!E||(T.options.layer??"bottom")===E)&&(yield T)}forEachDecorationAtCell(b,y,E,M){this._decorations.forEachByKey(y,(O=>{x=O.options.x??0,C=x+(O.options.width??1),b>=x&&b<C&&(!E||(O.options.layer??"bottom")===E)&&M(O)}))}}l.DecorationService=S;class p extends m.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=c.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=c.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(b){super(),this.options=b,this.onRenderEmitter=this.register(new v.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new v.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=b.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const c=u(2585),v=u(8343);class m{constructor(...x){this._entries=new Map;for(const[C,S]of x)this.set(C,S)}set(x,C){const S=this._entries.get(x);return this._entries.set(x,C),S}forEach(x){for(const[C,S]of this._entries.entries())x(C,S)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}l.ServiceCollection=m,l.InstantiationService=class{constructor(){this._services=new m,this._services.set(c.IInstantiationService,this)}setService(_,x){this._services.set(_,x)}getService(_){return this._services.get(_)}createInstance(_,...x){const C=(0,v.getServiceDependencies)(_).sort(((g,b)=>g.index-b.index)),S=[];for(const g of C){const b=this._services.get(g.id);if(!b)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${g.id}.`);S.push(b)}const p=C.length>0?C[0].index:x.length;if(x.length!==p)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${p+1} conflicts with ${x.length} static arguments`);return new _(...x,...S)}}},7866:function(d,l,u){var c=this&&this.__decorate||function(p,g,b,y){var E,M=arguments.length,O=M<3?g:y===null?y=Object.getOwnPropertyDescriptor(g,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(p,g,b,y);else for(var T=p.length-1;T>=0;T--)(E=p[T])&&(O=(M<3?E(O):M>3?E(g,b,O):E(g,b))||O);return M>3&&O&&Object.defineProperty(g,b,O),O},v=this&&this.__param||function(p,g){return function(b,y){g(b,y,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const m=u(844),_=u(2585),x={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let C,S=l.LogService=class extends m.Disposable{get logLevel(){return this._logLevel}constructor(p){super(),this._optionsService=p,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(p){for(let g=0;g<p.length;g++)typeof p[g]=="function"&&(p[g]=p[g]())}_log(p,g,b){this._evalLazyOptionalParams(b),p.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+g,...b)}trace(p,...g){this._logLevel<=_.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,p,g)}debug(p,...g){this._logLevel<=_.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,p,g)}info(p,...g){this._logLevel<=_.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,p,g)}warn(p,...g){this._logLevel<=_.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,p,g)}error(p,...g){this._logLevel<=_.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,p,g)}};l.LogService=S=c([v(0,_.IOptionsService)],S),l.setTraceLogger=function(p){C=p},l.traceCall=function(p,g,b){if(typeof b.value!="function")throw new Error("not supported");const y=b.value;b.value=function(...E){if(C.logLevel!==_.LogLevelEnum.TRACE)return y.apply(this,E);C.trace(`GlyphRenderer#${y.name}(${E.map((O=>JSON.stringify(O))).join(", ")})`);const M=y.apply(this,E);return C.trace(`GlyphRenderer#${y.name} return`,M),M}}},7302:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const c=u(8460),v=u(844),m=u(6114);l.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:m.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends v.Disposable{constructor(S){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const p={...l.DEFAULT_OPTIONS};for(const g in S)if(g in p)try{const b=S[g];p[g]=this._sanitizeAndValidateOption(g,b)}catch(b){console.error(b)}this.rawOptions=p,this.options={...p},this._setupOptions()}onSpecificOptionChange(S,p){return this.onOptionChange((g=>{g===S&&p(this.rawOptions[S])}))}onMultipleOptionChange(S,p){return this.onOptionChange((g=>{S.indexOf(g)!==-1&&p()}))}_setupOptions(){const S=g=>{if(!(g in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${g}"`);return this.rawOptions[g]},p=(g,b)=>{if(!(g in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${g}"`);b=this._sanitizeAndValidateOption(g,b),this.rawOptions[g]!==b&&(this.rawOptions[g]=b,this._onOptionChange.fire(g))};for(const g in this.rawOptions){const b={get:S.bind(this,g),set:p.bind(this,g)};Object.defineProperty(this.options,g,b)}}_sanitizeAndValidateOption(S,p){switch(S){case"cursorStyle":if(p||(p=l.DEFAULT_OPTIONS[S]),!(function(g){return g==="block"||g==="underline"||g==="bar"})(p))throw new Error(`"${p}" is not a valid value for ${S}`);break;case"wordSeparator":p||(p=l.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof p=="number"&&1<=p&&p<=1e3)break;p=_.includes(p)?p:l.DEFAULT_OPTIONS[S];break;case"cursorWidth":p=Math.floor(p);case"lineHeight":case"tabStopWidth":if(p<1)throw new Error(`${S} cannot be less than 1, value: ${p}`);break;case"minimumContrastRatio":p=Math.max(1,Math.min(21,Math.round(10*p)/10));break;case"scrollback":if((p=Math.min(p,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${p}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(p<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${p}`);break;case"rows":case"cols":if(!p&&p!==0)throw new Error(`${S} must be numeric, value: ${p}`);break;case"windowsPty":p=p??{}}return p}}l.OptionsService=x},2660:function(d,l,u){var c=this&&this.__decorate||function(x,C,S,p){var g,b=arguments.length,y=b<3?C:p===null?p=Object.getOwnPropertyDescriptor(C,S):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(x,C,S,p);else for(var E=x.length-1;E>=0;E--)(g=x[E])&&(y=(b<3?g(y):b>3?g(C,S,y):g(C,S))||y);return b>3&&y&&Object.defineProperty(C,S,y),y},v=this&&this.__param||function(x,C){return function(S,p){C(S,p,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const m=u(2585);let _=l.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const C=this._bufferService.buffer;if(x.id===void 0){const E=C.addMarker(C.ybase+C.y),M={data:x,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(M,E))),this._dataByLinkId.set(M.id,M),M.id}const S=x,p=this._getEntryIdKey(S),g=this._entriesWithId.get(p);if(g)return this.addLineToLink(g.id,C.ybase+C.y),g.id;const b=C.addMarker(C.ybase+C.y),y={id:this._nextId++,key:this._getEntryIdKey(S),data:S,lines:[b]};return b.onDispose((()=>this._removeMarkerFromLink(y,b))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(x,C){const S=this._dataByLinkId.get(x);if(S&&S.lines.every((p=>p.line!==C))){const p=this._bufferService.buffer.addMarker(C);S.lines.push(p),p.onDispose((()=>this._removeMarkerFromLink(S,p)))}}getLinkData(x){return this._dataByLinkId.get(x)?.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,C){const S=x.lines.indexOf(C);S!==-1&&(x.lines.splice(S,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};l.OscLinkService=_=c([v(0,m.IBufferService)],_)},8343:(d,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const u="di$target",c="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(v){return v[c]||[]},l.createDecorator=function(v){if(l.serviceRegistry.has(v))return l.serviceRegistry.get(v);const m=function(_,x,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,p,g){p[u]===p?p[c].push({id:S,index:g}):(p[c]=[{id:S,index:g}],p[u]=p)})(m,_,C)};return m.toString=()=>v,l.serviceRegistry.set(v,m),m}},2585:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const c=u(8343);var v;l.IBufferService=(0,c.createDecorator)("BufferService"),l.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),l.ICoreService=(0,c.createDecorator)("CoreService"),l.ICharsetService=(0,c.createDecorator)("CharsetService"),l.IInstantiationService=(0,c.createDecorator)("InstantiationService"),(function(m){m[m.TRACE=0]="TRACE",m[m.DEBUG=1]="DEBUG",m[m.INFO=2]="INFO",m[m.WARN=3]="WARN",m[m.ERROR=4]="ERROR",m[m.OFF=5]="OFF"})(v||(l.LogLevelEnum=v={})),l.ILogService=(0,c.createDecorator)("LogService"),l.IOptionsService=(0,c.createDecorator)("OptionsService"),l.IOscLinkService=(0,c.createDecorator)("OscLinkService"),l.IUnicodeService=(0,c.createDecorator)("UnicodeService"),l.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(d,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const c=u(8460),v=u(225);class m{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,C,S=!1){return(16777215&x)<<3|(3&C)<<1|(S?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const x=new v.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let C=0,S=0;const p=x.length;for(let g=0;g<p;++g){let b=x.charCodeAt(g);if(55296<=b&&b<=56319){if(++g>=p)return C+this.wcwidth(b);const M=x.charCodeAt(g);56320<=M&&M<=57343?b=1024*(b-55296)+M-56320+65536:C+=this.wcwidth(M)}const y=this.charProperties(b,S);let E=m.extractWidth(y);m.extractShouldJoin(y)&&(E-=m.extractWidth(S)),C+=E,S=y}return C}charProperties(x,C){return this._activeProvider.charProperties(x,C)}}l.UnicodeService=m}},s={};function a(d){var l=s[d];if(l!==void 0)return l.exports;var u=s[d]={exports:{}};return i[d].call(u.exports,u,u.exports,a),u.exports}var f={};return(()=>{var d=f;Object.defineProperty(d,"__esModule",{value:!0}),d.Terminal=void 0;const l=a(9042),u=a(3236),c=a(844),v=a(5741),m=a(8285),_=a(7975),x=a(7090),C=["cols","rows"];class S extends c.Disposable{constructor(g){super(),this._core=this.register(new u.Terminal(g)),this._addonManager=this.register(new v.AddonManager),this._publicOptions={...this._core.options};const b=E=>this._core.options[E],y=(E,M)=>{this._checkReadonlyOptions(E),this._core.options[E]=M};for(const E in this._core.options){const M={get:b.bind(this,E),set:y.bind(this,E)};Object.defineProperty(this._publicOptions,E,M)}}_checkReadonlyOptions(g){if(C.includes(g))throw new Error(`Option "${g}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new m.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const g=this._core.coreService.decPrivateModes;let b="none";switch(this._core.coreMouseService.activeProtocol){case"X10":b="x10";break;case"VT200":b="vt200";break;case"DRAG":b="drag";break;case"ANY":b="any"}return{applicationCursorKeysMode:g.applicationCursorKeys,applicationKeypadMode:g.applicationKeypad,bracketedPasteMode:g.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:b,originMode:g.origin,reverseWraparoundMode:g.reverseWraparound,sendFocusMode:g.sendFocus,wraparoundMode:g.wraparound}}get options(){return this._publicOptions}set options(g){for(const b in g)this._publicOptions[b]=g[b]}blur(){this._core.blur()}focus(){this._core.focus()}resize(g,b){this._verifyIntegers(g,b),this._core.resize(g,b)}open(g){this._core.open(g)}attachCustomKeyEventHandler(g){this._core.attachCustomKeyEventHandler(g)}registerLinkProvider(g){return this._core.registerLinkProvider(g)}registerCharacterJoiner(g){return this._checkProposedApi(),this._core.registerCharacterJoiner(g)}deregisterCharacterJoiner(g){this._checkProposedApi(),this._core.deregisterCharacterJoiner(g)}registerMarker(g=0){return this._verifyIntegers(g),this._core.registerMarker(g)}registerDecoration(g){return this._checkProposedApi(),this._verifyPositiveIntegers(g.x??0,g.width??0,g.height??0),this._core.registerDecoration(g)}hasSelection(){return this._core.hasSelection()}select(g,b,y){this._verifyIntegers(g,b,y),this._core.select(g,b,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(g,b){this._verifyIntegers(g,b),this._core.selectLines(g,b)}dispose(){super.dispose()}scrollLines(g){this._verifyIntegers(g),this._core.scrollLines(g)}scrollPages(g){this._verifyIntegers(g),this._core.scrollPages(g)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(g){this._verifyIntegers(g),this._core.scrollToLine(g)}clear(){this._core.clear()}write(g,b){this._core.write(g,b)}writeln(g,b){this._core.write(g),this._core.write(`\r
66
+ `,b)}paste(g){this._core.paste(g)}refresh(g,b){this._verifyIntegers(g,b),this._core.refresh(g,b)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(g){this._addonManager.loadAddon(this,g)}static get strings(){return l}_verifyIntegers(...g){for(const b of g)if(b===1/0||isNaN(b)||b%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...g){for(const b of g)if(b&&(b===1/0||isNaN(b)||b%1!=0||b<0))throw new Error("This API only accepts positive integers")}}d.Terminal=S})(),f})()))})(Em)),Em.exports}var NH=kH(),Rm={exports:{}},jS;function BH(){return jS||(jS=1,(function(e,n){(function(i,s){e.exports=s()})(self,(()=>(()=>{var i={};return(()=>{var s=i;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(a){this._terminal=a}dispose(){}fit(){const a=this.proposeDimensions();if(!a||!this._terminal||isNaN(a.cols)||isNaN(a.rows))return;const f=this._terminal._core;this._terminal.rows===a.rows&&this._terminal.cols===a.cols||(f._renderService.clear(),this._terminal.resize(a.cols,a.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const a=this._terminal._core,f=a._renderService.dimensions;if(f.css.cell.width===0||f.css.cell.height===0)return;const d=this._terminal.options.scrollback===0?0:a.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(l.getPropertyValue("height")),c=Math.max(0,parseInt(l.getPropertyValue("width"))),v=window.getComputedStyle(this._terminal.element),m=u-(parseInt(v.getPropertyValue("padding-top"))+parseInt(v.getPropertyValue("padding-bottom"))),_=c-(parseInt(v.getPropertyValue("padding-right"))+parseInt(v.getPropertyValue("padding-left")))-d;return{cols:Math.max(2,Math.floor(_/f.css.cell.width)),rows:Math.max(1,Math.floor(m/f.css.cell.height))}}}})(),i})()))})(Rm)),Rm.exports}var jH=BH();class HH{ws=null;handlers;sessionId;reconnectTimer=null;retryCount=0;exitReceived=!1;manualClose=!1;reconnectScheduled=!1;constructor(n,i){this.sessionId=n,this.handlers=i}connect(){this.clearReconnectTimer();const n=window.location.protocol==="https:"?"wss:":"ws:",i=window.location.host,s=`${n}//${i}/api/sessions/${this.sessionId}/terminal?sessionId=${this.sessionId}`;this.ws=new WebSocket(s),this.manualClose=!1,this.exitReceived=!1,this.reconnectScheduled=!1,this.ws.onopen=()=>{this.retryCount=0,this.handlers.onOpen?.()},this.ws.onmessage=a=>{try{const f=JSON.parse(a.data);this.handleServerMessage(f)}catch(f){console.error("Failed to parse WebSocket message:",f)}},this.ws.onerror=a=>{console.error("WebSocket error:",a),this.scheduleReconnect()},this.ws.onclose=()=>{this.handlers.onClose?.(),this.scheduleReconnect()}}handleServerMessage(n){switch(n.type){case"output":{const i=n;this.handlers.onOutput?.(i.data);break}case"exit":{const i=n;this.exitReceived=!0,this.handlers.onExit?.(i.data.code,i.data.signal);break}case"error":{const i=n;this.handlers.onError?.(i.data.message);break}case"pong":{this.handlers.onPong?.();break}default:{console.warn("Unknown server message type:",n.type);break}}}sendInput(n){if(!this.ws||this.ws.readyState!==WebSocket.OPEN){console.error("WebSocket is not connected");return}const i={type:"input",data:n,timestamp:new Date().toISOString()};this.ws.send(JSON.stringify(i))}sendResize(n,i){if(!this.ws||this.ws.readyState!==WebSocket.OPEN){console.error("WebSocket is not connected");return}const s={type:"resize",data:{cols:n,rows:i},timestamp:new Date().toISOString()};this.ws.send(JSON.stringify(s))}sendPing(){if(!this.ws||this.ws.readyState!==WebSocket.OPEN){console.error("WebSocket is not connected");return}const n={type:"ping",timestamp:new Date().toISOString()};this.ws.send(JSON.stringify(n))}disconnect(){this.manualClose=!0,this.exitReceived=!0,this.clearReconnectTimer(),this.ws&&(this.ws.close(),this.ws=null)}isConnected(){return this.ws!==null&&this.ws.readyState===WebSocket.OPEN}scheduleReconnect(){if(this.reconnectScheduled||this.manualClose||this.exitReceived)return;if(this.retryCount>=zH){this.handlers.onError?.("Unable to reconnect to session.");return}this.retryCount+=1;const n=Math.min(2e3,this.retryCount*500);this.clearReconnectTimer(),this.reconnectScheduled=!0,this.reconnectTimer=window.setTimeout(()=>{this.reconnectScheduled=!1,this.connect()},n)}clearReconnectTimer(){this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.reconnectScheduled=!1)}}const zH=5;function PH({sessionId:e,onExit:n,onError:i}){const s=L.useRef(null),a=L.useRef(null),f=L.useRef(null),d=L.useRef(null),l=L.useRef(n),u=L.useRef(i);return L.useEffect(()=>{l.current=n,u.current=i},[n,i]),L.useEffect(()=>{if(!s.current)return;const c=new NH.Terminal({cursorBlink:!0,fontSize:14,fontFamily:'"Cascadia Code", "SF Mono", Monaco, Consolas, monospace',theme:{background:"#1e1e1e",foreground:"#d4d4d4",cursor:"#aeafad",black:"#000000",red:"#cd3131",green:"#0dbc79",yellow:"#e5e510",blue:"#2472c8",magenta:"#bc3fbc",cyan:"#11a8cd",white:"#e5e5e5",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#23d18b",brightYellow:"#f5f543",brightBlue:"#3b8eea",brightMagenta:"#d670d6",brightCyan:"#29b8db",brightWhite:"#ffffff"}}),v=new jH.FitAddon;c.loadAddon(v),c.open(s.current),v.fit(),a.current=c,f.current=v;const m=new HH(e,{onOutput:C=>{c.write(C)},onExit:C=>{c.write(`\r
67
+ \r
68
+ [Process exited with code ${C}]\r
69
+ `),l.current?.(C)},onError:C=>{c.write(`\r
70
+ \r
71
+ [Error: ${C}]\r
72
+ `),u.current?.(C)},onOpen:()=>{c.write(`Connected to session...\r
73
+ `)},onClose:()=>{c.write(`\r
74
+ [Connection closed]\r
75
+ `)}});m.connect(),d.current=m,c.onData(C=>{m.sendInput(C)});const _=()=>{v.fit(),m.isConnected()&&m.sendResize(c.cols,c.rows)};window.addEventListener("resize",_);let x=null;return typeof ResizeObserver<"u"&&(x=new ResizeObserver(()=>{_()}),x.observe(s.current)),()=>{window.removeEventListener("resize",_),x?.disconnect(),m.disconnect(),c.dispose()}},[e]),D.jsx("div",{ref:s,style:{width:"100%",height:"100%",padding:"8px",backgroundColor:"#1e1e1e"}})}function IH({sessionId:e,isFullscreen:n,onToggleFullscreen:i,onExit:s,onError:a}){return e?D.jsxs(Yt,{className:Pe("flex flex-col transition-all",n&&"fixed inset-4 z-50 h-auto"),"data-testid":"active-terminal",children:[D.jsxs(Mn,{className:"flex-shrink-0 pb-2",children:[D.jsxs("div",{className:"flex items-center justify-between",children:[D.jsxs("div",{children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Active Session"}),D.jsx("h3",{className:"text-lg font-semibold",children:"ターミナルセッション"})]}),D.jsxs("div",{className:"flex gap-2",children:[D.jsx(It,{variant:"ghost",size:"sm",onClick:i,children:n?"通常表示に戻す":"最大化"}),n&&D.jsx(It,{variant:"ghost",size:"sm",onClick:i,"aria-label":"ターミナルを閉じる",children:"×"})]})]}),D.jsx("p",{className:"text-sm text-muted-foreground",children:"出力はリアルタイムにストリームされます。終了するとこのパネルは自動で閉じます。"})]}),D.jsx(Jt,{className:Pe("flex-1 overflow-hidden",n&&"h-full"),children:D.jsx("div",{className:Pe("h-full min-h-[300px] overflow-auto rounded-lg border bg-black p-4",n&&"min-h-0"),children:D.jsx(PH,{sessionId:e,onExit:s,onError:a})})})]}):D.jsxs(Yt,{className:"h-full",children:[D.jsxs(Mn,{className:"pb-2",children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Terminal"}),D.jsx("h3",{className:"text-lg font-semibold",children:"セッションは未起動"})]}),D.jsx(Jt,{className:"flex min-h-[200px] items-center justify-center",children:D.jsxs("p",{className:"text-center text-sm text-muted-foreground",children:["上部のアクションからAIツールを起動すると、",D.jsx("br",{}),"このエリアにターミナルが表示されます。"]})})]})}const UH={local:"ローカル",remote:"リモート"},FH={merged:"マージ済み",unmerged:"未マージ",unknown:"状態不明"};function $H(){const{branchName:e}=uT(),n=e?decodeURIComponent(e):"",{data:i,isLoading:s,error:a}=vM(n),f=_M(n),d=HB(),l=PB(),{data:u,isLoading:c}=zB(),v=IB(),{data:m,isLoading:_,error:x}=A1(),[C,S]=L.useState(null),[p,g]=L.useState(!1),[b,y]=L.useState(null),[E,M]=L.useState(!1),[O,T]=L.useState("claude-code"),[A,k]=L.useState("normal"),[q,z]=L.useState(!1),[I,W]=L.useState(""),[U,G]=L.useState(null),H=L.useMemo(()=>VH(i?.commitDate),[i?.commitDate]);L.useEffect(()=>{if(!E)return;const le=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=le}},[E]);const K=m?.tools??[],F=L.useMemo(()=>[{id:"claude-code",label:"Claude Code",target:"claude"},{id:"codex-cli",label:"Codex CLI",target:"codex"},...K.map(le=>({id:le.id,label:le.displayName,target:"custom",definition:le}))],[K]);L.useEffect(()=>{if(!F.length){T("claude-code");return}if(!F.find(le=>le.id===O)){const le=F[0];le&&T(le.id)}},[F,O]);const N=L.useMemo(()=>(u??[]).filter(le=>le.worktreePath===i?.worktreePath).sort((le,_e)=>(_e.startedAt??"").localeCompare(le.startedAt??"")),[u,i?.worktreePath]),$=L.useMemo(()=>{if(!i)return null;if(i.lastToolUsage)return i.lastToolUsage;const le=N[0];return le?{branch:i.name,worktreePath:i.worktreePath??null,toolId:le.toolType==="custom"?le.toolName??"custom":le.toolType,toolLabel:le.toolType==="custom"?le.toolName??"Custom":HS(le.toolType),mode:le.mode??"normal",model:null,timestamp:le.startedAt?Date.parse(le.startedAt):Date.now()}:null},[i,N]);if(s)return D.jsxs("div",{className:"min-h-screen bg-background",children:[D.jsx(_r,{eyebrow:"BRANCH DETAIL",title:"読み込み中...",subtitle:"ブランチ情報を取得しています"}),D.jsx("main",{className:"mx-auto max-w-7xl px-6 py-8",children:D.jsx("div",{className:"flex items-center justify-center py-20",children:D.jsxs("div",{className:"text-center",children:[D.jsx("div",{className:"mb-4 text-4xl",children:"⏳"}),D.jsx("p",{className:"text-muted-foreground",children:"Loading branch..."})]})})})]});if(a)return D.jsxs("div",{className:"min-h-screen bg-background",children:[D.jsx(_r,{eyebrow:"BRANCH DETAIL",title:"エラー"}),D.jsxs("main",{className:"mx-auto max-w-7xl px-6 py-8",children:[D.jsx(yi,{variant:"destructive",children:D.jsx(bi,{children:a instanceof Error?a.message:"未知のエラーです"})}),D.jsx("div",{className:"mt-4",children:D.jsx(It,{variant:"ghost",asChild:!0,children:D.jsx(pr,{to:"/",children:"← ブランチ一覧に戻る"})})})]})]});if(!i)return D.jsxs("div",{className:"min-h-screen bg-background",children:[D.jsx(_r,{eyebrow:"BRANCH DETAIL",title:"Branch not found"}),D.jsxs("main",{className:"mx-auto max-w-7xl px-6 py-8",children:[D.jsx("p",{className:"mb-4 text-muted-foreground",children:"指定されたブランチは存在しません。"}),D.jsx(It,{variant:"ghost",asChild:!0,children:D.jsx(pr,{to:"/",children:"← ブランチ一覧に戻る"})})]})]});const B=!!i.worktreePath,P=i.divergence??null,Q=!!(P&&P.ahead>0&&P.behind>0),J=!!(i.worktreePath&&P&&P.behind>0&&P.ahead===0&&!Q),ae=f.isPending,Z=F.find(le=>le.id===O),X=async()=>{try{await d.mutateAsync({branchName:i.name,createBranch:!1}),y({type:"success",message:`${i.name} のWorktreeを作成しました。`})}catch(le){y({type:"error",message:Ou(le,"Worktreeの作成に失敗しました")})}},V=async()=>{if(!i.worktreePath){y({type:"error",message:"Worktreeが存在しないため、先に作成してください。"});return}if(!Z){y({type:"error",message:"起動するAIツールを選択してください"});return}if(J){y({type:"error",message:"リモートの更新を取り込むまでAIツールは起動できません。"});return}if(Q){y({type:"error",message:"差分を解消してから起動してください。"});return}if(!(q&&!window.confirm("権限チェックをスキップして起動します。続行しますか?"))){g(!0);try{const le=Z.target==="codex"?"codex-cli":Z.target==="custom"?"custom":"claude-code",_e=I.split(/\s+/).map(Be=>Be.trim()).filter(Boolean),Ce={toolType:le,toolName:Z.target==="custom"?Z.id:null,...Z.target==="custom"?{customToolId:Z.id}:{},mode:A,worktreePath:i.worktreePath,skipPermissions:q,...Z.target==="codex"?{bypassApprovals:q}:{},..._e.length?{extraArgs:_e}:{}},He=await l.mutateAsync(Ce);S(He.sessionId),M(!1),y({type:"info",message:`${HS(le,Z)} を起動しました。`})}catch(le){y({type:"error",message:Ou(le,"セッションの起動に失敗しました")})}finally{g(!1)}}},ie=async le=>{G(le);try{await v.mutateAsync(le),y({type:"success",message:"セッションを終了しました"}),C===le&&S(null)}catch(_e){y({type:"error",message:Ou(_e,"セッションの終了に失敗しました")})}finally{G(null)}},de=async()=>{if(!i.worktreePath){y({type:"error",message:"Worktreeが存在しないため同期できません。"});return}try{const le=await f.mutateAsync({worktreePath:i.worktreePath});if(le.pullStatus==="success")y({type:"success",message:"リモートの最新変更を取り込みました。"});else{const _e=le.warnings?.join(`
76
+ `)??"fast-forward pull が完了しませんでした";y({type:"error",message:`git pull --ff-only が失敗しました。
77
+ ${_e}`})}}catch(le){y({type:"error",message:Ou(le,"Git同期に失敗しました")})}},re=le=>{S(null),M(!1),y({type:le===0?"success":"error",message:`セッションがコード ${le} で終了しました。`})};return D.jsxs("div",{className:"min-h-screen bg-background",children:[E&&D.jsx("div",{className:"fixed inset-0 z-40 bg-black/80","aria-hidden":"true",onClick:()=>M(!1)}),D.jsxs(_r,{eyebrow:"BRANCH DETAIL",title:i.name,subtitle:`最新コミット ${i.commitHash.slice(0,7)} · ${H}`,children:[D.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[D.jsx(vt,{variant:i.type==="local"?"local":"remote",children:UH[i.type]}),D.jsx(vt,{variant:i.mergeStatus==="merged"?"success":i.mergeStatus==="unmerged"?"warning":"outline",children:FH[i.mergeStatus]}),D.jsx(vt,{variant:i.worktreePath?"success":"outline",children:i.worktreePath?"Worktreeあり":"Worktree未作成"})]}),D.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[D.jsx(It,{variant:"ghost",size:"sm",asChild:!0,children:D.jsx(pr,{to:"/",children:"← ブランチ一覧"})}),B?D.jsx(It,{variant:"secondary",asChild:!0,children:D.jsx(pr,{to:"/config",children:"カスタムツール設定"})}):D.jsx(It,{onClick:X,disabled:d.isPending,children:d.isPending?"作成中...":"Worktreeを作成"})]})]}),b&&D.jsx("div",{className:"mx-auto max-w-7xl px-6 pt-4",children:D.jsx(yi,{variant:b.type==="error"?"destructive":b.type==="success"?"success":"info",children:D.jsx(bi,{children:b.message})})}),D.jsx("main",{className:"mx-auto max-w-7xl space-y-6 px-6 py-8",children:D.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1fr_400px]",children:[D.jsxs("div",{className:"space-y-6",children:[D.jsx(TH,{branch:i,availableTools:F,selectedToolId:O,selectedMode:A,skipPermissions:q,extraArgsText:I,isConfigLoading:_,configError:x??null,isStartingSession:p,isSyncingBranch:ae,needsRemoteSync:J,hasBlockingDivergence:Q,onToolChange:T,onModeChange:k,onSkipPermissionsChange:z,onExtraArgsChange:W,onStartSession:V,onSyncBranch:de}),D.jsx(YB,{sessions:N,isLoading:c,terminatingSessionId:U,isDeleting:v.isPending,onTerminate:ie,onSelectSession:S}),D.jsx(LH,{branch:i,formattedCommitDate:H,latestToolUsage:$})]}),D.jsx("div",{className:"lg:sticky lg:top-6 lg:self-start",children:D.jsx(IH,{sessionId:C,isFullscreen:E,onToggleFullscreen:()=>M(le=>!le),onExit:re,onError:le=>y({type:"error",message:le??"不明なエラー"})})})]})})]})}function VH(e){if(!e)return"日時不明";try{return new Intl.DateTimeFormat("ja-JP",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(e))}catch{return e}}function Ou(e,n){return e instanceof wx?`${e.message}${e.details?`
78
+ ${e.details}`:""}`:e instanceof Error?e.message:n}function HS(e,n){return e==="custom"&&n?.target==="custom"?n.label:e==="codex-cli"?"Codex CLI":"Claude Code"}const qH=/^[A-Z0-9_]+$/;function XC(e){const n={id:e?.id??`env-${Date.now()}-${Math.random().toString(36).slice(2)}`,key:e?.key??"",value:e?.value??""};return typeof e?.importedFromOs=="boolean"&&(n.importedFromOs=e.importedFromOs),e?.lastUpdated&&(n.lastUpdated=e.lastUpdated),n}function WH(e){return e.key?!qH.test(e.key):!0}function zS({title:e,rows:n,onChange:i,description:s,allowAdd:a=!0,emptyLabel:f="環境変数はまだありません"}){const d=(c,v,m)=>{i(n.map(_=>_.id===c?{..._,[v]:v==="key"?m.toUpperCase().replace(/[^A-Z0-9_]/g,"_"):m}:_))},l=c=>{i(n.filter(v=>v.id!==c))},u=()=>{i([...n,XC()])};return D.jsxs("div",{className:"space-y-4",children:[D.jsxs("div",{className:"flex items-start justify-between gap-4",children:[D.jsxs("div",{children:[D.jsx("h3",{className:"font-semibold",children:e}),s&&D.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s})]}),a&&D.jsx(It,{variant:"secondary",size:"sm",onClick:u,children:"変数を追加"})]}),n.length===0?D.jsx("p",{className:"py-4 text-center text-sm text-muted-foreground",children:f}):D.jsx("div",{className:"rounded-md border",children:D.jsxs(Qp,{children:[D.jsx(Zp,{children:D.jsxs(kl,{children:[D.jsx(kr,{children:"キー"}),D.jsx(kr,{children:"値"}),D.jsx(kr,{className:"w-24 text-right",children:"操作"})]})}),D.jsx(Jp,{children:n.map(c=>{const v=WH(c);return D.jsxs(kl,{className:Pe(v&&"bg-destructive/10"),children:[D.jsxs(Nr,{className:"space-y-1",children:[D.jsx(Ll,{type:"text",value:c.key,onChange:m=>d(c.id,"key",m.target.value),placeholder:"EXAMPLE_KEY",className:Pe(v&&"border-destructive")}),D.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.importedFromOs&&D.jsx(vt,{variant:"outline",className:"text-xs",children:"OSから取り込み"}),c.lastUpdated&&D.jsxs("span",{className:"text-xs text-muted-foreground",children:["更新: ",new Date(c.lastUpdated).toLocaleString()]})]}),v&&D.jsx("p",{className:"text-xs text-destructive",children:"A-Z,0-9,_ のみ使用できます"})]}),D.jsx(Nr,{children:D.jsx(Ll,{type:"text",value:c.value,onChange:m=>d(c.id,"value",m.target.value),placeholder:"値"})}),D.jsx(Nr,{className:"text-right",children:D.jsx(It,{variant:"ghost",size:"sm",onClick:()=>l(c.id),children:"削除"})})]},c.id)})})]})})]})}function PS(e){return e?e.map(n=>{const i={key:n.key,value:n.value};return typeof n.importedFromOs=="boolean"&&(i.importedFromOs=n.importedFromOs),n.lastUpdated&&(i.lastUpdated=n.lastUpdated),XC(i)}):[]}function hh(e){return e.filter(n=>n.key.trim().length>0).map(n=>({key:n.key.trim().toUpperCase(),value:n.value}))}function YH(e,n,i){const s=(e?.tools??[]).map(a=>({...a,env:hh(i[a.id]??[])}));return{version:e?.version??"1.0.0",env:hh(n),tools:s}}function KH(){const{data:e,isLoading:n,error:i}=A1(),s=UB(),[a,f]=L.useState([]),[d,l]=L.useState({}),[u,c]=L.useState(null);L.useEffect(()=>{if(!e)return;f(PS(e.env));const S={};e.tools?.forEach(p=>{S[p.id]=PS(p.env)}),l(S)},[e]);const v=L.useMemo(()=>JSON.stringify(e?.env??[]),[e?.env]),m=L.useMemo(()=>JSON.stringify(hh(a)),[a]),_=L.useMemo(()=>{const S=a.some(b=>!b.key||/[^A-Z0-9_]/.test(b.key)),p=a.some(b=>b.key&&b.value.trim().length===0),g=Object.values(d).some(b=>b.some(y=>!y.key||/[^A-Z0-9_]/.test(y.key)||y.value.trim().length===0));return S||p||g},[a,d]),x=L.useMemo(()=>{if(v!==m)return!0;if(!e)return!1;const S=e.tools?.map(g=>hh(d[g.id]??[]))??[],p=e.tools?.map(g=>g.env??[])??[];return JSON.stringify(S)!==JSON.stringify(p)},[e,v,m,d]),C=async()=>{if(e)try{const S=YH(e,a,d);await s.mutateAsync(S),c({type:"success",message:"設定を保存しました"})}catch(S){c({type:"error",message:S instanceof Error?S.message:"保存に失敗しました"})}};return n?D.jsxs("div",{className:"min-h-screen bg-background",children:[D.jsx(_r,{eyebrow:"CONFIG",title:"環境変数の管理",subtitle:"読み込み中..."}),D.jsx("main",{className:"mx-auto max-w-7xl px-6 py-8",children:D.jsx("div",{className:"flex items-center justify-center py-20",children:D.jsx("p",{className:"text-muted-foreground",children:"設定を読み込んでいます..."})})})]}):i?D.jsxs("div",{className:"min-h-screen bg-background",children:[D.jsx(_r,{eyebrow:"CONFIG",title:"エラー"}),D.jsxs("main",{className:"mx-auto max-w-7xl px-6 py-8",children:[D.jsx(yi,{variant:"destructive",children:D.jsx(bi,{children:i instanceof Error?i.message:"未知のエラーです"})}),D.jsx("div",{className:"mt-4",children:D.jsx(It,{variant:"ghost",asChild:!0,children:D.jsx(pr,{to:"/",children:"← ブランチ一覧に戻る"})})})]})]}):D.jsxs("div",{className:"min-h-screen bg-background",children:[D.jsx(_r,{eyebrow:"CONFIG",title:"環境変数の管理",subtitle:"共通環境変数とツールごとの上書きをブラウザから編集できます。",children:D.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[D.jsx(It,{variant:"ghost",size:"sm",asChild:!0,children:D.jsx(pr,{to:"/",children:"← ブランチ一覧へ"})}),D.jsx(It,{onClick:C,disabled:s.isPending||_||!x,children:s.isPending?"保存中...":"保存"})]})}),u&&D.jsx("div",{className:"mx-auto max-w-7xl px-6 pt-4",children:D.jsx(yi,{variant:u.type==="error"?"destructive":"success",children:D.jsx(bi,{children:u.message})})}),D.jsxs("main",{className:"mx-auto max-w-7xl space-y-6 px-6 py-8",children:[D.jsx(Yt,{children:D.jsx(Jt,{className:"pt-6",children:D.jsx(zS,{title:"共通環境変数",description:"全てのAIツールで共有される値。PAT やプロキシ設定などはこちらに入力してください。",rows:a,onChange:f})})}),D.jsxs(Yt,{children:[D.jsxs(Mn,{className:"pb-3",children:[D.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Tool-specific"}),D.jsx("h3",{className:"mt-1 text-lg font-semibold",children:"ツール固有の環境変数"}),D.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"各ツール固有に上書きしたい値がある場合はこちらから設定します。 共通設定との競合がある場合はツール設定が優先されます。"})]}),D.jsxs(Jt,{className:"space-y-6",children:[e?.tools?.map(S=>D.jsx("div",{className:"rounded-lg border p-4",children:D.jsx(zS,{title:S.displayName,description:`${S.executionType} / ${S.command}`,rows:d[S.id]??[],onChange:p=>l(g=>({...g,[S.id]:p}))})},S.id)),!e?.tools?.length&&D.jsx("p",{className:"py-4 text-center text-sm text-muted-foreground",children:"登録されているツールがありません。"})]})]})]})]})}const GH=tM([{path:"/",element:D.jsx(BB,{})},{path:"/:branchName",element:D.jsx($H,{})},{path:"/config",element:D.jsx(KH,{})}]),XH=new jR({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1,staleTime:3e4}}}),QC=document.getElementById("root");if(!QC)throw new Error("Root element not found");dR.createRoot(QC).render(D.jsx(Or.StrictMode,{children:D.jsx(HR,{client:XH,children:D.jsx(mM,{router:GH})})}));