@launchsecure/launch-kit 0.0.42 → 0.0.43

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 (77) hide show
  1. package/dist/chart-client/assets/index-DOKsFe5i.css +1 -0
  2. package/dist/chart-client/index.html +2 -2
  3. package/dist/client/assets/index-BqiDfvZi.js +294 -0
  4. package/dist/client/assets/index-Mewz-s77.css +32 -0
  5. package/dist/client/index.html +2 -2
  6. package/dist/council-client/assets/index-o_3y7Z0J.css +1 -0
  7. package/dist/council-client/index.html +2 -2
  8. package/dist/deck-client/assets/{_baseUniq-BrhDuG3C.js → _baseUniq-C6w7kg8x.js} +1 -1
  9. package/dist/deck-client/assets/{arc-DXtPHMhw.js → arc-Cx9pT3Nn.js} +1 -1
  10. package/dist/deck-client/assets/{architectureDiagram-Q4EWVU46-Cs9IdLQQ.js → architectureDiagram-Q4EWVU46-BITSj3vA.js} +1 -1
  11. package/dist/deck-client/assets/{blockDiagram-DXYQGD6D--wpvoBAt.js → blockDiagram-DXYQGD6D-BehOFuwh.js} +1 -1
  12. package/dist/deck-client/assets/{c4Diagram-AHTNJAMY-BNIKE8-Z.js → c4Diagram-AHTNJAMY-BZTYM4na.js} +1 -1
  13. package/dist/deck-client/assets/channel-Cw2WDt9a.js +1 -0
  14. package/dist/deck-client/assets/{chunk-4BX2VUAB-Bz3EWmUo.js → chunk-4BX2VUAB-CCUx5CTd.js} +1 -1
  15. package/dist/deck-client/assets/{chunk-4TB4RGXK-D55BBvVZ.js → chunk-4TB4RGXK-UDZXXga6.js} +1 -1
  16. package/dist/deck-client/assets/{chunk-55IACEB6-BzjEcoTi.js → chunk-55IACEB6-CfcU6PIW.js} +1 -1
  17. package/dist/deck-client/assets/{chunk-EDXVE4YY-CH1vs4Lu.js → chunk-EDXVE4YY-BK6F5Fof.js} +1 -1
  18. package/dist/deck-client/assets/{chunk-FMBD7UC4-CVRnaGM0.js → chunk-FMBD7UC4-C-2idlFB.js} +1 -1
  19. package/dist/deck-client/assets/{chunk-OYMX7WX6-BCTV_aEZ.js → chunk-OYMX7WX6-D6hBkYLP.js} +1 -1
  20. package/dist/deck-client/assets/{chunk-QZHKN3VN-BqM8r4ee.js → chunk-QZHKN3VN-DixNpysA.js} +1 -1
  21. package/dist/deck-client/assets/{chunk-YZCP3GAM-Rhbb691A.js → chunk-YZCP3GAM-Cd3pNBtQ.js} +1 -1
  22. package/dist/deck-client/assets/classDiagram-6PBFFD2Q-JLUXVCUr.js +1 -0
  23. package/dist/deck-client/assets/classDiagram-v2-HSJHXN6E-JLUXVCUr.js +1 -0
  24. package/dist/deck-client/assets/clone-H0XCnSb6.js +1 -0
  25. package/dist/deck-client/assets/{cose-bilkent-S5V4N54A-fWyBR9Nn.js → cose-bilkent-S5V4N54A-OF3JWdEt.js} +1 -1
  26. package/dist/deck-client/assets/{dagre-KV5264BT-Ds0Sqext.js → dagre-KV5264BT-Bqu-qcv4.js} +1 -1
  27. package/dist/deck-client/assets/{diagram-5BDNPKRD-BGz_X007.js → diagram-5BDNPKRD--0eHmUBS.js} +1 -1
  28. package/dist/deck-client/assets/{diagram-G4DWMVQ6-C78jeb-r.js → diagram-G4DWMVQ6-nss6oL20.js} +1 -1
  29. package/dist/deck-client/assets/{diagram-MMDJMWI5-BdoHW8mF.js → diagram-MMDJMWI5-D_gSGnLR.js} +1 -1
  30. package/dist/deck-client/assets/{diagram-TYMM5635-C8i9zc-U.js → diagram-TYMM5635-BIt-P6Pk.js} +1 -1
  31. package/dist/deck-client/assets/{erDiagram-SMLLAGMA-DplAZ-yG.js → erDiagram-SMLLAGMA-Bi-E4KQm.js} +1 -1
  32. package/dist/deck-client/assets/{flowDiagram-DWJPFMVM-F3N9yTAB.js → flowDiagram-DWJPFMVM-DMJCvLMA.js} +1 -1
  33. package/dist/deck-client/assets/{ganttDiagram-T4ZO3ILL-DebdM4S5.js → ganttDiagram-T4ZO3ILL-C3xgEoPD.js} +1 -1
  34. package/dist/deck-client/assets/{gitGraphDiagram-UUTBAWPF-htCk0oPz.js → gitGraphDiagram-UUTBAWPF-CD0BEGAW.js} +1 -1
  35. package/dist/deck-client/assets/{graph-Dtxc2PT4.js → graph-Dtsd9Jwe.js} +1 -1
  36. package/dist/deck-client/assets/index-C6YxyZay.css +1 -0
  37. package/dist/deck-client/assets/{index-CwAiam97.js → index-TFX8vtTG.js} +1 -1
  38. package/dist/deck-client/assets/{infoDiagram-42DDH7IO-gTxegviJ.js → infoDiagram-42DDH7IO-7IcQYqe_.js} +1 -1
  39. package/dist/deck-client/assets/{ishikawaDiagram-UXIWVN3A-DYSEsfUK.js → ishikawaDiagram-UXIWVN3A-DsCEbx3u.js} +1 -1
  40. package/dist/deck-client/assets/{journeyDiagram-VCZTEJTY-DgVc1q4D.js → journeyDiagram-VCZTEJTY-1mP2JwCk.js} +1 -1
  41. package/dist/deck-client/assets/{kanban-definition-6JOO6SKY-DcOf3i9N.js → kanban-definition-6JOO6SKY-vT0Xrqh9.js} +1 -1
  42. package/dist/deck-client/assets/{layout-CHP9HIw4.js → layout-Cw4rS2pn.js} +1 -1
  43. package/dist/deck-client/assets/{linear-XjVb7x4Q.js → linear-CzOjL-Ih.js} +1 -1
  44. package/dist/deck-client/assets/{mermaid.core-bouKOnsR.js → mermaid.core-DYi3A-qK.js} +4 -4
  45. package/dist/deck-client/assets/{min-Jl4GV9DB.js → min-DstloRoL.js} +1 -1
  46. package/dist/deck-client/assets/{mindmap-definition-QFDTVHPH-FXXf4cJx.js → mindmap-definition-QFDTVHPH-D-cCX2d2.js} +1 -1
  47. package/dist/deck-client/assets/{pieDiagram-DEJITSTG-Dl4plCTi.js → pieDiagram-DEJITSTG-BqW2NTmy.js} +1 -1
  48. package/dist/deck-client/assets/{quadrantDiagram-34T5L4WZ-BeOEeelg.js → quadrantDiagram-34T5L4WZ-DbJoWA8f.js} +1 -1
  49. package/dist/deck-client/assets/{requirementDiagram-MS252O5E-CBh1jchM.js → requirementDiagram-MS252O5E-DQrUiz_d.js} +1 -1
  50. package/dist/deck-client/assets/{sankeyDiagram-XADWPNL6-BK6gG-ub.js → sankeyDiagram-XADWPNL6-kB7PZc3g.js} +1 -1
  51. package/dist/deck-client/assets/{sequenceDiagram-FGHM5R23-BtQwzsF5.js → sequenceDiagram-FGHM5R23-CpyVu1TN.js} +1 -1
  52. package/dist/deck-client/assets/{stateDiagram-FHFEXIEX--kLQOi8R.js → stateDiagram-FHFEXIEX-CjqQcnty.js} +1 -1
  53. package/dist/deck-client/assets/stateDiagram-v2-QKLJ7IA2-tfMSn8xx.js +1 -0
  54. package/dist/deck-client/assets/{timeline-definition-GMOUNBTQ-CQ_-CLh7.js → timeline-definition-GMOUNBTQ-B2PAO9bk.js} +1 -1
  55. package/dist/deck-client/assets/{vennDiagram-DHZGUBPP-DBhKYAFT.js → vennDiagram-DHZGUBPP-C0G3ItCr.js} +1 -1
  56. package/dist/deck-client/assets/{wardley-RL74JXVD-DLKe29q9.js → wardley-RL74JXVD-B0TVaOmp.js} +1 -1
  57. package/dist/deck-client/assets/{wardleyDiagram-NUSXRM2D-Brb8ezsV.js → wardleyDiagram-NUSXRM2D-B-qtbNZe.js} +1 -1
  58. package/dist/deck-client/assets/{xychartDiagram-5P7HB3ND-LogZ0Az9.js → xychartDiagram-5P7HB3ND-41kcBoBE.js} +1 -1
  59. package/dist/deck-client/index.html +2 -2
  60. package/dist/server/cli.js +484 -77
  61. package/dist/server/init-entry.js +47 -21
  62. package/dist/server/launch-bot-entry.js +38 -4
  63. package/dist/server/radar-docker-init-entry.js +46 -20
  64. package/dist/server/rover-entry.js +6047 -5155
  65. package/package.json +1 -1
  66. package/dist/chart-client/assets/index-Dd6IotOZ.css +0 -1
  67. package/dist/client/assets/index-BoIjawzY.js +0 -294
  68. package/dist/client/assets/index-DE0uje6k.css +0 -32
  69. package/dist/council-client/assets/index-CGYusOCK.css +0 -1
  70. package/dist/deck-client/assets/channel-Bb5wIjTD.js +0 -1
  71. package/dist/deck-client/assets/classDiagram-6PBFFD2Q-CN-ZYMbT.js +0 -1
  72. package/dist/deck-client/assets/classDiagram-v2-HSJHXN6E-CN-ZYMbT.js +0 -1
  73. package/dist/deck-client/assets/clone-D6e7poKG.js +0 -1
  74. package/dist/deck-client/assets/index-evAPhGvM.css +0 -1
  75. package/dist/deck-client/assets/stateDiagram-v2-QKLJ7IA2-CHEPjgB0.js +0 -1
  76. /package/dist/chart-client/assets/{index-CrYM1-ac.js → index-DJQYgFcp.js} +0 -0
  77. /package/dist/council-client/assets/{index-DkTFX53U.js → index-Wn06apTg.js} +0 -0
@@ -0,0 +1,294 @@
1
+ function hx(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(n,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function r(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();function op(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ap={exports:{}},ta={},lp={exports:{}},le={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var oi=Symbol.for("react.element"),fx=Symbol.for("react.portal"),px=Symbol.for("react.fragment"),mx=Symbol.for("react.strict_mode"),gx=Symbol.for("react.profiler"),vx=Symbol.for("react.provider"),_x=Symbol.for("react.context"),yx=Symbol.for("react.forward_ref"),xx=Symbol.for("react.suspense"),wx=Symbol.for("react.memo"),Sx=Symbol.for("react.lazy"),Fd=Symbol.iterator;function bx(e){return e===null||typeof e!="object"?null:(e=Fd&&e[Fd]||e["@@iterator"],typeof e=="function"?e:null)}var cp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},up=Object.assign,dp={};function Qn(e,t,r){this.props=e,this.context=t,this.refs=dp,this.updater=r||cp}Qn.prototype.isReactComponent={};Qn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Qn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function hp(){}hp.prototype=Qn.prototype;function Xc(e,t,r){this.props=e,this.context=t,this.refs=dp,this.updater=r||cp}var Yc=Xc.prototype=new hp;Yc.constructor=Xc;up(Yc,Qn.prototype);Yc.isPureReactComponent=!0;var $d=Array.isArray,fp=Object.prototype.hasOwnProperty,Jc={current:null},pp={key:!0,ref:!0,__self:!0,__source:!0};function mp(e,t,r){var n,s={},o=null,u=null;if(t!=null)for(n in t.ref!==void 0&&(u=t.ref),t.key!==void 0&&(o=""+t.key),t)fp.call(t,n)&&!pp.hasOwnProperty(n)&&(s[n]=t[n]);var i=arguments.length-2;if(i===1)s.children=r;else if(1<i){for(var a=Array(i),d=0;d<i;d++)a[d]=arguments[d+2];s.children=a}if(e&&e.defaultProps)for(n in i=e.defaultProps,i)s[n]===void 0&&(s[n]=i[n]);return{$$typeof:oi,type:e,key:o,ref:u,props:s,_owner:Jc.current}}function Cx(e,t){return{$$typeof:oi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Qc(e){return typeof e=="object"&&e!==null&&e.$$typeof===oi}function kx(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Hd=/\/+/g;function Va(e,t){return typeof e=="object"&&e!==null&&e.key!=null?kx(""+e.key):t.toString(36)}function to(e,t,r,n,s){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var u=!1;if(e===null)u=!0;else switch(o){case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case oi:case fx:u=!0}}if(u)return u=e,s=s(u),e=n===""?"."+Va(u,0):n,$d(s)?(r="",e!=null&&(r=e.replace(Hd,"$&/")+"/"),to(s,t,r,"",function(d){return d})):s!=null&&(Qc(s)&&(s=Cx(s,r+(!s.key||u&&u.key===s.key?"":(""+s.key).replace(Hd,"$&/")+"/")+e)),t.push(s)),1;if(u=0,n=n===""?".":n+":",$d(e))for(var i=0;i<e.length;i++){o=e[i];var a=n+Va(o,i);u+=to(o,t,r,a,s)}else if(a=bx(e),typeof a=="function")for(e=a.call(e),i=0;!(o=e.next()).done;)o=o.value,a=n+Va(o,i++),u+=to(o,t,r,a,s);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return u}function Ei(e,t,r){if(e==null)return e;var n=[],s=0;return to(e,n,"","",function(o){return t.call(r,o,s++)}),n}function Ex(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var ze={current:null},ro={transition:null},Rx={ReactCurrentDispatcher:ze,ReactCurrentBatchConfig:ro,ReactCurrentOwner:Jc};function gp(){throw Error("act(...) is not supported in production builds of React.")}le.Children={map:Ei,forEach:function(e,t,r){Ei(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Ei(e,function(){t++}),t},toArray:function(e){return Ei(e,function(t){return t})||[]},only:function(e){if(!Qc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};le.Component=Qn;le.Fragment=px;le.Profiler=gx;le.PureComponent=Xc;le.StrictMode=mx;le.Suspense=xx;le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Rx;le.act=gp;le.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=up({},e.props),s=e.key,o=e.ref,u=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,u=Jc.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(a in t)fp.call(t,a)&&!pp.hasOwnProperty(a)&&(n[a]=t[a]===void 0&&i!==void 0?i[a]:t[a])}var a=arguments.length-2;if(a===1)n.children=r;else if(1<a){i=Array(a);for(var d=0;d<a;d++)i[d]=arguments[d+2];n.children=i}return{$$typeof:oi,type:e.type,key:s,ref:o,props:n,_owner:u}};le.createContext=function(e){return e={$$typeof:_x,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:vx,_context:e},e.Consumer=e};le.createElement=mp;le.createFactory=function(e){var t=mp.bind(null,e);return t.type=e,t};le.createRef=function(){return{current:null}};le.forwardRef=function(e){return{$$typeof:yx,render:e}};le.isValidElement=Qc;le.lazy=function(e){return{$$typeof:Sx,_payload:{_status:-1,_result:e},_init:Ex}};le.memo=function(e,t){return{$$typeof:wx,type:e,compare:t===void 0?null:t}};le.startTransition=function(e){var t=ro.transition;ro.transition={};try{e()}finally{ro.transition=t}};le.unstable_act=gp;le.useCallback=function(e,t){return ze.current.useCallback(e,t)};le.useContext=function(e){return ze.current.useContext(e)};le.useDebugValue=function(){};le.useDeferredValue=function(e){return ze.current.useDeferredValue(e)};le.useEffect=function(e,t){return ze.current.useEffect(e,t)};le.useId=function(){return ze.current.useId()};le.useImperativeHandle=function(e,t,r){return ze.current.useImperativeHandle(e,t,r)};le.useInsertionEffect=function(e,t){return ze.current.useInsertionEffect(e,t)};le.useLayoutEffect=function(e,t){return ze.current.useLayoutEffect(e,t)};le.useMemo=function(e,t){return ze.current.useMemo(e,t)};le.useReducer=function(e,t,r){return ze.current.useReducer(e,t,r)};le.useRef=function(e){return ze.current.useRef(e)};le.useState=function(e){return ze.current.useState(e)};le.useSyncExternalStore=function(e,t,r){return ze.current.useSyncExternalStore(e,t,r)};le.useTransition=function(){return ze.current.useTransition()};le.version="18.3.1";lp.exports=le;var S=lp.exports;const Ve=op(S),ra=hx({__proto__:null,default:Ve},[S]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Px=S,Tx=Symbol.for("react.element"),Nx=Symbol.for("react.fragment"),Lx=Object.prototype.hasOwnProperty,Ax=Px.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Dx={key:!0,ref:!0,__self:!0,__source:!0};function vp(e,t,r){var n,s={},o=null,u=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(u=t.ref);for(n in t)Lx.call(t,n)&&!Dx.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:Tx,type:e,key:o,ref:u,props:s,_owner:Ax.current}}ta.Fragment=Nx;ta.jsx=vp;ta.jsxs=vp;ap.exports=ta;var v=ap.exports,Il={},_p={exports:{}},at={},yp={exports:{}},xp={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(B,P){var N=B.length;B.push(P);e:for(;0<N;){var j=N-1>>>1,D=B[j];if(0<s(D,P))B[j]=P,B[N]=D,N=j;else break e}}function r(B){return B.length===0?null:B[0]}function n(B){if(B.length===0)return null;var P=B[0],N=B.pop();if(N!==P){B[0]=N;e:for(var j=0,D=B.length,W=D>>>1;j<W;){var $=2*(j+1)-1,V=B[$],q=$+1,I=B[q];if(0>s(V,N))q<D&&0>s(I,V)?(B[j]=I,B[q]=N,j=q):(B[j]=V,B[$]=N,j=$);else if(q<D&&0>s(I,N))B[j]=I,B[q]=N,j=q;else break e}}return P}function s(B,P){var N=B.sortIndex-P.sortIndex;return N!==0?N:B.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,i=u.now();e.unstable_now=function(){return u.now()-i}}var a=[],d=[],m=1,c=null,g=3,y=!1,C=!1,_=!1,p=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,l=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function f(B){for(var P=r(d);P!==null;){if(P.callback===null)n(d);else if(P.startTime<=B)n(d),P.sortIndex=P.expirationTime,t(a,P);else break;P=r(d)}}function x(B){if(_=!1,f(B),!C)if(r(a)!==null)C=!0,G(E);else{var P=r(d);P!==null&&K(x,P.startTime-B)}}function E(B,P){C=!1,_&&(_=!1,h(w),w=-1),y=!0;var N=g;try{for(f(P),c=r(a);c!==null&&(!(c.expirationTime>P)||B&&!M());){var j=c.callback;if(typeof j=="function"){c.callback=null,g=c.priorityLevel;var D=j(c.expirationTime<=P);P=e.unstable_now(),typeof D=="function"?c.callback=D:c===r(a)&&n(a),f(P)}else n(a);c=r(a)}if(c!==null)var W=!0;else{var $=r(d);$!==null&&K(x,$.startTime-P),W=!1}return W}finally{c=null,g=N,y=!1}}var k=!1,b=null,w=-1,R=5,T=-1;function M(){return!(e.unstable_now()-T<R)}function O(){if(b!==null){var B=e.unstable_now();T=B;var P=!0;try{P=b(!0,B)}finally{P?A():(k=!1,b=null)}}else k=!1}var A;if(typeof l=="function")A=function(){l(O)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,U=F.port2;F.port1.onmessage=O,A=function(){U.postMessage(null)}}else A=function(){p(O,0)};function G(B){b=B,k||(k=!0,A())}function K(B,P){w=p(function(){B(e.unstable_now())},P)}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(B){B.callback=null},e.unstable_continueExecution=function(){C||y||(C=!0,G(E))},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return r(a)},e.unstable_next=function(B){switch(g){case 1:case 2:case 3:var P=3;break;default:P=g}var N=g;g=P;try{return B()}finally{g=N}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,P){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var N=g;g=B;try{return P()}finally{g=N}},e.unstable_scheduleCallback=function(B,P,N){var j=e.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?j+N:j):N=j,B){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=N+D,B={id:m++,callback:P,priorityLevel:B,startTime:N,expirationTime:D,sortIndex:-1},N>j?(B.sortIndex=N,t(d,B),r(a)===null&&B===r(d)&&(_?(h(w),w=-1):_=!0,K(x,N-j))):(B.sortIndex=D,t(a,B),C||y||(C=!0,G(E))),B},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(B){var P=g;return function(){var N=g;g=P;try{return B.apply(this,arguments)}finally{g=N}}}})(xp);yp.exports=xp;var Mx=yp.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var jx=S,ot=Mx;function J(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var wp=new Set,Bs={};function cn(e,t){Hn(e,t),Hn(e+"Capture",t)}function Hn(e,t){for(Bs[e]=t,e=0;e<t.length;e++)wp.add(t[e])}var qt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ol=Object.prototype.hasOwnProperty,Ix=/^[: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]*$/,zd={},Wd={};function Ox(e){return Ol.call(Wd,e)?!0:Ol.call(zd,e)?!1:Ix.test(e)?Wd[e]=!0:(zd[e]=!0,!1)}function Bx(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Fx(e,t,r,n){if(t===null||typeof t>"u"||Bx(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function We(e,t,r,n,s,o,u){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=u}var je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){je[e]=new We(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];je[t]=new We(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){je[e]=new We(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){je[e]=new We(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){je[e]=new We(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){je[e]=new We(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){je[e]=new We(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){je[e]=new We(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){je[e]=new We(e,5,!1,e.toLowerCase(),null,!1,!1)});var Zc=/[\-:]([a-z])/g;function eu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Zc,eu);je[t]=new We(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Zc,eu);je[t]=new We(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Zc,eu);je[t]=new We(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){je[e]=new We(e,1,!1,e.toLowerCase(),null,!1,!1)});je.xlinkHref=new We("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){je[e]=new We(e,1,!1,e.toLowerCase(),null,!0,!0)});function tu(e,t,r,n){var s=je.hasOwnProperty(t)?je[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Fx(t,r,s,n)&&(r=null),n||s===null?Ox(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var er=jx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ri=Symbol.for("react.element"),wn=Symbol.for("react.portal"),Sn=Symbol.for("react.fragment"),ru=Symbol.for("react.strict_mode"),Bl=Symbol.for("react.profiler"),Sp=Symbol.for("react.provider"),bp=Symbol.for("react.context"),nu=Symbol.for("react.forward_ref"),Fl=Symbol.for("react.suspense"),$l=Symbol.for("react.suspense_list"),su=Symbol.for("react.memo"),cr=Symbol.for("react.lazy"),Cp=Symbol.for("react.offscreen"),Ud=Symbol.iterator;function ds(e){return e===null||typeof e!="object"?null:(e=Ud&&e[Ud]||e["@@iterator"],typeof e=="function"?e:null)}var xe=Object.assign,Ka;function Ss(e){if(Ka===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Ka=t&&t[1]||""}return`
34
+ `+Ka+e}var Ga=!1;function qa(e,t){if(!e||Ga)return"";Ga=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var n=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){n=d}e.call(t.prototype)}else{try{throw Error()}catch(d){n=d}e()}}catch(d){if(d&&n&&typeof d.stack=="string"){for(var s=d.stack.split(`
35
+ `),o=n.stack.split(`
36
+ `),u=s.length-1,i=o.length-1;1<=u&&0<=i&&s[u]!==o[i];)i--;for(;1<=u&&0<=i;u--,i--)if(s[u]!==o[i]){if(u!==1||i!==1)do if(u--,i--,0>i||s[u]!==o[i]){var a=`
37
+ `+s[u].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=u&&0<=i);break}}}finally{Ga=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Ss(e):""}function $x(e){switch(e.tag){case 5:return Ss(e.type);case 16:return Ss("Lazy");case 13:return Ss("Suspense");case 19:return Ss("SuspenseList");case 0:case 2:case 15:return e=qa(e.type,!1),e;case 11:return e=qa(e.type.render,!1),e;case 1:return e=qa(e.type,!0),e;default:return""}}function Hl(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Sn:return"Fragment";case wn:return"Portal";case Bl:return"Profiler";case ru:return"StrictMode";case Fl:return"Suspense";case $l:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case bp:return(e.displayName||"Context")+".Consumer";case Sp:return(e._context.displayName||"Context")+".Provider";case nu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case su:return t=e.displayName||null,t!==null?t:Hl(e.type)||"Memo";case cr:t=e._payload,e=e._init;try{return Hl(e(t))}catch{}}return null}function Hx(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Hl(t);case 8:return t===ru?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function kr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function kp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function zx(e){var t=kp(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(u){n=""+u,o.call(this,u)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(u){n=""+u},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pi(e){e._valueTracker||(e._valueTracker=zx(e))}function Ep(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=kp(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function _o(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function zl(e,t){var r=t.checked;return xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Vd(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=kr(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Rp(e,t){t=t.checked,t!=null&&tu(e,"checked",t,!1)}function Wl(e,t){Rp(e,t);var r=kr(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ul(e,t.type,r):t.hasOwnProperty("defaultValue")&&Ul(e,t.type,kr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Kd(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Ul(e,t,r){(t!=="number"||_o(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var bs=Array.isArray;function Dn(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+kr(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Vl(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(J(91));return xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Gd(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(J(92));if(bs(r)){if(1<r.length)throw Error(J(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:kr(r)}}function Pp(e,t){var r=kr(t.value),n=kr(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function qd(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Tp(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Kl(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Tp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ti,Np=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ti=Ti||document.createElement("div"),Ti.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ti.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Fs(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ps={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Wx=["Webkit","ms","Moz","O"];Object.keys(Ps).forEach(function(e){Wx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ps[t]=Ps[e]})});function Lp(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ps.hasOwnProperty(e)&&Ps[e]?(""+t).trim():t+"px"}function Ap(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=Lp(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var Ux=xe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Gl(e,t){if(t){if(Ux[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(J(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(J(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(J(61))}if(t.style!=null&&typeof t.style!="object")throw Error(J(62))}}function ql(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Xl=null;function iu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yl=null,Mn=null,jn=null;function Xd(e){if(e=ci(e)){if(typeof Yl!="function")throw Error(J(280));var t=e.stateNode;t&&(t=aa(t),Yl(e.stateNode,e.type,t))}}function Dp(e){Mn?jn?jn.push(e):jn=[e]:Mn=e}function Mp(){if(Mn){var e=Mn,t=jn;if(jn=Mn=null,Xd(e),t)for(e=0;e<t.length;e++)Xd(t[e])}}function jp(e,t){return e(t)}function Ip(){}var Xa=!1;function Op(e,t,r){if(Xa)return e(t,r);Xa=!0;try{return jp(e,t,r)}finally{Xa=!1,(Mn!==null||jn!==null)&&(Ip(),Mp())}}function $s(e,t){var r=e.stateNode;if(r===null)return null;var n=aa(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(J(231,t,typeof r));return r}var Jl=!1;if(qt)try{var hs={};Object.defineProperty(hs,"passive",{get:function(){Jl=!0}}),window.addEventListener("test",hs,hs),window.removeEventListener("test",hs,hs)}catch{Jl=!1}function Vx(e,t,r,n,s,o,u,i,a){var d=Array.prototype.slice.call(arguments,3);try{t.apply(r,d)}catch(m){this.onError(m)}}var Ts=!1,yo=null,xo=!1,Ql=null,Kx={onError:function(e){Ts=!0,yo=e}};function Gx(e,t,r,n,s,o,u,i,a){Ts=!1,yo=null,Vx.apply(Kx,arguments)}function qx(e,t,r,n,s,o,u,i,a){if(Gx.apply(this,arguments),Ts){if(Ts){var d=yo;Ts=!1,yo=null}else throw Error(J(198));xo||(xo=!0,Ql=d)}}function un(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Bp(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Yd(e){if(un(e)!==e)throw Error(J(188))}function Xx(e){var t=e.alternate;if(!t){if(t=un(e),t===null)throw Error(J(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var o=s.alternate;if(o===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===r)return Yd(s),e;if(o===n)return Yd(s),t;o=o.sibling}throw Error(J(188))}if(r.return!==n.return)r=s,n=o;else{for(var u=!1,i=s.child;i;){if(i===r){u=!0,r=s,n=o;break}if(i===n){u=!0,n=s,r=o;break}i=i.sibling}if(!u){for(i=o.child;i;){if(i===r){u=!0,r=o,n=s;break}if(i===n){u=!0,n=o,r=s;break}i=i.sibling}if(!u)throw Error(J(189))}}if(r.alternate!==n)throw Error(J(190))}if(r.tag!==3)throw Error(J(188));return r.stateNode.current===r?e:t}function Fp(e){return e=Xx(e),e!==null?$p(e):null}function $p(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=$p(e);if(t!==null)return t;e=e.sibling}return null}var Hp=ot.unstable_scheduleCallback,Jd=ot.unstable_cancelCallback,Yx=ot.unstable_shouldYield,Jx=ot.unstable_requestPaint,Se=ot.unstable_now,Qx=ot.unstable_getCurrentPriorityLevel,ou=ot.unstable_ImmediatePriority,zp=ot.unstable_UserBlockingPriority,wo=ot.unstable_NormalPriority,Zx=ot.unstable_LowPriority,Wp=ot.unstable_IdlePriority,na=null,It=null;function ew(e){if(It&&typeof It.onCommitFiberRoot=="function")try{It.onCommitFiberRoot(na,e,void 0,(e.current.flags&128)===128)}catch{}}var Ct=Math.clz32?Math.clz32:nw,tw=Math.log,rw=Math.LN2;function nw(e){return e>>>=0,e===0?32:31-(tw(e)/rw|0)|0}var Ni=64,Li=4194304;function Cs(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function So(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,o=e.pingedLanes,u=r&268435455;if(u!==0){var i=u&~s;i!==0?n=Cs(i):(o&=u,o!==0&&(n=Cs(o)))}else u=r&~s,u!==0?n=Cs(u):o!==0&&(n=Cs(o));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Ct(t),s=1<<r,n|=e[r],t&=~s;return n}function sw(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function iw(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var u=31-Ct(o),i=1<<u,a=s[u];a===-1?(!(i&r)||i&n)&&(s[u]=sw(i,t)):a<=t&&(e.expiredLanes|=i),o&=~i}}function Zl(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Up(){var e=Ni;return Ni<<=1,!(Ni&4194240)&&(Ni=64),e}function Ya(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function ai(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ct(t),e[t]=r}function ow(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-Ct(r),o=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~o}}function au(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Ct(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var de=0;function Vp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Kp,lu,Gp,qp,Xp,ec=!1,Ai=[],gr=null,vr=null,_r=null,Hs=new Map,zs=new Map,dr=[],aw="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Qd(e,t){switch(e){case"focusin":case"focusout":gr=null;break;case"dragenter":case"dragleave":vr=null;break;case"mouseover":case"mouseout":_r=null;break;case"pointerover":case"pointerout":Hs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":zs.delete(t.pointerId)}}function fs(e,t,r,n,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:o,targetContainers:[s]},t!==null&&(t=ci(t),t!==null&&lu(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function lw(e,t,r,n,s){switch(t){case"focusin":return gr=fs(gr,e,t,r,n,s),!0;case"dragenter":return vr=fs(vr,e,t,r,n,s),!0;case"mouseover":return _r=fs(_r,e,t,r,n,s),!0;case"pointerover":var o=s.pointerId;return Hs.set(o,fs(Hs.get(o)||null,e,t,r,n,s)),!0;case"gotpointercapture":return o=s.pointerId,zs.set(o,fs(zs.get(o)||null,e,t,r,n,s)),!0}return!1}function Yp(e){var t=Kr(e.target);if(t!==null){var r=un(t);if(r!==null){if(t=r.tag,t===13){if(t=Bp(r),t!==null){e.blockedOn=t,Xp(e.priority,function(){Gp(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function no(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=tc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Xl=n,r.target.dispatchEvent(n),Xl=null}else return t=ci(r),t!==null&&lu(t),e.blockedOn=r,!1;t.shift()}return!0}function Zd(e,t,r){no(e)&&r.delete(t)}function cw(){ec=!1,gr!==null&&no(gr)&&(gr=null),vr!==null&&no(vr)&&(vr=null),_r!==null&&no(_r)&&(_r=null),Hs.forEach(Zd),zs.forEach(Zd)}function ps(e,t){e.blockedOn===t&&(e.blockedOn=null,ec||(ec=!0,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,cw)))}function Ws(e){function t(s){return ps(s,e)}if(0<Ai.length){ps(Ai[0],e);for(var r=1;r<Ai.length;r++){var n=Ai[r];n.blockedOn===e&&(n.blockedOn=null)}}for(gr!==null&&ps(gr,e),vr!==null&&ps(vr,e),_r!==null&&ps(_r,e),Hs.forEach(t),zs.forEach(t),r=0;r<dr.length;r++)n=dr[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<dr.length&&(r=dr[0],r.blockedOn===null);)Yp(r),r.blockedOn===null&&dr.shift()}var In=er.ReactCurrentBatchConfig,bo=!0;function uw(e,t,r,n){var s=de,o=In.transition;In.transition=null;try{de=1,cu(e,t,r,n)}finally{de=s,In.transition=o}}function dw(e,t,r,n){var s=de,o=In.transition;In.transition=null;try{de=4,cu(e,t,r,n)}finally{de=s,In.transition=o}}function cu(e,t,r,n){if(bo){var s=tc(e,t,r,n);if(s===null)ol(e,t,n,Co,r),Qd(e,n);else if(lw(s,e,t,r,n))n.stopPropagation();else if(Qd(e,n),t&4&&-1<aw.indexOf(e)){for(;s!==null;){var o=ci(s);if(o!==null&&Kp(o),o=tc(e,t,r,n),o===null&&ol(e,t,n,Co,r),o===s)break;s=o}s!==null&&n.stopPropagation()}else ol(e,t,n,null,r)}}var Co=null;function tc(e,t,r,n){if(Co=null,e=iu(n),e=Kr(e),e!==null)if(t=un(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Bp(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Co=e,null}function Jp(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Qx()){case ou:return 1;case zp:return 4;case wo:case Zx:return 16;case Wp:return 536870912;default:return 16}default:return 16}}var fr=null,uu=null,so=null;function Qp(){if(so)return so;var e,t=uu,r=t.length,n,s="value"in fr?fr.value:fr.textContent,o=s.length;for(e=0;e<r&&t[e]===s[e];e++);var u=r-e;for(n=1;n<=u&&t[r-n]===s[o-n];n++);return so=s.slice(e,1<n?1-n:void 0)}function io(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Di(){return!0}function eh(){return!1}function lt(e){function t(r,n,s,o,u){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=o,this.target=u,this.currentTarget=null;for(var i in e)e.hasOwnProperty(i)&&(r=e[i],this[i]=r?r(o):o[i]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Di:eh,this.isPropagationStopped=eh,this}return xe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Di)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Di)},persist:function(){},isPersistent:Di}),t}var Zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},du=lt(Zn),li=xe({},Zn,{view:0,detail:0}),hw=lt(li),Ja,Qa,ms,sa=xe({},li,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ms&&(ms&&e.type==="mousemove"?(Ja=e.screenX-ms.screenX,Qa=e.screenY-ms.screenY):Qa=Ja=0,ms=e),Ja)},movementY:function(e){return"movementY"in e?e.movementY:Qa}}),th=lt(sa),fw=xe({},sa,{dataTransfer:0}),pw=lt(fw),mw=xe({},li,{relatedTarget:0}),Za=lt(mw),gw=xe({},Zn,{animationName:0,elapsedTime:0,pseudoElement:0}),vw=lt(gw),_w=xe({},Zn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yw=lt(_w),xw=xe({},Zn,{data:0}),rh=lt(xw),ww={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sw={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"},bw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=bw[e])?!!t[e]:!1}function hu(){return Cw}var kw=xe({},li,{key:function(e){if(e.key){var t=ww[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=io(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Sw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hu,charCode:function(e){return e.type==="keypress"?io(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?io(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ew=lt(kw),Rw=xe({},sa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nh=lt(Rw),Pw=xe({},li,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hu}),Tw=lt(Pw),Nw=xe({},Zn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lw=lt(Nw),Aw=xe({},sa,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Dw=lt(Aw),Mw=[9,13,27,32],fu=qt&&"CompositionEvent"in window,Ns=null;qt&&"documentMode"in document&&(Ns=document.documentMode);var jw=qt&&"TextEvent"in window&&!Ns,Zp=qt&&(!fu||Ns&&8<Ns&&11>=Ns),sh=" ",ih=!1;function em(e,t){switch(e){case"keyup":return Mw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var bn=!1;function Iw(e,t){switch(e){case"compositionend":return tm(t);case"keypress":return t.which!==32?null:(ih=!0,sh);case"textInput":return e=t.data,e===sh&&ih?null:e;default:return null}}function Ow(e,t){if(bn)return e==="compositionend"||!fu&&em(e,t)?(e=Qp(),so=uu=fr=null,bn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Zp&&t.locale!=="ko"?null:t.data;default:return null}}var Bw={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 oh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Bw[e.type]:t==="textarea"}function rm(e,t,r,n){Dp(n),t=ko(t,"onChange"),0<t.length&&(r=new du("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Ls=null,Us=null;function Fw(e){fm(e,0)}function ia(e){var t=En(e);if(Ep(t))return e}function $w(e,t){if(e==="change")return t}var nm=!1;if(qt){var el;if(qt){var tl="oninput"in document;if(!tl){var ah=document.createElement("div");ah.setAttribute("oninput","return;"),tl=typeof ah.oninput=="function"}el=tl}else el=!1;nm=el&&(!document.documentMode||9<document.documentMode)}function lh(){Ls&&(Ls.detachEvent("onpropertychange",sm),Us=Ls=null)}function sm(e){if(e.propertyName==="value"&&ia(Us)){var t=[];rm(t,Us,e,iu(e)),Op(Fw,t)}}function Hw(e,t,r){e==="focusin"?(lh(),Ls=t,Us=r,Ls.attachEvent("onpropertychange",sm)):e==="focusout"&&lh()}function zw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ia(Us)}function Ww(e,t){if(e==="click")return ia(t)}function Uw(e,t){if(e==="input"||e==="change")return ia(t)}function Vw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Et=typeof Object.is=="function"?Object.is:Vw;function Vs(e,t){if(Et(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!Ol.call(t,s)||!Et(e[s],t[s]))return!1}return!0}function ch(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function uh(e,t){var r=ch(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ch(r)}}function im(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?im(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function om(){for(var e=window,t=_o();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=_o(e.document)}return t}function pu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Kw(e){var t=om(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&im(r.ownerDocument.documentElement,r)){if(n!==null&&pu(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,o=Math.min(n.start,s);n=n.end===void 0?o:Math.min(n.end,s),!e.extend&&o>n&&(s=n,n=o,o=s),s=uh(r,o);var u=uh(r,n);s&&u&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==u.node||e.focusOffset!==u.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(u.node,u.offset)):(t.setEnd(u.node,u.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Gw=qt&&"documentMode"in document&&11>=document.documentMode,Cn=null,rc=null,As=null,nc=!1;function dh(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;nc||Cn==null||Cn!==_o(n)||(n=Cn,"selectionStart"in n&&pu(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),As&&Vs(As,n)||(As=n,n=ko(rc,"onSelect"),0<n.length&&(t=new du("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Cn)))}function Mi(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var kn={animationend:Mi("Animation","AnimationEnd"),animationiteration:Mi("Animation","AnimationIteration"),animationstart:Mi("Animation","AnimationStart"),transitionend:Mi("Transition","TransitionEnd")},rl={},am={};qt&&(am=document.createElement("div").style,"AnimationEvent"in window||(delete kn.animationend.animation,delete kn.animationiteration.animation,delete kn.animationstart.animation),"TransitionEvent"in window||delete kn.transitionend.transition);function oa(e){if(rl[e])return rl[e];if(!kn[e])return e;var t=kn[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in am)return rl[e]=t[r];return e}var lm=oa("animationend"),cm=oa("animationiteration"),um=oa("animationstart"),dm=oa("transitionend"),hm=new Map,hh="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Nr(e,t){hm.set(e,t),cn(t,[e])}for(var nl=0;nl<hh.length;nl++){var sl=hh[nl],qw=sl.toLowerCase(),Xw=sl[0].toUpperCase()+sl.slice(1);Nr(qw,"on"+Xw)}Nr(lm,"onAnimationEnd");Nr(cm,"onAnimationIteration");Nr(um,"onAnimationStart");Nr("dblclick","onDoubleClick");Nr("focusin","onFocus");Nr("focusout","onBlur");Nr(dm,"onTransitionEnd");Hn("onMouseEnter",["mouseout","mouseover"]);Hn("onMouseLeave",["mouseout","mouseover"]);Hn("onPointerEnter",["pointerout","pointerover"]);Hn("onPointerLeave",["pointerout","pointerover"]);cn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));cn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));cn("onBeforeInput",["compositionend","keypress","textInput","paste"]);cn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));cn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));cn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ks="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(" "),Yw=new Set("cancel close invalid load scroll toggle".split(" ").concat(ks));function fh(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,qx(n,t,void 0,e),e.currentTarget=null}function fm(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var o=void 0;if(t)for(var u=n.length-1;0<=u;u--){var i=n[u],a=i.instance,d=i.currentTarget;if(i=i.listener,a!==o&&s.isPropagationStopped())break e;fh(s,i,d),o=a}else for(u=0;u<n.length;u++){if(i=n[u],a=i.instance,d=i.currentTarget,i=i.listener,a!==o&&s.isPropagationStopped())break e;fh(s,i,d),o=a}}}if(xo)throw e=Ql,xo=!1,Ql=null,e}function pe(e,t){var r=t[lc];r===void 0&&(r=t[lc]=new Set);var n=e+"__bubble";r.has(n)||(pm(t,e,2,!1),r.add(n))}function il(e,t,r){var n=0;t&&(n|=4),pm(r,e,n,t)}var ji="_reactListening"+Math.random().toString(36).slice(2);function Ks(e){if(!e[ji]){e[ji]=!0,wp.forEach(function(r){r!=="selectionchange"&&(Yw.has(r)||il(r,!1,e),il(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ji]||(t[ji]=!0,il("selectionchange",!1,t))}}function pm(e,t,r,n){switch(Jp(t)){case 1:var s=uw;break;case 4:s=dw;break;default:s=cu}r=s.bind(null,t,r,e),s=void 0,!Jl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function ol(e,t,r,n,s){var o=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var u=n.tag;if(u===3||u===4){var i=n.stateNode.containerInfo;if(i===s||i.nodeType===8&&i.parentNode===s)break;if(u===4)for(u=n.return;u!==null;){var a=u.tag;if((a===3||a===4)&&(a=u.stateNode.containerInfo,a===s||a.nodeType===8&&a.parentNode===s))return;u=u.return}for(;i!==null;){if(u=Kr(i),u===null)return;if(a=u.tag,a===5||a===6){n=o=u;continue e}i=i.parentNode}}n=n.return}Op(function(){var d=o,m=iu(r),c=[];e:{var g=hm.get(e);if(g!==void 0){var y=du,C=e;switch(e){case"keypress":if(io(r)===0)break e;case"keydown":case"keyup":y=Ew;break;case"focusin":C="focus",y=Za;break;case"focusout":C="blur",y=Za;break;case"beforeblur":case"afterblur":y=Za;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=th;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=pw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=Tw;break;case lm:case cm:case um:y=vw;break;case dm:y=Lw;break;case"scroll":y=hw;break;case"wheel":y=Dw;break;case"copy":case"cut":case"paste":y=yw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=nh}var _=(t&4)!==0,p=!_&&e==="scroll",h=_?g!==null?g+"Capture":null:g;_=[];for(var l=d,f;l!==null;){f=l;var x=f.stateNode;if(f.tag===5&&x!==null&&(f=x,h!==null&&(x=$s(l,h),x!=null&&_.push(Gs(l,x,f)))),p)break;l=l.return}0<_.length&&(g=new y(g,C,null,r,m),c.push({event:g,listeners:_}))}}if(!(t&7)){e:{if(g=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",g&&r!==Xl&&(C=r.relatedTarget||r.fromElement)&&(Kr(C)||C[Xt]))break e;if((y||g)&&(g=m.window===m?m:(g=m.ownerDocument)?g.defaultView||g.parentWindow:window,y?(C=r.relatedTarget||r.toElement,y=d,C=C?Kr(C):null,C!==null&&(p=un(C),C!==p||C.tag!==5&&C.tag!==6)&&(C=null)):(y=null,C=d),y!==C)){if(_=th,x="onMouseLeave",h="onMouseEnter",l="mouse",(e==="pointerout"||e==="pointerover")&&(_=nh,x="onPointerLeave",h="onPointerEnter",l="pointer"),p=y==null?g:En(y),f=C==null?g:En(C),g=new _(x,l+"leave",y,r,m),g.target=p,g.relatedTarget=f,x=null,Kr(m)===d&&(_=new _(h,l+"enter",C,r,m),_.target=f,_.relatedTarget=p,x=_),p=x,y&&C)t:{for(_=y,h=C,l=0,f=_;f;f=pn(f))l++;for(f=0,x=h;x;x=pn(x))f++;for(;0<l-f;)_=pn(_),l--;for(;0<f-l;)h=pn(h),f--;for(;l--;){if(_===h||h!==null&&_===h.alternate)break t;_=pn(_),h=pn(h)}_=null}else _=null;y!==null&&ph(c,g,y,_,!1),C!==null&&p!==null&&ph(c,p,C,_,!0)}}e:{if(g=d?En(d):window,y=g.nodeName&&g.nodeName.toLowerCase(),y==="select"||y==="input"&&g.type==="file")var E=$w;else if(oh(g))if(nm)E=Uw;else{E=zw;var k=Hw}else(y=g.nodeName)&&y.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(E=Ww);if(E&&(E=E(e,d))){rm(c,E,r,m);break e}k&&k(e,g,d),e==="focusout"&&(k=g._wrapperState)&&k.controlled&&g.type==="number"&&Ul(g,"number",g.value)}switch(k=d?En(d):window,e){case"focusin":(oh(k)||k.contentEditable==="true")&&(Cn=k,rc=d,As=null);break;case"focusout":As=rc=Cn=null;break;case"mousedown":nc=!0;break;case"contextmenu":case"mouseup":case"dragend":nc=!1,dh(c,r,m);break;case"selectionchange":if(Gw)break;case"keydown":case"keyup":dh(c,r,m)}var b;if(fu)e:{switch(e){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else bn?em(e,r)&&(w="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(w="onCompositionStart");w&&(Zp&&r.locale!=="ko"&&(bn||w!=="onCompositionStart"?w==="onCompositionEnd"&&bn&&(b=Qp()):(fr=m,uu="value"in fr?fr.value:fr.textContent,bn=!0)),k=ko(d,w),0<k.length&&(w=new rh(w,e,null,r,m),c.push({event:w,listeners:k}),b?w.data=b:(b=tm(r),b!==null&&(w.data=b)))),(b=jw?Iw(e,r):Ow(e,r))&&(d=ko(d,"onBeforeInput"),0<d.length&&(m=new rh("onBeforeInput","beforeinput",null,r,m),c.push({event:m,listeners:d}),m.data=b))}fm(c,t)})}function Gs(e,t,r){return{instance:e,listener:t,currentTarget:r}}function ko(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=$s(e,r),o!=null&&n.unshift(Gs(e,o,s)),o=$s(e,t),o!=null&&n.push(Gs(e,o,s))),e=e.return}return n}function pn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function ph(e,t,r,n,s){for(var o=t._reactName,u=[];r!==null&&r!==n;){var i=r,a=i.alternate,d=i.stateNode;if(a!==null&&a===n)break;i.tag===5&&d!==null&&(i=d,s?(a=$s(r,o),a!=null&&u.unshift(Gs(r,a,i))):s||(a=$s(r,o),a!=null&&u.push(Gs(r,a,i)))),r=r.return}u.length!==0&&e.push({event:t,listeners:u})}var Jw=/\r\n?/g,Qw=/\u0000|\uFFFD/g;function mh(e){return(typeof e=="string"?e:""+e).replace(Jw,`
38
+ `).replace(Qw,"")}function Ii(e,t,r){if(t=mh(t),mh(e)!==t&&r)throw Error(J(425))}function Eo(){}var sc=null,ic=null;function oc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ac=typeof setTimeout=="function"?setTimeout:void 0,Zw=typeof clearTimeout=="function"?clearTimeout:void 0,gh=typeof Promise=="function"?Promise:void 0,eS=typeof queueMicrotask=="function"?queueMicrotask:typeof gh<"u"?function(e){return gh.resolve(null).then(e).catch(tS)}:ac;function tS(e){setTimeout(function(){throw e})}function al(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),Ws(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);Ws(t)}function yr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function vh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var es=Math.random().toString(36).slice(2),Dt="__reactFiber$"+es,qs="__reactProps$"+es,Xt="__reactContainer$"+es,lc="__reactEvents$"+es,rS="__reactListeners$"+es,nS="__reactHandles$"+es;function Kr(e){var t=e[Dt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Xt]||r[Dt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=vh(e);e!==null;){if(r=e[Dt])return r;e=vh(e)}return t}e=r,r=e.parentNode}return null}function ci(e){return e=e[Dt]||e[Xt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function En(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(J(33))}function aa(e){return e[qs]||null}var cc=[],Rn=-1;function Lr(e){return{current:e}}function me(e){0>Rn||(e.current=cc[Rn],cc[Rn]=null,Rn--)}function fe(e,t){Rn++,cc[Rn]=e.current,e.current=t}var Er={},Fe=Lr(Er),qe=Lr(!1),Qr=Er;function zn(e,t){var r=e.type.contextTypes;if(!r)return Er;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in r)s[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Xe(e){return e=e.childContextTypes,e!=null}function Ro(){me(qe),me(Fe)}function _h(e,t,r){if(Fe.current!==Er)throw Error(J(168));fe(Fe,t),fe(qe,r)}function mm(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(J(108,Hx(e)||"Unknown",s));return xe({},r,n)}function Po(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Er,Qr=Fe.current,fe(Fe,e),fe(qe,qe.current),!0}function yh(e,t,r){var n=e.stateNode;if(!n)throw Error(J(169));r?(e=mm(e,t,Qr),n.__reactInternalMemoizedMergedChildContext=e,me(qe),me(Fe),fe(Fe,e)):me(qe),fe(qe,r)}var Ut=null,la=!1,ll=!1;function gm(e){Ut===null?Ut=[e]:Ut.push(e)}function sS(e){la=!0,gm(e)}function Ar(){if(!ll&&Ut!==null){ll=!0;var e=0,t=de;try{var r=Ut;for(de=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Ut=null,la=!1}catch(s){throw Ut!==null&&(Ut=Ut.slice(e+1)),Hp(ou,Ar),s}finally{de=t,ll=!1}}return null}var Pn=[],Tn=0,To=null,No=0,dt=[],ht=0,Zr=null,Vt=1,Kt="";function Wr(e,t){Pn[Tn++]=No,Pn[Tn++]=To,To=e,No=t}function vm(e,t,r){dt[ht++]=Vt,dt[ht++]=Kt,dt[ht++]=Zr,Zr=e;var n=Vt;e=Kt;var s=32-Ct(n)-1;n&=~(1<<s),r+=1;var o=32-Ct(t)+s;if(30<o){var u=s-s%5;o=(n&(1<<u)-1).toString(32),n>>=u,s-=u,Vt=1<<32-Ct(t)+s|r<<s|n,Kt=o+e}else Vt=1<<o|r<<s|n,Kt=e}function mu(e){e.return!==null&&(Wr(e,1),vm(e,1,0))}function gu(e){for(;e===To;)To=Pn[--Tn],Pn[Tn]=null,No=Pn[--Tn],Pn[Tn]=null;for(;e===Zr;)Zr=dt[--ht],dt[ht]=null,Kt=dt[--ht],dt[ht]=null,Vt=dt[--ht],dt[ht]=null}var nt=null,rt=null,ge=!1,bt=null;function _m(e,t){var r=ft(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function xh(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,nt=e,rt=yr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,nt=e,rt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Zr!==null?{id:Vt,overflow:Kt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=ft(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,nt=e,rt=null,!0):!1;default:return!1}}function uc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function dc(e){if(ge){var t=rt;if(t){var r=t;if(!xh(e,t)){if(uc(e))throw Error(J(418));t=yr(r.nextSibling);var n=nt;t&&xh(e,t)?_m(n,r):(e.flags=e.flags&-4097|2,ge=!1,nt=e)}}else{if(uc(e))throw Error(J(418));e.flags=e.flags&-4097|2,ge=!1,nt=e}}}function wh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;nt=e}function Oi(e){if(e!==nt)return!1;if(!ge)return wh(e),ge=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!oc(e.type,e.memoizedProps)),t&&(t=rt)){if(uc(e))throw ym(),Error(J(418));for(;t;)_m(e,t),t=yr(t.nextSibling)}if(wh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(J(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){rt=yr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}rt=null}}else rt=nt?yr(e.stateNode.nextSibling):null;return!0}function ym(){for(var e=rt;e;)e=yr(e.nextSibling)}function Wn(){rt=nt=null,ge=!1}function vu(e){bt===null?bt=[e]:bt.push(e)}var iS=er.ReactCurrentBatchConfig;function gs(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(J(309));var n=r.stateNode}if(!n)throw Error(J(147,e));var s=n,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(u){var i=s.refs;u===null?delete i[o]:i[o]=u},t._stringRef=o,t)}if(typeof e!="string")throw Error(J(284));if(!r._owner)throw Error(J(290,e))}return e}function Bi(e,t){throw e=Object.prototype.toString.call(t),Error(J(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Sh(e){var t=e._init;return t(e._payload)}function xm(e){function t(h,l){if(e){var f=h.deletions;f===null?(h.deletions=[l],h.flags|=16):f.push(l)}}function r(h,l){if(!e)return null;for(;l!==null;)t(h,l),l=l.sibling;return null}function n(h,l){for(h=new Map;l!==null;)l.key!==null?h.set(l.key,l):h.set(l.index,l),l=l.sibling;return h}function s(h,l){return h=br(h,l),h.index=0,h.sibling=null,h}function o(h,l,f){return h.index=f,e?(f=h.alternate,f!==null?(f=f.index,f<l?(h.flags|=2,l):f):(h.flags|=2,l)):(h.flags|=1048576,l)}function u(h){return e&&h.alternate===null&&(h.flags|=2),h}function i(h,l,f,x){return l===null||l.tag!==6?(l=ml(f,h.mode,x),l.return=h,l):(l=s(l,f),l.return=h,l)}function a(h,l,f,x){var E=f.type;return E===Sn?m(h,l,f.props.children,x,f.key):l!==null&&(l.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===cr&&Sh(E)===l.type)?(x=s(l,f.props),x.ref=gs(h,l,f),x.return=h,x):(x=fo(f.type,f.key,f.props,null,h.mode,x),x.ref=gs(h,l,f),x.return=h,x)}function d(h,l,f,x){return l===null||l.tag!==4||l.stateNode.containerInfo!==f.containerInfo||l.stateNode.implementation!==f.implementation?(l=gl(f,h.mode,x),l.return=h,l):(l=s(l,f.children||[]),l.return=h,l)}function m(h,l,f,x,E){return l===null||l.tag!==7?(l=Yr(f,h.mode,x,E),l.return=h,l):(l=s(l,f),l.return=h,l)}function c(h,l,f){if(typeof l=="string"&&l!==""||typeof l=="number")return l=ml(""+l,h.mode,f),l.return=h,l;if(typeof l=="object"&&l!==null){switch(l.$$typeof){case Ri:return f=fo(l.type,l.key,l.props,null,h.mode,f),f.ref=gs(h,null,l),f.return=h,f;case wn:return l=gl(l,h.mode,f),l.return=h,l;case cr:var x=l._init;return c(h,x(l._payload),f)}if(bs(l)||ds(l))return l=Yr(l,h.mode,f,null),l.return=h,l;Bi(h,l)}return null}function g(h,l,f,x){var E=l!==null?l.key:null;if(typeof f=="string"&&f!==""||typeof f=="number")return E!==null?null:i(h,l,""+f,x);if(typeof f=="object"&&f!==null){switch(f.$$typeof){case Ri:return f.key===E?a(h,l,f,x):null;case wn:return f.key===E?d(h,l,f,x):null;case cr:return E=f._init,g(h,l,E(f._payload),x)}if(bs(f)||ds(f))return E!==null?null:m(h,l,f,x,null);Bi(h,f)}return null}function y(h,l,f,x,E){if(typeof x=="string"&&x!==""||typeof x=="number")return h=h.get(f)||null,i(l,h,""+x,E);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Ri:return h=h.get(x.key===null?f:x.key)||null,a(l,h,x,E);case wn:return h=h.get(x.key===null?f:x.key)||null,d(l,h,x,E);case cr:var k=x._init;return y(h,l,f,k(x._payload),E)}if(bs(x)||ds(x))return h=h.get(f)||null,m(l,h,x,E,null);Bi(l,x)}return null}function C(h,l,f,x){for(var E=null,k=null,b=l,w=l=0,R=null;b!==null&&w<f.length;w++){b.index>w?(R=b,b=null):R=b.sibling;var T=g(h,b,f[w],x);if(T===null){b===null&&(b=R);break}e&&b&&T.alternate===null&&t(h,b),l=o(T,l,w),k===null?E=T:k.sibling=T,k=T,b=R}if(w===f.length)return r(h,b),ge&&Wr(h,w),E;if(b===null){for(;w<f.length;w++)b=c(h,f[w],x),b!==null&&(l=o(b,l,w),k===null?E=b:k.sibling=b,k=b);return ge&&Wr(h,w),E}for(b=n(h,b);w<f.length;w++)R=y(b,h,w,f[w],x),R!==null&&(e&&R.alternate!==null&&b.delete(R.key===null?w:R.key),l=o(R,l,w),k===null?E=R:k.sibling=R,k=R);return e&&b.forEach(function(M){return t(h,M)}),ge&&Wr(h,w),E}function _(h,l,f,x){var E=ds(f);if(typeof E!="function")throw Error(J(150));if(f=E.call(f),f==null)throw Error(J(151));for(var k=E=null,b=l,w=l=0,R=null,T=f.next();b!==null&&!T.done;w++,T=f.next()){b.index>w?(R=b,b=null):R=b.sibling;var M=g(h,b,T.value,x);if(M===null){b===null&&(b=R);break}e&&b&&M.alternate===null&&t(h,b),l=o(M,l,w),k===null?E=M:k.sibling=M,k=M,b=R}if(T.done)return r(h,b),ge&&Wr(h,w),E;if(b===null){for(;!T.done;w++,T=f.next())T=c(h,T.value,x),T!==null&&(l=o(T,l,w),k===null?E=T:k.sibling=T,k=T);return ge&&Wr(h,w),E}for(b=n(h,b);!T.done;w++,T=f.next())T=y(b,h,w,T.value,x),T!==null&&(e&&T.alternate!==null&&b.delete(T.key===null?w:T.key),l=o(T,l,w),k===null?E=T:k.sibling=T,k=T);return e&&b.forEach(function(O){return t(h,O)}),ge&&Wr(h,w),E}function p(h,l,f,x){if(typeof f=="object"&&f!==null&&f.type===Sn&&f.key===null&&(f=f.props.children),typeof f=="object"&&f!==null){switch(f.$$typeof){case Ri:e:{for(var E=f.key,k=l;k!==null;){if(k.key===E){if(E=f.type,E===Sn){if(k.tag===7){r(h,k.sibling),l=s(k,f.props.children),l.return=h,h=l;break e}}else if(k.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===cr&&Sh(E)===k.type){r(h,k.sibling),l=s(k,f.props),l.ref=gs(h,k,f),l.return=h,h=l;break e}r(h,k);break}else t(h,k);k=k.sibling}f.type===Sn?(l=Yr(f.props.children,h.mode,x,f.key),l.return=h,h=l):(x=fo(f.type,f.key,f.props,null,h.mode,x),x.ref=gs(h,l,f),x.return=h,h=x)}return u(h);case wn:e:{for(k=f.key;l!==null;){if(l.key===k)if(l.tag===4&&l.stateNode.containerInfo===f.containerInfo&&l.stateNode.implementation===f.implementation){r(h,l.sibling),l=s(l,f.children||[]),l.return=h,h=l;break e}else{r(h,l);break}else t(h,l);l=l.sibling}l=gl(f,h.mode,x),l.return=h,h=l}return u(h);case cr:return k=f._init,p(h,l,k(f._payload),x)}if(bs(f))return C(h,l,f,x);if(ds(f))return _(h,l,f,x);Bi(h,f)}return typeof f=="string"&&f!==""||typeof f=="number"?(f=""+f,l!==null&&l.tag===6?(r(h,l.sibling),l=s(l,f),l.return=h,h=l):(r(h,l),l=ml(f,h.mode,x),l.return=h,h=l),u(h)):r(h,l)}return p}var Un=xm(!0),wm=xm(!1),Lo=Lr(null),Ao=null,Nn=null,_u=null;function yu(){_u=Nn=Ao=null}function xu(e){var t=Lo.current;me(Lo),e._currentValue=t}function hc(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function On(e,t){Ao=e,_u=Nn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ge=!0),e.firstContext=null)}function gt(e){var t=e._currentValue;if(_u!==e)if(e={context:e,memoizedValue:t,next:null},Nn===null){if(Ao===null)throw Error(J(308));Nn=e,Ao.dependencies={lanes:0,firstContext:e}}else Nn=Nn.next=e;return t}var Gr=null;function wu(e){Gr===null?Gr=[e]:Gr.push(e)}function Sm(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,wu(t)):(r.next=s.next,s.next=r),t.interleaved=r,Yt(e,n)}function Yt(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var ur=!1;function Su(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function bm(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Gt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function xr(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ue&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,Yt(e,r)}return s=n.interleaved,s===null?(t.next=t,wu(n)):(t.next=s.next,s.next=t),n.interleaved=t,Yt(e,r)}function oo(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,au(e,r)}}function bh(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var u={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?s=o=u:o=o.next=u,r=r.next}while(r!==null);o===null?s=o=t:o=o.next=t}else s=o=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Do(e,t,r,n){var s=e.updateQueue;ur=!1;var o=s.firstBaseUpdate,u=s.lastBaseUpdate,i=s.shared.pending;if(i!==null){s.shared.pending=null;var a=i,d=a.next;a.next=null,u===null?o=d:u.next=d,u=a;var m=e.alternate;m!==null&&(m=m.updateQueue,i=m.lastBaseUpdate,i!==u&&(i===null?m.firstBaseUpdate=d:i.next=d,m.lastBaseUpdate=a))}if(o!==null){var c=s.baseState;u=0,m=d=a=null,i=o;do{var g=i.lane,y=i.eventTime;if((n&g)===g){m!==null&&(m=m.next={eventTime:y,lane:0,tag:i.tag,payload:i.payload,callback:i.callback,next:null});e:{var C=e,_=i;switch(g=t,y=r,_.tag){case 1:if(C=_.payload,typeof C=="function"){c=C.call(y,c,g);break e}c=C;break e;case 3:C.flags=C.flags&-65537|128;case 0:if(C=_.payload,g=typeof C=="function"?C.call(y,c,g):C,g==null)break e;c=xe({},c,g);break e;case 2:ur=!0}}i.callback!==null&&i.lane!==0&&(e.flags|=64,g=s.effects,g===null?s.effects=[i]:g.push(i))}else y={eventTime:y,lane:g,tag:i.tag,payload:i.payload,callback:i.callback,next:null},m===null?(d=m=y,a=c):m=m.next=y,u|=g;if(i=i.next,i===null){if(i=s.shared.pending,i===null)break;g=i,i=g.next,g.next=null,s.lastBaseUpdate=g,s.shared.pending=null}}while(!0);if(m===null&&(a=c),s.baseState=a,s.firstBaseUpdate=d,s.lastBaseUpdate=m,t=s.shared.interleaved,t!==null){s=t;do u|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);tn|=u,e.lanes=u,e.memoizedState=c}}function Ch(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(J(191,s));s.call(n)}}}var ui={},Ot=Lr(ui),Xs=Lr(ui),Ys=Lr(ui);function qr(e){if(e===ui)throw Error(J(174));return e}function bu(e,t){switch(fe(Ys,t),fe(Xs,e),fe(Ot,ui),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Kl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Kl(t,e)}me(Ot),fe(Ot,t)}function Vn(){me(Ot),me(Xs),me(Ys)}function Cm(e){qr(Ys.current);var t=qr(Ot.current),r=Kl(t,e.type);t!==r&&(fe(Xs,e),fe(Ot,r))}function Cu(e){Xs.current===e&&(me(Ot),me(Xs))}var _e=Lr(0);function Mo(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var cl=[];function ku(){for(var e=0;e<cl.length;e++)cl[e]._workInProgressVersionPrimary=null;cl.length=0}var ao=er.ReactCurrentDispatcher,ul=er.ReactCurrentBatchConfig,en=0,ye=null,Pe=null,Le=null,jo=!1,Ds=!1,Js=0,oS=0;function Ie(){throw Error(J(321))}function Eu(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Et(e[r],t[r]))return!1;return!0}function Ru(e,t,r,n,s,o){if(en=o,ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ao.current=e===null||e.memoizedState===null?uS:dS,e=r(n,s),Ds){o=0;do{if(Ds=!1,Js=0,25<=o)throw Error(J(301));o+=1,Le=Pe=null,t.updateQueue=null,ao.current=hS,e=r(n,s)}while(Ds)}if(ao.current=Io,t=Pe!==null&&Pe.next!==null,en=0,Le=Pe=ye=null,jo=!1,t)throw Error(J(300));return e}function Pu(){var e=Js!==0;return Js=0,e}function At(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Le===null?ye.memoizedState=Le=e:Le=Le.next=e,Le}function vt(){if(Pe===null){var e=ye.alternate;e=e!==null?e.memoizedState:null}else e=Pe.next;var t=Le===null?ye.memoizedState:Le.next;if(t!==null)Le=t,Pe=e;else{if(e===null)throw Error(J(310));Pe=e,e={memoizedState:Pe.memoizedState,baseState:Pe.baseState,baseQueue:Pe.baseQueue,queue:Pe.queue,next:null},Le===null?ye.memoizedState=Le=e:Le=Le.next=e}return Le}function Qs(e,t){return typeof t=="function"?t(e):t}function dl(e){var t=vt(),r=t.queue;if(r===null)throw Error(J(311));r.lastRenderedReducer=e;var n=Pe,s=n.baseQueue,o=r.pending;if(o!==null){if(s!==null){var u=s.next;s.next=o.next,o.next=u}n.baseQueue=s=o,r.pending=null}if(s!==null){o=s.next,n=n.baseState;var i=u=null,a=null,d=o;do{var m=d.lane;if((en&m)===m)a!==null&&(a=a.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),n=d.hasEagerState?d.eagerState:e(n,d.action);else{var c={lane:m,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};a===null?(i=a=c,u=n):a=a.next=c,ye.lanes|=m,tn|=m}d=d.next}while(d!==null&&d!==o);a===null?u=n:a.next=i,Et(n,t.memoizedState)||(Ge=!0),t.memoizedState=n,t.baseState=u,t.baseQueue=a,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do o=s.lane,ye.lanes|=o,tn|=o,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function hl(e){var t=vt(),r=t.queue;if(r===null)throw Error(J(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,o=t.memoizedState;if(s!==null){r.pending=null;var u=s=s.next;do o=e(o,u.action),u=u.next;while(u!==s);Et(o,t.memoizedState)||(Ge=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),r.lastRenderedState=o}return[o,n]}function km(){}function Em(e,t){var r=ye,n=vt(),s=t(),o=!Et(n.memoizedState,s);if(o&&(n.memoizedState=s,Ge=!0),n=n.queue,Tu(Tm.bind(null,r,n,e),[e]),n.getSnapshot!==t||o||Le!==null&&Le.memoizedState.tag&1){if(r.flags|=2048,Zs(9,Pm.bind(null,r,n,s,t),void 0,null),Ae===null)throw Error(J(349));en&30||Rm(r,t,s)}return s}function Rm(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=ye.updateQueue,t===null?(t={lastEffect:null,stores:null},ye.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Pm(e,t,r,n){t.value=r,t.getSnapshot=n,Nm(t)&&Lm(e)}function Tm(e,t,r){return r(function(){Nm(t)&&Lm(e)})}function Nm(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Et(e,r)}catch{return!0}}function Lm(e){var t=Yt(e,1);t!==null&&kt(t,e,1,-1)}function kh(e){var t=At();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Qs,lastRenderedState:e},t.queue=e,e=e.dispatch=cS.bind(null,ye,e),[t.memoizedState,e]}function Zs(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=ye.updateQueue,t===null?(t={lastEffect:null,stores:null},ye.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function Am(){return vt().memoizedState}function lo(e,t,r,n){var s=At();ye.flags|=e,s.memoizedState=Zs(1|t,r,void 0,n===void 0?null:n)}function ca(e,t,r,n){var s=vt();n=n===void 0?null:n;var o=void 0;if(Pe!==null){var u=Pe.memoizedState;if(o=u.destroy,n!==null&&Eu(n,u.deps)){s.memoizedState=Zs(t,r,o,n);return}}ye.flags|=e,s.memoizedState=Zs(1|t,r,o,n)}function Eh(e,t){return lo(8390656,8,e,t)}function Tu(e,t){return ca(2048,8,e,t)}function Dm(e,t){return ca(4,2,e,t)}function Mm(e,t){return ca(4,4,e,t)}function jm(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Im(e,t,r){return r=r!=null?r.concat([e]):null,ca(4,4,jm.bind(null,t,e),r)}function Nu(){}function Om(e,t){var r=vt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Eu(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Bm(e,t){var r=vt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Eu(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Fm(e,t,r){return en&21?(Et(r,t)||(r=Up(),ye.lanes|=r,tn|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ge=!0),e.memoizedState=r)}function aS(e,t){var r=de;de=r!==0&&4>r?r:4,e(!0);var n=ul.transition;ul.transition={};try{e(!1),t()}finally{de=r,ul.transition=n}}function $m(){return vt().memoizedState}function lS(e,t,r){var n=Sr(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Hm(e))zm(t,r);else if(r=Sm(e,t,r,n),r!==null){var s=He();kt(r,e,n,s),Wm(r,t,n)}}function cS(e,t,r){var n=Sr(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Hm(e))zm(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var u=t.lastRenderedState,i=o(u,r);if(s.hasEagerState=!0,s.eagerState=i,Et(i,u)){var a=t.interleaved;a===null?(s.next=s,wu(t)):(s.next=a.next,a.next=s),t.interleaved=s;return}}catch{}finally{}r=Sm(e,t,s,n),r!==null&&(s=He(),kt(r,e,n,s),Wm(r,t,n))}}function Hm(e){var t=e.alternate;return e===ye||t!==null&&t===ye}function zm(e,t){Ds=jo=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Wm(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,au(e,r)}}var Io={readContext:gt,useCallback:Ie,useContext:Ie,useEffect:Ie,useImperativeHandle:Ie,useInsertionEffect:Ie,useLayoutEffect:Ie,useMemo:Ie,useReducer:Ie,useRef:Ie,useState:Ie,useDebugValue:Ie,useDeferredValue:Ie,useTransition:Ie,useMutableSource:Ie,useSyncExternalStore:Ie,useId:Ie,unstable_isNewReconciler:!1},uS={readContext:gt,useCallback:function(e,t){return At().memoizedState=[e,t===void 0?null:t],e},useContext:gt,useEffect:Eh,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,lo(4194308,4,jm.bind(null,t,e),r)},useLayoutEffect:function(e,t){return lo(4194308,4,e,t)},useInsertionEffect:function(e,t){return lo(4,2,e,t)},useMemo:function(e,t){var r=At();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=At();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=lS.bind(null,ye,e),[n.memoizedState,e]},useRef:function(e){var t=At();return e={current:e},t.memoizedState=e},useState:kh,useDebugValue:Nu,useDeferredValue:function(e){return At().memoizedState=e},useTransition:function(){var e=kh(!1),t=e[0];return e=aS.bind(null,e[1]),At().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=ye,s=At();if(ge){if(r===void 0)throw Error(J(407));r=r()}else{if(r=t(),Ae===null)throw Error(J(349));en&30||Rm(n,t,r)}s.memoizedState=r;var o={value:r,getSnapshot:t};return s.queue=o,Eh(Tm.bind(null,n,o,e),[e]),n.flags|=2048,Zs(9,Pm.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=At(),t=Ae.identifierPrefix;if(ge){var r=Kt,n=Vt;r=(n&~(1<<32-Ct(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Js++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=oS++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},dS={readContext:gt,useCallback:Om,useContext:gt,useEffect:Tu,useImperativeHandle:Im,useInsertionEffect:Dm,useLayoutEffect:Mm,useMemo:Bm,useReducer:dl,useRef:Am,useState:function(){return dl(Qs)},useDebugValue:Nu,useDeferredValue:function(e){var t=vt();return Fm(t,Pe.memoizedState,e)},useTransition:function(){var e=dl(Qs)[0],t=vt().memoizedState;return[e,t]},useMutableSource:km,useSyncExternalStore:Em,useId:$m,unstable_isNewReconciler:!1},hS={readContext:gt,useCallback:Om,useContext:gt,useEffect:Tu,useImperativeHandle:Im,useInsertionEffect:Dm,useLayoutEffect:Mm,useMemo:Bm,useReducer:hl,useRef:Am,useState:function(){return hl(Qs)},useDebugValue:Nu,useDeferredValue:function(e){var t=vt();return Pe===null?t.memoizedState=e:Fm(t,Pe.memoizedState,e)},useTransition:function(){var e=hl(Qs)[0],t=vt().memoizedState;return[e,t]},useMutableSource:km,useSyncExternalStore:Em,useId:$m,unstable_isNewReconciler:!1};function wt(e,t){if(e&&e.defaultProps){t=xe({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function fc(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:xe({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var ua={isMounted:function(e){return(e=e._reactInternals)?un(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=He(),s=Sr(e),o=Gt(n,s);o.payload=t,r!=null&&(o.callback=r),t=xr(e,o,s),t!==null&&(kt(t,e,s,n),oo(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=He(),s=Sr(e),o=Gt(n,s);o.tag=1,o.payload=t,r!=null&&(o.callback=r),t=xr(e,o,s),t!==null&&(kt(t,e,s,n),oo(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=He(),n=Sr(e),s=Gt(r,n);s.tag=2,t!=null&&(s.callback=t),t=xr(e,s,n),t!==null&&(kt(t,e,n,r),oo(t,e,n))}};function Rh(e,t,r,n,s,o,u){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,o,u):t.prototype&&t.prototype.isPureReactComponent?!Vs(r,n)||!Vs(s,o):!0}function Um(e,t,r){var n=!1,s=Er,o=t.contextType;return typeof o=="object"&&o!==null?o=gt(o):(s=Xe(t)?Qr:Fe.current,n=t.contextTypes,o=(n=n!=null)?zn(e,s):Er),t=new t(r,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ua,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function Ph(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&ua.enqueueReplaceState(t,t.state,null)}function pc(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},Su(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=gt(o):(o=Xe(t)?Qr:Fe.current,s.context=zn(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(fc(e,t,o,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&ua.enqueueReplaceState(s,s.state,null),Do(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Kn(e,t){try{var r="",n=t;do r+=$x(n),n=n.return;while(n);var s=r}catch(o){s=`
39
+ Error generating stack: `+o.message+`
40
+ `+o.stack}return{value:e,source:t,stack:s,digest:null}}function fl(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function mc(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var fS=typeof WeakMap=="function"?WeakMap:Map;function Vm(e,t,r){r=Gt(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Bo||(Bo=!0,kc=n),mc(e,t)},r}function Km(e,t,r){r=Gt(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){mc(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(r.callback=function(){mc(e,t),typeof n!="function"&&(wr===null?wr=new Set([this]):wr.add(this));var u=t.stack;this.componentDidCatch(t.value,{componentStack:u!==null?u:""})}),r}function Th(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new fS;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=RS.bind(null,e,t,r),t.then(e,e))}function Nh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Lh(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Gt(-1,1),t.tag=2,xr(r,t,1))),r.lanes|=1),e)}var pS=er.ReactCurrentOwner,Ge=!1;function $e(e,t,r,n){t.child=e===null?wm(t,null,r,n):Un(t,e.child,r,n)}function Ah(e,t,r,n,s){r=r.render;var o=t.ref;return On(t,s),n=Ru(e,t,r,n,o,s),r=Pu(),e!==null&&!Ge?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Jt(e,t,s)):(ge&&r&&mu(t),t.flags|=1,$e(e,t,n,s),t.child)}function Dh(e,t,r,n,s){if(e===null){var o=r.type;return typeof o=="function"&&!Bu(o)&&o.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=o,Gm(e,t,o,n,s)):(e=fo(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var u=o.memoizedProps;if(r=r.compare,r=r!==null?r:Vs,r(u,n)&&e.ref===t.ref)return Jt(e,t,s)}return t.flags|=1,e=br(o,n),e.ref=t.ref,e.return=t,t.child=e}function Gm(e,t,r,n,s){if(e!==null){var o=e.memoizedProps;if(Vs(o,n)&&e.ref===t.ref)if(Ge=!1,t.pendingProps=n=o,(e.lanes&s)!==0)e.flags&131072&&(Ge=!0);else return t.lanes=e.lanes,Jt(e,t,s)}return gc(e,t,r,n,s)}function qm(e,t,r){var n=t.pendingProps,s=n.children,o=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},fe(An,et),et|=r;else{if(!(r&1073741824))return e=o!==null?o.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,fe(An,et),et|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=o!==null?o.baseLanes:r,fe(An,et),et|=n}else o!==null?(n=o.baseLanes|r,t.memoizedState=null):n=r,fe(An,et),et|=n;return $e(e,t,s,r),t.child}function Xm(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function gc(e,t,r,n,s){var o=Xe(r)?Qr:Fe.current;return o=zn(t,o),On(t,s),r=Ru(e,t,r,n,o,s),n=Pu(),e!==null&&!Ge?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Jt(e,t,s)):(ge&&n&&mu(t),t.flags|=1,$e(e,t,r,s),t.child)}function Mh(e,t,r,n,s){if(Xe(r)){var o=!0;Po(t)}else o=!1;if(On(t,s),t.stateNode===null)co(e,t),Um(t,r,n),pc(t,r,n,s),n=!0;else if(e===null){var u=t.stateNode,i=t.memoizedProps;u.props=i;var a=u.context,d=r.contextType;typeof d=="object"&&d!==null?d=gt(d):(d=Xe(r)?Qr:Fe.current,d=zn(t,d));var m=r.getDerivedStateFromProps,c=typeof m=="function"||typeof u.getSnapshotBeforeUpdate=="function";c||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(i!==n||a!==d)&&Ph(t,u,n,d),ur=!1;var g=t.memoizedState;u.state=g,Do(t,n,u,s),a=t.memoizedState,i!==n||g!==a||qe.current||ur?(typeof m=="function"&&(fc(t,r,m,n),a=t.memoizedState),(i=ur||Rh(t,r,i,n,g,a,d))?(c||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=a),u.props=n,u.state=a,u.context=d,n=i):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{u=t.stateNode,bm(e,t),i=t.memoizedProps,d=t.type===t.elementType?i:wt(t.type,i),u.props=d,c=t.pendingProps,g=u.context,a=r.contextType,typeof a=="object"&&a!==null?a=gt(a):(a=Xe(r)?Qr:Fe.current,a=zn(t,a));var y=r.getDerivedStateFromProps;(m=typeof y=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(i!==c||g!==a)&&Ph(t,u,n,a),ur=!1,g=t.memoizedState,u.state=g,Do(t,n,u,s);var C=t.memoizedState;i!==c||g!==C||qe.current||ur?(typeof y=="function"&&(fc(t,r,y,n),C=t.memoizedState),(d=ur||Rh(t,r,d,n,g,C,a)||!1)?(m||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(n,C,a),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(n,C,a)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||i===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=C),u.props=n,u.state=C,u.context=a,n=d):(typeof u.componentDidUpdate!="function"||i===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),n=!1)}return vc(e,t,r,n,o,s)}function vc(e,t,r,n,s,o){Xm(e,t);var u=(t.flags&128)!==0;if(!n&&!u)return s&&yh(t,r,!1),Jt(e,t,o);n=t.stateNode,pS.current=t;var i=u&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&u?(t.child=Un(t,e.child,null,o),t.child=Un(t,null,i,o)):$e(e,t,i,o),t.memoizedState=n.state,s&&yh(t,r,!0),t.child}function Ym(e){var t=e.stateNode;t.pendingContext?_h(e,t.pendingContext,t.pendingContext!==t.context):t.context&&_h(e,t.context,!1),bu(e,t.containerInfo)}function jh(e,t,r,n,s){return Wn(),vu(s),t.flags|=256,$e(e,t,r,n),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0};function yc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Jm(e,t,r){var n=t.pendingProps,s=_e.current,o=!1,u=(t.flags&128)!==0,i;if((i=u)||(i=e!==null&&e.memoizedState===null?!1:(s&2)!==0),i?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),fe(_e,s&1),e===null)return dc(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(u=n.children,e=n.fallback,o?(n=t.mode,o=t.child,u={mode:"hidden",children:u},!(n&1)&&o!==null?(o.childLanes=0,o.pendingProps=u):o=fa(u,n,0,null),e=Yr(e,n,r,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=yc(r),t.memoizedState=_c,e):Lu(t,u));if(s=e.memoizedState,s!==null&&(i=s.dehydrated,i!==null))return mS(e,t,u,n,i,s,r);if(o){o=n.fallback,u=t.mode,s=e.child,i=s.sibling;var a={mode:"hidden",children:n.children};return!(u&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=a,t.deletions=null):(n=br(s,a),n.subtreeFlags=s.subtreeFlags&14680064),i!==null?o=br(i,o):(o=Yr(o,u,r,null),o.flags|=2),o.return=t,n.return=t,n.sibling=o,t.child=n,n=o,o=t.child,u=e.child.memoizedState,u=u===null?yc(r):{baseLanes:u.baseLanes|r,cachePool:null,transitions:u.transitions},o.memoizedState=u,o.childLanes=e.childLanes&~r,t.memoizedState=_c,n}return o=e.child,e=o.sibling,n=br(o,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Lu(e,t){return t=fa({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Fi(e,t,r,n){return n!==null&&vu(n),Un(t,e.child,null,r),e=Lu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function mS(e,t,r,n,s,o,u){if(r)return t.flags&256?(t.flags&=-257,n=fl(Error(J(422))),Fi(e,t,u,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=n.fallback,s=t.mode,n=fa({mode:"visible",children:n.children},s,0,null),o=Yr(o,s,u,null),o.flags|=2,n.return=t,o.return=t,n.sibling=o,t.child=n,t.mode&1&&Un(t,e.child,null,u),t.child.memoizedState=yc(u),t.memoizedState=_c,o);if(!(t.mode&1))return Fi(e,t,u,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var i=n.dgst;return n=i,o=Error(J(419)),n=fl(o,n,void 0),Fi(e,t,u,n)}if(i=(u&e.childLanes)!==0,Ge||i){if(n=Ae,n!==null){switch(u&-u){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|u)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,Yt(e,s),kt(n,e,s,-1))}return Ou(),n=fl(Error(J(421))),Fi(e,t,u,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=PS.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,rt=yr(s.nextSibling),nt=t,ge=!0,bt=null,e!==null&&(dt[ht++]=Vt,dt[ht++]=Kt,dt[ht++]=Zr,Vt=e.id,Kt=e.overflow,Zr=t),t=Lu(t,n.children),t.flags|=4096,t)}function Ih(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),hc(e.return,t,r)}function pl(e,t,r,n,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailMode=s)}function Qm(e,t,r){var n=t.pendingProps,s=n.revealOrder,o=n.tail;if($e(e,t,n.children,r),n=_e.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ih(e,r,t);else if(e.tag===19)Ih(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(fe(_e,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&Mo(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),pl(t,!1,s,r,o);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Mo(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}pl(t,!0,r,null,o);break;case"together":pl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function co(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Jt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),tn|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(J(153));if(t.child!==null){for(e=t.child,r=br(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=br(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function gS(e,t,r){switch(t.tag){case 3:Ym(t),Wn();break;case 5:Cm(t);break;case 1:Xe(t.type)&&Po(t);break;case 4:bu(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;fe(Lo,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(fe(_e,_e.current&1),t.flags|=128,null):r&t.child.childLanes?Jm(e,t,r):(fe(_e,_e.current&1),e=Jt(e,t,r),e!==null?e.sibling:null);fe(_e,_e.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return Qm(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),fe(_e,_e.current),n)break;return null;case 22:case 23:return t.lanes=0,qm(e,t,r)}return Jt(e,t,r)}var Zm,xc,eg,tg;Zm=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&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;r=r.return}r.sibling.return=r.return,r=r.sibling}};xc=function(){};eg=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,qr(Ot.current);var o=null;switch(r){case"input":s=zl(e,s),n=zl(e,n),o=[];break;case"select":s=xe({},s,{value:void 0}),n=xe({},n,{value:void 0}),o=[];break;case"textarea":s=Vl(e,s),n=Vl(e,n),o=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Eo)}Gl(r,n);var u;r=null;for(d in s)if(!n.hasOwnProperty(d)&&s.hasOwnProperty(d)&&s[d]!=null)if(d==="style"){var i=s[d];for(u in i)i.hasOwnProperty(u)&&(r||(r={}),r[u]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Bs.hasOwnProperty(d)?o||(o=[]):(o=o||[]).push(d,null));for(d in n){var a=n[d];if(i=s!=null?s[d]:void 0,n.hasOwnProperty(d)&&a!==i&&(a!=null||i!=null))if(d==="style")if(i){for(u in i)!i.hasOwnProperty(u)||a&&a.hasOwnProperty(u)||(r||(r={}),r[u]="");for(u in a)a.hasOwnProperty(u)&&i[u]!==a[u]&&(r||(r={}),r[u]=a[u])}else r||(o||(o=[]),o.push(d,r)),r=a;else d==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,i=i?i.__html:void 0,a!=null&&i!==a&&(o=o||[]).push(d,a)):d==="children"?typeof a!="string"&&typeof a!="number"||(o=o||[]).push(d,""+a):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Bs.hasOwnProperty(d)?(a!=null&&d==="onScroll"&&pe("scroll",e),o||i===a||(o=[])):(o=o||[]).push(d,a))}r&&(o=o||[]).push("style",r);var d=o;(t.updateQueue=d)&&(t.flags|=4)}};tg=function(e,t,r,n){r!==n&&(t.flags|=4)};function vs(e,t){if(!ge)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Oe(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function vS(e,t,r){var n=t.pendingProps;switch(gu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Oe(t),null;case 1:return Xe(t.type)&&Ro(),Oe(t),null;case 3:return n=t.stateNode,Vn(),me(qe),me(Fe),ku(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Oi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,bt!==null&&(Pc(bt),bt=null))),xc(e,t),Oe(t),null;case 5:Cu(t);var s=qr(Ys.current);if(r=t.type,e!==null&&t.stateNode!=null)eg(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(J(166));return Oe(t),null}if(e=qr(Ot.current),Oi(t)){n=t.stateNode,r=t.type;var o=t.memoizedProps;switch(n[Dt]=t,n[qs]=o,e=(t.mode&1)!==0,r){case"dialog":pe("cancel",n),pe("close",n);break;case"iframe":case"object":case"embed":pe("load",n);break;case"video":case"audio":for(s=0;s<ks.length;s++)pe(ks[s],n);break;case"source":pe("error",n);break;case"img":case"image":case"link":pe("error",n),pe("load",n);break;case"details":pe("toggle",n);break;case"input":Vd(n,o),pe("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!o.multiple},pe("invalid",n);break;case"textarea":Gd(n,o),pe("invalid",n)}Gl(r,o),s=null;for(var u in o)if(o.hasOwnProperty(u)){var i=o[u];u==="children"?typeof i=="string"?n.textContent!==i&&(o.suppressHydrationWarning!==!0&&Ii(n.textContent,i,e),s=["children",i]):typeof i=="number"&&n.textContent!==""+i&&(o.suppressHydrationWarning!==!0&&Ii(n.textContent,i,e),s=["children",""+i]):Bs.hasOwnProperty(u)&&i!=null&&u==="onScroll"&&pe("scroll",n)}switch(r){case"input":Pi(n),Kd(n,o,!0);break;case"textarea":Pi(n),qd(n);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(n.onclick=Eo)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{u=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Tp(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=u.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=u.createElement(r,{is:n.is}):(e=u.createElement(r),r==="select"&&(u=e,n.multiple?u.multiple=!0:n.size&&(u.size=n.size))):e=u.createElementNS(e,r),e[Dt]=t,e[qs]=n,Zm(e,t,!1,!1),t.stateNode=e;e:{switch(u=ql(r,n),r){case"dialog":pe("cancel",e),pe("close",e),s=n;break;case"iframe":case"object":case"embed":pe("load",e),s=n;break;case"video":case"audio":for(s=0;s<ks.length;s++)pe(ks[s],e);s=n;break;case"source":pe("error",e),s=n;break;case"img":case"image":case"link":pe("error",e),pe("load",e),s=n;break;case"details":pe("toggle",e),s=n;break;case"input":Vd(e,n),s=zl(e,n),pe("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=xe({},n,{value:void 0}),pe("invalid",e);break;case"textarea":Gd(e,n),s=Vl(e,n),pe("invalid",e);break;default:s=n}Gl(r,s),i=s;for(o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="style"?Ap(e,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Np(e,a)):o==="children"?typeof a=="string"?(r!=="textarea"||a!=="")&&Fs(e,a):typeof a=="number"&&Fs(e,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Bs.hasOwnProperty(o)?a!=null&&o==="onScroll"&&pe("scroll",e):a!=null&&tu(e,o,a,u))}switch(r){case"input":Pi(e),Kd(e,n,!1);break;case"textarea":Pi(e),qd(e);break;case"option":n.value!=null&&e.setAttribute("value",""+kr(n.value));break;case"select":e.multiple=!!n.multiple,o=n.value,o!=null?Dn(e,!!n.multiple,o,!1):n.defaultValue!=null&&Dn(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Eo)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Oe(t),null;case 6:if(e&&t.stateNode!=null)tg(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(J(166));if(r=qr(Ys.current),qr(Ot.current),Oi(t)){if(n=t.stateNode,r=t.memoizedProps,n[Dt]=t,(o=n.nodeValue!==r)&&(e=nt,e!==null))switch(e.tag){case 3:Ii(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ii(n.nodeValue,r,(e.mode&1)!==0)}o&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Dt]=t,t.stateNode=n}return Oe(t),null;case 13:if(me(_e),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ge&&rt!==null&&t.mode&1&&!(t.flags&128))ym(),Wn(),t.flags|=98560,o=!1;else if(o=Oi(t),n!==null&&n.dehydrated!==null){if(e===null){if(!o)throw Error(J(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(J(317));o[Dt]=t}else Wn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Oe(t),o=!1}else bt!==null&&(Pc(bt),bt=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||_e.current&1?Te===0&&(Te=3):Ou())),t.updateQueue!==null&&(t.flags|=4),Oe(t),null);case 4:return Vn(),xc(e,t),e===null&&Ks(t.stateNode.containerInfo),Oe(t),null;case 10:return xu(t.type._context),Oe(t),null;case 17:return Xe(t.type)&&Ro(),Oe(t),null;case 19:if(me(_e),o=t.memoizedState,o===null)return Oe(t),null;if(n=(t.flags&128)!==0,u=o.rendering,u===null)if(n)vs(o,!1);else{if(Te!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(u=Mo(e),u!==null){for(t.flags|=128,vs(o,!1),n=u.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)o=r,e=n,o.flags&=14680066,u=o.alternate,u===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=u.childLanes,o.lanes=u.lanes,o.child=u.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=u.memoizedProps,o.memoizedState=u.memoizedState,o.updateQueue=u.updateQueue,o.type=u.type,e=u.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return fe(_e,_e.current&1|2),t.child}e=e.sibling}o.tail!==null&&Se()>Gn&&(t.flags|=128,n=!0,vs(o,!1),t.lanes=4194304)}else{if(!n)if(e=Mo(u),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),vs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!u.alternate&&!ge)return Oe(t),null}else 2*Se()-o.renderingStartTime>Gn&&r!==1073741824&&(t.flags|=128,n=!0,vs(o,!1),t.lanes=4194304);o.isBackwards?(u.sibling=t.child,t.child=u):(r=o.last,r!==null?r.sibling=u:t.child=u,o.last=u)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Se(),t.sibling=null,r=_e.current,fe(_e,n?r&1|2:r&1),t):(Oe(t),null);case 22:case 23:return Iu(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?et&1073741824&&(Oe(t),t.subtreeFlags&6&&(t.flags|=8192)):Oe(t),null;case 24:return null;case 25:return null}throw Error(J(156,t.tag))}function _S(e,t){switch(gu(t),t.tag){case 1:return Xe(t.type)&&Ro(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vn(),me(qe),me(Fe),ku(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Cu(t),null;case 13:if(me(_e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));Wn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return me(_e),null;case 4:return Vn(),null;case 10:return xu(t.type._context),null;case 22:case 23:return Iu(),null;case 24:return null;default:return null}}var $i=!1,Be=!1,yS=typeof WeakSet=="function"?WeakSet:Set,Z=null;function Ln(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){we(e,t,n)}else r.current=null}function wc(e,t,r){try{r()}catch(n){we(e,t,n)}}var Oh=!1;function xS(e,t){if(sc=bo,e=om(),pu(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var u=0,i=-1,a=-1,d=0,m=0,c=e,g=null;t:for(;;){for(var y;c!==r||s!==0&&c.nodeType!==3||(i=u+s),c!==o||n!==0&&c.nodeType!==3||(a=u+n),c.nodeType===3&&(u+=c.nodeValue.length),(y=c.firstChild)!==null;)g=c,c=y;for(;;){if(c===e)break t;if(g===r&&++d===s&&(i=u),g===o&&++m===n&&(a=u),(y=c.nextSibling)!==null)break;c=g,g=c.parentNode}c=y}r=i===-1||a===-1?null:{start:i,end:a}}else r=null}r=r||{start:0,end:0}}else r=null;for(ic={focusedElem:e,selectionRange:r},bo=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var C=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(C!==null){var _=C.memoizedProps,p=C.memoizedState,h=t.stateNode,l=h.getSnapshotBeforeUpdate(t.elementType===t.type?_:wt(t.type,_),p);h.__reactInternalSnapshotBeforeUpdate=l}break;case 3:var f=t.stateNode.containerInfo;f.nodeType===1?f.textContent="":f.nodeType===9&&f.documentElement&&f.removeChild(f.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(J(163))}}catch(x){we(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return C=Oh,Oh=!1,C}function Ms(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&wc(t,r,o)}s=s.next}while(s!==n)}}function da(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Sc(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function rg(e){var t=e.alternate;t!==null&&(e.alternate=null,rg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Dt],delete t[qs],delete t[lc],delete t[rS],delete t[nS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ng(e){return e.tag===5||e.tag===3||e.tag===4}function Bh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ng(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function bc(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Eo));else if(n!==4&&(e=e.child,e!==null))for(bc(e,t,r),e=e.sibling;e!==null;)bc(e,t,r),e=e.sibling}function Cc(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Cc(e,t,r),e=e.sibling;e!==null;)Cc(e,t,r),e=e.sibling}var De=null,St=!1;function ir(e,t,r){for(r=r.child;r!==null;)sg(e,t,r),r=r.sibling}function sg(e,t,r){if(It&&typeof It.onCommitFiberUnmount=="function")try{It.onCommitFiberUnmount(na,r)}catch{}switch(r.tag){case 5:Be||Ln(r,t);case 6:var n=De,s=St;De=null,ir(e,t,r),De=n,St=s,De!==null&&(St?(e=De,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):De.removeChild(r.stateNode));break;case 18:De!==null&&(St?(e=De,r=r.stateNode,e.nodeType===8?al(e.parentNode,r):e.nodeType===1&&al(e,r),Ws(e)):al(De,r.stateNode));break;case 4:n=De,s=St,De=r.stateNode.containerInfo,St=!0,ir(e,t,r),De=n,St=s;break;case 0:case 11:case 14:case 15:if(!Be&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var o=s,u=o.destroy;o=o.tag,u!==void 0&&(o&2||o&4)&&wc(r,t,u),s=s.next}while(s!==n)}ir(e,t,r);break;case 1:if(!Be&&(Ln(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(i){we(r,t,i)}ir(e,t,r);break;case 21:ir(e,t,r);break;case 22:r.mode&1?(Be=(n=Be)||r.memoizedState!==null,ir(e,t,r),Be=n):ir(e,t,r);break;default:ir(e,t,r)}}function Fh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new yS),t.forEach(function(n){var s=TS.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function yt(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var o=e,u=t,i=u;e:for(;i!==null;){switch(i.tag){case 5:De=i.stateNode,St=!1;break e;case 3:De=i.stateNode.containerInfo,St=!0;break e;case 4:De=i.stateNode.containerInfo,St=!0;break e}i=i.return}if(De===null)throw Error(J(160));sg(o,u,s),De=null,St=!1;var a=s.alternate;a!==null&&(a.return=null),s.return=null}catch(d){we(s,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ig(t,e),t=t.sibling}function ig(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(yt(t,e),Lt(e),n&4){try{Ms(3,e,e.return),da(3,e)}catch(_){we(e,e.return,_)}try{Ms(5,e,e.return)}catch(_){we(e,e.return,_)}}break;case 1:yt(t,e),Lt(e),n&512&&r!==null&&Ln(r,r.return);break;case 5:if(yt(t,e),Lt(e),n&512&&r!==null&&Ln(r,r.return),e.flags&32){var s=e.stateNode;try{Fs(s,"")}catch(_){we(e,e.return,_)}}if(n&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,u=r!==null?r.memoizedProps:o,i=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{i==="input"&&o.type==="radio"&&o.name!=null&&Rp(s,o),ql(i,u);var d=ql(i,o);for(u=0;u<a.length;u+=2){var m=a[u],c=a[u+1];m==="style"?Ap(s,c):m==="dangerouslySetInnerHTML"?Np(s,c):m==="children"?Fs(s,c):tu(s,m,c,d)}switch(i){case"input":Wl(s,o);break;case"textarea":Pp(s,o);break;case"select":var g=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var y=o.value;y!=null?Dn(s,!!o.multiple,y,!1):g!==!!o.multiple&&(o.defaultValue!=null?Dn(s,!!o.multiple,o.defaultValue,!0):Dn(s,!!o.multiple,o.multiple?[]:"",!1))}s[qs]=o}catch(_){we(e,e.return,_)}}break;case 6:if(yt(t,e),Lt(e),n&4){if(e.stateNode===null)throw Error(J(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(_){we(e,e.return,_)}}break;case 3:if(yt(t,e),Lt(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Ws(t.containerInfo)}catch(_){we(e,e.return,_)}break;case 4:yt(t,e),Lt(e);break;case 13:yt(t,e),Lt(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Mu=Se())),n&4&&Fh(e);break;case 22:if(m=r!==null&&r.memoizedState!==null,e.mode&1?(Be=(d=Be)||m,yt(t,e),Be=d):yt(t,e),Lt(e),n&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!m&&e.mode&1)for(Z=e,m=e.child;m!==null;){for(c=Z=m;Z!==null;){switch(g=Z,y=g.child,g.tag){case 0:case 11:case 14:case 15:Ms(4,g,g.return);break;case 1:Ln(g,g.return);var C=g.stateNode;if(typeof C.componentWillUnmount=="function"){n=g,r=g.return;try{t=n,C.props=t.memoizedProps,C.state=t.memoizedState,C.componentWillUnmount()}catch(_){we(n,r,_)}}break;case 5:Ln(g,g.return);break;case 22:if(g.memoizedState!==null){Hh(c);continue}}y!==null?(y.return=g,Z=y):Hh(c)}m=m.sibling}e:for(m=null,c=e;;){if(c.tag===5){if(m===null){m=c;try{s=c.stateNode,d?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(i=c.stateNode,a=c.memoizedProps.style,u=a!=null&&a.hasOwnProperty("display")?a.display:null,i.style.display=Lp("display",u))}catch(_){we(e,e.return,_)}}}else if(c.tag===6){if(m===null)try{c.stateNode.nodeValue=d?"":c.memoizedProps}catch(_){we(e,e.return,_)}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===e)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===e)break e;for(;c.sibling===null;){if(c.return===null||c.return===e)break e;m===c&&(m=null),c=c.return}m===c&&(m=null),c.sibling.return=c.return,c=c.sibling}}break;case 19:yt(t,e),Lt(e),n&4&&Fh(e);break;case 21:break;default:yt(t,e),Lt(e)}}function Lt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(ng(r)){var n=r;break e}r=r.return}throw Error(J(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(Fs(s,""),n.flags&=-33);var o=Bh(e);Cc(e,o,s);break;case 3:case 4:var u=n.stateNode.containerInfo,i=Bh(e);bc(e,i,u);break;default:throw Error(J(161))}}catch(a){we(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function wS(e,t,r){Z=e,og(e)}function og(e,t,r){for(var n=(e.mode&1)!==0;Z!==null;){var s=Z,o=s.child;if(s.tag===22&&n){var u=s.memoizedState!==null||$i;if(!u){var i=s.alternate,a=i!==null&&i.memoizedState!==null||Be;i=$i;var d=Be;if($i=u,(Be=a)&&!d)for(Z=s;Z!==null;)u=Z,a=u.child,u.tag===22&&u.memoizedState!==null?zh(s):a!==null?(a.return=u,Z=a):zh(s);for(;o!==null;)Z=o,og(o),o=o.sibling;Z=s,$i=i,Be=d}$h(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,Z=o):$h(e)}}function $h(e){for(;Z!==null;){var t=Z;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Be||da(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Be)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:wt(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&Ch(t,o,n);break;case 3:var u=t.updateQueue;if(u!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Ch(t,u,r)}break;case 5:var i=t.stateNode;if(r===null&&t.flags&4){r=i;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&r.focus();break;case"img":a.src&&(r.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var m=d.memoizedState;if(m!==null){var c=m.dehydrated;c!==null&&Ws(c)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(J(163))}Be||t.flags&512&&Sc(t)}catch(g){we(t,t.return,g)}}if(t===e){Z=null;break}if(r=t.sibling,r!==null){r.return=t.return,Z=r;break}Z=t.return}}function Hh(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Z=r;break}Z=t.return}}function zh(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{da(4,t)}catch(a){we(t,r,a)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(a){we(t,s,a)}}var o=t.return;try{Sc(t)}catch(a){we(t,o,a)}break;case 5:var u=t.return;try{Sc(t)}catch(a){we(t,u,a)}}}catch(a){we(t,t.return,a)}if(t===e){Z=null;break}var i=t.sibling;if(i!==null){i.return=t.return,Z=i;break}Z=t.return}}var SS=Math.ceil,Oo=er.ReactCurrentDispatcher,Au=er.ReactCurrentOwner,pt=er.ReactCurrentBatchConfig,ue=0,Ae=null,ke=null,Me=0,et=0,An=Lr(0),Te=0,ei=null,tn=0,ha=0,Du=0,js=null,Ke=null,Mu=0,Gn=1/0,Wt=null,Bo=!1,kc=null,wr=null,Hi=!1,pr=null,Fo=0,Is=0,Ec=null,uo=-1,ho=0;function He(){return ue&6?Se():uo!==-1?uo:uo=Se()}function Sr(e){return e.mode&1?ue&2&&Me!==0?Me&-Me:iS.transition!==null?(ho===0&&(ho=Up()),ho):(e=de,e!==0||(e=window.event,e=e===void 0?16:Jp(e.type)),e):1}function kt(e,t,r,n){if(50<Is)throw Is=0,Ec=null,Error(J(185));ai(e,r,n),(!(ue&2)||e!==Ae)&&(e===Ae&&(!(ue&2)&&(ha|=r),Te===4&&hr(e,Me)),Ye(e,n),r===1&&ue===0&&!(t.mode&1)&&(Gn=Se()+500,la&&Ar()))}function Ye(e,t){var r=e.callbackNode;iw(e,t);var n=So(e,e===Ae?Me:0);if(n===0)r!==null&&Jd(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&Jd(r),t===1)e.tag===0?sS(Wh.bind(null,e)):gm(Wh.bind(null,e)),eS(function(){!(ue&6)&&Ar()}),r=null;else{switch(Vp(n)){case 1:r=ou;break;case 4:r=zp;break;case 16:r=wo;break;case 536870912:r=Wp;break;default:r=wo}r=pg(r,ag.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function ag(e,t){if(uo=-1,ho=0,ue&6)throw Error(J(327));var r=e.callbackNode;if(Bn()&&e.callbackNode!==r)return null;var n=So(e,e===Ae?Me:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=$o(e,n);else{t=n;var s=ue;ue|=2;var o=cg();(Ae!==e||Me!==t)&&(Wt=null,Gn=Se()+500,Xr(e,t));do try{kS();break}catch(i){lg(e,i)}while(!0);yu(),Oo.current=o,ue=s,ke!==null?t=0:(Ae=null,Me=0,t=Te)}if(t!==0){if(t===2&&(s=Zl(e),s!==0&&(n=s,t=Rc(e,s))),t===1)throw r=ei,Xr(e,0),hr(e,n),Ye(e,Se()),r;if(t===6)hr(e,n);else{if(s=e.current.alternate,!(n&30)&&!bS(s)&&(t=$o(e,n),t===2&&(o=Zl(e),o!==0&&(n=o,t=Rc(e,o))),t===1))throw r=ei,Xr(e,0),hr(e,n),Ye(e,Se()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(J(345));case 2:Ur(e,Ke,Wt);break;case 3:if(hr(e,n),(n&130023424)===n&&(t=Mu+500-Se(),10<t)){if(So(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){He(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=ac(Ur.bind(null,e,Ke,Wt),t);break}Ur(e,Ke,Wt);break;case 4:if(hr(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var u=31-Ct(n);o=1<<u,u=t[u],u>s&&(s=u),n&=~o}if(n=s,n=Se()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*SS(n/1960))-n,10<n){e.timeoutHandle=ac(Ur.bind(null,e,Ke,Wt),n);break}Ur(e,Ke,Wt);break;case 5:Ur(e,Ke,Wt);break;default:throw Error(J(329))}}}return Ye(e,Se()),e.callbackNode===r?ag.bind(null,e):null}function Rc(e,t){var r=js;return e.current.memoizedState.isDehydrated&&(Xr(e,t).flags|=256),e=$o(e,t),e!==2&&(t=Ke,Ke=r,t!==null&&Pc(t)),e}function Pc(e){Ke===null?Ke=e:Ke.push.apply(Ke,e)}function bS(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],o=s.getSnapshot;s=s.value;try{if(!Et(o(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function hr(e,t){for(t&=~Du,t&=~ha,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Ct(t),n=1<<r;e[r]=-1,t&=~n}}function Wh(e){if(ue&6)throw Error(J(327));Bn();var t=So(e,0);if(!(t&1))return Ye(e,Se()),null;var r=$o(e,t);if(e.tag!==0&&r===2){var n=Zl(e);n!==0&&(t=n,r=Rc(e,n))}if(r===1)throw r=ei,Xr(e,0),hr(e,t),Ye(e,Se()),r;if(r===6)throw Error(J(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ur(e,Ke,Wt),Ye(e,Se()),null}function ju(e,t){var r=ue;ue|=1;try{return e(t)}finally{ue=r,ue===0&&(Gn=Se()+500,la&&Ar())}}function rn(e){pr!==null&&pr.tag===0&&!(ue&6)&&Bn();var t=ue;ue|=1;var r=pt.transition,n=de;try{if(pt.transition=null,de=1,e)return e()}finally{de=n,pt.transition=r,ue=t,!(ue&6)&&Ar()}}function Iu(){et=An.current,me(An)}function Xr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Zw(r)),ke!==null)for(r=ke.return;r!==null;){var n=r;switch(gu(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Ro();break;case 3:Vn(),me(qe),me(Fe),ku();break;case 5:Cu(n);break;case 4:Vn();break;case 13:me(_e);break;case 19:me(_e);break;case 10:xu(n.type._context);break;case 22:case 23:Iu()}r=r.return}if(Ae=e,ke=e=br(e.current,null),Me=et=t,Te=0,ei=null,Du=ha=tn=0,Ke=js=null,Gr!==null){for(t=0;t<Gr.length;t++)if(r=Gr[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,o=r.pending;if(o!==null){var u=o.next;o.next=s,n.next=u}r.pending=n}Gr=null}return e}function lg(e,t){do{var r=ke;try{if(yu(),ao.current=Io,jo){for(var n=ye.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}jo=!1}if(en=0,Le=Pe=ye=null,Ds=!1,Js=0,Au.current=null,r===null||r.return===null){Te=1,ei=t,ke=null;break}e:{var o=e,u=r.return,i=r,a=t;if(t=Me,i.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var d=a,m=i,c=m.tag;if(!(m.mode&1)&&(c===0||c===11||c===15)){var g=m.alternate;g?(m.updateQueue=g.updateQueue,m.memoizedState=g.memoizedState,m.lanes=g.lanes):(m.updateQueue=null,m.memoizedState=null)}var y=Nh(u);if(y!==null){y.flags&=-257,Lh(y,u,i,o,t),y.mode&1&&Th(o,d,t),t=y,a=d;var C=t.updateQueue;if(C===null){var _=new Set;_.add(a),t.updateQueue=_}else C.add(a);break e}else{if(!(t&1)){Th(o,d,t),Ou();break e}a=Error(J(426))}}else if(ge&&i.mode&1){var p=Nh(u);if(p!==null){!(p.flags&65536)&&(p.flags|=256),Lh(p,u,i,o,t),vu(Kn(a,i));break e}}o=a=Kn(a,i),Te!==4&&(Te=2),js===null?js=[o]:js.push(o),o=u;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var h=Vm(o,a,t);bh(o,h);break e;case 1:i=a;var l=o.type,f=o.stateNode;if(!(o.flags&128)&&(typeof l.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(wr===null||!wr.has(f)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Km(o,i,t);bh(o,x);break e}}o=o.return}while(o!==null)}dg(r)}catch(E){t=E,ke===r&&r!==null&&(ke=r=r.return);continue}break}while(!0)}function cg(){var e=Oo.current;return Oo.current=Io,e===null?Io:e}function Ou(){(Te===0||Te===3||Te===2)&&(Te=4),Ae===null||!(tn&268435455)&&!(ha&268435455)||hr(Ae,Me)}function $o(e,t){var r=ue;ue|=2;var n=cg();(Ae!==e||Me!==t)&&(Wt=null,Xr(e,t));do try{CS();break}catch(s){lg(e,s)}while(!0);if(yu(),ue=r,Oo.current=n,ke!==null)throw Error(J(261));return Ae=null,Me=0,Te}function CS(){for(;ke!==null;)ug(ke)}function kS(){for(;ke!==null&&!Yx();)ug(ke)}function ug(e){var t=fg(e.alternate,e,et);e.memoizedProps=e.pendingProps,t===null?dg(e):ke=t,Au.current=null}function dg(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=_S(r,t),r!==null){r.flags&=32767,ke=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Te=6,ke=null;return}}else if(r=vS(r,t,et),r!==null){ke=r;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);Te===0&&(Te=5)}function Ur(e,t,r){var n=de,s=pt.transition;try{pt.transition=null,de=1,ES(e,t,r,n)}finally{pt.transition=s,de=n}return null}function ES(e,t,r,n){do Bn();while(pr!==null);if(ue&6)throw Error(J(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(J(177));e.callbackNode=null,e.callbackPriority=0;var o=r.lanes|r.childLanes;if(ow(e,o),e===Ae&&(ke=Ae=null,Me=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Hi||(Hi=!0,pg(wo,function(){return Bn(),null})),o=(r.flags&15990)!==0,r.subtreeFlags&15990||o){o=pt.transition,pt.transition=null;var u=de;de=1;var i=ue;ue|=4,Au.current=null,xS(e,r),ig(r,e),Kw(ic),bo=!!sc,ic=sc=null,e.current=r,wS(r),Jx(),ue=i,de=u,pt.transition=o}else e.current=r;if(Hi&&(Hi=!1,pr=e,Fo=s),o=e.pendingLanes,o===0&&(wr=null),ew(r.stateNode),Ye(e,Se()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(Bo)throw Bo=!1,e=kc,kc=null,e;return Fo&1&&e.tag!==0&&Bn(),o=e.pendingLanes,o&1?e===Ec?Is++:(Is=0,Ec=e):Is=0,Ar(),null}function Bn(){if(pr!==null){var e=Vp(Fo),t=pt.transition,r=de;try{if(pt.transition=null,de=16>e?16:e,pr===null)var n=!1;else{if(e=pr,pr=null,Fo=0,ue&6)throw Error(J(331));var s=ue;for(ue|=4,Z=e.current;Z!==null;){var o=Z,u=o.child;if(Z.flags&16){var i=o.deletions;if(i!==null){for(var a=0;a<i.length;a++){var d=i[a];for(Z=d;Z!==null;){var m=Z;switch(m.tag){case 0:case 11:case 15:Ms(8,m,o)}var c=m.child;if(c!==null)c.return=m,Z=c;else for(;Z!==null;){m=Z;var g=m.sibling,y=m.return;if(rg(m),m===d){Z=null;break}if(g!==null){g.return=y,Z=g;break}Z=y}}}var C=o.alternate;if(C!==null){var _=C.child;if(_!==null){C.child=null;do{var p=_.sibling;_.sibling=null,_=p}while(_!==null)}}Z=o}}if(o.subtreeFlags&2064&&u!==null)u.return=o,Z=u;else e:for(;Z!==null;){if(o=Z,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Ms(9,o,o.return)}var h=o.sibling;if(h!==null){h.return=o.return,Z=h;break e}Z=o.return}}var l=e.current;for(Z=l;Z!==null;){u=Z;var f=u.child;if(u.subtreeFlags&2064&&f!==null)f.return=u,Z=f;else e:for(u=l;Z!==null;){if(i=Z,i.flags&2048)try{switch(i.tag){case 0:case 11:case 15:da(9,i)}}catch(E){we(i,i.return,E)}if(i===u){Z=null;break e}var x=i.sibling;if(x!==null){x.return=i.return,Z=x;break e}Z=i.return}}if(ue=s,Ar(),It&&typeof It.onPostCommitFiberRoot=="function")try{It.onPostCommitFiberRoot(na,e)}catch{}n=!0}return n}finally{de=r,pt.transition=t}}return!1}function Uh(e,t,r){t=Kn(r,t),t=Vm(e,t,1),e=xr(e,t,1),t=He(),e!==null&&(ai(e,1,t),Ye(e,t))}function we(e,t,r){if(e.tag===3)Uh(e,e,r);else for(;t!==null;){if(t.tag===3){Uh(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(wr===null||!wr.has(n))){e=Kn(r,e),e=Km(t,e,1),t=xr(t,e,1),e=He(),t!==null&&(ai(t,1,e),Ye(t,e));break}}t=t.return}}function RS(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=He(),e.pingedLanes|=e.suspendedLanes&r,Ae===e&&(Me&r)===r&&(Te===4||Te===3&&(Me&130023424)===Me&&500>Se()-Mu?Xr(e,0):Du|=r),Ye(e,t)}function hg(e,t){t===0&&(e.mode&1?(t=Li,Li<<=1,!(Li&130023424)&&(Li=4194304)):t=1);var r=He();e=Yt(e,t),e!==null&&(ai(e,t,r),Ye(e,r))}function PS(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),hg(e,r)}function TS(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(J(314))}n!==null&&n.delete(t),hg(e,r)}var fg;fg=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||qe.current)Ge=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Ge=!1,gS(e,t,r);Ge=!!(e.flags&131072)}else Ge=!1,ge&&t.flags&1048576&&vm(t,No,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;co(e,t),e=t.pendingProps;var s=zn(t,Fe.current);On(t,r),s=Ru(null,t,n,e,s,r);var o=Pu();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Xe(n)?(o=!0,Po(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Su(t),s.updater=ua,t.stateNode=s,s._reactInternals=t,pc(t,n,e,r),t=vc(null,t,n,!0,o,r)):(t.tag=0,ge&&o&&mu(t),$e(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(co(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=LS(n),e=wt(n,e),s){case 0:t=gc(null,t,n,e,r);break e;case 1:t=Mh(null,t,n,e,r);break e;case 11:t=Ah(null,t,n,e,r);break e;case 14:t=Dh(null,t,n,wt(n.type,e),r);break e}throw Error(J(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:wt(n,s),gc(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:wt(n,s),Mh(e,t,n,s,r);case 3:e:{if(Ym(t),e===null)throw Error(J(387));n=t.pendingProps,o=t.memoizedState,s=o.element,bm(e,t),Do(t,n,null,r);var u=t.memoizedState;if(n=u.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:u.cache,pendingSuspenseBoundaries:u.pendingSuspenseBoundaries,transitions:u.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=Kn(Error(J(423)),t),t=jh(e,t,n,r,s);break e}else if(n!==s){s=Kn(Error(J(424)),t),t=jh(e,t,n,r,s);break e}else for(rt=yr(t.stateNode.containerInfo.firstChild),nt=t,ge=!0,bt=null,r=wm(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Wn(),n===s){t=Jt(e,t,r);break e}$e(e,t,n,r)}t=t.child}return t;case 5:return Cm(t),e===null&&dc(t),n=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,u=s.children,oc(n,s)?u=null:o!==null&&oc(n,o)&&(t.flags|=32),Xm(e,t),$e(e,t,u,r),t.child;case 6:return e===null&&dc(t),null;case 13:return Jm(e,t,r);case 4:return bu(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Un(t,null,n,r):$e(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:wt(n,s),Ah(e,t,n,s,r);case 7:return $e(e,t,t.pendingProps,r),t.child;case 8:return $e(e,t,t.pendingProps.children,r),t.child;case 12:return $e(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,o=t.memoizedProps,u=s.value,fe(Lo,n._currentValue),n._currentValue=u,o!==null)if(Et(o.value,u)){if(o.children===s.children&&!qe.current){t=Jt(e,t,r);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var i=o.dependencies;if(i!==null){u=o.child;for(var a=i.firstContext;a!==null;){if(a.context===n){if(o.tag===1){a=Gt(-1,r&-r),a.tag=2;var d=o.updateQueue;if(d!==null){d=d.shared;var m=d.pending;m===null?a.next=a:(a.next=m.next,m.next=a),d.pending=a}}o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),hc(o.return,r,t),i.lanes|=r;break}a=a.next}}else if(o.tag===10)u=o.type===t.type?null:o.child;else if(o.tag===18){if(u=o.return,u===null)throw Error(J(341));u.lanes|=r,i=u.alternate,i!==null&&(i.lanes|=r),hc(u,r,t),u=o.sibling}else u=o.child;if(u!==null)u.return=o;else for(u=o;u!==null;){if(u===t){u=null;break}if(o=u.sibling,o!==null){o.return=u.return,u=o;break}u=u.return}o=u}$e(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,On(t,r),s=gt(s),n=n(s),t.flags|=1,$e(e,t,n,r),t.child;case 14:return n=t.type,s=wt(n,t.pendingProps),s=wt(n.type,s),Dh(e,t,n,s,r);case 15:return Gm(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:wt(n,s),co(e,t),t.tag=1,Xe(n)?(e=!0,Po(t)):e=!1,On(t,r),Um(t,n,s),pc(t,n,s,r),vc(null,t,n,!0,e,r);case 19:return Qm(e,t,r);case 22:return qm(e,t,r)}throw Error(J(156,t.tag))};function pg(e,t){return Hp(e,t)}function NS(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ft(e,t,r,n){return new NS(e,t,r,n)}function Bu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function LS(e){if(typeof e=="function")return Bu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===nu)return 11;if(e===su)return 14}return 2}function br(e,t){var r=e.alternate;return r===null?(r=ft(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function fo(e,t,r,n,s,o){var u=2;if(n=e,typeof e=="function")Bu(e)&&(u=1);else if(typeof e=="string")u=5;else e:switch(e){case Sn:return Yr(r.children,s,o,t);case ru:u=8,s|=8;break;case Bl:return e=ft(12,r,t,s|2),e.elementType=Bl,e.lanes=o,e;case Fl:return e=ft(13,r,t,s),e.elementType=Fl,e.lanes=o,e;case $l:return e=ft(19,r,t,s),e.elementType=$l,e.lanes=o,e;case Cp:return fa(r,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Sp:u=10;break e;case bp:u=9;break e;case nu:u=11;break e;case su:u=14;break e;case cr:u=16,n=null;break e}throw Error(J(130,e==null?e:typeof e,""))}return t=ft(u,r,t,s),t.elementType=e,t.type=n,t.lanes=o,t}function Yr(e,t,r,n){return e=ft(7,e,n,t),e.lanes=r,e}function fa(e,t,r,n){return e=ft(22,e,n,t),e.elementType=Cp,e.lanes=r,e.stateNode={isHidden:!1},e}function ml(e,t,r){return e=ft(6,e,null,t),e.lanes=r,e}function gl(e,t,r){return t=ft(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function AS(e,t,r,n,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ya(0),this.expirationTimes=Ya(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ya(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Fu(e,t,r,n,s,o,u,i,a){return e=new AS(e,t,r,i,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=ft(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Su(o),e}function DS(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:wn,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function mg(e){if(!e)return Er;e=e._reactInternals;e:{if(un(e)!==e||e.tag!==1)throw Error(J(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Xe(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(J(171))}if(e.tag===1){var r=e.type;if(Xe(r))return mm(e,r,t)}return t}function gg(e,t,r,n,s,o,u,i,a){return e=Fu(r,n,!0,e,s,o,u,i,a),e.context=mg(null),r=e.current,n=He(),s=Sr(r),o=Gt(n,s),o.callback=t??null,xr(r,o,s),e.current.lanes=s,ai(e,s,n),Ye(e,n),e}function pa(e,t,r,n){var s=t.current,o=He(),u=Sr(s);return r=mg(r),t.context===null?t.context=r:t.pendingContext=r,t=Gt(o,u),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=xr(s,t,u),e!==null&&(kt(e,s,u,o),oo(e,s,u)),u}function Ho(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Vh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function $u(e,t){Vh(e,t),(e=e.alternate)&&Vh(e,t)}function MS(){return null}var vg=typeof reportError=="function"?reportError:function(e){console.error(e)};function Hu(e){this._internalRoot=e}ma.prototype.render=Hu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(J(409));pa(e,t,null,null)};ma.prototype.unmount=Hu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;rn(function(){pa(null,e,null,null)}),t[Xt]=null}};function ma(e){this._internalRoot=e}ma.prototype.unstable_scheduleHydration=function(e){if(e){var t=qp();e={blockedOn:null,target:e,priority:t};for(var r=0;r<dr.length&&t!==0&&t<dr[r].priority;r++);dr.splice(r,0,e),r===0&&Yp(e)}};function zu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ga(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Kh(){}function jS(e,t,r,n,s){if(s){if(typeof n=="function"){var o=n;n=function(){var d=Ho(u);o.call(d)}}var u=gg(t,n,e,0,null,!1,!1,"",Kh);return e._reactRootContainer=u,e[Xt]=u.current,Ks(e.nodeType===8?e.parentNode:e),rn(),u}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var i=n;n=function(){var d=Ho(a);i.call(d)}}var a=Fu(e,0,!1,null,null,!1,!1,"",Kh);return e._reactRootContainer=a,e[Xt]=a.current,Ks(e.nodeType===8?e.parentNode:e),rn(function(){pa(t,a,r,n)}),a}function va(e,t,r,n,s){var o=r._reactRootContainer;if(o){var u=o;if(typeof s=="function"){var i=s;s=function(){var a=Ho(u);i.call(a)}}pa(t,u,e,s)}else u=jS(r,t,e,s,n);return Ho(u)}Kp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Cs(t.pendingLanes);r!==0&&(au(t,r|1),Ye(t,Se()),!(ue&6)&&(Gn=Se()+500,Ar()))}break;case 13:rn(function(){var n=Yt(e,1);if(n!==null){var s=He();kt(n,e,1,s)}}),$u(e,1)}};lu=function(e){if(e.tag===13){var t=Yt(e,134217728);if(t!==null){var r=He();kt(t,e,134217728,r)}$u(e,134217728)}};Gp=function(e){if(e.tag===13){var t=Sr(e),r=Yt(e,t);if(r!==null){var n=He();kt(r,e,t,n)}$u(e,t)}};qp=function(){return de};Xp=function(e,t){var r=de;try{return de=e,t()}finally{de=r}};Yl=function(e,t,r){switch(t){case"input":if(Wl(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=aa(n);if(!s)throw Error(J(90));Ep(n),Wl(n,s)}}}break;case"textarea":Pp(e,r);break;case"select":t=r.value,t!=null&&Dn(e,!!r.multiple,t,!1)}};jp=ju;Ip=rn;var IS={usingClientEntryPoint:!1,Events:[ci,En,aa,Dp,Mp,ju]},_s={findFiberByHostInstance:Kr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},OS={bundleType:_s.bundleType,version:_s.version,rendererPackageName:_s.rendererPackageName,rendererConfig:_s.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:er.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Fp(e),e===null?null:e.stateNode},findFiberByHostInstance:_s.findFiberByHostInstance||MS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var zi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zi.isDisabled&&zi.supportsFiber)try{na=zi.inject(OS),It=zi}catch{}}at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=IS;at.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!zu(t))throw Error(J(200));return DS(e,t,null,r)};at.createRoot=function(e,t){if(!zu(e))throw Error(J(299));var r=!1,n="",s=vg;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Fu(e,1,!1,null,null,r,!1,n,s),e[Xt]=t.current,Ks(e.nodeType===8?e.parentNode:e),new Hu(t)};at.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(J(188)):(e=Object.keys(e).join(","),Error(J(268,e)));return e=Fp(t),e=e===null?null:e.stateNode,e};at.flushSync=function(e){return rn(e)};at.hydrate=function(e,t,r){if(!ga(t))throw Error(J(200));return va(null,e,t,!0,r)};at.hydrateRoot=function(e,t,r){if(!zu(e))throw Error(J(405));var n=r!=null&&r.hydratedSources||null,s=!1,o="",u=vg;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onRecoverableError!==void 0&&(u=r.onRecoverableError)),t=gg(t,null,e,1,r??null,s,!1,o,u),e[Xt]=t.current,Ks(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new ma(t)};at.render=function(e,t,r){if(!ga(t))throw Error(J(200));return va(null,e,t,!1,r)};at.unmountComponentAtNode=function(e){if(!ga(e))throw Error(J(40));return e._reactRootContainer?(rn(function(){va(null,null,e,!1,function(){e._reactRootContainer=null,e[Xt]=null})}),!0):!1};at.unstable_batchedUpdates=ju;at.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!ga(r))throw Error(J(200));if(e==null||e._reactInternals===void 0)throw Error(J(38));return va(e,t,r,!1,n)};at.version="18.3.1-next-f1338f8080-20240426";function _g(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_g)}catch(e){console.error(e)}}_g(),_p.exports=at;var ts=_p.exports;const BS=op(ts);var Gh=ts;Il.createRoot=Gh.createRoot,Il.hydrateRoot=Gh.hydrateRoot;/**
41
+ * @remix-run/router v1.23.2
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */function ti(){return ti=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ti.apply(this,arguments)}var mr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(mr||(mr={}));const qh="popstate";function FS(e){e===void 0&&(e={});function t(n,s){let{pathname:o,search:u,hash:i}=n.location;return Tc("",{pathname:o,search:u,hash:i},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(n,s){return typeof s=="string"?s:yg(s)}return HS(t,r,null,e)}function Ee(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Wu(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function $S(){return Math.random().toString(36).substr(2,8)}function Xh(e,t){return{usr:e.state,key:e.key,idx:t}}function Tc(e,t,r,n){return r===void 0&&(r=null),ti({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?rs(t):t,{state:r,key:t&&t.key||n||$S()})}function yg(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function rs(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function HS(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:o=!1}=n,u=s.history,i=mr.Pop,a=null,d=m();d==null&&(d=0,u.replaceState(ti({},u.state,{idx:d}),""));function m(){return(u.state||{idx:null}).idx}function c(){i=mr.Pop;let p=m(),h=p==null?null:p-d;d=p,a&&a({action:i,location:_.location,delta:h})}function g(p,h){i=mr.Push;let l=Tc(_.location,p,h);d=m()+1;let f=Xh(l,d),x=_.createHref(l);try{u.pushState(f,"",x)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;s.location.assign(x)}o&&a&&a({action:i,location:_.location,delta:1})}function y(p,h){i=mr.Replace;let l=Tc(_.location,p,h);d=m();let f=Xh(l,d),x=_.createHref(l);u.replaceState(f,"",x),o&&a&&a({action:i,location:_.location,delta:0})}function C(p){let h=s.location.origin!=="null"?s.location.origin:s.location.href,l=typeof p=="string"?p:yg(p);return l=l.replace(/ $/,"%20"),Ee(h,"No window.location.(origin|href) available to create URL for href: "+l),new URL(l,h)}let _={get action(){return i},get location(){return e(s,u)},listen(p){if(a)throw new Error("A history only accepts one active listener");return s.addEventListener(qh,c),a=p,()=>{s.removeEventListener(qh,c),a=null}},createHref(p){return t(s,p)},createURL:C,encodeLocation(p){let h=C(p);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:g,replace:y,go(p){return u.go(p)}};return _}var Yh;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Yh||(Yh={}));function zS(e,t,r){return r===void 0&&(r="/"),WS(e,t,r)}function WS(e,t,r,n){let s=typeof t=="string"?rs(t):t,o=Sg(s.pathname||"/",r);if(o==null)return null;let u=xg(e);US(u);let i=null;for(let a=0;i==null&&a<u.length;++a){let d=rb(o);i=ZS(u[a],d)}return i}function xg(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let s=(o,u,i)=>{let a={relativePath:i===void 0?o.path||"":i,caseSensitive:o.caseSensitive===!0,childrenIndex:u,route:o};a.relativePath.startsWith("/")&&(Ee(a.relativePath.startsWith(n),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(n.length));let d=Jr([n,a.relativePath]),m=r.concat(a);o.children&&o.children.length>0&&(Ee(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),xg(o.children,t,m,d)),!(o.path==null&&!o.index)&&t.push({path:d,score:JS(d,o.index),routesMeta:m})};return e.forEach((o,u)=>{var i;if(o.path===""||!((i=o.path)!=null&&i.includes("?")))s(o,u);else for(let a of wg(o.path))s(o,u,a)}),t}function wg(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return s?[o,""]:[o];let u=wg(n.join("/")),i=[];return i.push(...u.map(a=>a===""?o:[o,a].join("/"))),s&&i.push(...u),i.map(a=>e.startsWith("/")&&a===""?"/":a)}function US(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:QS(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const VS=/^:[\w-]+$/,KS=3,GS=2,qS=1,XS=10,YS=-2,Jh=e=>e==="*";function JS(e,t){let r=e.split("/"),n=r.length;return r.some(Jh)&&(n+=YS),t&&(n+=GS),r.filter(s=>!Jh(s)).reduce((s,o)=>s+(VS.test(o)?KS:o===""?qS:XS),n)}function QS(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function ZS(e,t,r){let{routesMeta:n}=e,s={},o="/",u=[];for(let i=0;i<n.length;++i){let a=n[i],d=i===n.length-1,m=o==="/"?t:t.slice(o.length)||"/",c=eb({path:a.relativePath,caseSensitive:a.caseSensitive,end:d},m),g=a.route;if(!c)return null;Object.assign(s,c.params),u.push({params:s,pathname:Jr([o,c.pathname]),pathnameBase:ab(Jr([o,c.pathnameBase])),route:g}),c.pathnameBase!=="/"&&(o=Jr([o,c.pathnameBase]))}return u}function eb(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=tb(e.path,e.caseSensitive,e.end),s=t.match(r);if(!s)return null;let o=s[0],u=o.replace(/(.)\/+$/,"$1"),i=s.slice(1);return{params:n.reduce((d,m,c)=>{let{paramName:g,isOptional:y}=m;if(g==="*"){let _=i[c]||"";u=o.slice(0,o.length-_.length).replace(/(.)\/+$/,"$1")}const C=i[c];return y&&!C?d[g]=void 0:d[g]=(C||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:u,pattern:e}}function tb(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Wu(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 n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,i,a)=>(n.push({paramName:i,isOptional:a!=null}),a?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function rb(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Wu(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Sg(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const nb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sb=e=>nb.test(e);function ib(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?rs(e):e,o;if(r)if(sb(r))o=r;else{if(r.includes("//")){let u=r;r=r.replace(/\/\/+/g,"/"),Wu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(u+" -> "+r))}r.startsWith("/")?o=Qh(r.substring(1),"/"):o=Qh(r,t)}else o=t;return{pathname:o,search:lb(n),hash:cb(s)}}function Qh(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function vl(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function ob(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function bg(e,t){let r=ob(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Cg(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=rs(e):(s=ti({},e),Ee(!s.pathname||!s.pathname.includes("?"),vl("?","pathname","search",s)),Ee(!s.pathname||!s.pathname.includes("#"),vl("#","pathname","hash",s)),Ee(!s.search||!s.search.includes("#"),vl("#","search","hash",s)));let o=e===""||s.pathname==="",u=o?"/":s.pathname,i;if(u==null)i=r;else{let c=t.length-1;if(!n&&u.startsWith("..")){let g=u.split("/");for(;g[0]==="..";)g.shift(),c-=1;s.pathname=g.join("/")}i=c>=0?t[c]:"/"}let a=ib(s,i),d=u&&u!=="/"&&u.endsWith("/"),m=(o||u===".")&&r.endsWith("/");return!a.pathname.endsWith("/")&&(d||m)&&(a.pathname+="/"),a}const Jr=e=>e.join("/").replace(/\/\/+/g,"/"),ab=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),lb=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,cb=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function ub(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const kg=["post","put","patch","delete"];new Set(kg);const db=["get",...kg];new Set(db);/**
50
+ * React Router v6.30.3
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */function ri(){return ri=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ri.apply(this,arguments)}const Uu=S.createContext(null),hb=S.createContext(null),di=S.createContext(null),_a=S.createContext(null),Dr=S.createContext({outlet:null,matches:[],isDataRoute:!1}),Eg=S.createContext(null);function hi(){return S.useContext(_a)!=null}function Vu(){return hi()||Ee(!1),S.useContext(_a).location}function Rg(e){S.useContext(di).static||S.useLayoutEffect(e)}function Ku(){let{isDataRoute:e}=S.useContext(Dr);return e?Eb():fb()}function fb(){hi()||Ee(!1);let e=S.useContext(Uu),{basename:t,future:r,navigator:n}=S.useContext(di),{matches:s}=S.useContext(Dr),{pathname:o}=Vu(),u=JSON.stringify(bg(s,r.v7_relativeSplatPath)),i=S.useRef(!1);return Rg(()=>{i.current=!0}),S.useCallback(function(d,m){if(m===void 0&&(m={}),!i.current)return;if(typeof d=="number"){n.go(d);return}let c=Cg(d,JSON.parse(u),o,m.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Jr([t,c.pathname])),(m.replace?n.replace:n.push)(c,m.state,m)},[t,n,u,o,e])}function pb(){let{matches:e}=S.useContext(Dr),t=e[e.length-1];return t?t.params:{}}function mb(e,t){return gb(e,t)}function gb(e,t,r,n){hi()||Ee(!1);let{navigator:s}=S.useContext(di),{matches:o}=S.useContext(Dr),u=o[o.length-1],i=u?u.params:{};u&&u.pathname;let a=u?u.pathnameBase:"/";u&&u.route;let d=Vu(),m;if(t){var c;let p=typeof t=="string"?rs(t):t;a==="/"||(c=p.pathname)!=null&&c.startsWith(a)||Ee(!1),m=p}else m=d;let g=m.pathname||"/",y=g;if(a!=="/"){let p=a.replace(/^\//,"").split("/");y="/"+g.replace(/^\//,"").split("/").slice(p.length).join("/")}let C=zS(e,{pathname:y}),_=wb(C&&C.map(p=>Object.assign({},p,{params:Object.assign({},i,p.params),pathname:Jr([a,s.encodeLocation?s.encodeLocation(p.pathname).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?a:Jr([a,s.encodeLocation?s.encodeLocation(p.pathnameBase).pathname:p.pathnameBase])})),o,r,n);return t&&_?S.createElement(_a.Provider,{value:{location:ri({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:mr.Pop}},_):_}function vb(){let e=kb(),t=ub(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),r?S.createElement("pre",{style:s},r):null,null)}const _b=S.createElement(vb,null);class yb extends S.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?S.createElement(Dr.Provider,{value:this.props.routeContext},S.createElement(Eg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function xb(e){let{routeContext:t,match:r,children:n}=e,s=S.useContext(Uu);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),S.createElement(Dr.Provider,{value:t},n)}function wb(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var o;if(!r)return null;if(r.errors)e=r.matches;else if((o=n)!=null&&o.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let u=e,i=(s=r)==null?void 0:s.errors;if(i!=null){let m=u.findIndex(c=>c.route.id&&(i==null?void 0:i[c.route.id])!==void 0);m>=0||Ee(!1),u=u.slice(0,Math.min(u.length,m+1))}let a=!1,d=-1;if(r&&n&&n.v7_partialHydration)for(let m=0;m<u.length;m++){let c=u[m];if((c.route.HydrateFallback||c.route.hydrateFallbackElement)&&(d=m),c.route.id){let{loaderData:g,errors:y}=r,C=c.route.loader&&g[c.route.id]===void 0&&(!y||y[c.route.id]===void 0);if(c.route.lazy||C){a=!0,d>=0?u=u.slice(0,d+1):u=[u[0]];break}}}return u.reduceRight((m,c,g)=>{let y,C=!1,_=null,p=null;r&&(y=i&&c.route.id?i[c.route.id]:void 0,_=c.route.errorElement||_b,a&&(d<0&&g===0?(Rb("route-fallback"),C=!0,p=null):d===g&&(C=!0,p=c.route.hydrateFallbackElement||null)));let h=t.concat(u.slice(0,g+1)),l=()=>{let f;return y?f=_:C?f=p:c.route.Component?f=S.createElement(c.route.Component,null):c.route.element?f=c.route.element:f=m,S.createElement(xb,{match:c,routeContext:{outlet:m,matches:h,isDataRoute:r!=null},children:f})};return r&&(c.route.ErrorBoundary||c.route.errorElement||g===0)?S.createElement(yb,{location:r.location,revalidation:r.revalidation,component:_,error:y,children:l(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):l()},null)}var Pg=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Pg||{}),Tg=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Tg||{});function Sb(e){let t=S.useContext(Uu);return t||Ee(!1),t}function bb(e){let t=S.useContext(hb);return t||Ee(!1),t}function Cb(e){let t=S.useContext(Dr);return t||Ee(!1),t}function Ng(e){let t=Cb(),r=t.matches[t.matches.length-1];return r.route.id||Ee(!1),r.route.id}function kb(){var e;let t=S.useContext(Eg),r=bb(),n=Ng();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function Eb(){let{router:e}=Sb(Pg.UseNavigateStable),t=Ng(Tg.UseNavigateStable),r=S.useRef(!1);return Rg(()=>{r.current=!0}),S.useCallback(function(s,o){o===void 0&&(o={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,ri({fromRouteId:t},o)))},[e,t])}const Zh={};function Rb(e,t,r){Zh[e]||(Zh[e]=!0)}function Pb(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function _l(e){let{to:t,replace:r,state:n,relative:s}=e;hi()||Ee(!1);let{future:o,static:u}=S.useContext(di),{matches:i}=S.useContext(Dr),{pathname:a}=Vu(),d=Ku(),m=Cg(t,bg(i,o.v7_relativeSplatPath),a,s==="path"),c=JSON.stringify(m);return S.useEffect(()=>d(JSON.parse(c),{replace:r,state:n,relative:s}),[d,c,s,r,n]),null}function Vr(e){Ee(!1)}function Tb(e){let{basename:t="/",children:r=null,location:n,navigationType:s=mr.Pop,navigator:o,static:u=!1,future:i}=e;hi()&&Ee(!1);let a=t.replace(/^\/*/,"/"),d=S.useMemo(()=>({basename:a,navigator:o,static:u,future:ri({v7_relativeSplatPath:!1},i)}),[a,i,o,u]);typeof n=="string"&&(n=rs(n));let{pathname:m="/",search:c="",hash:g="",state:y=null,key:C="default"}=n,_=S.useMemo(()=>{let p=Sg(m,a);return p==null?null:{location:{pathname:p,search:c,hash:g,state:y,key:C},navigationType:s}},[a,m,c,g,y,C,s]);return _==null?null:S.createElement(di.Provider,{value:d},S.createElement(_a.Provider,{children:r,value:_}))}function ef(e){let{children:t,location:r}=e;return mb(Nc(t),r)}new Promise(()=>{});function Nc(e,t){t===void 0&&(t=[]);let r=[];return S.Children.forEach(e,(n,s)=>{if(!S.isValidElement(n))return;let o=[...t,s];if(n.type===S.Fragment){r.push.apply(r,Nc(n.props.children,o));return}n.type!==Vr&&Ee(!1),!n.props.index||!n.props.children||Ee(!1);let u={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(u.children=Nc(n.props.children,o)),r.push(u)}),r}/**
59
+ * React Router DOM v6.30.3
60
+ *
61
+ * Copyright (c) Remix Software Inc.
62
+ *
63
+ * This source code is licensed under the MIT license found in the
64
+ * LICENSE.md file in the root directory of this source tree.
65
+ *
66
+ * @license MIT
67
+ */const Nb="6";try{window.__reactRouterVersion=Nb}catch{}const Lb="startTransition",tf=ra[Lb];function Ab(e){let{basename:t,children:r,future:n,window:s}=e,o=S.useRef();o.current==null&&(o.current=FS({window:s,v5Compat:!0}));let u=o.current,[i,a]=S.useState({action:u.action,location:u.location}),{v7_startTransition:d}=n||{},m=S.useCallback(c=>{d&&tf?tf(()=>a(c)):a(c)},[a,d]);return S.useLayoutEffect(()=>u.listen(m),[u,m]),S.useEffect(()=>Pb(n),[n]),S.createElement(Tb,{basename:t,children:r,location:i.location,navigationType:i.action,navigator:u,future:n})}var rf;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(rf||(rf={}));var nf;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(nf||(nf={}));const Gu=S.createContext({theme:"system",resolvedTheme:"light",setTheme:()=>{}});function Db(){return S.useContext(Gu)}function Mb(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function sf(e){return e==="system"?Mb():e}function jb({children:e}){const[t,r]=S.useState(()=>localStorage.getItem("launchpod-theme")||"system"),[n,s]=S.useState(()=>sf(localStorage.getItem("launchpod-theme")||"system")),o=S.useCallback(i=>{const a=sf(i);s(a),document.documentElement.classList.toggle("dark",a==="dark")},[]),u=S.useCallback(i=>{r(i),localStorage.setItem("launchpod-theme",i),o(i)},[o]);return S.useEffect(()=>{o(t);const i=window.matchMedia("(prefers-color-scheme: dark)"),a=()=>{t==="system"&&o("system")};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)},[t,o]),v.jsx(Gu.Provider,{value:{theme:t,resolvedTheme:n,setTheme:u},children:e})}function Lg(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Lg(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Ag(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Lg(e))&&(n&&(n+=" "),n+=t);return n}const Ib=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},Ob=(e,t)=>({classGroupId:e,validator:t}),Dg=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),zo="-",of=[],Bb="arbitrary..",Fb=e=>{const t=Hb(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return $b(u);const i=u.split(zo),a=i[0]===""&&i.length>1?1:0;return Mg(i,a,t)},getConflictingClassGroupIds:(u,i)=>{if(i){const a=n[u],d=r[u];return a?d?Ib(d,a):a:d||of}return r[u]||of}}},Mg=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const s=e[t],o=r.nextPart.get(s);if(o){const d=Mg(e,t+1,o);if(d)return d}const u=r.validators;if(u===null)return;const i=t===0?e.join(zo):e.slice(t).join(zo),a=u.length;for(let d=0;d<a;d++){const m=u[d];if(m.validator(i))return m.classGroupId}},$b=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?Bb+n:void 0})(),Hb=e=>{const{theme:t,classGroups:r}=e;return zb(r,t)},zb=(e,t)=>{const r=Dg();for(const n in e){const s=e[n];qu(s,r,n,t)}return r},qu=(e,t,r,n)=>{const s=e.length;for(let o=0;o<s;o++){const u=e[o];Wb(u,t,r,n)}},Wb=(e,t,r,n)=>{if(typeof e=="string"){Ub(e,t,r);return}if(typeof e=="function"){Vb(e,t,r,n);return}Kb(e,t,r,n)},Ub=(e,t,r)=>{const n=e===""?t:jg(t,e);n.classGroupId=r},Vb=(e,t,r,n)=>{if(Gb(e)){qu(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Ob(r,e))},Kb=(e,t,r,n)=>{const s=Object.entries(e),o=s.length;for(let u=0;u<o;u++){const[i,a]=s[u];qu(a,jg(t,i),r,n)}},jg=(e,t)=>{let r=e;const n=t.split(zo),s=n.length;for(let o=0;o<s;o++){const u=n[o];let i=r.nextPart.get(u);i||(i=Dg(),r.nextPart.set(u,i)),r=i}return r},Gb=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,qb=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const s=(o,u)=>{r[o]=u,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(o){let u=r[o];if(u!==void 0)return u;if((u=n[o])!==void 0)return s(o,u),u},set(o,u){o in r?r[o]=u:s(o,u)}}},Lc="!",af=":",Xb=[],lf=(e,t,r,n,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:s}),Yb=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=s=>{const o=[];let u=0,i=0,a=0,d;const m=s.length;for(let _=0;_<m;_++){const p=s[_];if(u===0&&i===0){if(p===af){o.push(s.slice(a,_)),a=_+1;continue}if(p==="/"){d=_;continue}}p==="["?u++:p==="]"?u--:p==="("?i++:p===")"&&i--}const c=o.length===0?s:s.slice(a);let g=c,y=!1;c.endsWith(Lc)?(g=c.slice(0,-1),y=!0):c.startsWith(Lc)&&(g=c.slice(1),y=!0);const C=d&&d>a?d-a:void 0;return lf(o,y,g,C)};if(t){const s=t+af,o=n;n=u=>u.startsWith(s)?o(u.slice(s.length)):lf(Xb,!1,u,void 0,!0)}if(r){const s=n;n=o=>r({className:o,parseClassName:s})}return n},Jb=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let s=[];for(let o=0;o<r.length;o++){const u=r[o],i=u[0]==="[",a=t.has(u);i||a?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(u)):s.push(u)}return s.length>0&&(s.sort(),n.push(...s)),n}},Qb=e=>({cache:qb(e.cacheSize),parseClassName:Yb(e),sortModifiers:Jb(e),...Fb(e)}),Zb=/\s+/,e1=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:o}=t,u=[],i=e.trim().split(Zb);let a="";for(let d=i.length-1;d>=0;d-=1){const m=i[d],{isExternal:c,modifiers:g,hasImportantModifier:y,baseClassName:C,maybePostfixModifierPosition:_}=r(m);if(c){a=m+(a.length>0?" "+a:a);continue}let p=!!_,h=n(p?C.substring(0,_):C);if(!h){if(!p){a=m+(a.length>0?" "+a:a);continue}if(h=n(C),!h){a=m+(a.length>0?" "+a:a);continue}p=!1}const l=g.length===0?"":g.length===1?g[0]:o(g).join(":"),f=y?l+Lc:l,x=f+h;if(u.indexOf(x)>-1)continue;u.push(x);const E=s(h,p);for(let k=0;k<E.length;++k){const b=E[k];u.push(f+b)}a=m+(a.length>0?" "+a:a)}return a},t1=(...e)=>{let t=0,r,n,s="";for(;t<e.length;)(r=e[t++])&&(n=Ig(r))&&(s&&(s+=" "),s+=n);return s},Ig=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ig(e[n]))&&(r&&(r+=" "),r+=t);return r},r1=(e,...t)=>{let r,n,s,o;const u=a=>{const d=t.reduce((m,c)=>c(m),e());return r=Qb(d),n=r.cache.get,s=r.cache.set,o=i,i(a)},i=a=>{const d=n(a);if(d)return d;const m=e1(a,r);return s(a,m),m};return o=u,(...a)=>o(t1(...a))},n1=[],Re=e=>{const t=r=>r[e]||n1;return t.isThemeGetter=!0,t},Og=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Bg=/^\((?:(\w[\w-]*):)?(.+)\)$/i,s1=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,i1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,o1=/\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$/,a1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,l1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,c1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,or=e=>s1.test(e),ae=e=>!!e&&!Number.isNaN(Number(e)),ar=e=>!!e&&Number.isInteger(Number(e)),yl=e=>e.endsWith("%")&&ae(e.slice(0,-1)),zt=e=>i1.test(e),Fg=()=>!0,u1=e=>o1.test(e)&&!a1.test(e),Xu=()=>!1,d1=e=>l1.test(e),h1=e=>c1.test(e),f1=e=>!ee(e)&&!te(e),p1=e=>Mr(e,zg,Xu),ee=e=>Og.test(e),$r=e=>Mr(e,Wg,u1),cf=e=>Mr(e,S1,ae),m1=e=>Mr(e,Vg,Fg),g1=e=>Mr(e,Ug,Xu),uf=e=>Mr(e,$g,Xu),v1=e=>Mr(e,Hg,h1),Wi=e=>Mr(e,Kg,d1),te=e=>Bg.test(e),ys=e=>dn(e,Wg),_1=e=>dn(e,Ug),df=e=>dn(e,$g),y1=e=>dn(e,zg),x1=e=>dn(e,Hg),Ui=e=>dn(e,Kg,!0),w1=e=>dn(e,Vg,!0),Mr=(e,t,r)=>{const n=Og.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},dn=(e,t,r=!1)=>{const n=Bg.exec(e);return n?n[1]?t(n[1]):r:!1},$g=e=>e==="position"||e==="percentage",Hg=e=>e==="image"||e==="url",zg=e=>e==="length"||e==="size"||e==="bg-size",Wg=e=>e==="length",S1=e=>e==="number",Ug=e=>e==="family-name",Vg=e=>e==="number"||e==="weight",Kg=e=>e==="shadow",b1=()=>{const e=Re("color"),t=Re("font"),r=Re("text"),n=Re("font-weight"),s=Re("tracking"),o=Re("leading"),u=Re("breakpoint"),i=Re("container"),a=Re("spacing"),d=Re("radius"),m=Re("shadow"),c=Re("inset-shadow"),g=Re("text-shadow"),y=Re("drop-shadow"),C=Re("blur"),_=Re("perspective"),p=Re("aspect"),h=Re("ease"),l=Re("animate"),f=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...x(),te,ee],k=()=>["auto","hidden","clip","visible","scroll"],b=()=>["auto","contain","none"],w=()=>[te,ee,a],R=()=>[or,"full","auto",...w()],T=()=>[ar,"none","subgrid",te,ee],M=()=>["auto",{span:["full",ar,te,ee]},ar,te,ee],O=()=>[ar,"auto",te,ee],A=()=>["auto","min","max","fr",te,ee],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...w()],K=()=>[or,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],B=()=>[or,"screen","full","dvw","lvw","svw","min","max","fit",...w()],P=()=>[or,"screen","full","lh","dvh","lvh","svh","min","max","fit",...w()],N=()=>[e,te,ee],j=()=>[...x(),df,uf,{position:[te,ee]}],D=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",y1,p1,{size:[te,ee]}],$=()=>[yl,ys,$r],V=()=>["","none","full",d,te,ee],q=()=>["",ae,ys,$r],I=()=>["solid","dashed","dotted","double"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],z=()=>[ae,yl,df,uf],H=()=>["","none",C,te,ee],Y=()=>["none",ae,te,ee],X=()=>["none",ae,te,ee],ne=()=>[ae,te,ee],oe=()=>[or,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[zt],breakpoint:[zt],color:[Fg],container:[zt],"drop-shadow":[zt],ease:["in","out","in-out"],font:[f1],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[zt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[zt],shadow:[zt],spacing:["px",ae],text:[zt],"text-shadow":[zt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",or,ee,te,p]}],container:["container"],columns:[{columns:[ae,ee,te,i]}],"break-after":[{"break-after":f()}],"break-before":[{"break-before":f()}],"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:E()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:b()}],"overscroll-x":[{"overscroll-x":b()}],"overscroll-y":[{"overscroll-y":b()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:R()}],"inset-x":[{"inset-x":R()}],"inset-y":[{"inset-y":R()}],start:[{"inset-s":R(),start:R()}],end:[{"inset-e":R(),end:R()}],"inset-bs":[{"inset-bs":R()}],"inset-be":[{"inset-be":R()}],top:[{top:R()}],right:[{right:R()}],bottom:[{bottom:R()}],left:[{left:R()}],visibility:["visible","invisible","collapse"],z:[{z:[ar,"auto",te,ee]}],basis:[{basis:[or,"full","auto",i,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ae,or,"auto","initial","none",ee]}],grow:[{grow:["",ae,te,ee]}],shrink:[{shrink:["",ae,te,ee]}],order:[{order:[ar,"first","last","none",te,ee]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":A()}],"auto-rows":[{"auto-rows":A()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mbs:[{mbs:G()}],mbe:[{mbe:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],"inline-size":[{inline:["auto",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...P()]}],"min-block-size":[{"min-block":["auto",...P()]}],"max-block-size":[{"max-block":["none",...P()]}],w:[{w:[i,"screen",...K()]}],"min-w":[{"min-w":[i,"screen","none",...K()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[u]},...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",r,ys,$r]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,w1,m1]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yl,ee]}],"font-family":[{font:[_1,g1,t]}],"font-features":[{"font-features":[ee]}],"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:[s,te,ee]}],"line-clamp":[{"line-clamp":[ae,"none",te,cf]}],leading:[{leading:[o,...w()]}],"list-image":[{"list-image":["none",te,ee]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",te,ee]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:[ae,"from-font","auto",te,$r]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[ae,"auto",te,ee]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te,ee]}],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,ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:D()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ar,te,ee],radial:["",te,ee],conic:[ar,te,ee]},x1,v1]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:V()}],"rounded-s":[{"rounded-s":V()}],"rounded-e":[{"rounded-e":V()}],"rounded-t":[{"rounded-t":V()}],"rounded-r":[{"rounded-r":V()}],"rounded-b":[{"rounded-b":V()}],"rounded-l":[{"rounded-l":V()}],"rounded-ss":[{"rounded-ss":V()}],"rounded-se":[{"rounded-se":V()}],"rounded-ee":[{"rounded-ee":V()}],"rounded-es":[{"rounded-es":V()}],"rounded-tl":[{"rounded-tl":V()}],"rounded-tr":[{"rounded-tr":V()}],"rounded-br":[{"rounded-br":V()}],"rounded-bl":[{"rounded-bl":V()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-bs":[{"border-bs":q()}],"border-w-be":[{"border-be":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...I(),"hidden","none"]}],"divide-style":[{divide:[...I(),"hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...I(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ae,te,ee]}],"outline-w":[{outline:["",ae,ys,$r]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",m,Ui,Wi]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",c,Ui,Wi]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[ae,$r]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",g,Ui,Wi]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[ae,te,ee]}],"mix-blend":[{"mix-blend":[...L(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":L()}],"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":[ae]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[te,ee]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"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":x()}],"mask-image-conic-pos":[{"mask-conic":[ae]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:D()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",te,ee]}],filter:[{filter:["","none",te,ee]}],blur:[{blur:H()}],brightness:[{brightness:[ae,te,ee]}],contrast:[{contrast:[ae,te,ee]}],"drop-shadow":[{"drop-shadow":["","none",y,Ui,Wi]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",ae,te,ee]}],"hue-rotate":[{"hue-rotate":[ae,te,ee]}],invert:[{invert:["",ae,te,ee]}],saturate:[{saturate:[ae,te,ee]}],sepia:[{sepia:["",ae,te,ee]}],"backdrop-filter":[{"backdrop-filter":["","none",te,ee]}],"backdrop-blur":[{"backdrop-blur":H()}],"backdrop-brightness":[{"backdrop-brightness":[ae,te,ee]}],"backdrop-contrast":[{"backdrop-contrast":[ae,te,ee]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ae,te,ee]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ae,te,ee]}],"backdrop-invert":[{"backdrop-invert":["",ae,te,ee]}],"backdrop-opacity":[{"backdrop-opacity":[ae,te,ee]}],"backdrop-saturate":[{"backdrop-saturate":[ae,te,ee]}],"backdrop-sepia":[{"backdrop-sepia":["",ae,te,ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",te,ee]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ae,"initial",te,ee]}],ease:[{ease:["linear","initial",h,te,ee]}],delay:[{delay:[ae,te,ee]}],animate:[{animate:["none",l,te,ee]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,te,ee]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[te,ee,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"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,ee]}],"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":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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,ee]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[ae,ys,$r,cf]}],stroke:[{stroke:["none",...N()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]}},C1=r1(b1);function re(...e){return C1(Ag(e))}function Gg(e,t=[]){let r=[];function n(o,u){const i=S.createContext(u);i.displayName=o+"Context";const a=r.length;r=[...r,u];const d=c=>{var h;const{scope:g,children:y,...C}=c,_=((h=g==null?void 0:g[e])==null?void 0:h[a])||i,p=S.useMemo(()=>C,Object.values(C));return v.jsx(_.Provider,{value:p,children:y})};d.displayName=o+"Provider";function m(c,g){var _;const y=((_=g==null?void 0:g[e])==null?void 0:_[a])||i,C=S.useContext(y);if(C)return C;if(u!==void 0)return u;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[d,m]}const s=()=>{const o=r.map(u=>S.createContext(u));return function(i){const a=(i==null?void 0:i[e])||o;return S.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,k1(s,...t)]}function k1(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const u=n.reduce((i,{useScope:a,scopeName:d})=>{const c=a(o)[`__scope${d}`];return{...i,...c}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}function Ft(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}var Ne=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{};function hf(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function $t(...e){return t=>{let r=!1;const n=e.map(s=>{const o=hf(s,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():hf(e[s],null)}}}}function ce(...e){return S.useCallback($t(...e),e)}var E1=Symbol.for("react.lazy"),Wo=ra[" use ".trim().toString()];function R1(e){return typeof e=="object"&&e!==null&&"then"in e}function qg(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===E1&&"_payload"in e&&R1(e._payload)}function Xg(e){const t=P1(e),r=S.forwardRef((n,s)=>{let{children:o,...u}=n;qg(o)&&typeof Wo=="function"&&(o=Wo(o._payload));const i=S.Children.toArray(o),a=i.find(N1);if(a){const d=a.props.children,m=i.map(c=>c===a?S.Children.count(d)>1?S.Children.only(null):S.isValidElement(d)?d.props.children:null:c);return v.jsx(t,{...u,ref:s,children:S.isValidElement(d)?S.cloneElement(d,void 0,m):null})}return v.jsx(t,{...u,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}var Yg=Xg("Slot");function P1(e){const t=S.forwardRef((r,n)=>{let{children:s,...o}=r;if(qg(s)&&typeof Wo=="function"&&(s=Wo(s._payload)),S.isValidElement(s)){const u=A1(s),i=L1(o,s.props);return s.type!==S.Fragment&&(i.ref=n?$t(n,u):u),S.cloneElement(s,i)}return S.Children.count(s)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var T1=Symbol("radix.slottable");function N1(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===T1}function L1(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function A1(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var D1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ue=D1.reduce((e,t)=>{const r=Xg(`Primitive.${t}`),n=S.forwardRef((s,o)=>{const{asChild:u,...i}=s,a=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Jg={exports:{}},Qg={};/**
68
+ * @license React
69
+ * use-sync-external-store-shim.production.js
70
+ *
71
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
72
+ *
73
+ * This source code is licensed under the MIT license found in the
74
+ * LICENSE file in the root directory of this source tree.
75
+ */var qn=S;function M1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var j1=typeof Object.is=="function"?Object.is:M1,I1=qn.useState,O1=qn.useEffect,B1=qn.useLayoutEffect,F1=qn.useDebugValue;function $1(e,t){var r=t(),n=I1({inst:{value:r,getSnapshot:t}}),s=n[0].inst,o=n[1];return B1(function(){s.value=r,s.getSnapshot=t,xl(s)&&o({inst:s})},[e,r,t]),O1(function(){return xl(s)&&o({inst:s}),e(function(){xl(s)&&o({inst:s})})},[e]),F1(r),r}function xl(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!j1(e,r)}catch{return!0}}function H1(e,t){return t()}var z1=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?H1:$1;Qg.useSyncExternalStore=qn.useSyncExternalStore!==void 0?qn.useSyncExternalStore:z1;Jg.exports=Qg;var W1=Jg.exports;function U1(){return W1.useSyncExternalStore(V1,()=>!0,()=>!1)}function V1(){return()=>{}}var Yu="Avatar",[K1]=Gg(Yu),[G1,Zg]=K1(Yu),ev=S.forwardRef((e,t)=>{const{__scopeAvatar:r,...n}=e,[s,o]=S.useState("idle");return v.jsx(G1,{scope:r,imageLoadingStatus:s,onImageLoadingStatusChange:o,children:v.jsx(Ue.span,{...n,ref:t})})});ev.displayName=Yu;var tv="AvatarImage",rv=S.forwardRef((e,t)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:s=()=>{},...o}=e,u=Zg(tv,r),i=q1(n,o),a=Ft(d=>{s(d),u.onImageLoadingStatusChange(d)});return Ne(()=>{i!=="idle"&&a(i)},[i,a]),i==="loaded"?v.jsx(Ue.img,{...o,ref:t,src:n}):null});rv.displayName=tv;var nv="AvatarFallback",sv=S.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...s}=e,o=Zg(nv,r),[u,i]=S.useState(n===void 0);return S.useEffect(()=>{if(n!==void 0){const a=window.setTimeout(()=>i(!0),n);return()=>window.clearTimeout(a)}},[n]),u&&o.imageLoadingStatus!=="loaded"?v.jsx(Ue.span,{...s,ref:t}):null});sv.displayName=nv;function ff(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function q1(e,{referrerPolicy:t,crossOrigin:r}){const n=U1(),s=S.useRef(null),o=n?(s.current||(s.current=new window.Image),s.current):null,[u,i]=S.useState(()=>ff(o,e));return Ne(()=>{i(ff(o,e))},[o,e]),Ne(()=>{const a=c=>()=>{i(c)};if(!o)return;const d=a("loaded"),m=a("error");return o.addEventListener("load",d),o.addEventListener("error",m),t&&(o.referrerPolicy=t),typeof r=="string"&&(o.crossOrigin=r),()=>{o.removeEventListener("load",d),o.removeEventListener("error",m)}},[o,r,t]),u}var iv=ev,ov=rv,av=sv;const X1=S.forwardRef(({className:e,...t},r)=>v.jsx(iv,{ref:r,className:re("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));X1.displayName=iv.displayName;const Y1=S.forwardRef(({className:e,...t},r)=>v.jsx(ov,{ref:r,className:re("aspect-square h-full w-full",e),...t}));Y1.displayName=ov.displayName;const J1=S.forwardRef(({className:e,...t},r)=>v.jsx(av,{ref:r,className:re("flex h-full w-full items-center justify-center rounded-full bg-primary/10 text-primary font-medium",e),...t}));J1.displayName=av.displayName;const pf=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,mf=Ag,Ju=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return mf(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=t,u=Object.keys(s).map(d=>{const m=r==null?void 0:r[d],c=o==null?void 0:o[d];if(m===null)return null;const g=pf(m)||pf(c);return s[d][g]}),i=r&&Object.entries(r).reduce((d,m)=>{let[c,g]=m;return g===void 0||(d[c]=g),d},{}),a=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((d,m)=>{let{class:c,className:g,...y}=m;return Object.entries(y).every(C=>{let[_,p]=C;return Array.isArray(p)?p.includes({...o,...i}[_]):{...o,...i}[_]===p})?[...d,c,g]:d},[]);return mf(e,u,a,r==null?void 0:r.class,r==null?void 0:r.className)};/**
76
+ * @license lucide-react v0.576.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const lv=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
81
+ * @license lucide-react v0.576.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const Q1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
86
+ * @license lucide-react v0.576.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const Z1=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase());/**
91
+ * @license lucide-react v0.576.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const gf=e=>{const t=Z1(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
96
+ * @license lucide-react v0.576.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */var eC={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"};/**
101
+ * @license lucide-react v0.576.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const tC=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
106
+ * @license lucide-react v0.576.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const rC=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:u,...i},a)=>S.createElement("svg",{ref:a,...eC,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:lv("lucide",s),...!o&&!tC(i)&&{"aria-hidden":"true"},...i},[...u.map(([d,m])=>S.createElement(d,m)),...Array.isArray(o)?o:[o]]));/**
111
+ * @license lucide-react v0.576.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const be=(e,t)=>{const r=S.forwardRef(({className:n,...s},o)=>S.createElement(rC,{ref:o,iconNode:t,className:lv(`lucide-${Q1(gf(e))}`,`lucide-${e}`,n),...s}));return r.displayName=gf(e),r};/**
116
+ * @license lucide-react v0.576.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const nC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Qu=be("check",nC);/**
121
+ * @license lucide-react v0.576.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const sC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Zu=be("chevron-down",sC);/**
126
+ * @license lucide-react v0.576.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const iC=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],cv=be("chevron-right",iC);/**
131
+ * @license lucide-react v0.576.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const oC=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],aC=be("chevron-up",oC);/**
136
+ * @license lucide-react v0.576.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const lC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],cC=be("circle",lC);/**
141
+ * @license lucide-react v0.576.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const uC=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],dC=be("layout-dashboard",uC);/**
146
+ * @license lucide-react v0.576.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const hC=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],fC=be("loader-circle",hC);/**
151
+ * @license lucide-react v0.576.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const pC=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],mC=be("log-out",pC);/**
156
+ * @license lucide-react v0.576.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const gC=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],vC=be("moon",gC);/**
161
+ * @license lucide-react v0.576.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const _C=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],yC=be("pause",_C);/**
166
+ * @license lucide-react v0.576.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const xC=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],wC=be("play",xC);/**
171
+ * @license lucide-react v0.576.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const SC=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],bC=be("refresh-cw",SC);/**
176
+ * @license lucide-react v0.576.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const CC=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],kC=be("rotate-ccw",CC);/**
181
+ * @license lucide-react v0.576.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const EC=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],RC=be("search",EC);/**
186
+ * @license lucide-react v0.576.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const PC=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],TC=be("settings",PC);/**
191
+ * @license lucide-react v0.576.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const NC=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],LC=be("sun",NC);/**
196
+ * @license lucide-react v0.576.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const AC=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],DC=be("terminal",AC);/**
201
+ * @license lucide-react v0.576.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const MC=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],jC=be("trash-2",MC);/**
206
+ * @license lucide-react v0.576.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const IC=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],OC=be("wrench",IC);/**
211
+ * @license lucide-react v0.576.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const BC=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],uv=be("x",BC);/**
216
+ * @license lucide-react v0.576.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const FC=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],$C=be("zap",FC),HC=S.forwardRef(({...e},t)=>v.jsx("nav",{ref:t,"aria-label":"breadcrumb",...e}));HC.displayName="Breadcrumb";const zC=S.forwardRef(({className:e,...t},r)=>v.jsx("ol",{ref:r,className:re("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...t}));zC.displayName="BreadcrumbList";const WC=S.forwardRef(({className:e,...t},r)=>v.jsx("li",{ref:r,className:re("inline-flex items-center gap-1.5",e),...t}));WC.displayName="BreadcrumbItem";const UC=S.forwardRef(({asChild:e,className:t,...r},n)=>{const s=e?Yg:"a";return v.jsx(s,{ref:n,className:re("transition-colors hover:text-foreground",t),...r})});UC.displayName="BreadcrumbLink";const VC=S.forwardRef(({className:e,...t},r)=>v.jsx("span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:re("font-normal text-foreground",e),...t}));VC.displayName="BreadcrumbPage";const KC=Ju("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"}}),dv=S.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const u=n?Yg:"button";return v.jsx(u,{className:re(KC({variant:t,size:r,className:e})),ref:o,...s})});dv.displayName="Button";const GC=S.forwardRef(({className:e,onClick:t,...r},n)=>{const s=S.useRef(null),[o,u]=S.useState(!1);return S.useEffect(()=>{var d;const i=s.current;if(!i)return;const a=!!t||((d=i.parentElement)==null?void 0:d.tagName)==="A"||!!i.querySelector(":scope > a");u(a)},[t]),v.jsx("div",{ref:i=>{s.current=i,typeof n=="function"?n(i):n&&(n.current=i)},className:re("ls-card rounded-xl bg-card text-card-foreground",o&&"interactive",e),onClick:t,...r})});GC.displayName="Card";const qC=S.forwardRef(({className:e,...t},r)=>v.jsx("div",{ref:r,className:re("flex flex-col space-y-1.5 p-6",e),...t}));qC.displayName="CardHeader";const XC=S.forwardRef(({className:e,...t},r)=>v.jsx("div",{ref:r,className:re("font-semibold leading-none tracking-tight",e),...t}));XC.displayName="CardTitle";const YC=S.forwardRef(({className:e,...t},r)=>v.jsx("div",{ref:r,className:re("text-sm text-muted-foreground",e),...t}));YC.displayName="CardDescription";const JC=S.forwardRef(({className:e,...t},r)=>v.jsx("div",{ref:r,className:re("p-6 pt-0",e),...t}));JC.displayName="CardContent";const QC=S.forwardRef(({className:e,...t},r)=>v.jsx("div",{ref:r,className:re("flex items-center p-6 pt-0",e),...t}));QC.displayName="CardFooter";function ZC(e,t){const r=S.createContext(t),n=o=>{const{children:u,...i}=o,a=S.useMemo(()=>i,Object.values(i));return v.jsx(r.Provider,{value:a,children:u})};n.displayName=e+"Provider";function s(o){const u=S.useContext(r);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[n,s]}function _t(e,t=[]){let r=[];function n(o,u){const i=S.createContext(u),a=r.length;r=[...r,u];const d=c=>{var h;const{scope:g,children:y,...C}=c,_=((h=g==null?void 0:g[e])==null?void 0:h[a])||i,p=S.useMemo(()=>C,Object.values(C));return v.jsx(_.Provider,{value:p,children:y})};d.displayName=o+"Provider";function m(c,g){var _;const y=((_=g==null?void 0:g[e])==null?void 0:_[a])||i,C=S.useContext(y);if(C)return C;if(u!==void 0)return u;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[d,m]}const s=()=>{const o=r.map(u=>S.createContext(u));return function(i){const a=(i==null?void 0:i[e])||o;return S.useMemo(()=>({[`__scope${e}`]:{...i,[e]:a}}),[i,a])}};return s.scopeName=e,[n,ek(s,...t)]}function ek(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const u=n.reduce((i,{useScope:a,scopeName:d})=>{const c=a(o)[`__scope${d}`];return{...i,...c}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}function Q(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}var tk=ra[" useInsertionEffect ".trim().toString()]||Ne;function fi({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,o,u]=rk({defaultProp:t,onChange:r}),i=e!==void 0,a=i?e:s;{const m=S.useRef(e!==void 0);S.useEffect(()=>{const c=m.current;c!==i&&console.warn(`${n} is changing from ${c?"controlled":"uncontrolled"} to ${i?"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.`),m.current=i},[i,n])}const d=S.useCallback(m=>{var c;if(i){const g=nk(m)?m(e):m;g!==e&&((c=u.current)==null||c.call(u,g))}else o(m)},[i,e,o,u]);return[a,d]}function rk({defaultProp:e,onChange:t}){const[r,n]=S.useState(e),s=S.useRef(r),o=S.useRef(t);return tk(()=>{o.current=t},[t]),S.useEffect(()=>{var u;s.current!==r&&((u=o.current)==null||u.call(o,r),s.current=r)},[r,s]),[r,n,o]}function nk(e){return typeof e=="function"}function ed(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function td(e){const[t,r]=S.useState(void 0);return Ne(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let u,i;if("borderBoxSize"in o){const a=o.borderBoxSize,d=Array.isArray(a)?a[0]:a;u=d.inlineSize,i=d.blockSize}else u=e.offsetWidth,i=e.offsetHeight;r({width:u,height:i})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}function sk(e,t){return S.useReducer((r,n)=>t[r][n]??r,e)}var Je=e=>{const{present:t,children:r}=e,n=ik(t),s=typeof r=="function"?r({present:n.isPresent}):S.Children.only(r),o=ce(n.ref,ok(s));return typeof r=="function"||n.isPresent?S.cloneElement(s,{ref:o}):null};Je.displayName="Presence";function ik(e){const[t,r]=S.useState(),n=S.useRef(null),s=S.useRef(e),o=S.useRef("none"),u=e?"mounted":"unmounted",[i,a]=sk(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const d=Vi(n.current);o.current=i==="mounted"?d:"none"},[i]),Ne(()=>{const d=n.current,m=s.current;if(m!==e){const g=o.current,y=Vi(d);e?a("MOUNT"):y==="none"||(d==null?void 0:d.display)==="none"?a("UNMOUNT"):a(m&&g!==y?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,a]),Ne(()=>{if(t){let d;const m=t.ownerDocument.defaultView??window,c=y=>{const _=Vi(n.current).includes(CSS.escape(y.animationName));if(y.target===t&&_&&(a("ANIMATION_END"),!s.current)){const p=t.style.animationFillMode;t.style.animationFillMode="forwards",d=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=p)})}},g=y=>{y.target===t&&(o.current=Vi(n.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{m.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:S.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function Vi(e){return(e==null?void 0:e.animationName)||"none"}function ok(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function nn(e){const t=ak(e),r=S.forwardRef((n,s)=>{const{children:o,...u}=n,i=S.Children.toArray(o),a=i.find(ck);if(a){const d=a.props.children,m=i.map(c=>c===a?S.Children.count(d)>1?S.Children.only(null):S.isValidElement(d)?d.props.children:null:c);return v.jsx(t,{...u,ref:s,children:S.isValidElement(d)?S.cloneElement(d,void 0,m):null})}return v.jsx(t,{...u,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}function ak(e){const t=S.forwardRef((r,n)=>{const{children:s,...o}=r;if(S.isValidElement(s)){const u=dk(s),i=uk(o,s.props);return s.type!==S.Fragment&&(i.ref=n?$t(n,u):u),S.cloneElement(s,i)}return S.Children.count(s)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hv=Symbol("radix.slottable");function lk(e){const t=({children:r})=>v.jsx(v.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=hv,t}function ck(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hv}function uk(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...i)=>{const a=o(...i);return s(...i),a}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function dk(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var hk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ie=hk.reduce((e,t)=>{const r=nn(`Primitive.${t}`),n=S.forwardRef((s,o)=>{const{asChild:u,...i}=s,a=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(a,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function fv(e,t){e&&ts.flushSync(()=>e.dispatchEvent(t))}var ya="Checkbox",[fk]=_t(ya),[pk,rd]=fk(ya);function mk(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:s,disabled:o,form:u,name:i,onCheckedChange:a,required:d,value:m="on",internal_do_not_use_render:c}=e,[g,y]=fi({prop:r,defaultProp:s??!1,onChange:a,caller:ya}),[C,_]=S.useState(null),[p,h]=S.useState(null),l=S.useRef(!1),f=C?!!u||!!C.closest("form"):!0,x={checked:g,disabled:o,setChecked:y,control:C,setControl:_,name:i,form:u,value:m,hasConsumerStoppedPropagationRef:l,required:d,defaultChecked:Cr(s)?!1:s,isFormControl:f,bubbleInput:p,setBubbleInput:h};return v.jsx(pk,{scope:t,...x,children:gk(c)?c(x):n})}var pv="CheckboxTrigger",mv=S.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},s)=>{const{control:o,value:u,disabled:i,checked:a,required:d,setControl:m,setChecked:c,hasConsumerStoppedPropagationRef:g,isFormControl:y,bubbleInput:C}=rd(pv,e),_=ce(s,m),p=S.useRef(a);return S.useEffect(()=>{const h=o==null?void 0:o.form;if(h){const l=()=>c(p.current);return h.addEventListener("reset",l),()=>h.removeEventListener("reset",l)}},[o,c]),v.jsx(ie.button,{type:"button",role:"checkbox","aria-checked":Cr(a)?"mixed":a,"aria-required":d,"data-state":xv(a),"data-disabled":i?"":void 0,disabled:i,value:u,...n,ref:_,onKeyDown:Q(t,h=>{h.key==="Enter"&&h.preventDefault()}),onClick:Q(r,h=>{c(l=>Cr(l)?!0:!l),C&&y&&(g.current=h.isPropagationStopped(),g.current||h.stopPropagation())})})});mv.displayName=pv;var nd=S.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:s,defaultChecked:o,required:u,disabled:i,value:a,onCheckedChange:d,form:m,...c}=e;return v.jsx(mk,{__scopeCheckbox:r,checked:s,defaultChecked:o,disabled:i,required:u,onCheckedChange:d,name:n,form:m,value:a,internal_do_not_use_render:({isFormControl:g})=>v.jsxs(v.Fragment,{children:[v.jsx(mv,{...c,ref:t,__scopeCheckbox:r}),g&&v.jsx(yv,{__scopeCheckbox:r})]})})});nd.displayName=ya;var gv="CheckboxIndicator",vv=S.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...s}=e,o=rd(gv,r);return v.jsx(Je,{present:n||Cr(o.checked)||o.checked===!0,children:v.jsx(ie.span,{"data-state":xv(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});vv.displayName=gv;var _v="CheckboxBubbleInput",yv=S.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:u,required:i,disabled:a,name:d,value:m,form:c,bubbleInput:g,setBubbleInput:y}=rd(_v,e),C=ce(r,y),_=ed(o),p=td(n);S.useEffect(()=>{const l=g;if(!l)return;const f=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(f,"checked").set,k=!s.current;if(_!==o&&E){const b=new Event("click",{bubbles:k});l.indeterminate=Cr(o),E.call(l,Cr(o)?!1:o),l.dispatchEvent(b)}},[g,_,o,s]);const h=S.useRef(Cr(o)?!1:o);return v.jsx(ie.input,{type:"checkbox","aria-hidden":!0,defaultChecked:u??h.current,required:i,disabled:a,name:d,value:m,form:c,...t,tabIndex:-1,ref:C,style:{...t.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});yv.displayName=_v;function gk(e){return typeof e=="function"}function Cr(e){return e==="indeterminate"}function xv(e){return Cr(e)?"indeterminate":e?"checked":"unchecked"}const vk=S.forwardRef(({className:e,...t},r)=>v.jsx(nd,{ref:r,className:re("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:v.jsx(vv,{className:re("grid place-content-center text-current"),children:v.jsx(Qu,{className:"h-4 w-4"})})}));vk.displayName=nd.displayName;var _k=ra[" useId ".trim().toString()]||(()=>{}),yk=0;function st(e){const[t,r]=S.useState(_k());return Ne(()=>{r(n=>n??String(yk++))},[e]),t?`radix-${t}`:""}var vf=1,xk=.9,wk=.8,Sk=.17,wl=.1,Sl=.999,bk=.9999,Ck=.99,kk=/[\\\/_+.#"@\[\(\{&]/,Ek=/[\\\/_+.#"@\[\(\{&]/g,Rk=/[\s-]/,wv=/[\s-]/g;function Ac(e,t,r,n,s,o,u){if(o===t.length)return s===e.length?vf:Ck;var i=`${s},${o}`;if(u[i]!==void 0)return u[i];for(var a=n.charAt(o),d=r.indexOf(a,s),m=0,c,g,y,C;d>=0;)c=Ac(e,t,r,n,d+1,o+1,u),c>m&&(d===s?c*=vf:kk.test(e.charAt(d-1))?(c*=wk,y=e.slice(s,d-1).match(Ek),y&&s>0&&(c*=Math.pow(Sl,y.length))):Rk.test(e.charAt(d-1))?(c*=xk,C=e.slice(s,d-1).match(wv),C&&s>0&&(c*=Math.pow(Sl,C.length))):(c*=Sk,s>0&&(c*=Math.pow(Sl,d-s))),e.charAt(d)!==t.charAt(o)&&(c*=bk)),(c<wl&&r.charAt(d-1)===n.charAt(o+1)||n.charAt(o+1)===n.charAt(o)&&r.charAt(d-1)!==n.charAt(o))&&(g=Ac(e,t,r,n,d+1,o+2,u),g*wl>c&&(c=g*wl)),c>m&&(m=c),d=r.indexOf(a,d+1);return u[i]=m,m}function _f(e){return e.toLowerCase().replace(wv," ")}function Pk(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Ac(e,t,_f(e),_f(t),0,0,{})}function Tk(e,t=globalThis==null?void 0:globalThis.document){const r=Ft(e);S.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Nk="DismissableLayer",Dc="dismissableLayer.update",Lk="dismissableLayer.pointerDownOutside",Ak="dismissableLayer.focusOutside",yf,Sv=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ns=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:u,onDismiss:i,...a}=e,d=S.useContext(Sv),[m,c]=S.useState(null),g=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=S.useState({}),C=ce(t,b=>c(b)),_=Array.from(d.layers),[p]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),h=_.indexOf(p),l=m?_.indexOf(m):-1,f=d.layersWithOutsidePointerEventsDisabled.size>0,x=l>=h,E=jk(b=>{const w=b.target,R=[...d.branches].some(T=>T.contains(w));!x||R||(s==null||s(b),u==null||u(b),b.defaultPrevented||i==null||i())},g),k=Ik(b=>{const w=b.target;[...d.branches].some(T=>T.contains(w))||(o==null||o(b),u==null||u(b),b.defaultPrevented||i==null||i())},g);return Tk(b=>{l===d.layers.size-1&&(n==null||n(b),!b.defaultPrevented&&i&&(b.preventDefault(),i()))},g),S.useEffect(()=>{if(m)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(yf=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),xf(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=yf)}},[m,g,r,d]),S.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),xf())},[m,d]),S.useEffect(()=>{const b=()=>y({});return document.addEventListener(Dc,b),()=>document.removeEventListener(Dc,b)},[]),v.jsx(ie.div,{...a,ref:C,style:{pointerEvents:f?x?"auto":"none":void 0,...e.style},onFocusCapture:Q(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Q(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Q(e.onPointerDownCapture,E.onPointerDownCapture)})});ns.displayName=Nk;var Dk="DismissableLayerBranch",Mk=S.forwardRef((e,t)=>{const r=S.useContext(Sv),n=S.useRef(null),s=ce(t,n);return S.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),v.jsx(ie.div,{...e,ref:s})});Mk.displayName=Dk;function jk(e,t=globalThis==null?void 0:globalThis.document){const r=Ft(e),n=S.useRef(!1),s=S.useRef(()=>{});return S.useEffect(()=>{const o=i=>{if(i.target&&!n.current){let a=function(){bv(Lk,r,d,{discrete:!0})};const d={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=a,t.addEventListener("click",s.current,{once:!0})):a()}else t.removeEventListener("click",s.current);n.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Ik(e,t=globalThis==null?void 0:globalThis.document){const r=Ft(e),n=S.useRef(!1);return S.useEffect(()=>{const s=o=>{o.target&&!n.current&&bv(Ak,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function xf(){const e=new CustomEvent(Dc);document.dispatchEvent(e)}function bv(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?fv(s,o):s.dispatchEvent(o)}var bl="focusScope.autoFocusOnMount",Cl="focusScope.autoFocusOnUnmount",wf={bubbles:!1,cancelable:!0},Ok="FocusScope",pi=S.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...u}=e,[i,a]=S.useState(null),d=Ft(s),m=Ft(o),c=S.useRef(null),g=ce(t,_=>a(_)),y=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(n){let _=function(f){if(y.paused||!i)return;const x=f.target;i.contains(x)?c.current=x:lr(c.current,{select:!0})},p=function(f){if(y.paused||!i)return;const x=f.relatedTarget;x!==null&&(i.contains(x)||lr(c.current,{select:!0}))},h=function(f){if(document.activeElement===document.body)for(const E of f)E.removedNodes.length>0&&lr(i)};document.addEventListener("focusin",_),document.addEventListener("focusout",p);const l=new MutationObserver(h);return i&&l.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",p),l.disconnect()}}},[n,i,y.paused]),S.useEffect(()=>{if(i){bf.add(y);const _=document.activeElement;if(!i.contains(_)){const h=new CustomEvent(bl,wf);i.addEventListener(bl,d),i.dispatchEvent(h),h.defaultPrevented||(Bk(Wk(Cv(i)),{select:!0}),document.activeElement===_&&lr(i))}return()=>{i.removeEventListener(bl,d),setTimeout(()=>{const h=new CustomEvent(Cl,wf);i.addEventListener(Cl,m),i.dispatchEvent(h),h.defaultPrevented||lr(_??document.body,{select:!0}),i.removeEventListener(Cl,m),bf.remove(y)},0)}}},[i,d,m,y]);const C=S.useCallback(_=>{if(!r&&!n||y.paused)return;const p=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,h=document.activeElement;if(p&&h){const l=_.currentTarget,[f,x]=Fk(l);f&&x?!_.shiftKey&&h===x?(_.preventDefault(),r&&lr(f,{select:!0})):_.shiftKey&&h===f&&(_.preventDefault(),r&&lr(x,{select:!0})):h===l&&_.preventDefault()}},[r,n,y.paused]);return v.jsx(ie.div,{tabIndex:-1,...u,ref:g,onKeyDown:C})});pi.displayName=Ok;function Bk(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(lr(n,{select:t}),document.activeElement!==r)return}function Fk(e){const t=Cv(e),r=Sf(t,e),n=Sf(t.reverse(),e);return[r,n]}function Cv(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Sf(e,t){for(const r of e)if(!$k(r,{upTo:t}))return r}function $k(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Hk(e){return e instanceof HTMLInputElement&&"select"in e}function lr(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Hk(e)&&t&&e.select()}}var bf=zk();function zk(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Cf(e,t),e.unshift(t)},remove(t){var r;e=Cf(e,t),(r=e[0])==null||r.resume()}}}function Cf(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Wk(e){return e.filter(t=>t.tagName!=="A")}var Uk="Portal",ss=S.forwardRef((e,t)=>{var i;const{container:r,...n}=e,[s,o]=S.useState(!1);Ne(()=>o(!0),[]);const u=r||s&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return u?BS.createPortal(v.jsx(ie.div,{...n,ref:t}),u):null});ss.displayName=Uk;var kl=0;function xa(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??kf()),document.body.insertAdjacentElement("beforeend",e[1]??kf()),kl++,()=>{kl===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),kl--}},[])}function kf(){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 Mt=function(){return Mt=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Mt.apply(this,arguments)};function kv(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function Vk(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,o;n<s;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}var po="right-scroll-bar-position",mo="width-before-scroll-bar",Kk="with-scroll-bars-hidden",Gk="--removed-body-scroll-bar-size";function El(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function qk(e,t){var r=S.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var Xk=typeof window<"u"?S.useLayoutEffect:S.useEffect,Ef=new WeakMap;function Yk(e,t){var r=qk(null,function(n){return e.forEach(function(s){return El(s,n)})});return Xk(function(){var n=Ef.get(r);if(n){var s=new Set(n),o=new Set(e),u=r.current;s.forEach(function(i){o.has(i)||El(i,null)}),o.forEach(function(i){s.has(i)||El(i,u)})}Ef.set(r,e)},[e]),r}function Jk(e){return e}function Qk(e,t){t===void 0&&(t=Jk);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var u=t(o,n);return r.push(u),function(){r=r.filter(function(i){return i!==u})}},assignSyncMedium:function(o){for(n=!0;r.length;){var u=r;r=[],u.forEach(o)}r={push:function(i){return o(i)},filter:function(){return r}}},assignMedium:function(o){n=!0;var u=[];if(r.length){var i=r;r=[],i.forEach(o),u=r}var a=function(){var m=u;u=[],m.forEach(o)},d=function(){return Promise.resolve().then(a)};d(),r={push:function(m){u.push(m),d()},filter:function(m){return u=u.filter(m),r}}}};return s}function Zk(e){e===void 0&&(e={});var t=Qk(null);return t.options=Mt({async:!0,ssr:!1},e),t}var Ev=function(e){var t=e.sideCar,r=kv(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return S.createElement(n,Mt({},r))};Ev.isSideCarExport=!0;function eE(e,t){return e.useMedium(t),Ev}var Rv=Zk(),Rl=function(){},wa=S.forwardRef(function(e,t){var r=S.useRef(null),n=S.useState({onScrollCapture:Rl,onWheelCapture:Rl,onTouchMoveCapture:Rl}),s=n[0],o=n[1],u=e.forwardProps,i=e.children,a=e.className,d=e.removeScrollBar,m=e.enabled,c=e.shards,g=e.sideCar,y=e.noRelative,C=e.noIsolation,_=e.inert,p=e.allowPinchZoom,h=e.as,l=h===void 0?"div":h,f=e.gapMode,x=kv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=g,k=Yk([r,t]),b=Mt(Mt({},x),s);return S.createElement(S.Fragment,null,m&&S.createElement(E,{sideCar:Rv,removeScrollBar:d,shards:c,noRelative:y,noIsolation:C,inert:_,setCallbacks:o,allowPinchZoom:!!p,lockRef:r,gapMode:f}),u?S.cloneElement(S.Children.only(i),Mt(Mt({},b),{ref:k})):S.createElement(l,Mt({},b,{className:a,ref:k}),i))});wa.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};wa.classNames={fullWidth:mo,zeroRight:po};var tE=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function rE(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tE();return t&&e.setAttribute("nonce",t),e}function nE(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function sE(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var iE=function(){var e=0,t=null;return{add:function(r){e==0&&(t=rE())&&(nE(t,r),sE(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oE=function(){var e=iE();return function(t,r){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Pv=function(){var e=oE(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},aE={left:0,top:0,right:0,gap:0},Pl=function(e){return parseInt(e||"",10)||0},lE=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Pl(r),Pl(n),Pl(s)]},cE=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return aE;var t=lE(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},uE=Pv(),Fn="data-scroll-locked",dE=function(e,t,r,n){var s=e.left,o=e.top,u=e.right,i=e.gap;return r===void 0&&(r="margin"),`
221
+ .`.concat(Kk,` {
222
+ overflow: hidden `).concat(n,`;
223
+ padding-right: `).concat(i,"px ").concat(n,`;
224
+ }
225
+ body[`).concat(Fn,`] {
226
+ overflow: hidden `).concat(n,`;
227
+ overscroll-behavior: contain;
228
+ `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
229
+ padding-left: `.concat(s,`px;
230
+ padding-top: `).concat(o,`px;
231
+ padding-right: `).concat(u,`px;
232
+ margin-left:0;
233
+ margin-top:0;
234
+ margin-right: `).concat(i,"px ").concat(n,`;
235
+ `),r==="padding"&&"padding-right: ".concat(i,"px ").concat(n,";")].filter(Boolean).join(""),`
236
+ }
237
+
238
+ .`).concat(po,` {
239
+ right: `).concat(i,"px ").concat(n,`;
240
+ }
241
+
242
+ .`).concat(mo,` {
243
+ margin-right: `).concat(i,"px ").concat(n,`;
244
+ }
245
+
246
+ .`).concat(po," .").concat(po,` {
247
+ right: 0 `).concat(n,`;
248
+ }
249
+
250
+ .`).concat(mo," .").concat(mo,` {
251
+ margin-right: 0 `).concat(n,`;
252
+ }
253
+
254
+ body[`).concat(Fn,`] {
255
+ `).concat(Gk,": ").concat(i,`px;
256
+ }
257
+ `)},Rf=function(){var e=parseInt(document.body.getAttribute(Fn)||"0",10);return isFinite(e)?e:0},hE=function(){S.useEffect(function(){return document.body.setAttribute(Fn,(Rf()+1).toString()),function(){var e=Rf()-1;e<=0?document.body.removeAttribute(Fn):document.body.setAttribute(Fn,e.toString())}},[])},fE=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;hE();var o=S.useMemo(function(){return cE(s)},[s]);return S.createElement(uE,{styles:dE(o,!t,s,r?"":"!important")})},Mc=!1;if(typeof window<"u")try{var Ki=Object.defineProperty({},"passive",{get:function(){return Mc=!0,!0}});window.addEventListener("test",Ki,Ki),window.removeEventListener("test",Ki,Ki)}catch{Mc=!1}var mn=Mc?{passive:!1}:!1,pE=function(e){return e.tagName==="TEXTAREA"},Tv=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!pE(e)&&r[t]==="visible")},mE=function(e){return Tv(e,"overflowY")},gE=function(e){return Tv(e,"overflowX")},Pf=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=Nv(e,n);if(s){var o=Lv(e,n),u=o[1],i=o[2];if(u>i)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},vE=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},_E=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Nv=function(e,t){return e==="v"?mE(t):gE(t)},Lv=function(e,t){return e==="v"?vE(t):_E(t)},yE=function(e,t){return e==="h"&&t==="rtl"?-1:1},xE=function(e,t,r,n,s){var o=yE(e,window.getComputedStyle(t).direction),u=o*n,i=r.target,a=t.contains(i),d=!1,m=u>0,c=0,g=0;do{if(!i)break;var y=Lv(e,i),C=y[0],_=y[1],p=y[2],h=_-p-o*C;(C||h)&&Nv(e,i)&&(c+=h,g+=C);var l=i.parentNode;i=l&&l.nodeType===Node.DOCUMENT_FRAGMENT_NODE?l.host:l}while(!a&&i!==document.body||a&&(t.contains(i)||t===i));return(m&&Math.abs(c)<1||!m&&Math.abs(g)<1)&&(d=!0),d},Gi=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Tf=function(e){return[e.deltaX,e.deltaY]},Nf=function(e){return e&&"current"in e?e.current:e},wE=function(e,t){return e[0]===t[0]&&e[1]===t[1]},SE=function(e){return`
258
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
259
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
260
+ `)},bE=0,gn=[];function CE(e){var t=S.useRef([]),r=S.useRef([0,0]),n=S.useRef(),s=S.useState(bE++)[0],o=S.useState(Pv)[0],u=S.useRef(e);S.useEffect(function(){u.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var _=Vk([e.lockRef.current],(e.shards||[]).map(Nf),!0).filter(Boolean);return _.forEach(function(p){return p.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),_.forEach(function(p){return p.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var i=S.useCallback(function(_,p){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!u.current.allowPinchZoom;var h=Gi(_),l=r.current,f="deltaX"in _?_.deltaX:l[0]-h[0],x="deltaY"in _?_.deltaY:l[1]-h[1],E,k=_.target,b=Math.abs(f)>Math.abs(x)?"h":"v";if("touches"in _&&b==="h"&&k.type==="range")return!1;var w=window.getSelection(),R=w&&w.anchorNode,T=R?R===k||R.contains(k):!1;if(T)return!1;var M=Pf(b,k);if(!M)return!0;if(M?E=b:(E=b==="v"?"h":"v",M=Pf(b,k)),!M)return!1;if(!n.current&&"changedTouches"in _&&(f||x)&&(n.current=E),!E)return!0;var O=n.current||E;return xE(O,p,_,O==="h"?f:x)},[]),a=S.useCallback(function(_){var p=_;if(!(!gn.length||gn[gn.length-1]!==o)){var h="deltaY"in p?Tf(p):Gi(p),l=t.current.filter(function(E){return E.name===p.type&&(E.target===p.target||p.target===E.shadowParent)&&wE(E.delta,h)})[0];if(l&&l.should){p.cancelable&&p.preventDefault();return}if(!l){var f=(u.current.shards||[]).map(Nf).filter(Boolean).filter(function(E){return E.contains(p.target)}),x=f.length>0?i(p,f[0]):!u.current.noIsolation;x&&p.cancelable&&p.preventDefault()}}},[]),d=S.useCallback(function(_,p,h,l){var f={name:_,delta:p,target:h,should:l,shadowParent:kE(h)};t.current.push(f),setTimeout(function(){t.current=t.current.filter(function(x){return x!==f})},1)},[]),m=S.useCallback(function(_){r.current=Gi(_),n.current=void 0},[]),c=S.useCallback(function(_){d(_.type,Tf(_),_.target,i(_,e.lockRef.current))},[]),g=S.useCallback(function(_){d(_.type,Gi(_),_.target,i(_,e.lockRef.current))},[]);S.useEffect(function(){return gn.push(o),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:g}),document.addEventListener("wheel",a,mn),document.addEventListener("touchmove",a,mn),document.addEventListener("touchstart",m,mn),function(){gn=gn.filter(function(_){return _!==o}),document.removeEventListener("wheel",a,mn),document.removeEventListener("touchmove",a,mn),document.removeEventListener("touchstart",m,mn)}},[]);var y=e.removeScrollBar,C=e.inert;return S.createElement(S.Fragment,null,C?S.createElement(o,{styles:SE(s)}):null,y?S.createElement(fE,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function kE(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const EE=eE(Rv,CE);var mi=S.forwardRef(function(e,t){return S.createElement(wa,Mt({},e,{ref:t,sideCar:EE}))});mi.classNames=wa.classNames;var RE=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vn=new WeakMap,qi=new WeakMap,Xi={},Tl=0,Av=function(e){return e&&(e.host||Av(e.parentNode))},PE=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Av(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},TE=function(e,t,r,n){var s=PE(t,Array.isArray(e)?e:[e]);Xi[r]||(Xi[r]=new WeakMap);var o=Xi[r],u=[],i=new Set,a=new Set(s),d=function(c){!c||i.has(c)||(i.add(c),d(c.parentNode))};s.forEach(d);var m=function(c){!c||a.has(c)||Array.prototype.forEach.call(c.children,function(g){if(i.has(g))m(g);else try{var y=g.getAttribute(n),C=y!==null&&y!=="false",_=(vn.get(g)||0)+1,p=(o.get(g)||0)+1;vn.set(g,_),o.set(g,p),u.push(g),_===1&&C&&qi.set(g,!0),p===1&&g.setAttribute(r,"true"),C||g.setAttribute(n,"true")}catch(h){console.error("aria-hidden: cannot operate on ",g,h)}})};return m(t),i.clear(),Tl++,function(){u.forEach(function(c){var g=vn.get(c)-1,y=o.get(c)-1;vn.set(c,g),o.set(c,y),g||(qi.has(c)||c.removeAttribute(n),qi.delete(c)),y||c.removeAttribute(r)}),Tl--,Tl||(vn=new WeakMap,vn=new WeakMap,qi=new WeakMap,Xi={})}},Sa=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=RE(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live], script"))),TE(n,s,r,"aria-hidden")):function(){return null}},ba="Dialog",[Dv]=_t(ba),[NE,Tt]=Dv(ba),Mv=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:u=!0}=e,i=S.useRef(null),a=S.useRef(null),[d,m]=fi({prop:n,defaultProp:s??!1,onChange:o,caller:ba});return v.jsx(NE,{scope:t,triggerRef:i,contentRef:a,contentId:st(),titleId:st(),descriptionId:st(),open:d,onOpenChange:m,onOpenToggle:S.useCallback(()=>m(c=>!c),[m]),modal:u,children:r})};Mv.displayName=ba;var jv="DialogTrigger",LE=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tt(jv,r),o=ce(t,s.triggerRef);return v.jsx(ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":od(s.open),...n,ref:o,onClick:Q(e.onClick,s.onOpenToggle)})});LE.displayName=jv;var sd="DialogPortal",[AE,Iv]=Dv(sd,{forceMount:void 0}),Ov=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,o=Tt(sd,t);return v.jsx(AE,{scope:t,forceMount:r,children:S.Children.map(n,u=>v.jsx(Je,{present:r||o.open,children:v.jsx(ss,{asChild:!0,container:s,children:u})}))})};Ov.displayName=sd;var Uo="DialogOverlay",Bv=S.forwardRef((e,t)=>{const r=Iv(Uo,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=Tt(Uo,e.__scopeDialog);return o.modal?v.jsx(Je,{present:n||o.open,children:v.jsx(ME,{...s,ref:t})}):null});Bv.displayName=Uo;var DE=nn("DialogOverlay.RemoveScroll"),ME=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tt(Uo,r);return v.jsx(mi,{as:DE,allowPinchZoom:!0,shards:[s.contentRef],children:v.jsx(ie.div,{"data-state":od(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),sn="DialogContent",Fv=S.forwardRef((e,t)=>{const r=Iv(sn,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=Tt(sn,e.__scopeDialog);return v.jsx(Je,{present:n||o.open,children:o.modal?v.jsx(jE,{...s,ref:t}):v.jsx(IE,{...s,ref:t})})});Fv.displayName=sn;var jE=S.forwardRef((e,t)=>{const r=Tt(sn,e.__scopeDialog),n=S.useRef(null),s=ce(t,r.contentRef,n);return S.useEffect(()=>{const o=n.current;if(o)return Sa(o)},[]),v.jsx($v,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Q(e.onCloseAutoFocus,o=>{var u;o.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Q(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,i=u.button===0&&u.ctrlKey===!0;(u.button===2||i)&&o.preventDefault()}),onFocusOutside:Q(e.onFocusOutside,o=>o.preventDefault())})}),IE=S.forwardRef((e,t)=>{const r=Tt(sn,e.__scopeDialog),n=S.useRef(!1),s=S.useRef(!1);return v.jsx($v,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,i;(u=e.onCloseAutoFocus)==null||u.call(e,o),o.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var a,d;(a=e.onInteractOutside)==null||a.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const u=o.target;((d=r.triggerRef.current)==null?void 0:d.contains(u))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),$v=S.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...u}=e,i=Tt(sn,r),a=S.useRef(null),d=ce(t,a);return xa(),v.jsxs(v.Fragment,{children:[v.jsx(pi,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:v.jsx(ns,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":od(i.open),...u,ref:d,onDismiss:()=>i.onOpenChange(!1)})}),v.jsxs(v.Fragment,{children:[v.jsx(OE,{titleId:i.titleId}),v.jsx(FE,{contentRef:a,descriptionId:i.descriptionId})]})]})}),id="DialogTitle",Hv=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tt(id,r);return v.jsx(ie.h2,{id:s.titleId,...n,ref:t})});Hv.displayName=id;var zv="DialogDescription",Wv=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tt(zv,r);return v.jsx(ie.p,{id:s.descriptionId,...n,ref:t})});Wv.displayName=zv;var Uv="DialogClose",Vv=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=Tt(Uv,r);return v.jsx(ie.button,{type:"button",...n,ref:t,onClick:Q(e.onClick,()=>s.onOpenChange(!1))})});Vv.displayName=Uv;function od(e){return e?"open":"closed"}var Kv="DialogTitleWarning",[gA,Gv]=ZC(Kv,{contentName:sn,titleName:id,docsSlug:"dialog"}),OE=({titleId:e})=>{const t=Gv(Kv),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
261
+
262
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
263
+
264
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},BE="DialogDescriptionWarning",FE=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Gv(BE).contentName}}.`;return S.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},$E=Mv,ad=Ov,gi=Bv,vi=Fv,Ca=Hv,ka=Wv,qv=Vv,xs='[cmdk-group=""]',Nl='[cmdk-group-items=""]',HE='[cmdk-group-heading=""]',Xv='[cmdk-item=""]',Lf=`${Xv}:not([aria-disabled="true"])`,jc="cmdk-item-select",yn="data-value",zE=(e,t,r)=>Pk(e,t,r),Yv=S.createContext(void 0),_i=()=>S.useContext(Yv),Jv=S.createContext(void 0),ld=()=>S.useContext(Jv),Qv=S.createContext(void 0),Zv=S.forwardRef((e,t)=>{let r=xn(()=>{var D,W;return{search:"",value:(W=(D=e.value)!=null?D:e.defaultValue)!=null?W:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=xn(()=>new Set),s=xn(()=>new Map),o=xn(()=>new Map),u=xn(()=>new Set),i=e_(e),{label:a,children:d,value:m,onValueChange:c,filter:g,shouldFilter:y,loop:C,disablePointerSelection:_=!1,vimBindings:p=!0,...h}=e,l=st(),f=st(),x=st(),E=S.useRef(null),k=ZE();on(()=>{if(m!==void 0){let D=m.trim();r.current.value=D,b.emit()}},[m]),on(()=>{k(6,A)},[]);let b=S.useMemo(()=>({subscribe:D=>(u.current.add(D),()=>u.current.delete(D)),snapshot:()=>r.current,setState:(D,W,$)=>{var V,q,I,L;if(!Object.is(r.current[D],W)){if(r.current[D]=W,D==="search")O(),T(),k(1,M);else if(D==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let z=document.getElementById(x);z?z.focus():(V=document.getElementById(l))==null||V.focus()}if(k(7,()=>{var z;r.current.selectedItemId=(z=F())==null?void 0:z.id,b.emit()}),$||k(5,A),((q=i.current)==null?void 0:q.value)!==void 0){let z=W??"";(L=(I=i.current).onValueChange)==null||L.call(I,z);return}}b.emit()}},emit:()=>{u.current.forEach(D=>D())}}),[]),w=S.useMemo(()=>({value:(D,W,$)=>{var V;W!==((V=o.current.get(D))==null?void 0:V.value)&&(o.current.set(D,{value:W,keywords:$}),r.current.filtered.items.set(D,R(W,$)),k(2,()=>{T(),b.emit()}))},item:(D,W)=>(n.current.add(D),W&&(s.current.has(W)?s.current.get(W).add(D):s.current.set(W,new Set([D]))),k(3,()=>{O(),T(),r.current.value||M(),b.emit()}),()=>{o.current.delete(D),n.current.delete(D),r.current.filtered.items.delete(D);let $=F();k(4,()=>{O(),($==null?void 0:$.getAttribute("id"))===D&&M(),b.emit()})}),group:D=>(s.current.has(D)||s.current.set(D,new Set),()=>{o.current.delete(D),s.current.delete(D)}),filter:()=>i.current.shouldFilter,label:a||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:l,inputId:x,labelId:f,listInnerRef:E}),[]);function R(D,W){var $,V;let q=(V=($=i.current)==null?void 0:$.filter)!=null?V:zE;return D?q(D,r.current.search,W):0}function T(){if(!r.current.search||i.current.shouldFilter===!1)return;let D=r.current.filtered.items,W=[];r.current.filtered.groups.forEach(V=>{let q=s.current.get(V),I=0;q.forEach(L=>{let z=D.get(L);I=Math.max(z,I)}),W.push([V,I])});let $=E.current;U().sort((V,q)=>{var I,L;let z=V.getAttribute("id"),H=q.getAttribute("id");return((I=D.get(H))!=null?I:0)-((L=D.get(z))!=null?L:0)}).forEach(V=>{let q=V.closest(Nl);q?q.appendChild(V.parentElement===q?V:V.closest(`${Nl} > *`)):$.appendChild(V.parentElement===$?V:V.closest(`${Nl} > *`))}),W.sort((V,q)=>q[1]-V[1]).forEach(V=>{var q;let I=(q=E.current)==null?void 0:q.querySelector(`${xs}[${yn}="${encodeURIComponent(V[0])}"]`);I==null||I.parentElement.appendChild(I)})}function M(){let D=U().find($=>$.getAttribute("aria-disabled")!=="true"),W=D==null?void 0:D.getAttribute(yn);b.setState("value",W||void 0)}function O(){var D,W,$,V;if(!r.current.search||i.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let q=0;for(let I of n.current){let L=(W=(D=o.current.get(I))==null?void 0:D.value)!=null?W:"",z=(V=($=o.current.get(I))==null?void 0:$.keywords)!=null?V:[],H=R(L,z);r.current.filtered.items.set(I,H),H>0&&q++}for(let[I,L]of s.current)for(let z of L)if(r.current.filtered.items.get(z)>0){r.current.filtered.groups.add(I);break}r.current.filtered.count=q}function A(){var D,W,$;let V=F();V&&(((D=V.parentElement)==null?void 0:D.firstChild)===V&&(($=(W=V.closest(xs))==null?void 0:W.querySelector(HE))==null||$.scrollIntoView({block:"nearest"})),V.scrollIntoView({block:"nearest"}))}function F(){var D;return(D=E.current)==null?void 0:D.querySelector(`${Xv}[aria-selected="true"]`)}function U(){var D;return Array.from(((D=E.current)==null?void 0:D.querySelectorAll(Lf))||[])}function G(D){let W=U()[D];W&&b.setState("value",W.getAttribute(yn))}function K(D){var W;let $=F(),V=U(),q=V.findIndex(L=>L===$),I=V[q+D];(W=i.current)!=null&&W.loop&&(I=q+D<0?V[V.length-1]:q+D===V.length?V[0]:V[q+D]),I&&b.setState("value",I.getAttribute(yn))}function B(D){let W=F(),$=W==null?void 0:W.closest(xs),V;for(;$&&!V;)$=D>0?JE($,xs):QE($,xs),V=$==null?void 0:$.querySelector(Lf);V?b.setState("value",V.getAttribute(yn)):K(D)}let P=()=>G(U().length-1),N=D=>{D.preventDefault(),D.metaKey?P():D.altKey?B(1):K(1)},j=D=>{D.preventDefault(),D.metaKey?G(0):D.altKey?B(-1):K(-1)};return S.createElement(Ue.div,{ref:t,tabIndex:-1,...h,"cmdk-root":"",onKeyDown:D=>{var W;(W=h.onKeyDown)==null||W.call(h,D);let $=D.nativeEvent.isComposing||D.keyCode===229;if(!(D.defaultPrevented||$))switch(D.key){case"n":case"j":{p&&D.ctrlKey&&N(D);break}case"ArrowDown":{N(D);break}case"p":case"k":{p&&D.ctrlKey&&j(D);break}case"ArrowUp":{j(D);break}case"Home":{D.preventDefault(),G(0);break}case"End":{D.preventDefault(),P();break}case"Enter":{D.preventDefault();let V=F();if(V){let q=new Event(jc);V.dispatchEvent(q)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:w.inputId,id:w.labelId,style:t2},a),Ea(e,D=>S.createElement(Jv.Provider,{value:b},S.createElement(Yv.Provider,{value:w},D))))}),WE=S.forwardRef((e,t)=>{var r,n;let s=st(),o=S.useRef(null),u=S.useContext(Qv),i=_i(),a=e_(e),d=(n=(r=a.current)==null?void 0:r.forceMount)!=null?n:u==null?void 0:u.forceMount;on(()=>{if(!d)return i.item(s,u==null?void 0:u.id)},[d]);let m=t_(s,o,[e.value,e.children,o],e.keywords),c=ld(),g=Rr(k=>k.value&&k.value===m.current),y=Rr(k=>d||i.filter()===!1?!0:k.search?k.filtered.items.get(s)>0:!0);S.useEffect(()=>{let k=o.current;if(!(!k||e.disabled))return k.addEventListener(jc,C),()=>k.removeEventListener(jc,C)},[y,e.onSelect,e.disabled]);function C(){var k,b;_(),(b=(k=a.current).onSelect)==null||b.call(k,m.current)}function _(){c.setState("value",m.current,!0)}if(!y)return null;let{disabled:p,value:h,onSelect:l,forceMount:f,keywords:x,...E}=e;return S.createElement(Ue.div,{ref:$t(o,t),...E,id:s,"cmdk-item":"",role:"option","aria-disabled":!!p,"aria-selected":!!g,"data-disabled":!!p,"data-selected":!!g,onPointerMove:p||i.getDisablePointerSelection()?void 0:_,onClick:p?void 0:C},e.children)}),UE=S.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...o}=e,u=st(),i=S.useRef(null),a=S.useRef(null),d=st(),m=_i(),c=Rr(y=>s||m.filter()===!1?!0:y.search?y.filtered.groups.has(u):!0);on(()=>m.group(u),[]),t_(u,i,[e.value,e.heading,a]);let g=S.useMemo(()=>({id:u,forceMount:s}),[s]);return S.createElement(Ue.div,{ref:$t(i,t),...o,"cmdk-group":"",role:"presentation",hidden:c?void 0:!0},r&&S.createElement("div",{ref:a,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),Ea(e,y=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},S.createElement(Qv.Provider,{value:g},y))))}),VE=S.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=S.useRef(null),o=Rr(u=>!u.search);return!r&&!o?null:S.createElement(Ue.div,{ref:$t(s,t),...n,"cmdk-separator":"",role:"separator"})}),KE=S.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=e.value!=null,o=ld(),u=Rr(d=>d.search),i=Rr(d=>d.selectedItemId),a=_i();return S.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),S.createElement(Ue.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":a.listId,"aria-labelledby":a.labelId,"aria-activedescendant":i,id:a.inputId,type:"text",value:s?e.value:u,onChange:d=>{s||o.setState("search",d.target.value),r==null||r(d.target.value)}})}),GE=S.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,o=S.useRef(null),u=S.useRef(null),i=Rr(d=>d.selectedItemId),a=_i();return S.useEffect(()=>{if(u.current&&o.current){let d=u.current,m=o.current,c,g=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let y=d.offsetHeight;m.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return g.observe(d),()=>{cancelAnimationFrame(c),g.unobserve(d)}}},[]),S.createElement(Ue.div,{ref:$t(o,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":i,"aria-label":n,id:a.listId},Ea(e,d=>S.createElement("div",{ref:$t(u,a.listInnerRef),"cmdk-list-sizer":""},d)))}),qE=S.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:o,container:u,...i}=e;return S.createElement($E,{open:r,onOpenChange:n},S.createElement(ad,{container:u},S.createElement(gi,{"cmdk-overlay":"",className:s}),S.createElement(vi,{"aria-label":e.label,"cmdk-dialog":"",className:o},S.createElement(Zv,{ref:t,...i}))))}),XE=S.forwardRef((e,t)=>Rr(r=>r.filtered.count===0)?S.createElement(Ue.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),YE=S.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...o}=e;return S.createElement(Ue.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Ea(e,u=>S.createElement("div",{"aria-hidden":!0},u)))}),Qe=Object.assign(Zv,{List:GE,Item:WE,Input:KE,Group:UE,Separator:VE,Dialog:qE,Empty:XE,Loading:YE});function JE(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function QE(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function e_(e){let t=S.useRef(e);return on(()=>{t.current=e}),t}var on=typeof window>"u"?S.useEffect:S.useLayoutEffect;function xn(e){let t=S.useRef();return t.current===void 0&&(t.current=e()),t}function Rr(e){let t=ld(),r=()=>e(t.snapshot());return S.useSyncExternalStore(t.subscribe,r,r)}function t_(e,t,r,n=[]){let s=S.useRef(),o=_i();return on(()=>{var u;let i=(()=>{var d;for(let m of r){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(d=m.current.textContent)==null?void 0:d.trim():s.current}})(),a=n.map(d=>d.trim());o.value(e,i,a),(u=t.current)==null||u.setAttribute(yn,i),s.current=i}),s}var ZE=()=>{let[e,t]=S.useState(),r=xn(()=>new Map);return on(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,s)=>{r.current.set(n,s),t({})}};function e2(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Ea({asChild:e,children:t},r){return e&&S.isValidElement(t)?S.cloneElement(e2(t),{ref:t.ref},r(t.props.children)):r(t)}var t2={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const r2=S.forwardRef(({className:e,...t},r)=>v.jsx(Qe,{ref:r,className:re("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));r2.displayName=Qe.displayName;const n2=S.forwardRef(({className:e,...t},r)=>v.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[v.jsx(RC,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),v.jsx(Qe.Input,{ref:r,className:re("flex h-9 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));n2.displayName=Qe.Input.displayName;const s2=S.forwardRef(({className:e,onWheel:t,...r},n)=>v.jsx(Qe.List,{ref:n,className:re("overflow-y-auto overflow-x-hidden",e),style:{maxHeight:300},onWheel:t??(s=>{s.currentTarget.scrollTop+=s.deltaY}),...r}));s2.displayName=Qe.List.displayName;const i2=S.forwardRef((e,t)=>v.jsx(Qe.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));i2.displayName=Qe.Empty.displayName;const o2=S.forwardRef(({className:e,...t},r)=>v.jsx(Qe.Group,{ref:r,className:re("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));o2.displayName=Qe.Group.displayName;const a2=S.forwardRef(({className:e,...t},r)=>v.jsx(Qe.Separator,{ref:r,className:re("-mx-1 h-px bg-border",e),...t}));a2.displayName=Qe.Separator.displayName;const l2=S.forwardRef(({className:e,...t},r)=>v.jsx(Qe.Item,{ref:r,className:re("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));l2.displayName=Qe.Item.displayName;const c2=["top","right","bottom","left"],Pr=Math.min,tt=Math.max,Vo=Math.round,Yi=Math.floor,Bt=e=>({x:e,y:e}),u2={left:"right",right:"left",bottom:"top",top:"bottom"};function Ic(e,t,r){return tt(e,Pr(t,r))}function Qt(e,t){return typeof e=="function"?e(t):e}function Zt(e){return e.split("-")[0]}function is(e){return e.split("-")[1]}function cd(e){return e==="x"?"y":"x"}function ud(e){return e==="y"?"height":"width"}function jt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function dd(e){return cd(jt(e))}function d2(e,t,r){r===void 0&&(r=!1);const n=is(e),s=dd(e),o=ud(s);let u=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(u=Ko(u)),[u,Ko(u)]}function h2(e){const t=Ko(e);return[Oc(e),t,Oc(t)]}function Oc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Af=["left","right"],Df=["right","left"],f2=["top","bottom"],p2=["bottom","top"];function m2(e,t,r){switch(e){case"top":case"bottom":return r?t?Df:Af:t?Af:Df;case"left":case"right":return t?f2:p2;default:return[]}}function g2(e,t,r,n){const s=is(e);let o=m2(Zt(e),r==="start",n);return s&&(o=o.map(u=>u+"-"+s),t&&(o=o.concat(o.map(Oc)))),o}function Ko(e){const t=Zt(e);return u2[t]+e.slice(t.length)}function v2(e){return{top:0,right:0,bottom:0,left:0,...e}}function r_(e){return typeof e!="number"?v2(e):{top:e,right:e,bottom:e,left:e}}function Go(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function Mf(e,t,r){let{reference:n,floating:s}=e;const o=jt(t),u=dd(t),i=ud(u),a=Zt(t),d=o==="y",m=n.x+n.width/2-s.width/2,c=n.y+n.height/2-s.height/2,g=n[i]/2-s[i]/2;let y;switch(a){case"top":y={x:m,y:n.y-s.height};break;case"bottom":y={x:m,y:n.y+n.height};break;case"right":y={x:n.x+n.width,y:c};break;case"left":y={x:n.x-s.width,y:c};break;default:y={x:n.x,y:n.y}}switch(is(t)){case"start":y[u]-=g*(r&&d?-1:1);break;case"end":y[u]+=g*(r&&d?-1:1);break}return y}async function _2(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:o,rects:u,elements:i,strategy:a}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:c="floating",altBoundary:g=!1,padding:y=0}=Qt(t,e),C=r_(y),p=i[g?c==="floating"?"reference":"floating":c],h=Go(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(p)))==null||r?p:p.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(i.floating)),boundary:d,rootBoundary:m,strategy:a})),l=c==="floating"?{x:n,y:s,width:u.floating.width,height:u.floating.height}:u.reference,f=await(o.getOffsetParent==null?void 0:o.getOffsetParent(i.floating)),x=await(o.isElement==null?void 0:o.isElement(f))?await(o.getScale==null?void 0:o.getScale(f))||{x:1,y:1}:{x:1,y:1},E=Go(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:l,offsetParent:f,strategy:a}):l);return{top:(h.top-E.top+C.top)/x.y,bottom:(E.bottom-h.bottom+C.bottom)/x.y,left:(h.left-E.left+C.left)/x.x,right:(E.right-h.right+C.right)/x.x}}const y2=50,x2=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:u}=r,i=u.detectOverflow?u:{...u,detectOverflow:_2},a=await(u.isRTL==null?void 0:u.isRTL(t));let d=await u.getElementRects({reference:e,floating:t,strategy:s}),{x:m,y:c}=Mf(d,n,a),g=n,y=0;const C={};for(let _=0;_<o.length;_++){const p=o[_];if(!p)continue;const{name:h,fn:l}=p,{x:f,y:x,data:E,reset:k}=await l({x:m,y:c,initialPlacement:n,placement:g,strategy:s,middlewareData:C,rects:d,platform:i,elements:{reference:e,floating:t}});m=f??m,c=x??c,C[h]={...C[h],...E},k&&y<y2&&(y++,typeof k=="object"&&(k.placement&&(g=k.placement),k.rects&&(d=k.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:s}):k.rects),{x:m,y:c}=Mf(d,g,a)),_=-1)}return{x:m,y:c,placement:g,strategy:s,middlewareData:C}},w2=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:u,elements:i,middlewareData:a}=t,{element:d,padding:m=0}=Qt(e,t)||{};if(d==null)return{};const c=r_(m),g={x:r,y:n},y=dd(s),C=ud(y),_=await u.getDimensions(d),p=y==="y",h=p?"top":"left",l=p?"bottom":"right",f=p?"clientHeight":"clientWidth",x=o.reference[C]+o.reference[y]-g[y]-o.floating[C],E=g[y]-o.reference[y],k=await(u.getOffsetParent==null?void 0:u.getOffsetParent(d));let b=k?k[f]:0;(!b||!await(u.isElement==null?void 0:u.isElement(k)))&&(b=i.floating[f]||o.floating[C]);const w=x/2-E/2,R=b/2-_[C]/2-1,T=Pr(c[h],R),M=Pr(c[l],R),O=T,A=b-_[C]-M,F=b/2-_[C]/2+w,U=Ic(O,F,A),G=!a.arrow&&is(s)!=null&&F!==U&&o.reference[C]/2-(F<O?T:M)-_[C]/2<0,K=G?F<O?F-O:F-A:0;return{[y]:g[y]+K,data:{[y]:U,centerOffset:F-U-K,...G&&{alignmentOffset:K}},reset:G}}}),S2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:o,rects:u,initialPlacement:i,platform:a,elements:d}=t,{mainAxis:m=!0,crossAxis:c=!0,fallbackPlacements:g,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:_=!0,...p}=Qt(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const h=Zt(s),l=jt(i),f=Zt(i)===i,x=await(a.isRTL==null?void 0:a.isRTL(d.floating)),E=g||(f||!_?[Ko(i)]:h2(i)),k=C!=="none";!g&&k&&E.push(...g2(i,_,C,x));const b=[i,...E],w=await a.detectOverflow(t,p),R=[];let T=((n=o.flip)==null?void 0:n.overflows)||[];if(m&&R.push(w[h]),c){const F=d2(s,u,x);R.push(w[F[0]],w[F[1]])}if(T=[...T,{placement:s,overflows:R}],!R.every(F=>F<=0)){var M,O;const F=(((M=o.flip)==null?void 0:M.index)||0)+1,U=b[F];if(U&&(!(c==="alignment"?l!==jt(U):!1)||T.every(B=>jt(B.placement)===l?B.overflows[0]>0:!0)))return{data:{index:F,overflows:T},reset:{placement:U}};let G=(O=T.filter(K=>K.overflows[0]<=0).sort((K,B)=>K.overflows[1]-B.overflows[1])[0])==null?void 0:O.placement;if(!G)switch(y){case"bestFit":{var A;const K=(A=T.filter(B=>{if(k){const P=jt(B.placement);return P===l||P==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(P=>P>0).reduce((P,N)=>P+N,0)]).sort((B,P)=>B[1]-P[1])[0])==null?void 0:A[0];K&&(G=K);break}case"initialPlacement":G=i;break}if(s!==G)return{reset:{placement:G}}}return{}}}};function jf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function If(e){return c2.some(t=>e[t]>=0)}const b2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:s="referenceHidden",...o}=Qt(e,t);switch(s){case"referenceHidden":{const u=await n.detectOverflow(t,{...o,elementContext:"reference"}),i=jf(u,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:If(i)}}}case"escaped":{const u=await n.detectOverflow(t,{...o,altBoundary:!0}),i=jf(u,r.floating);return{data:{escapedOffsets:i,escaped:If(i)}}}default:return{}}}}},n_=new Set(["left","top"]);async function C2(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),u=Zt(r),i=is(r),a=jt(r)==="y",d=n_.has(u)?-1:1,m=o&&a?-1:1,c=Qt(t,e);let{mainAxis:g,crossAxis:y,alignmentAxis:C}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return i&&typeof C=="number"&&(y=i==="end"?C*-1:C),a?{x:y*m,y:g*d}:{x:g*d,y:y*m}}const k2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:u,middlewareData:i}=t,a=await C2(t,e);return u===((r=i.offset)==null?void 0:r.placement)&&(n=i.arrow)!=null&&n.alignmentOffset?{}:{x:s+a.x,y:o+a.y,data:{...a,placement:u}}}}},E2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:s,platform:o}=t,{mainAxis:u=!0,crossAxis:i=!1,limiter:a={fn:h=>{let{x:l,y:f}=h;return{x:l,y:f}}},...d}=Qt(e,t),m={x:r,y:n},c=await o.detectOverflow(t,d),g=jt(Zt(s)),y=cd(g);let C=m[y],_=m[g];if(u){const h=y==="y"?"top":"left",l=y==="y"?"bottom":"right",f=C+c[h],x=C-c[l];C=Ic(f,C,x)}if(i){const h=g==="y"?"top":"left",l=g==="y"?"bottom":"right",f=_+c[h],x=_-c[l];_=Ic(f,_,x)}const p=a.fn({...t,[y]:C,[g]:_});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[y]:u,[g]:i}}}}}},R2=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:u}=t,{offset:i=0,mainAxis:a=!0,crossAxis:d=!0}=Qt(e,t),m={x:r,y:n},c=jt(s),g=cd(c);let y=m[g],C=m[c];const _=Qt(i,t),p=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(a){const f=g==="y"?"height":"width",x=o.reference[g]-o.floating[f]+p.mainAxis,E=o.reference[g]+o.reference[f]-p.mainAxis;y<x?y=x:y>E&&(y=E)}if(d){var h,l;const f=g==="y"?"width":"height",x=n_.has(Zt(s)),E=o.reference[c]-o.floating[f]+(x&&((h=u.offset)==null?void 0:h[c])||0)+(x?0:p.crossAxis),k=o.reference[c]+o.reference[f]+(x?0:((l=u.offset)==null?void 0:l[c])||0)-(x?p.crossAxis:0);C<E?C=E:C>k&&(C=k)}return{[g]:y,[c]:C}}}},P2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:o,platform:u,elements:i}=t,{apply:a=()=>{},...d}=Qt(e,t),m=await u.detectOverflow(t,d),c=Zt(s),g=is(s),y=jt(s)==="y",{width:C,height:_}=o.floating;let p,h;c==="top"||c==="bottom"?(p=c,h=g===(await(u.isRTL==null?void 0:u.isRTL(i.floating))?"start":"end")?"left":"right"):(h=c,p=g==="end"?"top":"bottom");const l=_-m.top-m.bottom,f=C-m.left-m.right,x=Pr(_-m[p],l),E=Pr(C-m[h],f),k=!t.middlewareData.shift;let b=x,w=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(w=f),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(b=l),k&&!g){const T=tt(m.left,0),M=tt(m.right,0),O=tt(m.top,0),A=tt(m.bottom,0);y?w=C-2*(T!==0||M!==0?T+M:tt(m.left,m.right)):b=_-2*(O!==0||A!==0?O+A:tt(m.top,m.bottom))}await a({...t,availableWidth:w,availableHeight:b});const R=await u.getDimensions(i.floating);return C!==R.width||_!==R.height?{reset:{rects:!0}}:{}}}};function Ra(){return typeof window<"u"}function os(e){return s_(e)?(e.nodeName||"").toLowerCase():"#document"}function it(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ht(e){var t;return(t=(s_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function s_(e){return Ra()?e instanceof Node||e instanceof it(e).Node:!1}function Rt(e){return Ra()?e instanceof Element||e instanceof it(e).Element:!1}function tr(e){return Ra()?e instanceof HTMLElement||e instanceof it(e).HTMLElement:!1}function Of(e){return!Ra()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof it(e).ShadowRoot}function yi(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=Pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&s!=="inline"&&s!=="contents"}function T2(e){return/^(table|td|th)$/.test(os(e))}function Pa(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const N2=/transform|translate|scale|rotate|perspective|filter/,L2=/paint|layout|strict|content/,Hr=e=>!!e&&e!=="none";let Ll;function hd(e){const t=Rt(e)?Pt(e):e;return Hr(t.transform)||Hr(t.translate)||Hr(t.scale)||Hr(t.rotate)||Hr(t.perspective)||!fd()&&(Hr(t.backdropFilter)||Hr(t.filter))||N2.test(t.willChange||"")||L2.test(t.contain||"")}function A2(e){let t=Tr(e);for(;tr(t)&&!Xn(t);){if(hd(t))return t;if(Pa(t))return null;t=Tr(t)}return null}function fd(){return Ll==null&&(Ll=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ll}function Xn(e){return/^(html|body|#document)$/.test(os(e))}function Pt(e){return it(e).getComputedStyle(e)}function Ta(e){return Rt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Tr(e){if(os(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Of(e)&&e.host||Ht(e);return Of(t)?t.host:t}function i_(e){const t=Tr(e);return Xn(t)?e.ownerDocument?e.ownerDocument.body:e.body:tr(t)&&yi(t)?t:i_(t)}function ni(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=i_(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),u=it(s);if(o){const i=Bc(u);return t.concat(u,u.visualViewport||[],yi(s)?s:[],i&&r?ni(i):[])}else return t.concat(s,ni(s,[],r))}function Bc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function o_(e){const t=Pt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=tr(e),o=s?e.offsetWidth:r,u=s?e.offsetHeight:n,i=Vo(r)!==o||Vo(n)!==u;return i&&(r=o,n=u),{width:r,height:n,$:i}}function pd(e){return Rt(e)?e:e.contextElement}function $n(e){const t=pd(e);if(!tr(t))return Bt(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=o_(t);let u=(o?Vo(r.width):r.width)/n,i=(o?Vo(r.height):r.height)/s;return(!u||!Number.isFinite(u))&&(u=1),(!i||!Number.isFinite(i))&&(i=1),{x:u,y:i}}const D2=Bt(0);function a_(e){const t=it(e);return!fd()||!t.visualViewport?D2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function M2(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==it(e)?!1:t}function an(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=pd(e);let u=Bt(1);t&&(n?Rt(n)&&(u=$n(n)):u=$n(e));const i=M2(o,r,n)?a_(o):Bt(0);let a=(s.left+i.x)/u.x,d=(s.top+i.y)/u.y,m=s.width/u.x,c=s.height/u.y;if(o){const g=it(o),y=n&&Rt(n)?it(n):n;let C=g,_=Bc(C);for(;_&&n&&y!==C;){const p=$n(_),h=_.getBoundingClientRect(),l=Pt(_),f=h.left+(_.clientLeft+parseFloat(l.paddingLeft))*p.x,x=h.top+(_.clientTop+parseFloat(l.paddingTop))*p.y;a*=p.x,d*=p.y,m*=p.x,c*=p.y,a+=f,d+=x,C=it(_),_=Bc(C)}}return Go({width:m,height:c,x:a,y:d})}function Na(e,t){const r=Ta(e).scrollLeft;return t?t.left+r:an(Ht(e)).left+r}function l_(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Na(e,r),s=r.top+t.scrollTop;return{x:n,y:s}}function j2(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",u=Ht(n),i=t?Pa(t.floating):!1;if(n===u||i&&o)return r;let a={scrollLeft:0,scrollTop:0},d=Bt(1);const m=Bt(0),c=tr(n);if((c||!c&&!o)&&((os(n)!=="body"||yi(u))&&(a=Ta(n)),c)){const y=an(n);d=$n(n),m.x=y.x+n.clientLeft,m.y=y.y+n.clientTop}const g=u&&!c&&!o?l_(u,a):Bt(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-a.scrollLeft*d.x+m.x+g.x,y:r.y*d.y-a.scrollTop*d.y+m.y+g.y}}function I2(e){return Array.from(e.getClientRects())}function O2(e){const t=Ht(e),r=Ta(e),n=e.ownerDocument.body,s=tt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=tt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let u=-r.scrollLeft+Na(e);const i=-r.scrollTop;return Pt(n).direction==="rtl"&&(u+=tt(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:u,y:i}}const Bf=25;function B2(e,t){const r=it(e),n=Ht(e),s=r.visualViewport;let o=n.clientWidth,u=n.clientHeight,i=0,a=0;if(s){o=s.width,u=s.height;const m=fd();(!m||m&&t==="fixed")&&(i=s.offsetLeft,a=s.offsetTop)}const d=Na(n);if(d<=0){const m=n.ownerDocument,c=m.body,g=getComputedStyle(c),y=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,C=Math.abs(n.clientWidth-c.clientWidth-y);C<=Bf&&(o-=C)}else d<=Bf&&(o+=d);return{width:o,height:u,x:i,y:a}}function F2(e,t){const r=an(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=tr(e)?$n(e):Bt(1),u=e.clientWidth*o.x,i=e.clientHeight*o.y,a=s*o.x,d=n*o.y;return{width:u,height:i,x:a,y:d}}function Ff(e,t,r){let n;if(t==="viewport")n=B2(e,r);else if(t==="document")n=O2(Ht(e));else if(Rt(t))n=F2(t,r);else{const s=a_(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Go(n)}function c_(e,t){const r=Tr(e);return r===t||!Rt(r)||Xn(r)?!1:Pt(r).position==="fixed"||c_(r,t)}function $2(e,t){const r=t.get(e);if(r)return r;let n=ni(e,[],!1).filter(i=>Rt(i)&&os(i)!=="body"),s=null;const o=Pt(e).position==="fixed";let u=o?Tr(e):e;for(;Rt(u)&&!Xn(u);){const i=Pt(u),a=hd(u);!a&&i.position==="fixed"&&(s=null),(o?!a&&!s:!a&&i.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||yi(u)&&!a&&c_(e,u))?n=n.filter(m=>m!==u):s=i,u=Tr(u)}return t.set(e,n),n}function H2(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const u=[...r==="clippingAncestors"?Pa(t)?[]:$2(t,this._c):[].concat(r),n],i=Ff(t,u[0],s);let a=i.top,d=i.right,m=i.bottom,c=i.left;for(let g=1;g<u.length;g++){const y=Ff(t,u[g],s);a=tt(y.top,a),d=Pr(y.right,d),m=Pr(y.bottom,m),c=tt(y.left,c)}return{width:d-c,height:m-a,x:c,y:a}}function z2(e){const{width:t,height:r}=o_(e);return{width:t,height:r}}function W2(e,t,r){const n=tr(t),s=Ht(t),o=r==="fixed",u=an(e,!0,o,t);let i={scrollLeft:0,scrollTop:0};const a=Bt(0);function d(){a.x=Na(s)}if(n||!n&&!o)if((os(t)!=="body"||yi(s))&&(i=Ta(t)),n){const y=an(t,!0,o,t);a.x=y.x+t.clientLeft,a.y=y.y+t.clientTop}else s&&d();o&&!n&&s&&d();const m=s&&!n&&!o?l_(s,i):Bt(0),c=u.left+i.scrollLeft-a.x-m.x,g=u.top+i.scrollTop-a.y-m.y;return{x:c,y:g,width:u.width,height:u.height}}function Al(e){return Pt(e).position==="static"}function $f(e,t){if(!tr(e)||Pt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ht(e)===r&&(r=r.ownerDocument.body),r}function u_(e,t){const r=it(e);if(Pa(e))return r;if(!tr(e)){let s=Tr(e);for(;s&&!Xn(s);){if(Rt(s)&&!Al(s))return s;s=Tr(s)}return r}let n=$f(e,t);for(;n&&T2(n)&&Al(n);)n=$f(n,t);return n&&Xn(n)&&Al(n)&&!hd(n)?r:n||A2(e)||r}const U2=async function(e){const t=this.getOffsetParent||u_,r=this.getDimensions,n=await r(e.floating);return{reference:W2(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function V2(e){return Pt(e).direction==="rtl"}const K2={convertOffsetParentRelativeRectToViewportRelativeRect:j2,getDocumentElement:Ht,getClippingRect:H2,getOffsetParent:u_,getElementRects:U2,getClientRects:I2,getDimensions:z2,getScale:$n,isElement:Rt,isRTL:V2};function d_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function G2(e,t){let r=null,n;const s=Ht(e);function o(){var i;clearTimeout(n),(i=r)==null||i.disconnect(),r=null}function u(i,a){i===void 0&&(i=!1),a===void 0&&(a=1),o();const d=e.getBoundingClientRect(),{left:m,top:c,width:g,height:y}=d;if(i||t(),!g||!y)return;const C=Yi(c),_=Yi(s.clientWidth-(m+g)),p=Yi(s.clientHeight-(c+y)),h=Yi(m),f={rootMargin:-C+"px "+-_+"px "+-p+"px "+-h+"px",threshold:tt(0,Pr(1,a))||1};let x=!0;function E(k){const b=k[0].intersectionRatio;if(b!==a){if(!x)return u();b?u(!1,b):n=setTimeout(()=>{u(!1,1e-7)},1e3)}b===1&&!d_(d,e.getBoundingClientRect())&&u(),x=!1}try{r=new IntersectionObserver(E,{...f,root:s.ownerDocument})}catch{r=new IntersectionObserver(E,f)}r.observe(e)}return u(!0),o}function q2(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:a=!1}=n,d=pd(e),m=s||o?[...d?ni(d):[],...t?ni(t):[]]:[];m.forEach(h=>{s&&h.addEventListener("scroll",r,{passive:!0}),o&&h.addEventListener("resize",r)});const c=d&&i?G2(d,r):null;let g=-1,y=null;u&&(y=new ResizeObserver(h=>{let[l]=h;l&&l.target===d&&y&&t&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var f;(f=y)==null||f.observe(t)})),r()}),d&&!a&&y.observe(d),t&&y.observe(t));let C,_=a?an(e):null;a&&p();function p(){const h=an(e);_&&!d_(_,h)&&r(),_=h,C=requestAnimationFrame(p)}return r(),()=>{var h;m.forEach(l=>{s&&l.removeEventListener("scroll",r),o&&l.removeEventListener("resize",r)}),c==null||c(),(h=y)==null||h.disconnect(),y=null,a&&cancelAnimationFrame(C)}}const X2=k2,Y2=E2,J2=S2,Q2=P2,Z2=b2,Hf=w2,eR=R2,tR=(e,t,r)=>{const n=new Map,s={platform:K2,...r},o={...s.platform,_c:n};return x2(e,t,{...s,platform:o})};var rR=typeof document<"u",nR=function(){},go=rR?S.useLayoutEffect:nR;function qo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!qo(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!qo(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function h_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zf(e,t){const r=h_(e);return Math.round(t*r)/r}function Dl(e){const t=S.useRef(e);return go(()=>{t.current=e}),t}function sR(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:u}={},transform:i=!0,whileElementsMounted:a,open:d}=e,[m,c]=S.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[g,y]=S.useState(n);qo(g,n)||y(n);const[C,_]=S.useState(null),[p,h]=S.useState(null),l=S.useCallback(B=>{B!==k.current&&(k.current=B,_(B))},[]),f=S.useCallback(B=>{B!==b.current&&(b.current=B,h(B))},[]),x=o||C,E=u||p,k=S.useRef(null),b=S.useRef(null),w=S.useRef(m),R=a!=null,T=Dl(a),M=Dl(s),O=Dl(d),A=S.useCallback(()=>{if(!k.current||!b.current)return;const B={placement:t,strategy:r,middleware:g};M.current&&(B.platform=M.current),tR(k.current,b.current,B).then(P=>{const N={...P,isPositioned:O.current!==!1};F.current&&!qo(w.current,N)&&(w.current=N,ts.flushSync(()=>{c(N)}))})},[g,t,r,M,O]);go(()=>{d===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,c(B=>({...B,isPositioned:!1})))},[d]);const F=S.useRef(!1);go(()=>(F.current=!0,()=>{F.current=!1}),[]),go(()=>{if(x&&(k.current=x),E&&(b.current=E),x&&E){if(T.current)return T.current(x,E,A);A()}},[x,E,A,T,R]);const U=S.useMemo(()=>({reference:k,floating:b,setReference:l,setFloating:f}),[l,f]),G=S.useMemo(()=>({reference:x,floating:E}),[x,E]),K=S.useMemo(()=>{const B={position:r,left:0,top:0};if(!G.floating)return B;const P=zf(G.floating,m.x),N=zf(G.floating,m.y);return i?{...B,transform:"translate("+P+"px, "+N+"px)",...h_(G.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:P,top:N}},[r,i,G.floating,m.x,m.y]);return S.useMemo(()=>({...m,update:A,refs:U,elements:G,floatingStyles:K}),[m,A,U,G,K])}const iR=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Hf({element:n.current,padding:s}).fn(r):{}:n?Hf({element:n,padding:s}).fn(r):{}}}},oR=(e,t)=>{const r=X2(e);return{name:r.name,fn:r.fn,options:[e,t]}},aR=(e,t)=>{const r=Y2(e);return{name:r.name,fn:r.fn,options:[e,t]}},lR=(e,t)=>({fn:eR(e).fn,options:[e,t]}),cR=(e,t)=>{const r=J2(e);return{name:r.name,fn:r.fn,options:[e,t]}},uR=(e,t)=>{const r=Q2(e);return{name:r.name,fn:r.fn,options:[e,t]}},dR=(e,t)=>{const r=Z2(e);return{name:r.name,fn:r.fn,options:[e,t]}},hR=(e,t)=>{const r=iR(e);return{name:r.name,fn:r.fn,options:[e,t]}};var fR="Arrow",f_=S.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return v.jsx(ie.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});f_.displayName=fR;var pR=f_,p_="Popper",[m_,jr]=_t(p_),[vA,g_]=m_(p_),v_="PopperAnchor",__=S.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=g_(v_,r),u=S.useRef(null),i=ce(t,u),a=S.useRef(null);return S.useEffect(()=>{const d=a.current;a.current=(n==null?void 0:n.current)||u.current,d!==a.current&&o.onAnchorChange(a.current)}),n?null:v.jsx(ie.div,{...s,ref:i})});__.displayName=v_;var md="PopperContent",[mR,gR]=m_(md),y_=S.forwardRef((e,t)=>{var I,L,z,H,Y,X;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:u=0,arrowPadding:i=0,avoidCollisions:a=!0,collisionBoundary:d=[],collisionPadding:m=0,sticky:c="partial",hideWhenDetached:g=!1,updatePositionStrategy:y="optimized",onPlaced:C,..._}=e,p=g_(md,r),[h,l]=S.useState(null),f=ce(t,ne=>l(ne)),[x,E]=S.useState(null),k=td(x),b=(k==null?void 0:k.width)??0,w=(k==null?void 0:k.height)??0,R=n+(o!=="center"?"-"+o:""),T=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},M=Array.isArray(d)?d:[d],O=M.length>0,A={padding:T,boundary:M.filter(_R),altBoundary:O},{refs:F,floatingStyles:U,placement:G,isPositioned:K,middlewareData:B}=sR({strategy:"fixed",placement:R,whileElementsMounted:(...ne)=>q2(...ne,{animationFrame:y==="always"}),elements:{reference:p.anchor},middleware:[oR({mainAxis:s+w,alignmentAxis:u}),a&&aR({mainAxis:!0,crossAxis:!1,limiter:c==="partial"?lR():void 0,...A}),a&&cR({...A}),uR({...A,apply:({elements:ne,rects:oe,availableWidth:he,availableHeight:Ce})=>{const{width:se,height:Fr}=oe.reference,rr=ne.floating.style;rr.setProperty("--radix-popper-available-width",`${he}px`),rr.setProperty("--radix-popper-available-height",`${Ce}px`),rr.setProperty("--radix-popper-anchor-width",`${se}px`),rr.setProperty("--radix-popper-anchor-height",`${Fr}px`)}}),x&&hR({element:x,padding:i}),yR({arrowWidth:b,arrowHeight:w}),g&&dR({strategy:"referenceHidden",...A})]}),[P,N]=S_(G),j=Ft(C);Ne(()=>{K&&(j==null||j())},[K,j]);const D=(I=B.arrow)==null?void 0:I.x,W=(L=B.arrow)==null?void 0:L.y,$=((z=B.arrow)==null?void 0:z.centerOffset)!==0,[V,q]=S.useState();return Ne(()=>{h&&q(window.getComputedStyle(h).zIndex)},[h]),v.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:K?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:V,"--radix-popper-transform-origin":[(H=B.transformOrigin)==null?void 0:H.x,(Y=B.transformOrigin)==null?void 0:Y.y].join(" "),...((X=B.hide)==null?void 0:X.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(mR,{scope:r,placedSide:P,onArrowChange:E,arrowX:D,arrowY:W,shouldHideArrow:$,children:v.jsx(ie.div,{"data-side":P,"data-align":N,..._,ref:f,style:{..._.style,animation:K?void 0:"none"}})})})});y_.displayName=md;var x_="PopperArrow",vR={top:"bottom",right:"left",bottom:"top",left:"right"},w_=S.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=gR(x_,n),u=vR[o.placedSide];return v.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:v.jsx(pR,{...s,ref:r,style:{...s.style,display:"block"}})})});w_.displayName=x_;function _R(e){return e!==null}var yR=e=>({name:"transformOrigin",options:e,fn(t){var p,h,l;const{placement:r,rects:n,middlewareData:s}=t,u=((p=s.arrow)==null?void 0:p.centerOffset)!==0,i=u?0:e.arrowWidth,a=u?0:e.arrowHeight,[d,m]=S_(r),c={start:"0%",center:"50%",end:"100%"}[m],g=(((h=s.arrow)==null?void 0:h.x)??0)+i/2,y=(((l=s.arrow)==null?void 0:l.y)??0)+a/2;let C="",_="";return d==="bottom"?(C=u?c:`${g}px`,_=`${-a}px`):d==="top"?(C=u?c:`${g}px`,_=`${n.floating.height+a}px`):d==="right"?(C=`${-a}px`,_=u?c:`${y}px`):d==="left"&&(C=`${n.floating.width+a}px`,_=u?c:`${y}px`),{data:{x:C,y:_}}}});function S_(e){const[t,r="center"]=e.split("-");return[t,r]}var xi=__,La=y_,Aa=w_,b_="Popover",[C_]=_t(b_,[jr]),Da=jr(),[_A,Ir]=C_(b_),k_="PopoverAnchor",xR=S.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Ir(k_,r),o=Da(r),{onCustomAnchorAdd:u,onCustomAnchorRemove:i}=s;return S.useEffect(()=>(u(),()=>i()),[u,i]),v.jsx(xi,{...o,...n,ref:t})});xR.displayName=k_;var E_="PopoverTrigger",wR=S.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Ir(E_,r),o=Da(r),u=ce(t,s.triggerRef),i=v.jsx(ie.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":L_(s.open),...n,ref:u,onClick:Q(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?i:v.jsx(xi,{asChild:!0,...o,children:i})});wR.displayName=E_;var gd="PopoverPortal",[SR,bR]=C_(gd,{forceMount:void 0}),R_=e=>{const{__scopePopover:t,forceMount:r,children:n,container:s}=e,o=Ir(gd,t);return v.jsx(SR,{scope:t,forceMount:r,children:v.jsx(Je,{present:r||o.open,children:v.jsx(ss,{asChild:!0,container:s,children:n})})})};R_.displayName=gd;var Yn="PopoverContent",P_=S.forwardRef((e,t)=>{const r=bR(Yn,e.__scopePopover),{forceMount:n=r.forceMount,...s}=e,o=Ir(Yn,e.__scopePopover);return v.jsx(Je,{present:n||o.open,children:o.modal?v.jsx(kR,{...s,ref:t}):v.jsx(ER,{...s,ref:t})})});P_.displayName=Yn;var CR=nn("PopoverContent.RemoveScroll"),kR=S.forwardRef((e,t)=>{const r=Ir(Yn,e.__scopePopover),n=S.useRef(null),s=ce(t,n),o=S.useRef(!1);return S.useEffect(()=>{const u=n.current;if(u)return Sa(u)},[]),v.jsx(mi,{as:CR,allowPinchZoom:!0,children:v.jsx(T_,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Q(e.onCloseAutoFocus,u=>{var i;u.preventDefault(),o.current||(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:Q(e.onPointerDownOutside,u=>{const i=u.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0,d=i.button===2||a;o.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Q(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1})})})}),ER=S.forwardRef((e,t)=>{const r=Ir(Yn,e.__scopePopover),n=S.useRef(!1),s=S.useRef(!1);return v.jsx(T_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,i;(u=e.onCloseAutoFocus)==null||u.call(e,o),o.defaultPrevented||(n.current||(i=r.triggerRef.current)==null||i.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var a,d;(a=e.onInteractOutside)==null||a.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const u=o.target;((d=r.triggerRef.current)==null?void 0:d.contains(u))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),T_=S.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:u,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:d,onInteractOutside:m,...c}=e,g=Ir(Yn,r),y=Da(r);return xa(),v.jsx(pi,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:v.jsx(ns,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:d,onDismiss:()=>g.onOpenChange(!1),children:v.jsx(La,{"data-state":L_(g.open),role:"dialog",id:g.contentId,...y,...c,ref:t,style:{...c.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),N_="PopoverClose",RR=S.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Ir(N_,r);return v.jsx(ie.button,{type:"button",...n,ref:t,onClick:Q(e.onClick,()=>s.onOpenChange(!1))})});RR.displayName=N_;var PR="PopoverArrow",TR=S.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,s=Da(r);return v.jsx(Aa,{...s,...n,ref:t})});TR.displayName=PR;function L_(e){return e?"open":"closed"}var NR=R_,A_=P_;const LR=S.forwardRef(({className:e,align:t="start",sideOffset:r=4,...n},s)=>v.jsx(NR,{children:v.jsx(A_,{ref:s,align:t,sideOffset:r,className:re("z-50 w-[var(--radix-popover-trigger-width)] rounded-md border bg-popover p-0 text-popover-foreground shadow-md outline-none 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",e),...n})}));LR.displayName=A_.displayName;const AR=ad,D_=S.forwardRef(({className:e,...t},r)=>v.jsx(gi,{ref:r,className:re("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));D_.displayName=gi.displayName;const DR=S.forwardRef(({className:e,children:t,...r},n)=>v.jsxs(AR,{children:[v.jsx(D_,{}),v.jsxs(vi,{ref:n,className:re("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,v.jsxs(qv,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[v.jsx(uv,{className:"h-4 w-4"}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));DR.displayName=vi.displayName;const MR=S.forwardRef(({className:e,...t},r)=>v.jsx(Ca,{ref:r,className:re("text-lg font-semibold leading-none tracking-tight",e),...t}));MR.displayName=Ca.displayName;const jR=S.forwardRef(({className:e,...t},r)=>v.jsx(ka,{ref:r,className:re("text-sm text-muted-foreground",e),...t}));jR.displayName=ka.displayName;function vd(e){const t=e+"CollectionProvider",[r,n]=_t(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),u=_=>{const{scope:p,children:h}=_,l=Ve.useRef(null),f=Ve.useRef(new Map).current;return v.jsx(s,{scope:p,itemMap:f,collectionRef:l,children:h})};u.displayName=t;const i=e+"CollectionSlot",a=nn(i),d=Ve.forwardRef((_,p)=>{const{scope:h,children:l}=_,f=o(i,h),x=ce(p,f.collectionRef);return v.jsx(a,{ref:x,children:l})});d.displayName=i;const m=e+"CollectionItemSlot",c="data-radix-collection-item",g=nn(m),y=Ve.forwardRef((_,p)=>{const{scope:h,children:l,...f}=_,x=Ve.useRef(null),E=ce(p,x),k=o(m,h);return Ve.useEffect(()=>(k.itemMap.set(x,{ref:x,...f}),()=>void k.itemMap.delete(x))),v.jsx(g,{[c]:"",ref:E,children:l})});y.displayName=m;function C(_){const p=o(e+"CollectionConsumer",_);return Ve.useCallback(()=>{const l=p.collectionRef.current;if(!l)return[];const f=Array.from(l.querySelectorAll(`[${c}]`));return Array.from(p.itemMap.values()).sort((k,b)=>f.indexOf(k.ref.current)-f.indexOf(b.ref.current))},[p.collectionRef,p.itemMap])}return[{Provider:u,Slot:d,ItemSlot:y},C,n]}var IR=S.createContext(void 0);function M_(e){const t=S.useContext(IR);return e||t||"ltr"}var Ml="rovingFocusGroup.onEntryFocus",OR={bubbles:!1,cancelable:!0},wi="RovingFocusGroup",[Fc,j_,BR]=vd(wi),[FR,Ma]=_t(wi,[BR]),[$R,HR]=FR(wi),I_=S.forwardRef((e,t)=>v.jsx(Fc.Provider,{scope:e.__scopeRovingFocusGroup,children:v.jsx(Fc.Slot,{scope:e.__scopeRovingFocusGroup,children:v.jsx(zR,{...e,ref:t})})}));I_.displayName=wi;var zR=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:o,currentTabStopId:u,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:a,onEntryFocus:d,preventScrollOnEntryFocus:m=!1,...c}=e,g=S.useRef(null),y=ce(t,g),C=M_(o),[_,p]=fi({prop:u,defaultProp:i??null,onChange:a,caller:wi}),[h,l]=S.useState(!1),f=Ft(d),x=j_(r),E=S.useRef(!1),[k,b]=S.useState(0);return S.useEffect(()=>{const w=g.current;if(w)return w.addEventListener(Ml,f),()=>w.removeEventListener(Ml,f)},[f]),v.jsx($R,{scope:r,orientation:n,dir:C,loop:s,currentTabStopId:_,onItemFocus:S.useCallback(w=>p(w),[p]),onItemShiftTab:S.useCallback(()=>l(!0),[]),onFocusableItemAdd:S.useCallback(()=>b(w=>w+1),[]),onFocusableItemRemove:S.useCallback(()=>b(w=>w-1),[]),children:v.jsx(ie.div,{tabIndex:h||k===0?-1:0,"data-orientation":n,...c,ref:y,style:{outline:"none",...e.style},onMouseDown:Q(e.onMouseDown,()=>{E.current=!0}),onFocus:Q(e.onFocus,w=>{const R=!E.current;if(w.target===w.currentTarget&&R&&!h){const T=new CustomEvent(Ml,OR);if(w.currentTarget.dispatchEvent(T),!T.defaultPrevented){const M=x().filter(G=>G.focusable),O=M.find(G=>G.active),A=M.find(G=>G.id===_),U=[O,A,...M].filter(Boolean).map(G=>G.ref.current);F_(U,m)}}E.current=!1}),onBlur:Q(e.onBlur,()=>l(!1))})})}),O_="RovingFocusGroupItem",B_=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:o,children:u,...i}=e,a=st(),d=o||a,m=HR(O_,r),c=m.currentTabStopId===d,g=j_(r),{onFocusableItemAdd:y,onFocusableItemRemove:C,currentTabStopId:_}=m;return S.useEffect(()=>{if(n)return y(),()=>C()},[n,y,C]),v.jsx(Fc.ItemSlot,{scope:r,id:d,focusable:n,active:s,children:v.jsx(ie.span,{tabIndex:c?0:-1,"data-orientation":m.orientation,...i,ref:t,onMouseDown:Q(e.onMouseDown,p=>{n?m.onItemFocus(d):p.preventDefault()}),onFocus:Q(e.onFocus,()=>m.onItemFocus(d)),onKeyDown:Q(e.onKeyDown,p=>{if(p.key==="Tab"&&p.shiftKey){m.onItemShiftTab();return}if(p.target!==p.currentTarget)return;const h=VR(p,m.orientation,m.dir);if(h!==void 0){if(p.metaKey||p.ctrlKey||p.altKey||p.shiftKey)return;p.preventDefault();let f=g().filter(x=>x.focusable).map(x=>x.ref.current);if(h==="last")f.reverse();else if(h==="prev"||h==="next"){h==="prev"&&f.reverse();const x=f.indexOf(p.currentTarget);f=m.loop?KR(f,x+1):f.slice(x+1)}setTimeout(()=>F_(f))}}),children:typeof u=="function"?u({isCurrentTabStop:c,hasTabStop:_!=null}):u})})});B_.displayName=O_;var WR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function UR(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function VR(e,t,r){const n=UR(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return WR[n]}function F_(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function KR(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var $_=I_,H_=B_,$c=["Enter"," "],GR=["ArrowDown","PageUp","Home"],z_=["ArrowUp","PageDown","End"],qR=[...GR,...z_],XR={ltr:[...$c,"ArrowRight"],rtl:[...$c,"ArrowLeft"]},YR={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ja="Menu",[si,JR,QR]=vd(ja),[hn,W_]=_t(ja,[QR,jr,Ma]),_d=jr(),U_=Ma(),[yA,fn]=hn(ja),[xA,Si]=hn(ja),ZR="MenuAnchor",yd=S.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=_d(r);return v.jsx(xi,{...s,...n,ref:t})});yd.displayName=ZR;var xd="MenuPortal",[eP,V_]=hn(xd,{forceMount:void 0}),K_=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:s}=e,o=fn(xd,t);return v.jsx(eP,{scope:t,forceMount:r,children:v.jsx(Je,{present:r||o.open,children:v.jsx(ss,{asChild:!0,container:s,children:n})})})};K_.displayName=xd;var mt="MenuContent",[tP,wd]=hn(mt),G_=S.forwardRef((e,t)=>{const r=V_(mt,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=fn(mt,e.__scopeMenu),u=Si(mt,e.__scopeMenu);return v.jsx(si.Provider,{scope:e.__scopeMenu,children:v.jsx(Je,{present:n||o.open,children:v.jsx(si.Slot,{scope:e.__scopeMenu,children:u.modal?v.jsx(rP,{...s,ref:t}):v.jsx(nP,{...s,ref:t})})})})}),rP=S.forwardRef((e,t)=>{const r=fn(mt,e.__scopeMenu),n=S.useRef(null),s=ce(t,n);return S.useEffect(()=>{const o=n.current;if(o)return Sa(o)},[]),v.jsx(Sd,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Q(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),nP=S.forwardRef((e,t)=>{const r=fn(mt,e.__scopeMenu);return v.jsx(Sd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),sP=nn("MenuContent.ScrollLock"),Sd=S.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:u,disableOutsidePointerEvents:i,onEntryFocus:a,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:c,onInteractOutside:g,onDismiss:y,disableOutsideScroll:C,..._}=e,p=fn(mt,r),h=Si(mt,r),l=_d(r),f=U_(r),x=JR(r),[E,k]=S.useState(null),b=S.useRef(null),w=ce(t,b,p.onContentChange),R=S.useRef(0),T=S.useRef(""),M=S.useRef(0),O=S.useRef(null),A=S.useRef("right"),F=S.useRef(0),U=C?mi:S.Fragment,G=C?{as:sP,allowPinchZoom:!0}:void 0,K=P=>{var I,L;const N=T.current+P,j=x().filter(z=>!z.disabled),D=document.activeElement,W=(I=j.find(z=>z.ref.current===D))==null?void 0:I.textValue,$=j.map(z=>z.textValue),V=gP($,N,W),q=(L=j.find(z=>z.textValue===V))==null?void 0:L.ref.current;(function z(H){T.current=H,window.clearTimeout(R.current),H!==""&&(R.current=window.setTimeout(()=>z(""),1e3))})(N),q&&setTimeout(()=>q.focus())};S.useEffect(()=>()=>window.clearTimeout(R.current),[]),xa();const B=S.useCallback(P=>{var j,D;return A.current===((j=O.current)==null?void 0:j.side)&&_P(P,(D=O.current)==null?void 0:D.area)},[]);return v.jsx(tP,{scope:r,searchRef:T,onItemEnter:S.useCallback(P=>{B(P)&&P.preventDefault()},[B]),onItemLeave:S.useCallback(P=>{var N;B(P)||((N=b.current)==null||N.focus(),k(null))},[B]),onTriggerLeave:S.useCallback(P=>{B(P)&&P.preventDefault()},[B]),pointerGraceTimerRef:M,onPointerGraceIntentChange:S.useCallback(P=>{O.current=P},[]),children:v.jsx(U,{...G,children:v.jsx(pi,{asChild:!0,trapped:s,onMountAutoFocus:Q(o,P=>{var N;P.preventDefault(),(N=b.current)==null||N.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:v.jsx(ns,{asChild:!0,disableOutsidePointerEvents:i,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:c,onInteractOutside:g,onDismiss:y,children:v.jsx($_,{asChild:!0,...f,dir:h.dir,orientation:"vertical",loop:n,currentTabStopId:E,onCurrentTabStopIdChange:k,onEntryFocus:Q(a,P=>{h.isUsingKeyboardRef.current||P.preventDefault()}),preventScrollOnEntryFocus:!0,children:v.jsx(La,{role:"menu","aria-orientation":"vertical","data-state":c0(p.open),"data-radix-menu-content":"",dir:h.dir,...l,..._,ref:w,style:{outline:"none",..._.style},onKeyDown:Q(_.onKeyDown,P=>{const j=P.target.closest("[data-radix-menu-content]")===P.currentTarget,D=P.ctrlKey||P.altKey||P.metaKey,W=P.key.length===1;j&&(P.key==="Tab"&&P.preventDefault(),!D&&W&&K(P.key));const $=b.current;if(P.target!==$||!qR.includes(P.key))return;P.preventDefault();const q=x().filter(I=>!I.disabled).map(I=>I.ref.current);z_.includes(P.key)&&q.reverse(),pP(q)}),onBlur:Q(e.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(R.current),T.current="")}),onPointerMove:Q(e.onPointerMove,ii(P=>{const N=P.target,j=F.current!==P.clientX;if(P.currentTarget.contains(N)&&j){const D=P.clientX>F.current?"right":"left";A.current=D,F.current=P.clientX}}))})})})})})})});G_.displayName=mt;var iP="MenuGroup",bd=S.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return v.jsx(ie.div,{role:"group",...n,ref:t})});bd.displayName=iP;var oP="MenuLabel",q_=S.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return v.jsx(ie.div,{...n,ref:t})});q_.displayName=oP;var Xo="MenuItem",Wf="menu.itemSelect",Ia=S.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...s}=e,o=S.useRef(null),u=Si(Xo,e.__scopeMenu),i=wd(Xo,e.__scopeMenu),a=ce(t,o),d=S.useRef(!1),m=()=>{const c=o.current;if(!r&&c){const g=new CustomEvent(Wf,{bubbles:!0,cancelable:!0});c.addEventListener(Wf,y=>n==null?void 0:n(y),{once:!0}),fv(c,g),g.defaultPrevented?d.current=!1:u.onClose()}};return v.jsx(X_,{...s,ref:a,disabled:r,onClick:Q(e.onClick,m),onPointerDown:c=>{var g;(g=e.onPointerDown)==null||g.call(e,c),d.current=!0},onPointerUp:Q(e.onPointerUp,c=>{var g;d.current||(g=c.currentTarget)==null||g.click()}),onKeyDown:Q(e.onKeyDown,c=>{const g=i.searchRef.current!=="";r||g&&c.key===" "||$c.includes(c.key)&&(c.currentTarget.click(),c.preventDefault())})})});Ia.displayName=Xo;var X_=S.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:s,...o}=e,u=wd(Xo,r),i=U_(r),a=S.useRef(null),d=ce(t,a),[m,c]=S.useState(!1),[g,y]=S.useState("");return S.useEffect(()=>{const C=a.current;C&&y((C.textContent??"").trim())},[o.children]),v.jsx(si.ItemSlot,{scope:r,disabled:n,textValue:s??g,children:v.jsx(H_,{asChild:!0,...i,focusable:!n,children:v.jsx(ie.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...o,ref:d,onPointerMove:Q(e.onPointerMove,ii(C=>{n?u.onItemLeave(C):(u.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Q(e.onPointerLeave,ii(C=>u.onItemLeave(C))),onFocus:Q(e.onFocus,()=>c(!0)),onBlur:Q(e.onBlur,()=>c(!1))})})})}),aP="MenuCheckboxItem",Y_=S.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...s}=e;return v.jsx(t0,{scope:e.__scopeMenu,checked:r,children:v.jsx(Ia,{role:"menuitemcheckbox","aria-checked":Yo(r)?"mixed":r,...s,ref:t,"data-state":kd(r),onSelect:Q(s.onSelect,()=>n==null?void 0:n(Yo(r)?!0:!r),{checkForDefaultPrevented:!1})})})});Y_.displayName=aP;var J_="MenuRadioGroup",[lP,cP]=hn(J_,{value:void 0,onValueChange:()=>{}}),Q_=S.forwardRef((e,t)=>{const{value:r,onValueChange:n,...s}=e,o=Ft(n);return v.jsx(lP,{scope:e.__scopeMenu,value:r,onValueChange:o,children:v.jsx(bd,{...s,ref:t})})});Q_.displayName=J_;var Z_="MenuRadioItem",e0=S.forwardRef((e,t)=>{const{value:r,...n}=e,s=cP(Z_,e.__scopeMenu),o=r===s.value;return v.jsx(t0,{scope:e.__scopeMenu,checked:o,children:v.jsx(Ia,{role:"menuitemradio","aria-checked":o,...n,ref:t,"data-state":kd(o),onSelect:Q(n.onSelect,()=>{var u;return(u=s.onValueChange)==null?void 0:u.call(s,r)},{checkForDefaultPrevented:!1})})})});e0.displayName=Z_;var Cd="MenuItemIndicator",[t0,uP]=hn(Cd,{checked:!1}),r0=S.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...s}=e,o=uP(Cd,r);return v.jsx(Je,{present:n||Yo(o.checked)||o.checked===!0,children:v.jsx(ie.span,{...s,ref:t,"data-state":kd(o.checked)})})});r0.displayName=Cd;var dP="MenuSeparator",n0=S.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return v.jsx(ie.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});n0.displayName=dP;var hP="MenuArrow",s0=S.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,s=_d(r);return v.jsx(Aa,{...s,...n,ref:t})});s0.displayName=hP;var fP="MenuSub",[wA,i0]=hn(fP),Es="MenuSubTrigger",o0=S.forwardRef((e,t)=>{const r=fn(Es,e.__scopeMenu),n=Si(Es,e.__scopeMenu),s=i0(Es,e.__scopeMenu),o=wd(Es,e.__scopeMenu),u=S.useRef(null),{pointerGraceTimerRef:i,onPointerGraceIntentChange:a}=o,d={__scopeMenu:e.__scopeMenu},m=S.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return S.useEffect(()=>m,[m]),S.useEffect(()=>{const c=i.current;return()=>{window.clearTimeout(c),a(null)}},[i,a]),v.jsx(yd,{asChild:!0,...d,children:v.jsx(X_,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":c0(r.open),...e,ref:$t(t,s.onTriggerChange),onClick:c=>{var g;(g=e.onClick)==null||g.call(e,c),!(e.disabled||c.defaultPrevented)&&(c.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Q(e.onPointerMove,ii(c=>{o.onItemEnter(c),!c.defaultPrevented&&!e.disabled&&!r.open&&!u.current&&(o.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{r.onOpenChange(!0),m()},100))})),onPointerLeave:Q(e.onPointerLeave,ii(c=>{var y,C;m();const g=(y=r.content)==null?void 0:y.getBoundingClientRect();if(g){const _=(C=r.content)==null?void 0:C.dataset.side,p=_==="right",h=p?-5:5,l=g[p?"left":"right"],f=g[p?"right":"left"];o.onPointerGraceIntentChange({area:[{x:c.clientX+h,y:c.clientY},{x:l,y:g.top},{x:f,y:g.top},{x:f,y:g.bottom},{x:l,y:g.bottom}],side:_}),window.clearTimeout(i.current),i.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(c),c.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Q(e.onKeyDown,c=>{var y;const g=o.searchRef.current!=="";e.disabled||g&&c.key===" "||XR[n.dir].includes(c.key)&&(r.onOpenChange(!0),(y=r.content)==null||y.focus(),c.preventDefault())})})})});o0.displayName=Es;var a0="MenuSubContent",l0=S.forwardRef((e,t)=>{const r=V_(mt,e.__scopeMenu),{forceMount:n=r.forceMount,...s}=e,o=fn(mt,e.__scopeMenu),u=Si(mt,e.__scopeMenu),i=i0(a0,e.__scopeMenu),a=S.useRef(null),d=ce(t,a);return v.jsx(si.Provider,{scope:e.__scopeMenu,children:v.jsx(Je,{present:n||o.open,children:v.jsx(si.Slot,{scope:e.__scopeMenu,children:v.jsx(Sd,{id:i.contentId,"aria-labelledby":i.triggerId,...s,ref:d,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var c;u.isUsingKeyboardRef.current&&((c=a.current)==null||c.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Q(e.onFocusOutside,m=>{m.target!==i.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:Q(e.onEscapeKeyDown,m=>{u.onClose(),m.preventDefault()}),onKeyDown:Q(e.onKeyDown,m=>{var y;const c=m.currentTarget.contains(m.target),g=YR[u.dir].includes(m.key);c&&g&&(o.onOpenChange(!1),(y=i.trigger)==null||y.focus(),m.preventDefault())})})})})})});l0.displayName=a0;function c0(e){return e?"open":"closed"}function Yo(e){return e==="indeterminate"}function kd(e){return Yo(e)?"indeterminate":e?"checked":"unchecked"}function pP(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function mP(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function gP(e,t,r){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let u=mP(e,Math.max(o,0));s.length===1&&(u=u.filter(d=>d!==r));const a=u.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return a!==r?a:void 0}function vP(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,u=t.length-1;o<t.length;u=o++){const i=t[o],a=t[u],d=i.x,m=i.y,c=a.x,g=a.y;m>n!=g>n&&r<(c-d)*(n-m)/(g-m)+d&&(s=!s)}return s}function _P(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return vP(r,t)}function ii(e){return t=>t.pointerType==="mouse"?e(t):void 0}var yP=yd,xP=K_,wP=G_,SP=bd,bP=q_,CP=Ia,kP=Y_,EP=Q_,RP=e0,PP=r0,TP=n0,NP=s0,LP=o0,AP=l0,u0="DropdownMenu",[DP]=_t(u0,[W_]),Ze=W_(),[SA,d0]=DP(u0),h0="DropdownMenuTrigger",MP=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...s}=e,o=d0(h0,r),u=Ze(r);return v.jsx(yP,{asChild:!0,...u,children:v.jsx(ie.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...s,ref:$t(t,o.triggerRef),onPointerDown:Q(e.onPointerDown,i=>{!n&&i.button===0&&i.ctrlKey===!1&&(o.onOpenToggle(),o.open||i.preventDefault())}),onKeyDown:Q(e.onKeyDown,i=>{n||(["Enter"," "].includes(i.key)&&o.onOpenToggle(),i.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())})})})});MP.displayName=h0;var jP="DropdownMenuPortal",f0=e=>{const{__scopeDropdownMenu:t,...r}=e,n=Ze(t);return v.jsx(xP,{...n,...r})};f0.displayName=jP;var p0="DropdownMenuContent",m0=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=d0(p0,r),o=Ze(r),u=S.useRef(!1);return v.jsx(wP,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...n,ref:t,onCloseAutoFocus:Q(e.onCloseAutoFocus,i=>{var a;u.current||(a=s.triggerRef.current)==null||a.focus(),u.current=!1,i.preventDefault()}),onInteractOutside:Q(e.onInteractOutside,i=>{const a=i.detail.originalEvent,d=a.button===0&&a.ctrlKey===!0,m=a.button===2||d;(!s.modal||m)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});m0.displayName=p0;var IP="DropdownMenuGroup",OP=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return v.jsx(SP,{...s,...n,ref:t})});OP.displayName=IP;var BP="DropdownMenuLabel",g0=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return v.jsx(bP,{...s,...n,ref:t})});g0.displayName=BP;var FP="DropdownMenuItem",v0=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return v.jsx(CP,{...s,...n,ref:t})});v0.displayName=FP;var $P="DropdownMenuCheckboxItem",_0=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return v.jsx(kP,{...s,...n,ref:t})});_0.displayName=$P;var HP="DropdownMenuRadioGroup",zP=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return v.jsx(EP,{...s,...n,ref:t})});zP.displayName=HP;var WP="DropdownMenuRadioItem",y0=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return v.jsx(RP,{...s,...n,ref:t})});y0.displayName=WP;var UP="DropdownMenuItemIndicator",x0=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return v.jsx(PP,{...s,...n,ref:t})});x0.displayName=UP;var VP="DropdownMenuSeparator",w0=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return v.jsx(TP,{...s,...n,ref:t})});w0.displayName=VP;var KP="DropdownMenuArrow",GP=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return v.jsx(NP,{...s,...n,ref:t})});GP.displayName=KP;var qP="DropdownMenuSubTrigger",S0=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return v.jsx(LP,{...s,...n,ref:t})});S0.displayName=qP;var XP="DropdownMenuSubContent",b0=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,s=Ze(r);return v.jsx(AP,{...s,...n,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});b0.displayName=XP;var YP=f0,C0=m0,k0=g0,E0=v0,R0=_0,P0=y0,T0=x0,N0=w0,L0=S0,A0=b0;const JP=S.forwardRef(({className:e,inset:t,children:r,...n},s)=>v.jsxs(L0,{ref:s,className:re("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n,children:[r,v.jsx(cv,{className:"ml-auto"})]}));JP.displayName=L0.displayName;const QP=S.forwardRef(({className:e,...t},r)=>v.jsx(A0,{ref:r,className:re("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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 origin-[--radix-dropdown-menu-content-transform-origin]",e),...t}));QP.displayName=A0.displayName;const ZP=S.forwardRef(({className:e,sideOffset:t=4,...r},n)=>v.jsx(YP,{children:v.jsx(C0,{ref:n,sideOffset:t,className:re("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 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 origin-[--radix-dropdown-menu-content-transform-origin]",e),...r})}));ZP.displayName=C0.displayName;const eT=S.forwardRef(({className:e,inset:t,...r},n)=>v.jsx(E0,{ref:n,className:re("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...r}));eT.displayName=E0.displayName;const tT=S.forwardRef(({className:e,children:t,checked:r,...n},s)=>v.jsxs(R0,{ref:s,className:re("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...n,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(T0,{children:v.jsx(Qu,{className:"h-4 w-4"})})}),t]}));tT.displayName=R0.displayName;const rT=S.forwardRef(({className:e,children:t,...r},n)=>v.jsxs(P0,{ref:n,className:re("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[v.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(T0,{children:v.jsx(cC,{className:"h-2 w-2 fill-current"})})}),t]}));rT.displayName=P0.displayName;const nT=S.forwardRef(({className:e,inset:t,...r},n)=>v.jsx(k0,{ref:n,className:re("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));nT.displayName=k0.displayName;const sT=S.forwardRef(({className:e,...t},r)=>v.jsx(N0,{ref:r,className:re("-mx-1 my-1 h-px bg-muted",e),...t}));sT.displayName=N0.displayName;const iT=S.forwardRef(({className:e,type:t,...r},n)=>v.jsx("input",{type:t,className:re("flex h-9 w-full rounded-md border border-transparent bg-input px-3 py-1 text-base transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground/50 placeholder:font-light focus-visible:outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));iT.displayName="Input";var oT="Label",D0=S.forwardRef((e,t)=>v.jsx(Ue.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));D0.displayName=oT;var M0=D0;const aT=Ju("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),lT=S.forwardRef(({className:e,...t},r)=>v.jsx(M0,{ref:r,className:re(aT(),e),...t}));lT.displayName=M0.displayName;var Ed="Progress",Rd=100,[cT]=Gg(Ed),[uT,dT]=cT(Ed),j0=S.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:s,getValueLabel:o=hT,...u}=e;(s||s===0)&&!Uf(s)&&console.error(fT(`${s}`,"Progress"));const i=Uf(s)?s:Rd;n!==null&&!Vf(n,i)&&console.error(pT(`${n}`,"Progress"));const a=Vf(n,i)?n:null,d=Jo(a)?o(a,i):void 0;return v.jsx(uT,{scope:r,value:a,max:i,children:v.jsx(Ue.div,{"aria-valuemax":i,"aria-valuemin":0,"aria-valuenow":Jo(a)?a:void 0,"aria-valuetext":d,role:"progressbar","data-state":B0(a,i),"data-value":a??void 0,"data-max":i,...u,ref:t})})});j0.displayName=Ed;var I0="ProgressIndicator",O0=S.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,s=dT(I0,r);return v.jsx(Ue.div,{"data-state":B0(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...n,ref:t})});O0.displayName=I0;function hT(e,t){return`${Math.round(e/t*100)}%`}function B0(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Jo(e){return typeof e=="number"}function Uf(e){return Jo(e)&&!isNaN(e)&&e>0}function Vf(e,t){return Jo(e)&&!isNaN(e)&&e<=t&&e>=0}function fT(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Rd}\`.`}function pT(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
265
+ - a positive number
266
+ - less than the value passed to \`max\` (or ${Rd} if no \`max\` prop is set)
267
+ - \`null\` or \`undefined\` if the progress is indeterminate.
268
+
269
+ Defaulting to \`null\`.`}var F0=j0,mT=O0;const gT=S.forwardRef(({className:e,value:t,...r},n)=>v.jsx(F0,{ref:n,className:re("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...r,children:v.jsx(mT,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));gT.displayName=F0.displayName;function Kf(e,[t,r]){return Math.min(r,Math.max(t,e))}var $0=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"}),vT="VisuallyHidden",H0=S.forwardRef((e,t)=>v.jsx(ie.span,{...e,ref:t,style:{...$0,...e.style}}));H0.displayName=vT;var _T=H0,yT=[" ","Enter","ArrowUp","ArrowDown"],xT=[" ","Enter"],Oa="Select",[Pd,Ba,wT]=vd(Oa),[as]=_t(Oa,[wT,jr]),Td=jr(),[bA,Or]=as(Oa),[CA,ST]=as(Oa),z0="SelectTrigger",W0=S.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=Td(r),u=Or(z0,r),i=u.disabled||n,a=ce(t,u.onTriggerChange),d=Ba(r),m=S.useRef("touch"),[c,g,y]=dy(_=>{const p=d().filter(f=>!f.disabled),h=p.find(f=>f.value===u.value),l=hy(p,_,h);l!==void 0&&u.onValueChange(l.value)}),C=_=>{i||(u.onOpenChange(!0),y()),_&&(u.triggerPointerDownPosRef.current={x:Math.round(_.pageX),y:Math.round(_.pageY)})};return v.jsx(xi,{asChild:!0,...o,children:v.jsx(ie.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:i,"data-disabled":i?"":void 0,"data-placeholder":uy(u.value)?"":void 0,...s,ref:a,onClick:Q(s.onClick,_=>{_.currentTarget.focus(),m.current!=="mouse"&&C(_)}),onPointerDown:Q(s.onPointerDown,_=>{m.current=_.pointerType;const p=_.target;p.hasPointerCapture(_.pointerId)&&p.releasePointerCapture(_.pointerId),_.button===0&&_.ctrlKey===!1&&_.pointerType==="mouse"&&(C(_),_.preventDefault())}),onKeyDown:Q(s.onKeyDown,_=>{const p=c.current!=="";!(_.ctrlKey||_.altKey||_.metaKey)&&_.key.length===1&&g(_.key),!(p&&_.key===" ")&&yT.includes(_.key)&&(C(),_.preventDefault())})})})});W0.displayName=z0;var U0="SelectValue",bT=S.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:u="",...i}=e,a=Or(U0,r),{onValueNodeHasChildrenChange:d}=a,m=o!==void 0,c=ce(t,a.onValueNodeChange);return Ne(()=>{d(m)},[d,m]),v.jsx(ie.span,{...i,ref:c,style:{pointerEvents:"none"},children:uy(a.value)?v.jsx(v.Fragment,{children:u}):o})});bT.displayName=U0;var CT="SelectIcon",V0=S.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return v.jsx(ie.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});V0.displayName=CT;var kT="SelectPortal",K0=e=>v.jsx(ss,{asChild:!0,...e});K0.displayName=kT;var ln="SelectContent",G0=S.forwardRef((e,t)=>{const r=Or(ln,e.__scopeSelect),[n,s]=S.useState();if(Ne(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?ts.createPortal(v.jsx(q0,{scope:e.__scopeSelect,children:v.jsx(Pd.Slot,{scope:e.__scopeSelect,children:v.jsx("div",{children:e.children})})}),o):null}return v.jsx(X0,{...e,ref:t})});G0.displayName=ln;var xt=10,[q0,Br]=as(ln),ET="SelectContentImpl",RT=nn("SelectContent.RemoveScroll"),X0=S.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:u,side:i,sideOffset:a,align:d,alignOffset:m,arrowPadding:c,collisionBoundary:g,collisionPadding:y,sticky:C,hideWhenDetached:_,avoidCollisions:p,...h}=e,l=Or(ln,r),[f,x]=S.useState(null),[E,k]=S.useState(null),b=ce(t,I=>x(I)),[w,R]=S.useState(null),[T,M]=S.useState(null),O=Ba(r),[A,F]=S.useState(!1),U=S.useRef(!1);S.useEffect(()=>{if(f)return Sa(f)},[f]),xa();const G=S.useCallback(I=>{const[L,...z]=O().map(X=>X.ref.current),[H]=z.slice(-1),Y=document.activeElement;for(const X of I)if(X===Y||(X==null||X.scrollIntoView({block:"nearest"}),X===L&&E&&(E.scrollTop=0),X===H&&E&&(E.scrollTop=E.scrollHeight),X==null||X.focus(),document.activeElement!==Y))return},[O,E]),K=S.useCallback(()=>G([w,f]),[G,w,f]);S.useEffect(()=>{A&&K()},[A,K]);const{onOpenChange:B,triggerPointerDownPosRef:P}=l;S.useEffect(()=>{if(f){let I={x:0,y:0};const L=H=>{var Y,X;I={x:Math.abs(Math.round(H.pageX)-(((Y=P.current)==null?void 0:Y.x)??0)),y:Math.abs(Math.round(H.pageY)-(((X=P.current)==null?void 0:X.y)??0))}},z=H=>{I.x<=10&&I.y<=10?H.preventDefault():f.contains(H.target)||B(!1),document.removeEventListener("pointermove",L),P.current=null};return P.current!==null&&(document.addEventListener("pointermove",L),document.addEventListener("pointerup",z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",L),document.removeEventListener("pointerup",z,{capture:!0})}}},[f,B,P]),S.useEffect(()=>{const I=()=>B(!1);return window.addEventListener("blur",I),window.addEventListener("resize",I),()=>{window.removeEventListener("blur",I),window.removeEventListener("resize",I)}},[B]);const[N,j]=dy(I=>{const L=O().filter(Y=>!Y.disabled),z=L.find(Y=>Y.ref.current===document.activeElement),H=hy(L,I,z);H&&setTimeout(()=>H.ref.current.focus())}),D=S.useCallback((I,L,z)=>{const H=!U.current&&!z;(l.value!==void 0&&l.value===L||H)&&(R(I),H&&(U.current=!0))},[l.value]),W=S.useCallback(()=>f==null?void 0:f.focus(),[f]),$=S.useCallback((I,L,z)=>{const H=!U.current&&!z;(l.value!==void 0&&l.value===L||H)&&M(I)},[l.value]),V=n==="popper"?Hc:Y0,q=V===Hc?{side:i,sideOffset:a,align:d,alignOffset:m,arrowPadding:c,collisionBoundary:g,collisionPadding:y,sticky:C,hideWhenDetached:_,avoidCollisions:p}:{};return v.jsx(q0,{scope:r,content:f,viewport:E,onViewportChange:k,itemRefCallback:D,selectedItem:w,onItemLeave:W,itemTextRefCallback:$,focusSelectedItem:K,selectedItemText:T,position:n,isPositioned:A,searchRef:N,children:v.jsx(mi,{as:RT,allowPinchZoom:!0,children:v.jsx(pi,{asChild:!0,trapped:l.open,onMountAutoFocus:I=>{I.preventDefault()},onUnmountAutoFocus:Q(s,I=>{var L;(L=l.trigger)==null||L.focus({preventScroll:!0}),I.preventDefault()}),children:v.jsx(ns,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:u,onFocusOutside:I=>I.preventDefault(),onDismiss:()=>l.onOpenChange(!1),children:v.jsx(V,{role:"listbox",id:l.contentId,"data-state":l.open?"open":"closed",dir:l.dir,onContextMenu:I=>I.preventDefault(),...h,...q,onPlaced:()=>F(!0),ref:b,style:{display:"flex",flexDirection:"column",outline:"none",...h.style},onKeyDown:Q(h.onKeyDown,I=>{const L=I.ctrlKey||I.altKey||I.metaKey;if(I.key==="Tab"&&I.preventDefault(),!L&&I.key.length===1&&j(I.key),["ArrowUp","ArrowDown","Home","End"].includes(I.key)){let H=O().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);if(["ArrowUp","End"].includes(I.key)&&(H=H.slice().reverse()),["ArrowUp","ArrowDown"].includes(I.key)){const Y=I.target,X=H.indexOf(Y);H=H.slice(X+1)}setTimeout(()=>G(H)),I.preventDefault()}})})})})})})});X0.displayName=ET;var PT="SelectItemAlignedPosition",Y0=S.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=Or(ln,r),u=Br(ln,r),[i,a]=S.useState(null),[d,m]=S.useState(null),c=ce(t,b=>m(b)),g=Ba(r),y=S.useRef(!1),C=S.useRef(!0),{viewport:_,selectedItem:p,selectedItemText:h,focusSelectedItem:l}=u,f=S.useCallback(()=>{if(o.trigger&&o.valueNode&&i&&d&&_&&p&&h){const b=o.trigger.getBoundingClientRect(),w=d.getBoundingClientRect(),R=o.valueNode.getBoundingClientRect(),T=h.getBoundingClientRect();if(o.dir!=="rtl"){const Y=T.left-w.left,X=R.left-Y,ne=b.left-X,oe=b.width+ne,he=Math.max(oe,w.width),Ce=window.innerWidth-xt,se=Kf(X,[xt,Math.max(xt,Ce-he)]);i.style.minWidth=oe+"px",i.style.left=se+"px"}else{const Y=w.right-T.right,X=window.innerWidth-R.right-Y,ne=window.innerWidth-b.right-X,oe=b.width+ne,he=Math.max(oe,w.width),Ce=window.innerWidth-xt,se=Kf(X,[xt,Math.max(xt,Ce-he)]);i.style.minWidth=oe+"px",i.style.right=se+"px"}const M=g(),O=window.innerHeight-xt*2,A=_.scrollHeight,F=window.getComputedStyle(d),U=parseInt(F.borderTopWidth,10),G=parseInt(F.paddingTop,10),K=parseInt(F.borderBottomWidth,10),B=parseInt(F.paddingBottom,10),P=U+G+A+B+K,N=Math.min(p.offsetHeight*5,P),j=window.getComputedStyle(_),D=parseInt(j.paddingTop,10),W=parseInt(j.paddingBottom,10),$=b.top+b.height/2-xt,V=O-$,q=p.offsetHeight/2,I=p.offsetTop+q,L=U+G+I,z=P-L;if(L<=$){const Y=M.length>0&&p===M[M.length-1].ref.current;i.style.bottom="0px";const X=d.clientHeight-_.offsetTop-_.offsetHeight,ne=Math.max(V,q+(Y?W:0)+X+K),oe=L+ne;i.style.height=oe+"px"}else{const Y=M.length>0&&p===M[0].ref.current;i.style.top="0px";const ne=Math.max($,U+_.offsetTop+(Y?D:0)+q)+z;i.style.height=ne+"px",_.scrollTop=L-$+_.offsetTop}i.style.margin=`${xt}px 0`,i.style.minHeight=N+"px",i.style.maxHeight=O+"px",n==null||n(),requestAnimationFrame(()=>y.current=!0)}},[g,o.trigger,o.valueNode,i,d,_,p,h,o.dir,n]);Ne(()=>f(),[f]);const[x,E]=S.useState();Ne(()=>{d&&E(window.getComputedStyle(d).zIndex)},[d]);const k=S.useCallback(b=>{b&&C.current===!0&&(f(),l==null||l(),C.current=!1)},[f,l]);return v.jsx(NT,{scope:r,contentWrapper:i,shouldExpandOnScrollRef:y,onScrollButtonChange:k,children:v.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:v.jsx(ie.div,{...s,ref:c,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Y0.displayName=PT;var TT="SelectPopperPosition",Hc=S.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=xt,...o}=e,u=Td(r);return v.jsx(La,{...u,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.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)"}})});Hc.displayName=TT;var[NT,Nd]=as(ln,{}),zc="SelectViewport",J0=S.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=Br(zc,r),u=Nd(zc,r),i=ce(t,o.onViewportChange),a=S.useRef(0);return v.jsxs(v.Fragment,{children:[v.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:n}),v.jsx(Pd.Slot,{scope:r,children:v.jsx(ie.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:i,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Q(s.onScroll,d=>{const m=d.currentTarget,{contentWrapper:c,shouldExpandOnScrollRef:g}=u;if(g!=null&&g.current&&c){const y=Math.abs(a.current-m.scrollTop);if(y>0){const C=window.innerHeight-xt*2,_=parseFloat(c.style.minHeight),p=parseFloat(c.style.height),h=Math.max(_,p);if(h<C){const l=h+y,f=Math.min(C,l),x=l-f;c.style.height=f+"px",c.style.bottom==="0px"&&(m.scrollTop=x>0?x:0,c.style.justifyContent="flex-end")}}}a.current=m.scrollTop})})})]})});J0.displayName=zc;var Q0="SelectGroup",[LT,AT]=as(Q0),DT=S.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=st();return v.jsx(LT,{scope:r,id:s,children:v.jsx(ie.div,{role:"group","aria-labelledby":s,...n,ref:t})})});DT.displayName=Q0;var Z0="SelectLabel",ey=S.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=AT(Z0,r);return v.jsx(ie.div,{id:s.id,...n,ref:t})});ey.displayName=Z0;var Qo="SelectItem",[MT,ty]=as(Qo),ry=S.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...u}=e,i=Or(Qo,r),a=Br(Qo,r),d=i.value===n,[m,c]=S.useState(o??""),[g,y]=S.useState(!1),C=ce(t,l=>{var f;return(f=a.itemRefCallback)==null?void 0:f.call(a,l,n,s)}),_=st(),p=S.useRef("touch"),h=()=>{s||(i.onValueChange(n),i.onOpenChange(!1))};if(n==="")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 v.jsx(MT,{scope:r,value:n,disabled:s,textId:_,isSelected:d,onItemTextChange:S.useCallback(l=>{c(f=>f||((l==null?void 0:l.textContent)??"").trim())},[]),children:v.jsx(Pd.ItemSlot,{scope:r,value:n,disabled:s,textValue:m,children:v.jsx(ie.div,{role:"option","aria-labelledby":_,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...u,ref:C,onFocus:Q(u.onFocus,()=>y(!0)),onBlur:Q(u.onBlur,()=>y(!1)),onClick:Q(u.onClick,()=>{p.current!=="mouse"&&h()}),onPointerUp:Q(u.onPointerUp,()=>{p.current==="mouse"&&h()}),onPointerDown:Q(u.onPointerDown,l=>{p.current=l.pointerType}),onPointerMove:Q(u.onPointerMove,l=>{var f;p.current=l.pointerType,s?(f=a.onItemLeave)==null||f.call(a):p.current==="mouse"&&l.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Q(u.onPointerLeave,l=>{var f;l.currentTarget===document.activeElement&&((f=a.onItemLeave)==null||f.call(a))}),onKeyDown:Q(u.onKeyDown,l=>{var x;((x=a.searchRef)==null?void 0:x.current)!==""&&l.key===" "||(xT.includes(l.key)&&h(),l.key===" "&&l.preventDefault())})})})})});ry.displayName=Qo;var Rs="SelectItemText",ny=S.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,u=Or(Rs,r),i=Br(Rs,r),a=ty(Rs,r),d=ST(Rs,r),[m,c]=S.useState(null),g=ce(t,h=>c(h),a.onItemTextChange,h=>{var l;return(l=i.itemTextRefCallback)==null?void 0:l.call(i,h,a.value,a.disabled)}),y=m==null?void 0:m.textContent,C=S.useMemo(()=>v.jsx("option",{value:a.value,disabled:a.disabled,children:y},a.value),[a.disabled,a.value,y]),{onNativeOptionAdd:_,onNativeOptionRemove:p}=d;return Ne(()=>(_(C),()=>p(C)),[_,p,C]),v.jsxs(v.Fragment,{children:[v.jsx(ie.span,{id:a.textId,...o,ref:g}),a.isSelected&&u.valueNode&&!u.valueNodeHasChildren?ts.createPortal(o.children,u.valueNode):null]})});ny.displayName=Rs;var sy="SelectItemIndicator",iy=S.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return ty(sy,r).isSelected?v.jsx(ie.span,{"aria-hidden":!0,...n,ref:t}):null});iy.displayName=sy;var Wc="SelectScrollUpButton",oy=S.forwardRef((e,t)=>{const r=Br(Wc,e.__scopeSelect),n=Nd(Wc,e.__scopeSelect),[s,o]=S.useState(!1),u=ce(t,n.onScrollButtonChange);return Ne(()=>{if(r.viewport&&r.isPositioned){let i=function(){const d=a.scrollTop>0;o(d)};const a=r.viewport;return i(),a.addEventListener("scroll",i),()=>a.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),s?v.jsx(ly,{...e,ref:u,onAutoScroll:()=>{const{viewport:i,selectedItem:a}=r;i&&a&&(i.scrollTop=i.scrollTop-a.offsetHeight)}}):null});oy.displayName=Wc;var Uc="SelectScrollDownButton",ay=S.forwardRef((e,t)=>{const r=Br(Uc,e.__scopeSelect),n=Nd(Uc,e.__scopeSelect),[s,o]=S.useState(!1),u=ce(t,n.onScrollButtonChange);return Ne(()=>{if(r.viewport&&r.isPositioned){let i=function(){const d=a.scrollHeight-a.clientHeight,m=Math.ceil(a.scrollTop)<d;o(m)};const a=r.viewport;return i(),a.addEventListener("scroll",i),()=>a.removeEventListener("scroll",i)}},[r.viewport,r.isPositioned]),s?v.jsx(ly,{...e,ref:u,onAutoScroll:()=>{const{viewport:i,selectedItem:a}=r;i&&a&&(i.scrollTop=i.scrollTop+a.offsetHeight)}}):null});ay.displayName=Uc;var ly=S.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=Br("SelectScrollButton",r),u=S.useRef(null),i=Ba(r),a=S.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return S.useEffect(()=>()=>a(),[a]),Ne(()=>{var m;const d=i().find(c=>c.ref.current===document.activeElement);(m=d==null?void 0:d.ref.current)==null||m.scrollIntoView({block:"nearest"})},[i]),v.jsx(ie.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Q(s.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(n,50))}),onPointerMove:Q(s.onPointerMove,()=>{var d;(d=o.onItemLeave)==null||d.call(o),u.current===null&&(u.current=window.setInterval(n,50))}),onPointerLeave:Q(s.onPointerLeave,()=>{a()})})}),jT="SelectSeparator",cy=S.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return v.jsx(ie.div,{"aria-hidden":!0,...n,ref:t})});cy.displayName=jT;var Vc="SelectArrow",IT=S.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Td(r),o=Or(Vc,r),u=Br(Vc,r);return o.open&&u.position==="popper"?v.jsx(Aa,{...s,...n,ref:t}):null});IT.displayName=Vc;var OT="SelectBubbleInput",BT=S.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=S.useRef(null),o=ce(n,s),u=ed(t);return S.useEffect(()=>{const i=s.current;if(!i)return;const a=window.HTMLSelectElement.prototype,m=Object.getOwnPropertyDescriptor(a,"value").set;if(u!==t&&m){const c=new Event("change",{bubbles:!0});m.call(i,t),i.dispatchEvent(c)}},[u,t]),v.jsx(ie.select,{...r,style:{...$0,...r.style},ref:o,defaultValue:t})});BT.displayName=OT;function uy(e){return e===""||e===void 0}function dy(e){const t=Ft(e),r=S.useRef(""),n=S.useRef(0),s=S.useCallback(u=>{const i=r.current+u;t(i),function a(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>a(""),1e3))}(i)},[t]),o=S.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function hy(e,t,r){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let u=FT(e,Math.max(o,0));s.length===1&&(u=u.filter(d=>d!==r));const a=u.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return a!==r?a:void 0}function FT(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var fy=W0,$T=V0,HT=K0,py=G0,zT=J0,my=ey,gy=ry,WT=ny,UT=iy,vy=oy,_y=ay,yy=cy;const VT=S.forwardRef(({className:e,children:t,...r},n)=>v.jsxs(fy,{ref:n,className:re("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-transparent bg-input px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground/50 data-[placeholder]:font-light focus:outline-none focus:border-ring focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,v.jsx($T,{asChild:!0,children:v.jsx(Zu,{className:"h-4 w-4 opacity-50"})})]}));VT.displayName=fy.displayName;const xy=S.forwardRef(({className:e,...t},r)=>v.jsx(vy,{ref:r,className:re("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(aC,{className:"h-4 w-4"})}));xy.displayName=vy.displayName;const wy=S.forwardRef(({className:e,...t},r)=>v.jsx(_y,{ref:r,className:re("flex cursor-default items-center justify-center py-1",e),...t,children:v.jsx(Zu,{className:"h-4 w-4"})}));wy.displayName=_y.displayName;const KT=S.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>v.jsx(HT,{children:v.jsxs(py,{ref:s,className:re("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-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 origin-[--radix-select-content-transform-origin]",r==="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:r,...n,children:[v.jsx(xy,{}),v.jsx(zT,{className:re("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),v.jsx(wy,{})]})}));KT.displayName=py.displayName;const GT=S.forwardRef(({className:e,...t},r)=>v.jsx(my,{ref:r,className:re("px-2 py-1.5 text-sm font-semibold",e),...t}));GT.displayName=my.displayName;const qT=S.forwardRef(({className:e,children:t,...r},n)=>v.jsxs(gy,{ref:n,className:re("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),...r,children:[v.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:v.jsx(UT,{children:v.jsx(Qu,{className:"h-4 w-4"})})}),v.jsx(WT,{children:t})]}));qT.displayName=gy.displayName;const XT=S.forwardRef(({className:e,...t},r)=>v.jsx(yy,{ref:r,className:re("-mx-1 my-1 h-px bg-muted",e),...t}));XT.displayName=yy.displayName;var YT="Separator",Gf="horizontal",JT=["horizontal","vertical"],Sy=S.forwardRef((e,t)=>{const{decorative:r,orientation:n=Gf,...s}=e,o=QT(n)?n:Gf,i=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return v.jsx(Ue.div,{"data-orientation":o,...i,...s,ref:t})});Sy.displayName=YT;function QT(e){return JT.includes(e)}var by=Sy;const ZT=S.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>v.jsx(by,{ref:s,decorative:r,orientation:t,className:re("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));ZT.displayName=by.displayName;const eN=ad,Cy=S.forwardRef(({className:e,...t},r)=>v.jsx(gi,{className:re("fixed inset-0 z-50 bg-black/80 [will-change:opacity] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));Cy.displayName=gi.displayName;const tN=Ju("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out [will-change:transform,opacity] data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),rN=S.forwardRef(({side:e="right",className:t,children:r,...n},s)=>v.jsxs(eN,{children:[v.jsx(Cy,{}),v.jsxs(vi,{ref:s,className:re(tN({side:e}),t),...n,children:[v.jsxs(qv,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[v.jsx(uv,{className:"h-4 w-4"}),v.jsx("span",{className:"sr-only",children:"Close"})]}),r]})]}));rN.displayName=vi.displayName;const nN=S.forwardRef(({className:e,...t},r)=>v.jsx(Ca,{ref:r,className:re("text-lg font-semibold text-foreground",e),...t}));nN.displayName=Ca.displayName;const sN=S.forwardRef(({className:e,...t},r)=>v.jsx(ka,{ref:r,className:re("text-sm text-muted-foreground",e),...t}));sN.displayName=ka.displayName;var Fa="Switch",[iN]=_t(Fa),[oN,aN]=iN(Fa),ky=S.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:s,defaultChecked:o,required:u,disabled:i,value:a="on",onCheckedChange:d,form:m,...c}=e,[g,y]=S.useState(null),C=ce(t,f=>y(f)),_=S.useRef(!1),p=g?m||!!g.closest("form"):!0,[h,l]=fi({prop:s,defaultProp:o??!1,onChange:d,caller:Fa});return v.jsxs(oN,{scope:r,checked:h,disabled:i,children:[v.jsx(ie.button,{type:"button",role:"switch","aria-checked":h,"aria-required":u,"data-state":Ty(h),"data-disabled":i?"":void 0,disabled:i,value:a,...c,ref:C,onClick:Q(e.onClick,f=>{l(x=>!x),p&&(_.current=f.isPropagationStopped(),_.current||f.stopPropagation())})}),p&&v.jsx(Py,{control:g,bubbles:!_.current,name:n,value:a,checked:h,required:u,disabled:i,form:m,style:{transform:"translateX(-100%)"}})]})});ky.displayName=Fa;var Ey="SwitchThumb",Ry=S.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,s=aN(Ey,r);return v.jsx(ie.span,{"data-state":Ty(s.checked),"data-disabled":s.disabled?"":void 0,...n,ref:t})});Ry.displayName=Ey;var lN="SwitchBubbleInput",Py=S.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...s},o)=>{const u=S.useRef(null),i=ce(u,o),a=ed(r),d=td(t);return S.useEffect(()=>{const m=u.current;if(!m)return;const c=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==r&&y){const C=new Event("click",{bubbles:n});y.call(m,r),m.dispatchEvent(C)}},[a,r,n]),v.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:i,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Py.displayName=lN;function Ty(e){return e?"checked":"unchecked"}var Ny=ky,cN=Ry;const uN=S.forwardRef(({className:e,...t},r)=>v.jsx(Ny,{ref:r,className:re("peer inline-flex h-4 w-7 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,children:v.jsx(cN,{className:re("pointer-events-none block h-3 w-3 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-3 data-[state=unchecked]:translate-x-0")})}));uN.displayName=Ny.displayName;function dN(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Array(12).fill(0);let Kc=1;class hN{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...s}=t,o=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:Kc++,u=this.toasts.find(a=>a.id===o),i=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),u?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...t,id:o,title:n}),{...a,...t,id:o,dismissible:i,title:n}):a):this.addToast({title:n,...s,dismissible:i,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let o=n!==void 0,u;const i=s.then(async d=>{if(u=["resolve",d],Ve.isValidElement(d))o=!1,this.create({id:n,type:"default",message:d});else if(pN(d)&&!d.ok){o=!1;const c=typeof r.error=="function"?await r.error(`HTTP error! status: ${d.status}`):r.error,g=typeof r.description=="function"?await r.description(`HTTP error! status: ${d.status}`):r.description,C=typeof c=="object"&&!Ve.isValidElement(c)?c:{message:c};this.create({id:n,type:"error",description:g,...C})}else if(d instanceof Error){o=!1;const c=typeof r.error=="function"?await r.error(d):r.error,g=typeof r.description=="function"?await r.description(d):r.description,C=typeof c=="object"&&!Ve.isValidElement(c)?c:{message:c};this.create({id:n,type:"error",description:g,...C})}else if(r.success!==void 0){o=!1;const c=typeof r.success=="function"?await r.success(d):r.success,g=typeof r.description=="function"?await r.description(d):r.description,C=typeof c=="object"&&!Ve.isValidElement(c)?c:{message:c};this.create({id:n,type:"success",description:g,...C})}}).catch(async d=>{if(u=["reject",d],r.error!==void 0){o=!1;const m=typeof r.error=="function"?await r.error(d):r.error,c=typeof r.description=="function"?await r.description(d):r.description,y=typeof m=="object"&&!Ve.isValidElement(m)?m:{message:m};this.create({id:n,type:"error",description:c,...y})}}).finally(()=>{o&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),a=()=>new Promise((d,m)=>i.then(()=>u[0]==="reject"?m(u[1]):d(u[1])).catch(m));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(t,r)=>{const n=(r==null?void 0:r.id)||Kc++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ut=new hN,fN=(e,t)=>{const r=(t==null?void 0:t.id)||Kc++;return ut.addToast({title:e,...t,id:r}),r},pN=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",mN=fN,gN=()=>ut.toasts,vN=()=>ut.getActiveToasts();Object.assign(mN,{success:ut.success,info:ut.info,warning:ut.warning,error:ut.error,custom:ut.custom,message:ut.message,promise:ut.promise,dismiss:ut.dismiss,loading:ut.loading},{getHistory:gN,getToasts:vN});dN("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");var $a="Tabs",[_N]=_t($a,[Ma]),Ly=Ma(),[yN,Ld]=_N($a),xN=S.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:s,defaultValue:o,orientation:u="horizontal",dir:i,activationMode:a="automatic",...d}=e,m=M_(i),[c,g]=fi({prop:n,onChange:s,defaultProp:o??"",caller:$a});return v.jsx(yN,{scope:r,baseId:st(),value:c,onValueChange:g,orientation:u,dir:m,activationMode:a,children:v.jsx(ie.div,{dir:m,"data-orientation":u,...d,ref:t})})});xN.displayName=$a;var Ay="TabsList",Dy=S.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...s}=e,o=Ld(Ay,r),u=Ly(r);return v.jsx($_,{asChild:!0,...u,orientation:o.orientation,dir:o.dir,loop:n,children:v.jsx(ie.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});Dy.displayName=Ay;var My="TabsTrigger",jy=S.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:s=!1,...o}=e,u=Ld(My,r),i=Ly(r),a=By(u.baseId,n),d=Fy(u.baseId,n),m=n===u.value;return v.jsx(H_,{asChild:!0,...i,focusable:!s,active:m,children:v.jsx(ie.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":d,"data-state":m?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:a,...o,ref:t,onMouseDown:Q(e.onMouseDown,c=>{!s&&c.button===0&&c.ctrlKey===!1?u.onValueChange(n):c.preventDefault()}),onKeyDown:Q(e.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&u.onValueChange(n)}),onFocus:Q(e.onFocus,()=>{const c=u.activationMode!=="manual";!m&&!s&&c&&u.onValueChange(n)})})})});jy.displayName=My;var Iy="TabsContent",Oy=S.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:s,children:o,...u}=e,i=Ld(Iy,r),a=By(i.baseId,n),d=Fy(i.baseId,n),m=n===i.value,c=S.useRef(m);return S.useEffect(()=>{const g=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(g)},[]),v.jsx(Je,{present:s||m,children:({present:g})=>v.jsx(ie.div,{"data-state":m?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":a,hidden:!g,id:d,tabIndex:0,...u,ref:t,style:{...e.style,animationDuration:c.current?"0s":void 0},children:g&&o})})});Oy.displayName=Iy;function By(e,t){return`${e}-trigger-${t}`}function Fy(e,t){return`${e}-content-${t}`}var $y=Dy,Hy=jy,zy=Oy;const wN=S.forwardRef(({className:e,...t},r)=>v.jsx($y,{ref:r,className:re("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));wN.displayName=$y.displayName;const SN=S.forwardRef(({className:e,...t},r)=>v.jsx(Hy,{ref:r,className:re("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary/10 data-[state=active]:text-primary data-[state=active]:shadow-sm",e),...t}));SN.displayName=Hy.displayName;const bN=S.forwardRef(({className:e,...t},r)=>v.jsx(zy,{ref:r,className:re("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));bN.displayName=zy.displayName;const CN=S.forwardRef(({className:e,...t},r)=>v.jsx("textarea",{className:re("flex min-h-[60px] w-full rounded-md border border-transparent bg-input px-3 py-2 text-base placeholder:text-muted-foreground/50 placeholder:font-light focus-visible:outline-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...t}));CN.displayName="Textarea";var[Ha]=_t("Tooltip",[jr]),Ad=jr(),kN="TooltipProvider",qf="tooltip.open",[kA,Wy]=Ha(kN),Uy="Tooltip",[EA,bi]=Ha(Uy),Gc="TooltipTrigger",EN=S.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=bi(Gc,r),o=Wy(Gc,r),u=Ad(r),i=S.useRef(null),a=ce(t,i,s.onTriggerChange),d=S.useRef(!1),m=S.useRef(!1),c=S.useCallback(()=>d.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",c),[c]),v.jsx(xi,{asChild:!0,...u,children:v.jsx(ie.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:a,onPointerMove:Q(e.onPointerMove,g=>{g.pointerType!=="touch"&&!m.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),m.current=!0)}),onPointerLeave:Q(e.onPointerLeave,()=>{s.onTriggerLeave(),m.current=!1}),onPointerDown:Q(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",c,{once:!0})}),onFocus:Q(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:Q(e.onBlur,s.onClose),onClick:Q(e.onClick,s.onClose)})})});EN.displayName=Gc;var Dd="TooltipPortal",[RN,PN]=Ha(Dd,{forceMount:void 0}),Vy=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:s}=e,o=bi(Dd,t);return v.jsx(RN,{scope:t,forceMount:r,children:v.jsx(Je,{present:r||o.open,children:v.jsx(ss,{asChild:!0,container:s,children:n})})})};Vy.displayName=Dd;var Jn="TooltipContent",Ky=S.forwardRef((e,t)=>{const r=PN(Jn,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,u=bi(Jn,e.__scopeTooltip);return v.jsx(Je,{present:n||u.open,children:u.disableHoverableContent?v.jsx(Gy,{side:s,...o,ref:t}):v.jsx(TN,{side:s,...o,ref:t})})}),TN=S.forwardRef((e,t)=>{const r=bi(Jn,e.__scopeTooltip),n=Wy(Jn,e.__scopeTooltip),s=S.useRef(null),o=ce(t,s),[u,i]=S.useState(null),{trigger:a,onClose:d}=r,m=s.current,{onPointerInTransitChange:c}=n,g=S.useCallback(()=>{i(null),c(!1)},[c]),y=S.useCallback((C,_)=>{const p=C.currentTarget,h={x:C.clientX,y:C.clientY},l=MN(h,p.getBoundingClientRect()),f=jN(h,l),x=IN(_.getBoundingClientRect()),E=BN([...f,...x]);i(E),c(!0)},[c]);return S.useEffect(()=>()=>g(),[g]),S.useEffect(()=>{if(a&&m){const C=p=>y(p,m),_=p=>y(p,a);return a.addEventListener("pointerleave",C),m.addEventListener("pointerleave",_),()=>{a.removeEventListener("pointerleave",C),m.removeEventListener("pointerleave",_)}}},[a,m,y,g]),S.useEffect(()=>{if(u){const C=_=>{const p=_.target,h={x:_.clientX,y:_.clientY},l=(a==null?void 0:a.contains(p))||(m==null?void 0:m.contains(p)),f=!ON(h,u);l?g():f&&(g(),d())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[a,m,u,d,g]),v.jsx(Gy,{...e,ref:o})}),[NN,LN]=Ha(Uy,{isInside:!1}),AN=lk("TooltipContent"),Gy=S.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:u,...i}=e,a=bi(Jn,r),d=Ad(r),{onClose:m}=a;return S.useEffect(()=>(document.addEventListener(qf,m),()=>document.removeEventListener(qf,m)),[m]),S.useEffect(()=>{if(a.trigger){const c=g=>{const y=g.target;y!=null&&y.contains(a.trigger)&&m()};return window.addEventListener("scroll",c,{capture:!0}),()=>window.removeEventListener("scroll",c,{capture:!0})}},[a.trigger,m]),v.jsx(ns,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:u,onFocusOutside:c=>c.preventDefault(),onDismiss:m,children:v.jsxs(La,{"data-state":a.stateAttribute,...d,...i,ref:t,style:{...i.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[v.jsx(AN,{children:n}),v.jsx(NN,{scope:r,isInside:!0,children:v.jsx(_T,{id:a.contentId,role:"tooltip",children:s||n})})]})})});Ky.displayName=Jn;var qy="TooltipArrow",DN=S.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Ad(r);return LN(qy,r).isInside?null:v.jsx(Aa,{...s,...n,ref:t})});DN.displayName=qy;function MN(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function jN(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function IN(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function ON(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,u=t.length-1;o<t.length;u=o++){const i=t[o],a=t[u],d=i.x,m=i.y,c=a.x,g=a.y;m>n!=g>n&&r<(c-d)*(n-m)/(g-m)+d&&(s=!s)}return s}function BN(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),FN(t)}function FN(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=2;){const o=t[t.length-1],u=t[t.length-2];if((o.x-u.x)*(s.y-u.y)>=(o.y-u.y)*(s.x-u.x))t.pop();else break}t.push(s)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],u=r[r.length-2];if((o.x-u.x)*(s.y-u.y)>=(o.y-u.y)*(s.x-u.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var $N=Vy,Xy=Ky;const HN=S.forwardRef(({className:e,sideOffset:t=4,...r},n)=>v.jsx($N,{children:v.jsx(Xy,{ref:n,sideOffset:t,className:re("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 origin-[--radix-tooltip-content-transform-origin]",e),...r})}));HN.displayName=Xy.displayName;S.createContext(!1);function zN({message:e="Loading...",className:t,fullPage:r=!1}){return v.jsxs("div",{className:re("flex flex-col items-center gap-3 text-muted-foreground",r?"fixed inset-0 z-50 justify-center bg-background":"absolute inset-0 justify-center",t),children:[v.jsx(fC,{className:"h-8 w-8 animate-spin text-primary"}),e&&v.jsx("p",{className:"text-sm",children:e})]})}function WN(){const{setTheme:e,resolvedTheme:t}=Db();return v.jsxs(dv,{variant:"ghost",size:"icon",className:"relative h-8 w-8",onClick:()=>e(t==="dark"?"light":"dark"),children:[v.jsx(LC,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),v.jsx(vC,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),v.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}const UN=()=>v.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z"}),v.jsx("path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z"}),v.jsx("path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0"}),v.jsx("path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"})]});function Md(){return v.jsxs("span",{className:"logo",children:[v.jsx("span",{className:"logo-icon",children:v.jsx(UN,{})}),v.jsx("span",{className:"logo-text",children:"LaunchPod"})]})}const VN=()=>v.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:v.jsx("polyline",{points:"20 6 9 17 4 12"})}),KN=["Automated security scanning","GitHub-native CI/CD integration","Team collaboration built in"];function GN(){return v.jsxs("div",{className:"brand-panel auth-gradient",children:[v.jsx("div",{className:"auth-blob auth-blob--1"}),v.jsx("div",{className:"auth-blob auth-blob--2"}),v.jsx("div",{className:"auth-blob auth-blob--3"}),v.jsx(Md,{}),v.jsxs("div",{className:"brand-content",children:[v.jsx("h1",{children:"Ship secure software, faster."}),v.jsx("ul",{className:"feature-list",children:KN.map(e=>v.jsxs("li",{children:[v.jsx(VN,{}),v.jsx("span",{children:e})]},e))})]}),v.jsx("p",{className:"brand-footer",children:"Trusted by development teams"})]})}const qN=()=>v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),v.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),XN=()=>v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),v.jsx("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),v.jsx("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),v.jsx("path",{d:"m2 2 20 20"})]});function YN({onSuccess:e}){const[t,r]=S.useState(""),[n,s]=S.useState(!1),[o,u]=S.useState(""),[i,a]=S.useState(!1),d=async m=>{m.preventDefault(),u(""),a(!0);try{const g=await(await fetch("/api/auth",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:t.trim()})})).json();g.success?e():u(g.error||"Invalid token")}catch{u("Connection failed")}finally{a(!1)}};return v.jsxs("div",{className:"auth-layout",children:[v.jsx(GN,{}),v.jsx("div",{className:"form-panel",children:v.jsxs("div",{className:"form-container",children:[v.jsx("div",{className:"mobile-logo",children:v.jsx(Md,{})}),v.jsxs("div",{className:"form-header",children:[v.jsx("h2",{children:"Connect your pod"}),v.jsx("p",{children:"Enter your MCP runner token to authenticate"})]}),o&&v.jsx("div",{className:"error-box",children:o}),v.jsxs("form",{onSubmit:d,children:[v.jsxs("div",{className:"form-group",children:[v.jsx("label",{htmlFor:"token",children:"MCP Runner Token"}),v.jsxs("div",{className:"input-wrapper",children:[v.jsx("input",{id:"token",className:"input input--with-toggle",type:n?"text":"password",placeholder:"Paste your MCP runner token",required:!0,autoComplete:"off",value:t,onChange:m=>r(m.target.value)}),v.jsx("button",{type:"button",className:"toggle-visibility",onClick:()=>s(!n),tabIndex:-1,children:n?v.jsx(XN,{}):v.jsx(qN,{})})]})]}),v.jsx("button",{type:"submit",className:"btn btn--primary btn--lg",disabled:i,children:i?"Connecting...":"Connect"})]}),v.jsx("p",{className:"help-text",children:"Find your MCP runner token in the LaunchSecure dashboard under Pipeline Settings."})]})})]})}const JN=5,QN=1e3,ZN=3e4;function jd({onMessage:e}){const[t,r]=S.useState("disconnected"),[n,s]=S.useState(null),o=S.useRef(null),u=S.useRef(0),i=S.useRef(null),a=S.useRef(e);a.current=e;const d=S.useCallback(m=>{const c=o.current;c&&c.readyState===WebSocket.OPEN&&c.send(JSON.stringify(m))},[]);return S.useEffect(()=>{let m=!1,c=null;function g(){if(m)return;r("connecting");const C=location.protocol==="https:"?"wss:":"ws:",_=new WebSocket(`${C}//${location.host}/terminal/ws`);o.current=_,_.onopen=()=>{if(m){_.close();return}u.current=0,r("connected"),i.current=setInterval(()=>{_.readyState===WebSocket.OPEN&&_.send(JSON.stringify({type:"ping"}))},ZN)},_.onmessage=p=>{if(m)return;const h=JSON.parse(p.data);h.type==="connected"&&s(h.connectionId),a.current(h)},_.onclose=p=>{if(!m&&(y(),r("disconnected"),!p.wasClean&&u.current<JN)){const h=QN*Math.pow(2,u.current);u.current+=1,c=setTimeout(g,h)}},_.onerror=()=>{}}function y(){i.current&&(clearInterval(i.current),i.current=null)}return g(),()=>{var C;m=!0,y(),c&&clearTimeout(c),(C=o.current)==null||C.close(),o.current=null}},[]),{status:t,connectionId:n,send:d}}function eL(){return v.jsxs("header",{className:"sticky top-0 z-40 flex h-[var(--header-height)] items-center border-b bg-background/80 backdrop-blur-md px-4 shadow-sm",children:[v.jsx(Md,{}),v.jsx("div",{className:"ml-auto flex items-center gap-2",children:v.jsx(WN,{})})]})}const Ji="sidebar-nav-item active relative flex items-center gap-3 overflow-hidden rounded-lg px-3 py-1.5 text-sm bg-gradient-to-r from-sidebar-primary/20 via-transparent via-80% to-transparent font-medium text-sidebar-foreground before:absolute before:left-0 before:top-0 before:h-full before:w-[3px] before:rounded-full before:bg-sidebar-primary",ws="sidebar-nav-item relative flex w-full items-center gap-3 overflow-hidden rounded-lg px-3 py-1.5 text-sm font-normal text-sidebar-muted-foreground transition-colors duration-200 hover:text-sidebar-foreground bg-transparent border-none cursor-pointer";function tL({onLogout:e,terminalAvailable:t,activePage:r="dashboard",onNavigate:n}){return v.jsxs("aside",{className:"hidden lg:flex lg:flex-col w-[var(--sidebar-width)] sidebar-gradient",children:[v.jsx("nav",{className:"flex-1 overflow-y-auto px-3 py-4",children:v.jsxs("ul",{className:"space-y-1",children:[v.jsx("li",{children:v.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n("dashboard"),className:r==="dashboard"?Ji:ws,children:[v.jsx(dC,{className:"h-4 w-4 shrink-0"}),"Dashboard"]})}),t&&v.jsx("li",{children:v.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n("terminal"),className:r==="terminal"?Ji:ws,children:[v.jsx(DC,{className:"h-4 w-4 shrink-0"}),"Terminal"]})}),v.jsx("li",{children:v.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n("settings"),className:r==="settings"?Ji:ws,children:[v.jsx(TC,{className:"h-4 w-4 shrink-0"}),"Settings"]})}),v.jsx("li",{children:v.jsxs("button",{type:"button",onClick:()=>n==null?void 0:n("repair"),className:r==="repair"?Ji:ws,children:[v.jsx(OC,{className:"h-4 w-4 shrink-0"}),"Repair"]})})]})}),v.jsx("div",{className:"border-t border-sidebar-border px-3 py-3",children:v.jsxs("button",{type:"button",onClick:e,className:ws,children:[v.jsx(mC,{className:"h-4 w-4 shrink-0"}),"Disconnect"]})})]})}function Zo(e){return e.toLowerCase()}function rL(e){const t=new Map;for(const r of e){const n=t.get(r.ph);n?n.push(r):t.set(r.ph,[r])}return t}function Yy(e){return e.replace(/_/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function nL(e){return e==="script_pod"?"LOCAL":e==="script"?"SCRIPT":"LLM"}function Id({status:e}){return v.jsx("span",{className:`agent-status-dot agent-status-dot--${Zo(e)}`})}function sL({agent:e,status:t,selected:r,dim:n,onClick:s}){const o=["pipeline-compact-item",r&&"pipeline-compact-item--selected",n&&"pipeline-compact-item--dim"].filter(Boolean).join(" ");return v.jsxs("button",{type:"button",className:o,onClick:s,children:[v.jsx(Id,{status:t}),v.jsx("span",{className:"pipeline-compact-name",children:e.nm})]})}function Xf({agents:e,agentStatuses:t,selectedId:r,onSelect:n,nextUpIds:s}){const o=rL(e),u=Array.from(o.keys()).sort((i,a)=>i-a);return e.length===0?v.jsx("div",{className:"pipeline-empty-state",children:"None yet"}):v.jsx(v.Fragment,{children:u.map(i=>v.jsxs("div",{className:"pipeline-phase-group",children:[v.jsxs("div",{className:"pipeline-phase-label",children:["Phase ",i]}),o.get(i).map(a=>{var m;const d=t!=null&&t[a.id]?Zo(((m=t[a.id])==null?void 0:m.status)??"pending"):"pending";return v.jsx(sL,{agent:a,status:d,selected:r===a.id,dim:s?!s.has(a.id):!1,onClick:()=>n(a.id)},a.id)})]},i))})}function Yf({agent:e,status:t,triggeredAt:r,completedAt:n,needsAttention:s,previews:o,onOpenTerminal:u,podProgressState:i,onResolveIntervention:a,interventions:d}){const[m,c]=S.useState(0);let g=i;if(e.tp==="script_pod"&&!g){const h=d==null?void 0:d.find(l=>l.agent_id===e.id&&l.status==="pending");h&&(g={messages:[{text:h.message,level:"info",ts:Date.now()}],templateMatch:null})}const y=e.tp==="script_pod"&&g,C=o&&o.length>0?Math.min(m,o.length-1):0,_=o==null?void 0:o[C],p=e.gr==="per_unit"&&o&&o.length>1;return v.jsxs("div",{className:`pipeline-detail-card pipeline-detail-card--${t}`,children:[v.jsxs("div",{className:"pipeline-detail-left",children:[v.jsxs("div",{className:"pipeline-detail-header",children:[v.jsx(Id,{status:t}),v.jsx("span",{className:"pipeline-detail-name",children:e.nm}),s&&v.jsx("span",{className:"pipeline-attention-dot",title:"Terminal may need input"})]}),v.jsxs("div",{className:"pipeline-detail-meta",children:[v.jsx("span",{className:"pipeline-detail-id",children:e.id}),v.jsx("span",{className:"pipeline-detail-runner",children:nL(e.tp)})]}),v.jsxs("div",{className:"pipeline-detail-badges",children:[v.jsx("span",{className:"agent-badge agent-badge--ia",children:e.ia}),v.jsx("span",{className:"agent-badge agent-badge--gr",children:e.gr==="per_unit"?"per-unit":e.gr})]}),v.jsxs("div",{className:"pipeline-detail-info",children:[v.jsxs("span",{children:["Phase ",e.ph]}),r&&v.jsxs("span",{children:["Started: ",new Date(r).toLocaleTimeString()]}),n&&v.jsxs("span",{children:["Completed: ",new Date(n).toLocaleTimeString()]})]})]}),v.jsxs("div",{className:"pipeline-detail-right",children:[p&&v.jsx("div",{className:"pipeline-unit-tabs",children:o.map((h,l)=>v.jsx("button",{type:"button",className:`pipeline-unit-tab${l===C?" pipeline-unit-tab--active":""}`,onClick:()=>c(l),children:h.unitId||`unit-${l}`},h.sessionId))}),y?v.jsx(oL,{podState:g}):_!=null&&_.text?v.jsx("pre",{className:"pipeline-preview-text",children:_.text}):v.jsx("div",{className:"pipeline-preview-empty",children:"No output yet"}),e.tp==="script_pod"&&a&&(d==null?void 0:d.filter(h=>h.agent_id===e.id&&h.status==="pending").map(h=>{const{runText:l,skipText:f}=Jy(h);return v.jsxs("div",{className:"pipeline-intervention-actions",style:{marginTop:"8px"},children:[v.jsx("button",{type:"button",onClick:()=>a(h.id,"continue"),className:"pipeline-intervention-btn pipeline-intervention-btn--run",children:l}),v.jsx("button",{type:"button",onClick:()=>a(h.id,"skip"),className:"pipeline-intervention-btn pipeline-intervention-btn--skip",children:f})]},h.id)})),!y&&(_==null?void 0:_.sessionId)&&u&&v.jsx("button",{type:"button",className:"pipeline-open-terminal-btn",title:"Open terminal",onClick:()=>u(_.sessionId),children:v.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("polyline",{points:"4 17 10 11 4 5"}),v.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})})]})]})}function Jy(e){if(e.agent_id==="workspace_setup")return{label:"Workspace Setup",runText:"Use Template",skipText:"Custom Build"};switch(e.type.toLowerCase()){case"checkpoint":return{label:"Checkpoint",runText:"Continue",skipText:"Skip"};case"error":return{label:"Error",runText:"Retry",skipText:"Skip"};case"loop_escalation":return{label:"Loop Escalation",runText:"Continue",skipText:"Stop"};default:return{label:"Review Gate",runText:"Run",skipText:"Skip"}}}function iL({intervention:e,onResolve:t}){const[r,n]=S.useState(!1),{label:s,runText:o,skipText:u}=Jy(e),i=a=>{n(!0),t(e.id,a)};return v.jsxs("div",{className:"pipeline-intervention-card",children:[v.jsx("div",{className:"pipeline-intervention-label",children:s}),v.jsx("div",{className:"pipeline-intervention-agent",children:Yy(e.agent_id)}),e.message&&v.jsx("p",{className:"pipeline-intervention-msg",children:e.message}),v.jsxs("div",{className:"pipeline-intervention-actions",children:[v.jsx("button",{type:"button",disabled:r,onClick:()=>i("continue"),className:"pipeline-intervention-btn pipeline-intervention-btn--run",children:r?"...":o}),v.jsx("button",{type:"button",disabled:r,onClick:()=>i("skip"),className:"pipeline-intervention-btn pipeline-intervention-btn--skip",children:r?"...":u})]})]})}function oL({podState:e}){const{messages:t}=e;return v.jsx("div",{className:"pod-progress-panel",children:v.jsx("div",{className:"pod-progress-log",children:t.map((r,n)=>v.jsx("div",{className:`pod-progress-entry pod-progress-entry--${r.level}`,children:r.text},n))})})}function aL({agentId:e,agentName:t,error:r}){const[n,s]=S.useState(!1);return v.jsxs("div",{className:"pipeline-detail-card pipeline-detail-card--failed",children:[v.jsxs("div",{className:"pipeline-detail-left",children:[v.jsxs("div",{className:"pipeline-detail-header",children:[v.jsx(Id,{status:"failed"}),v.jsx("span",{className:"pipeline-detail-name",children:t??Yy(e)})]}),v.jsx("div",{className:"pipeline-detail-meta",children:v.jsx("span",{className:"pipeline-detail-id",children:e})}),v.jsx("div",{style:{marginTop:"0.5rem"},children:v.jsx("span",{className:"text-red-400 text-xs font-medium",children:"Node failed to start"})}),v.jsx("button",{type:"button",onClick:()=>s(!n),className:"inline-flex items-center gap-1 mt-2 px-2 py-1 rounded text-xs bg-zinc-700 hover:bg-zinc-600 text-zinc-200 transition-colors",children:n?"Hide Log":"Show Log"})]}),v.jsx("div",{className:"pipeline-detail-right",children:n?v.jsx("pre",{className:"pipeline-preview-text",style:{color:"var(--color-red-300, #fca5a5)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:r}):v.jsx("div",{className:"pipeline-preview-empty",children:'Click "Show Log" for details'})})]})}function lL({data:e,agentStatuses:t,interventions:r,onResolveIntervention:n,stalled:s,onPoke:o,attentionAgentIds:u,sessionPreviews:i,onOpenTerminal:a,podProgressStates:d,runStatus:m,nodeErrors:c}){const[g,y]=S.useState(null),C=T=>y(M=>M===T?null:T),_=e.nd??[],p=new Map(_.map(T=>[T.id,T])),h=[],l=[],f=[];for(const T of _){const M=t==null?void 0:t[T.id],O=M?Zo(M.status):"pending";O==="completed"||O==="failed"?h.push(T):O==="in_progress"?l.push(T):f.push(T)}const x=new Set;if(f.length>0){const T=Math.min(...f.map(M=>M.ph));for(const M of f)M.ph===T&&x.add(M.id)}const E=new Set(_.filter(T=>T.tp==="script_pod").map(T=>T.id)),k=(r??[]).filter(T=>T.status==="pending"&&!E.has(T.agent_id)),b=g?p.get(g):null,w=g?t==null?void 0:t[g]:null,R=w?Zo(w.status):"pending";return v.jsxs("div",{className:"pipeline-dashboard",children:[v.jsxs("div",{className:"pipeline-col pipeline-col--left",children:[v.jsx("div",{className:"pipeline-col-header",children:"Completed"}),v.jsx("div",{className:"pipeline-col-body",children:v.jsx(Xf,{agents:h,agentStatuses:t,selectedId:g,onSelect:C})})]}),v.jsxs("div",{className:"pipeline-col pipeline-col--center",children:[v.jsx("div",{className:"pipeline-col-header",children:"Active"}),v.jsxs("div",{className:"pipeline-col-body",children:[n&&k.map(T=>v.jsx(iL,{intervention:T,onResolve:n},T.id)),b&&!l.some(T=>T.id===g)&&v.jsx(Yf,{agent:b,status:R,triggeredAt:w==null?void 0:w.triggered_at,completedAt:w==null?void 0:w.completed_at,needsAttention:u==null?void 0:u.has(b.id),previews:i==null?void 0:i[b.id],onOpenTerminal:a,podProgressState:d==null?void 0:d[b.id],onResolveIntervention:n,interventions:r}),l.map(T=>{const M=t==null?void 0:t[T.id];return v.jsx(Yf,{agent:T,status:"in_progress",triggeredAt:M==null?void 0:M.triggered_at,completedAt:M==null?void 0:M.completed_at,needsAttention:u==null?void 0:u.has(T.id),previews:i==null?void 0:i[T.id],onOpenTerminal:a,podProgressState:d==null?void 0:d[T.id],onResolveIntervention:n,interventions:r},T.id)}),c&&Object.entries(c).map(([T,M])=>{const O=p.get(T);return v.jsx(aL,{agentId:T,agentName:O==null?void 0:O.nm,error:M},`err-${T}`)}),!b&&l.length===0&&k.length===0&&Object.keys(c??{}).length===0&&(m==="completed"?v.jsxs("div",{className:"pipeline-empty-state pipeline-empty-state--completed",children:[v.jsx("span",{className:"agent-status-dot agent-status-dot--completed"}),v.jsx("span",{children:"Pipeline Complete"})]}):m==="paused"?v.jsxs("div",{className:"pipeline-empty-state",children:[v.jsx("span",{className:"agent-status-dot agent-status-dot--pending"}),v.jsx("span",{children:"Pipeline Paused"})]}):v.jsxs("div",{className:"pipeline-empty-state",children:[v.jsx("span",{className:"agent-status-dot agent-status-dot--in_progress"}),v.jsx("span",{children:"Waiting for next node..."})]}))]})]}),v.jsxs("div",{className:"pipeline-col pipeline-col--right",children:[v.jsx("div",{className:"pipeline-col-header",children:"Upcoming"}),v.jsx("div",{className:"pipeline-col-body",children:v.jsx(Xf,{agents:f,agentStatuses:t,selectedId:g,onSelect:C,nextUpIds:x})})]})]})}let Jf=!1,Qi=null;function cL({send:e,xtermRef:t,defaultAgent:r,autoSessionId:n}){const[s,o]=S.useState(null),[u,i]=S.useState(!1),a=S.useRef(r);a.current=r;const d=S.useRef(n);d.current=n;function m(C){e({type:C==="claude"?"start_claude":C==="codex"?"start_codex":"start_agent"})}const c=S.useCallback((C,_)=>{e({type:C==="claude"?"start_claude":C==="codex"?"start_codex":"start_agent",options:_})},[e]),g=S.useCallback(()=>{e({type:"stop"})},[e]),y=S.useCallback(C=>{var _,p,h;switch(C.type){case"connected":{if(Jf)break;Jf=!0;const l=d.current;if(l){o(l),e({type:"join_session",sessionId:l});break}Qi==null||Qi.abort();const f=new AbortController;Qi=f,fetch("/terminal/api/sessions/list",{signal:f.signal}).then(x=>x.json()).then(x=>{const E=x.sessions??[];if(E.length>0){const k=E[0];o(k.id),i(k.active),e({type:"join_session",sessionId:k.id}),!k.active&&a.current&&setTimeout(()=>m(a.current),100)}else e({type:"create_session",name:"Session 1"})}).catch(()=>{f.signal.aborted||e({type:"create_session",name:"Session 1"})});break}case"session_created":{o(C.sessionId),i(!1);const l=a.current;l&&m(l);break}case"session_joined":{if(o(C.sessionId),i(C.active),(_=t.current)==null||_.clear(),(p=C.outputBuffer)!=null&&p.length)for(const l of C.outputBuffer)(h=t.current)==null||h.write(l.replace(/\x1b\[\[?[IO]/g,""));setTimeout(()=>{var l;return(l=t.current)==null?void 0:l.fit()},0);break}case"session_left":case"session_deleted":break;case"claude_started":case"codex_started":case"agent_started":i(!0);break;case"claude_stopped":case"codex_stopped":case"agent_stopped":i(!1);break;case"exit":i(!1);break}},[e,t]);return{sessionId:s,agentRunning:u,handleMessage:y,startAgent:c,stopAgent:g}}const Qf=1e4,uL=["Plan mode is active","you MUST NOT make any edits","present your plan by calling the ExitPlanMode tool","Starting plan mode"],dL=["User has approved your plan","You can now start coding","Plan mode exited","Exiting plan mode"],hL=[/## Implementation Plan:/,/### \d+\. /,/## Plan:/,/### Plan Overview/,/## Proposed Solution:/];function Zf(e){return e.replace(/\x1b\[[0-9;]*m/g,"").replace(/\x1b\[[0-9]*[A-Za-z]/g,"")}function Qy(){const[e,t]=S.useState(null),[r,n]=S.useState(!1),s=S.useRef([]),o=S.useRef(!1),u=S.useCallback((m=5e4)=>{const c=s.current.join("");return Zf(c).slice(-m)},[]),i=S.useCallback(m=>{let c=null;const g=m.match(/## Implementation Plan:[\s\S]*?(?=(?:User has approved|Exit plan mode|[$>]|^[a-z]+@))/im);if(g&&(c=g[0]),!c){const y=m.match(/##[^#].*?Plan.*?:[\s\S]*?(?:###.*?[\s\S]*?){2,}(?=(?:User has approved|Exit plan mode|[$>]|^[a-z]+@))/im);y&&(c=y[0])}if(!c){const C=m.slice(-5e3).match(/(?:##|Plan:)[\s\S]*?(?:###[\s\S]*?){1,}/);C&&(c=C[0])}return c?(c=Zf(c).replace(/\r\n/g,`
270
+ `).replace(/\r/g,`
271
+ `).trim(),{content:c,timestamp:Date.now()}):null},[]),a=S.useCallback(m=>{s.current.push(m),s.current.length>Qf&&(s.current=s.current.slice(-Qf/2));const c=u();if(o.current||uL.some(y=>c.includes(y))&&(o.current=!0,n(!0)),o.current){const g=hL.some(C=>C.test(c)),y=c.slice(-1e4);if(g&&y.includes("###")){const C=i(c);C&&t(C)}}o.current&&dL.some(y=>c.includes(y))&&(o.current=!1,n(!1),t(null))},[u,i]),d=S.useCallback(()=>{t(null),s.current=[],o.current=!1,n(!1)},[]);return{plan:e,planModeActive:r,processOutput:a,clearPlan:d}}const Zy="launchpod-settings",jl={defaultAgent:"claude"};function ex(){try{const e=localStorage.getItem(Zy);return e?{...jl,...JSON.parse(e)}:jl}catch{return jl}}function fL(e){localStorage.setItem(Zy,JSON.stringify(e));try{const t=JSON.parse(localStorage.getItem("launchpod-terminal-settings")||"{}");t.defaultAgent=e.defaultAgent,localStorage.setItem("launchpod-terminal-settings",JSON.stringify(t))}catch{}}function pL(){const[e,t]=S.useState(ex),[r,n]=S.useState(!1),s=()=>{fL(e),n(!0),setTimeout(()=>n(!1),2e3)};return v.jsxs("div",{className:"max-w-xl mx-auto py-10 px-6",children:[v.jsx("h1",{className:"text-xl font-semibold text-foreground mb-6",children:"Settings"}),v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"space-y-2",children:[v.jsx("label",{className:"block text-sm font-medium text-foreground",children:"Default Agent"}),v.jsx("p",{className:"text-xs text-muted-foreground",children:"Which agent to show in the start prompt when opening the terminal."}),v.jsxs("select",{value:e.defaultAgent,onChange:o=>t({...e,defaultAgent:o.target.value}),className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring",children:[v.jsx("option",{value:"claude",children:"Claude"}),v.jsx("option",{value:"codex",children:"Codex"}),v.jsx("option",{value:"agent",children:"Cursor"})]})]}),v.jsx("button",{onClick:s,className:"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 transition-colors",children:r?"Saved":"Save Settings"})]})]})}var tx={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(globalThis,()=>(()=>{var r={4567:function(u,i,a){var d=this&&this.__decorate||function(l,f,x,E){var k,b=arguments.length,w=b<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(l,f,x,E);else for(var R=l.length-1;R>=0;R--)(k=l[R])&&(w=(b<3?k(w):b>3?k(f,x,w):k(f,x))||w);return b>3&&w&&Object.defineProperty(f,x,w),w},m=this&&this.__param||function(l,f){return function(x,E){f(x,E,l)}};Object.defineProperty(i,"__esModule",{value:!0}),i.AccessibilityManager=void 0;const c=a(9042),g=a(9924),y=a(844),C=a(4725),_=a(2585),p=a(3656);let h=i.AccessibilityManager=class extends y.Disposable{constructor(l,f,x,E){super(),this._terminal=l,this._coreBrowserService=x,this._renderService=E,this._rowColumns=new WeakMap,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 k=0;k<this._terminal.rows;k++)this._rowElements[k]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[k]);if(this._topBoundaryFocusListener=k=>this._handleBoundaryFocus(k,0),this._bottomBoundaryFocusListener=k=>this._handleBoundaryFocus(k,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 g.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(k=>this._handleResize(k.rows))),this.register(this._terminal.onRender(k=>this._refreshRows(k.start,k.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(k=>this._handleChar(k))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
272
+ `))),this.register(this._terminal.onA11yTab(k=>this._handleTab(k))),this.register(this._terminal.onKey(k=>this._handleKey(k.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,p.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,y.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(l){for(let f=0;f<l;f++)this._handleChar(" ")}_handleChar(l){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==l&&(this._charsToAnnounce+=l):this._charsToAnnounce+=l,l===`
273
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=c.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(l){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(l)||this._charsToConsume.push(l)}_refreshRows(l,f){this._liveRegionDebouncer.refresh(l,f,this._terminal.rows)}_renderRows(l,f){const x=this._terminal.buffer,E=x.lines.length.toString();for(let k=l;k<=f;k++){const b=x.lines.get(x.ydisp+k),w=[],R=(b==null?void 0:b.translateToString(!0,void 0,void 0,w))||"",T=(x.ydisp+k+1).toString(),M=this._rowElements[k];M&&(R.length===0?(M.innerText=" ",this._rowColumns.set(M,[0,1])):(M.textContent=R,this._rowColumns.set(M,w)),M.setAttribute("aria-posinset",T),M.setAttribute("aria-setsize",E))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(l,f){const x=l.target,E=this._rowElements[f===0?1:this._rowElements.length-2];if(x.getAttribute("aria-posinset")===(f===0?"1":`${this._terminal.buffer.lines.length}`)||l.relatedTarget!==E)return;let k,b;if(f===0?(k=x,b=this._rowElements.pop(),this._rowContainer.removeChild(b)):(k=this._rowElements.shift(),b=x,this._rowContainer.removeChild(k)),k.removeEventListener("focus",this._topBoundaryFocusListener),b.removeEventListener("focus",this._bottomBoundaryFocusListener),f===0){const w=this._createAccessibilityTreeNode();this._rowElements.unshift(w),this._rowContainer.insertAdjacentElement("afterbegin",w)}else{const w=this._createAccessibilityTreeNode();this._rowElements.push(w),this._rowContainer.appendChild(w)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(f===0?-1:1),this._rowElements[f===0?1:this._rowElements.length-2].focus(),l.preventDefault(),l.stopImmediatePropagation()}_handleSelectionChange(){var R;if(this._rowElements.length===0)return;const l=document.getSelection();if(!l)return;if(l.isCollapsed)return void(this._rowContainer.contains(l.anchorNode)&&this._terminal.clearSelection());if(!l.anchorNode||!l.focusNode)return void console.error("anchorNode and/or focusNode are null");let f={node:l.anchorNode,offset:l.anchorOffset},x={node:l.focusNode,offset:l.focusOffset};if((f.node.compareDocumentPosition(x.node)&Node.DOCUMENT_POSITION_PRECEDING||f.node===x.node&&f.offset>x.offset)&&([f,x]=[x,f]),f.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(f={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(f.node))return;const E=this._rowElements.slice(-1)[0];if(x.node.compareDocumentPosition(E)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(x={node:E,offset:((R=E.textContent)==null?void 0:R.length)??0}),!this._rowContainer.contains(x.node))return;const k=({node:T,offset:M})=>{const O=T instanceof Text?T.parentNode:T;let A=parseInt(O==null?void 0:O.getAttribute("aria-posinset"),10)-1;if(isNaN(A))return console.warn("row is invalid. Race condition?"),null;const F=this._rowColumns.get(O);if(!F)return console.warn("columns is null. Race condition?"),null;let U=M<F.length?F[M]:F.slice(-1)[0]+1;return U>=this._terminal.cols&&(++A,U=0),{row:A,column:U}},b=k(f),w=k(x);if(b&&w){if(b.row>w.row||b.row===w.row&&b.column>=w.column)throw new Error("invalid range");this._terminal.select(b.column,b.row,(w.row-b.row)*this._terminal.cols-b.column+w.column)}}_handleResize(l){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let f=this._rowContainer.children.length;f<this._terminal.rows;f++)this._rowElements[f]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[f]);for(;this._rowElements.length>l;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const l=this._coreBrowserService.mainDocument.createElement("div");return l.setAttribute("role","listitem"),l.tabIndex=-1,this._refreshRowDimensions(l),l}_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 l=0;l<this._terminal.rows;l++)this._refreshRowDimensions(this._rowElements[l])}}_refreshRowDimensions(l){l.style.height=`${this._renderService.dimensions.css.cell.height}px`}};i.AccessibilityManager=h=d([m(1,_.IInstantiationService),m(2,C.ICoreBrowserService),m(3,C.IRenderService)],h)},3614:(u,i)=>{function a(g){return g.replace(/\r?\n/g,"\r")}function d(g,y){return y?"\x1B[200~"+g+"\x1B[201~":g}function m(g,y,C,_){g=d(g=a(g),C.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(g,!0),y.value=""}function c(g,y,C){const _=C.getBoundingClientRect(),p=g.clientX-_.left-10,h=g.clientY-_.top-10;y.style.width="20px",y.style.height="20px",y.style.left=`${p}px`,y.style.top=`${h}px`,y.style.zIndex="1000",y.focus()}Object.defineProperty(i,"__esModule",{value:!0}),i.rightClickHandler=i.moveTextAreaUnderMouseCursor=i.paste=i.handlePasteEvent=i.copyHandler=i.bracketTextForPaste=i.prepareTextForTerminal=void 0,i.prepareTextForTerminal=a,i.bracketTextForPaste=d,i.copyHandler=function(g,y){g.clipboardData&&g.clipboardData.setData("text/plain",y.selectionText),g.preventDefault()},i.handlePasteEvent=function(g,y,C,_){g.stopPropagation(),g.clipboardData&&m(g.clipboardData.getData("text/plain"),y,C,_)},i.paste=m,i.moveTextAreaUnderMouseCursor=c,i.rightClickHandler=function(g,y,C,_,p){c(g,y,C),p&&_.rightClickSelect(g),y.value=_.selectionText,y.select()}},7239:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorContrastCache=void 0;const d=a(1505);i.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(m,c,g){this._css.set(m,c,g)}getCss(m,c){return this._css.get(m,c)}setColor(m,c,g){this._color.set(m,c,g)}getColor(m,c){return this._color.get(m,c)}clear(){this._color.clear(),this._css.clear()}}},3656:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=void 0,i.addDisposableDomListener=function(a,d,m,c){a.addEventListener(d,m,c);let g=!1;return{dispose:()=>{g||(g=!0,a.removeEventListener(d,m,c))}}}},3551:function(u,i,a){var d=this&&this.__decorate||function(h,l,f,x){var E,k=arguments.length,b=k<3?l:x===null?x=Object.getOwnPropertyDescriptor(l,f):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(h,l,f,x);else for(var w=h.length-1;w>=0;w--)(E=h[w])&&(b=(k<3?E(b):k>3?E(l,f,b):E(l,f))||b);return k>3&&b&&Object.defineProperty(l,f,b),b},m=this&&this.__param||function(h,l){return function(f,x){l(f,x,h)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Linkifier=void 0;const c=a(3656),g=a(8460),y=a(844),C=a(2585),_=a(4725);let p=i.Linkifier=class extends y.Disposable{get currentLink(){return this._currentLink}constructor(h,l,f,x,E){super(),this._element=h,this._mouseService=l,this._renderService=f,this._bufferService=x,this._linkProviderService=E,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,y.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,y.toDisposable)(()=>{var k;this._lastMouseEvent=void 0,(k=this._activeProviderReplies)==null||k.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,c.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,c.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,c.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,c.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(h){this._lastMouseEvent=h;const l=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!l)return;this._isMouseOut=!1;const f=h.composedPath();for(let x=0;x<f.length;x++){const E=f[x];if(E.classList.contains("xterm"))break;if(E.classList.contains("xterm-hover"))return}this._lastBufferCell&&l.x===this._lastBufferCell.x&&l.y===this._lastBufferCell.y||(this._handleHover(l),this._lastBufferCell=l)}_handleHover(h){if(this._activeLine!==h.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(h,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,h)||(this._clearCurrentLink(),this._askForLink(h,!0))}_askForLink(h,l){var x,E;this._activeProviderReplies&&l||((x=this._activeProviderReplies)==null||x.forEach(k=>{k==null||k.forEach(b=>{b.link.dispose&&b.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=h.y);let f=!1;for(const[k,b]of this._linkProviderService.linkProviders.entries())l?(E=this._activeProviderReplies)!=null&&E.get(k)&&(f=this._checkLinkProviderResult(k,h,f)):b.provideLinks(h.y,w=>{var T,M;if(this._isMouseOut)return;const R=w==null?void 0:w.map(O=>({link:O}));(T=this._activeProviderReplies)==null||T.set(k,R),f=this._checkLinkProviderResult(k,h,f),((M=this._activeProviderReplies)==null?void 0:M.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)})}_removeIntersectingLinks(h,l){const f=new Set;for(let x=0;x<l.size;x++){const E=l.get(x);if(E)for(let k=0;k<E.length;k++){const b=E[k],w=b.link.range.start.y<h?0:b.link.range.start.x,R=b.link.range.end.y>h?this._bufferService.cols:b.link.range.end.x;for(let T=w;T<=R;T++){if(f.has(T)){E.splice(k--,1);break}f.add(T)}}}}_checkLinkProviderResult(h,l,f){var k;if(!this._activeProviderReplies)return f;const x=this._activeProviderReplies.get(h);let E=!1;for(let b=0;b<h;b++)this._activeProviderReplies.has(b)&&!this._activeProviderReplies.get(b)||(E=!0);if(!E&&x){const b=x.find(w=>this._linkAtPosition(w.link,l));b&&(f=!0,this._handleNewLink(b))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!f)for(let b=0;b<this._activeProviderReplies.size;b++){const w=(k=this._activeProviderReplies.get(b))==null?void 0:k.find(R=>this._linkAtPosition(R.link,l));if(w){f=!0,this._handleNewLink(w);break}}return f}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._currentLink)return;const l=this._positionFromMouseEvent(h,this._element,this._mouseService);l&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,l)&&this._currentLink.link.activate(h,this._currentLink.link.text)}_clearCurrentLink(h,l){this._currentLink&&this._lastMouseEvent&&(!h||!l||this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=l)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,y.disposeArray)(this._linkCacheDisposables))}_handleNewLink(h){if(!this._lastMouseEvent)return;const l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._linkAtPosition(h.link,l)&&(this._currentLink=h,this._currentLink.state={decorations:{underline:h.link.decorations===void 0||h.link.decorations.underline,pointerCursor:h.link.decorations===void 0||h.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,h.link,this._lastMouseEvent),h.link.decorations={},Object.defineProperties(h.link.decorations,{pointerCursor:{get:()=>{var f,x;return(x=(f=this._currentLink)==null?void 0:f.state)==null?void 0:x.decorations.pointerCursor},set:f=>{var x;(x=this._currentLink)!=null&&x.state&&this._currentLink.state.decorations.pointerCursor!==f&&(this._currentLink.state.decorations.pointerCursor=f,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",f))}},underline:{get:()=>{var f,x;return(x=(f=this._currentLink)==null?void 0:f.state)==null?void 0:x.decorations.underline},set:f=>{var x,E,k;(x=this._currentLink)!=null&&x.state&&((k=(E=this._currentLink)==null?void 0:E.state)==null?void 0:k.decorations.underline)!==f&&(this._currentLink.state.decorations.underline=f,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,f))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(f=>{if(!this._currentLink)return;const x=f.start===0?0:f.start+1+this._bufferService.buffer.ydisp,E=this._bufferService.buffer.ydisp+1+f.end;if(this._currentLink.link.range.start.y>=x&&this._currentLink.link.range.end.y<=E&&(this._clearCurrentLink(x,E),this._lastMouseEvent)){const k=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);k&&this._askForLink(k,!1)}})))}_linkHover(h,l,f){var x;(x=this._currentLink)!=null&&x.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!0),this._currentLink.state.decorations.pointerCursor&&h.classList.add("xterm-cursor-pointer")),l.hover&&l.hover(f,l.text)}_fireUnderlineEvent(h,l){const f=h.range,x=this._bufferService.buffer.ydisp,E=this._createLinkUnderlineEvent(f.start.x-1,f.start.y-x-1,f.end.x,f.end.y-x-1,void 0);(l?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(E)}_linkLeave(h,l,f){var x;(x=this._currentLink)!=null&&x.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!1),this._currentLink.state.decorations.pointerCursor&&h.classList.remove("xterm-cursor-pointer")),l.leave&&l.leave(f,l.text)}_linkAtPosition(h,l){const f=h.range.start.y*this._bufferService.cols+h.range.start.x,x=h.range.end.y*this._bufferService.cols+h.range.end.x,E=l.y*this._bufferService.cols+l.x;return f<=E&&E<=x}_positionFromMouseEvent(h,l,f){const x=f.getCoords(h,l,this._bufferService.cols,this._bufferService.rows);if(x)return{x:x[0],y:x[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,l,f,x,E){return{x1:h,y1:l,x2:f,y2:x,cols:this._bufferService.cols,fg:E}}};i.Linkifier=p=d([m(1,_.IMouseService),m(2,_.IRenderService),m(3,C.IBufferService),m(4,_.ILinkProviderService)],p)},9042:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.tooMuchOutput=i.promptLabel=void 0,i.promptLabel="Terminal input",i.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(u,i,a){var d=this&&this.__decorate||function(_,p,h,l){var f,x=arguments.length,E=x<3?p:l===null?l=Object.getOwnPropertyDescriptor(p,h):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,p,h,l);else for(var k=_.length-1;k>=0;k--)(f=_[k])&&(E=(x<3?f(E):x>3?f(p,h,E):f(p,h))||E);return x>3&&E&&Object.defineProperty(p,h,E),E},m=this&&this.__param||function(_,p){return function(h,l){p(h,l,_)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkProvider=void 0;const c=a(511),g=a(2585);let y=i.OscLinkProvider=class{constructor(_,p,h){this._bufferService=_,this._optionsService=p,this._oscLinkService=h}provideLinks(_,p){var R;const h=this._bufferService.buffer.lines.get(_-1);if(!h)return void p(void 0);const l=[],f=this._optionsService.rawOptions.linkHandler,x=new c.CellData,E=h.getTrimmedLength();let k=-1,b=-1,w=!1;for(let T=0;T<E;T++)if(b!==-1||h.hasContent(T)){if(h.loadCell(T,x),x.hasExtendedAttrs()&&x.extended.urlId){if(b===-1){b=T,k=x.extended.urlId;continue}w=x.extended.urlId!==k}else b!==-1&&(w=!0);if(w||b!==-1&&T===E-1){const M=(R=this._oscLinkService.getLinkData(k))==null?void 0:R.uri;if(M){const O={start:{x:b+1,y:_},end:{x:T+(w||T!==E-1?0:1),y:_}};let A=!1;if(!(f!=null&&f.allowNonHttpProtocols))try{const F=new URL(M);["http:","https:"].includes(F.protocol)||(A=!0)}catch{A=!0}A||l.push({text:M,range:O,activate:(F,U)=>f?f.activate(F,U,O):C(0,U),hover:(F,U)=>{var G;return(G=f==null?void 0:f.hover)==null?void 0:G.call(f,F,U,O)},leave:(F,U)=>{var G;return(G=f==null?void 0:f.leave)==null?void 0:G.call(f,F,U,O)}})}w=!1,x.hasExtendedAttrs()&&x.extended.urlId?(b=T,k=x.extended.urlId):(b=-1,k=-1)}}p(l)}};function C(_,p){if(confirm(`Do you want to navigate to ${p}?
274
+
275
+ WARNING: This link could potentially be dangerous`)){const h=window.open();if(h){try{h.opener=null}catch{}h.location.href=p}else console.warn("Opening link blocked as opener could not be cleared")}}i.OscLinkProvider=y=d([m(0,g.IBufferService),m(1,g.IOptionsService),m(2,g.IOscLinkService)],y)},6193:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.RenderDebouncer=void 0,i.RenderDebouncer=class{constructor(a,d){this._renderCallback=a,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,d,m){this._rowCount=m,a=a!==void 0?a:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.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 a=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},3236:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Terminal=void 0;const d=a(3614),m=a(3656),c=a(3551),g=a(9042),y=a(3730),C=a(1680),_=a(3107),p=a(5744),h=a(2950),l=a(1296),f=a(428),x=a(4269),E=a(5114),k=a(8934),b=a(3230),w=a(9312),R=a(4725),T=a(6731),M=a(8055),O=a(8969),A=a(8460),F=a(844),U=a(6114),G=a(8437),K=a(2584),B=a(7399),P=a(5941),N=a(9074),j=a(2585),D=a(5435),W=a(4567),$=a(779);class V extends O.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(I={}){super(I),this.browser=U,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new F.MutableDisposable),this._onCursorMove=this.register(new A.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new A.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new A.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new A.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new A.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new A.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new A.EventEmitter),this._onBlur=this.register(new A.EventEmitter),this._onA11yCharEmitter=this.register(new A.EventEmitter),this._onA11yTabEmitter=this.register(new A.EventEmitter),this._onWillOpen=this.register(new A.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(N.DecorationService),this._instantiationService.setService(j.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance($.LinkProviderService),this._instantiationService.setService(R.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(y.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((L,z)=>this.refresh(L,z))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(L=>this._reportWindowsOptions(L))),this.register(this._inputHandler.onColor(L=>this._handleColorEvent(L))),this.register((0,A.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,A.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,A.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(L=>this._afterResize(L.cols,L.rows))),this.register((0,F.toDisposable)(()=>{var L,z;this._customKeyEventHandler=void 0,(z=(L=this.element)==null?void 0:L.parentNode)==null||z.removeChild(this.element)}))}_handleColorEvent(I){if(this._themeService)for(const L of I){let z,H="";switch(L.index){case 256:z="foreground",H="10";break;case 257:z="background",H="11";break;case 258:z="cursor",H="12";break;default:z="ansi",H="4;"+L.index}switch(L.type){case 0:const Y=M.color.toColorRGB(z==="ansi"?this._themeService.colors.ansi[L.index]:this._themeService.colors[z]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${H};${(0,P.toRgbString)(Y)}${K.C1_ESCAPED.ST}`);break;case 1:if(z==="ansi")this._themeService.modifyColors(X=>X.ansi[L.index]=M.channels.toColor(...L.color));else{const X=z;this._themeService.modifyColors(ne=>ne[X]=M.channels.toColor(...L.color))}break;case 2:this._themeService.restoreColor(L.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(I){I?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(W.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(I){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var I;return(I=this.textarea)==null?void 0:I.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 I=this.buffer.ybase+this.buffer.y,L=this.buffer.lines.get(I);if(!L)return;const z=Math.min(this.buffer.x,this.cols-1),H=this._renderService.dimensions.css.cell.height,Y=L.getWidth(z),X=this._renderService.dimensions.css.cell.width*Y,ne=this.buffer.y*this._renderService.dimensions.css.cell.height,oe=z*this._renderService.dimensions.css.cell.width;this.textarea.style.left=oe+"px",this.textarea.style.top=ne+"px",this.textarea.style.width=X+"px",this.textarea.style.height=H+"px",this.textarea.style.lineHeight=H+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",L=>{this.hasSelection()&&(0,d.copyHandler)(L,this._selectionService)}));const I=L=>(0,d.handlePasteEvent)(L,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",I)),this.register((0,m.addDisposableDomListener)(this.element,"paste",I)),U.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",L=>{L.button===2&&(0,d.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",L=>{(0,d.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),U.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",L=>{L.button===1&&(0,d.moveTextAreaUnderMouseCursor)(L,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",I=>this._keyUp(I),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",I=>this._keyDown(I),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",I=>this._keyPress(I),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",I=>this._compositionHelper.compositionupdate(I))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,m.addDisposableDomListener)(this.textarea,"input",I=>this._inputEvent(I),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(I){var z;if(!I)throw new Error("Terminal requires a parent element.");if(I.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((z=this.element)==null?void 0:z.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=I.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"),I.appendChild(this.element);const L=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),L.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.register((0,m.addDisposableDomListener)(this.screenElement,"mousemove",H=>this.updateCursorStyle(H))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),L.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),U.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(E.CoreBrowserService,this.textarea,I.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(R.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",H=>this._handleTextAreaFocus(H))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(f.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(R.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(R.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(x.CharacterJoinerService),this._instantiationService.setService(R.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(b.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(R.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(H=>this._onRender.fire(H))),this.onResize(H=>this._renderService.resize(H.cols,H.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(h.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(k.MouseService),this._instantiationService.setService(R.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(c.Linkifier,this.screenElement)),this.element.appendChild(L);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(H=>this.scrollLines(H.amount,H.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(w.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(R.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(H=>this.scrollLines(H.amount,H.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(H=>this._renderService.handleSelectionChanged(H.start,H.end,H.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(H=>{this.textarea.value=H,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(H=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(_.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",H=>this._selectionService.handleMouseDown(H))),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(W.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",H=>this._handleScreenReaderModeOptionChange(H))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(p.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",H=>{!this._overviewRulerRenderer&&H&&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(l.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const I=this,L=this.element;function z(X){const ne=I._mouseService.getMouseReportCoords(X,I.screenElement);if(!ne)return!1;let oe,he;switch(X.overrideType||X.type){case"mousemove":he=32,X.buttons===void 0?(oe=3,X.button!==void 0&&(oe=X.button<3?X.button:3)):oe=1&X.buttons?0:4&X.buttons?1:2&X.buttons?2:3;break;case"mouseup":he=0,oe=X.button<3?X.button:3;break;case"mousedown":he=1,oe=X.button<3?X.button:3;break;case"wheel":if(I._customWheelEventHandler&&I._customWheelEventHandler(X)===!1||I.viewport.getLinesScrolled(X)===0)return!1;he=X.deltaY<0?0:1,oe=4;break;default:return!1}return!(he===void 0||oe===void 0||oe>4)&&I.coreMouseService.triggerMouseEvent({col:ne.col,row:ne.row,x:ne.x,y:ne.y,button:oe,action:he,ctrl:X.ctrlKey,alt:X.altKey,shift:X.shiftKey})}const H={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Y={mouseup:X=>(z(X),X.buttons||(this._document.removeEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.removeEventListener("mousemove",H.mousedrag)),this.cancel(X)),wheel:X=>(z(X),this.cancel(X,!0)),mousedrag:X=>{X.buttons&&z(X)},mousemove:X=>{X.buttons||z(X)}};this.register(this.coreMouseService.onProtocolChange(X=>{X?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(X)),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&X?H.mousemove||(L.addEventListener("mousemove",Y.mousemove),H.mousemove=Y.mousemove):(L.removeEventListener("mousemove",H.mousemove),H.mousemove=null),16&X?H.wheel||(L.addEventListener("wheel",Y.wheel,{passive:!1}),H.wheel=Y.wheel):(L.removeEventListener("wheel",H.wheel),H.wheel=null),2&X?H.mouseup||(H.mouseup=Y.mouseup):(this._document.removeEventListener("mouseup",H.mouseup),H.mouseup=null),4&X?H.mousedrag||(H.mousedrag=Y.mousedrag):(this._document.removeEventListener("mousemove",H.mousedrag),H.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(L,"mousedown",X=>{if(X.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(X))return z(X),H.mouseup&&this._document.addEventListener("mouseup",H.mouseup),H.mousedrag&&this._document.addEventListener("mousemove",H.mousedrag),this.cancel(X)})),this.register((0,m.addDisposableDomListener)(L,"wheel",X=>{if(!H.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(X)===!1)return!1;if(!this.buffer.hasScrollback){const ne=this.viewport.getLinesScrolled(X);if(ne===0)return;const oe=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(X.deltaY<0?"A":"B");let he="";for(let Ce=0;Ce<Math.abs(ne);Ce++)he+=oe;return this.coreService.triggerDataEvent(he,!0),this.cancel(X,!0)}return this.viewport.handleWheel(X)?this.cancel(X):void 0}},{passive:!1})),this.register((0,m.addDisposableDomListener)(L,"touchstart",X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(X),this.cancel(X)},{passive:!0})),this.register((0,m.addDisposableDomListener)(L,"touchmove",X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(X)?void 0:this.cancel(X)},{passive:!1}))}refresh(I,L){var z;(z=this._renderService)==null||z.refreshRows(I,L)}updateCursorStyle(I){var L;(L=this._selectionService)!=null&&L.shouldColumnSelect(I)?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(I,L,z=0){var H;z===1?(super.scrollLines(I,L,z),this.refresh(0,this.rows-1)):(H=this.viewport)==null||H.scrollLines(I)}paste(I){(0,d.paste)(I,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(I){this._customKeyEventHandler=I}attachCustomWheelEventHandler(I){this._customWheelEventHandler=I}registerLinkProvider(I){return this._linkProviderService.registerLinkProvider(I)}registerCharacterJoiner(I){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const L=this._characterJoinerService.register(I);return this.refresh(0,this.rows-1),L}deregisterCharacterJoiner(I){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(I)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(I){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+I)}registerDecoration(I){return this._decorationService.registerDecoration(I)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(I,L,z){this._selectionService.setSelection(I,L,z)}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(){var I;(I=this._selectionService)==null||I.clearSelection()}selectAll(){var I;(I=this._selectionService)==null||I.selectAll()}selectLines(I,L){var z;(z=this._selectionService)==null||z.selectLines(I,L)}_keyDown(I){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1)return!1;const L=this.browser.isMac&&this.options.macOptionIsMeta&&I.altKey;if(!L&&!this._compositionHelper.keydown(I))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;L||I.key!=="Dead"&&I.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const z=(0,B.evaluateKeyboardEvent)(I,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(I),z.type===3||z.type===2){const H=this.rows-1;return this.scrollLines(z.type===2?-H:H),this.cancel(I,!0)}return z.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,I)||(z.cancel&&this.cancel(I,!0),!z.key||!!(I.key&&!I.ctrlKey&&!I.altKey&&!I.metaKey&&I.key.length===1&&I.key.charCodeAt(0)>=65&&I.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(z.key!==K.C0.ETX&&z.key!==K.C0.CR||(this.textarea.value=""),this._onKey.fire({key:z.key,domEvent:I}),this._showCursor(),this.coreService.triggerDataEvent(z.key,!0),!this.optionsService.rawOptions.screenReaderMode||I.altKey||I.ctrlKey?this.cancel(I,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(I,L){const z=I.isMac&&!this.options.macOptionIsMeta&&L.altKey&&!L.ctrlKey&&!L.metaKey||I.isWindows&&L.altKey&&L.ctrlKey&&!L.metaKey||I.isWindows&&L.getModifierState("AltGraph");return L.type==="keypress"?z:z&&(!L.keyCode||L.keyCode>47)}_keyUp(I){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1||(function(L){return L.keyCode===16||L.keyCode===17||L.keyCode===18}(I)||this.focus(),this.updateCursorStyle(I),this._keyPressHandled=!1)}_keyPress(I){let L;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(I)===!1)return!1;if(this.cancel(I),I.charCode)L=I.charCode;else if(I.which===null||I.which===void 0)L=I.keyCode;else{if(I.which===0||I.charCode===0)return!1;L=I.which}return!(!L||(I.altKey||I.ctrlKey||I.metaKey)&&!this._isThirdLevelShift(this.browser,I)||(L=String.fromCharCode(L),this._onKey.fire({key:L,domEvent:I}),this._showCursor(),this.coreService.triggerDataEvent(L,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(I){if(I.data&&I.inputType==="insertText"&&(!I.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const L=I.data;return this.coreService.triggerDataEvent(L,!0),this.cancel(I),!0}return!1}resize(I,L){I!==this.cols||L!==this.rows?super.resize(I,L):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(I,L){var z,H;(z=this._charSizeService)==null||z.measure(),(H=this.viewport)==null||H.syncScrollArea(!0)}clear(){var I;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 L=1;L<this.rows;L++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(I=this.viewport)==null||I.reset(),this.refresh(0,this.rows-1)}}reset(){var L,z;this.options.rows=this.rows,this.options.cols=this.cols;const I=this._customKeyEventHandler;this._setup(),super.reset(),(L=this._selectionService)==null||L.reset(),this._decorationService.reset(),(z=this.viewport)==null||z.reset(),this._customKeyEventHandler=I,this.refresh(0,this.rows-1)}clearTextureAtlas(){var I;(I=this._renderService)==null||I.clearTextureAtlas()}_reportFocus(){var I;(I=this.element)!=null&&I.classList.contains("focus")?this.coreService.triggerDataEvent(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(I){if(this._renderService)switch(I){case D.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const L=this._renderService.dimensions.css.canvas.width.toFixed(0),z=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${z};${L}t`);break;case D.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const H=this._renderService.dimensions.css.cell.width.toFixed(0),Y=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${Y};${H}t`)}}cancel(I,L){if(this.options.cancelEvents||L)return I.preventDefault(),I.stopPropagation(),!1}}i.Terminal=V},9924:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TimeBasedDebouncer=void 0,i.TimeBasedDebouncer=class{constructor(a,d=1e3){this._renderCallback=a,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,d,m){this._rowCount=m,a=a!==void 0?a:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const c=Date.now();if(c-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=c,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=c-this._lastRefreshMs,y=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},y)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const a=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,d)}}},1680:function(u,i,a){var d=this&&this.__decorate||function(h,l,f,x){var E,k=arguments.length,b=k<3?l:x===null?x=Object.getOwnPropertyDescriptor(l,f):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(h,l,f,x);else for(var w=h.length-1;w>=0;w--)(E=h[w])&&(b=(k<3?E(b):k>3?E(l,f,b):E(l,f))||b);return k>3&&b&&Object.defineProperty(l,f,b),b},m=this&&this.__param||function(h,l){return function(f,x){l(f,x,h)}};Object.defineProperty(i,"__esModule",{value:!0}),i.Viewport=void 0;const c=a(3656),g=a(4725),y=a(8460),C=a(844),_=a(2585);let p=i.Viewport=class extends C.Disposable{constructor(h,l,f,x,E,k,b,w){super(),this._viewportElement=h,this._scrollArea=l,this._bufferService=f,this._optionsService=x,this._charSizeService=E,this._renderService=k,this._coreBrowserService=b,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 y.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,c.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(R=>this._activeBuffer=R.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(R=>this._renderDimensions=R)),this._handleThemeChange(w.colors),this.register(w.onChangeColors(R=>this._handleThemeChange(R))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(h){this._viewportElement.style.backgroundColor=h.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(h){if(h)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 l=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==l&&(this._lastRecordedBufferHeight=l,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const h=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==h&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=h),this._refreshAnimationFrame=null}syncScrollArea(h=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(h);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(h)}_handleScroll(h){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 l=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const h=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(h*(this._smoothScrollState.target-this._smoothScrollState.origin)),h<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(h,l){const f=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(l<0&&this._viewportElement.scrollTop!==0||l>0&&f<this._lastRecordedBufferHeight)||(h.cancelable&&h.preventDefault(),!1)}handleWheel(h){const l=this._getPixelsScrolled(h);return l!==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+l:this._smoothScrollState.target+=l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=l,this._bubbleScroll(h,l))}scrollLines(h){if(h!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const l=h*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!1})}_getPixelsScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let l=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_LINE?l*=this._currentRowHeight:h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._currentRowHeight*this._bufferService.rows),l}getBufferElements(h,l){var w;let f,x="";const E=[],k=l??this._bufferService.buffer.lines.length,b=this._bufferService.buffer.lines;for(let R=h;R<k;R++){const T=b.get(R);if(!T)continue;const M=(w=b.get(R+1))==null?void 0:w.isWrapped;if(x+=T.translateToString(!M),!M||R===b.length-1){const O=document.createElement("div");O.textContent=x,E.push(O),x.length>0&&(f=O),x=""}}return{bufferElements:E,cursorElement:f}}getLinesScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let l=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(l/=this._currentRowHeight+0,this._wheelPartialScroll+=l,l=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l}_applyScrollModifier(h,l){const f=this._optionsService.rawOptions.fastScrollModifier;return f==="alt"&&l.altKey||f==="ctrl"&&l.ctrlKey||f==="shift"&&l.shiftKey?h*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:h*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(h){this._lastTouchY=h.touches[0].pageY}handleTouchMove(h){const l=this._lastTouchY-h.touches[0].pageY;return this._lastTouchY=h.touches[0].pageY,l!==0&&(this._viewportElement.scrollTop+=l,this._bubbleScroll(h,l))}};i.Viewport=p=d([m(2,_.IBufferService),m(3,_.IOptionsService),m(4,g.ICharSizeService),m(5,g.IRenderService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],p)},3107:function(u,i,a){var d=this&&this.__decorate||function(_,p,h,l){var f,x=arguments.length,E=x<3?p:l===null?l=Object.getOwnPropertyDescriptor(p,h):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,p,h,l);else for(var k=_.length-1;k>=0;k--)(f=_[k])&&(E=(x<3?f(E):x>3?f(p,h,E):f(p,h))||E);return x>3&&E&&Object.defineProperty(p,h,E),E},m=this&&this.__param||function(_,p){return function(h,l){p(h,l,_)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferDecorationRenderer=void 0;const c=a(4725),g=a(844),y=a(2585);let C=i.BufferDecorationRenderer=class extends g.Disposable{constructor(_,p,h,l,f){super(),this._screenElement=_,this._bufferService=p,this._coreBrowserService=h,this._decorationService=l,this._renderService=f,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(x=>this._removeDecoration(x))),this.register((0,g.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 _ of this._decorationService.decorations)this._renderDecoration(_);this._dimensionsChanged=!1}_renderDecoration(_){this._refreshStyle(_),this._dimensionsChanged&&this._refreshXPosition(_)}_createElement(_){var l;const p=this._coreBrowserService.mainDocument.createElement("div");p.classList.add("xterm-decoration"),p.classList.toggle("xterm-decoration-top-layer",((l=_==null?void 0:_.options)==null?void 0:l.layer)==="top"),p.style.width=`${Math.round((_.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,p.style.height=(_.options.height||1)*this._renderService.dimensions.css.cell.height+"px",p.style.top=(_.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 h=_.options.x??0;return h&&h>this._bufferService.cols&&(p.style.display="none"),this._refreshXPosition(_,p),p}_refreshStyle(_){const p=_.marker.line-this._bufferService.buffers.active.ydisp;if(p<0||p>=this._bufferService.rows)_.element&&(_.element.style.display="none",_.onRenderEmitter.fire(_.element));else{let h=this._decorationElements.get(_);h||(h=this._createElement(_),_.element=h,this._decorationElements.set(_,h),this._container.appendChild(h),_.onDispose(()=>{this._decorationElements.delete(_),h.remove()})),h.style.top=p*this._renderService.dimensions.css.cell.height+"px",h.style.display=this._altBufferIsActive?"none":"block",_.onRenderEmitter.fire(h)}}_refreshXPosition(_,p=_.element){if(!p)return;const h=_.options.x??0;(_.options.anchor||"left")==="right"?p.style.right=h?h*this._renderService.dimensions.css.cell.width+"px":"":p.style.left=h?h*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(_){var p;(p=this._decorationElements.get(_))==null||p.remove(),this._decorationElements.delete(_),_.dispose()}};i.BufferDecorationRenderer=C=d([m(1,y.IBufferService),m(2,c.ICoreBrowserService),m(3,y.IDecorationService),m(4,c.IRenderService)],C)},5871:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ColorZoneStore=void 0,i.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(a){if(a.options.overviewRulerOptions){for(const d of this._zones)if(d.color===a.options.overviewRulerOptions.color&&d.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,a.marker.line))return;if(this._lineAdjacentToZone(d,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(d,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,d){return d>=a.startBufferLine&&d<=a.endBufferLine}_lineAdjacentToZone(a,d,m){return d>=a.startBufferLine-this._linePadding[m||"full"]&&d<=a.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(a,d){a.startBufferLine=Math.min(a.startBufferLine,d),a.endBufferLine=Math.max(a.endBufferLine,d)}}},5744:function(u,i,a){var d=this&&this.__decorate||function(f,x,E,k){var b,w=arguments.length,R=w<3?x:k===null?k=Object.getOwnPropertyDescriptor(x,E):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,x,E,k);else for(var T=f.length-1;T>=0;T--)(b=f[T])&&(R=(w<3?b(R):w>3?b(x,E,R):b(x,E))||R);return w>3&&R&&Object.defineProperty(x,E,R),R},m=this&&this.__param||function(f,x){return function(E,k){x(E,k,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OverviewRulerRenderer=void 0;const c=a(5871),g=a(4725),y=a(844),C=a(2585),_={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0};let l=i.OverviewRulerRenderer=class extends y.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(f,x,E,k,b,w,R){var M;super(),this._viewportElement=f,this._screenElement=x,this._bufferService=E,this._decorationService=k,this._renderService=b,this._optionsService=w,this._coreBrowserService=R,this._colorZoneStore=new c.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(),(M=this._viewportElement.parentElement)==null||M.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,y.toDisposable)(()=>{var O;(O=this._canvas)==null||O.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 f=Math.floor(this._canvas.width/3),x=Math.ceil(this._canvas.width/3);p.full=this._canvas.width,p.left=f,p.center=x,p.right=f,this._refreshDrawHeightConstants(),h.full=0,h.left=0,h.center=p.left,h.right=p.left+p.center}_refreshDrawHeightConstants(){_.full=Math.round(2*this._coreBrowserService.dpr);const f=this._canvas.height/this._bufferService.buffer.lines.length,x=Math.round(Math.max(Math.min(f,12),6)*this._coreBrowserService.dpr);_.left=x,_.center=x,_.right=x}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_.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 x of this._decorationService.decorations)this._colorZoneStore.addDecoration(x);this._ctx.lineWidth=1;const f=this._colorZoneStore.zones;for(const x of f)x.position!=="full"&&this._renderColorZone(x);for(const x of f)x.position==="full"&&this._renderColorZone(x);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(f){this._ctx.fillStyle=f.color,this._ctx.fillRect(h[f.position||"full"],Math.round((this._canvas.height-1)*(f.startBufferLine/this._bufferService.buffers.active.lines.length)-_[f.position||"full"]/2),p[f.position||"full"],Math.round((this._canvas.height-1)*((f.endBufferLine-f.startBufferLine)/this._bufferService.buffers.active.lines.length)+_[f.position||"full"]))}_queueRefresh(f,x){this._shouldUpdateDimensions=f||this._shouldUpdateDimensions,this._shouldUpdateAnchor=x||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};i.OverviewRulerRenderer=l=d([m(2,C.IBufferService),m(3,C.IDecorationService),m(4,g.IRenderService),m(5,C.IOptionsService),m(6,g.ICoreBrowserService)],l)},2950:function(u,i,a){var d=this&&this.__decorate||function(_,p,h,l){var f,x=arguments.length,E=x<3?p:l===null?l=Object.getOwnPropertyDescriptor(p,h):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(_,p,h,l);else for(var k=_.length-1;k>=0;k--)(f=_[k])&&(E=(x<3?f(E):x>3?f(p,h,E):f(p,h))||E);return x>3&&E&&Object.defineProperty(p,h,E),E},m=this&&this.__param||function(_,p){return function(h,l){p(h,l,_)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CompositionHelper=void 0;const c=a(4725),g=a(2585),y=a(2584);let C=i.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(_,p,h,l,f,x){this._textarea=_,this._compositionView=p,this._bufferService=h,this._optionsService=l,this._coreService=f,this._renderService=x,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(_){this._compositionView.textContent=_.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(_){if(this._isComposing||this._isSendingComposition){if(_.keyCode===229||_.keyCode===16||_.keyCode===17||_.keyCode===18)return!1;this._finalizeComposition(!1)}return _.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(_){if(this._compositionView.classList.remove("active"),this._isComposing=!1,_){const p={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let h;this._isSendingComposition=!1,p.start+=this._dataAlreadySent.length,h=this._isComposing?this._textarea.value.substring(p.start,p.end):this._textarea.value.substring(p.start),h.length>0&&this._coreService.triggerDataEvent(h,!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 _=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const p=this._textarea.value,h=p.replace(_,"");this._dataAlreadySent=h,p.length>_.length?this._coreService.triggerDataEvent(h,!0):p.length<_.length?this._coreService.triggerDataEvent(`${y.C0.DEL}`,!0):p.length===_.length&&p!==_&&this._coreService.triggerDataEvent(p,!0)}},0)}updateCompositionElements(_){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const p=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),h=this._renderService.dimensions.css.cell.height,l=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,f=p*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=f+"px",this._compositionView.style.top=l+"px",this._compositionView.style.height=h+"px",this._compositionView.style.lineHeight=h+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const x=this._compositionView.getBoundingClientRect();this._textarea.style.left=f+"px",this._textarea.style.top=l+"px",this._textarea.style.width=Math.max(x.width,1)+"px",this._textarea.style.height=Math.max(x.height,1)+"px",this._textarea.style.lineHeight=x.height+"px"}_||setTimeout(()=>this.updateCompositionElements(!0),0)}}};i.CompositionHelper=C=d([m(2,g.IBufferService),m(3,g.IOptionsService),m(4,g.ICoreService),m(5,c.IRenderService)],C)},9806:(u,i)=>{function a(d,m,c){const g=c.getBoundingClientRect(),y=d.getComputedStyle(c),C=parseInt(y.getPropertyValue("padding-left")),_=parseInt(y.getPropertyValue("padding-top"));return[m.clientX-g.left-C,m.clientY-g.top-_]}Object.defineProperty(i,"__esModule",{value:!0}),i.getCoords=i.getCoordsRelativeToElement=void 0,i.getCoordsRelativeToElement=a,i.getCoords=function(d,m,c,g,y,C,_,p,h){if(!C)return;const l=a(d,m,c);return l?(l[0]=Math.ceil((l[0]+(h?_/2:0))/_),l[1]=Math.ceil(l[1]/p),l[0]=Math.min(Math.max(l[0],1),g+(h?1:0)),l[1]=Math.min(Math.max(l[1],1),y),l):void 0}},9504:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.moveToCellSequence=void 0;const d=a(2584);function m(p,h,l,f){const x=p-c(p,l),E=h-c(h,l),k=Math.abs(x-E)-function(b,w,R){let T=0;const M=b-c(b,R),O=w-c(w,R);for(let A=0;A<Math.abs(M-O);A++){const F=g(b,w)==="A"?-1:1,U=R.buffer.lines.get(M+F*A);U!=null&&U.isWrapped&&T++}return T}(p,h,l);return _(k,C(g(p,h),f))}function c(p,h){let l=0,f=h.buffer.lines.get(p),x=f==null?void 0:f.isWrapped;for(;x&&p>=0&&p<h.rows;)l++,f=h.buffer.lines.get(--p),x=f==null?void 0:f.isWrapped;return l}function g(p,h){return p>h?"A":"B"}function y(p,h,l,f,x,E){let k=p,b=h,w="";for(;k!==l||b!==f;)k+=x?1:-1,x&&k>E.cols-1?(w+=E.buffer.translateBufferLineToString(b,!1,p,k),k=0,p=0,b++):!x&&k<0&&(w+=E.buffer.translateBufferLineToString(b,!1,0,p+1),k=E.cols-1,p=k,b--);return w+E.buffer.translateBufferLineToString(b,!1,p,k)}function C(p,h){const l=h?"O":"[";return d.C0.ESC+l+p}function _(p,h){p=Math.floor(p);let l="";for(let f=0;f<p;f++)l+=h;return l}i.moveToCellSequence=function(p,h,l,f){const x=l.buffer.x,E=l.buffer.y;if(!l.buffer.hasScrollback)return function(w,R,T,M,O,A){return m(R,M,O,A).length===0?"":_(y(w,R,w,R-c(R,O),!1,O).length,C("D",A))}(x,E,0,h,l,f)+m(E,h,l,f)+function(w,R,T,M,O,A){let F;F=m(R,M,O,A).length>0?M-c(M,O):R;const U=M,G=function(K,B,P,N,j,D){let W;return W=m(P,N,j,D).length>0?N-c(N,j):B,K<P&&W<=N||K>=P&&W<N?"C":"D"}(w,R,T,M,O,A);return _(y(w,F,T,U,G==="C",O).length,C(G,A))}(x,E,p,h,l,f);let k;if(E===h)return k=x>p?"D":"C",_(Math.abs(x-p),C(k,f));k=E>h?"D":"C";const b=Math.abs(E-h);return _(function(w,R){return R.cols-w}(E>h?p:x,l)+(b-1)*l.cols+1+((E>h?x:p)-1),C(k,f))}},1296:function(u,i,a){var d=this&&this.__decorate||function(A,F,U,G){var K,B=arguments.length,P=B<3?F:G===null?G=Object.getOwnPropertyDescriptor(F,U):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(A,F,U,G);else for(var N=A.length-1;N>=0;N--)(K=A[N])&&(P=(B<3?K(P):B>3?K(F,U,P):K(F,U))||P);return B>3&&P&&Object.defineProperty(F,U,P),P},m=this&&this.__param||function(A,F){return function(U,G){F(U,G,A)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRenderer=void 0;const c=a(3787),g=a(2550),y=a(2223),C=a(6171),_=a(6052),p=a(4725),h=a(8055),l=a(8460),f=a(844),x=a(2585),E="xterm-dom-renderer-owner-",k="xterm-rows",b="xterm-fg-",w="xterm-bg-",R="xterm-focus",T="xterm-selection";let M=1,O=i.DomRenderer=class extends f.Disposable{constructor(A,F,U,G,K,B,P,N,j,D,W,$,V){super(),this._terminal=A,this._document=F,this._element=U,this._screenElement=G,this._viewportElement=K,this._helperContainer=B,this._linkifier2=P,this._charSizeService=j,this._optionsService=D,this._bufferService=W,this._coreBrowserService=$,this._themeService=V,this._terminalClass=M++,this._rowElements=[],this._selectionRenderModel=(0,_.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new l.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(k),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(T),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(q=>this._injectCss(q))),this._injectCss(this._themeService.colors),this._rowFactory=N.createInstance(c.DomRendererRowFactory,document),this._element.classList.add(E+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(q=>this._handleLinkHover(q))),this.register(this._linkifier2.onHideLinkUnderline(q=>this._handleLinkLeave(q))),this.register((0,f.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 g.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 A=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*A,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*A),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/A),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/A),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 F=`${this._terminalSelector} .${k} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=F,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(A){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let F=`${this._terminalSelector} .${k} { color: ${A.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;F+=`${this._terminalSelector} .${k} .xterm-dim { color: ${h.color.multiplyOpacity(A.foreground,.5).css};}`,F+=`${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;}`;const U=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,K=`blink_block_${this._terminalClass}`;F+=`@keyframes ${U} { 50% { border-bottom-style: hidden; }}`,F+=`@keyframes ${G} { 50% { box-shadow: none; }}`,F+=`@keyframes ${K} { 0% { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css}; } 50% { background-color: inherit; color: ${A.cursor.css}; }}`,F+=`${this._terminalSelector} .${k}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${U} 1s step-end infinite;}${this._terminalSelector} .${k}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${k}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block { background-color: ${A.cursor.css}; color: ${A.cursorAccent.css};}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${A.cursor.css} !important; color: ${A.cursorAccent.css} !important;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${A.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${A.cursor.css} inset;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${A.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,F+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${A.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${A.selectionInactiveBackgroundOpaque.css};}`;for(const[B,P]of A.ansi.entries())F+=`${this._terminalSelector} .${b}${B} { color: ${P.css}; }${this._terminalSelector} .${b}${B}.xterm-dim { color: ${h.color.multiplyOpacity(P,.5).css}; }${this._terminalSelector} .${w}${B} { background-color: ${P.css}; }`;F+=`${this._terminalSelector} .${b}${y.INVERTED_DEFAULT_COLOR} { color: ${h.color.opaque(A.background).css}; }${this._terminalSelector} .${b}${y.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${h.color.multiplyOpacity(h.color.opaque(A.background),.5).css}; }${this._terminalSelector} .${w}${y.INVERTED_DEFAULT_COLOR} { background-color: ${A.foreground.css}; }`,this._themeStyleElement.textContent=F}_setDefaultSpacing(){const A=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${A}px`,this._rowFactory.defaultSpacing=A}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(A,F){for(let U=this._rowElements.length;U<=F;U++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>F;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(A,F){this._refreshRowElements(A,F),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(R),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(R),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(A,F,U){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(A,F,U),this.renderRows(0,this._bufferService.rows-1),!A||!F)return;this._selectionRenderModel.update(this._terminal,A,F,U);const G=this._selectionRenderModel.viewportStartRow,K=this._selectionRenderModel.viewportEndRow,B=this._selectionRenderModel.viewportCappedStartRow,P=this._selectionRenderModel.viewportCappedEndRow;if(B>=this._bufferService.rows||P<0)return;const N=this._document.createDocumentFragment();if(U){const j=A[0]>F[0];N.appendChild(this._createSelectionElement(B,j?F[0]:A[0],j?A[0]:F[0],P-B+1))}else{const j=G===B?A[0]:0,D=B===K?F[0]:this._bufferService.cols;N.appendChild(this._createSelectionElement(B,j,D));const W=P-B-1;if(N.appendChild(this._createSelectionElement(B+1,0,this._bufferService.cols,W)),B!==P){const $=K===P?F[0]:this._bufferService.cols;N.appendChild(this._createSelectionElement(P,0,$))}}this._selectionContainer.appendChild(N)}_createSelectionElement(A,F,U,G=1){const K=this._document.createElement("div"),B=F*this.dimensions.css.cell.width;let P=this.dimensions.css.cell.width*(U-F);return B+P>this.dimensions.css.canvas.width&&(P=this.dimensions.css.canvas.width-B),K.style.height=G*this.dimensions.css.cell.height+"px",K.style.top=A*this.dimensions.css.cell.height+"px",K.style.left=`${B}px`,K.style.width=`${P}px`,K}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 A of this._rowElements)A.replaceChildren()}renderRows(A,F){const U=this._bufferService.buffer,G=U.ybase+U.y,K=Math.min(U.x,this._bufferService.cols-1),B=this._optionsService.rawOptions.cursorBlink,P=this._optionsService.rawOptions.cursorStyle,N=this._optionsService.rawOptions.cursorInactiveStyle;for(let j=A;j<=F;j++){const D=j+U.ydisp,W=this._rowElements[j],$=U.lines.get(D);if(!W||!$)break;W.replaceChildren(...this._rowFactory.createRow($,D,D===G,P,N,K,B,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${E}${this._terminalClass}`}_handleLinkHover(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!0)}_handleLinkLeave(A){this._setCellUnderline(A.x1,A.x2,A.y1,A.y2,A.cols,!1)}_setCellUnderline(A,F,U,G,K,B){U<0&&(A=0),G<0&&(F=0);const P=this._bufferService.rows-1;U=Math.max(Math.min(U,P),0),G=Math.max(Math.min(G,P),0),K=Math.min(K,this._bufferService.cols);const N=this._bufferService.buffer,j=N.ybase+N.y,D=Math.min(N.x,K-1),W=this._optionsService.rawOptions.cursorBlink,$=this._optionsService.rawOptions.cursorStyle,V=this._optionsService.rawOptions.cursorInactiveStyle;for(let q=U;q<=G;++q){const I=q+N.ydisp,L=this._rowElements[q],z=N.lines.get(I);if(!L||!z)break;L.replaceChildren(...this._rowFactory.createRow(z,I,I===j,$,V,D,W,this.dimensions.css.cell.width,this._widthCache,B?q===U?A:0:-1,B?(q===G?F:K)-1:-1))}}};i.DomRenderer=O=d([m(7,x.IInstantiationService),m(8,p.ICharSizeService),m(9,x.IOptionsService),m(10,x.IBufferService),m(11,p.ICoreBrowserService),m(12,p.IThemeService)],O)},3787:function(u,i,a){var d=this&&this.__decorate||function(k,b,w,R){var T,M=arguments.length,O=M<3?b:R===null?R=Object.getOwnPropertyDescriptor(b,w):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(k,b,w,R);else for(var A=k.length-1;A>=0;A--)(T=k[A])&&(O=(M<3?T(O):M>3?T(b,w,O):T(b,w))||O);return M>3&&O&&Object.defineProperty(b,w,O),O},m=this&&this.__param||function(k,b){return function(w,R){b(w,R,k)}};Object.defineProperty(i,"__esModule",{value:!0}),i.DomRendererRowFactory=void 0;const c=a(2223),g=a(643),y=a(511),C=a(2585),_=a(8055),p=a(4725),h=a(4269),l=a(6171),f=a(3734);let x=i.DomRendererRowFactory=class{constructor(k,b,w,R,T,M,O){this._document=k,this._characterJoinerService=b,this._optionsService=w,this._coreBrowserService=R,this._coreService=T,this._decorationService=M,this._themeService=O,this._workCell=new y.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(k,b,w){this._selectionStart=k,this._selectionEnd=b,this._columnSelectMode=w}createRow(k,b,w,R,T,M,O,A,F,U,G){const K=[],B=this._characterJoinerService.getJoinedCharacters(b),P=this._themeService.colors;let N,j=k.getNoBgTrimmedLength();w&&j<M+1&&(j=M+1);let D=0,W="",$=0,V=0,q=0,I=!1,L=0,z=!1,H=0;const Y=[],X=U!==-1&&G!==-1;for(let ne=0;ne<j;ne++){k.loadCell(ne,this._workCell);let oe=this._workCell.getWidth();if(oe===0)continue;let he=!1,Ce=ne,se=this._workCell;if(B.length>0&&ne===B[0][0]){he=!0;const ve=B.shift();se=new h.JoinedCellData(this._workCell,k.translateToString(!0,ve[0],ve[1]),ve[1]-ve[0]),Ce=ve[1]-1,oe=se.getWidth()}const Fr=this._isCellInSelection(ne,b),rr=w&&ne===M,za=X&&ne>=U&&ne<=G;let Wa=!1;this._decorationService.forEachDecorationAtCell(ne,b,void 0,ve=>{Wa=!0});let Ci=se.getChars()||g.WHITESPACE_CELL_CHAR;if(Ci===" "&&(se.isUnderline()||se.isOverline())&&(Ci=" "),H=oe*A-F.get(Ci,se.isBold(),se.isItalic()),N){if(D&&(Fr&&z||!Fr&&!z&&se.bg===$)&&(Fr&&z&&P.selectionForeground||se.fg===V)&&se.extended.ext===q&&za===I&&H===L&&!rr&&!he&&!Wa){se.isInvisible()?W+=g.WHITESPACE_CELL_CHAR:W+=Ci,D++;continue}D&&(N.textContent=W),N=this._document.createElement("span"),D=0,W=""}else N=this._document.createElement("span");if($=se.bg,V=se.fg,q=se.extended.ext,I=za,L=H,z=Fr,he&&M>=ne&&M<=Ce&&(M=ne),!this._coreService.isCursorHidden&&rr&&this._coreService.isCursorInitialized){if(Y.push("xterm-cursor"),this._coreBrowserService.isFocused)O&&Y.push("xterm-cursor-blink"),Y.push(R==="bar"?"xterm-cursor-bar":R==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":Y.push("xterm-cursor-outline");break;case"block":Y.push("xterm-cursor-block");break;case"bar":Y.push("xterm-cursor-bar");break;case"underline":Y.push("xterm-cursor-underline")}}if(se.isBold()&&Y.push("xterm-bold"),se.isItalic()&&Y.push("xterm-italic"),se.isDim()&&Y.push("xterm-dim"),W=se.isInvisible()?g.WHITESPACE_CELL_CHAR:se.getChars()||g.WHITESPACE_CELL_CHAR,se.isUnderline()&&(Y.push(`xterm-underline-${se.extended.underlineStyle}`),W===" "&&(W=" "),!se.isUnderlineColorDefault()))if(se.isUnderlineColorRGB())N.style.textDecorationColor=`rgb(${f.AttributeData.toColorRGB(se.getUnderlineColor()).join(",")})`;else{let ve=se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&se.isBold()&&ve<8&&(ve+=8),N.style.textDecorationColor=P.ansi[ve].css}se.isOverline()&&(Y.push("xterm-overline"),W===" "&&(W=" ")),se.isStrikethrough()&&Y.push("xterm-strikethrough"),za&&(N.style.textDecoration="underline");let ct=se.getFgColor(),ls=se.getFgColorMode(),Nt=se.getBgColor(),cs=se.getBgColorMode();const Ua=!!se.isInverse();if(Ua){const ve=ct;ct=Nt,Nt=ve;const dx=ls;ls=cs,cs=dx}let nr,ki,sr,us=!1;switch(this._decorationService.forEachDecorationAtCell(ne,b,void 0,ve=>{ve.options.layer!=="top"&&us||(ve.backgroundColorRGB&&(cs=50331648,Nt=ve.backgroundColorRGB.rgba>>8&16777215,nr=ve.backgroundColorRGB),ve.foregroundColorRGB&&(ls=50331648,ct=ve.foregroundColorRGB.rgba>>8&16777215,ki=ve.foregroundColorRGB),us=ve.options.layer==="top")}),!us&&Fr&&(nr=this._coreBrowserService.isFocused?P.selectionBackgroundOpaque:P.selectionInactiveBackgroundOpaque,Nt=nr.rgba>>8&16777215,cs=50331648,us=!0,P.selectionForeground&&(ls=50331648,ct=P.selectionForeground.rgba>>8&16777215,ki=P.selectionForeground)),us&&Y.push("xterm-decoration-top"),cs){case 16777216:case 33554432:sr=P.ansi[Nt],Y.push(`xterm-bg-${Nt}`);break;case 50331648:sr=_.channels.toColor(Nt>>16,Nt>>8&255,255&Nt),this._addStyle(N,`background-color:#${E((Nt>>>0).toString(16),"0",6)}`);break;default:Ua?(sr=P.foreground,Y.push(`xterm-bg-${c.INVERTED_DEFAULT_COLOR}`)):sr=P.background}switch(nr||se.isDim()&&(nr=_.color.multiplyOpacity(sr,.5)),ls){case 16777216:case 33554432:se.isBold()&&ct<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ct+=8),this._applyMinimumContrast(N,sr,P.ansi[ct],se,nr,void 0)||Y.push(`xterm-fg-${ct}`);break;case 50331648:const ve=_.channels.toColor(ct>>16&255,ct>>8&255,255&ct);this._applyMinimumContrast(N,sr,ve,se,nr,ki)||this._addStyle(N,`color:#${E(ct.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(N,sr,P.foreground,se,nr,ki)||Ua&&Y.push(`xterm-fg-${c.INVERTED_DEFAULT_COLOR}`)}Y.length&&(N.className=Y.join(" "),Y.length=0),rr||he||Wa?N.textContent=W:D++,H!==this.defaultSpacing&&(N.style.letterSpacing=`${H}px`),K.push(N),ne=Ce}return N&&D&&(N.textContent=W),K}_applyMinimumContrast(k,b,w,R,T,M){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,l.treatGlyphAsBackgroundColor)(R.getCode()))return!1;const O=this._getContrastCache(R);let A;if(T||M||(A=O.getColor(b.rgba,w.rgba)),A===void 0){const F=this._optionsService.rawOptions.minimumContrastRatio/(R.isDim()?2:1);A=_.color.ensureContrastRatio(T||b,M||w,F),O.setColor((T||b).rgba,(M||w).rgba,A??null)}return!!A&&(this._addStyle(k,`color:${A.css}`),!0)}_getContrastCache(k){return k.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(k,b){k.setAttribute("style",`${k.getAttribute("style")||""}${b};`)}_isCellInSelection(k,b){const w=this._selectionStart,R=this._selectionEnd;return!(!w||!R)&&(this._columnSelectMode?w[0]<=R[0]?k>=w[0]&&b>=w[1]&&k<R[0]&&b<=R[1]:k<w[0]&&b>=w[1]&&k>=R[0]&&b<=R[1]:b>w[1]&&b<R[1]||w[1]===R[1]&&b===w[1]&&k>=w[0]&&k<R[0]||w[1]<R[1]&&b===R[1]&&k<R[0]||w[1]<R[1]&&b===w[1]&&k>=w[0])}};function E(k,b,w){for(;k.length<w;)k=b+k;return k}i.DomRendererRowFactory=x=d([m(1,p.ICharacterJoinerService),m(2,C.IOptionsService),m(3,p.ICoreBrowserService),m(4,C.ICoreService),m(5,C.IDecorationService),m(6,p.IThemeService)],x)},2550:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WidthCache=void 0,i.WidthCache=class{constructor(a,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=a.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 m=a.createElement("span");m.classList.add("xterm-char-measure-element");const c=a.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontWeight="bold";const g=a.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const y=a.createElement("span");y.classList.add("xterm-char-measure-element"),y.style.fontWeight="bold",y.style.fontStyle="italic",this._measureElements=[m,c,g,y],this._container.appendChild(m),this._container.appendChild(c),this._container.appendChild(g),this._container.appendChild(y),d.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(a,d,m,c){a===this._font&&d===this._fontSize&&m===this._weight&&c===this._weightBold||(this._font=a,this._fontSize=d,this._weight=m,this._weightBold=c,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${c}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${c}`,this.clear())}get(a,d,m){let c=0;if(!d&&!m&&a.length===1&&(c=a.charCodeAt(0))<256){if(this._flat[c]!==-9999)return this._flat[c];const C=this._measure(a,0);return C>0&&(this._flat[c]=C),C}let g=a;d&&(g+="B"),m&&(g+="I");let y=this._holey.get(g);if(y===void 0){let C=0;d&&(C|=1),m&&(C|=2),y=this._measure(a,C),y>0&&this._holey.set(g,y)}return y}_measure(a,d){const m=this._measureElements[d];return m.textContent=a.repeat(32),m.offsetWidth/32}}},2223:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.TEXT_BASELINE=i.DIM_OPACITY=i.INVERTED_DEFAULT_COLOR=void 0;const d=a(6114);i.INVERTED_DEFAULT_COLOR=257,i.DIM_OPACITY=.5,i.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(u,i)=>{function a(m){return 57508<=m&&m<=57558}function d(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(i,"__esModule",{value:!0}),i.computeNextVariantOffset=i.createRenderDimensions=i.treatGlyphAsBackgroundColor=i.allowRescaling=i.isEmoji=i.isRestrictedPowerlineGlyph=i.isPowerlineGlyph=i.throwIfFalsy=void 0,i.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},i.isPowerlineGlyph=a,i.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},i.isEmoji=d,i.allowRescaling=function(m,c,g,y){return c===1&&g>Math.ceil(1.5*y)&&m!==void 0&&m>255&&!d(m)&&!a(m)&&!function(C){return 57344<=C&&C<=63743}(m)},i.treatGlyphAsBackgroundColor=function(m){return a(m)||function(c){return 9472<=c&&c<=9631}(m)},i.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}}}},i.computeNextVariantOffset=function(m,c,g=0){return(m-(2*Math.round(c)-g))%(2*Math.round(c))}},6052:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createSelectionRenderModel=void 0;class a{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(m,c,g,y=!1){if(this.selectionStart=c,this.selectionEnd=g,!c||!g||c[0]===g[0]&&c[1]===g[1])return void this.clear();const C=m.buffers.active.ydisp,_=c[1]-C,p=g[1]-C,h=Math.max(_,0),l=Math.min(p,m.rows-1);h>=m.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=y,this.viewportStartRow=_,this.viewportEndRow=p,this.viewportCappedStartRow=h,this.viewportCappedEndRow=l,this.startCol=c[0],this.endCol=g[0])}isCellSelected(m,c,g){return!!this.hasSelection&&(g-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?c>=this.startCol&&g>=this.viewportCappedStartRow&&c<this.endCol&&g<=this.viewportCappedEndRow:c<this.startCol&&g>=this.viewportCappedStartRow&&c>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&c>=this.startCol&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&c<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&c>=this.startCol)}}i.createSelectionRenderModel=function(){return new a}},456:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionModel=void 0,i.SelectionModel=class{constructor(a){this._bufferService=a,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 a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const a=this.selectionStart,d=this.selectionEnd;return!(!a||!d)&&(a[1]>d[1]||a[1]===d[1]&&a[0]>d[0])}handleTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(u,i,a){var d=this&&this.__decorate||function(l,f,x,E){var k,b=arguments.length,w=b<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(l,f,x,E);else for(var R=l.length-1;R>=0;R--)(k=l[R])&&(w=(b<3?k(w):b>3?k(f,x,w):k(f,x))||w);return b>3&&w&&Object.defineProperty(f,x,w),w},m=this&&this.__param||function(l,f){return function(x,E){f(x,E,l)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharSizeService=void 0;const c=a(2585),g=a(8460),y=a(844);let C=i.CharSizeService=class extends y.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(l,f,x){super(),this._optionsService=x,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new h(this._optionsService))}catch{this._measureStrategy=this.register(new p(l,f,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const l=this._measureStrategy.measure();l.width===this.width&&l.height===this.height||(this.width=l.width,this.height=l.height,this._onCharSizeChange.fire())}};i.CharSizeService=C=d([m(2,c.IOptionsService)],C);class _ extends y.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(f,x){f!==void 0&&f>0&&x!==void 0&&x>0&&(this._result.width=f,this._result.height=x)}}class p extends _{constructor(f,x,E){super(),this._document=f,this._parentElement=x,this._optionsService=E,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(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class h extends _{constructor(f){super(),this._optionsService=f,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const x=this._ctx.measureText("W");if(!("width"in x&&"fontBoundingBoxAscent"in x&&"fontBoundingBoxDescent"in x))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const f=this._ctx.measureText("W");return this._validateAndSet(f.width,f.fontBoundingBoxAscent+f.fontBoundingBoxDescent),this._result}}},4269:function(u,i,a){var d=this&&this.__decorate||function(h,l,f,x){var E,k=arguments.length,b=k<3?l:x===null?x=Object.getOwnPropertyDescriptor(l,f):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(h,l,f,x);else for(var w=h.length-1;w>=0;w--)(E=h[w])&&(b=(k<3?E(b):k>3?E(l,f,b):E(l,f))||b);return k>3&&b&&Object.defineProperty(l,f,b),b},m=this&&this.__param||function(h,l){return function(f,x){l(f,x,h)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CharacterJoinerService=i.JoinedCellData=void 0;const c=a(3734),g=a(643),y=a(511),C=a(2585);class _ extends c.AttributeData{constructor(l,f,x){super(),this.content=0,this.combinedData="",this.fg=l.fg,this.bg=l.bg,this.combinedData=f,this._width=x}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(l){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.JoinedCellData=_;let p=i.CharacterJoinerService=class rx{constructor(l){this._bufferService=l,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new y.CellData}register(l){const f={id:this._nextCharacterJoinerId++,handler:l};return this._characterJoiners.push(f),f.id}deregister(l){for(let f=0;f<this._characterJoiners.length;f++)if(this._characterJoiners[f].id===l)return this._characterJoiners.splice(f,1),!0;return!1}getJoinedCharacters(l){if(this._characterJoiners.length===0)return[];const f=this._bufferService.buffer.lines.get(l);if(!f||f.length===0)return[];const x=[],E=f.translateToString(!0);let k=0,b=0,w=0,R=f.getFg(0),T=f.getBg(0);for(let M=0;M<f.getTrimmedLength();M++)if(f.loadCell(M,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==R||this._workCell.bg!==T){if(M-k>1){const O=this._getJoinedRanges(E,w,b,f,k);for(let A=0;A<O.length;A++)x.push(O[A])}k=M,w=b,R=this._workCell.fg,T=this._workCell.bg}b+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-k>1){const M=this._getJoinedRanges(E,w,b,f,k);for(let O=0;O<M.length;O++)x.push(M[O])}return x}_getJoinedRanges(l,f,x,E,k){const b=l.substring(f,x);let w=[];try{w=this._characterJoiners[0].handler(b)}catch(R){console.error(R)}for(let R=1;R<this._characterJoiners.length;R++)try{const T=this._characterJoiners[R].handler(b);for(let M=0;M<T.length;M++)rx._mergeRanges(w,T[M])}catch(T){console.error(T)}return this._stringRangesToCellRanges(w,E,k),w}_stringRangesToCellRanges(l,f,x){let E=0,k=!1,b=0,w=l[E];if(w){for(let R=x;R<this._bufferService.cols;R++){const T=f.getWidth(R),M=f.getString(R).length||g.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!k&&w[0]<=b&&(w[0]=R,k=!0),w[1]<=b){if(w[1]=R,w=l[++E],!w)break;w[0]<=b?(w[0]=R,k=!0):k=!1}b+=M}}w&&(w[1]=this._bufferService.cols)}}static _mergeRanges(l,f){let x=!1;for(let E=0;E<l.length;E++){const k=l[E];if(x){if(f[1]<=k[0])return l[E-1][1]=f[1],l;if(f[1]<=k[1])return l[E-1][1]=Math.max(f[1],k[1]),l.splice(E,1),l;l.splice(E,1),E--}else{if(f[1]<=k[0])return l.splice(E,0,f),l;if(f[1]<=k[1])return k[0]=Math.min(f[0],k[0]),l;f[0]<k[1]&&(k[0]=Math.min(f[0],k[0]),x=!0)}}return x?l[l.length-1][1]=f[1]:l.push(f),l}};i.CharacterJoinerService=p=d([m(0,C.IBufferService)],p)},5114:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreBrowserService=void 0;const d=a(844),m=a(8460),c=a(3656);class g extends d.Disposable{constructor(_,p,h){super(),this._textarea=_,this._window=p,this.mainDocument=h,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new y(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(l=>this._screenDprMonitor.setWindow(l))),this.register((0,m.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(_){this._window!==_&&(this._window=_,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}}i.CoreBrowserService=g;class y extends d.Disposable{constructor(_){super(),this._parentWindow=_,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)(()=>this.clearListener()))}setWindow(_){this._parentWindow=_,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,c.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var _;this._outerListener&&((_=this._resolutionMediaMatchList)==null||_.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)}}},779:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.LinkProviderService=void 0;const d=a(844);class m extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const y=this.linkProviders.indexOf(g);y!==-1&&this.linkProviders.splice(y,1)}}}}i.LinkProviderService=m},8934:function(u,i,a){var d=this&&this.__decorate||function(C,_,p,h){var l,f=arguments.length,x=f<3?_:h===null?h=Object.getOwnPropertyDescriptor(_,p):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(C,_,p,h);else for(var E=C.length-1;E>=0;E--)(l=C[E])&&(x=(f<3?l(x):f>3?l(_,p,x):l(_,p))||x);return f>3&&x&&Object.defineProperty(_,p,x),x},m=this&&this.__param||function(C,_){return function(p,h){_(p,h,C)}};Object.defineProperty(i,"__esModule",{value:!0}),i.MouseService=void 0;const c=a(4725),g=a(9806);let y=i.MouseService=class{constructor(C,_){this._renderService=C,this._charSizeService=_}getCoords(C,_,p,h,l){return(0,g.getCoords)(window,C,_,p,h,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(C,_){const p=(0,g.getCoordsRelativeToElement)(window,C,_);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])}}};i.MouseService=y=d([m(0,c.IRenderService),m(1,c.ICharSizeService)],y)},3230:function(u,i,a){var d=this&&this.__decorate||function(l,f,x,E){var k,b=arguments.length,w=b<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(l,f,x,E);else for(var R=l.length-1;R>=0;R--)(k=l[R])&&(w=(b<3?k(w):b>3?k(f,x,w):k(f,x))||w);return b>3&&w&&Object.defineProperty(f,x,w),w},m=this&&this.__param||function(l,f){return function(x,E){f(x,E,l)}};Object.defineProperty(i,"__esModule",{value:!0}),i.RenderService=void 0;const c=a(6193),g=a(4725),y=a(8460),C=a(844),_=a(7226),p=a(2585);let h=i.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(l,f,x,E,k,b,w,R){super(),this._rowCount=l,this._charSizeService=E,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new _.DebouncedIdleTask,this._observerDisposable=this.register(new C.MutableDisposable),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 y.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new y.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new y.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new y.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new c.RenderDebouncer((T,M)=>this._renderRows(T,M),w),this.register(this._renderDebouncer),this.register(w.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(b.onResize(()=>this._fullRefresh())),this.register(b.buffers.onBufferActivate(()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()})),this.register(x.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(k.onDecorationRegistered(()=>this._fullRefresh())),this.register(k.onDecorationRemoved(()=>this._fullRefresh())),this.register(x.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(b.cols,b.rows),this._fullRefresh()})),this.register(x.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(b.buffer.y,b.buffer.y,!0))),this.register(R.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(w.window,f),this.register(w.onWindowChange(T=>this._registerIntersectionObserver(T,f)))}_registerIntersectionObserver(l,f){if("IntersectionObserver"in l){const x=new l.IntersectionObserver(E=>this._handleIntersectionChange(E[E.length-1]),{threshold:0});x.observe(f),this._observerDisposable.value=(0,C.toDisposable)(()=>x.disconnect())}}_handleIntersectionChange(l){this._isPaused=l.isIntersecting===void 0?l.intersectionRatio===0:!l.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(l,f,x=!1){this._isPaused?this._needsFullRefresh=!0:(x||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(l,f,this._rowCount))}_renderRows(l,f){this._renderer.value&&(l=Math.min(l,this._rowCount-1),f=Math.min(f,this._rowCount-1),this._renderer.value.renderRows(l,f),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:l,end:f}),this._onRender.fire({start:l,end:f}),this._isNextRenderRedrawOnly=!0)}resize(l,f){this._rowCount=f,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(l){this._renderer.value=l,this._renderer.value&&(this._renderer.value.onRequestRedraw(f=>this.refreshRows(f.start,f.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(l){return this._renderDebouncer.addRefreshCallback(l)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var l,f;this._renderer.value&&((f=(l=this._renderer.value).clearTextureAtlas)==null||f.call(l),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(l,f){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var x;return(x=this._renderer.value)==null?void 0:x.handleResize(l,f)}):this._renderer.value.handleResize(l,f),this._fullRefresh())}handleCharSizeChanged(){var l;(l=this._renderer.value)==null||l.handleCharSizeChanged()}handleBlur(){var l;(l=this._renderer.value)==null||l.handleBlur()}handleFocus(){var l;(l=this._renderer.value)==null||l.handleFocus()}handleSelectionChanged(l,f,x){var E;this._selectionState.start=l,this._selectionState.end=f,this._selectionState.columnSelectMode=x,(E=this._renderer.value)==null||E.handleSelectionChanged(l,f,x)}handleCursorMove(){var l;(l=this._renderer.value)==null||l.handleCursorMove()}clear(){var l;(l=this._renderer.value)==null||l.clear()}};i.RenderService=h=d([m(2,p.IOptionsService),m(3,g.ICharSizeService),m(4,p.IDecorationService),m(5,p.IBufferService),m(6,g.ICoreBrowserService),m(7,g.IThemeService)],h)},9312:function(u,i,a){var d=this&&this.__decorate||function(w,R,T,M){var O,A=arguments.length,F=A<3?R:M===null?M=Object.getOwnPropertyDescriptor(R,T):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(w,R,T,M);else for(var U=w.length-1;U>=0;U--)(O=w[U])&&(F=(A<3?O(F):A>3?O(R,T,F):O(R,T))||F);return A>3&&F&&Object.defineProperty(R,T,F),F},m=this&&this.__param||function(w,R){return function(T,M){R(T,M,w)}};Object.defineProperty(i,"__esModule",{value:!0}),i.SelectionService=void 0;const c=a(9806),g=a(9504),y=a(456),C=a(4725),_=a(8460),p=a(844),h=a(6114),l=a(4841),f=a(511),x=a(2585),E=" ",k=new RegExp(E,"g");let b=i.SelectionService=class extends p.Disposable{constructor(w,R,T,M,O,A,F,U,G){super(),this._element=w,this._screenElement=R,this._linkifier=T,this._bufferService=M,this._coreService=O,this._mouseService=A,this._optionsService=F,this._renderService=U,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new f.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new _.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new _.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new _.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new _.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 y.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 w=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!w||!R||w[0]===R[0]&&w[1]===R[1])}get selectionText(){const w=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;if(!w||!R)return"";const T=this._bufferService.buffer,M=[];if(this._activeSelectionMode===3){if(w[0]===R[0])return"";const O=w[0]<R[0]?w[0]:R[0],A=w[0]<R[0]?R[0]:w[0];for(let F=w[1];F<=R[1];F++){const U=T.translateBufferLineToString(F,!0,O,A);M.push(U)}}else{const O=w[1]===R[1]?R[0]:void 0;M.push(T.translateBufferLineToString(w[1],!0,w[0],O));for(let A=w[1]+1;A<=R[1]-1;A++){const F=T.lines.get(A),U=T.translateBufferLineToString(A,!0);F!=null&&F.isWrapped?M[M.length-1]+=U:M.push(U)}if(w[1]!==R[1]){const A=T.lines.get(R[1]),F=T.translateBufferLineToString(R[1],!0,0,R[0]);A&&A.isWrapped?M[M.length-1]+=F:M.push(F)}}return M.map(O=>O.replace(k," ")).join(h.isWindows?`\r
276
+ `:`
277
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(w){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),h.isLinux&&w&&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(w){const R=this._getMouseBufferCoords(w),T=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!!(T&&M&&R)&&this._areCoordsInSelection(R,T,M)}isCellInSelection(w,R){const T=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!T||!M)&&this._areCoordsInSelection([w,R],T,M)}_areCoordsInSelection(w,R,T){return w[1]>R[1]&&w[1]<T[1]||R[1]===T[1]&&w[1]===R[1]&&w[0]>=R[0]&&w[0]<T[0]||R[1]<T[1]&&w[1]===T[1]&&w[0]<T[0]||R[1]<T[1]&&w[1]===R[1]&&w[0]>=R[0]}_selectWordAtCursor(w,R){var O,A;const T=(A=(O=this._linkifier.currentLink)==null?void 0:O.link)==null?void 0:A.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,l.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const M=this._getMouseBufferCoords(w);return!!M&&(this._selectWordAt(M,R),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(w,R){this._model.clearSelection(),w=Math.max(w,0),R=Math.min(R,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,w],this._model.selectionEnd=[this._bufferService.cols,R],this.refresh(),this._onSelectionChange.fire()}_handleTrim(w){this._model.handleTrim(w)&&this.refresh()}_getMouseBufferCoords(w){const R=this._mouseService.getCoords(w,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(R)return R[0]--,R[1]--,R[1]+=this._bufferService.buffer.ydisp,R}_getMouseEventScrollAmount(w){let R=(0,c.getCoordsRelativeToElement)(this._coreBrowserService.window,w,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return R>=0&&R<=T?0:(R>T&&(R-=T),R=Math.min(Math.max(R,-50),50),R/=50,R/Math.abs(R)+Math.round(14*R))}shouldForceSelection(w){return h.isMac?w.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:w.shiftKey}handleMouseDown(w){if(this._mouseDownTimeStamp=w.timeStamp,(w.button!==2||!this.hasSelection)&&w.button===0){if(!this._enabled){if(!this.shouldForceSelection(w))return;w.stopPropagation()}w.preventDefault(),this._dragScrollAmount=0,this._enabled&&w.shiftKey?this._handleIncrementalClick(w):w.detail===1?this._handleSingleClick(w):w.detail===2?this._handleDoubleClick(w):w.detail===3&&this._handleTripleClick(w),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(w){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(w))}_handleSingleClick(w){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(w)?3:0,this._model.selectionStart=this._getMouseBufferCoords(w),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const R=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);R&&R.length!==this._model.selectionStart[0]&&R.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(w){this._selectWordAtCursor(w,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(w){const R=this._getMouseBufferCoords(w);R&&(this._activeSelectionMode=2,this._selectLineAt(R[1]))}shouldColumnSelect(w){return w.altKey&&!(h.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(w){if(w.stopImmediatePropagation(),!this._model.selectionStart)return;const R=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(w),!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(w),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const M=T.lines.get(this._model.selectionEnd[1]);M&&M.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}R&&R[0]===this._model.selectionEnd[0]&&R[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 w=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(w.ydisp+this._bufferService.rows,w.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=w.ydisp),this.refresh()}}_handleMouseUp(w){const R=w.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&R<500&&w.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(w,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const M=(0,g.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(M,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const w=this._model.finalSelectionStart,R=this._model.finalSelectionEnd,T=!(!w||!R||w[0]===R[0]&&w[1]===R[1]);T?w&&R&&(this._oldSelectionStart&&this._oldSelectionEnd&&w[0]===this._oldSelectionStart[0]&&w[1]===this._oldSelectionStart[1]&&R[0]===this._oldSelectionEnd[0]&&R[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(w,R,T)):this._oldHasSelection&&this._fireOnSelectionChange(w,R,T)}_fireOnSelectionChange(w,R,T){this._oldSelectionStart=w,this._oldSelectionEnd=R,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(w){this.clearSelection(),this._trimListener.dispose(),this._trimListener=w.activeBuffer.lines.onTrim(R=>this._handleTrim(R))}_convertViewportColToCharacterIndex(w,R){let T=R;for(let M=0;R>=M;M++){const O=w.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:O>1&&R!==M&&(T+=O-1)}return T}setSelection(w,R,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[w,R],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(w){this._isClickInSelection(w)||(this._selectWordAtCursor(w,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(w,R,T=!0,M=!0){if(w[0]>=this._bufferService.cols)return;const O=this._bufferService.buffer,A=O.lines.get(w[1]);if(!A)return;const F=O.translateBufferLineToString(w[1],!1);let U=this._convertViewportColToCharacterIndex(A,w[0]),G=U;const K=w[0]-U;let B=0,P=0,N=0,j=0;if(F.charAt(U)===" "){for(;U>0&&F.charAt(U-1)===" ";)U--;for(;G<F.length&&F.charAt(G+1)===" ";)G++}else{let $=w[0],V=w[0];A.getWidth($)===0&&(B++,$--),A.getWidth(V)===2&&(P++,V++);const q=A.getString(V).length;for(q>1&&(j+=q-1,G+=q-1);$>0&&U>0&&!this._isCharWordSeparator(A.loadCell($-1,this._workCell));){A.loadCell($-1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===0?(B++,$--):I>1&&(N+=I-1,U-=I-1),U--,$--}for(;V<A.length&&G+1<F.length&&!this._isCharWordSeparator(A.loadCell(V+1,this._workCell));){A.loadCell(V+1,this._workCell);const I=this._workCell.getChars().length;this._workCell.getWidth()===2?(P++,V++):I>1&&(j+=I-1,G+=I-1),G++,V++}}G++;let D=U+K-B+N,W=Math.min(this._bufferService.cols,G-U+B+P-N-j);if(R||F.slice(U,G).trim()!==""){if(T&&D===0&&A.getCodePoint(0)!==32){const $=O.lines.get(w[1]-1);if($&&A.isWrapped&&$.getCodePoint(this._bufferService.cols-1)!==32){const V=this._getWordAt([this._bufferService.cols-1,w[1]-1],!1,!0,!1);if(V){const q=this._bufferService.cols-V.start;D-=q,W+=q}}}if(M&&D+W===this._bufferService.cols&&A.getCodePoint(this._bufferService.cols-1)!==32){const $=O.lines.get(w[1]+1);if($!=null&&$.isWrapped&&$.getCodePoint(0)!==32){const V=this._getWordAt([0,w[1]+1],!1,!1,!0);V&&(W+=V.length)}}return{start:D,length:W}}}_selectWordAt(w,R){const T=this._getWordAt(w,R);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,w[1]--;this._model.selectionStart=[T.start,w[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(w){const R=this._getWordAt(w,!0);if(R){let T=w[1];for(;R.start<0;)R.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;R.start+R.length>this._bufferService.cols;)R.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?R.start:R.start+R.length,T]}}_isCharWordSeparator(w){return w.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(w.getChars())>=0}_selectLineAt(w){const R=this._bufferService.buffer.getWrappedRangeForLine(w),T={start:{x:0,y:R.first},end:{x:this._bufferService.cols-1,y:R.last}};this._model.selectionStart=[0,R.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,l.getRangeLength)(T,this._bufferService.cols)}};i.SelectionService=b=d([m(3,x.IBufferService),m(4,x.ICoreService),m(5,C.IMouseService),m(6,x.IOptionsService),m(7,C.IRenderService),m(8,C.ICoreBrowserService)],b)},4725:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ILinkProviderService=i.IThemeService=i.ICharacterJoinerService=i.ISelectionService=i.IRenderService=i.IMouseService=i.ICoreBrowserService=i.ICharSizeService=void 0;const d=a(8343);i.ICharSizeService=(0,d.createDecorator)("CharSizeService"),i.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),i.IMouseService=(0,d.createDecorator)("MouseService"),i.IRenderService=(0,d.createDecorator)("RenderService"),i.ISelectionService=(0,d.createDecorator)("SelectionService"),i.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),i.IThemeService=(0,d.createDecorator)("ThemeService"),i.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(u,i,a){var d=this&&this.__decorate||function(b,w,R,T){var M,O=arguments.length,A=O<3?w:T===null?T=Object.getOwnPropertyDescriptor(w,R):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(b,w,R,T);else for(var F=b.length-1;F>=0;F--)(M=b[F])&&(A=(O<3?M(A):O>3?M(w,R,A):M(w,R))||A);return O>3&&A&&Object.defineProperty(w,R,A),A},m=this&&this.__param||function(b,w){return function(R,T){w(R,T,b)}};Object.defineProperty(i,"__esModule",{value:!0}),i.ThemeService=i.DEFAULT_ANSI_COLORS=void 0;const c=a(7239),g=a(8055),y=a(8460),C=a(844),_=a(2585),p=g.css.toColor("#ffffff"),h=g.css.toColor("#000000"),l=g.css.toColor("#ffffff"),f=g.css.toColor("#000000"),x={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};i.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const b=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],w=[0,95,135,175,215,255];for(let R=0;R<216;R++){const T=w[R/36%6|0],M=w[R/6%6|0],O=w[R%6];b.push({css:g.channels.toCss(T,M,O),rgba:g.channels.toRgba(T,M,O)})}for(let R=0;R<24;R++){const T=8+10*R;b.push({css:g.channels.toCss(T,T,T),rgba:g.channels.toRgba(T,T,T)})}return b})());let E=i.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(b){super(),this._optionsService=b,this._contrastCache=new c.ColorContrastCache,this._halfContrastCache=new c.ColorContrastCache,this._onChangeColors=this.register(new y.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:p,background:h,cursor:l,cursorAccent:f,selectionForeground:void 0,selectionBackgroundTransparent:x,selectionBackgroundOpaque:g.color.blend(h,x),selectionInactiveBackgroundTransparent:x,selectionInactiveBackgroundOpaque:g.color.blend(h,x),ansi:i.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(b={}){const w=this._colors;if(w.foreground=k(b.foreground,p),w.background=k(b.background,h),w.cursor=k(b.cursor,l),w.cursorAccent=k(b.cursorAccent,f),w.selectionBackgroundTransparent=k(b.selectionBackground,x),w.selectionBackgroundOpaque=g.color.blend(w.background,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundTransparent=k(b.selectionInactiveBackground,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundOpaque=g.color.blend(w.background,w.selectionInactiveBackgroundTransparent),w.selectionForeground=b.selectionForeground?k(b.selectionForeground,g.NULL_COLOR):void 0,w.selectionForeground===g.NULL_COLOR&&(w.selectionForeground=void 0),g.color.isOpaque(w.selectionBackgroundTransparent)&&(w.selectionBackgroundTransparent=g.color.opacity(w.selectionBackgroundTransparent,.3)),g.color.isOpaque(w.selectionInactiveBackgroundTransparent)&&(w.selectionInactiveBackgroundTransparent=g.color.opacity(w.selectionInactiveBackgroundTransparent,.3)),w.ansi=i.DEFAULT_ANSI_COLORS.slice(),w.ansi[0]=k(b.black,i.DEFAULT_ANSI_COLORS[0]),w.ansi[1]=k(b.red,i.DEFAULT_ANSI_COLORS[1]),w.ansi[2]=k(b.green,i.DEFAULT_ANSI_COLORS[2]),w.ansi[3]=k(b.yellow,i.DEFAULT_ANSI_COLORS[3]),w.ansi[4]=k(b.blue,i.DEFAULT_ANSI_COLORS[4]),w.ansi[5]=k(b.magenta,i.DEFAULT_ANSI_COLORS[5]),w.ansi[6]=k(b.cyan,i.DEFAULT_ANSI_COLORS[6]),w.ansi[7]=k(b.white,i.DEFAULT_ANSI_COLORS[7]),w.ansi[8]=k(b.brightBlack,i.DEFAULT_ANSI_COLORS[8]),w.ansi[9]=k(b.brightRed,i.DEFAULT_ANSI_COLORS[9]),w.ansi[10]=k(b.brightGreen,i.DEFAULT_ANSI_COLORS[10]),w.ansi[11]=k(b.brightYellow,i.DEFAULT_ANSI_COLORS[11]),w.ansi[12]=k(b.brightBlue,i.DEFAULT_ANSI_COLORS[12]),w.ansi[13]=k(b.brightMagenta,i.DEFAULT_ANSI_COLORS[13]),w.ansi[14]=k(b.brightCyan,i.DEFAULT_ANSI_COLORS[14]),w.ansi[15]=k(b.brightWhite,i.DEFAULT_ANSI_COLORS[15]),b.extendedAnsi){const R=Math.min(w.ansi.length-16,b.extendedAnsi.length);for(let T=0;T<R;T++)w.ansi[T+16]=k(b.extendedAnsi[T],i.DEFAULT_ANSI_COLORS[T+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(b){this._restoreColor(b),this._onChangeColors.fire(this.colors)}_restoreColor(b){if(b!==void 0)switch(b){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[b]=this._restoreColors.ansi[b]}else for(let w=0;w<this._restoreColors.ansi.length;++w)this._colors.ansi[w]=this._restoreColors.ansi[w]}modifyColors(b){b(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 k(b,w){if(b!==void 0)try{return g.css.toColor(b)}catch{}return w}i.ThemeService=E=d([m(0,_.IOptionsService)],E)},6349:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CircularList=void 0;const d=a(8460),m=a(844);class c extends m.Disposable{constructor(y){super(),this._maxLength=y,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.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(y){if(this._maxLength===y)return;const C=new Array(y);for(let _=0;_<Math.min(y,this.length);_++)C[_]=this._array[this._getCyclicIndex(_)];this._array=C,this._maxLength=y,this._startIndex=0}get length(){return this._length}set length(y){if(y>this._length)for(let C=this._length;C<y;C++)this._array[C]=void 0;this._length=y}get(y){return this._array[this._getCyclicIndex(y)]}set(y,C){this._array[this._getCyclicIndex(y)]=C}push(y){this._array[this._getCyclicIndex(this._length)]=y,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(y,C,..._){if(C){for(let p=y;p<this._length-C;p++)this._array[this._getCyclicIndex(p)]=this._array[this._getCyclicIndex(p+C)];this._length-=C,this.onDeleteEmitter.fire({index:y,amount:C})}for(let p=this._length-1;p>=y;p--)this._array[this._getCyclicIndex(p+_.length)]=this._array[this._getCyclicIndex(p)];for(let p=0;p<_.length;p++)this._array[this._getCyclicIndex(y+p)]=_[p];if(_.length&&this.onInsertEmitter.fire({index:y,amount:_.length}),this._length+_.length>this._maxLength){const p=this._length+_.length-this._maxLength;this._startIndex+=p,this._length=this._maxLength,this.onTrimEmitter.fire(p)}else this._length+=_.length}trimStart(y){y>this._length&&(y=this._length),this._startIndex+=y,this._length-=y,this.onTrimEmitter.fire(y)}shiftElements(y,C,_){if(!(C<=0)){if(y<0||y>=this._length)throw new Error("start argument out of range");if(y+_<0)throw new Error("Cannot shift elements in list beyond index 0");if(_>0){for(let h=C-1;h>=0;h--)this.set(y+h+_,this.get(y+h));const p=y+C+_-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(y+p+_,this.get(y+p))}}_getCyclicIndex(y){return(this._startIndex+y)%this._maxLength}}i.CircularList=c},1439:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.clone=void 0,i.clone=function a(d,m=5){if(typeof d!="object")return d;const c=Array.isArray(d)?[]:{};for(const g in d)c[g]=m<=1?d[g]:d[g]&&a(d[g],m-1);return c}},8055:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.contrastRatio=i.toPaddedHex=i.rgba=i.rgb=i.css=i.color=i.channels=i.NULL_COLOR=void 0;let a=0,d=0,m=0,c=0;var g,y,C,_,p;function h(f){const x=f.toString(16);return x.length<2?"0"+x:x}function l(f,x){return f<x?(x+.05)/(f+.05):(f+.05)/(x+.05)}i.NULL_COLOR={css:"#00000000",rgba:0},function(f){f.toCss=function(x,E,k,b){return b!==void 0?`#${h(x)}${h(E)}${h(k)}${h(b)}`:`#${h(x)}${h(E)}${h(k)}`},f.toRgba=function(x,E,k,b=255){return(x<<24|E<<16|k<<8|b)>>>0},f.toColor=function(x,E,k,b){return{css:f.toCss(x,E,k,b),rgba:f.toRgba(x,E,k,b)}}}(g||(i.channels=g={})),function(f){function x(E,k){return c=Math.round(255*k),[a,d,m]=p.toChannels(E.rgba),{css:g.toCss(a,d,m,c),rgba:g.toRgba(a,d,m,c)}}f.blend=function(E,k){if(c=(255&k.rgba)/255,c===1)return{css:k.css,rgba:k.rgba};const b=k.rgba>>24&255,w=k.rgba>>16&255,R=k.rgba>>8&255,T=E.rgba>>24&255,M=E.rgba>>16&255,O=E.rgba>>8&255;return a=T+Math.round((b-T)*c),d=M+Math.round((w-M)*c),m=O+Math.round((R-O)*c),{css:g.toCss(a,d,m),rgba:g.toRgba(a,d,m)}},f.isOpaque=function(E){return(255&E.rgba)==255},f.ensureContrastRatio=function(E,k,b){const w=p.ensureContrastRatio(E.rgba,k.rgba,b);if(w)return g.toColor(w>>24&255,w>>16&255,w>>8&255)},f.opaque=function(E){const k=(255|E.rgba)>>>0;return[a,d,m]=p.toChannels(k),{css:g.toCss(a,d,m),rgba:k}},f.opacity=x,f.multiplyOpacity=function(E,k){return c=255&E.rgba,x(E,c*k/255)},f.toColorRGB=function(E){return[E.rgba>>24&255,E.rgba>>16&255,E.rgba>>8&255]}}(y||(i.color=y={})),function(f){let x,E;try{const k=document.createElement("canvas");k.width=1,k.height=1;const b=k.getContext("2d",{willReadFrequently:!0});b&&(x=b,x.globalCompositeOperation="copy",E=x.createLinearGradient(0,0,1,1))}catch{}f.toColor=function(k){if(k.match(/#[\da-f]{3,8}/i))switch(k.length){case 4:return a=parseInt(k.slice(1,2).repeat(2),16),d=parseInt(k.slice(2,3).repeat(2),16),m=parseInt(k.slice(3,4).repeat(2),16),g.toColor(a,d,m);case 5:return a=parseInt(k.slice(1,2).repeat(2),16),d=parseInt(k.slice(2,3).repeat(2),16),m=parseInt(k.slice(3,4).repeat(2),16),c=parseInt(k.slice(4,5).repeat(2),16),g.toColor(a,d,m,c);case 7:return{css:k,rgba:(parseInt(k.slice(1),16)<<8|255)>>>0};case 9:return{css:k,rgba:parseInt(k.slice(1),16)>>>0}}const b=k.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(b)return a=parseInt(b[1]),d=parseInt(b[2]),m=parseInt(b[3]),c=Math.round(255*(b[5]===void 0?1:parseFloat(b[5]))),g.toColor(a,d,m,c);if(!x||!E)throw new Error("css.toColor: Unsupported css format");if(x.fillStyle=E,x.fillStyle=k,typeof x.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(x.fillRect(0,0,1,1),[a,d,m,c]=x.getImageData(0,0,1,1).data,c!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(a,d,m,c),css:k}}}(C||(i.css=C={})),function(f){function x(E,k,b){const w=E/255,R=k/255,T=b/255;return .2126*(w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}f.relativeLuminance=function(E){return x(E>>16&255,E>>8&255,255&E)},f.relativeLuminance2=x}(_||(i.rgb=_={})),function(f){function x(k,b,w){const R=k>>24&255,T=k>>16&255,M=k>>8&255;let O=b>>24&255,A=b>>16&255,F=b>>8&255,U=l(_.relativeLuminance2(O,A,F),_.relativeLuminance2(R,T,M));for(;U<w&&(O>0||A>0||F>0);)O-=Math.max(0,Math.ceil(.1*O)),A-=Math.max(0,Math.ceil(.1*A)),F-=Math.max(0,Math.ceil(.1*F)),U=l(_.relativeLuminance2(O,A,F),_.relativeLuminance2(R,T,M));return(O<<24|A<<16|F<<8|255)>>>0}function E(k,b,w){const R=k>>24&255,T=k>>16&255,M=k>>8&255;let O=b>>24&255,A=b>>16&255,F=b>>8&255,U=l(_.relativeLuminance2(O,A,F),_.relativeLuminance2(R,T,M));for(;U<w&&(O<255||A<255||F<255);)O=Math.min(255,O+Math.ceil(.1*(255-O))),A=Math.min(255,A+Math.ceil(.1*(255-A))),F=Math.min(255,F+Math.ceil(.1*(255-F))),U=l(_.relativeLuminance2(O,A,F),_.relativeLuminance2(R,T,M));return(O<<24|A<<16|F<<8|255)>>>0}f.blend=function(k,b){if(c=(255&b)/255,c===1)return b;const w=b>>24&255,R=b>>16&255,T=b>>8&255,M=k>>24&255,O=k>>16&255,A=k>>8&255;return a=M+Math.round((w-M)*c),d=O+Math.round((R-O)*c),m=A+Math.round((T-A)*c),g.toRgba(a,d,m)},f.ensureContrastRatio=function(k,b,w){const R=_.relativeLuminance(k>>8),T=_.relativeLuminance(b>>8);if(l(R,T)<w){if(T<R){const A=x(k,b,w),F=l(R,_.relativeLuminance(A>>8));if(F<w){const U=E(k,b,w);return F>l(R,_.relativeLuminance(U>>8))?A:U}return A}const M=E(k,b,w),O=l(R,_.relativeLuminance(M>>8));if(O<w){const A=x(k,b,w);return O>l(R,_.relativeLuminance(A>>8))?M:A}return M}},f.reduceLuminance=x,f.increaseLuminance=E,f.toChannels=function(k){return[k>>24&255,k>>16&255,k>>8&255,255&k]}}(p||(i.rgba=p={})),i.toPaddedHex=h,i.contrastRatio=l},8969:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CoreTerminal=void 0;const d=a(844),m=a(2585),c=a(4348),g=a(7866),y=a(744),C=a(7302),_=a(6975),p=a(8460),h=a(1753),l=a(1480),f=a(7994),x=a(9282),E=a(5435),k=a(5981),b=a(2660);let w=!1;class R extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new p.EventEmitter),this._onScroll.event(M=>{var O;(O=this._onScrollApi)==null||O.fire(M.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(M){for(const O in M)this.optionsService.options[O]=M[O]}constructor(M){super(),this._windowsWrappingHeuristics=this.register(new d.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 c.InstantiationService,this.optionsService=this.register(new C.OptionsService(M)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(y.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(_.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(h.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(l.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(f.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(b.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new E.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(O=>{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(O=>{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 k.WriteBuffer((O,A)=>this._inputHandler.parse(O,A))),this.register((0,p.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,O){this._writeBuffer.write(M,O)}writeSync(M,O){this._logService.logLevel<=m.LogLevelEnum.WARN&&!w&&(this._logService.warn("writeSync is unreliable and will be removed soon."),w=!0),this._writeBuffer.writeSync(M,O)}input(M,O=!0){this.coreService.triggerDataEvent(M,O)}resize(M,O){isNaN(M)||isNaN(O)||(M=Math.max(M,y.MINIMUM_COLS),O=Math.max(O,y.MINIMUM_ROWS),this._bufferService.resize(M,O))}scroll(M,O=!1){this._bufferService.scroll(M,O)}scrollLines(M,O,A){this._bufferService.scrollLines(M,O,A)}scrollPages(M){this.scrollLines(M*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(M){const O=M-this._bufferService.buffer.ydisp;O!==0&&this.scrollLines(O)}registerEscHandler(M,O){return this._inputHandler.registerEscHandler(M,O)}registerDcsHandler(M,O){return this._inputHandler.registerDcsHandler(M,O)}registerCsiHandler(M,O){return this._inputHandler.registerCsiHandler(M,O)}registerOscHandler(M,O){return this._inputHandler.registerOscHandler(M,O)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let M=!1;const O=this.optionsService.rawOptions.windowsPty;O&&O.buildNumber!==void 0&&O.buildNumber!==void 0?M=O.backend==="conpty"&&O.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(M=!0),M?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const M=[];M.push(this.onLineFeed(x.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},()=>((0,x.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)(()=>{for(const O of M)O.dispose()})}}}i.CoreTerminal=R},8460:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.runAndSubscribe=i.forwardEvent=i.EventEmitter=void 0,i.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===a)return void this._listeners.splice(d,1)}}})),this._event}fire(a,d){const m=[];for(let c=0;c<this._listeners.length;c++)m.push(this._listeners[c]);for(let c=0;c<m.length;c++)m[c].call(void 0,a,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},i.forwardEvent=function(a,d){return a(m=>d.fire(m))},i.runAndSubscribe=function(a,d){return d(void 0),a(m=>d(m))}},5435:function(u,i,a){var d=this&&this.__decorate||function(B,P,N,j){var D,W=arguments.length,$=W<3?P:j===null?j=Object.getOwnPropertyDescriptor(P,N):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(B,P,N,j);else for(var V=B.length-1;V>=0;V--)(D=B[V])&&($=(W<3?D($):W>3?D(P,N,$):D(P,N))||$);return W>3&&$&&Object.defineProperty(P,N,$),$},m=this&&this.__param||function(B,P){return function(N,j){P(N,j,B)}};Object.defineProperty(i,"__esModule",{value:!0}),i.InputHandler=i.WindowsOptionsReportType=void 0;const c=a(2584),g=a(7116),y=a(2015),C=a(844),_=a(482),p=a(8437),h=a(8460),l=a(643),f=a(511),x=a(3734),E=a(2585),k=a(1480),b=a(6242),w=a(6351),R=a(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},M=131072;function O(B,P){if(B>24)return P.setWinLines||!1;switch(B){case 1:return!!P.restoreWin;case 2:return!!P.minimizeWin;case 3:return!!P.setWinPosition;case 4:return!!P.setWinSizePixels;case 5:return!!P.raiseWin;case 6:return!!P.lowerWin;case 7:return!!P.refreshWin;case 8:return!!P.setWinSizeChars;case 9:return!!P.maximizeWin;case 10:return!!P.fullscreenWin;case 11:return!!P.getWinState;case 13:return!!P.getWinPosition;case 14:return!!P.getWinSizePixels;case 15:return!!P.getScreenSizePixels;case 16:return!!P.getCellSizePixels;case 18:return!!P.getWinSizeChars;case 19:return!!P.getScreenSizeChars;case 20:return!!P.getIconTitle;case 21:return!!P.getWinTitle;case 22:return!!P.pushTitle;case 23:return!!P.popTitle;case 24:return!!P.setWinLines}return!1}var A;(function(B){B[B.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",B[B.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(A||(i.WindowsOptionsReportType=A={}));let F=0;class U extends C.Disposable{getAttrData(){return this._curAttrData}constructor(P,N,j,D,W,$,V,q,I=new y.EscapeSequenceParser){super(),this._bufferService=P,this._charsetService=N,this._coreService=j,this._logService=D,this._optionsService=W,this._oscLinkService=$,this._coreMouseService=V,this._unicodeService=q,this._parser=I,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.Utf8ToUtf32,this._workCell=new f.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 h.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new h.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new h.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new h.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new h.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new h.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new h.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new h.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new h.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new h.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new h.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 G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(L=>this._activeBuffer=L.activeBuffer)),this._parser.setCsiHandlerFallback((L,z)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(L),params:z.toArray()})}),this._parser.setEscHandlerFallback(L=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(L)})}),this._parser.setExecuteHandlerFallback(L=>{this._logService.debug("Unknown EXECUTE code: ",{code:L})}),this._parser.setOscHandlerFallback((L,z,H)=>{this._logService.debug("Unknown OSC code: ",{identifier:L,action:z,data:H})}),this._parser.setDcsHandlerFallback((L,z,H)=>{z==="HOOK"&&(H=H.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(L),action:z,payload:H})}),this._parser.setPrintHandler((L,z,H)=>this.print(L,z,H)),this._parser.registerCsiHandler({final:"@"},L=>this.insertChars(L)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},L=>this.scrollLeft(L)),this._parser.registerCsiHandler({final:"A"},L=>this.cursorUp(L)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},L=>this.scrollRight(L)),this._parser.registerCsiHandler({final:"B"},L=>this.cursorDown(L)),this._parser.registerCsiHandler({final:"C"},L=>this.cursorForward(L)),this._parser.registerCsiHandler({final:"D"},L=>this.cursorBackward(L)),this._parser.registerCsiHandler({final:"E"},L=>this.cursorNextLine(L)),this._parser.registerCsiHandler({final:"F"},L=>this.cursorPrecedingLine(L)),this._parser.registerCsiHandler({final:"G"},L=>this.cursorCharAbsolute(L)),this._parser.registerCsiHandler({final:"H"},L=>this.cursorPosition(L)),this._parser.registerCsiHandler({final:"I"},L=>this.cursorForwardTab(L)),this._parser.registerCsiHandler({final:"J"},L=>this.eraseInDisplay(L,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},L=>this.eraseInDisplay(L,!0)),this._parser.registerCsiHandler({final:"K"},L=>this.eraseInLine(L,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},L=>this.eraseInLine(L,!0)),this._parser.registerCsiHandler({final:"L"},L=>this.insertLines(L)),this._parser.registerCsiHandler({final:"M"},L=>this.deleteLines(L)),this._parser.registerCsiHandler({final:"P"},L=>this.deleteChars(L)),this._parser.registerCsiHandler({final:"S"},L=>this.scrollUp(L)),this._parser.registerCsiHandler({final:"T"},L=>this.scrollDown(L)),this._parser.registerCsiHandler({final:"X"},L=>this.eraseChars(L)),this._parser.registerCsiHandler({final:"Z"},L=>this.cursorBackwardTab(L)),this._parser.registerCsiHandler({final:"`"},L=>this.charPosAbsolute(L)),this._parser.registerCsiHandler({final:"a"},L=>this.hPositionRelative(L)),this._parser.registerCsiHandler({final:"b"},L=>this.repeatPrecedingCharacter(L)),this._parser.registerCsiHandler({final:"c"},L=>this.sendDeviceAttributesPrimary(L)),this._parser.registerCsiHandler({prefix:">",final:"c"},L=>this.sendDeviceAttributesSecondary(L)),this._parser.registerCsiHandler({final:"d"},L=>this.linePosAbsolute(L)),this._parser.registerCsiHandler({final:"e"},L=>this.vPositionRelative(L)),this._parser.registerCsiHandler({final:"f"},L=>this.hVPosition(L)),this._parser.registerCsiHandler({final:"g"},L=>this.tabClear(L)),this._parser.registerCsiHandler({final:"h"},L=>this.setMode(L)),this._parser.registerCsiHandler({prefix:"?",final:"h"},L=>this.setModePrivate(L)),this._parser.registerCsiHandler({final:"l"},L=>this.resetMode(L)),this._parser.registerCsiHandler({prefix:"?",final:"l"},L=>this.resetModePrivate(L)),this._parser.registerCsiHandler({final:"m"},L=>this.charAttributes(L)),this._parser.registerCsiHandler({final:"n"},L=>this.deviceStatus(L)),this._parser.registerCsiHandler({prefix:"?",final:"n"},L=>this.deviceStatusPrivate(L)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},L=>this.softReset(L)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},L=>this.setCursorStyle(L)),this._parser.registerCsiHandler({final:"r"},L=>this.setScrollRegion(L)),this._parser.registerCsiHandler({final:"s"},L=>this.saveCursor(L)),this._parser.registerCsiHandler({final:"t"},L=>this.windowOptions(L)),this._parser.registerCsiHandler({final:"u"},L=>this.restoreCursor(L)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},L=>this.insertColumns(L)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},L=>this.deleteColumns(L)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},L=>this.selectProtected(L)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},L=>this.requestMode(L,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},L=>this.requestMode(L,!1)),this._parser.setExecuteHandler(c.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(c.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(c.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(c.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(c.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(c.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(c.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(c.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(c.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(c.C1.IND,()=>this.index()),this._parser.setExecuteHandler(c.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(c.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new b.OscHandler(L=>(this.setTitle(L),this.setIconName(L),!0))),this._parser.registerOscHandler(1,new b.OscHandler(L=>this.setIconName(L))),this._parser.registerOscHandler(2,new b.OscHandler(L=>this.setTitle(L))),this._parser.registerOscHandler(4,new b.OscHandler(L=>this.setOrReportIndexedColor(L))),this._parser.registerOscHandler(8,new b.OscHandler(L=>this.setHyperlink(L))),this._parser.registerOscHandler(10,new b.OscHandler(L=>this.setOrReportFgColor(L))),this._parser.registerOscHandler(11,new b.OscHandler(L=>this.setOrReportBgColor(L))),this._parser.registerOscHandler(12,new b.OscHandler(L=>this.setOrReportCursorColor(L))),this._parser.registerOscHandler(104,new b.OscHandler(L=>this.restoreIndexedColor(L))),this._parser.registerOscHandler(110,new b.OscHandler(L=>this.restoreFgColor(L))),this._parser.registerOscHandler(111,new b.OscHandler(L=>this.restoreBgColor(L))),this._parser.registerOscHandler(112,new b.OscHandler(L=>this.restoreCursorColor(L))),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 L in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:L},()=>this.selectCharset("("+L)),this._parser.registerEscHandler({intermediates:")",final:L},()=>this.selectCharset(")"+L)),this._parser.registerEscHandler({intermediates:"*",final:L},()=>this.selectCharset("*"+L)),this._parser.registerEscHandler({intermediates:"+",final:L},()=>this.selectCharset("+"+L)),this._parser.registerEscHandler({intermediates:"-",final:L},()=>this.selectCharset("-"+L)),this._parser.registerEscHandler({intermediates:".",final:L},()=>this.selectCharset("."+L)),this._parser.registerEscHandler({intermediates:"/",final:L},()=>this.selectCharset("/"+L));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(L=>(this._logService.error("Parsing error: ",L),L)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new w.DcsHandler((L,z)=>this.requestStatusString(L,z)))}_preserveStack(P,N,j,D){this._parseStack.paused=!0,this._parseStack.cursorStartX=P,this._parseStack.cursorStartY=N,this._parseStack.decodedLength=j,this._parseStack.position=D}_logSlowResolvingAsync(P){this._logService.logLevel<=E.LogLevelEnum.WARN&&Promise.race([P,new Promise((N,j)=>setTimeout(()=>j("#SLOW_TIMEOUT"),5e3))]).catch(N=>{if(N!=="#SLOW_TIMEOUT")throw N;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(P,N){let j,D=this._activeBuffer.x,W=this._activeBuffer.y,$=0;const V=this._parseStack.paused;if(V){if(j=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,N))return this._logSlowResolvingAsync(j),j;D=this._parseStack.cursorStartX,W=this._parseStack.cursorStartY,this._parseStack.paused=!1,P.length>M&&($=this._parseStack.position+M)}if(this._logService.logLevel<=E.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof P=="string"?` "${P}"`:` "${Array.prototype.map.call(P,L=>String.fromCharCode(L)).join("")}"`),typeof P=="string"?P.split("").map(L=>L.charCodeAt(0)):P),this._parseBuffer.length<P.length&&this._parseBuffer.length<M&&(this._parseBuffer=new Uint32Array(Math.min(P.length,M))),V||this._dirtyRowTracker.clearRange(),P.length>M)for(let L=$;L<P.length;L+=M){const z=L+M<P.length?L+M:P.length,H=typeof P=="string"?this._stringDecoder.decode(P.substring(L,z),this._parseBuffer):this._utf8Decoder.decode(P.subarray(L,z),this._parseBuffer);if(j=this._parser.parse(this._parseBuffer,H))return this._preserveStack(D,W,H,L),this._logSlowResolvingAsync(j),j}else if(!V){const L=typeof P=="string"?this._stringDecoder.decode(P,this._parseBuffer):this._utf8Decoder.decode(P,this._parseBuffer);if(j=this._parser.parse(this._parseBuffer,L))return this._preserveStack(D,W,L,0),this._logSlowResolvingAsync(j),j}this._activeBuffer.x===D&&this._activeBuffer.y===W||this._onCursorMove.fire();const q=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),I=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);I<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(I,this._bufferService.rows-1),Math.min(q,this._bufferService.rows-1))}print(P,N,j){let D,W;const $=this._charsetService.charset,V=this._optionsService.rawOptions.screenReaderMode,q=this._bufferService.cols,I=this._coreService.decPrivateModes.wraparound,L=this._coreService.modes.insertMode,z=this._curAttrData;let H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&j-N>0&&H.getWidth(this._activeBuffer.x-1)===2&&H.setCellFromCodepoint(this._activeBuffer.x-1,0,1,z);let Y=this._parser.precedingJoinState;for(let X=N;X<j;++X){if(D=P[X],D<127&&$){const Ce=$[String.fromCharCode(D)];Ce&&(D=Ce.charCodeAt(0))}const ne=this._unicodeService.charProperties(D,Y);W=k.UnicodeService.extractWidth(ne);const oe=k.UnicodeService.extractShouldJoin(ne),he=oe?k.UnicodeService.extractWidth(Y):0;if(Y=ne,V&&this._onA11yChar.fire((0,_.stringFromCodePoint)(D)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+W-he>q){if(I){const Ce=H;let se=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),H=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),he>0&&H instanceof p.BufferLine&&H.copyCellsFrom(Ce,se,0,he,!1);se<q;)Ce.setCellFromCodepoint(se++,0,1,z)}else if(this._activeBuffer.x=q-1,W===2)continue}if(oe&&this._activeBuffer.x){const Ce=H.getWidth(this._activeBuffer.x-1)?1:2;H.addCodepointToCell(this._activeBuffer.x-Ce,D,W);for(let se=W-he;--se>=0;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,z)}else if(L&&(H.insertCells(this._activeBuffer.x,W-he,this._activeBuffer.getNullCell(z)),H.getWidth(q-1)===2&&H.setCellFromCodepoint(q-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,z)),H.setCellFromCodepoint(this._activeBuffer.x++,D,W,z),W>0)for(;--W;)H.setCellFromCodepoint(this._activeBuffer.x++,0,0,z)}this._parser.precedingJoinState=Y,this._activeBuffer.x<q&&j-N>0&&H.getWidth(this._activeBuffer.x)===0&&!H.hasContent(this._activeBuffer.x)&&H.setCellFromCodepoint(this._activeBuffer.x,0,1,z),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(P,N){return P.final!=="t"||P.prefix||P.intermediates?this._parser.registerCsiHandler(P,N):this._parser.registerCsiHandler(P,j=>!O(j.params[0],this._optionsService.rawOptions.windowOptions)||N(j))}registerDcsHandler(P,N){return this._parser.registerDcsHandler(P,new w.DcsHandler(N))}registerEscHandler(P,N){return this._parser.registerEscHandler(P,N)}registerOscHandler(P,N){return this._parser.registerOscHandler(P,new b.OscHandler(N))}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(){var P;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&&((P=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&P.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 P=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-P),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(P=this._bufferService.cols-1){this._activeBuffer.x=Math.min(P,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(P,N){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=P,this._activeBuffer.y=this._activeBuffer.scrollTop+N):(this._activeBuffer.x=P,this._activeBuffer.y=N),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(P,N){this._restrictCursor(),this._setCursor(this._activeBuffer.x+P,this._activeBuffer.y+N)}cursorUp(P){const N=this._activeBuffer.y-this._activeBuffer.scrollTop;return N>=0?this._moveCursor(0,-Math.min(N,P.params[0]||1)):this._moveCursor(0,-(P.params[0]||1)),!0}cursorDown(P){const N=this._activeBuffer.scrollBottom-this._activeBuffer.y;return N>=0?this._moveCursor(0,Math.min(N,P.params[0]||1)):this._moveCursor(0,P.params[0]||1),!0}cursorForward(P){return this._moveCursor(P.params[0]||1,0),!0}cursorBackward(P){return this._moveCursor(-(P.params[0]||1),0),!0}cursorNextLine(P){return this.cursorDown(P),this._activeBuffer.x=0,!0}cursorPrecedingLine(P){return this.cursorUp(P),this._activeBuffer.x=0,!0}cursorCharAbsolute(P){return this._setCursor((P.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(P){return this._setCursor(P.length>=2?(P.params[1]||1)-1:0,(P.params[0]||1)-1),!0}charPosAbsolute(P){return this._setCursor((P.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(P){return this._moveCursor(P.params[0]||1,0),!0}linePosAbsolute(P){return this._setCursor(this._activeBuffer.x,(P.params[0]||1)-1),!0}vPositionRelative(P){return this._moveCursor(0,P.params[0]||1),!0}hVPosition(P){return this.cursorPosition(P),!0}tabClear(P){const N=P.params[0];return N===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:N===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(P){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let N=P.params[0]||1;for(;N--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(P){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let N=P.params[0]||1;for(;N--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(P){const N=P.params[0];return N===1&&(this._curAttrData.bg|=536870912),N!==2&&N!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(P,N,j,D=!1,W=!1){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);$.replaceCells(N,j,this._activeBuffer.getNullCell(this._eraseAttrData()),W),D&&($.isWrapped=!1)}_resetBufferLine(P,N=!1){const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);j&&(j.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),N),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+P),j.isWrapped=!1)}eraseInDisplay(P,N=!1){let j;switch(this._restrictCursor(this._bufferService.cols),P.params[0]){case 0:for(j=this._activeBuffer.y,this._dirtyRowTracker.markDirty(j),this._eraseInBufferLine(j++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,N);j<this._bufferService.rows;j++)this._resetBufferLine(j,N);this._dirtyRowTracker.markDirty(j);break;case 1:for(j=this._activeBuffer.y,this._dirtyRowTracker.markDirty(j),this._eraseInBufferLine(j,0,this._activeBuffer.x+1,!0,N),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(j+1).isWrapped=!1);j--;)this._resetBufferLine(j,N);this._dirtyRowTracker.markDirty(0);break;case 2:for(j=this._bufferService.rows,this._dirtyRowTracker.markDirty(j-1);j--;)this._resetBufferLine(j,N);this._dirtyRowTracker.markDirty(0);break;case 3:const D=this._activeBuffer.lines.length-this._bufferService.rows;D>0&&(this._activeBuffer.lines.trimStart(D),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-D,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-D,0),this._onScroll.fire(0))}return!0}eraseInLine(P,N=!1){switch(this._restrictCursor(this._bufferService.cols),P.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,N);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,N);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,N)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(P){this._restrictCursor();let N=P.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=this._activeBuffer.ybase+this._activeBuffer.y,D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-D+1;for(;N--;)this._activeBuffer.lines.splice(W-1,1),this._activeBuffer.lines.splice(j,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(P){this._restrictCursor();let N=P.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=this._activeBuffer.ybase+this._activeBuffer.y;let D;for(D=this._bufferService.rows-1-this._activeBuffer.scrollBottom,D=this._bufferService.rows-1+this._activeBuffer.ybase-D;N--;)this._activeBuffer.lines.splice(j,1),this._activeBuffer.lines.splice(D,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(P){this._restrictCursor();const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return N&&(N.insertCells(this._activeBuffer.x,P.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(P){this._restrictCursor();const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return N&&(N.deleteCells(this._activeBuffer.x,P.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(P){let N=P.params[0]||1;for(;N--;)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(P){let N=P.params[0]||1;for(;N--;)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(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=P.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);D.deleteCells(0,N,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=P.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);D.insertCells(0,N,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=P.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);D.insertCells(this._activeBuffer.x,N,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(P){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=P.params[0]||1;for(let j=this._activeBuffer.scrollTop;j<=this._activeBuffer.scrollBottom;++j){const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);D.deleteCells(this._activeBuffer.x,N,this._activeBuffer.getNullCell(this._eraseAttrData())),D.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(P){this._restrictCursor();const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return N&&(N.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(P.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(P){const N=this._parser.precedingJoinState;if(!N)return!0;const j=P.params[0]||1,D=k.UnicodeService.extractWidth(N),W=this._activeBuffer.x-D,$=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(W),V=new Uint32Array($.length*j);let q=0;for(let L=0;L<$.length;){const z=$.codePointAt(L)||0;V[q++]=z,L+=z>65535?2:1}let I=q;for(let L=1;L<j;++L)V.copyWithin(I,0,q),I+=q;return this.print(V,0,I),!0}sendDeviceAttributesPrimary(P){return P.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(c.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(c.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(P){return P.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(c.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(c.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(P.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(c.C0.ESC+"[>83;40003;0c")),!0}_is(P){return(this._optionsService.rawOptions.termName+"").indexOf(P)===0}setMode(P){for(let N=0;N<P.length;N++)switch(P.params[N]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(P){for(let N=0;N<P.length;N++)switch(P.params[N]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),this._charsetService.setgCharset(1,g.DEFAULT_CHARSET),this._charsetService.setgCharset(2,g.DEFAULT_CHARSET),this._charsetService.setgCharset(3,g.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(P){for(let N=0;N<P.length;N++)switch(P.params[N]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(P){for(let N=0;N<P.length;N++)switch(P.params[N]){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(),P.params[N]===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(P,N){const j=this._coreService.decPrivateModes,{activeProtocol:D,activeEncoding:W}=this._coreMouseService,$=this._coreService,{buffers:V,cols:q}=this._bufferService,{active:I,alt:L}=V,z=this._optionsService.rawOptions,H=oe=>oe?1:2,Y=P.params[0];return X=Y,ne=N?Y===2?4:Y===4?H($.modes.insertMode):Y===12?3:Y===20?H(z.convertEol):0:Y===1?H(j.applicationCursorKeys):Y===3?z.windowOptions.setWinLines?q===80?2:q===132?1:0:0:Y===6?H(j.origin):Y===7?H(j.wraparound):Y===8?3:Y===9?H(D==="X10"):Y===12?H(z.cursorBlink):Y===25?H(!$.isCursorHidden):Y===45?H(j.reverseWraparound):Y===66?H(j.applicationKeypad):Y===67?4:Y===1e3?H(D==="VT200"):Y===1002?H(D==="DRAG"):Y===1003?H(D==="ANY"):Y===1004?H(j.sendFocus):Y===1005?4:Y===1006?H(W==="SGR"):Y===1015?4:Y===1016?H(W==="SGR_PIXELS"):Y===1048?1:Y===47||Y===1047||Y===1049?H(I===L):Y===2004?H(j.bracketedPasteMode):0,$.triggerDataEvent(`${c.C0.ESC}[${N?"":"?"}${X};${ne}$y`),!0;var X,ne}_updateAttrColor(P,N,j,D,W){return N===2?(P|=50331648,P&=-16777216,P|=x.AttributeData.fromColorRGB([j,D,W])):N===5&&(P&=-50331904,P|=33554432|255&j),P}_extractColor(P,N,j){const D=[0,0,-1,0,0,0];let W=0,$=0;do{if(D[$+W]=P.params[N+$],P.hasSubParams(N+$)){const V=P.getSubParams(N+$);let q=0;do D[1]===5&&(W=1),D[$+q+1+W]=V[q];while(++q<V.length&&q+$+1+W<D.length);break}if(D[1]===5&&$+W>=2||D[1]===2&&$+W>=5)break;D[1]&&(W=1)}while(++$+N<P.length&&$+W<D.length);for(let V=2;V<D.length;++V)D[V]===-1&&(D[V]=0);switch(D[0]){case 38:j.fg=this._updateAttrColor(j.fg,D[1],D[3],D[4],D[5]);break;case 48:j.bg=this._updateAttrColor(j.bg,D[1],D[3],D[4],D[5]);break;case 58:j.extended=j.extended.clone(),j.extended.underlineColor=this._updateAttrColor(j.extended.underlineColor,D[1],D[3],D[4],D[5])}return $}_processUnderline(P,N){N.extended=N.extended.clone(),(!~P||P>5)&&(P=1),N.extended.underlineStyle=P,N.fg|=268435456,P===0&&(N.fg&=-268435457),N.updateExtended()}_processSGR0(P){P.fg=p.DEFAULT_ATTR_DATA.fg,P.bg=p.DEFAULT_ATTR_DATA.bg,P.extended=P.extended.clone(),P.extended.underlineStyle=0,P.extended.underlineColor&=-67108864,P.updateExtended()}charAttributes(P){if(P.length===1&&P.params[0]===0)return this._processSGR0(this._curAttrData),!0;const N=P.length;let j;const D=this._curAttrData;for(let W=0;W<N;W++)j=P.params[W],j>=30&&j<=37?(D.fg&=-50331904,D.fg|=16777216|j-30):j>=40&&j<=47?(D.bg&=-50331904,D.bg|=16777216|j-40):j>=90&&j<=97?(D.fg&=-50331904,D.fg|=16777224|j-90):j>=100&&j<=107?(D.bg&=-50331904,D.bg|=16777224|j-100):j===0?this._processSGR0(D):j===1?D.fg|=134217728:j===3?D.bg|=67108864:j===4?(D.fg|=268435456,this._processUnderline(P.hasSubParams(W)?P.getSubParams(W)[0]:1,D)):j===5?D.fg|=536870912:j===7?D.fg|=67108864:j===8?D.fg|=1073741824:j===9?D.fg|=2147483648:j===2?D.bg|=134217728:j===21?this._processUnderline(2,D):j===22?(D.fg&=-134217729,D.bg&=-134217729):j===23?D.bg&=-67108865:j===24?(D.fg&=-268435457,this._processUnderline(0,D)):j===25?D.fg&=-536870913:j===27?D.fg&=-67108865:j===28?D.fg&=-1073741825:j===29?D.fg&=2147483647:j===39?(D.fg&=-67108864,D.fg|=16777215&p.DEFAULT_ATTR_DATA.fg):j===49?(D.bg&=-67108864,D.bg|=16777215&p.DEFAULT_ATTR_DATA.bg):j===38||j===48||j===58?W+=this._extractColor(P,W,D):j===53?D.bg|=1073741824:j===55?D.bg&=-1073741825:j===59?(D.extended=D.extended.clone(),D.extended.underlineColor=-1,D.updateExtended()):j===100?(D.fg&=-67108864,D.fg|=16777215&p.DEFAULT_ATTR_DATA.fg,D.bg&=-67108864,D.bg|=16777215&p.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",j);return!0}deviceStatus(P){switch(P.params[0]){case 5:this._coreService.triggerDataEvent(`${c.C0.ESC}[0n`);break;case 6:const N=this._activeBuffer.y+1,j=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${c.C0.ESC}[${N};${j}R`)}return!0}deviceStatusPrivate(P){if(P.params[0]===6){const N=this._activeBuffer.y+1,j=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${c.C0.ESC}[?${N};${j}R`)}return!0}softReset(P){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(P){const N=P.params[0]||1;switch(N){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 j=N%2==1;return this._optionsService.options.cursorBlink=j,!0}setScrollRegion(P){const N=P.params[0]||1;let j;return(P.length<2||(j=P.params[1])>this._bufferService.rows||j===0)&&(j=this._bufferService.rows),j>N&&(this._activeBuffer.scrollTop=N-1,this._activeBuffer.scrollBottom=j-1,this._setCursor(0,0)),!0}windowOptions(P){if(!O(P.params[0],this._optionsService.rawOptions.windowOptions))return!0;const N=P.length>1?P.params[1]:0;switch(P.params[0]){case 14:N!==2&&this._onRequestWindowsOptionsReport.fire(A.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(A.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${c.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:N!==0&&N!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),N!==0&&N!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:N!==0&&N!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),N!==0&&N!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(P){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(P){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(P){return this._windowTitle=P,this._onTitleChange.fire(P),!0}setIconName(P){return this._iconName=P,!0}setOrReportIndexedColor(P){const N=[],j=P.split(";");for(;j.length>1;){const D=j.shift(),W=j.shift();if(/^\d+$/.exec(D)){const $=parseInt(D);if(K($))if(W==="?")N.push({type:0,index:$});else{const V=(0,R.parseColor)(W);V&&N.push({type:1,index:$,color:V})}}}return N.length&&this._onColor.fire(N),!0}setHyperlink(P){const N=P.split(";");return!(N.length<2)&&(N[1]?this._createHyperlink(N[0],N[1]):!N[0]&&this._finishHyperlink())}_createHyperlink(P,N){this._getCurrentLinkId()&&this._finishHyperlink();const j=P.split(":");let D;const W=j.findIndex($=>$.startsWith("id="));return W!==-1&&(D=j[W].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:D,uri:N}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(P,N){const j=P.split(";");for(let D=0;D<j.length&&!(N>=this._specialColors.length);++D,++N)if(j[D]==="?")this._onColor.fire([{type:0,index:this._specialColors[N]}]);else{const W=(0,R.parseColor)(j[D]);W&&this._onColor.fire([{type:1,index:this._specialColors[N],color:W}])}return!0}setOrReportFgColor(P){return this._setOrReportSpecialColor(P,0)}setOrReportBgColor(P){return this._setOrReportSpecialColor(P,1)}setOrReportCursorColor(P){return this._setOrReportSpecialColor(P,2)}restoreIndexedColor(P){if(!P)return this._onColor.fire([{type:2}]),!0;const N=[],j=P.split(";");for(let D=0;D<j.length;++D)if(/^\d+$/.exec(j[D])){const W=parseInt(j[D]);K(W)&&N.push({type:2,index:W})}return N.length&&this._onColor.fire(N),!0}restoreFgColor(P){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(P){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(P){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,g.DEFAULT_CHARSET),!0}selectCharset(P){return P.length!==2?(this.selectDefaultCharset(),!0):(P[0]==="/"||this._charsetService.setgCharset(T[P[0]],g.CHARSETS[P[1]]||g.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 P=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,P,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(P){return this._charsetService.setgLevel(P),!0}screenAlignmentPattern(){const P=new f.CellData;P.content=4194373,P.fg=this._curAttrData.fg,P.bg=this._curAttrData.bg,this._setCursor(0,0);for(let N=0;N<this._bufferService.rows;++N){const j=this._activeBuffer.ybase+this._activeBuffer.y+N,D=this._activeBuffer.lines.get(j);D&&(D.fill(P),D.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(P,N){const j=this._bufferService.buffer,D=this._optionsService.rawOptions;return(W=>(this._coreService.triggerDataEvent(`${c.C0.ESC}${W}${c.C0.ESC}\\`),!0))(P==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:P==='"p'?'P1$r61;1"p':P==="r"?`P1$r${j.scrollTop+1};${j.scrollBottom+1}r`:P==="m"?"P1$r0m":P===" q"?`P1$r${{block:2,underline:4,bar:6}[D.cursorStyle]-(D.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(P,N){this._dirtyRowTracker.markRangeDirty(P,N)}}i.InputHandler=U;let G=class{constructor(B){this._bufferService=B,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(B){B<this.start?this.start=B:B>this.end&&(this.end=B)}markRangeDirty(B,P){B>P&&(F=B,B=P,P=F),B<this.start&&(this.start=B),P>this.end&&(this.end=P)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(B){return 0<=B&&B<256}G=d([m(0,E.IBufferService)],G)},844:(u,i)=>{function a(d){for(const m of d)m.dispose();d.length=0}Object.defineProperty(i,"__esModule",{value:!0}),i.getDisposeArrayDisposable=i.disposeArray=i.toDisposable=i.MutableDisposable=i.Disposable=void 0,i.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const m=this._disposables.indexOf(d);m!==-1&&this._disposables.splice(m,1)}},i.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var m;this._isDisposed||d===this._value||((m=this._value)==null||m.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},i.toDisposable=function(d){return{dispose:d}},i.disposeArray=a,i.getDisposeArrayDisposable=function(d){return{dispose:()=>a(d)}}},1505:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.FourKeyMap=i.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(m,c,g){this._data[m]||(this._data[m]={}),this._data[m][c]=g}get(m,c){return this._data[m]?this._data[m][c]:void 0}clear(){this._data={}}}i.TwoKeyMap=a,i.FourKeyMap=class{constructor(){this._data=new a}set(d,m,c,g,y){this._data.get(d,m)||this._data.set(d,m,new a),this._data.get(d,m).set(c,g,y)}get(d,m,c,g){var y;return(y=this._data.get(d,m))==null?void 0:y.get(c,g)}clear(){this._data.clear()}}},6114:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.isChromeOS=i.isLinux=i.isWindows=i.isIphone=i.isIpad=i.isMac=i.getSafariVersion=i.isSafari=i.isLegacyEdge=i.isFirefox=i.isNode=void 0,i.isNode=typeof process<"u"&&"title"in process;const a=i.isNode?"node":navigator.userAgent,d=i.isNode?"node":navigator.platform;i.isFirefox=a.includes("Firefox"),i.isLegacyEdge=a.includes("Edge"),i.isSafari=/^((?!chrome|android).)*safari/i.test(a),i.getSafariVersion=function(){if(!i.isSafari)return 0;const m=a.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},i.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),i.isIpad=d==="iPad",i.isIphone=d==="iPhone",i.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),i.isLinux=d.indexOf("Linux")>=0,i.isChromeOS=/\bCrOS\b/.test(a)},6106:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.SortedList=void 0;let a=0;i.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(a=this._search(this._getKey(d)),this._array.splice(a,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const m=this._getKey(d);if(m===void 0||(a=this._search(m),a===-1)||this._getKey(this._array[a])!==m)return!1;do if(this._array[a]===d)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===m);return!1}*getKeyIterator(d){if(this._array.length!==0&&(a=this._search(d),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===d))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===d)}forEachByKey(d,m){if(this._array.length!==0&&(a=this._search(d),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===d))do m(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===d)}values(){return[...this._array].values()}_search(d){let m=0,c=this._array.length-1;for(;c>=m;){let g=m+c>>1;const y=this._getKey(this._array[g]);if(y>d)c=g-1;else{if(!(y<d)){for(;g>0&&this._getKey(this._array[g-1])===d;)g--;return g}m=g+1}}return m}}},7226:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DebouncedIdleTask=i.IdleTaskQueue=i.PriorityTaskQueue=void 0;const d=a(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(y){this._tasks.push(y),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(y){this._idleCallback=void 0;let C=0,_=0,p=y.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),_=Math.max(C,_),h=y.timeRemaining(),1.5*_>h)return p-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(p-C))}ms`),void this._start();p=h}this.clear()}}class c extends m{_requestCallback(y){return setTimeout(()=>y(this._createDeadline(16)))}_cancelCallback(y){clearTimeout(y)}_createDeadline(y){const C=Date.now()+y;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}i.PriorityTaskQueue=c,i.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:c,i.DebouncedIdleTask=class{constructor(){this._queue=new i.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.updateWindowsModeWrappedState=void 0;const d=a(643);i.updateWindowsModeWrappedState=function(m){const c=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),g=c==null?void 0:c.get(m.cols-1),y=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);y&&g&&(y.isWrapped=g[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&g[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ExtendedAttrs=i.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(c){return[c>>>16&255,c>>>8&255,255&c]}static fromColorRGB(c){return(255&c[0])<<16|(255&c[1])<<8|255&c[2]}clone(){const c=new a;return c.fg=this.fg,c.bg=this.bg,c.extended=this.extended.clone(),c}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}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}i.AttributeData=a;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(c){this._ext=c}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(c){this._ext&=-469762049,this._ext|=c<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(c){this._ext&=-67108864,this._ext|=67108863&c}get urlId(){return this._urlId}set urlId(c){this._urlId=c}get underlineVariantOffset(){const c=(3758096384&this._ext)>>29;return c<0?4294967288^c:c}set underlineVariantOffset(c){this._ext&=536870911,this._ext|=c<<29&3758096384}constructor(c=0,g=0){this._ext=0,this._urlId=0,this._ext=c,this._urlId=g}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}i.ExtendedAttrs=d},9092:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Buffer=i.MAX_BUFFER_SIZE=void 0;const d=a(6349),m=a(7226),c=a(3734),g=a(8437),y=a(4634),C=a(511),_=a(643),p=a(4863),h=a(7116);i.MAX_BUFFER_SIZE=4294967295,i.Buffer=class{constructor(l,f,x){this._hasScrollback=l,this._optionsService=f,this._bufferService=x,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,_.NULL_CELL_CHAR,_.NULL_CELL_WIDTH,_.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,_.WHITESPACE_CELL_CHAR,_.WHITESPACE_CELL_WIDTH,_.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(l){return l?(this._nullCell.fg=l.fg,this._nullCell.bg=l.bg,this._nullCell.extended=l.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new c.ExtendedAttrs),this._nullCell}getWhitespaceCell(l){return l?(this._whitespaceCell.fg=l.fg,this._whitespaceCell.bg=l.bg,this._whitespaceCell.extended=l.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new c.ExtendedAttrs),this._whitespaceCell}getBlankLine(l,f){return new g.BufferLine(this._bufferService.cols,this.getNullCell(l),f)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const l=this.ybase+this.y-this.ydisp;return l>=0&&l<this._rows}_getCorrectBufferLength(l){if(!this._hasScrollback)return l;const f=l+this._optionsService.rawOptions.scrollback;return f>i.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:f}fillViewportRows(l){if(this.lines.length===0){l===void 0&&(l=g.DEFAULT_ATTR_DATA);let f=this._rows;for(;f--;)this.lines.push(this.getBlankLine(l))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(l,f){const x=this.getNullCell(g.DEFAULT_ATTR_DATA);let E=0;const k=this._getCorrectBufferLength(f);if(k>this.lines.maxLength&&(this.lines.maxLength=k),this.lines.length>0){if(this._cols<l)for(let w=0;w<this.lines.length;w++)E+=+this.lines.get(w).resize(l,x);let b=0;if(this._rows<f)for(let w=this._rows;w<f;w++)this.lines.length<f+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new g.BufferLine(l,x)):this.ybase>0&&this.lines.length<=this.ybase+this.y+b+1?(this.ybase--,b++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(l,x)));else for(let w=this._rows;w>f;w--)this.lines.length>f+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(k<this.lines.maxLength){const w=this.lines.length-k;w>0&&(this.lines.trimStart(w),this.ybase=Math.max(this.ybase-w,0),this.ydisp=Math.max(this.ydisp-w,0),this.savedY=Math.max(this.savedY-w,0)),this.lines.maxLength=k}this.x=Math.min(this.x,l-1),this.y=Math.min(this.y,f-1),b&&(this.y+=b),this.savedX=Math.min(this.savedX,l-1),this.scrollTop=0}if(this.scrollBottom=f-1,this._isReflowEnabled&&(this._reflow(l,f),this._cols>l))for(let b=0;b<this.lines.length;b++)E+=+this.lines.get(b).resize(l,x);this._cols=l,this._rows=f,this._memoryCleanupQueue.clear(),E>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let l=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,l=!1);let f=0;for(;this._memoryCleanupPosition<this.lines.length;)if(f+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),f>100)return!0;return l}get _isReflowEnabled(){const l=this._optionsService.rawOptions.windowsPty;return l&&l.buildNumber?this._hasScrollback&&l.backend==="conpty"&&l.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(l,f){this._cols!==l&&(l>this._cols?this._reflowLarger(l,f):this._reflowSmaller(l,f))}_reflowLarger(l,f){const x=(0,y.reflowLargerGetLinesToRemove)(this.lines,this._cols,l,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(x.length>0){const E=(0,y.reflowLargerCreateNewLayout)(this.lines,x);(0,y.reflowLargerApplyNewLayout)(this.lines,E.layout),this._reflowLargerAdjustViewport(l,f,E.countRemoved)}}_reflowLargerAdjustViewport(l,f,x){const E=this.getNullCell(g.DEFAULT_ATTR_DATA);let k=x;for(;k-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<f&&this.lines.push(new g.BufferLine(l,E))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-x,0)}_reflowSmaller(l,f){const x=this.getNullCell(g.DEFAULT_ATTR_DATA),E=[];let k=0;for(let b=this.lines.length-1;b>=0;b--){let w=this.lines.get(b);if(!w||!w.isWrapped&&w.getTrimmedLength()<=l)continue;const R=[w];for(;w.isWrapped&&b>0;)w=this.lines.get(--b),R.unshift(w);const T=this.ybase+this.y;if(T>=b&&T<b+R.length)continue;const M=R[R.length-1].getTrimmedLength(),O=(0,y.reflowSmallerGetNewLineLengths)(R,this._cols,l),A=O.length-R.length;let F;F=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+A):Math.max(0,this.lines.length-this.lines.maxLength+A);const U=[];for(let j=0;j<A;j++){const D=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);U.push(D)}U.length>0&&(E.push({start:b+R.length+k,newLines:U}),k+=U.length),R.push(...U);let G=O.length-1,K=O[G];K===0&&(G--,K=O[G]);let B=R.length-A-1,P=M;for(;B>=0;){const j=Math.min(P,K);if(R[G]===void 0)break;if(R[G].copyCellsFrom(R[B],P-j,K-j,j,!0),K-=j,K===0&&(G--,K=O[G]),P-=j,P===0){B--;const D=Math.max(B,0);P=(0,y.getWrappedLineTrimmedLength)(R,D,this._cols)}}for(let j=0;j<R.length;j++)O[j]<l&&R[j].setCell(O[j],x);let N=A-F;for(;N-- >0;)this.ybase===0?this.y<f-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+k)-f&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+A,this.ybase+f-1)}if(E.length>0){const b=[],w=[];for(let G=0;G<this.lines.length;G++)w.push(this.lines.get(G));const R=this.lines.length;let T=R-1,M=0,O=E[M];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+k);let A=0;for(let G=Math.min(this.lines.maxLength-1,R+k-1);G>=0;G--)if(O&&O.start>T+A){for(let K=O.newLines.length-1;K>=0;K--)this.lines.set(G--,O.newLines[K]);G++,b.push({index:T+1,amount:O.newLines.length}),A+=O.newLines.length,O=E[++M]}else this.lines.set(G,w[T--]);let F=0;for(let G=b.length-1;G>=0;G--)b[G].index+=F,this.lines.onInsertEmitter.fire(b[G]),F+=b[G].amount;const U=Math.max(0,R+k-this.lines.maxLength);U>0&&this.lines.onTrimEmitter.fire(U)}}translateBufferLineToString(l,f,x=0,E){const k=this.lines.get(l);return k?k.translateToString(f,x,E):""}getWrappedRangeForLine(l){let f=l,x=l;for(;f>0&&this.lines.get(f).isWrapped;)f--;for(;x+1<this.lines.length&&this.lines.get(x+1).isWrapped;)x++;return{first:f,last:x}}setupTabStops(l){for(l!=null?this.tabs[l]||(l=this.prevStop(l)):(this.tabs={},l=0);l<this._cols;l+=this._optionsService.rawOptions.tabStopWidth)this.tabs[l]=!0}prevStop(l){for(l==null&&(l=this.x);!this.tabs[--l]&&l>0;);return l>=this._cols?this._cols-1:l<0?0:l}nextStop(l){for(l==null&&(l=this.x);!this.tabs[++l]&&l<this._cols;);return l>=this._cols?this._cols-1:l<0?0:l}clearMarkers(l){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].line===l&&(this.markers[f].dispose(),this.markers.splice(f--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].dispose(),this.markers.splice(l--,1);this._isClearing=!1}addMarker(l){const f=new p.Marker(l);return this.markers.push(f),f.register(this.lines.onTrim(x=>{f.line-=x,f.line<0&&f.dispose()})),f.register(this.lines.onInsert(x=>{f.line>=x.index&&(f.line+=x.amount)})),f.register(this.lines.onDelete(x=>{f.line>=x.index&&f.line<x.index+x.amount&&f.dispose(),f.line>x.index&&(f.line-=x.amount)})),f.register(f.onDispose(()=>this._removeMarker(f))),f}_removeMarker(l){this._isClearing||this.markers.splice(this.markers.indexOf(l),1)}}},8437:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLine=i.DEFAULT_ATTR_DATA=void 0;const d=a(3734),m=a(511),c=a(643),g=a(482);i.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let y=0;class C{constructor(p,h,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*p);const f=h||m.CellData.fromCharData([0,c.NULL_CELL_CHAR,c.NULL_CELL_WIDTH,c.NULL_CELL_CODE]);for(let x=0;x<p;++x)this.setCell(x,f);this.length=p}get(p){const h=this._data[3*p+0],l=2097151&h;return[this._data[3*p+1],2097152&h?this._combined[p]:l?(0,g.stringFromCodePoint)(l):"",h>>22,2097152&h?this._combined[p].charCodeAt(this._combined[p].length-1):l]}set(p,h){this._data[3*p+1]=h[c.CHAR_DATA_ATTR_INDEX],h[c.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[p]=h[1],this._data[3*p+0]=2097152|p|h[c.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*p+0]=h[c.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|h[c.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 h=this._data[3*p+0];return 2097152&h?this._combined[p].charCodeAt(this._combined[p].length-1):2097151&h}isCombined(p){return 2097152&this._data[3*p+0]}getString(p){const h=this._data[3*p+0];return 2097152&h?this._combined[p]:2097151&h?(0,g.stringFromCodePoint)(2097151&h):""}isProtected(p){return 536870912&this._data[3*p+2]}loadCell(p,h){return y=3*p,h.content=this._data[y+0],h.fg=this._data[y+1],h.bg=this._data[y+2],2097152&h.content&&(h.combinedData=this._combined[p]),268435456&h.bg&&(h.extended=this._extendedAttrs[p]),h}setCell(p,h){2097152&h.content&&(this._combined[p]=h.combinedData),268435456&h.bg&&(this._extendedAttrs[p]=h.extended),this._data[3*p+0]=h.content,this._data[3*p+1]=h.fg,this._data[3*p+2]=h.bg}setCellFromCodepoint(p,h,l,f){268435456&f.bg&&(this._extendedAttrs[p]=f.extended),this._data[3*p+0]=h|l<<22,this._data[3*p+1]=f.fg,this._data[3*p+2]=f.bg}addCodepointToCell(p,h,l){let f=this._data[3*p+0];2097152&f?this._combined[p]+=(0,g.stringFromCodePoint)(h):2097151&f?(this._combined[p]=(0,g.stringFromCodePoint)(2097151&f)+(0,g.stringFromCodePoint)(h),f&=-2097152,f|=2097152):f=h|4194304,l&&(f&=-12582913,f|=l<<22),this._data[3*p+0]=f}insertCells(p,h,l){if((p%=this.length)&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,l),h<this.length-p){const f=new m.CellData;for(let x=this.length-p-h-1;x>=0;--x)this.setCell(p+h+x,this.loadCell(p+x,f));for(let x=0;x<h;++x)this.setCell(p+x,l)}else for(let f=p;f<this.length;++f)this.setCell(f,l);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,l)}deleteCells(p,h,l){if(p%=this.length,h<this.length-p){const f=new m.CellData;for(let x=0;x<this.length-p-h;++x)this.setCell(p+x,this.loadCell(p+h+x,f));for(let x=this.length-h;x<this.length;++x)this.setCell(x,l)}else for(let f=p;f<this.length;++f)this.setCell(f,l);p&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,l),this.getWidth(p)!==0||this.hasContent(p)||this.setCellFromCodepoint(p,0,1,l)}replaceCells(p,h,l,f=!1){if(f)for(p&&this.getWidth(p-1)===2&&!this.isProtected(p-1)&&this.setCellFromCodepoint(p-1,0,1,l),h<this.length&&this.getWidth(h-1)===2&&!this.isProtected(h)&&this.setCellFromCodepoint(h,0,1,l);p<h&&p<this.length;)this.isProtected(p)||this.setCell(p,l),p++;else for(p&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p-1,0,1,l),h<this.length&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h,0,1,l);p<h&&p<this.length;)this.setCell(p++,l)}resize(p,h){if(p===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const l=3*p;if(p>this.length){if(this._data.buffer.byteLength>=4*l)this._data=new Uint32Array(this._data.buffer,0,l);else{const f=new Uint32Array(l);f.set(this._data),this._data=f}for(let f=this.length;f<p;++f)this.setCell(f,h)}else{this._data=this._data.subarray(0,l);const f=Object.keys(this._combined);for(let E=0;E<f.length;E++){const k=parseInt(f[E],10);k>=p&&delete this._combined[k]}const x=Object.keys(this._extendedAttrs);for(let E=0;E<x.length;E++){const k=parseInt(x[E],10);k>=p&&delete this._extendedAttrs[k]}}return this.length=p,4*l*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,h=!1){if(h)for(let l=0;l<this.length;++l)this.isProtected(l)||this.setCell(l,p);else{this._combined={},this._extendedAttrs={};for(let l=0;l<this.length;++l)this.setCell(l,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 h in p._combined)this._combined[h]=p._combined[h];this._extendedAttrs={};for(const h in p._extendedAttrs)this._extendedAttrs[h]=p._extendedAttrs[h];this.isWrapped=p.isWrapped}clone(){const p=new C(0);p._data=new Uint32Array(this._data),p.length=this.length;for(const h in this._combined)p._combined[h]=this._combined[h];for(const h in this._extendedAttrs)p._extendedAttrs[h]=this._extendedAttrs[h];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,h,l,f,x){const E=p._data;if(x)for(let b=f-1;b>=0;b--){for(let w=0;w<3;w++)this._data[3*(l+b)+w]=E[3*(h+b)+w];268435456&E[3*(h+b)+2]&&(this._extendedAttrs[l+b]=p._extendedAttrs[h+b])}else for(let b=0;b<f;b++){for(let w=0;w<3;w++)this._data[3*(l+b)+w]=E[3*(h+b)+w];268435456&E[3*(h+b)+2]&&(this._extendedAttrs[l+b]=p._extendedAttrs[h+b])}const k=Object.keys(p._combined);for(let b=0;b<k.length;b++){const w=parseInt(k[b],10);w>=h&&(this._combined[w-h+l]=p._combined[w])}}translateToString(p,h,l,f){h=h??0,l=l??this.length,p&&(l=Math.min(l,this.getTrimmedLength())),f&&(f.length=0);let x="";for(;h<l;){const E=this._data[3*h+0],k=2097151&E,b=2097152&E?this._combined[h]:k?(0,g.stringFromCodePoint)(k):c.WHITESPACE_CELL_CHAR;if(x+=b,f)for(let w=0;w<b.length;++w)f.push(h);h+=E>>22||1}return f&&f.push(h),x}}i.BufferLine=C},4841:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.getRangeLength=void 0,i.getRangeLength=function(a,d){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return d*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(u,i)=>{function a(d,m,c){if(m===d.length-1)return d[m].getTrimmedLength();const g=!d[m].hasContent(c-1)&&d[m].getWidth(c-1)===1,y=d[m+1].getWidth(0)===2;return g&&y?c-1:c}Object.defineProperty(i,"__esModule",{value:!0}),i.getWrappedLineTrimmedLength=i.reflowSmallerGetNewLineLengths=i.reflowLargerApplyNewLayout=i.reflowLargerCreateNewLayout=i.reflowLargerGetLinesToRemove=void 0,i.reflowLargerGetLinesToRemove=function(d,m,c,g,y){const C=[];for(let _=0;_<d.length-1;_++){let p=_,h=d.get(++p);if(!h.isWrapped)continue;const l=[d.get(_)];for(;p<d.length&&h.isWrapped;)l.push(h),h=d.get(++p);if(g>=_&&g<p){_+=l.length-1;continue}let f=0,x=a(l,f,m),E=1,k=0;for(;E<l.length;){const w=a(l,E,m),R=w-k,T=c-x,M=Math.min(R,T);l[f].copyCellsFrom(l[E],k,x,M,!1),x+=M,x===c&&(f++,x=0),k+=M,k===w&&(E++,k=0),x===0&&f!==0&&l[f-1].getWidth(c-1)===2&&(l[f].copyCellsFrom(l[f-1],c-1,x++,1,!1),l[f-1].setCell(c-1,y))}l[f].replaceCells(x,c,y);let b=0;for(let w=l.length-1;w>0&&(w>f||l[w].getTrimmedLength()===0);w--)b++;b>0&&(C.push(_+l.length-b),C.push(b)),_+=l.length-1}return C},i.reflowLargerCreateNewLayout=function(d,m){const c=[];let g=0,y=m[g],C=0;for(let _=0;_<d.length;_++)if(y===_){const p=m[++g];d.onDeleteEmitter.fire({index:_-C,amount:p}),_+=p-1,C+=p,y=m[++g]}else c.push(_);return{layout:c,countRemoved:C}},i.reflowLargerApplyNewLayout=function(d,m){const c=[];for(let g=0;g<m.length;g++)c.push(d.get(m[g]));for(let g=0;g<c.length;g++)d.set(g,c[g]);d.length=m.length},i.reflowSmallerGetNewLineLengths=function(d,m,c){const g=[],y=d.map((h,l)=>a(d,l,m)).reduce((h,l)=>h+l);let C=0,_=0,p=0;for(;p<y;){if(y-p<c){g.push(y-p);break}C+=c;const h=a(d,_,m);C>h&&(C-=h,_++);const l=d[_].getWidth(C-1)===2;l&&C--;const f=l?c-1:c;g.push(f),p+=f}return g},i.getWrappedLineTrimmedLength=a},5295:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferSet=void 0;const d=a(8460),m=a(844),c=a(9092);class g extends m.Disposable{constructor(C,_){super(),this._optionsService=C,this._bufferService=_,this._onBufferActivate=this.register(new d.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 c.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new c.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,_){this._normal.resize(C,_),this._alt.resize(C,_),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}i.BufferSet=g},511:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CellData=void 0;const d=a(482),m=a(643),c=a(3734);class g extends c.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new c.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const _=new g;return _.setFromCharData(C),_}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let _=!1;if(C[m.CHAR_DATA_CHAR_INDEX].length>2)_=!0;else if(C[m.CHAR_DATA_CHAR_INDEX].length===2){const p=C[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=p&&p<=56319){const h=C[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(p-55296)+h-56320+65536|C[m.CHAR_DATA_WIDTH_INDEX]<<22:_=!0}else _=!0}else this.content=C[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[m.CHAR_DATA_WIDTH_INDEX]<<22;_&&(this.combinedData=C[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}i.CellData=g},643:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WHITESPACE_CELL_CODE=i.WHITESPACE_CELL_WIDTH=i.WHITESPACE_CELL_CHAR=i.NULL_CELL_CODE=i.NULL_CELL_WIDTH=i.NULL_CELL_CHAR=i.CHAR_DATA_CODE_INDEX=i.CHAR_DATA_WIDTH_INDEX=i.CHAR_DATA_CHAR_INDEX=i.CHAR_DATA_ATTR_INDEX=i.DEFAULT_EXT=i.DEFAULT_ATTR=i.DEFAULT_COLOR=void 0,i.DEFAULT_COLOR=0,i.DEFAULT_ATTR=256|i.DEFAULT_COLOR<<9,i.DEFAULT_EXT=0,i.CHAR_DATA_ATTR_INDEX=0,i.CHAR_DATA_CHAR_INDEX=1,i.CHAR_DATA_WIDTH_INDEX=2,i.CHAR_DATA_CODE_INDEX=3,i.NULL_CELL_CHAR="",i.NULL_CELL_WIDTH=1,i.NULL_CELL_CODE=0,i.WHITESPACE_CELL_CHAR=" ",i.WHITESPACE_CELL_WIDTH=1,i.WHITESPACE_CELL_CODE=32},4863:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Marker=void 0;const d=a(8460),m=a(844);class c{get id(){return this._id}constructor(y){this.line=y,this.isDisposed=!1,this._disposables=[],this._id=c._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(y){return this._disposables.push(y),y}}i.Marker=c,c._nextId=1},7116:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DEFAULT_CHARSET=i.CHARSETS=void 0,i.CHARSETS={},i.DEFAULT_CHARSET=i.CHARSETS.B,i.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:"≥","{":"π","|":"≠","}":"£","~":"·"},i.CHARSETS.A={"#":"£"},i.CHARSETS.B=void 0,i.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},i.CHARSETS.C=i.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},i.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},i.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},i.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},i.CHARSETS.E=i.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},i.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},i.CHARSETS.H=i.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},i.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(u,i)=>{var a,d,m;Object.defineProperty(i,"__esModule",{value:!0}),i.C1_ESCAPED=i.C1=i.C0=void 0,function(c){c.NUL="\0",c.SOH="",c.STX="",c.ETX="",c.EOT="",c.ENQ="",c.ACK="",c.BEL="\x07",c.BS="\b",c.HT=" ",c.LF=`
278
+ `,c.VT="\v",c.FF="\f",c.CR="\r",c.SO="",c.SI="",c.DLE="",c.DC1="",c.DC2="",c.DC3="",c.DC4="",c.NAK="",c.SYN="",c.ETB="",c.CAN="",c.EM="",c.SUB="",c.ESC="\x1B",c.FS="",c.GS="",c.RS="",c.US="",c.SP=" ",c.DEL=""}(a||(i.C0=a={})),function(c){c.PAD="€",c.HOP="",c.BPH="‚",c.NBH="ƒ",c.IND="„",c.NEL="…",c.SSA="†",c.ESA="‡",c.HTS="ˆ",c.HTJ="‰",c.VTS="Š",c.PLD="‹",c.PLU="Œ",c.RI="",c.SS2="Ž",c.SS3="",c.DCS="",c.PU1="‘",c.PU2="’",c.STS="“",c.CCH="”",c.MW="•",c.SPA="–",c.EPA="—",c.SOS="˜",c.SGCI="™",c.SCI="š",c.CSI="›",c.ST="œ",c.OSC="",c.PM="ž",c.APC="Ÿ"}(d||(i.C1=d={})),function(c){c.ST=`${a.ESC}\\`}(m||(i.C1_ESCAPED=m={}))},7399:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.evaluateKeyboardEvent=void 0;const d=a(2584),m={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:["'",'"']};i.evaluateKeyboardEvent=function(c,g,y,C){const _={type:0,cancel:!1,key:void 0},p=(c.shiftKey?1:0)|(c.altKey?2:0)|(c.ctrlKey?4:0)|(c.metaKey?8:0);switch(c.keyCode){case 0:c.key==="UIKeyInputUpArrow"?_.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A":c.key==="UIKeyInputLeftArrow"?_.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D":c.key==="UIKeyInputRightArrow"?_.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C":c.key==="UIKeyInputDownArrow"&&(_.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:_.key=c.ctrlKey?"\b":d.C0.DEL,c.altKey&&(_.key=d.C0.ESC+_.key);break;case 9:if(c.shiftKey){_.key=d.C0.ESC+"[Z";break}_.key=d.C0.HT,_.cancel=!0;break;case 13:_.key=c.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,_.cancel=!0;break;case 27:_.key=d.C0.ESC,c.altKey&&(_.key=d.C0.ESC+d.C0.ESC),_.cancel=!0;break;case 37:if(c.metaKey)break;p?(_.key=d.C0.ESC+"[1;"+(p+1)+"D",_.key===d.C0.ESC+"[1;3D"&&(_.key=d.C0.ESC+(y?"b":"[1;5D"))):_.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(c.metaKey)break;p?(_.key=d.C0.ESC+"[1;"+(p+1)+"C",_.key===d.C0.ESC+"[1;3C"&&(_.key=d.C0.ESC+(y?"f":"[1;5C"))):_.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(c.metaKey)break;p?(_.key=d.C0.ESC+"[1;"+(p+1)+"A",y||_.key!==d.C0.ESC+"[1;3A"||(_.key=d.C0.ESC+"[1;5A")):_.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(c.metaKey)break;p?(_.key=d.C0.ESC+"[1;"+(p+1)+"B",y||_.key!==d.C0.ESC+"[1;3B"||(_.key=d.C0.ESC+"[1;5B")):_.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:c.shiftKey||c.ctrlKey||(_.key=d.C0.ESC+"[2~");break;case 46:_.key=p?d.C0.ESC+"[3;"+(p+1)+"~":d.C0.ESC+"[3~";break;case 36:_.key=p?d.C0.ESC+"[1;"+(p+1)+"H":g?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:_.key=p?d.C0.ESC+"[1;"+(p+1)+"F":g?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:c.shiftKey?_.type=2:c.ctrlKey?_.key=d.C0.ESC+"[5;"+(p+1)+"~":_.key=d.C0.ESC+"[5~";break;case 34:c.shiftKey?_.type=3:c.ctrlKey?_.key=d.C0.ESC+"[6;"+(p+1)+"~":_.key=d.C0.ESC+"[6~";break;case 112:_.key=p?d.C0.ESC+"[1;"+(p+1)+"P":d.C0.ESC+"OP";break;case 113:_.key=p?d.C0.ESC+"[1;"+(p+1)+"Q":d.C0.ESC+"OQ";break;case 114:_.key=p?d.C0.ESC+"[1;"+(p+1)+"R":d.C0.ESC+"OR";break;case 115:_.key=p?d.C0.ESC+"[1;"+(p+1)+"S":d.C0.ESC+"OS";break;case 116:_.key=p?d.C0.ESC+"[15;"+(p+1)+"~":d.C0.ESC+"[15~";break;case 117:_.key=p?d.C0.ESC+"[17;"+(p+1)+"~":d.C0.ESC+"[17~";break;case 118:_.key=p?d.C0.ESC+"[18;"+(p+1)+"~":d.C0.ESC+"[18~";break;case 119:_.key=p?d.C0.ESC+"[19;"+(p+1)+"~":d.C0.ESC+"[19~";break;case 120:_.key=p?d.C0.ESC+"[20;"+(p+1)+"~":d.C0.ESC+"[20~";break;case 121:_.key=p?d.C0.ESC+"[21;"+(p+1)+"~":d.C0.ESC+"[21~";break;case 122:_.key=p?d.C0.ESC+"[23;"+(p+1)+"~":d.C0.ESC+"[23~";break;case 123:_.key=p?d.C0.ESC+"[24;"+(p+1)+"~":d.C0.ESC+"[24~";break;default:if(!c.ctrlKey||c.shiftKey||c.altKey||c.metaKey)if(y&&!C||!c.altKey||c.metaKey)!y||c.altKey||c.ctrlKey||c.shiftKey||!c.metaKey?c.key&&!c.ctrlKey&&!c.altKey&&!c.metaKey&&c.keyCode>=48&&c.key.length===1?_.key=c.key:c.key&&c.ctrlKey&&(c.key==="_"&&(_.key=d.C0.US),c.key==="@"&&(_.key=d.C0.NUL)):c.keyCode===65&&(_.type=1);else{const h=m[c.keyCode],l=h==null?void 0:h[c.shiftKey?1:0];if(l)_.key=d.C0.ESC+l;else if(c.keyCode>=65&&c.keyCode<=90){const f=c.ctrlKey?c.keyCode-64:c.keyCode+32;let x=String.fromCharCode(f);c.shiftKey&&(x=x.toUpperCase()),_.key=d.C0.ESC+x}else if(c.keyCode===32)_.key=d.C0.ESC+(c.ctrlKey?d.C0.NUL:" ");else if(c.key==="Dead"&&c.code.startsWith("Key")){let f=c.code.slice(3,4);c.shiftKey||(f=f.toLowerCase()),_.key=d.C0.ESC+f,_.cancel=!0}}else c.keyCode>=65&&c.keyCode<=90?_.key=String.fromCharCode(c.keyCode-64):c.keyCode===32?_.key=d.C0.NUL:c.keyCode>=51&&c.keyCode<=55?_.key=String.fromCharCode(c.keyCode-51+27):c.keyCode===56?_.key=d.C0.DEL:c.keyCode===219?_.key=d.C0.ESC:c.keyCode===220?_.key=d.C0.FS:c.keyCode===221&&(_.key=d.C0.GS)}return _}},482:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Utf8ToUtf32=i.StringToUtf32=i.utf32ToString=i.stringFromCodePoint=void 0,i.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},i.utf32ToString=function(a,d=0,m=a.length){let c="";for(let g=d;g<m;++g){let y=a[g];y>65535?(y-=65536,c+=String.fromCharCode(55296+(y>>10))+String.fromCharCode(y%1024+56320)):c+=String.fromCharCode(y)}return c},i.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,d){const m=a.length;if(!m)return 0;let c=0,g=0;if(this._interim){const y=a.charCodeAt(g++);56320<=y&&y<=57343?d[c++]=1024*(this._interim-55296)+y-56320+65536:(d[c++]=this._interim,d[c++]=y),this._interim=0}for(let y=g;y<m;++y){const C=a.charCodeAt(y);if(55296<=C&&C<=56319){if(++y>=m)return this._interim=C,c;const _=a.charCodeAt(y);56320<=_&&_<=57343?d[c++]=1024*(C-55296)+_-56320+65536:(d[c++]=C,d[c++]=_)}else C!==65279&&(d[c++]=C)}return c}},i.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,d){const m=a.length;if(!m)return 0;let c,g,y,C,_=0,p=0,h=0;if(this.interim[0]){let x=!1,E=this.interim[0];E&=(224&E)==192?31:(240&E)==224?15:7;let k,b=0;for(;(k=63&this.interim[++b])&&b<4;)E<<=6,E|=k;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=w-b;for(;h<R;){if(h>=m)return 0;if(k=a[h++],(192&k)!=128){h--,x=!0;break}this.interim[b++]=k,E<<=6,E|=63&k}x||(w===2?E<128?h--:d[_++]=E:w===3?E<2048||E>=55296&&E<=57343||E===65279||(d[_++]=E):E<65536||E>1114111||(d[_++]=E)),this.interim.fill(0)}const l=m-4;let f=h;for(;f<m;){for(;!(!(f<l)||128&(c=a[f])||128&(g=a[f+1])||128&(y=a[f+2])||128&(C=a[f+3]));)d[_++]=c,d[_++]=g,d[_++]=y,d[_++]=C,f+=4;if(c=a[f++],c<128)d[_++]=c;else if((224&c)==192){if(f>=m)return this.interim[0]=c,_;if(g=a[f++],(192&g)!=128){f--;continue}if(p=(31&c)<<6|63&g,p<128){f--;continue}d[_++]=p}else if((240&c)==224){if(f>=m)return this.interim[0]=c,_;if(g=a[f++],(192&g)!=128){f--;continue}if(f>=m)return this.interim[0]=c,this.interim[1]=g,_;if(y=a[f++],(192&y)!=128){f--;continue}if(p=(15&c)<<12|(63&g)<<6|63&y,p<2048||p>=55296&&p<=57343||p===65279)continue;d[_++]=p}else if((248&c)==240){if(f>=m)return this.interim[0]=c,_;if(g=a[f++],(192&g)!=128){f--;continue}if(f>=m)return this.interim[0]=c,this.interim[1]=g,_;if(y=a[f++],(192&y)!=128){f--;continue}if(f>=m)return this.interim[0]=c,this.interim[1]=g,this.interim[2]=y,_;if(C=a[f++],(192&C)!=128){f--;continue}if(p=(7&c)<<18|(63&g)<<12|(63&y)<<6|63&C,p<65536||p>1114111)continue;d[_++]=p}}return _}}},225:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeV6=void 0;const d=a(1480),m=[[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]],c=[[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 g;i.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let y=0;y<m.length;++y)g.fill(0,m[y][0],m[y][1]+1)}}wcwidth(y){return y<32?0:y<127?1:y<65536?g[y]:function(C,_){let p,h=0,l=_.length-1;if(C<_[0][0]||C>_[l][1])return!1;for(;l>=h;)if(p=h+l>>1,C>_[p][1])h=p+1;else{if(!(C<_[p][0]))return!0;l=p-1}return!1}(y,c)?0:y>=131072&&y<=196605||y>=196608&&y<=262141?2:1}charProperties(y,C){let _=this.wcwidth(y),p=_===0&&C!==0;if(p){const h=d.UnicodeService.extractWidth(C);h===0?p=!1:h>_&&(_=h)}return d.UnicodeService.createPropertyValue(0,_,p)}}},5981:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.WriteBuffer=void 0;const d=a(8460),m=a(844);class c extends m.Disposable{constructor(y){super(),this._action=y,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(y,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let _;for(this._isSyncWriting=!0;_=this._writeBuffer.shift();){this._action(_);const p=this._callbacks.shift();p&&p()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(y,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+=y.length,this._writeBuffer.push(y),this._callbacks.push(C),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(C)}_innerWrite(y=0,C=!0){const _=y||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const p=this._writeBuffer[this._bufferOffset],h=this._action(p,C);if(h){const f=x=>Date.now()-_>=12?setTimeout(()=>this._innerWrite(0,x)):this._innerWrite(_,x);return void h.catch(x=>(queueMicrotask(()=>{throw x}),Promise.resolve(!1))).then(f)}const l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=p.length,Date.now()-_>=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()}}i.WriteBuffer=c},5941:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.toRgbString=i.parseColor=void 0;const a=/^([\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})$/,d=/^[\da-f]+$/;function m(c,g){const y=c.toString(16),C=y.length<2?"0"+y:y;switch(g){case 4:return y[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}i.parseColor=function(c){if(!c)return;let g=c.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const y=a.exec(g);if(y){const C=y[1]?15:y[4]?255:y[7]?4095:65535;return[Math.round(parseInt(y[1]||y[4]||y[7]||y[10],16)/C*255),Math.round(parseInt(y[2]||y[5]||y[8]||y[11],16)/C*255),Math.round(parseInt(y[3]||y[6]||y[9]||y[12],16)/C*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),d.exec(g)&&[3,6,9,12].includes(g.length))){const y=g.length/3,C=[0,0,0];for(let _=0;_<3;++_){const p=parseInt(g.slice(y*_,y*_+y),16);C[_]=y===1?p<<4:y===2?p:y===3?p>>4:p>>8}return C}},i.toRgbString=function(c,g=16){const[y,C,_]=c;return`rgb:${m(y,g)}/${m(C,g)}/${m(_,g)}`}},5770:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.PAYLOAD_LIMIT=void 0,i.PAYLOAD_LIMIT=1e7},6351:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DcsHandler=i.DcsParser=void 0;const d=a(482),m=a(8742),c=a(5770),g=[];i.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(C,_){this._handlers[C]===void 0&&(this._handlers[C]=[]);const p=this._handlers[C];return p.push(_),{dispose:()=>{const h=p.indexOf(_);h!==-1&&p.splice(h,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=g,this._ident=0}hook(C,_){if(this.reset(),this._ident=C,this._active=this._handlers[C]||g,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].hook(_);else this._handlerFb(this._ident,"HOOK",_)}put(C,_,p){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(C,_,p);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(C,_,p))}unhook(C,_=!0){if(this._active.length){let p=!1,h=this._active.length-1,l=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,p=_,l=this._stack.fallThrough,this._stack.paused=!1),!l&&p===!1){for(;h>=0&&(p=this._active[h].unhook(C),p!==!0);h--)if(p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,p;h--}for(;h>=0;h--)if(p=this._active[h].unhook(!1),p instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,p}else this._handlerFb(this._ident,"UNHOOK",C);this._active=g,this._ident=0}};const y=new m.Params;y.addParam(0),i.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=y,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():y,this._data="",this._hitLimit=!1}put(C,_,p){this._hitLimit||(this._data+=(0,d.utf32ToString)(C,_,p),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let _=!1;if(this._hitLimit)_=!1;else if(C&&(_=this._handler(this._data,this._params),_ instanceof Promise))return _.then(p=>(this._params=y,this._data="",this._hitLimit=!1,p));return this._params=y,this._data="",this._hitLimit=!1,_}}},2015:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.EscapeSequenceParser=i.VT500_TRANSITION_TABLE=i.TransitionTable=void 0;const d=a(844),m=a(8742),c=a(6242),g=a(6351);class y{constructor(h){this.table=new Uint8Array(h)}setDefault(h,l){this.table.fill(h<<4|l)}add(h,l,f,x){this.table[l<<8|h]=f<<4|x}addMany(h,l,f,x){for(let E=0;E<h.length;E++)this.table[l<<8|h[E]]=f<<4|x}}i.TransitionTable=y;const C=160;i.VT500_TRANSITION_TABLE=function(){const p=new y(4095),h=Array.apply(null,Array(256)).map((b,w)=>w),l=(b,w)=>h.slice(b,w),f=l(32,127),x=l(0,24);x.push(25),x.push.apply(x,l(28,32));const E=l(0,14);let k;for(k in p.setDefault(1,0),p.addMany(f,0,2,0),E)p.addMany([24,26,153,154],k,3,0),p.addMany(l(128,144),k,3,0),p.addMany(l(144,152),k,3,0),p.add(156,k,0,0),p.add(27,k,11,1),p.add(157,k,4,8),p.addMany([152,158,159],k,0,7),p.add(155,k,11,3),p.add(144,k,11,9);return p.addMany(x,0,3,0),p.addMany(x,1,3,1),p.add(127,1,0,1),p.addMany(x,8,0,8),p.addMany(x,3,3,3),p.add(127,3,0,3),p.addMany(x,4,3,4),p.add(127,4,0,4),p.addMany(x,6,3,6),p.addMany(x,5,3,5),p.add(127,5,0,5),p.addMany(x,2,3,2),p.add(127,2,0,2),p.add(93,1,4,8),p.addMany(f,8,5,8),p.add(127,8,5,8),p.addMany([156,27,24,26,7],8,6,0),p.addMany(l(28,32),8,0,8),p.addMany([88,94,95],1,0,7),p.addMany(f,7,0,7),p.addMany(x,7,0,7),p.add(156,7,0,0),p.add(127,7,0,7),p.add(91,1,11,3),p.addMany(l(64,127),3,7,0),p.addMany(l(48,60),3,8,4),p.addMany([60,61,62,63],3,9,4),p.addMany(l(48,60),4,8,4),p.addMany(l(64,127),4,7,0),p.addMany([60,61,62,63],4,0,6),p.addMany(l(32,64),6,0,6),p.add(127,6,0,6),p.addMany(l(64,127),6,0,0),p.addMany(l(32,48),3,9,5),p.addMany(l(32,48),5,9,5),p.addMany(l(48,64),5,0,6),p.addMany(l(64,127),5,7,0),p.addMany(l(32,48),4,9,5),p.addMany(l(32,48),1,9,2),p.addMany(l(32,48),2,9,2),p.addMany(l(48,127),2,10,0),p.addMany(l(48,80),1,10,0),p.addMany(l(81,88),1,10,0),p.addMany([89,90,92],1,10,0),p.addMany(l(96,127),1,10,0),p.add(80,1,11,9),p.addMany(x,9,0,9),p.add(127,9,0,9),p.addMany(l(28,32),9,0,9),p.addMany(l(32,48),9,9,12),p.addMany(l(48,60),9,8,10),p.addMany([60,61,62,63],9,9,10),p.addMany(x,11,0,11),p.addMany(l(32,128),11,0,11),p.addMany(l(28,32),11,0,11),p.addMany(x,10,0,10),p.add(127,10,0,10),p.addMany(l(28,32),10,0,10),p.addMany(l(48,60),10,8,10),p.addMany([60,61,62,63],10,0,11),p.addMany(l(32,48),10,9,12),p.addMany(x,12,0,12),p.add(127,12,0,12),p.addMany(l(28,32),12,0,12),p.addMany(l(32,48),12,9,12),p.addMany(l(48,64),12,0,11),p.addMany(l(64,127),12,12,13),p.addMany(l(64,127),10,12,13),p.addMany(l(64,127),9,12,13),p.addMany(x,13,13,13),p.addMany(f,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 _ extends d.Disposable{constructor(h=i.VT500_TRANSITION_TABLE){super(),this._transitions=h,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(l,f,x)=>{},this._executeHandlerFb=l=>{},this._csiHandlerFb=(l,f)=>{},this._escHandlerFb=l=>{},this._errorHandlerFb=l=>l,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new c.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(h,l=[64,126]){let f=0;if(h.prefix){if(h.prefix.length>1)throw new Error("only one byte as prefix supported");if(f=h.prefix.charCodeAt(0),f&&60>f||f>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(h.intermediates){if(h.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let E=0;E<h.intermediates.length;++E){const k=h.intermediates.charCodeAt(E);if(32>k||k>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");f<<=8,f|=k}}if(h.final.length!==1)throw new Error("final must be a single byte");const x=h.final.charCodeAt(0);if(l[0]>x||x>l[1])throw new Error(`final must be in range ${l[0]} .. ${l[1]}`);return f<<=8,f|=x,f}identToString(h){const l=[];for(;h;)l.push(String.fromCharCode(255&h)),h>>=8;return l.reverse().join("")}setPrintHandler(h){this._printHandler=h}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(h,l){const f=this._identifier(h,[48,126]);this._escHandlers[f]===void 0&&(this._escHandlers[f]=[]);const x=this._escHandlers[f];return x.push(l),{dispose:()=>{const E=x.indexOf(l);E!==-1&&x.splice(E,1)}}}clearEscHandler(h){this._escHandlers[this._identifier(h,[48,126])]&&delete this._escHandlers[this._identifier(h,[48,126])]}setEscHandlerFallback(h){this._escHandlerFb=h}setExecuteHandler(h,l){this._executeHandlers[h.charCodeAt(0)]=l}clearExecuteHandler(h){this._executeHandlers[h.charCodeAt(0)]&&delete this._executeHandlers[h.charCodeAt(0)]}setExecuteHandlerFallback(h){this._executeHandlerFb=h}registerCsiHandler(h,l){const f=this._identifier(h);this._csiHandlers[f]===void 0&&(this._csiHandlers[f]=[]);const x=this._csiHandlers[f];return x.push(l),{dispose:()=>{const E=x.indexOf(l);E!==-1&&x.splice(E,1)}}}clearCsiHandler(h){this._csiHandlers[this._identifier(h)]&&delete this._csiHandlers[this._identifier(h)]}setCsiHandlerFallback(h){this._csiHandlerFb=h}registerDcsHandler(h,l){return this._dcsParser.registerHandler(this._identifier(h),l)}clearDcsHandler(h){this._dcsParser.clearHandler(this._identifier(h))}setDcsHandlerFallback(h){this._dcsParser.setHandlerFallback(h)}registerOscHandler(h,l){return this._oscParser.registerHandler(h,l)}clearOscHandler(h){this._oscParser.clearHandler(h)}setOscHandlerFallback(h){this._oscParser.setHandlerFallback(h)}setErrorHandler(h){this._errorHandler=h}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(h,l,f,x,E){this._parseStack.state=h,this._parseStack.handlers=l,this._parseStack.handlerPos=f,this._parseStack.transition=x,this._parseStack.chunkPos=E}parse(h,l,f){let x,E=0,k=0,b=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,b=this._parseStack.chunkPos+1;else{if(f===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const w=this._parseStack.handlers;let R=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(f===!1&&R>-1){for(;R>=0&&(x=w[R](this._params),x!==!0);R--)if(x instanceof Promise)return this._parseStack.handlerPos=R,x}this._parseStack.handlers=[];break;case 4:if(f===!1&&R>-1){for(;R>=0&&(x=w[R](),x!==!0);R--)if(x instanceof Promise)return this._parseStack.handlerPos=R,x}this._parseStack.handlers=[];break;case 6:if(E=h[this._parseStack.chunkPos],x=this._dcsParser.unhook(E!==24&&E!==26,f),x)return x;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(E=h[this._parseStack.chunkPos],x=this._oscParser.end(E!==24&&E!==26,f),x)return x;E===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,b=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let w=b;w<l;++w){switch(E=h[w],k=this._transitions.table[this.currentState<<8|(E<160?E:C)],k>>4){case 2:for(let A=w+1;;++A){if(A>=l||(E=h[A])<32||E>126&&E<C){this._printHandler(h,w,A),w=A-1;break}if(++A>=l||(E=h[A])<32||E>126&&E<C){this._printHandler(h,w,A),w=A-1;break}if(++A>=l||(E=h[A])<32||E>126&&E<C){this._printHandler(h,w,A),w=A-1;break}if(++A>=l||(E=h[A])<32||E>126&&E<C){this._printHandler(h,w,A),w=A-1;break}}break;case 3:this._executeHandlers[E]?this._executeHandlers[E]():this._executeHandlerFb(E),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:w,code:E,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const R=this._csiHandlers[this._collect<<8|E];let T=R?R.length-1:-1;for(;T>=0&&(x=R[T](this._params),x!==!0);T--)if(x instanceof Promise)return this._preserveStack(3,R,T,k,w),x;T<0&&this._csiHandlerFb(this._collect<<8|E,this._params),this.precedingJoinState=0;break;case 8:do switch(E){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(E-48)}while(++w<l&&(E=h[w])>47&&E<60);w--;break;case 9:this._collect<<=8,this._collect|=E;break;case 10:const M=this._escHandlers[this._collect<<8|E];let O=M?M.length-1:-1;for(;O>=0&&(x=M[O](),x!==!0);O--)if(x instanceof Promise)return this._preserveStack(4,M,O,k,w),x;O<0&&this._escHandlerFb(this._collect<<8|E),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|E,this._params);break;case 13:for(let A=w+1;;++A)if(A>=l||(E=h[A])===24||E===26||E===27||E>127&&E<C){this._dcsParser.put(h,w,A),w=A-1;break}break;case 14:if(x=this._dcsParser.unhook(E!==24&&E!==26),x)return this._preserveStack(6,[],0,k,w),x;E===27&&(k|=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 A=w+1;;A++)if(A>=l||(E=h[A])<32||E>127&&E<C){this._oscParser.put(h,w,A),w=A-1;break}break;case 6:if(x=this._oscParser.end(E!==24&&E!==26),x)return this._preserveStack(5,[],0,k,w),x;E===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&k}}}i.EscapeSequenceParser=_},6242:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OscHandler=i.OscParser=void 0;const d=a(5770),m=a(482),c=[];i.OscParser=class{constructor(){this._state=0,this._active=c,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,y){this._handlers[g]===void 0&&(this._handlers[g]=[]);const C=this._handlers[g];return C.push(y),{dispose:()=>{const _=C.indexOf(y);_!==-1&&C.splice(_,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=c}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=c,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||c,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,y,C){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(g,y,C);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(g,y,C))}start(){this.reset(),this._state=1}put(g,y,C){if(this._state!==3){if(this._state===1)for(;y<C;){const _=g[y++];if(_===59){this._state=2,this._start();break}if(_<48||57<_)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+_-48}this._state===2&&C-y>0&&this._put(g,y,C)}}end(g,y=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,_=this._active.length-1,p=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,C=y,p=this._stack.fallThrough,this._stack.paused=!1),!p&&C===!1){for(;_>=0&&(C=this._active[_].end(g),C!==!0);_--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,C;_--}for(;_>=0;_--)if(C=this._active[_].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",g);this._active=c,this._id=-1,this._state=0}}},i.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,y,C){this._hitLimit||(this._data+=(0,m.utf32ToString)(g,y,C),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let y=!1;if(this._hitLimit)y=!1;else if(g&&(y=this._handler(this._data),y instanceof Promise))return y.then(C=>(this._data="",this._hitLimit=!1,C));return this._data="",this._hitLimit=!1,y}}},8742:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.Params=void 0;const a=2147483647;class d{static fromArray(c){const g=new d;if(!c.length)return g;for(let y=Array.isArray(c[0])?1:0;y<c.length;++y){const C=c[y];if(Array.isArray(C))for(let _=0;_<C.length;++_)g.addSubParam(C[_]);else g.addParam(C)}return g}constructor(c=32,g=32){if(this.maxLength=c,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(c),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(c),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const c=new d(this.maxLength,this.maxSubParamsLength);return c.params.set(this.params),c.length=this.length,c._subParams.set(this._subParams),c._subParamsLength=this._subParamsLength,c._subParamsIdx.set(this._subParamsIdx),c._rejectDigits=this._rejectDigits,c._rejectSubDigits=this._rejectSubDigits,c._digitIsSub=this._digitIsSub,c}toArray(){const c=[];for(let g=0;g<this.length;++g){c.push(this.params[g]);const y=this._subParamsIdx[g]>>8,C=255&this._subParamsIdx[g];C-y>0&&c.push(Array.prototype.slice.call(this._subParams,y,C))}return c}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(c){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=c>a?a:c}}addSubParam(c){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=c>a?a:c,this._subParamsIdx[this.length-1]++}}hasSubParams(c){return(255&this._subParamsIdx[c])-(this._subParamsIdx[c]>>8)>0}getSubParams(c){const g=this._subParamsIdx[c]>>8,y=255&this._subParamsIdx[c];return y-g>0?this._subParams.subarray(g,y):null}getSubParamsAll(){const c={};for(let g=0;g<this.length;++g){const y=this._subParamsIdx[g]>>8,C=255&this._subParamsIdx[g];C-y>0&&(c[g]=this._subParams.slice(y,C))}return c}addDigit(c){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const y=this._digitIsSub?this._subParams:this.params,C=y[g-1];y[g-1]=~C?Math.min(10*C+c,a):c}}i.Params=d},5741:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.AddonManager=void 0,i.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,d){const m={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(m),d.dispose=()=>this._wrappedAddonDispose(m),d.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let d=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===a){d=m;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(d,1)}}},8771:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferApiView=void 0;const d=a(3785),m=a(511);i.BufferApiView=class{constructor(c,g){this._buffer=c,this.type=g}init(c){return this._buffer=c,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(c){const g=this._buffer.lines.get(c);if(g)return new d.BufferLineApiView(g)}getNullCell(){return new m.CellData}}},3785:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferLineApiView=void 0;const d=a(511);i.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,c){if(!(m<0||m>=this._line.length))return c?(this._line.loadCell(m,c),c):this._line.loadCell(m,new d.CellData)}translateToString(m,c,g){return this._line.translateToString(m,c,g)}}},8285:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.BufferNamespaceApi=void 0;const d=a(8771),m=a(8460),c=a(844);class g extends c.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.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)}}i.BufferNamespaceApi=g},7975:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.ParserApi=void 0,i.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,d){return this._core.registerCsiHandler(a,m=>d(m.toArray()))}addCsiHandler(a,d){return this.registerCsiHandler(a,d)}registerDcsHandler(a,d){return this._core.registerDcsHandler(a,(m,c)=>d(m,c.toArray()))}addDcsHandler(a,d){return this.registerDcsHandler(a,d)}registerEscHandler(a,d){return this._core.registerEscHandler(a,d)}addEscHandler(a,d){return this.registerEscHandler(a,d)}registerOscHandler(a,d){return this._core.registerOscHandler(a,d)}addOscHandler(a,d){return this.registerOscHandler(a,d)}}},7090:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeApi=void 0,i.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(u,i,a){var d=this&&this.__decorate||function(p,h,l,f){var x,E=arguments.length,k=E<3?h:f===null?f=Object.getOwnPropertyDescriptor(h,l):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,h,l,f);else for(var b=p.length-1;b>=0;b--)(x=p[b])&&(k=(E<3?x(k):E>3?x(h,l,k):x(h,l))||k);return E>3&&k&&Object.defineProperty(h,l,k),k},m=this&&this.__param||function(p,h){return function(l,f){h(l,f,p)}};Object.defineProperty(i,"__esModule",{value:!0}),i.BufferService=i.MINIMUM_ROWS=i.MINIMUM_COLS=void 0;const c=a(8460),g=a(844),y=a(5295),C=a(2585);i.MINIMUM_COLS=2,i.MINIMUM_ROWS=1;let _=i.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(p){super(),this.isUserScrolling=!1,this._onResize=this.register(new c.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new c.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(p.rawOptions.cols||0,i.MINIMUM_COLS),this.rows=Math.max(p.rawOptions.rows||0,i.MINIMUM_ROWS),this.buffers=this.register(new y.BufferSet(p,this))}resize(p,h){this.cols=p,this.rows=h,this.buffers.resize(p,h),this._onResize.fire({cols:p,rows:h})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(p,h=!1){const l=this.buffer;let f;f=this._cachedBlankLine,f&&f.length===this.cols&&f.getFg(0)===p.fg&&f.getBg(0)===p.bg||(f=l.getBlankLine(p,h),this._cachedBlankLine=f),f.isWrapped=h;const x=l.ybase+l.scrollTop,E=l.ybase+l.scrollBottom;if(l.scrollTop===0){const k=l.lines.isFull;E===l.lines.length-1?k?l.lines.recycle().copyFrom(f):l.lines.push(f.clone()):l.lines.splice(E+1,0,f.clone()),k?this.isUserScrolling&&(l.ydisp=Math.max(l.ydisp-1,0)):(l.ybase++,this.isUserScrolling||l.ydisp++)}else{const k=E-x+1;l.lines.shiftElements(x+1,k-1,-1),l.lines.set(E,f.clone())}this.isUserScrolling||(l.ydisp=l.ybase),this._onScroll.fire(l.ydisp)}scrollLines(p,h,l){const f=this.buffer;if(p<0){if(f.ydisp===0)return;this.isUserScrolling=!0}else p+f.ydisp>=f.ybase&&(this.isUserScrolling=!1);const x=f.ydisp;f.ydisp=Math.max(Math.min(f.ydisp+p,f.ybase),0),x!==f.ydisp&&(h||this._onScroll.fire(f.ydisp))}};i.BufferService=_=d([m(0,C.IOptionsService)],_)},7994:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.CharsetService=void 0,i.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,d){this._charsets[a]=d,this.glevel===a&&(this.charset=d)}}},1753:function(u,i,a){var d=this&&this.__decorate||function(f,x,E,k){var b,w=arguments.length,R=w<3?x:k===null?k=Object.getOwnPropertyDescriptor(x,E):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,x,E,k);else for(var T=f.length-1;T>=0;T--)(b=f[T])&&(R=(w<3?b(R):w>3?b(x,E,R):b(x,E))||R);return w>3&&R&&Object.defineProperty(x,E,R),R},m=this&&this.__param||function(f,x){return function(E,k){x(E,k,f)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreMouseService=void 0;const c=a(2585),g=a(8460),y=a(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:f=>f.button!==4&&f.action===1&&(f.ctrl=!1,f.alt=!1,f.shift=!1,!0)},VT200:{events:19,restrict:f=>f.action!==32},DRAG:{events:23,restrict:f=>f.action!==32||f.button!==3},ANY:{events:31,restrict:f=>!0}};function _(f,x){let E=(f.ctrl?16:0)|(f.shift?4:0)|(f.alt?8:0);return f.button===4?(E|=64,E|=f.action):(E|=3&f.button,4&f.button&&(E|=64),8&f.button&&(E|=128),f.action===32?E|=32:f.action!==0||x||(E|=3)),E}const p=String.fromCharCode,h={DEFAULT:f=>{const x=[_(f,!1)+32,f.col+32,f.row+32];return x[0]>255||x[1]>255||x[2]>255?"":`\x1B[M${p(x[0])}${p(x[1])}${p(x[2])}`},SGR:f=>{const x=f.action===0&&f.button!==4?"m":"M";return`\x1B[<${_(f,!0)};${f.col};${f.row}${x}`},SGR_PIXELS:f=>{const x=f.action===0&&f.button!==4?"m":"M";return`\x1B[<${_(f,!0)};${f.x};${f.y}${x}`}};let l=i.CoreMouseService=class extends y.Disposable{constructor(f,x){super(),this._bufferService=f,this._coreService=x,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const E of Object.keys(C))this.addProtocol(E,C[E]);for(const E of Object.keys(h))this.addEncoding(E,h[E]);this.reset()}addProtocol(f,x){this._protocols[f]=x}addEncoding(f,x){this._encodings[f]=x}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(f){if(!this._protocols[f])throw new Error(`unknown protocol "${f}"`);this._activeProtocol=f,this._onProtocolChange.fire(this._protocols[f].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(f){if(!this._encodings[f])throw new Error(`unknown encoding "${f}"`);this._activeEncoding=f}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(f){if(f.col<0||f.col>=this._bufferService.cols||f.row<0||f.row>=this._bufferService.rows||f.button===4&&f.action===32||f.button===3&&f.action!==32||f.button!==4&&(f.action===2||f.action===3)||(f.col++,f.row++,f.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,f,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(f))return!1;const x=this._encodings[this._activeEncoding](f);return x&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(x):this._coreService.triggerDataEvent(x,!0)),this._lastEvent=f,!0}explainEvents(f){return{down:!!(1&f),up:!!(2&f),drag:!!(4&f),move:!!(8&f),wheel:!!(16&f)}}_equalEvents(f,x,E){if(E){if(f.x!==x.x||f.y!==x.y)return!1}else if(f.col!==x.col||f.row!==x.row)return!1;return f.button===x.button&&f.action===x.action&&f.ctrl===x.ctrl&&f.alt===x.alt&&f.shift===x.shift}};i.CoreMouseService=l=d([m(0,c.IBufferService),m(1,c.ICoreService)],l)},6975:function(u,i,a){var d=this&&this.__decorate||function(l,f,x,E){var k,b=arguments.length,w=b<3?f:E===null?E=Object.getOwnPropertyDescriptor(f,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(l,f,x,E);else for(var R=l.length-1;R>=0;R--)(k=l[R])&&(w=(b<3?k(w):b>3?k(f,x,w):k(f,x))||w);return b>3&&w&&Object.defineProperty(f,x,w),w},m=this&&this.__param||function(l,f){return function(x,E){f(x,E,l)}};Object.defineProperty(i,"__esModule",{value:!0}),i.CoreService=void 0;const c=a(1439),g=a(8460),y=a(844),C=a(2585),_=Object.freeze({insertMode:!1}),p=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let h=i.CoreService=class extends y.Disposable{constructor(l,f,x){super(),this._bufferService=l,this._logService=f,this._optionsService=x,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,c.clone)(_),this.decPrivateModes=(0,c.clone)(p)}reset(){this.modes=(0,c.clone)(_),this.decPrivateModes=(0,c.clone)(p)}triggerDataEvent(l,f=!1){if(this._optionsService.rawOptions.disableStdin)return;const x=this._bufferService.buffer;f&&this._optionsService.rawOptions.scrollOnUserInput&&x.ybase!==x.ydisp&&this._onRequestScrollToBottom.fire(),f&&this._onUserInput.fire(),this._logService.debug(`sending data "${l}"`,()=>l.split("").map(E=>E.charCodeAt(0))),this._onData.fire(l)}triggerBinaryEvent(l){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${l}"`,()=>l.split("").map(f=>f.charCodeAt(0))),this._onBinary.fire(l))}};i.CoreService=h=d([m(0,C.IBufferService),m(1,C.ILogService),m(2,C.IOptionsService)],h)},9074:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.DecorationService=void 0;const d=a(8055),m=a(8460),c=a(844),g=a(6106);let y=0,C=0;class _ extends c.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList(l=>l==null?void 0:l.marker.line),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,c.toDisposable)(()=>this.reset()))}registerDecoration(l){if(l.marker.isDisposed)return;const f=new p(l);if(f){const x=f.marker.onDispose(()=>f.dispose());f.onDispose(()=>{f&&(this._decorations.delete(f)&&this._onDecorationRemoved.fire(f),x.dispose())}),this._decorations.insert(f),this._onDecorationRegistered.fire(f)}return f}reset(){for(const l of this._decorations.values())l.dispose();this._decorations.clear()}*getDecorationsAtCell(l,f,x){let E=0,k=0;for(const b of this._decorations.getKeyIterator(f))E=b.options.x??0,k=E+(b.options.width??1),l>=E&&l<k&&(!x||(b.options.layer??"bottom")===x)&&(yield b)}forEachDecorationAtCell(l,f,x,E){this._decorations.forEachByKey(f,k=>{y=k.options.x??0,C=y+(k.options.width??1),l>=y&&l<C&&(!x||(k.options.layer??"bottom")===x)&&E(k)})}}i.DecorationService=_;class p extends c.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(l){super(),this.options=l,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=l.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.InstantiationService=i.ServiceCollection=void 0;const d=a(2585),m=a(8343);class c{constructor(...y){this._entries=new Map;for(const[C,_]of y)this.set(C,_)}set(y,C){const _=this._entries.get(y);return this._entries.set(y,C),_}forEach(y){for(const[C,_]of this._entries.entries())y(C,_)}has(y){return this._entries.has(y)}get(y){return this._entries.get(y)}}i.ServiceCollection=c,i.InstantiationService=class{constructor(){this._services=new c,this._services.set(d.IInstantiationService,this)}setService(g,y){this._services.set(g,y)}getService(g){return this._services.get(g)}createInstance(g,...y){const C=(0,m.getServiceDependencies)(g).sort((h,l)=>h.index-l.index),_=[];for(const h of C){const l=this._services.get(h.id);if(!l)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${h.id}.`);_.push(l)}const p=C.length>0?C[0].index:y.length;if(y.length!==p)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${p+1} conflicts with ${y.length} static arguments`);return new g(...y,..._)}}},7866:function(u,i,a){var d=this&&this.__decorate||function(p,h,l,f){var x,E=arguments.length,k=E<3?h:f===null?f=Object.getOwnPropertyDescriptor(h,l):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,h,l,f);else for(var b=p.length-1;b>=0;b--)(x=p[b])&&(k=(E<3?x(k):E>3?x(h,l,k):x(h,l))||k);return E>3&&k&&Object.defineProperty(h,l,k),k},m=this&&this.__param||function(p,h){return function(l,f){h(l,f,p)}};Object.defineProperty(i,"__esModule",{value:!0}),i.traceCall=i.setTraceLogger=i.LogService=void 0;const c=a(844),g=a(2585),y={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let C,_=i.LogService=class extends c.Disposable{get logLevel(){return this._logLevel}constructor(p){super(),this._optionsService=p,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),C=this}_updateLogLevel(){this._logLevel=y[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(p){for(let h=0;h<p.length;h++)typeof p[h]=="function"&&(p[h]=p[h]())}_log(p,h,l){this._evalLazyOptionalParams(l),p.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...l)}trace(p,...h){var l;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.trace.bind(this._optionsService.options.logger))??console.log,p,h)}debug(p,...h){var l;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.debug.bind(this._optionsService.options.logger))??console.log,p,h)}info(p,...h){var l;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.info.bind(this._optionsService.options.logger))??console.info,p,h)}warn(p,...h){var l;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.warn.bind(this._optionsService.options.logger))??console.warn,p,h)}error(p,...h){var l;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.error.bind(this._optionsService.options.logger))??console.error,p,h)}};i.LogService=_=d([m(0,g.IOptionsService)],_),i.setTraceLogger=function(p){C=p},i.traceCall=function(p,h,l){if(typeof l.value!="function")throw new Error("not supported");const f=l.value;l.value=function(...x){if(C.logLevel!==g.LogLevelEnum.TRACE)return f.apply(this,x);C.trace(`GlyphRenderer#${f.name}(${x.map(k=>JSON.stringify(k)).join(", ")})`);const E=f.apply(this,x);return C.trace(`GlyphRenderer#${f.name} return`,E),E}}},7302:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.OptionsService=i.DEFAULT_OPTIONS=void 0;const d=a(8460),m=a(844),c=a(6114);i.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:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:c.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class y extends m.Disposable{constructor(_){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const p={...i.DEFAULT_OPTIONS};for(const h in _)if(h in p)try{const l=_[h];p[h]=this._sanitizeAndValidateOption(h,l)}catch(l){console.error(l)}this.rawOptions=p,this.options={...p},this._setupOptions(),this.register((0,m.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(_,p){return this.onOptionChange(h=>{h===_&&p(this.rawOptions[_])})}onMultipleOptionChange(_,p){return this.onOptionChange(h=>{_.indexOf(h)!==-1&&p()})}_setupOptions(){const _=h=>{if(!(h in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);return this.rawOptions[h]},p=(h,l)=>{if(!(h in i.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);l=this._sanitizeAndValidateOption(h,l),this.rawOptions[h]!==l&&(this.rawOptions[h]=l,this._onOptionChange.fire(h))};for(const h in this.rawOptions){const l={get:_.bind(this,h),set:p.bind(this,h)};Object.defineProperty(this.options,h,l)}}_sanitizeAndValidateOption(_,p){switch(_){case"cursorStyle":if(p||(p=i.DEFAULT_OPTIONS[_]),!function(h){return h==="block"||h==="underline"||h==="bar"}(p))throw new Error(`"${p}" is not a valid value for ${_}`);break;case"wordSeparator":p||(p=i.DEFAULT_OPTIONS[_]);break;case"fontWeight":case"fontWeightBold":if(typeof p=="number"&&1<=p&&p<=1e3)break;p=g.includes(p)?p:i.DEFAULT_OPTIONS[_];break;case"cursorWidth":p=Math.floor(p);case"lineHeight":case"tabStopWidth":if(p<1)throw new Error(`${_} 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(`${_} cannot be less than 0, value: ${p}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(p<=0)throw new Error(`${_} cannot be less than or equal to 0, value: ${p}`);break;case"rows":case"cols":if(!p&&p!==0)throw new Error(`${_} must be numeric, value: ${p}`);break;case"windowsPty":p=p??{}}return p}}i.OptionsService=y},2660:function(u,i,a){var d=this&&this.__decorate||function(y,C,_,p){var h,l=arguments.length,f=l<3?C:p===null?p=Object.getOwnPropertyDescriptor(C,_):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(y,C,_,p);else for(var x=y.length-1;x>=0;x--)(h=y[x])&&(f=(l<3?h(f):l>3?h(C,_,f):h(C,_))||f);return l>3&&f&&Object.defineProperty(C,_,f),f},m=this&&this.__param||function(y,C){return function(_,p){C(_,p,y)}};Object.defineProperty(i,"__esModule",{value:!0}),i.OscLinkService=void 0;const c=a(2585);let g=i.OscLinkService=class{constructor(y){this._bufferService=y,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(y){const C=this._bufferService.buffer;if(y.id===void 0){const x=C.addMarker(C.ybase+C.y),E={data:y,id:this._nextId++,lines:[x]};return x.onDispose(()=>this._removeMarkerFromLink(E,x)),this._dataByLinkId.set(E.id,E),E.id}const _=y,p=this._getEntryIdKey(_),h=this._entriesWithId.get(p);if(h)return this.addLineToLink(h.id,C.ybase+C.y),h.id;const l=C.addMarker(C.ybase+C.y),f={id:this._nextId++,key:this._getEntryIdKey(_),data:_,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(f,l)),this._entriesWithId.set(f.key,f),this._dataByLinkId.set(f.id,f),f.id}addLineToLink(y,C){const _=this._dataByLinkId.get(y);if(_&&_.lines.every(p=>p.line!==C)){const p=this._bufferService.buffer.addMarker(C);_.lines.push(p),p.onDispose(()=>this._removeMarkerFromLink(_,p))}}getLinkData(y){var C;return(C=this._dataByLinkId.get(y))==null?void 0:C.data}_getEntryIdKey(y){return`${y.id};;${y.uri}`}_removeMarkerFromLink(y,C){const _=y.lines.indexOf(C);_!==-1&&(y.lines.splice(_,1),y.lines.length===0&&(y.data.id!==void 0&&this._entriesWithId.delete(y.key),this._dataByLinkId.delete(y.id)))}};i.OscLinkService=g=d([m(0,c.IBufferService)],g)},8343:(u,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.createDecorator=i.getServiceDependencies=i.serviceRegistry=void 0;const a="di$target",d="di$dependencies";i.serviceRegistry=new Map,i.getServiceDependencies=function(m){return m[d]||[]},i.createDecorator=function(m){if(i.serviceRegistry.has(m))return i.serviceRegistry.get(m);const c=function(g,y,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(_,p,h){p[a]===p?p[d].push({id:_,index:h}):(p[d]=[{id:_,index:h}],p[a]=p)})(c,g,C)};return c.toString=()=>m,i.serviceRegistry.set(m,c),c}},2585:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.IDecorationService=i.IUnicodeService=i.IOscLinkService=i.IOptionsService=i.ILogService=i.LogLevelEnum=i.IInstantiationService=i.ICharsetService=i.ICoreService=i.ICoreMouseService=i.IBufferService=void 0;const d=a(8343);var m;i.IBufferService=(0,d.createDecorator)("BufferService"),i.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),i.ICoreService=(0,d.createDecorator)("CoreService"),i.ICharsetService=(0,d.createDecorator)("CharsetService"),i.IInstantiationService=(0,d.createDecorator)("InstantiationService"),function(c){c[c.TRACE=0]="TRACE",c[c.DEBUG=1]="DEBUG",c[c.INFO=2]="INFO",c[c.WARN=3]="WARN",c[c.ERROR=4]="ERROR",c[c.OFF=5]="OFF"}(m||(i.LogLevelEnum=m={})),i.ILogService=(0,d.createDecorator)("LogService"),i.IOptionsService=(0,d.createDecorator)("OptionsService"),i.IOscLinkService=(0,d.createDecorator)("OscLinkService"),i.IUnicodeService=(0,d.createDecorator)("UnicodeService"),i.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(u,i,a)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.UnicodeService=void 0;const d=a(8460),m=a(225);class c{static extractShouldJoin(y){return(1&y)!=0}static extractWidth(y){return y>>1&3}static extractCharKind(y){return y>>3}static createPropertyValue(y,C,_=!1){return(16777215&y)<<3|(3&C)<<1|(_?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const y=new m.UnicodeV6;this.register(y),this._active=y.version,this._activeProvider=y}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(y){if(!this._providers[y])throw new Error(`unknown Unicode version "${y}"`);this._active=y,this._activeProvider=this._providers[y],this._onChange.fire(y)}register(y){this._providers[y.version]=y}wcwidth(y){return this._activeProvider.wcwidth(y)}getStringCellWidth(y){let C=0,_=0;const p=y.length;for(let h=0;h<p;++h){let l=y.charCodeAt(h);if(55296<=l&&l<=56319){if(++h>=p)return C+this.wcwidth(l);const E=y.charCodeAt(h);56320<=E&&E<=57343?l=1024*(l-55296)+E-56320+65536:C+=this.wcwidth(E)}const f=this.charProperties(l,_);let x=c.extractWidth(f);c.extractShouldJoin(f)&&(x-=c.extractWidth(_)),C+=x,_=f}return C}charProperties(y,C){return this._activeProvider.charProperties(y,C)}}i.UnicodeService=c}},n={};function s(u){var i=n[u];if(i!==void 0)return i.exports;var a=n[u]={exports:{}};return r[u].call(a.exports,a,a.exports,s),a.exports}var o={};return(()=>{var u=o;Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const i=s(9042),a=s(3236),d=s(844),m=s(5741),c=s(8285),g=s(7975),y=s(7090),C=["cols","rows"];class _ extends d.Disposable{constructor(h){super(),this._core=this.register(new a.Terminal(h)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const l=x=>this._core.options[x],f=(x,E)=>{this._checkReadonlyOptions(x),this._core.options[x]=E};for(const x in this._core.options){const E={get:l.bind(this,x),set:f.bind(this,x)};Object.defineProperty(this._publicOptions,x,E)}}_checkReadonlyOptions(h){if(C.includes(h))throw new Error(`Option "${h}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new y.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 c.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const h=this._core.coreService.decPrivateModes;let l="none";switch(this._core.coreMouseService.activeProtocol){case"X10":l="x10";break;case"VT200":l="vt200";break;case"DRAG":l="drag";break;case"ANY":l="any"}return{applicationCursorKeysMode:h.applicationCursorKeys,applicationKeypadMode:h.applicationKeypad,bracketedPasteMode:h.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:h.origin,reverseWraparoundMode:h.reverseWraparound,sendFocusMode:h.sendFocus,wraparoundMode:h.wraparound}}get options(){return this._publicOptions}set options(h){for(const l in h)this._publicOptions[l]=h[l]}blur(){this._core.blur()}focus(){this._core.focus()}input(h,l=!0){this._core.input(h,l)}resize(h,l){this._verifyIntegers(h,l),this._core.resize(h,l)}open(h){this._core.open(h)}attachCustomKeyEventHandler(h){this._core.attachCustomKeyEventHandler(h)}attachCustomWheelEventHandler(h){this._core.attachCustomWheelEventHandler(h)}registerLinkProvider(h){return this._core.registerLinkProvider(h)}registerCharacterJoiner(h){return this._checkProposedApi(),this._core.registerCharacterJoiner(h)}deregisterCharacterJoiner(h){this._checkProposedApi(),this._core.deregisterCharacterJoiner(h)}registerMarker(h=0){return this._verifyIntegers(h),this._core.registerMarker(h)}registerDecoration(h){return this._checkProposedApi(),this._verifyPositiveIntegers(h.x??0,h.width??0,h.height??0),this._core.registerDecoration(h)}hasSelection(){return this._core.hasSelection()}select(h,l,f){this._verifyIntegers(h,l,f),this._core.select(h,l,f)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(h,l){this._verifyIntegers(h,l),this._core.selectLines(h,l)}dispose(){super.dispose()}scrollLines(h){this._verifyIntegers(h),this._core.scrollLines(h)}scrollPages(h){this._verifyIntegers(h),this._core.scrollPages(h)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(h){this._verifyIntegers(h),this._core.scrollToLine(h)}clear(){this._core.clear()}write(h,l){this._core.write(h,l)}writeln(h,l){this._core.write(h),this._core.write(`\r
279
+ `,l)}paste(h){this._core.paste(h)}refresh(h,l){this._verifyIntegers(h,l),this._core.refresh(h,l)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(h){this._addonManager.loadAddon(this,h)}static get strings(){return i}_verifyIntegers(...h){for(const l of h)if(l===1/0||isNaN(l)||l%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...h){for(const l of h)if(l&&(l===1/0||isNaN(l)||l%1!=0||l<0))throw new Error("This API only accepts positive integers")}}u.Terminal=_})(),o})())})(tx);var mL=tx.exports,nx={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={};return(()=>{var n=r;Object.defineProperty(n,"__esModule",{value:!0}),n.FitAddon=void 0,n.FitAddon=class{activate(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const o=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(o._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,o=s._renderService.dimensions;if(o.css.cell.width===0||o.css.cell.height===0)return;const u=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,i=window.getComputedStyle(this._terminal.element.parentElement),a=parseInt(i.getPropertyValue("height")),d=Math.max(0,parseInt(i.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),c=a-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),g=d-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-u;return{cols:Math.max(2,Math.floor(g/o.css.cell.width)),rows:Math.max(1,Math.floor(c/o.css.cell.height))}}}})(),r})())})(nx);var gL=nx.exports,sx={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(self,()=>(()=>{var r={6:(u,i)=>{function a(m){try{const c=new URL(m),g=c.password&&c.username?`${c.protocol}//${c.username}:${c.password}@${c.host}`:c.username?`${c.protocol}//${c.username}@${c.host}`:`${c.protocol}//${c.host}`;return m.toLocaleLowerCase().startsWith(g.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(i,"__esModule",{value:!0}),i.LinkComputer=i.WebLinkProvider=void 0,i.WebLinkProvider=class{constructor(m,c,g,y={}){this._terminal=m,this._regex=c,this._handler=g,this._options=y}provideLinks(m,c){const g=d.computeLink(m,this._regex,this._terminal,this._handler);c(this._addCallbacks(g))}_addCallbacks(m){return m.map(c=>(c.leave=this._options.leave,c.hover=(g,y)=>{if(this._options.hover){const{range:C}=c;this._options.hover(g,y,C)}},c))}};class d{static computeLink(c,g,y,C){const _=new RegExp(g.source,(g.flags||"")+"g"),[p,h]=d._getWindowedLineStrings(c-1,y),l=p.join("");let f;const x=[];for(;f=_.exec(l);){const E=f[0];if(!a(E))continue;const[k,b]=d._mapStrIdx(y,h,0,f.index),[w,R]=d._mapStrIdx(y,k,b,E.length);if(k===-1||b===-1||w===-1||R===-1)continue;const T={start:{x:b+1,y:k+1},end:{x:R,y:w+1}};x.push({range:T,text:E,activate:C})}return x}static _getWindowedLineStrings(c,g){let y,C=c,_=c,p=0,h="";const l=[];if(y=g.buffer.active.getLine(c)){const f=y.translateToString(!0);if(y.isWrapped&&f[0]!==" "){for(p=0;(y=g.buffer.active.getLine(--C))&&p<2048&&(h=y.translateToString(!0),p+=h.length,l.push(h),y.isWrapped&&h.indexOf(" ")===-1););l.reverse()}for(l.push(f),p=0;(y=g.buffer.active.getLine(++_))&&y.isWrapped&&p<2048&&(h=y.translateToString(!0),p+=h.length,l.push(h),h.indexOf(" ")===-1););}return[l,C]}static _mapStrIdx(c,g,y,C){const _=c.buffer.active,p=_.getNullCell();let h=y;for(;C;){const l=_.getLine(g);if(!l)return[-1,-1];for(let f=h;f<l.length;++f){l.getCell(f,p);const x=p.getChars();if(p.getWidth()&&(C-=x.length||1,f===l.length-1&&x==="")){const E=_.getLine(g+1);E&&E.isWrapped&&(E.getCell(0,p),p.getWidth()===2&&(C+=1))}if(C<0)return[g,f]}g++,h=0}return[g,h]}}i.LinkComputer=d}},n={};function s(u){var i=n[u];if(i!==void 0)return i.exports;var a=n[u]={exports:{}};return r[u](a,a.exports,s),a.exports}var o={};return(()=>{var u=o;Object.defineProperty(u,"__esModule",{value:!0}),u.WebLinksAddon=void 0;const i=s(6),a=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function d(m,c){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=c}else console.warn("Opening link blocked as opener could not be cleared")}u.WebLinksAddon=class{constructor(m=d,c={}){this._handler=m,this._options=c}activate(m){this._terminal=m;const c=this._options,g=c.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new i.WebLinkProvider(this._terminal,g,this._handler,c))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),o})())})(sx);var vL=sx.exports;const Od=S.forwardRef(({onData:e,onResize:t},r)=>{const n=S.useRef(null),s=S.useRef(null),o=S.useRef(null),u=S.useRef(e);u.current=e;const i=S.useRef(t);return i.current=t,S.useImperativeHandle(r,()=>({write(a){var d;(d=s.current)==null||d.write(a)},clear(){var a;(a=s.current)==null||a.clear()},fit(){var a;try{(a=o.current)==null||a.fit()}catch{}},focus(){var a;(a=s.current)==null||a.focus()}})),S.useEffect(()=>{const a=n.current;if(!a)return;const d=new mL.Terminal({fontSize:14,fontFamily:'ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',theme:{background:"transparent",foreground:"#f0f6fc",cursor:"#58a6ff",cursorAccent:"#0d1117",selectionBackground:"rgba(88, 166, 255, 0.3)",black:"#484f58",red:"#ff7b72",green:"#7ee787",yellow:"#ffa657",blue:"#79c0ff",magenta:"#d2a8ff",cyan:"#a5f3fc",white:"#b1bac4",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#ffdf5d",brightBlue:"#79c0ff",brightMagenta:"#d2a8ff",brightCyan:"#a5f3fc",brightWhite:"#f0f6fc"},allowProposedApi:!0,scrollback:1e4,rightClickSelectsWord:!1,allowTransparency:!0,windowOptions:{}}),m=new gL.FitAddon,c=new vL.WebLinksAddon;d.loadAddon(m),d.loadAddon(c),d.open(a);try{m.fit()}catch{}d.onData(y=>{const C=y.replace(/\x1b\[\[?[IO]/g,"");C&&u.current(C)}),d.onResize(({cols:y,rows:C})=>{var _;(_=i.current)==null||_.call(i,y,C)}),s.current=d,o.current=m;const g=new ResizeObserver(()=>{try{m.fit()}catch{}});return g.observe(a),()=>{g.disconnect(),d.dispose(),s.current=null,o.current=null}},[]),v.jsx("div",{ref:n,className:"xterm-renderer"})});Od.displayName="XTermRenderer";const _L=[{kind:"claude",label:"Start Claude",icon:yL},{kind:"codex",label:"Start Codex",icon:xL},{kind:"agent",label:"Start Cursor",icon:wL}];function ix({visible:e,onStart:t}){return e?v.jsxs("div",{className:"start-prompt",children:[v.jsx("p",{className:"start-prompt-heading",children:"Choose an agent to start"}),v.jsx("div",{className:"start-prompt-buttons",children:_L.map(({kind:r,label:n,icon:s})=>v.jsxs("button",{className:"start-prompt-btn",onClick:()=>t(r),children:[s(),v.jsx("span",{children:n})]},r))})]}):null}function yL(){return v.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:v.jsx("path",{d:"M12 3l1.912 5.813a2 2 0 001.275 1.275L21 12l-5.813 1.912a2 2 0 00-1.275 1.275L12 21l-1.912-5.813a2 2 0 00-1.275-1.275L3 12l5.813-1.912a2 2 0 001.275-1.275L12 3z"})})}function xL(){return v.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("polyline",{points:"4 17 10 11 4 5"}),v.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})}function wL(){return v.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:v.jsx("path",{d:"M5 3l14 9-7 2-4 7L5 3z"})})}function ox({plan:e,onAccept:t,onReject:r}){const[n,s]=S.useState(!1);return e?v.jsxs("div",{className:"plan-panel",children:[v.jsxs("div",{className:"plan-panel-header",children:[v.jsxs("button",{className:"plan-panel-toggle",onClick:()=>s(o=>!o),children:[v.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{transform:n?"rotate(-90deg)":"rotate(0deg)",transition:"transform 150ms"},children:v.jsx("polyline",{points:"6 9 12 15 18 9"})}),v.jsx("span",{children:"Plan Detected"})]}),v.jsxs("div",{className:"plan-panel-actions",children:[v.jsx("button",{className:"plan-panel-btn plan-panel-btn--accept",onClick:t,children:"Accept"}),v.jsx("button",{className:"plan-panel-btn plan-panel-btn--reject",onClick:r,children:"Reject"})]})]}),!n&&v.jsx("div",{className:"plan-panel-body",children:v.jsx("pre",{className:"plan-panel-content",children:e.content})})]}):null}function ax({open:e,onClose:t,autoSessionId:r}){const[n,s]=S.useState(!1),o=S.useRef(null),u=S.useMemo(()=>ex().defaultAgent,[]);e&&!n&&s(!0);const{plan:i,processOutput:a,clearPlan:d}=Qy(),m=S.useRef(a);m.current=a;const c=S.useRef(d);c.current=d;const g=S.useRef(null),{status:y,send:C}=jd({onMessage:S.useCallback(b=>{var w,R,T,M;switch((w=g.current)==null||w.handleMessage(b),b.type){case"output":(R=o.current)==null||R.write(b.data),m.current(b.data);break;case"error":(T=o.current)==null||T.write(`\r
280
+ \x1B[31mError: ${b.message}\x1B[0m\r
281
+ `);break;case"exit":(M=o.current)==null||M.write(`\r
282
+ \x1B[33mAgent exited (code ${b.code??"unknown"})\x1B[0m\r
283
+ `);break;case"claude_started":case"codex_started":case"agent_started":c.current();break}},[])}),_=cL({send:C,xtermRef:o,defaultAgent:u,autoSessionId:r});g.current=_,S.useEffect(()=>{if(!e)return;const b=setTimeout(()=>{var w,R;(w=o.current)==null||w.fit(),(R=o.current)==null||R.focus()},250);return()=>clearTimeout(b)},[e]);const p=S.useCallback(b=>C({type:"input",data:b}),[C]),h=S.useCallback((b,w)=>C({type:"resize",cols:b,rows:w}),[C]),l=S.useCallback(()=>{C({type:"input",data:`y
284
+ `}),d()},[C,d]),f=S.useCallback(()=>{C({type:"input",data:`n
285
+ `}),d()},[C,d]),x=!!_.sessionId&&!_.agentRunning&&y==="connected",E=S.useRef(null);S.useEffect(()=>{!r||r===E.current||y==="connected"&&(E.current=r,C({type:"join_session",sessionId:r}))},[r,y,C]);const k=y==="connected"?"bg-emerald-400":y==="connecting"?"bg-amber-400 animate-pulse":"bg-red-400";return v.jsxs(v.Fragment,{children:[e&&v.jsx("div",{className:"fixed inset-0 z-40 bg-black/40",onClick:t}),v.jsxs("div",{className:"fixed top-0 right-0 z-50 h-full w-[50vw] min-w-[400px] max-w-[80vw] bg-background border-l border-border shadow-xl flex flex-col transition-transform duration-200",style:{transform:e?"translateX(0)":"translateX(100%)",pointerEvents:e?"auto":"none"},children:[v.jsxs("div",{className:"flex items-center justify-between px-4 py-2 border-b border-border bg-muted/50",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${k}`}),v.jsx("h3",{className:"text-sm font-medium text-foreground",children:"Terminal"})]}),v.jsx("button",{onClick:t,className:"rounded-md p-1 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:v.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[v.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),v.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),n&&v.jsxs("div",{className:"relative flex-1 min-h-0 flex flex-col",children:[v.jsx("div",{className:"flex-1 min-h-0 terminal-body-bg",children:v.jsx(Od,{ref:o,onData:p,onResize:h})}),v.jsx(ix,{visible:x,onStart:_.startAgent}),v.jsx(ox,{plan:i,onAccept:l,onReject:f})]})]})]})}const SL=3e3;function bL({sessionId:e}){const t=S.useRef(null),[r,n]=S.useState(!1),s=S.useRef(!1),{plan:o,processOutput:u,clearPlan:i}=Qy(),a=S.useRef(u);a.current=u;const d=S.useRef(i);d.current=i;const{status:m,send:c}=jd({onMessage:S.useCallback(h=>{var l,f,x,E,k,b;switch(h.type){case"connected":s.current||(s.current=!0,c({type:"join_session",sessionId:e}));break;case"session_joined":if(n(h.active),(l=t.current)==null||l.clear(),(f=h.outputBuffer)!=null&&f.length)for(const w of h.outputBuffer)(x=t.current)==null||x.write(w.replace(/\x1b\[\[?[IO]/g,""));break;case"output":(E=t.current)==null||E.write(h.data),a.current(h.data);break;case"error":(k=t.current)==null||k.write(`\r
286
+ \x1B[31mError: ${h.message}\x1B[0m\r
287
+ `);break;case"exit":(b=t.current)==null||b.write(`\r
288
+ \x1B[33mAgent exited (code ${h.code??"unknown"})\x1B[0m\r
289
+ `),n(!1);break;case"claude_started":case"codex_started":case"agent_started":n(!0),d.current();break;case"claude_stopped":case"codex_stopped":case"agent_stopped":n(!1);break}},[e])});S.useEffect(()=>{const h=setTimeout(()=>{var l,f;(l=t.current)==null||l.fit(),(f=t.current)==null||f.focus()},150);return()=>clearTimeout(h)},[]);const g=S.useCallback(h=>c({type:"input",data:h}),[c]),y=S.useCallback((h,l)=>c({type:"resize",cols:h,rows:l}),[c]),C=S.useCallback(h=>{c({type:h==="claude"?"start_claude":h==="codex"?"start_codex":"start_agent"})},[c]),_=!r&&m==="connected",p=m==="connected"?"bg-emerald-400":m==="connecting"?"bg-amber-400 animate-pulse":"bg-red-400";return v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border bg-muted/50",children:[v.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${p}`}),v.jsx("h3",{className:"text-sm font-medium text-foreground",children:"Terminal"})]}),v.jsxs("div",{className:"relative flex-1 min-h-0 flex flex-col",children:[v.jsx("div",{className:"flex-1 min-h-0 terminal-body-bg",children:v.jsx(Od,{ref:t,onData:g,onResize:y})}),v.jsx(ix,{visible:_,onStart:C}),v.jsx(ox,{plan:o,onAccept:()=>{c({type:"input",data:`y
290
+ `}),i()},onReject:()=>{c({type:"input",data:`n
291
+ `}),i()}})]})]})}function CL(){const[e,t]=S.useState([]),[r,n]=S.useState(!0),[s,o]=S.useState(null),[u,i]=S.useState(new Set),a=S.useRef(null),d=S.useCallback(async()=>{try{const g=await(await fetch("/terminal/api/sessions/list")).json();t(g.sessions??[])}catch{}finally{n(!1)}},[]);S.useEffect(()=>(d(),a.current=setInterval(d,SL),()=>{a.current&&clearInterval(a.current)}),[d]);const m=async c=>{i(g=>new Set(g).add(c));try{await fetch(`/terminal/api/sessions/${c}`,{method:"DELETE"}),s===c&&o(null),await d()}finally{i(g=>{const y=new Set(g);return y.delete(c),y})}};return s?v.jsxs("div",{className:"flex flex-col h-full",children:[v.jsx("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-border bg-muted/30",children:v.jsxs("button",{type:"button",onClick:()=>o(null),className:"inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-sm text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[v.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:v.jsx("polyline",{points:"15 18 9 12 15 6"})}),"Back to sessions"]})}),v.jsx("div",{className:"flex-1 min-h-0",children:v.jsx(bL,{sessionId:s},s)})]}):v.jsxs("div",{className:"p-6 max-w-4xl mx-auto",children:[v.jsxs("div",{className:"flex items-center justify-between mb-6",children:[v.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Terminal Sessions"}),v.jsxs("span",{className:"text-xs text-muted-foreground",children:[e.length," session",e.length!==1?"s":""]})]}),r?v.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading sessions..."}):e.length===0?v.jsx("div",{className:"rounded-lg border border-border bg-muted/30 p-8 text-center",children:v.jsx("p",{className:"text-sm text-muted-foreground",children:"No terminal sessions. Sessions are created automatically when the pipeline triggers an LLM node."})}):v.jsx("div",{className:"space-y-2",children:e.map(c=>v.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border bg-card px-4 py-3 hover:bg-muted/30 transition-colors",children:[v.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[v.jsx("span",{className:`inline-block w-2 h-2 rounded-full shrink-0 ${c.active?"bg-emerald-400":"bg-zinc-400"}`}),v.jsxs("div",{className:"min-w-0",children:[v.jsx("p",{className:"text-sm font-medium text-foreground truncate",children:c.name||c.id}),v.jsxs("p",{className:"text-xs text-muted-foreground",children:[c.active?"Active":"Inactive",c.lastActivity?` · ${kL(c.lastActivity)}`:""]})]})]}),v.jsxs("div",{className:"flex items-center gap-2 shrink-0 ml-4",children:[v.jsx("button",{type:"button",onClick:()=>o(c.id),className:"rounded-md px-3 py-1.5 text-xs font-medium bg-primary text-primary-foreground hover:bg-primary/90 transition-colors",children:"Open"}),v.jsx("button",{type:"button",onClick:()=>m(c.id),disabled:u.has(c.id),className:"rounded-md px-3 py-1.5 text-xs font-medium text-destructive border border-destructive/30 hover:bg-destructive/10 transition-colors disabled:opacity-50",children:u.has(c.id)?"Closing...":"Close"})]})]},c.id))})]})}function kL(e){const t=Date.now()-new Date(e).getTime(),r=Math.floor(t/1e3);if(r<60)return"just now";const n=Math.floor(r/60);if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}const EL={pending:"bg-zinc-500/20 text-zinc-400",in_progress:"bg-blue-500/20 text-blue-400",completed:"bg-emerald-500/20 text-emerald-400",failed:"bg-red-500/20 text-red-400",paused:"bg-amber-500/20 text-amber-400",cancelled:"bg-zinc-500/20 text-zinc-500"};function Os({status:e}){return v.jsx("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${EL[e]??"bg-zinc-500/20 text-zinc-400"}`,children:e})}function Zi(e){if(!e)return"—";try{return new Date(e).toLocaleTimeString()}catch{return e}}function RL(){var k;const[e,t]=S.useState(null),[r,n]=S.useState({}),[s,o]=S.useState(!1),[u,i]=S.useState(null),[a,d]=S.useState(new Set),m=S.useCallback(async()=>{o(!0),i(null);try{const[b,w]=await Promise.all([fetch("/api/repair/tracker"),fetch("/api/pipeline-graph")]);if(!b.ok)throw new Error(`Tracker: HTTP ${b.status}`);const R=await b.json();if(t(R),w.ok){const T=await w.json(),M=T.data??T,O=(M==null?void 0:M.nd)??[],A={};O.forEach((F,U)=>{A[F.id]={phase:F.ph,index:U}}),n(A)}}catch(b){i(String(b))}finally{o(!1)}},[]),c=S.useCallback(async(b,w,R)=>{try{const T={agent_id:b,status:w};R&&(T.unit_id=R),await fetch("/api/repair/agent-status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)}),await m()}catch(T){i(String(T))}},[m]),g=S.useCallback(async b=>{try{await fetch("/api/repair/run-status",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:b})}),await m()}catch(w){i(String(w))}},[m]),y=S.useCallback(async()=>{try{await fetch("/api/poke-orchestrator",{method:"POST"})}catch(b){i(String(b))}},[]),C=S.useCallback(async(b,w)=>{try{await fetch("/api/resolve-intervention",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:b,response:w})}),await m()}catch(R){i(String(R))}},[m]),_=S.useCallback(async()=>{if(window.confirm("FULL RESET: This will reset ALL agents to pending AND clear all output data, interventions, and loop state. Continue?"))try{await fetch("/api/repair/full-reset",{method:"POST"}),await m()}catch(b){i(String(b))}},[m]),p=S.useCallback(b=>{d(w=>{const R=new Set(w);return R.has(b)?R.delete(b):R.add(b),R})},[]);function h({agentId:b,status:w,unitId:R}){return w==="pending"?null:v.jsxs("button",{type:"button",onClick:()=>c(b,"pending",R),className:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs bg-zinc-700 hover:bg-zinc-600 text-zinc-200 transition-colors",title:"Reset to pending (re-run)",children:[v.jsx(kC,{className:"h-3 w-3"})," Reset"]})}const l=(k=e==null?void 0:e.run)==null?void 0:k.status,f=(e==null?void 0:e.nodes)??{},x=(e==null?void 0:e.interventions)??[],E=Object.entries(f).sort(([b],[w])=>{const R=r[b],T=r[w];return R&&T?R.phase!==T.phase?R.phase-T.phase:R.index-T.index:R&&!T?-1:!R&&T?1:b.localeCompare(w)});return v.jsxs("div",{className:"max-w-4xl mx-auto py-8 px-6 space-y-6",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("h1",{className:"text-xl font-semibold text-foreground",children:"Repair"}),v.jsxs("button",{type:"button",onClick:m,disabled:s,className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-sm text-foreground hover:bg-zinc-800 transition-colors disabled:opacity-50",children:[v.jsx(bC,{className:`h-3.5 w-3.5 ${s?"animate-spin":""}`}),e?"Refresh":"Load Tracker"]})]}),u&&v.jsx("div",{className:"rounded-md bg-red-500/10 border border-red-500/30 px-4 py-3 text-sm text-red-400",children:u}),!e&&!s&&!u&&v.jsx("p",{className:"text-sm text-muted-foreground",children:'Click "Load Tracker" to fetch the current pipeline state.'}),e&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[v.jsxs("div",{className:"flex items-center justify-between mb-3",children:[v.jsx("h2",{className:"text-sm font-medium text-foreground",children:"Run Status"}),l&&v.jsx(Os,{status:l})]}),v.jsxs("div",{className:"flex flex-wrap gap-2",children:[l!=="in_progress"&&v.jsxs("button",{type:"button",onClick:()=>g("in_progress"),className:"inline-flex items-center gap-1.5 rounded-md bg-emerald-600 hover:bg-emerald-500 px-3 py-1.5 text-xs font-medium text-white transition-colors",children:[v.jsx(wC,{className:"h-3 w-3"})," Resume"]}),l==="in_progress"&&v.jsxs("button",{type:"button",onClick:()=>g("paused"),className:"inline-flex items-center gap-1.5 rounded-md bg-amber-600 hover:bg-amber-500 px-3 py-1.5 text-xs font-medium text-white transition-colors",children:[v.jsx(yC,{className:"h-3 w-3"})," Pause"]}),v.jsxs("button",{type:"button",onClick:y,className:"inline-flex items-center gap-1.5 rounded-md bg-blue-600 hover:bg-blue-500 px-3 py-1.5 text-xs font-medium text-white transition-colors",children:[v.jsx($C,{className:"h-3 w-3"})," Poke Orchestrator"]}),v.jsxs("button",{type:"button",onClick:_,className:"inline-flex items-center gap-1.5 rounded-md bg-red-800 hover:bg-red-700 px-3 py-1.5 text-xs font-medium text-white transition-colors",children:[v.jsx(jC,{className:"h-3 w-3"})," Full Reset"]})]})]}),v.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[v.jsxs("h2",{className:"text-sm font-medium text-foreground mb-3",children:["Agents (",Object.keys(f).length,")"]}),Object.keys(f).length===0?v.jsx("p",{className:"text-sm text-muted-foreground",children:"No agents in tracker."}):v.jsx("div",{className:"overflow-x-auto",children:v.jsxs("table",{className:"w-full text-sm",children:[v.jsx("thead",{children:v.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[v.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Agent"}),v.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Phase"}),v.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Status"}),v.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Triggered"}),v.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Completed"}),v.jsx("th",{className:"pb-2 font-medium",children:"Actions"})]})}),v.jsx("tbody",{children:E.map(([b,w])=>{var M;const R=w.units&&Object.keys(w.units).length>0,T=a.has(b);return v.jsx(PL,{agentId:b,agent:w,phase:(M=r[b])==null?void 0:M.phase,hasUnits:!!R,isExpanded:T,onToggle:()=>p(b),actions:v.jsx(h,{agentId:b,status:w.status}),unitActions:(O,A)=>v.jsx(h,{agentId:b,status:A,unitId:O})},b)})})]})})]}),v.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[v.jsxs("h2",{className:"text-sm font-medium text-foreground mb-3",children:["Interventions (",x.length,")"]}),x.length===0?v.jsx("p",{className:"text-sm text-muted-foreground",children:"No interventions."}):v.jsx("div",{className:"overflow-x-auto",children:v.jsxs("table",{className:"w-full text-sm",children:[v.jsx("thead",{children:v.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[v.jsx("th",{className:"pb-2 pr-3 font-medium",children:"ID"}),v.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Agent"}),v.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Type"}),v.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Status"}),v.jsx("th",{className:"pb-2 pr-3 font-medium",children:"Message"}),v.jsx("th",{className:"pb-2 font-medium",children:"Actions"})]})}),v.jsx("tbody",{children:x.map(b=>v.jsxs("tr",{className:"border-b border-border/50",children:[v.jsx("td",{className:"py-2 pr-3 font-mono text-xs text-muted-foreground",title:b.id,children:b.id.length>12?b.id.slice(0,12)+"...":b.id}),v.jsx("td",{className:"py-2 pr-3 font-mono text-xs",children:b.agent_id}),v.jsx("td",{className:"py-2 pr-3",children:v.jsx(Os,{status:b.type})}),v.jsx("td",{className:"py-2 pr-3",children:v.jsx(Os,{status:b.status})}),v.jsx("td",{className:"py-2 pr-3 text-xs text-muted-foreground max-w-[200px] truncate",title:b.message,children:b.message}),v.jsx("td",{className:"py-2",children:b.status==="pending"&&v.jsxs("div",{className:"flex gap-1.5",children:[v.jsx("button",{type:"button",onClick:()=>C(b.id,"continue"),className:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs bg-emerald-600 hover:bg-emerald-500 text-white transition-colors",children:"Continue"}),v.jsx("button",{type:"button",onClick:()=>C(b.id,"skip"),className:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs bg-zinc-700 hover:bg-zinc-600 text-zinc-200 transition-colors",children:"Skip"})]})})]},b.id))})]})})]})]})]})}function PL({agentId:e,agent:t,phase:r,hasUnits:n,isExpanded:s,onToggle:o,actions:u,unitActions:i}){return v.jsxs(v.Fragment,{children:[v.jsxs("tr",{className:"border-b border-border/50",children:[v.jsx("td",{className:"py-2 pr-3 font-mono text-xs",children:v.jsxs("div",{className:"flex items-center gap-1",children:[n&&v.jsx("button",{type:"button",onClick:o,className:"text-muted-foreground hover:text-foreground",children:s?v.jsx(Zu,{className:"h-3.5 w-3.5"}):v.jsx(cv,{className:"h-3.5 w-3.5"})}),e]})}),v.jsx("td",{className:"py-2 pr-3 text-xs text-muted-foreground",children:r??"—"}),v.jsx("td",{className:"py-2 pr-3",children:v.jsx(Os,{status:t.status})}),v.jsx("td",{className:"py-2 pr-3 text-xs text-muted-foreground",children:Zi(t.triggered_at)}),v.jsx("td",{className:"py-2 pr-3 text-xs text-muted-foreground",children:Zi(t.completed_at)}),v.jsx("td",{className:"py-2",children:u})]}),n&&s&&Object.entries(t.units).map(([a,d])=>v.jsxs("tr",{className:"border-b border-border/30 bg-zinc-900/30",children:[v.jsx("td",{className:"py-1.5 pr-3 pl-8 font-mono text-xs text-muted-foreground",children:a}),v.jsx("td",{className:"py-1.5 pr-3"}),v.jsx("td",{className:"py-1.5 pr-3",children:v.jsx(Os,{status:d.status})}),v.jsx("td",{className:"py-1.5 pr-3 text-xs text-muted-foreground",children:Zi(d.triggered_at)}),v.jsx("td",{className:"py-1.5 pr-3 text-xs text-muted-foreground",children:Zi(d.completed_at)}),v.jsx("td",{className:"py-1.5",children:i(a,d.status)})]},`${e}-${a}`))]})}function TL({onLogout:e}){const[t,r]=S.useState(null),[n,s]=S.useState(null),[o,u]=S.useState(null),[i,a]=S.useState(!0),[d,m]=S.useState(!1),[c,g]=S.useState(!1),[y,C]=S.useState("dashboard"),[_,p]=S.useState(null),[h,l]=S.useState(!1),[f,x]=S.useState(!1),[E,k]=S.useState([]),[b,w]=S.useState(!1),[R,T]=S.useState(null),[M,O]=S.useState(new Set),[A,F]=S.useState({}),[U,G]=S.useState({}),[K,B]=S.useState({}),P=async()=>{await fetch("/api/auth",{method:"DELETE"}),e()},N=S.useCallback($=>{switch($.type){case"tracker_update":s($.agents),w(!1),$.interventions&&k($.interventions);break;case"pipeline_stalled":w(!0);break;case"pipeline_completed":T("completed");break;case"run_status_change":T($.status);break;case"sessions_needing_attention":O(new Set($.agentIds));break;case"session_previews":F($.previews);break;case"workspace_setup_progress":B(V=>({...V,workspace_setup:{messages:$.messages,templateMatch:$.templateMatch}}));break;case"impl_prep_progress":B(V=>({...V,impl_prep:{messages:$.messages}}));break;case"post_impl_launch_progress":B(V=>({...V,post_impl_launch:{messages:$.messages,appUrl:$.appUrl}}));break;case"node_start_failed":G(V=>({...V,[$.agentId]:$.error}));break;case"llm_node_started":p($.sessionId),g(!0),x(!1);break;case"llm_node_stopped":x(!0);break}},[]);jd({onMessage:N}),S.useEffect(()=>{Promise.all([fetch("/api/pipeline-graph").then($=>$.json()),fetch("/api/pipeline-tracker").then($=>$.json()).catch(()=>null),fetch("/api/terminal-status").then($=>$.json()).catch(()=>({available:!1})),fetch("/api/active-llm-session").then($=>$.json()).catch(()=>null),fetch("/terminal/api/sessions/list").then($=>$.json()).catch(()=>({sessions:[]})),fetch("/api/node-errors").then($=>$.json()).catch(()=>[])]).then(([$,V,q,I,L,z])=>{const H=$.error?null:$.data??$;$.error?u($.error):r(H),V!=null&&V.agents&&s(V.agents),Array.isArray(V==null?void 0:V.interventions)&&k(V.interventions),V!=null&&V.runStatus&&T(V.runStatus);const Y=q.available===!0;m(Y),Y&&(I!=null&&I.sessionId)&&(p(I.sessionId),g(!0));const X=(L==null?void 0:L.sessions)??[];if(l(X.some(ne=>ne.active)),Array.isArray(z)){const ne={};for(const oe of z)oe.agentId&&oe.error&&(ne[oe.agentId]=oe.error);Object.keys(ne).length>0&&G(ne)}}).catch($=>u(String($))).finally(()=>a(!1))},[]);const j=S.useCallback(()=>{w(!1),fetch("/api/poke-orchestrator",{method:"POST"}).catch($=>console.error("Poke failed:",$))},[]),D=S.useCallback($=>{p($),g(!0)},[]),W=S.useCallback(($,V)=>{k(q=>q.filter(I=>I.id!==$)),fetch("/api/resolve-intervention",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:$,response:V})}).catch(q=>console.error("Failed to resolve intervention:",q))},[]);return v.jsxs("div",{className:"flex h-screen flex-col overflow-hidden",children:[v.jsx(eL,{}),v.jsxs("div",{className:"flex flex-1 min-h-0",children:[v.jsx(tL,{onLogout:P,terminalAvailable:d,activePage:y,onNavigate:C}),v.jsxs("main",{className:"flex-1 overflow-y-auto content-gradient",children:[y==="dashboard"&&v.jsxs("div",{className:"welcome-content",children:[v.jsx("h1",{children:"Welcome to LaunchPod"}),i?v.jsx("p",{className:"text-muted-foreground",children:"Loading pipeline graph..."}):o?v.jsx("p",{className:"text-destructive",children:o}):t?v.jsx(v.Fragment,{children:v.jsx(lL,{data:t,agentStatuses:n??void 0,interventions:E,onResolveIntervention:W,stalled:b,onPoke:j,attentionAgentIds:M,sessionPreviews:A,onOpenTerminal:D,podProgressStates:K,runStatus:R??void 0,nodeErrors:U})}):null]}),y==="terminal"&&v.jsx(CL,{}),y==="settings"&&v.jsx(pL,{}),y==="repair"&&v.jsx(RL,{})]})]}),d&&v.jsx(ax,{open:c,onClose:()=>g(!1),autoSessionId:_}),b&&v.jsx("button",{type:"button",onClick:j,className:"pipeline-poke-fab",title:"Poke orchestrator",children:v.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[v.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),v.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]})})]})}function NL(){return v.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[v.jsx("circle",{cx:"12",cy:"12",r:"10"}),v.jsx("circle",{cx:"12",cy:"12",r:"5.5"}),v.jsx("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor",stroke:"none"}),v.jsx("path",{d:"M12 12L19 7"})]})}function LL(){return v.jsxs("svg",{className:"h-3.5 w-3.5 shrink-0 text-[hsl(var(--primary))]",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:[v.jsx("circle",{cx:"12",cy:"12",r:"10"}),v.jsx("path",{d:"M2 12h20M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]})}function lx({connected:e,children:t}){const{resolvedTheme:r,setTheme:n}=S.useContext(Gu),[s,o]=S.useState(null);S.useEffect(()=>{let i=!0;return fetch("/api/radar/context").then(a=>a.json()).then(a=>{i&&o(a)}).catch(()=>{}),()=>{i=!1}},[]);const u=r==="dark"?"light":"dark";return v.jsxs("header",{className:"sticky top-0 z-40 flex h-14 items-center gap-2 border-b border-border bg-background px-4 shrink-0",children:[v.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-2.5",children:[v.jsx("span",{className:"h-6 w-6 shrink-0 text-[hsl(var(--primary))]",children:v.jsx(NL,{})}),v.jsx("span",{className:"hidden truncate text-base font-semibold tracking-tight sm:inline",children:"LaunchRadar"})]}),s&&v.jsxs("div",{className:"flex h-8 min-w-0 items-center gap-2 rounded-md border border-border px-2.5 text-xs",title:`${s.org} / ${s.project} · Course: ${s.course}`,children:[v.jsxs("span",{className:"hidden min-w-0 items-center gap-2 md:flex",children:[v.jsx(LL,{}),v.jsx("span",{className:"truncate font-medium text-[hsl(var(--primary))]",children:s.org}),v.jsx("span",{className:"shrink-0 opacity-40",children:"/"}),v.jsx("span",{className:"max-w-[14rem] truncate font-medium",children:s.project}),v.jsx("span",{className:"mx-0.5 h-4 w-px shrink-0 bg-border","aria-hidden":"true"})]}),v.jsx("span",{className:"hidden shrink-0 font-semibold uppercase tracking-wide text-muted-foreground sm:inline",children:"Course"}),v.jsx("span",{className:"font-medium text-[hsl(var(--primary))]",children:s.course})]}),v.jsxs("div",{className:"flex min-w-0 flex-1 items-center justify-end gap-2 sm:gap-3",children:[t,v.jsxs("span",{className:"flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground",title:e?"Connected":"Reconnecting…",children:[v.jsx("span",{className:`h-2 w-2 rounded-full ${e?"bg-emerald-500":"bg-zinc-500 animate-pulse"}`}),v.jsx("span",{className:"hidden lg:inline",children:e?"Connected":"Reconnecting…"})]}),v.jsx("button",{type:"button",onClick:()=>n(u),className:"flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground","aria-label":`Switch to ${u} mode`,children:r==="dark"?v.jsxs("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[v.jsx("circle",{cx:"12",cy:"12",r:"5"}),v.jsx("path",{d:"M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"})]}):v.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:v.jsx("path",{d:"M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"})})})]})]})}const AL={queued:"bg-zinc-500/15 text-zinc-300",analyzing:"bg-amber-500/15 text-amber-400 animate-pulse",analyzed:"bg-emerald-500/15 text-emerald-400",failed:"bg-red-500/15 text-red-400",handled:"bg-blue-500/15 text-blue-300",dismissed:"bg-zinc-500/15 text-zinc-500 opacity-60"};function DL(e){switch((e??"").toLowerCase()){case"bug":return"bg-red-500/15 text-red-400";case"idea":return"bg-sky-500/15 text-sky-400";case"cosmetic":return"bg-violet-500/15 text-violet-400";case"praise":return"bg-emerald-500/15 text-emerald-400";default:return"bg-zinc-500/15 text-zinc-400"}}function ML(e){const t=new Date(e).getTime(),r=Math.max(0,Math.floor((Date.now()-t)/1e3));return r<60?`${r}s ago`:r<3600?`${Math.floor(r/60)}m ago`:r<86400?`${Math.floor(r/3600)}h ago`:`${Math.floor(r/86400)}d ago`}function jL({ping:e,selected:t,relatedCount:r,onSelect:n,onHandle:s,onDismiss:o,onRestart:u,onResume:i,onRename:a,onRemove:d}){var E,k;const{context:m}=e,c=e.state==="handled"||e.state==="dismissed",g=e.state==="failed",y=!!e.analysisSessionId&&(e.state==="failed"||e.state==="analyzed"),C=((E=e.displayName)==null?void 0:E.trim())||((k=m==null?void 0:m.body)==null?void 0:k.trim())||e.title,[_,p]=S.useState(!1),[h,l]=S.useState(""),f=()=>{l(e.displayName??""),p(!0)},x=()=>{a(h),p(!1)};return v.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:b=>{b.key==="Enter"&&b.target===b.currentTarget&&n()},className:["w-full text-left rounded-lg border bg-card px-4 py-3 transition-colors cursor-pointer",t?"border-primary ring-1 ring-primary/40":"border-border hover:border-zinc-600",c?"opacity-70":""].join(" "),children:[v.jsxs("div",{className:"flex items-start justify-between gap-3",children:[_?v.jsx("input",{autoFocus:!0,value:h,onChange:b=>l(b.target.value),onClick:b=>b.stopPropagation(),onKeyDown:b=>{b.stopPropagation(),b.key==="Enter"&&x(),b.key==="Escape"&&p(!1)},onBlur:x,placeholder:"Session name…",className:"min-w-0 flex-1 rounded border border-border bg-background px-2 py-1 text-sm outline-none focus:border-primary/60"}):v.jsx("p",{className:"text-sm leading-snug line-clamp-2 min-w-0 flex-1",children:C}),v.jsxs("div",{className:"shrink-0 flex items-center gap-1.5",children:[v.jsx("span",{role:"button",tabIndex:0,onClick:b=>{b.stopPropagation(),f()},onKeyDown:b=>{b.key==="Enter"&&(b.stopPropagation(),f())},className:"text-zinc-500 hover:text-zinc-200 cursor-pointer text-xs",title:"Rename session",children:"✎"}),v.jsx("span",{role:"button",tabIndex:0,onClick:b=>{b.stopPropagation(),d()},onKeyDown:b=>{b.key==="Enter"&&(b.stopPropagation(),d())},className:"text-zinc-500 hover:text-red-400 cursor-pointer text-xs",title:"Remove from list",children:"✕"}),v.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-medium ${AL[e.state]}`,children:e.state})]})]}),v.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 text-[11px]",children:[e.ruleName&&v.jsxs("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full bg-primary/15 text-primary",title:"Capture rule that created this session",children:["⚙ ",e.ruleName]}),(m==null?void 0:m.severity)&&v.jsx("span",{className:`inline-flex items-center px-1.5 py-0.5 rounded ${DL(m.severity)}`,children:m.severity}),(m==null?void 0:m.componentName)&&v.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded bg-zinc-700/40 text-zinc-300 font-mono",children:m.componentName}),(m==null?void 0:m.route)&&v.jsx("span",{className:"text-zinc-500 truncate max-w-[180px]",title:m.route,children:m.route}),r>0&&v.jsxs("span",{className:"text-zinc-500",children:["· ",r," related"]}),v.jsx("span",{className:"text-zinc-600 ml-auto",children:ML(e.receivedAt)})]}),e.analysisSummary&&v.jsx("p",{className:"mt-2 text-[11px] text-zinc-400 line-clamp-2",children:e.analysisSummary}),e.state==="failed"&&e.analysisError&&v.jsxs("p",{className:"mt-2 text-[11px] text-red-400 line-clamp-2",children:["⚠ ",e.analysisError]}),!c&&v.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[y&&v.jsx("span",{role:"button",tabIndex:0,onClick:b=>{b.stopPropagation(),i()},onKeyDown:b=>{b.key==="Enter"&&(b.stopPropagation(),i())},className:"text-[11px] text-violet-400 hover:text-violet-300 cursor-pointer",title:"Re-attach via claude --resume — keeps conversation history",children:"resume"}),g&&v.jsx("span",{role:"button",tabIndex:0,onClick:b=>{b.stopPropagation(),u()},onKeyDown:b=>{b.key==="Enter"&&(b.stopPropagation(),u())},className:"text-[11px] text-emerald-400 hover:text-emerald-300 cursor-pointer",title:"Discard old session and spawn a fresh analyzer",children:"restart"}),v.jsx("span",{role:"button",tabIndex:0,onClick:b=>{b.stopPropagation(),s()},onKeyDown:b=>{b.key==="Enter"&&(b.stopPropagation(),s())},className:"text-[11px] text-zinc-400 hover:text-zinc-200 cursor-pointer",children:"mark handled"}),v.jsx("span",{role:"button",tabIndex:0,onClick:b=>{b.stopPropagation(),o()},onKeyDown:b=>{b.key==="Enter"&&(b.stopPropagation(),o())},className:"text-[11px] text-zinc-500 hover:text-red-400 cursor-pointer",children:"dismiss"})]})]})}function IL({pings:e,selectedId:t,onSelect:r,onHandle:n,onDismiss:s,onRestart:o,onResume:u,onRename:i,onRemove:a,emptyState:d}){const m=S.useMemo(()=>{const c=new Map;for(const g of e)c.set(g.threadId,(c.get(g.threadId)??0)+1);return c},[e]);return e.length===0?v.jsx("div",{className:"text-sm text-muted-foreground p-6",children:d}):v.jsx("ul",{className:"space-y-2 p-3 overflow-y-auto",children:e.map(c=>v.jsx("li",{children:v.jsx(jL,{ping:c,selected:c.id===t,relatedCount:(m.get(c.threadId)??1)-1,onSelect:()=>r(c.id),onHandle:()=>n(c.id),onDismiss:()=>s(c.id),onRestart:()=>o(c.id),onResume:()=>u(c.id),onRename:g=>i(c.id,g),onRemove:()=>a(c.id)})},c.id))})}const OL=2e3;function BL(e){const[t,r]=S.useState([]),[n,s]=S.useState("connecting"),[o,u]=S.useState(null),[i,a]=S.useState(!1),[d,m]=S.useState(null),[c,g]=S.useState(!1),y=S.useRef(new Set);return S.useEffect(()=>{if(y.current=new Set,r([]),u(null),m(null),g(!1),!e){s("connecting");return}s("connecting");const C=new EventSource(`/api/radar/transcript/${encodeURIComponent(e)}`);return C.addEventListener("hello",()=>s("waiting")),C.addEventListener("waiting",()=>s("waiting")),C.addEventListener("end",()=>s("ended")),C.addEventListener("error",_=>{try{if(_.data){const p=JSON.parse(_.data);p.message&&u(p.message)}}catch{}s("error")}),C.addEventListener("event",_=>{try{const p=JSON.parse(_.data);if(y.current.has(p.uuid))return;y.current.add(p.uuid),r(h=>[...h,p]),s("streaming")}catch(p){u(p instanceof Error?p.message:String(p))}}),C.addEventListener("meta",_=>{try{const p=JSON.parse(_.data);p.kind==="permission-mode"&&typeof p.mode=="string"?m(p.mode):p.kind==="pty-active"&&typeof p.active=="boolean"&&g(p.active)}catch{}}),()=>{C.close()}},[e]),S.useEffect(()=>{if(a(!1),t.length===0)return;const C=t[t.length-1];if(C.role!=="assistant"||C.blocks.length===0)return;const _=C.blocks[C.blocks.length-1];if(_.type!=="text"&&_.type!=="thinking")return;const p=setTimeout(()=>a(!0),OL);return()=>clearTimeout(p)},[t]),{events:t,status:n,error:o,awaitingInput:i,permissionMode:d,ptyActive:c}}function FL({sessionId:e,canReply:t,drawerOpen:r}){const{events:n,status:s,error:o,awaitingInput:u,permissionMode:i,ptyActive:a}=BL(e),d=S.useMemo(()=>QL(n,i),[n,i]),m=n.length>0,c=!!(t&&!r),g=!!(a&&t),y=S.useRef(null),C=S.useRef(!0),[_,p]=S.useState(!0),h=S.useCallback(()=>{const b=y.current;return b?b.scrollTop+b.clientHeight>=b.scrollHeight-60:!0},[]),l=S.useCallback(()=>{const b=h();C.current=b,p(b)},[h]),f=S.useCallback(()=>{const b=y.current;b&&(b.scrollTop=b.scrollHeight,C.current=!0,p(!0))},[]);S.useEffect(()=>{if(!C.current)return;const b=y.current;if(!b)return;const w=requestAnimationFrame(()=>{b.scrollTop=b.scrollHeight});return()=>cancelAnimationFrame(w)},[n]);const x=S.useMemo(()=>{const b=new Map;for(const w of n)for(const R of w.blocks)R.type==="tool_use"&&b.set(R.id,R.name);return b},[n]),E=S.useMemo(()=>{const b=new Map;for(const w of n)for(const R of w.blocks)R.type==="tool_result"&&R.toolUseId&&b.set(R.toolUseId,{content:R.content,isError:R.isError});return b},[n]);if(!e)return v.jsx("div",{className:"h-full flex items-center justify-center text-sm text-muted-foreground",children:"Select a ping to view its analysis."});const k=[];for(const b of n)b.blocks.forEach((w,R)=>{k.push({ev:b,block:w,key:`${b.uuid}:${R}`})});return v.jsxs("div",{className:"h-full flex flex-col min-h-0",children:[v.jsxs("div",{className:"px-4 py-2 border-b border-border flex items-center gap-3 text-xs text-muted-foreground shrink-0",children:[v.jsx($L,{status:s}),u&&t&&v.jsx("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-emerald-500/15 text-emerald-400 animate-pulse",children:"waiting for you"}),o&&v.jsx("span",{className:"text-red-400",children:o}),v.jsxs("span",{className:"ml-auto font-mono",children:[n.length," message",n.length===1?"":"s"]})]}),g&&v.jsxs("div",{className:"border-b border-amber-500/30 bg-amber-500/10 px-4 py-2 text-xs text-amber-300 shrink-0 flex items-center gap-2",children:[v.jsx("span",{className:"animate-pulse",children:"●"}),v.jsxs("span",{children:["Claude is rendering something in the terminal that hasn't been written to the transcript yet (usually an",v.jsx("span",{className:"font-mono",children:" AskUserQuestion"})," dialog).",v.jsx("span",{className:"ml-1 text-amber-200",children:"Use Show Terminal to see and answer."})]})]}),v.jsxs("div",{className:"flex-1 min-h-0 relative",children:[v.jsxs("div",{ref:y,onScroll:l,className:"absolute inset-0 overflow-y-auto overflow-x-hidden px-4 py-3 space-y-2",children:[k.length===0&&s==="waiting"&&v.jsx("div",{className:"text-sm text-muted-foreground text-center py-8",children:"Session starting · waiting for first message…"}),k.map(({ev:b,block:w,key:R})=>v.jsx(HL,{ev:b,block:w,toolNameById:x,toolResultById:E},R))]}),!_&&v.jsxs("button",{type:"button",onClick:f,className:"absolute bottom-3 right-4 z-10 px-3 py-1.5 text-xs font-medium rounded-full bg-emerald-500/25 text-emerald-200 hover:bg-emerald-500/40 backdrop-blur shadow-lg transition-colors flex items-center gap-1",children:[v.jsx("span",{children:"↓"}),v.jsx("span",{children:"Jump to bottom"})]})]}),m&&v.jsx(eA,{meta:d,drawerOpen:r}),c&&v.jsx(nA,{sessionId:e,disabled:!!r,awaitingInput:u})]})}function $L({status:e}){const t={connecting:"connecting…",waiting:"waiting",streaming:"streaming",ended:"ended",error:"error"}[e],r={connecting:"bg-zinc-500/15 text-zinc-300",waiting:"bg-amber-500/15 text-amber-400",streaming:"bg-emerald-500/15 text-emerald-400",ended:"bg-blue-500/15 text-blue-300",error:"bg-red-500/15 text-red-400"};return v.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full font-medium ${r[e]}`,children:t})}function HL({ev:e,block:t,toolNameById:r,toolResultById:n}){const s=e.isSidechain?"ml-6 border-l-2 border-violet-500/40 pl-3":"";switch(t.type){case"text":return e.role==="user"?v.jsx(zr,{tone:"user",sidechain:s,children:v.jsx(zL,{text:t.text})}):v.jsx(zr,{tone:"assistant",sidechain:s,children:v.jsx(WL,{text:t.text})});case"thinking":return v.jsx(zr,{tone:"thinking",sidechain:s,children:v.jsx(UL,{text:t.text})});case"tool_use":return t.name==="AskUserQuestion"?v.jsx(zr,{tone:"ask",sidechain:s,children:v.jsx(XL,{input:t.input,result:n.get(t.id)})}):v.jsx(zr,{tone:"tool",sidechain:s,children:v.jsx(VL,{name:t.name,input:t.input})});case"tool_result":return v.jsx(zr,{tone:"tool",sidechain:s,children:v.jsx(KL,{content:t.content,isError:t.isError,parentName:r.get(t.toolUseId)})});case"image":return v.jsx(zr,{tone:"user",sidechain:s,children:v.jsx("img",{src:`data:${t.mediaType};base64,${t.dataBase64}`,alt:"attachment",className:"max-w-full rounded border border-border"})})}}function zr({tone:e,sidechain:t,children:r}){const n={user:"border-emerald-500/30 bg-emerald-500/5",assistant:"border-border bg-zinc-500/5",thinking:"border-zinc-700/40 bg-zinc-500/5",tool:"border-amber-500/30 bg-amber-500/5",ask:"border-violet-500/40 bg-violet-500/5"}[e];return v.jsx("div",{className:`rounded border ${n} ${t}`,children:r})}function zL({text:e}){return v.jsxs("div",{className:"px-3 py-2",children:[v.jsx("div",{className:"text-[10px] uppercase tracking-wide text-emerald-400/70 mb-1",children:"User"}),v.jsx("div",{className:"text-sm whitespace-pre-wrap break-words",children:e})]})}function WL({text:e}){return v.jsxs("div",{className:"px-3 py-2",children:[v.jsx("div",{className:"text-[10px] uppercase tracking-wide text-zinc-400 mb-1",children:"Claude"}),v.jsx("div",{className:"text-sm whitespace-pre-wrap break-words",children:e})]})}function UL({text:e}){const[t,r]=S.useState(!1),n=e.split(`
292
+ `).length;return v.jsxs("div",{className:"px-3 py-2",children:[v.jsxs("button",{type:"button",onClick:()=>r(s=>!s),className:"text-[10px] uppercase tracking-wide text-zinc-500 hover:text-zinc-300 flex items-center gap-1",children:[v.jsx("span",{children:t?"▾":"▸"}),v.jsxs("span",{children:["Thinking · ",n," line",n===1?"":"s"]})]}),t&&v.jsx("div",{className:"text-xs whitespace-pre-wrap break-words text-zinc-400 italic mt-2 font-mono",children:e})]})}function VL({name:e,input:t}){const[r,n]=S.useState(!1),s=GL(e,t),o=S.useMemo(()=>ea(t),[t]);return v.jsxs("div",{className:"px-3 py-2",children:[v.jsxs("button",{type:"button",onClick:()=>n(u=>!u),className:"w-full text-left flex items-baseline gap-2 min-w-0",children:[v.jsx("span",{className:"text-[10px] uppercase tracking-wide text-amber-400/80 shrink-0",children:r?"▾":"▸"}),v.jsx("span",{className:"text-sm font-medium text-amber-300 font-mono shrink-0",children:e}),v.jsx("span",{className:"text-xs text-zinc-400 font-mono truncate flex-1 min-w-0",children:s})]}),r&&v.jsx("pre",{className:"mt-2 text-xs text-zinc-300 font-mono whitespace-pre-wrap break-words bg-black/30 rounded p-2 max-h-96 overflow-y-auto",children:o})]})}function KL({content:e,isError:t,parentName:r}){const[n,s]=S.useState(!1),o=typeof e=="string"?e:ea(e),u=o.split(`
293
+ `).slice(0,1).join("").trim(),i=o.split(`
294
+ `).length,a=u.length>140?u.slice(0,140)+"…":u;return v.jsxs("div",{className:"px-3 py-2",children:[v.jsxs("button",{type:"button",onClick:()=>s(d=>!d),className:"w-full text-left flex items-baseline gap-2 min-w-0",children:[v.jsx("span",{className:"text-[10px] uppercase tracking-wide text-amber-400/80 shrink-0",children:n?"▾":"▸"}),v.jsxs("span",{className:`text-[10px] uppercase tracking-wide font-mono shrink-0 ${t?"text-red-400":"text-zinc-500"}`,children:["↳ ",r??"result",t?" · error":""," · ",i," line",i===1?"":"s"]}),v.jsx("span",{className:"text-xs text-zinc-400 font-mono truncate flex-1 min-w-0",children:a})]}),n&&v.jsx("pre",{className:"mt-2 text-xs text-zinc-300 font-mono whitespace-pre-wrap break-words bg-black/30 rounded p-2 max-h-96 overflow-y-auto",children:o})]})}function GL(e,t){if(!t||typeof t!="object")return"";const r=t;if(typeof r.command=="string")return r.command;if(typeof r.file_path=="string")return r.file_path;if(typeof r.path=="string")return r.path;if(typeof r.pattern=="string")return r.pattern;if(typeof r.query=="string")return r.query;if(typeof r.url=="string")return r.url;if(typeof r.description=="string")return r.description;for(const n of Object.values(r))if(typeof n=="string")return n;return`(${e})`}function ea(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function qL(e){if(!e||typeof e!="object")return!1;const t=e.questions;return Array.isArray(t)&&t.every(r=>r&&typeof r=="object"&&typeof r.question=="string"&&Array.isArray(r.options))}function XL({input:e,result:t}){if(!qL(e))return v.jsxs("div",{className:"px-3 py-2",children:[v.jsx("div",{className:"text-[10px] uppercase tracking-wide text-violet-300/80 mb-1",children:"AskUserQuestion"}),v.jsx("pre",{className:"text-xs text-zinc-300 font-mono whitespace-pre-wrap break-words bg-black/30 rounded p-2 max-h-80 overflow-y-auto",children:ea(e)})]});const r=!!t,n=t?typeof t.content=="string"?t.content:ea(t.content):null;return v.jsxs("div",{className:"px-3 py-2 space-y-3",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-[10px] uppercase tracking-wide text-violet-300/80",children:"AskUserQuestion"}),r&&v.jsx("span",{className:`text-[10px] uppercase tracking-wide px-1.5 py-0.5 rounded ${t!=null&&t.isError?"bg-amber-500/15 text-amber-300":"bg-emerald-500/15 text-emerald-300"}`,children:t!=null&&t.isError?"rejected":"answered"})]}),e.questions.map((s,o)=>v.jsx(YL,{q:s,answered:r,resultText:n},o)),r&&n&&v.jsxs("details",{className:"text-xs",children:[v.jsx("summary",{className:"cursor-pointer text-violet-300/80 hover:text-violet-200",children:"▸ user response"}),v.jsx("pre",{className:"mt-2 text-xs text-zinc-300 font-mono whitespace-pre-wrap break-words bg-black/30 rounded p-2 max-h-80 overflow-y-auto",children:n})]}),!r&&v.jsx("div",{className:"text-[11px] text-violet-300/70 border-t border-violet-500/20 pt-2",children:"Read-only preview · use Show Terminal to answer."})]})}function YL({q:e,answered:t,resultText:r}){return v.jsxs("div",{className:"space-y-1.5",children:[v.jsxs("div",{className:"text-sm font-medium text-zinc-100",children:[e.header&&v.jsx("span",{className:"text-[10px] uppercase tracking-wide text-violet-300/70 mr-2",children:e.header}),e.question]}),v.jsx("div",{className:"space-y-1",children:e.options.map((n,s)=>{const o=!!r&&JL(n.label,r);return v.jsxs("label",{className:`flex items-start gap-2 rounded px-2 py-1.5 text-sm cursor-default ${t?"":"opacity-70"} ${o?"bg-violet-500/15 ring-1 ring-violet-400/40":""}`,children:[v.jsx("input",{type:e.multiSelect?"checkbox":"radio",name:`q${e.question.slice(0,24)}`,checked:o,readOnly:!0,disabled:!0,className:"mt-1 accent-violet-400"}),v.jsxs("span",{className:"min-w-0",children:[v.jsx("span",{className:"text-zinc-100",children:n.label}),n.description&&v.jsx("span",{className:"block text-xs text-zinc-400 mt-0.5",children:n.description})]})]},s)})})]})}function JL(e,t){return e?t.includes(`"${e}"`)||t.includes(`= ${e}`)||t.includes(`: ${e}`):!1}function QL(e,t){var u;let r=null,n=null,s=null,o=null;for(let i=e.length-1;i>=0;i--){const a=e[i];if(!r&&a.cwd&&(r=a.cwd.split("/").filter(Boolean).pop()??a.cwd),!n&&a.gitBranch&&(n=a.gitBranch),!s&&((u=a.usage)!=null&&u.model)&&(s=a.usage.model),o===null&&a.usage){const d=(a.usage.inputTokens??0)+(a.usage.cacheReadTokens??0)+(a.usage.cacheCreationTokens??0),m=ZL(a.usage.model);d>0&&m>0&&(o=Math.min(100,Math.round(d/m*100)))}if(r&&n&&s&&o!==null)break}return{cwdLabel:r,gitBranch:n,model:s,contextPct:o,permissionMode:t}}function ZL(e){return e&&/\[1m\]/i.test(e)?1e6:2e5}function eA({meta:e,drawerOpen:t}){const r=[];return e.cwdLabel&&r.push({label:"cwd",value:e.cwdLabel}),e.gitBranch&&r.push({label:"git",value:`⌥ ${e.gitBranch}`}),e.contextPct!==null&&r.push({label:"ctx",value:`~${e.contextPct}%`}),e.permissionMode&&r.push({label:"perm",value:tA(e.permissionMode)}),e.model&&r.push({label:"model",value:rA(e.model)}),r.length===0?null:v.jsx("div",{className:`border-t border-border px-4 py-1.5 shrink-0 text-[11px] font-mono text-muted-foreground flex items-center gap-3 overflow-hidden ${t?"opacity-50":""}`,children:r.map((n,s)=>v.jsxs("span",{className:"truncate min-w-0",children:[v.jsxs("span",{className:"text-zinc-500",children:[n.label,":"]})," ",v.jsx("span",{className:"text-zinc-300",children:n.value})]},s))})}function tA(e){switch(e){case"bypassPermissions":return"bypass";case"acceptEdits":return"accept-edits";case"plan":return"plan";case"default":return"default";default:return e}}function rA(e){const t=e.match(/(?:claude-)?(opus|sonnet|haiku)-(\d+-\d+)(?:-\d+)?(\[1m\])?/i);return t?`${t[1].toLowerCase()}-${t[2]}${t[3]??""}`:e}function nA({sessionId:e,disabled:t,awaitingInput:r}){const[n,s]=S.useState(""),[o,u]=S.useState(!1),[i,a]=S.useState(null),[d,m]=S.useState(0),c=S.useRef(null);S.useEffect(()=>{if(d<=0)return;const h=setTimeout(()=>m(l=>Math.max(0,l-1)),1e3);return()=>clearTimeout(h)},[d]),S.useEffect(()=>{r&&!n&&c.current&&document.activeElement!==c.current&&c.current.focus()},[r,n]),S.useEffect(()=>{const h=c.current;h&&(h.style.height="auto",h.style.height=Math.min(160,h.scrollHeight)+"px")},[n]);const g=async()=>{const h=n.trim();if(!(!e||!h||o)){u(!0),a(null);try{const l=await fetch(`/api/radar/input/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:h})}),f=l.headers.get("content-type")??"";if(!f.includes("application/json"))throw new Error(`endpoint not found on server (got ${l.status} ${f||"no content-type"}). restart radar to load the new bundle.`);const x=await l.json().catch(()=>null);if(!l.ok||(x==null?void 0:x.ok)!==!0)throw new Error((x==null?void 0:x.error)??`HTTP ${l.status}`);s("")}catch(l){a(l instanceof Error?l.message:String(l))}finally{u(!1)}}},y=t||!e,C=!y&&!r,_=y||o||d>0,p=async()=>{if(!(!e||_)){m(5),a(null);try{const h=await fetch(`/api/radar/interrupt/${encodeURIComponent(e)}`,{method:"POST"}),l=h.headers.get("content-type")??"";if(!l.includes("application/json"))throw new Error(`endpoint not found on server (got ${h.status} ${l||"no content-type"}). restart radar to load the new bundle.`);const f=await h.json().catch(()=>null);if(!h.ok||(f==null?void 0:f.ok)!==!0)throw new Error((f==null?void 0:f.error)??`HTTP ${h.status}`)}catch(h){a(h instanceof Error?h.message:String(h))}}};return v.jsxs("div",{className:"border-t border-border bg-background/40 px-3 py-2 shrink-0 flex flex-col gap-1",children:[v.jsxs("div",{className:"flex items-end gap-2",children:[v.jsx("textarea",{ref:c,value:n,onChange:h=>s(h.target.value),onKeyDown:h=>{h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),g())},placeholder:y?t?"Terminal is open — close it to use the textbox":"No active session":r?"Reply to Claude…":"Type ahead — Claude will pick it up after the current turn",disabled:y||o,rows:1,className:"flex-1 min-w-0 resize-none rounded border border-border bg-background px-3 py-1.5 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-emerald-500/50 disabled:opacity-50"}),C&&v.jsx("button",{type:"button",onClick:()=>void p(),disabled:_,title:d>0?`wait ${d}s before another stop`:"Send Ctrl+C to interrupt Claude",className:"px-3 py-1.5 text-xs font-medium rounded bg-amber-500/20 text-amber-300 hover:bg-amber-500/35 disabled:opacity-40 disabled:hover:bg-amber-500/20 transition-colors shrink-0",children:d>0?`stop · ${d}s`:"Stop"}),v.jsx("button",{type:"button",onClick:()=>void g(),disabled:y||o||!n.trim(),className:"px-4 py-1.5 text-xs font-medium rounded bg-emerald-500/25 text-emerald-200 hover:bg-emerald-500/40 disabled:opacity-40 disabled:hover:bg-emerald-500/25 transition-colors shrink-0",children:o?"sending…":"Send"})]}),i&&v.jsxs("span",{className:"text-[11px] text-red-400",children:["send failed: ",i]})]})}const sA=2e3;function iA(){const[e,t]=S.useState("starting"),[r,n]=S.useState(null),[s,o]=S.useState([]),[u,i]=S.useState(!1),a=S.useRef(null),d=S.useRef(!1);S.useEffect(()=>{d.current=!1;const l=()=>{const f=window.location.protocol==="https:"?"wss:":"ws:",x=new WebSocket(`${f}//${window.location.host}/api/radar/stream`);a.current=x,x.onopen=()=>i(!0),x.onmessage=E=>{let k;try{k=JSON.parse(typeof E.data=="string"?E.data:"")}catch{return}k.type==="snapshot"?(t(k.status),n(k.authError??null),o(k.pings)):k.type==="ping"?o(b=>b.some(w=>w.id===k.ping.id)?b:[k.ping,...b]):k.type==="ping_state"?o(b=>{const w=b.findIndex(T=>T.id===k.ping.id);if(w===-1)return[k.ping,...b];const R=b.slice();return R[w]=k.ping,R}):k.type==="status"&&(t(k.status),n(k.authError??null))},x.onclose=()=>{i(!1),!d.current&&setTimeout(l,sA)},x.onerror=()=>{try{x.close()}catch{}}};return l(),()=>{var f;d.current=!0;try{(f=a.current)==null||f.close()}catch{}}},[]);const m=S.useCallback(async(l,f)=>{await fetch(`/api/radar/ping/${encodeURIComponent(l)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:f})})},[]),c=S.useCallback(l=>m(l,"handled"),[m]),g=S.useCallback(l=>m(l,"dismissed"),[m]),y=S.useCallback(l=>m(l,"restart"),[m]),C=S.useCallback(l=>m(l,"resume"),[m]),_=S.useCallback(async(l,f)=>{await fetch(`/api/radar/session/${encodeURIComponent(l)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:f})})},[]),p=S.useCallback(async l=>{await fetch(`/api/radar/session/${encodeURIComponent(l)}`,{method:"DELETE"})},[]),h=S.useCallback(async l=>{await fetch("/api/radar/sessions/clear",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope:l})})},[]);return{status:e,authError:r,pings:s,connected:u,markHandled:c,dismiss:g,restart:y,resume:C,rename:_,remove:p,clear:h}}const ep="radar.listCollapsed";function oA(e){switch(e){case"starting":return{text:"starting…",tone:"wait"};case"tunneling":return{text:"opening tunnel…",tone:"wait"};case"registering":return{text:"registering…",tone:"wait"};case"pending":return{text:"pending approval",tone:"wait"};case"live":return{text:"listening",tone:"live"};case"deactivated":return{text:"deactivated",tone:"stop"};case"error":return{text:"error",tone:"err"}}}const aA={wait:"bg-amber-500/15 text-amber-400",live:"bg-emerald-500/15 text-emerald-400",stop:"bg-zinc-500/20 text-zinc-300",err:"bg-red-500/15 text-red-400"};function lA(e){var t;return[e.displayName,e.title,(t=e.context)==null?void 0:t.body,e.ruleName,e.state,e.analysisSummary].filter(Boolean).join(" ").toLowerCase()}function tp(){const{status:e,authError:t,pings:r,connected:n,markHandled:s,dismiss:o,restart:u,resume:i,rename:a,remove:d,clear:m}=iA(),c=Ku(),{pingId:g}=pb(),y=g??null,[C,_]=S.useState(""),[p,h]=S.useState(()=>{try{return localStorage.getItem(ep)==="1"}catch{return!1}}),[l,f]=S.useState(!1),[x,E]=S.useState(!1),k=oA(e),b=()=>{h(K=>{const B=!K;try{localStorage.setItem(ep,B?"1":"0")}catch{}return B})};S.useEffect(()=>{f(!1),E(!1)},[y]);const w=K=>c(`/session/${encodeURIComponent(K)}`),R=S.useMemo(()=>{const K=C.trim().toLowerCase();return K?r.filter(B=>lA(B).includes(K)):r},[r,C]),T=S.useMemo(()=>r.filter(K=>K.state==="handled"||K.state==="dismissed").length,[r]),M=K=>{d(K),K===y&&c("/")},O=K=>{K==="all"&&!window.confirm("Remove all sessions? In-flight analyses are kept.")||(m(K),y&&c("/"))},A=y?r.find(K=>K.id===y)??null:null,F=(A==null?void 0:A.analysisSessionId)??null,U=()=>{E(!0),f(!0)},G=e==="live"?"No pings yet. Waiting…":e==="pending"?"Webhook pending approval. Approve it in LaunchSecure to start receiving pings.":e==="deactivated"?"Webhook deactivated. Restart LaunchPod to register again.":"Starting up…";return v.jsxs("div",{className:"h-screen flex flex-col bg-background text-foreground",children:[v.jsxs(lx,{connected:n,children:[v.jsx("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${aA[k.tone]}`,children:k.text}),v.jsxs("span",{className:"hidden sm:inline text-xs text-muted-foreground",children:[r.length," ping",r.length===1?"":"s"]}),v.jsx("button",{type:"button",onClick:()=>c("/config"),className:"px-2.5 py-1 text-xs font-medium rounded-full transition-colors bg-zinc-500/15 text-zinc-300 hover:bg-zinc-500/25",title:"Edit capture rules",children:"⚙ Config"})]}),t&&v.jsxs("div",{className:"shrink-0 border-b border-red-500/30 bg-red-500/10 px-6 py-2.5 flex items-start gap-2",children:[v.jsx("span",{className:"text-red-400 mt-px",children:"⚠"}),v.jsxs("div",{className:"min-w-0",children:[v.jsx("p",{className:"text-sm font-medium text-red-300",children:"Claude authentication failed"}),v.jsx("p",{className:"text-xs text-red-400/90 mt-0.5 break-words",children:t})]})]}),v.jsxs("div",{className:"flex-1 grid min-h-0",style:{gridTemplateColumns:p?"2.25rem minmax(0,1fr)":"minmax(320px,28rem) minmax(0,1fr)"},children:[p?v.jsxs("aside",{className:"border-r border-border flex flex-col items-center gap-3 pt-3 text-muted-foreground",children:[v.jsx("button",{type:"button",onClick:b,className:"text-base hover:text-foreground",title:"Show sessions",children:"›"}),v.jsx("span",{className:"text-[10px] [writing-mode:vertical-rl] rotate-180 tracking-wide",children:"sessions"})]}):v.jsxs("aside",{className:"border-r border-border min-h-0 overflow-hidden flex flex-col",children:[v.jsxs("div",{className:"flex items-center gap-2 px-3 pt-3 pb-1 shrink-0",children:[v.jsx("input",{type:"text",value:C,onChange:K=>_(K.target.value),placeholder:"Search name, rule, state…",className:"flex-1 min-w-0 rounded-md border border-border bg-card px-2.5 py-1.5 text-xs outline-none focus:border-primary/60"}),v.jsx("button",{type:"button",onClick:b,className:"shrink-0 text-muted-foreground hover:text-foreground text-base px-1",title:"Hide sessions",children:"‹"})]}),r.length>0&&v.jsxs("div",{className:"flex items-center gap-3 px-3 pb-1.5 text-[11px] text-muted-foreground shrink-0",children:[v.jsxs("span",{children:[r.length," session",r.length===1?"":"s"]}),T>0&&v.jsxs("button",{type:"button",onClick:()=>O("handled"),className:"hover:text-foreground",title:"Remove handled + dismissed sessions",children:["Clear handled (",T,")"]}),v.jsx("button",{type:"button",onClick:()=>O("all"),className:"ml-auto hover:text-red-400",title:"Remove all (in-flight analyses are kept)",children:"Clear all"})]}),v.jsx(IL,{pings:R,selectedId:y,onSelect:w,onHandle:K=>{s(K)},onDismiss:K=>{o(K)},onRestart:K=>{u(K)},onResume:K=>{i(K)},onRename:(K,B)=>{a(K,B)},onRemove:M,emptyState:C.trim()?"No sessions match your search.":G})]}),v.jsx("main",{className:"min-h-0 relative flex flex-col",children:A?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"border-b border-border px-3 py-1.5 flex items-center justify-between gap-2 shrink-0 bg-background/50 min-h-[34px]",children:[v.jsxs("div",{className:"min-w-0 flex items-center gap-2 text-xs text-muted-foreground",children:[v.jsx("span",{className:"truncate font-medium text-foreground",children:A.displayName||A.title}),A.ruleName&&v.jsxs("span",{className:"shrink-0 inline-flex items-center px-1.5 py-0.5 rounded-full bg-primary/15 text-primary text-[10px]",children:["⚙ ",A.ruleName]})]}),A.state==="analyzing"&&v.jsx("button",{type:"button",onClick:U,className:"shrink-0 px-3 py-1 text-xs font-medium rounded-full transition-colors bg-zinc-500/15 text-zinc-300 hover:bg-zinc-500/25",children:"Show Terminal"})]}),v.jsx("div",{className:"flex-1 min-h-0",children:v.jsx(FL,{sessionId:F,canReply:A.state==="analyzing",drawerOpen:l})})]}):v.jsx("div",{className:"h-full flex items-center justify-center text-sm text-muted-foreground",children:y?"Session not found.":"Select a session to view its analysis."})})]}),A&&x&&v.jsx(ax,{open:l,onClose:()=>f(!1),autoSessionId:F},A.id)]})}const rp=["NONE","LOW","MEDIUM","HIGH","URGENT"],Bd=[{value:"COMMENT_CREATED",label:"Comment created",fields:[{key:"tags",label:"Tags",kind:"text"},{key:"linkedResourceType",label:"Linked type",kind:"enum",options:["feedback","bug"]}]},{value:"work_item.created",label:"Work item created",fields:[{key:"boardName",label:"Board",kind:"board"},{key:"columnName",label:"Column",kind:"column"},{key:"priority",label:"Priority",kind:"enum",options:rp}]},{value:"work_item.moved",label:"Work item moved",fields:[{key:"boardName",label:"Board",kind:"board"},{key:"toColumnName",label:"To column",kind:"column"},{key:"fromColumnName",label:"From column",kind:"column"}]},{value:"work_item.priority_changed",label:"Work item priority changed",fields:[{key:"boardName",label:"Board",kind:"board"},{key:"toPriority",label:"New priority",kind:"enum",options:rp},{key:"columnName",label:"Column",kind:"column"}]},{value:"work_item.assigned",label:"Work item assigned",fields:[{key:"boardName",label:"Board",kind:"board"},{key:"columnName",label:"Column",kind:"column"},{key:"assignedUserId",label:"Assignee (user id)",kind:"user"}]}],_n="__custom__",qc=e=>Bd.find(t=>t.value===e),cx=(e,t)=>{var r;return(r=qc(e))==null?void 0:r.fields.find(n=>n.key===t)},np=e=>Bd.some(t=>t.value===e),cA=(e,t)=>!!cx(e,t),ux=["eq","in","contains"],vo="h-8 rounded-md border border-border bg-background px-2.5 text-xs outline-none transition-colors focus:border-primary/60 focus:ring-2 focus:ring-primary/20",eo=`${vo} font-mono`;function uA({values:e,options:t,onChange:r,placeholder:n}){const[s,o]=S.useState(""),u=S.useId(),i=m=>{var c;return((c=t.find(g=>g.value===m))==null?void 0:c.label)??m},a=m=>{const c=m.trim();if(!c)return;const g=t.find(C=>C.label.toLowerCase()===c.toLowerCase()),y=g?g.value:c;e.includes(y)||r([...e,y]),o("")},d=m=>r(e.filter(c=>c!==m));return v.jsxs("div",{className:"flex-1 min-w-0 min-h-8 flex flex-wrap items-center gap-1 rounded-md border border-border bg-background px-1.5 py-1 transition-colors focus-within:border-primary/60 focus-within:ring-2 focus-within:ring-primary/20",children:[e.map(m=>v.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-primary/15 text-primary px-1.5 py-0.5 text-[11px]",children:[i(m),v.jsx("button",{type:"button",onClick:()=>d(m),className:"text-primary/70 hover:text-red-400",title:"Remove",children:"✕"})]},m)),v.jsx("input",{list:u,value:s,onChange:m=>o(m.target.value),onKeyDown:m=>{m.key==="Enter"||m.key===","?(m.preventDefault(),a(s)):m.key==="Backspace"&&!s&&e.length&&d(e[e.length-1])},onBlur:()=>a(s),placeholder:e.length?"":n??"add…",className:"flex-1 min-w-[60px] bg-transparent outline-none text-xs"}),t.length>0&&v.jsx("datalist",{id:u,children:t.filter(m=>!e.includes(m.value)).map(m=>v.jsx("option",{value:m.label,children:m.label!==m.value?m.value:void 0},m.value))})]})}function sp(e){return{id:e.id,name:e.name,enabled:e.enabled,trigger:e.trigger,filters:(e.filters??[]).map(t=>({field:t.field,op:ux.includes(t.op)?t.op:"eq",value:Array.isArray(t.value)?t.value.join(", "):String(t.value??"")})),enrich:e.enrich??!0,prompt:e.prompt??""}}function dA(e){return e.map(t=>({id:t.id,name:t.name,enabled:t.enabled,trigger:t.trigger,enrich:t.enrich,prompt:t.prompt,filters:t.filters.map(r=>({field:r.field,op:r.op,value:r.op==="in"&&r.value.includes(",")?r.value.split(",").map(n=>n.trim()).filter(Boolean):r.value}))}))}function hA(){return`rule-${typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID().slice(0,8):Math.floor(Math.random()*1e9).toString(36)}`}function ip({checked:e,onChange:t,label:r,title:n}){return v.jsxs("button",{type:"button",role:"switch","aria-checked":e,onClick:()=>t(!e),title:n,className:`inline-flex shrink-0 items-center gap-1.5 text-xs select-none transition-colors ${e?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[v.jsx("span",{className:`relative inline-flex h-4 w-7 items-center rounded-full transition-colors ${e?"bg-primary":"bg-zinc-600"}`,children:v.jsx("span",{className:`inline-block h-3 w-3 rounded-full bg-white transition-transform ${e?"translate-x-[15px]":"translate-x-[2px]"}`})}),r]})}function fA(){return v.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[v.jsx("path",{d:"M3 6h18M8 6V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v2m2 0v14a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V6"}),v.jsx("path",{d:"M10 11v6M14 11v6"})]})}function pA(){const e=Ku(),[t,r]=S.useState([]),[n,s]=S.useState(!0),[o,u]=S.useState(!1),[i,a]=S.useState(null),[d,m]=S.useState(!1);S.useEffect(()=>{let b=!0;return fetch("/api/radar/config").then(w=>w.json()).then(w=>{b&&(r((w.rules??[]).map(sp)),s(!1))}).catch(w=>{b&&(a(`Failed to load rules: ${w.message}`),s(!1))}),()=>{b=!1}},[]);const[c,g]=S.useState(null);S.useEffect(()=>{if(c===null)return;const b=w=>{w.key==="Escape"&&g(null)};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[c]);const[y,C]=S.useState({tags:[],users:[],boards:[],columns:[]});S.useEffect(()=>{fetch("/api/radar/field-options").then(b=>b.json()).then(b=>C({tags:b.tags??[],users:b.users??[],boards:b.boards??[],columns:b.columns??[]})).catch(()=>{})},[]);const _=(b,w)=>{const R=cx(b,w);return R?R.kind==="enum"?(R.options??[]).map(T=>({value:T,label:T})):R.kind==="user"?y.users.map(T=>({value:T.id,label:T.name})):R.kind==="board"?y.boards.map(T=>({value:T,label:T})):R.kind==="column"?y.columns.map(T=>({value:T,label:T})):w==="tags"?y.tags.filter(T=>!/^\d+$/.test(T)).sort((T,M)=>T.localeCompare(M)).map(T=>({value:T,label:T})):[]:[]},p=(b,w)=>{m(!1),r(R=>R.map((T,M)=>M===b?{...T,...w}:T))},h=(b,w,R)=>{m(!1),r(T=>T.map((M,O)=>O!==b?M:{...M,filters:M.filters.map((A,F)=>F===w?{...A,...R}:A)}))},l=b=>{var R,T;const w=((T=(R=qc(t[b].trigger))==null?void 0:R.fields[0])==null?void 0:T.key)??"";p(b,{filters:[...t[b].filters,{field:w,op:"eq",value:""}]})},f=(b,w)=>r(R=>R.map((T,M)=>M!==b?T:{...T,filters:T.filters.filter((O,A)=>A!==w)})),x=()=>{m(!1),r(b=>[...b,{id:hA(),name:"New rule",enabled:!0,trigger:"COMMENT_CREATED",filters:[],enrich:!0,prompt:""}])},E=b=>{m(!1),r(w=>w.filter((R,T)=>T!==b))},k=()=>{u(!0),a(null),m(!1),fetch("/api/radar/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({rules:dA(t)})}).then(async b=>{const w=await b.json().catch(()=>({}));if(!b.ok||w.ok===!1)throw new Error(w.error||`HTTP ${b.status}`);Array.isArray(w.rules)&&r(w.rules.map(sp)),m(!0)}).catch(b=>a(b.message)).finally(()=>u(!1))};return v.jsxs("div",{className:"h-screen flex flex-col bg-background text-foreground",children:[v.jsxs(lx,{connected:!n,children:[d&&v.jsx("span",{className:"text-xs text-emerald-400",children:"saved ✓"}),i&&v.jsx("span",{className:"hidden md:inline text-xs text-red-400 max-w-[320px] truncate",title:i,children:i}),v.jsx("button",{type:"button",onClick:()=>e("/"),className:"px-2.5 py-1 text-xs font-medium rounded-full transition-colors bg-zinc-500/15 text-zinc-300 hover:bg-zinc-500/25",title:"Back to sessions",children:"‹ Sessions"}),v.jsx("button",{type:"button",onClick:x,className:"px-2.5 py-1 text-xs font-medium rounded-full bg-zinc-500/15 text-zinc-300 hover:bg-zinc-500/25",children:"+ Add rule"}),v.jsx("button",{type:"button",onClick:k,disabled:o||n,className:"px-2.5 py-1 text-xs font-medium rounded-full bg-primary/20 text-primary hover:bg-primary/30 disabled:opacity-50",children:o?"Saving…":"↑ Save to cloud"})]}),v.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto px-6 py-4",children:[v.jsxs("div",{className:"flex items-baseline gap-2 mb-4",children:[v.jsx("h1",{className:"text-lg font-semibold",children:"Capture rules"}),v.jsx("span",{className:"text-xs text-muted-foreground",children:"pulled from cloud"})]}),n?v.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading rules…"}):v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-5 items-start",children:[t.map((b,w)=>v.jsxs("div",{className:`relative overflow-hidden rounded-xl border bg-card transition-all ${b.enabled?"border-border shadow-sm hover:shadow-md":"border-border/50 opacity-60"}`,children:[v.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 w-[3px] bg-gradient-to-b from-[hsl(259,67%,59%)] to-[hsl(220,80%,55%)]",style:{opacity:b.enabled?1:.3}}),v.jsxs("div",{className:"flex items-center gap-2.5 border-b border-border/60 px-4 py-3 pl-5",children:[v.jsx("input",{value:b.name,onChange:R=>p(w,{name:R.target.value}),placeholder:"Rule name",className:"flex-1 min-w-0 rounded-md border border-transparent bg-transparent px-1.5 py-1 text-sm font-semibold outline-none transition-colors hover:border-border focus:border-primary/60 focus:bg-background"}),v.jsx(ip,{checked:b.enabled,onChange:R=>p(w,{enabled:R}),label:"Enabled",title:"Whether this rule is active"}),v.jsx(ip,{checked:b.enrich,onChange:R=>p(w,{enrich:R}),label:"Enrich",title:"Fetch the full entity into the prompt CONTEXT"}),v.jsx("div",{className:"h-5 w-px bg-border/70"}),v.jsx("button",{type:"button",onClick:()=>E(w),title:"Delete rule","aria-label":"Delete rule",className:"shrink-0 flex h-7 w-7 items-center justify-center rounded-md text-zinc-500 transition-colors hover:bg-red-500/15 hover:text-red-400",children:v.jsx(fA,{})})]}),v.jsxs("div",{className:"space-y-4 px-4 py-4 pl-5",children:[v.jsxs("div",{className:"space-y-1.5",children:[v.jsx("div",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:"Trigger"}),v.jsxs("select",{value:np(b.trigger)?b.trigger:_n,onChange:R=>p(w,{trigger:R.target.value===_n?"":R.target.value}),className:`${eo} w-full`,children:[Bd.map(R=>v.jsxs("option",{value:R.value,children:[R.label," (",R.value,")"]},R.value)),v.jsx("option",{value:_n,children:"Custom…"})]}),!np(b.trigger)&&v.jsx("input",{value:b.trigger,onChange:R=>p(w,{trigger:R.target.value}),placeholder:"custom.event.type",className:`${eo} w-full`})]}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:["Filters",b.filters.length>1&&v.jsx("span",{className:"normal-case text-zinc-600",children:" · all must match (AND)"})]}),v.jsx("button",{type:"button",onClick:()=>l(w),className:"rounded-md px-2 py-0.5 text-[11px] font-medium text-primary transition-colors hover:bg-primary/10",children:"+ filter"})]}),b.filters.length===0&&v.jsx("p",{className:"rounded-md border border-dashed border-border/70 px-2.5 py-2 text-[11px] text-zinc-500",children:"No filters — matches every event of this trigger."}),b.filters.map((R,T)=>{var B;const M=cA(b.trigger,R.field),O=((B=qc(b.trigger))==null?void 0:B.fields)??[],A=_(b.trigger,R.field),F=A.length>0&&R.op!=="in",U=A.length>0&&R.op==="in",G=`dl-${w}-${T}`,K=R.value.split(",").map(P=>P.trim()).filter(Boolean);return v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsxs("select",{value:M?R.field:_n,onChange:P=>h(w,T,{field:P.target.value===_n?"":P.target.value}),className:`${eo} flex-1 min-w-0`,children:[O.length===0&&v.jsx("option",{value:"",children:"(no fields for this trigger)"}),O.map(P=>v.jsxs("option",{value:P.key,children:[P.label," (",P.key,")"]},P.key)),v.jsx("option",{value:_n,children:"Custom…"})]}),!M&&v.jsx("input",{value:R.field,onChange:P=>h(w,T,{field:P.target.value}),placeholder:"field",className:`${eo} flex-1 min-w-0`}),v.jsx("select",{value:R.op,onChange:P=>h(w,T,{op:P.target.value}),className:`${vo} w-[84px] shrink-0 text-center`,children:ux.map(P=>v.jsx("option",{value:P,children:P},P))}),U?v.jsx(uA,{values:K,options:A,onChange:P=>h(w,T,{value:P.join(", ")}),placeholder:"add value…"}):F?v.jsxs("select",{value:R.value,onChange:P=>h(w,T,{value:P.target.value}),className:`${vo} flex-1 min-w-0`,children:[v.jsx("option",{value:"",children:"(choose)"}),R.value&&!A.some(P=>P.value===R.value)&&v.jsxs("option",{value:R.value,children:[R.value," (custom)"]}),A.map(P=>v.jsx("option",{value:P.value,children:P.label},P.value))]}):v.jsxs(v.Fragment,{children:[v.jsx("input",{list:A.length>0?G:void 0,value:R.value,onChange:P=>h(w,T,{value:P.target.value}),placeholder:R.op==="in"?"a, b, c":"value",className:`${vo} flex-1 min-w-0`}),A.length>0&&v.jsx("datalist",{id:G,children:A.map(P=>v.jsx("option",{value:P.value,children:P.label!==P.value?P.label:void 0},P.value))})]}),v.jsx("button",{type:"button",onClick:()=>f(w,T),title:"Remove filter","aria-label":"Remove filter",className:"shrink-0 flex h-7 w-7 items-center justify-center rounded-md text-zinc-500 transition-colors hover:bg-red-500/15 hover:text-red-400",children:"✕"})]},T)})]}),v.jsxs("div",{className:"space-y-1.5",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("span",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:["Prompt",b.prompt.length>0&&v.jsxs("span",{className:"normal-case text-zinc-600",children:[" · ",b.prompt.length," chars"]})]}),v.jsx("button",{type:"button",onClick:()=>g(w),className:"rounded-md px-2 py-0.5 text-[11px] text-zinc-400 transition-colors hover:bg-accent hover:text-foreground",title:"Open full prompt in a dialog",children:"⤢ Expand"})]}),v.jsx("textarea",{value:b.prompt,onChange:R=>p(w,{prompt:R.target.value}),rows:3,placeholder:"Instructions for the Claude session this rule spawns. Click Expand to edit the full prompt.",className:"w-full rounded-md border border-border bg-background px-2.5 py-2 text-sm leading-relaxed outline-none transition-colors focus:border-primary/60 focus:ring-2 focus:ring-primary/20 resize-y"})]})]})]},b.id)),v.jsxs("button",{type:"button",onClick:x,className:"group flex min-h-[120px] flex-col items-center justify-center gap-2 rounded-xl border-2 border-dashed border-border/70 text-muted-foreground transition-colors hover:border-primary/50 hover:bg-primary/5 hover:text-foreground",children:[v.jsx("span",{className:"flex h-9 w-9 items-center justify-center rounded-full border border-border/70 text-lg transition-colors group-hover:border-primary/50 group-hover:text-primary",children:"+"}),v.jsx("span",{className:"text-sm font-medium",children:"Add rule"})]})]}),v.jsx("p",{className:"text-[11px] text-zinc-600 mt-4",children:"Edits write to the cloud (source of truth), then the daemon hot-swaps its live matcher and re-subscribes the webhook if the set of event types changed — no restart."})]}),c!==null&&t[c]&&v.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-6",onClick:()=>g(null),children:v.jsxs("div",{className:"w-full max-w-3xl h-[80vh] flex flex-col rounded-lg border border-border bg-card shadow-xl",onClick:b=>b.stopPropagation(),children:[v.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 shrink-0",children:[v.jsxs("div",{className:"text-sm font-medium truncate",children:["Prompt — ",t[c].name]}),v.jsx("button",{type:"button",onClick:()=>g(null),className:"text-muted-foreground hover:text-foreground",title:"Close",children:"✕"})]}),v.jsx("textarea",{autoFocus:!0,value:t[c].prompt,onChange:b=>p(c,{prompt:b.target.value}),placeholder:"Instructions for the Claude session this rule spawns.",className:"flex-1 min-h-0 resize-none bg-background px-4 py-3 text-sm outline-none font-mono leading-relaxed"}),v.jsxs("div",{className:"flex items-center justify-between border-t border-border px-4 py-3 shrink-0",children:[v.jsxs("span",{className:"text-[11px] text-zinc-600",children:[t[c].prompt.length," chars · Esc to close · “Save to cloud” to persist"]}),v.jsx("button",{type:"button",onClick:()=>g(null),className:"px-3 py-1 text-xs font-medium rounded-full bg-primary/20 text-primary hover:bg-primary/30",children:"Done"})]})]})})]})}function mA(){const[e,t]=S.useState(null);return S.useEffect(()=>{fetch("/api/auth").then(r=>r.json()).then(r=>t({authenticated:r.authenticated??!1,mode:r.mode==="radar"?"radar":"pipeline"})).catch(()=>t({authenticated:!1,mode:"pipeline"}))},[]),e===null?v.jsx(zN,{fullPage:!0}):e.mode==="radar"?v.jsxs(ef,{children:[v.jsx(Vr,{path:"/config",element:v.jsx(pA,{})}),v.jsx(Vr,{path:"/session/:pingId",element:v.jsx(tp,{})}),v.jsx(Vr,{path:"/",element:v.jsx(tp,{})}),v.jsx(Vr,{path:"*",element:v.jsx(_l,{to:"/",replace:!0})})]}):v.jsxs(ef,{children:[v.jsx(Vr,{path:"/login",element:e.authenticated?v.jsx(_l,{to:"/",replace:!0}):v.jsx(YN,{onSuccess:()=>t({...e,authenticated:!0})})}),v.jsx(Vr,{path:"/",element:e.authenticated?v.jsx(TL,{onLogout:()=>t({...e,authenticated:!1})}):v.jsx(_l,{to:"/login",replace:!0})})]})}Il.createRoot(document.getElementById("root")).render(v.jsx(Ve.StrictMode,{children:v.jsx(Ab,{children:v.jsx(jb,{children:v.jsx(mA,{})})})}));