@citadel-labs/beads-ui 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/worktrees/agent-a7b97047/LICENSE +21 -0
- package/.claude/worktrees/agent-a7b97047/README.md +63 -0
- package/.claude/worktrees/agent-a7b97047/bin/beads-board.js +183 -0
- package/.claude/worktrees/agent-a7b97047/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/.claude/worktrees/agent-a7b97047/package-lock.json +1752 -0
- package/.claude/worktrees/agent-a7b97047/package.json +43 -0
- package/.claude/worktrees/agent-a7b97047/server/__tests__/api.test.js +206 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/angular-html-DA-rfuFy.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/angular-ts-BrjP3tb8.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/c-BIGW1oBm.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/cpp-BRuaLJcg.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/csharp-COcwbKMJ.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/css-CLj8gQPS.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/dockerfile-BcOcwvcX.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/dotenv-Da5cRb03.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/github-dark-DHJKELXO.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/go-C27-OAKa.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/graphql-ChdNCCLP.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/html-derivative-C6UeqQa8.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/html-pp8916En.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/http-l_GQhCeT.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/index-BBBYE21N.css +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/index-cZFE6wf9.js +231 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/ini-BEwlwnbL.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/java-CylS5w8V.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/javascript-wDzz0qaB.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/json-Cp-IABpG.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/jsonc-Des-eS-w.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/jsonl-DcaNXYhu.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/jsx-g9-lgVsj.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/kotlin-BdnUsdx6.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/kusto-wEQ09or8.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/latex-DdMFrP5M.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/markdown-Cvjx9yec.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/mdc-Dz5ISc6g.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/mdx-Cmh6b_Ma.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/mermaid-mWjccvbQ.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/php-R6g_5hLQ.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/powershell-Dpen1YoG.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/python-B6aJPvgy.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/ruby-AcS3PBV-.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/rust-B1yitclQ.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/sass-Cj5Yp3dK.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/scss-D5BDwBP9.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/shellscript-DfDnw5Jg.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/sql-BLtJtn59.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/svelte-DR4MIrkg.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/swift-D82vCrfD.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/toml-vGWfd6FD.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/tsx-COt5Ahok.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/typescript-BPQ3VLAy.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/vue-CJgBXYWu.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/xml-sdJ4AIDG.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/yaml-Buea-lGh.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/assets/zig-VOosw3JB.js +1 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/favicon.svg +103 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/index.html +14 -0
- package/.claude/worktrees/agent-a7b97047/server/dist/vite.svg +1 -0
- package/.claude/worktrees/agent-a7b97047/server/handlers.js +357 -0
- package/.claude/worktrees/agent-a7b97047/server/index.js +88 -0
- package/.claude/worktrees/agent-a7b97047/server/terminal.js +103 -0
- package/.claude/worktrees/agent-a7b97047/vitest.config.mjs +8 -0
- package/.claude/worktrees/agent-a952bde8/LICENSE +21 -0
- package/.claude/worktrees/agent-a952bde8/README.md +63 -0
- package/.claude/worktrees/agent-a952bde8/bin/beads-board.js +183 -0
- package/.claude/worktrees/agent-a952bde8/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/.claude/worktrees/agent-a952bde8/package-lock.json +1752 -0
- package/.claude/worktrees/agent-a952bde8/package.json +43 -0
- package/.claude/worktrees/agent-a952bde8/server/__tests__/api.test.js +122 -0
- package/.claude/worktrees/agent-a952bde8/server/dist/assets/index-BsWRmNbj.js +79 -0
- package/.claude/worktrees/agent-a952bde8/server/dist/assets/index-C7JKZkTD.css +1 -0
- package/.claude/worktrees/agent-a952bde8/server/dist/favicon.svg +103 -0
- package/.claude/worktrees/agent-a952bde8/server/dist/index.html +14 -0
- package/.claude/worktrees/agent-a952bde8/server/dist/vite.svg +1 -0
- package/.claude/worktrees/agent-a952bde8/server/handlers.js +269 -0
- package/.claude/worktrees/agent-a952bde8/server/index.js +88 -0
- package/.claude/worktrees/agent-a952bde8/server/terminal.js +103 -0
- package/.claude/worktrees/agent-a952bde8/vitest.config.mjs +8 -0
- package/package.json +1 -1
- package/server/__tests__/api.test.js +139 -0
- package/server/dist/assets/angular-html-DA-rfuFy.js +1 -0
- package/server/dist/assets/angular-ts-BrjP3tb8.js +1 -0
- package/server/dist/assets/c-BIGW1oBm.js +1 -0
- package/server/dist/assets/cpp-BRuaLJcg.js +1 -0
- package/server/dist/assets/csharp-COcwbKMJ.js +1 -0
- package/server/dist/assets/css-CLj8gQPS.js +1 -0
- package/server/dist/assets/dockerfile-BcOcwvcX.js +1 -0
- package/server/dist/assets/dotenv-Da5cRb03.js +1 -0
- package/server/dist/assets/github-dark-DHJKELXO.js +1 -0
- package/server/dist/assets/go-C27-OAKa.js +1 -0
- package/server/dist/assets/graphql-ChdNCCLP.js +1 -0
- package/server/dist/assets/html-derivative-C6UeqQa8.js +1 -0
- package/server/dist/assets/html-pp8916En.js +1 -0
- package/server/dist/assets/http-l_GQhCeT.js +1 -0
- package/server/dist/assets/index-DOFQi_E1.js +231 -0
- package/server/dist/assets/index-DeppoR8O.css +1 -0
- package/server/dist/assets/ini-BEwlwnbL.js +1 -0
- package/server/dist/assets/java-CylS5w8V.js +1 -0
- package/server/dist/assets/javascript-wDzz0qaB.js +1 -0
- package/server/dist/assets/json-Cp-IABpG.js +1 -0
- package/server/dist/assets/jsonc-Des-eS-w.js +1 -0
- package/server/dist/assets/jsonl-DcaNXYhu.js +1 -0
- package/server/dist/assets/jsx-g9-lgVsj.js +1 -0
- package/server/dist/assets/kotlin-BdnUsdx6.js +1 -0
- package/server/dist/assets/kusto-wEQ09or8.js +1 -0
- package/server/dist/assets/latex-DdMFrP5M.js +1 -0
- package/server/dist/assets/markdown-Cvjx9yec.js +1 -0
- package/server/dist/assets/mdc-Dz5ISc6g.js +1 -0
- package/server/dist/assets/mdx-Cmh6b_Ma.js +1 -0
- package/server/dist/assets/mermaid-mWjccvbQ.js +1 -0
- package/server/dist/assets/php-R6g_5hLQ.js +1 -0
- package/server/dist/assets/powershell-Dpen1YoG.js +1 -0
- package/server/dist/assets/python-B6aJPvgy.js +1 -0
- package/server/dist/assets/ruby-AcS3PBV-.js +1 -0
- package/server/dist/assets/rust-B1yitclQ.js +1 -0
- package/server/dist/assets/sass-Cj5Yp3dK.js +1 -0
- package/server/dist/assets/scss-D5BDwBP9.js +1 -0
- package/server/dist/assets/shellscript-DfDnw5Jg.js +1 -0
- package/server/dist/assets/sql-BLtJtn59.js +1 -0
- package/server/dist/assets/svelte-DR4MIrkg.js +1 -0
- package/server/dist/assets/swift-D82vCrfD.js +1 -0
- package/server/dist/assets/toml-vGWfd6FD.js +1 -0
- package/server/dist/assets/tsx-COt5Ahok.js +1 -0
- package/server/dist/assets/typescript-BPQ3VLAy.js +1 -0
- package/server/dist/assets/vue-CJgBXYWu.js +1 -0
- package/server/dist/assets/xml-sdJ4AIDG.js +1 -0
- package/server/dist/assets/yaml-Buea-lGh.js +1 -0
- package/server/dist/assets/zig-VOosw3JB.js +1 -0
- package/server/dist/index.html +2 -2
- package/server/handlers.js +93 -6
- package/server/terminal.js +2 -4
- package/server/dist/assets/index-B2S7vHJ3.js +0 -79
- package/server/dist/assets/index-K-eN8vD6.css +0 -1
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DA-rfuFy.js","assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/angular-ts-BrjP3tb8.js","assets/scss-D5BDwBP9.js","assets/cpp-BRuaLJcg.js","assets/c-BIGW1oBm.js","assets/sql-BLtJtn59.js","assets/graphql-ChdNCCLP.js","assets/typescript-BPQ3VLAy.js","assets/jsx-g9-lgVsj.js","assets/tsx-COt5Ahok.js","assets/http-l_GQhCeT.js","assets/shellscript-DfDnw5Jg.js","assets/json-Cp-IABpG.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/mdc-Dz5ISc6g.js","assets/markdown-Cvjx9yec.js","assets/yaml-Buea-lGh.js","assets/html-derivative-C6UeqQa8.js","assets/php-R6g_5hLQ.js","assets/ruby-AcS3PBV-.js","assets/svelte-DR4MIrkg.js","assets/vue-CJgBXYWu.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
function lL(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(i,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>i[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"]'))i(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function i(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();function d2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dm={exports:{}},jl={};var o1;function cL(){if(o1)return jl;o1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,s,a){var l=null;if(a!==void 0&&(l=""+a),s.key!==void 0&&(l=""+s.key),"key"in s){a={};for(var u in s)u!=="key"&&(a[u]=s[u])}else a=s;return s=a.ref,{$$typeof:e,type:i,key:l,ref:s!==void 0?s:null,props:a}}return jl.Fragment=t,jl.jsx=n,jl.jsxs=n,jl}var a1;function uL(){return a1||(a1=1,Dm.exports=cL()),Dm.exports}var w=uL(),Nm={exports:{}},Ne={};var l1;function hL(){if(l1)return Ne;l1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),_=Symbol.iterator;function y(L){return L===null||typeof L!="object"?null:(L=_&&L[_]||L["@@iterator"],typeof L=="function"?L:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function k(L,Z,ie){this.props=L,this.context=Z,this.refs=C,this.updater=ie||b}k.prototype.isReactComponent={},k.prototype.setState=function(L,Z){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,Z,"setState")},k.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function T(){}T.prototype=k.prototype;function R(L,Z,ie){this.props=L,this.context=Z,this.refs=C,this.updater=ie||b}var A=R.prototype=new T;A.constructor=R,S(A,k.prototype),A.isPureReactComponent=!0;var N=Array.isArray;function V(){}var H={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function J(L,Z,ie){var F=ie.ref;return{$$typeof:e,type:L,key:Z,ref:F!==void 0?F:null,props:ie}}function $(L,Z){return J(L.type,Z,L.props)}function K(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function I(L){var Z={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(ie){return Z[ie]})}var P=/\/+/g;function B(L,Z){return typeof L=="object"&&L!==null&&L.key!=null?I(""+L.key):Z.toString(36)}function W(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(V,V):(L.status="pending",L.then(function(Z){L.status==="pending"&&(L.status="fulfilled",L.value=Z)},function(Z){L.status==="pending"&&(L.status="rejected",L.reason=Z)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function M(L,Z,ie,F,O){var G=typeof L;(G==="undefined"||G==="boolean")&&(L=null);var q=!1;if(L===null)q=!0;else switch(G){case"bigint":case"string":case"number":q=!0;break;case"object":switch(L.$$typeof){case e:case t:q=!0;break;case p:return q=L._init,M(q(L._payload),Z,ie,F,O)}}if(q)return O=O(L),q=F===""?"."+B(L,0):F,N(O)?(ie="",q!=null&&(ie=q.replace(P,"$&/")+"/"),M(O,Z,ie,"",function(fe){return fe})):O!=null&&(K(O)&&(O=$(O,ie+(O.key==null||L&&L.key===O.key?"":(""+O.key).replace(P,"$&/")+"/")+q)),Z.push(O)),1;q=0;var ne=F===""?".":F+":";if(N(L))for(var re=0;re<L.length;re++)F=L[re],G=ne+B(F,re),q+=M(F,Z,ie,G,O);else if(re=y(L),typeof re=="function")for(L=re.call(L),re=0;!(F=L.next()).done;)F=F.value,G=ne+B(F,re++),q+=M(F,Z,ie,G,O);else if(G==="object"){if(typeof L.then=="function")return M(W(L),Z,ie,F,O);throw Z=String(L),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return q}function U(L,Z,ie){if(L==null)return L;var F=[],O=0;return M(L,F,"","",function(G){return Z.call(ie,G,O++)}),F}function j(L){if(L._status===-1){var Z=L._result;Z=Z(),Z.then(function(ie){(L._status===0||L._status===-1)&&(L._status=1,L._result=ie)},function(ie){(L._status===0||L._status===-1)&&(L._status=2,L._result=ie)}),L._status===-1&&(L._status=0,L._result=Z)}if(L._status===1)return L._result.default;throw L._result}var ee=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},X={map:U,forEach:function(L,Z,ie){U(L,function(){Z.apply(this,arguments)},ie)},count:function(L){var Z=0;return U(L,function(){Z++}),Z},toArray:function(L){return U(L,function(Z){return Z})||[]},only:function(L){if(!K(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Ne.Activity=m,Ne.Children=X,Ne.Component=k,Ne.Fragment=n,Ne.Profiler=s,Ne.PureComponent=R,Ne.StrictMode=i,Ne.Suspense=h,Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,Ne.__COMPILER_RUNTIME={__proto__:null,c:function(L){return H.H.useMemoCache(L)}},Ne.cache=function(L){return function(){return L.apply(null,arguments)}},Ne.cacheSignal=function(){return null},Ne.cloneElement=function(L,Z,ie){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var F=S({},L.props),O=L.key;if(Z!=null)for(G in Z.key!==void 0&&(O=""+Z.key),Z)!z.call(Z,G)||G==="key"||G==="__self"||G==="__source"||G==="ref"&&Z.ref===void 0||(F[G]=Z[G]);var G=arguments.length-2;if(G===1)F.children=ie;else if(1<G){for(var q=Array(G),ne=0;ne<G;ne++)q[ne]=arguments[ne+2];F.children=q}return J(L.type,O,F)},Ne.createContext=function(L){return L={$$typeof:l,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:a,_context:L},L},Ne.createElement=function(L,Z,ie){var F,O={},G=null;if(Z!=null)for(F in Z.key!==void 0&&(G=""+Z.key),Z)z.call(Z,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(O[F]=Z[F]);var q=arguments.length-2;if(q===1)O.children=ie;else if(1<q){for(var ne=Array(q),re=0;re<q;re++)ne[re]=arguments[re+2];O.children=ne}if(L&&L.defaultProps)for(F in q=L.defaultProps,q)O[F]===void 0&&(O[F]=q[F]);return J(L,G,O)},Ne.createRef=function(){return{current:null}},Ne.forwardRef=function(L){return{$$typeof:u,render:L}},Ne.isValidElement=K,Ne.lazy=function(L){return{$$typeof:p,_payload:{_status:-1,_result:L},_init:j}},Ne.memo=function(L,Z){return{$$typeof:d,type:L,compare:Z===void 0?null:Z}},Ne.startTransition=function(L){var Z=H.T,ie={};H.T=ie;try{var F=L(),O=H.S;O!==null&&O(ie,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(V,ee)}catch(G){ee(G)}finally{Z!==null&&ie.types!==null&&(Z.types=ie.types),H.T=Z}},Ne.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},Ne.use=function(L){return H.H.use(L)},Ne.useActionState=function(L,Z,ie){return H.H.useActionState(L,Z,ie)},Ne.useCallback=function(L,Z){return H.H.useCallback(L,Z)},Ne.useContext=function(L){return H.H.useContext(L)},Ne.useDebugValue=function(){},Ne.useDeferredValue=function(L,Z){return H.H.useDeferredValue(L,Z)},Ne.useEffect=function(L,Z){return H.H.useEffect(L,Z)},Ne.useEffectEvent=function(L){return H.H.useEffectEvent(L)},Ne.useId=function(){return H.H.useId()},Ne.useImperativeHandle=function(L,Z,ie){return H.H.useImperativeHandle(L,Z,ie)},Ne.useInsertionEffect=function(L,Z){return H.H.useInsertionEffect(L,Z)},Ne.useLayoutEffect=function(L,Z){return H.H.useLayoutEffect(L,Z)},Ne.useMemo=function(L,Z){return H.H.useMemo(L,Z)},Ne.useOptimistic=function(L,Z){return H.H.useOptimistic(L,Z)},Ne.useReducer=function(L,Z,ie){return H.H.useReducer(L,Z,ie)},Ne.useRef=function(L){return H.H.useRef(L)},Ne.useState=function(L){return H.H.useState(L)},Ne.useSyncExternalStore=function(L,Z,ie){return H.H.useSyncExternalStore(L,Z,ie)},Ne.useTransition=function(){return H.H.useTransition()},Ne.version="19.2.4",Ne}var c1;function Lv(){return c1||(c1=1,Nm.exports=hL()),Nm.exports}var x=Lv();const ss=d2(x),f2=lL({__proto__:null,default:ss},[x]);var Om={exports:{}},zl={},Lm={exports:{}},Pm={};var u1;function dL(){return u1||(u1=1,(function(e){function t(M,U){var j=M.length;M.push(U);e:for(;0<j;){var ee=j-1>>>1,X=M[ee];if(0<s(X,U))M[ee]=U,M[j]=X,j=ee;else break e}}function n(M){return M.length===0?null:M[0]}function i(M){if(M.length===0)return null;var U=M[0],j=M.pop();if(j!==U){M[0]=j;e:for(var ee=0,X=M.length,L=X>>>1;ee<L;){var Z=2*(ee+1)-1,ie=M[Z],F=Z+1,O=M[F];if(0>s(ie,j))F<X&&0>s(O,ie)?(M[ee]=O,M[F]=j,ee=F):(M[ee]=ie,M[Z]=j,ee=Z);else if(F<X&&0>s(O,j))M[ee]=O,M[F]=j,ee=F;else break e}}return U}function s(M,U){var j=M.sortIndex-U.sortIndex;return j!==0?j:M.id-U.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var h=[],d=[],p=1,m=null,_=3,y=!1,b=!1,S=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function A(M){for(var U=n(d);U!==null;){if(U.callback===null)i(d);else if(U.startTime<=M)i(d),U.sortIndex=U.expirationTime,t(h,U);else break;U=n(d)}}function N(M){if(S=!1,A(M),!b)if(n(h)!==null)b=!0,V||(V=!0,I());else{var U=n(d);U!==null&&W(N,U.startTime-M)}}var V=!1,H=-1,z=5,J=-1;function $(){return C?!0:!(e.unstable_now()-J<z)}function K(){if(C=!1,V){var M=e.unstable_now();J=M;var U=!0;try{e:{b=!1,S&&(S=!1,T(H),H=-1),y=!0;var j=_;try{t:{for(A(M),m=n(h);m!==null&&!(m.expirationTime>M&&$());){var ee=m.callback;if(typeof ee=="function"){m.callback=null,_=m.priorityLevel;var X=ee(m.expirationTime<=M);if(M=e.unstable_now(),typeof X=="function"){m.callback=X,A(M),U=!0;break t}m===n(h)&&i(h),A(M)}else i(h);m=n(h)}if(m!==null)U=!0;else{var L=n(d);L!==null&&W(N,L.startTime-M),U=!1}}break e}finally{m=null,_=j,y=!1}U=void 0}}finally{U?I():V=!1}}}var I;if(typeof R=="function")I=function(){R(K)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,B=P.port2;P.port1.onmessage=K,I=function(){B.postMessage(null)}}else I=function(){k(K,0)};function W(M,U){H=k(function(){M(e.unstable_now())},U)}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(M){M.callback=null},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(M){switch(_){case 1:case 2:case 3:var U=3;break;default:U=_}var j=_;_=U;try{return M()}finally{_=j}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(M,U){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var j=_;_=M;try{return U()}finally{_=j}},e.unstable_scheduleCallback=function(M,U,j){var ee=e.unstable_now();switch(typeof j=="object"&&j!==null?(j=j.delay,j=typeof j=="number"&&0<j?ee+j:ee):j=ee,M){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=j+X,M={id:p++,callback:U,priorityLevel:M,startTime:j,expirationTime:X,sortIndex:-1},j>ee?(M.sortIndex=j,t(d,M),n(h)===null&&M===n(d)&&(S?(T(H),H=-1):S=!0,W(N,j-ee))):(M.sortIndex=X,t(h,M),b||y||(b=!0,V||(V=!0,I()))),M},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(M){var U=_;return function(){var j=_;_=U;try{return M.apply(this,arguments)}finally{_=j}}}})(Pm)),Pm}var h1;function fL(){return h1||(h1=1,Lm.exports=dL()),Lm.exports}var Bm={exports:{}},un={};var d1;function pL(){if(d1)return un;d1=1;var e=Lv();function t(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+h+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(h,d,p){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:h,containerInfo:d,implementation:p}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return un.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,un.createPortal=function(h,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return a(h,d,null,p)},un.flushSync=function(h){var d=l.T,p=i.p;try{if(l.T=null,i.p=2,h)return h()}finally{l.T=d,i.p=p,i.d.f()}},un.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,i.d.C(h,d))},un.prefetchDNS=function(h){typeof h=="string"&&i.d.D(h)},un.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var p=d.as,m=u(p,d.crossOrigin),_=typeof d.integrity=="string"?d.integrity:void 0,y=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?i.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:_,fetchPriority:y}):p==="script"&&i.d.X(h,{crossOrigin:m,integrity:_,fetchPriority:y,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},un.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=u(d.as,d.crossOrigin);i.d.M(h,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&i.d.M(h)},un.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,m=u(p,d.crossOrigin);i.d.L(h,p,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},un.preloadModule=function(h,d){if(typeof h=="string")if(d){var p=u(d.as,d.crossOrigin);i.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else i.d.m(h)},un.requestFormReset=function(h){i.d.r(h)},un.unstable_batchedUpdates=function(h,d){return h(d)},un.useFormState=function(h,d,p){return l.H.useFormState(h,d,p)},un.useFormStatus=function(){return l.H.useHostTransitionStatus()},un.version="19.2.4",un}var f1;function p2(){if(f1)return Bm.exports;f1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Bm.exports=pL(),Bm.exports}var p1;function mL(){if(p1)return zl;p1=1;var e=fL(),t=Lv(),n=p2();function i(r){var o="https://react.dev/errors/"+r;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function a(r){var o=r,c=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(c=o.return),r=o.return;while(r)}return o.tag===3?c:null}function l(r){if(r.tag===13){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function u(r){if(r.tag===31){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function h(r){if(a(r)!==r)throw Error(i(188))}function d(r){var o=r.alternate;if(!o){if(o=a(r),o===null)throw Error(i(188));return o!==r?null:r}for(var c=r,f=o;;){var g=c.return;if(g===null)break;var v=g.alternate;if(v===null){if(f=g.return,f!==null){c=f;continue}break}if(g.child===v.child){for(v=g.child;v;){if(v===c)return h(g),r;if(v===f)return h(g),o;v=v.sibling}throw Error(i(188))}if(c.return!==f.return)c=g,f=v;else{for(var E=!1,D=g.child;D;){if(D===c){E=!0,c=g,f=v;break}if(D===f){E=!0,f=g,c=v;break}D=D.sibling}if(!E){for(D=v.child;D;){if(D===c){E=!0,c=v,f=g;break}if(D===f){E=!0,f=v,c=g;break}D=D.sibling}if(!E)throw Error(i(189))}}if(c.alternate!==f)throw Error(i(190))}if(c.tag!==3)throw Error(i(188));return c.stateNode.current===c?r:o}function p(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r;for(r=r.child;r!==null;){if(o=p(r),o!==null)return o;r=r.sibling}return null}var m=Object.assign,_=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),R=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function I(r){return r===null||typeof r!="object"?null:(r=K&&r[K]||r["@@iterator"],typeof r=="function"?r:null)}var P=Symbol.for("react.client.reference");function B(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===P?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case S:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case N:return"Suspense";case V:return"SuspenseList";case J:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case b:return"Portal";case R:return r.displayName||"Context";case T:return(r._context.displayName||"Context")+".Consumer";case A:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case H:return o=r.displayName||null,o!==null?o:B(r.type)||"Memo";case z:o=r._payload,r=r._init;try{return B(r(o))}catch{}}return null}var W=Array.isArray,M=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j={pending:!1,data:null,method:null,action:null},ee=[],X=-1;function L(r){return{current:r}}function Z(r){0>X||(r.current=ee[X],ee[X]=null,X--)}function ie(r,o){X++,ee[X]=r.current,r.current=o}var F=L(null),O=L(null),G=L(null),q=L(null);function ne(r,o){switch(ie(G,o),ie(O,r),ie(F,null),o.nodeType){case 9:case 11:r=(r=o.documentElement)&&(r=r.namespaceURI)?Rw(r):0;break;default:if(r=o.tagName,o=o.namespaceURI)o=Rw(o),r=Mw(o,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}Z(F),ie(F,r)}function re(){Z(F),Z(O),Z(G)}function fe(r){r.memoizedState!==null&&ie(q,r);var o=F.current,c=Mw(o,r.type);o!==c&&(ie(O,r),ie(F,c))}function pe(r){O.current===r&&(Z(F),Z(O)),q.current===r&&(Z(q),Ll._currentValue=j)}var xe,Ee;function Pe(r){if(xe===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);xe=o&&o[1]||"",Ee=-1<c.stack.indexOf(`
|
|
3
|
+
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
+
`+xe+r+Ee}var Ce=!1;function De(r,o){if(!r||Ce)return"";Ce=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(o){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(le){var ae=le}Reflect.construct(r,[],he)}else{try{he.call()}catch(le){ae=le}r.call(he.prototype)}}else{try{throw Error()}catch(le){ae=le}(he=r())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(le){if(le&&ae&&typeof le.stack=="string")return[le.stack,ae.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=f.DetermineComponentFrameRoot(),E=v[0],D=v[1];if(E&&D){var Y=E.split(`
|
|
5
|
+
`),oe=D.split(`
|
|
6
|
+
`);for(g=f=0;f<Y.length&&!Y[f].includes("DetermineComponentFrameRoot");)f++;for(;g<oe.length&&!oe[g].includes("DetermineComponentFrameRoot");)g++;if(f===Y.length||g===oe.length)for(f=Y.length-1,g=oe.length-1;1<=f&&0<=g&&Y[f]!==oe[g];)g--;for(;1<=f&&0<=g;f--,g--)if(Y[f]!==oe[g]){if(f!==1||g!==1)do if(f--,g--,0>g||Y[f]!==oe[g]){var ce=`
|
|
7
|
+
`+Y[f].replace(" at new "," at ");return r.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",r.displayName)),ce}while(1<=f&&0<=g);break}}}finally{Ce=!1,Error.prepareStackTrace=c}return(c=r?r.displayName||r.name:"")?Pe(c):""}function vt(r,o){switch(r.tag){case 26:case 27:case 5:return Pe(r.type);case 16:return Pe("Lazy");case 13:return r.child!==o&&o!==null?Pe("Suspense Fallback"):Pe("Suspense");case 19:return Pe("SuspenseList");case 0:case 15:return De(r.type,!1);case 11:return De(r.type.render,!1);case 1:return De(r.type,!0);case 31:return Pe("Activity");default:return""}}function cn(r){try{var o="",c=null;do o+=vt(r,c),c=r,r=r.return;while(r);return o}catch(f){return`
|
|
8
|
+
Error generating stack: `+f.message+`
|
|
9
|
+
`+f.stack}}var Gi=Object.prototype.hasOwnProperty,Tr=e.unstable_scheduleCallback,ki=e.unstable_cancelCallback,Cs=e.unstable_shouldYield,vf=e.unstable_requestPaint,Jt=e.unstable_now,UD=e.unstable_getCurrentPriorityLevel,a0=e.unstable_ImmediatePriority,l0=e.unstable_UserBlockingPriority,Hc=e.unstable_NormalPriority,FD=e.unstable_LowPriority,c0=e.unstable_IdlePriority,$D=e.log,WD=e.unstable_setDisableYieldValue,Ga=null,Dn=null;function Ar(r){if(typeof $D=="function"&&WD(r),Dn&&typeof Dn.setStrictMode=="function")try{Dn.setStrictMode(Ga,r)}catch{}}var Nn=Math.clz32?Math.clz32:KD,GD=Math.log,qD=Math.LN2;function KD(r){return r>>>=0,r===0?32:31-(GD(r)/qD|0)|0}var Vc=256,Uc=262144,Fc=4194304;function Es(r){var o=r&42;if(o!==0)return o;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function $c(r,o,c){var f=r.pendingLanes;if(f===0)return 0;var g=0,v=r.suspendedLanes,E=r.pingedLanes;r=r.warmLanes;var D=f&134217727;return D!==0?(f=D&~v,f!==0?g=Es(f):(E&=D,E!==0?g=Es(E):c||(c=D&~r,c!==0&&(g=Es(c))))):(D=f&~v,D!==0?g=Es(D):E!==0?g=Es(E):c||(c=f&~r,c!==0&&(g=Es(c)))),g===0?0:o!==0&&o!==g&&(o&v)===0&&(v=g&-g,c=o&-o,v>=c||v===32&&(c&4194048)!==0)?o:g}function qa(r,o){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&o)===0}function YD(r,o){switch(r){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function u0(){var r=Fc;return Fc<<=1,(Fc&62914560)===0&&(Fc=4194304),r}function yf(r){for(var o=[],c=0;31>c;c++)o.push(r);return o}function Ka(r,o){r.pendingLanes|=o,o!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function XD(r,o,c,f,g,v){var E=r.pendingLanes;r.pendingLanes=c,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=c,r.entangledLanes&=c,r.errorRecoveryDisabledLanes&=c,r.shellSuspendCounter=0;var D=r.entanglements,Y=r.expirationTimes,oe=r.hiddenUpdates;for(c=E&~c;0<c;){var ce=31-Nn(c),he=1<<ce;D[ce]=0,Y[ce]=-1;var ae=oe[ce];if(ae!==null)for(oe[ce]=null,ce=0;ce<ae.length;ce++){var le=ae[ce];le!==null&&(le.lane&=-536870913)}c&=~he}f!==0&&h0(r,f,0),v!==0&&g===0&&r.tag!==0&&(r.suspendedLanes|=v&~(E&~o))}function h0(r,o,c){r.pendingLanes|=o,r.suspendedLanes&=~o;var f=31-Nn(o);r.entangledLanes|=o,r.entanglements[f]=r.entanglements[f]|1073741824|c&261930}function d0(r,o){var c=r.entangledLanes|=o;for(r=r.entanglements;c;){var f=31-Nn(c),g=1<<f;g&o|r[f]&o&&(r[f]|=o),c&=~g}}function f0(r,o){var c=o&-o;return c=(c&42)!==0?1:bf(c),(c&(r.suspendedLanes|o))!==0?0:c}function bf(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Sf(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function p0(){var r=U.p;return r!==0?r:(r=window.event,r===void 0?32:Jw(r.type))}function m0(r,o){var c=U.p;try{return U.p=r,o()}finally{U.p=c}}var Rr=Math.random().toString(36).slice(2),en="__reactFiber$"+Rr,wn="__reactProps$"+Rr,yo="__reactContainer$"+Rr,wf="__reactEvents$"+Rr,ZD="__reactListeners$"+Rr,QD="__reactHandles$"+Rr,g0="__reactResources$"+Rr,Ya="__reactMarker$"+Rr;function xf(r){delete r[en],delete r[wn],delete r[wf],delete r[ZD],delete r[QD]}function bo(r){var o=r[en];if(o)return o;for(var c=r.parentNode;c;){if(o=c[yo]||c[en]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(r=Iw(r);r!==null;){if(c=r[en])return c;r=Iw(r)}return o}r=c,c=r.parentNode}return null}function So(r){if(r=r[en]||r[yo]){var o=r.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return r}return null}function Xa(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r.stateNode;throw Error(i(33))}function wo(r){var o=r[g0];return o||(o=r[g0]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Wt(r){r[Ya]=!0}var _0=new Set,v0={};function ks(r,o){xo(r,o),xo(r+"Capture",o)}function xo(r,o){for(v0[r]=o,r=0;r<o.length;r++)_0.add(o[r])}var JD=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),y0={},b0={};function eN(r){return Gi.call(b0,r)?!0:Gi.call(y0,r)?!1:JD.test(r)?b0[r]=!0:(y0[r]=!0,!1)}function Wc(r,o,c){if(eN(o))if(c===null)r.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":r.removeAttribute(o);return;case"boolean":var f=o.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){r.removeAttribute(o);return}}r.setAttribute(o,""+c)}}function Gc(r,o,c){if(c===null)r.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttribute(o,""+c)}}function qi(r,o,c,f){if(f===null)r.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(c);return}r.setAttributeNS(o,c,""+f)}}function qn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function S0(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function tN(r,o,c){var f=Object.getOwnPropertyDescriptor(r.constructor.prototype,o);if(!r.hasOwnProperty(o)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var g=f.get,v=f.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return g.call(this)},set:function(E){c=""+E,v.call(this,E)}}),Object.defineProperty(r,o,{enumerable:f.enumerable}),{getValue:function(){return c},setValue:function(E){c=""+E},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function Cf(r){if(!r._valueTracker){var o=S0(r)?"checked":"value";r._valueTracker=tN(r,o,""+r[o])}}function w0(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var c=o.getValue(),f="";return r&&(f=S0(r)?r.checked?"true":"false":r.value),r=f,r!==c?(o.setValue(r),!0):!1}function qc(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var nN=/[\n"\\]/g;function Kn(r){return r.replace(nN,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Ef(r,o,c,f,g,v,E,D){r.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?r.type=E:r.removeAttribute("type"),o!=null?E==="number"?(o===0&&r.value===""||r.value!=o)&&(r.value=""+qn(o)):r.value!==""+qn(o)&&(r.value=""+qn(o)):E!=="submit"&&E!=="reset"||r.removeAttribute("value"),o!=null?kf(r,E,qn(o)):c!=null?kf(r,E,qn(c)):f!=null&&r.removeAttribute("value"),g==null&&v!=null&&(r.defaultChecked=!!v),g!=null&&(r.checked=g&&typeof g!="function"&&typeof g!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?r.name=""+qn(D):r.removeAttribute("name")}function x0(r,o,c,f,g,v,E,D){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),o!=null||c!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){Cf(r);return}c=c!=null?""+qn(c):"",o=o!=null?""+qn(o):c,D||o===r.value||(r.value=o),r.defaultValue=o}f=f??g,f=typeof f!="function"&&typeof f!="symbol"&&!!f,r.checked=D?r.checked:!!f,r.defaultChecked=!!f,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(r.name=E),Cf(r)}function kf(r,o,c){o==="number"&&qc(r.ownerDocument)===r||r.defaultValue===""+c||(r.defaultValue=""+c)}function Co(r,o,c,f){if(r=r.options,o){o={};for(var g=0;g<c.length;g++)o["$"+c[g]]=!0;for(c=0;c<r.length;c++)g=o.hasOwnProperty("$"+r[c].value),r[c].selected!==g&&(r[c].selected=g),g&&f&&(r[c].defaultSelected=!0)}else{for(c=""+qn(c),o=null,g=0;g<r.length;g++){if(r[g].value===c){r[g].selected=!0,f&&(r[g].defaultSelected=!0);return}o!==null||r[g].disabled||(o=r[g])}o!==null&&(o.selected=!0)}}function C0(r,o,c){if(o!=null&&(o=""+qn(o),o!==r.value&&(r.value=o),c==null)){r.defaultValue!==o&&(r.defaultValue=o);return}r.defaultValue=c!=null?""+qn(c):""}function E0(r,o,c,f){if(o==null){if(f!=null){if(c!=null)throw Error(i(92));if(W(f)){if(1<f.length)throw Error(i(93));f=f[0]}c=f}c==null&&(c=""),o=c}c=qn(o),r.defaultValue=c,f=r.textContent,f===c&&f!==""&&f!==null&&(r.value=f),Cf(r)}function Eo(r,o){if(o){var c=r.firstChild;if(c&&c===r.lastChild&&c.nodeType===3){c.nodeValue=o;return}}r.textContent=o}var iN=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function k0(r,o,c){var f=o.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?f?r.setProperty(o,""):o==="float"?r.cssFloat="":r[o]="":f?r.setProperty(o,c):typeof c!="number"||c===0||iN.has(o)?o==="float"?r.cssFloat=c:r[o]=(""+c).trim():r[o]=c+"px"}function T0(r,o,c){if(o!=null&&typeof o!="object")throw Error(i(62));if(r=r.style,c!=null){for(var f in c)!c.hasOwnProperty(f)||o!=null&&o.hasOwnProperty(f)||(f.indexOf("--")===0?r.setProperty(f,""):f==="float"?r.cssFloat="":r[f]="");for(var g in o)f=o[g],o.hasOwnProperty(g)&&c[g]!==f&&k0(r,g,f)}else for(var v in o)o.hasOwnProperty(v)&&k0(r,v,o[v])}function Tf(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var rN=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),sN=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Kc(r){return sN.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Ki(){}var Af=null;function Rf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var ko=null,To=null;function A0(r){var o=So(r);if(o&&(r=o.stateNode)){var c=r[wn]||null;e:switch(r=o.stateNode,o.type){case"input":if(Ef(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),o=c.name,c.type==="radio"&&o!=null){for(c=r;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Kn(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var f=c[o];if(f!==r&&f.form===r.form){var g=f[wn]||null;if(!g)throw Error(i(90));Ef(f,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(o=0;o<c.length;o++)f=c[o],f.form===r.form&&w0(f)}break e;case"textarea":C0(r,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&Co(r,!!c.multiple,o,!1)}}}var Mf=!1;function R0(r,o,c){if(Mf)return r(o,c);Mf=!0;try{var f=r(o);return f}finally{if(Mf=!1,(ko!==null||To!==null)&&(Pu(),ko&&(o=ko,r=To,To=ko=null,A0(o),r)))for(o=0;o<r.length;o++)A0(r[o])}}function Za(r,o){var c=r.stateNode;if(c===null)return null;var f=c[wn]||null;if(f===null)return null;c=f[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(r=r.type,f=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!f;break e;default:r=!1}if(r)return null;if(c&&typeof c!="function")throw Error(i(231,o,typeof c));return c}var Yi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Df=!1;if(Yi)try{var Qa={};Object.defineProperty(Qa,"passive",{get:function(){Df=!0}}),window.addEventListener("test",Qa,Qa),window.removeEventListener("test",Qa,Qa)}catch{Df=!1}var Mr=null,Nf=null,Yc=null;function M0(){if(Yc)return Yc;var r,o=Nf,c=o.length,f,g="value"in Mr?Mr.value:Mr.textContent,v=g.length;for(r=0;r<c&&o[r]===g[r];r++);var E=c-r;for(f=1;f<=E&&o[c-f]===g[v-f];f++);return Yc=g.slice(r,1<f?1-f:void 0)}function Xc(r){var o=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&o===13&&(r=13)):r=o,r===10&&(r=13),32<=r||r===13?r:0}function Zc(){return!0}function D0(){return!1}function xn(r){function o(c,f,g,v,E){this._reactName=c,this._targetInst=g,this.type=f,this.nativeEvent=v,this.target=E,this.currentTarget=null;for(var D in r)r.hasOwnProperty(D)&&(c=r[D],this[D]=c?c(v):v[D]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Zc:D0,this.isPropagationStopped=D0,this}return m(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Zc)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Zc)},persist:function(){},isPersistent:Zc}),o}var Ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qc=xn(Ts),Ja=m({},Ts,{view:0,detail:0}),oN=xn(Ja),Of,Lf,el,Jc=m({},Ja,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bf,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==el&&(el&&r.type==="mousemove"?(Of=r.screenX-el.screenX,Lf=r.screenY-el.screenY):Lf=Of=0,el=r),Of)},movementY:function(r){return"movementY"in r?r.movementY:Lf}}),N0=xn(Jc),aN=m({},Jc,{dataTransfer:0}),lN=xn(aN),cN=m({},Ja,{relatedTarget:0}),Pf=xn(cN),uN=m({},Ts,{animationName:0,elapsedTime:0,pseudoElement:0}),hN=xn(uN),dN=m({},Ts,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),fN=xn(dN),pN=m({},Ts,{data:0}),O0=xn(pN),mN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gN={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"},_N={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vN(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=_N[r])?!!o[r]:!1}function Bf(){return vN}var yN=m({},Ja,{key:function(r){if(r.key){var o=mN[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=Xc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?gN[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bf,charCode:function(r){return r.type==="keypress"?Xc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Xc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),bN=xn(yN),SN=m({},Jc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),L0=xn(SN),wN=m({},Ja,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bf}),xN=xn(wN),CN=m({},Ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),EN=xn(CN),kN=m({},Jc,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),TN=xn(kN),AN=m({},Ts,{newState:0,oldState:0}),RN=xn(AN),MN=[9,13,27,32],If=Yi&&"CompositionEvent"in window,tl=null;Yi&&"documentMode"in document&&(tl=document.documentMode);var DN=Yi&&"TextEvent"in window&&!tl,P0=Yi&&(!If||tl&&8<tl&&11>=tl),B0=" ",I0=!1;function j0(r,o){switch(r){case"keyup":return MN.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function z0(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ao=!1;function NN(r,o){switch(r){case"compositionend":return z0(o);case"keypress":return o.which!==32?null:(I0=!0,B0);case"textInput":return r=o.data,r===B0&&I0?null:r;default:return null}}function ON(r,o){if(Ao)return r==="compositionend"||!If&&j0(r,o)?(r=M0(),Yc=Nf=Mr=null,Ao=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return P0&&o.locale!=="ko"?null:o.data;default:return null}}var LN={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 H0(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!LN[r.type]:o==="textarea"}function V0(r,o,c,f){ko?To?To.push(f):To=[f]:ko=f,o=Uu(o,"onChange"),0<o.length&&(c=new Qc("onChange","change",null,c,f),r.push({event:c,listeners:o}))}var nl=null,il=null;function PN(r){xw(r,0)}function eu(r){var o=Xa(r);if(w0(o))return r}function U0(r,o){if(r==="change")return o}var F0=!1;if(Yi){var jf;if(Yi){var zf="oninput"in document;if(!zf){var $0=document.createElement("div");$0.setAttribute("oninput","return;"),zf=typeof $0.oninput=="function"}jf=zf}else jf=!1;F0=jf&&(!document.documentMode||9<document.documentMode)}function W0(){nl&&(nl.detachEvent("onpropertychange",G0),il=nl=null)}function G0(r){if(r.propertyName==="value"&&eu(il)){var o=[];V0(o,il,r,Rf(r)),R0(PN,o)}}function BN(r,o,c){r==="focusin"?(W0(),nl=o,il=c,nl.attachEvent("onpropertychange",G0)):r==="focusout"&&W0()}function IN(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return eu(il)}function jN(r,o){if(r==="click")return eu(o)}function zN(r,o){if(r==="input"||r==="change")return eu(o)}function HN(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var On=typeof Object.is=="function"?Object.is:HN;function rl(r,o){if(On(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var c=Object.keys(r),f=Object.keys(o);if(c.length!==f.length)return!1;for(f=0;f<c.length;f++){var g=c[f];if(!Gi.call(o,g)||!On(r[g],o[g]))return!1}return!0}function q0(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function K0(r,o){var c=q0(r);r=0;for(var f;c;){if(c.nodeType===3){if(f=r+c.textContent.length,r<=o&&f>=o)return{node:c,offset:o-r};r=f}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=q0(c)}}function Y0(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?Y0(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function X0(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var o=qc(r.document);o instanceof r.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch{c=!1}if(c)r=o.contentWindow;else break;o=qc(r.document)}return o}function Hf(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}var VN=Yi&&"documentMode"in document&&11>=document.documentMode,Ro=null,Vf=null,sl=null,Uf=!1;function Z0(r,o,c){var f=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Uf||Ro==null||Ro!==qc(f)||(f=Ro,"selectionStart"in f&&Hf(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),sl&&rl(sl,f)||(sl=f,f=Uu(Vf,"onSelect"),0<f.length&&(o=new Qc("onSelect","select",null,o,c),r.push({event:o,listeners:f}),o.target=Ro)))}function As(r,o){var c={};return c[r.toLowerCase()]=o.toLowerCase(),c["Webkit"+r]="webkit"+o,c["Moz"+r]="moz"+o,c}var Mo={animationend:As("Animation","AnimationEnd"),animationiteration:As("Animation","AnimationIteration"),animationstart:As("Animation","AnimationStart"),transitionrun:As("Transition","TransitionRun"),transitionstart:As("Transition","TransitionStart"),transitioncancel:As("Transition","TransitionCancel"),transitionend:As("Transition","TransitionEnd")},Ff={},Q0={};Yi&&(Q0=document.createElement("div").style,"AnimationEvent"in window||(delete Mo.animationend.animation,delete Mo.animationiteration.animation,delete Mo.animationstart.animation),"TransitionEvent"in window||delete Mo.transitionend.transition);function Rs(r){if(Ff[r])return Ff[r];if(!Mo[r])return r;var o=Mo[r],c;for(c in o)if(o.hasOwnProperty(c)&&c in Q0)return Ff[r]=o[c];return r}var J0=Rs("animationend"),eb=Rs("animationiteration"),tb=Rs("animationstart"),UN=Rs("transitionrun"),FN=Rs("transitionstart"),$N=Rs("transitioncancel"),nb=Rs("transitionend"),ib=new Map,$f="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");$f.push("scrollEnd");function fi(r,o){ib.set(r,o),ks(o,[r])}var tu=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Yn=[],Do=0,Wf=0;function nu(){for(var r=Do,o=Wf=Do=0;o<r;){var c=Yn[o];Yn[o++]=null;var f=Yn[o];Yn[o++]=null;var g=Yn[o];Yn[o++]=null;var v=Yn[o];if(Yn[o++]=null,f!==null&&g!==null){var E=f.pending;E===null?g.next=g:(g.next=E.next,E.next=g),f.pending=g}v!==0&&rb(c,g,v)}}function iu(r,o,c,f){Yn[Do++]=r,Yn[Do++]=o,Yn[Do++]=c,Yn[Do++]=f,Wf|=f,r.lanes|=f,r=r.alternate,r!==null&&(r.lanes|=f)}function Gf(r,o,c,f){return iu(r,o,c,f),ru(r)}function Ms(r,o){return iu(r,null,null,o),ru(r)}function rb(r,o,c){r.lanes|=c;var f=r.alternate;f!==null&&(f.lanes|=c);for(var g=!1,v=r.return;v!==null;)v.childLanes|=c,f=v.alternate,f!==null&&(f.childLanes|=c),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(g=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,g&&o!==null&&(g=31-Nn(c),r=v.hiddenUpdates,f=r[g],f===null?r[g]=[o]:f.push(o),o.lane=c|536870912),v):null}function ru(r){if(50<Tl)throw Tl=0,tm=null,Error(i(185));for(var o=r.return;o!==null;)r=o,o=r.return;return r.tag===3?r.stateNode:null}var No={};function WN(r,o,c,f){this.tag=r,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ln(r,o,c,f){return new WN(r,o,c,f)}function qf(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Xi(r,o){var c=r.alternate;return c===null?(c=Ln(r.tag,o,r.key,r.mode),c.elementType=r.elementType,c.type=r.type,c.stateNode=r.stateNode,c.alternate=r,r.alternate=c):(c.pendingProps=o,c.type=r.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=r.flags&65011712,c.childLanes=r.childLanes,c.lanes=r.lanes,c.child=r.child,c.memoizedProps=r.memoizedProps,c.memoizedState=r.memoizedState,c.updateQueue=r.updateQueue,o=r.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=r.sibling,c.index=r.index,c.ref=r.ref,c.refCleanup=r.refCleanup,c}function sb(r,o){r.flags&=65011714;var c=r.alternate;return c===null?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=c.childLanes,r.lanes=c.lanes,r.child=c.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=c.memoizedProps,r.memoizedState=c.memoizedState,r.updateQueue=c.updateQueue,r.type=c.type,o=c.dependencies,r.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),r}function su(r,o,c,f,g,v){var E=0;if(f=r,typeof r=="function")qf(r)&&(E=1);else if(typeof r=="string")E=XO(r,c,F.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case J:return r=Ln(31,c,o,g),r.elementType=J,r.lanes=v,r;case S:return Ds(c.children,g,v,o);case C:E=8,g|=24;break;case k:return r=Ln(12,c,o,g|2),r.elementType=k,r.lanes=v,r;case N:return r=Ln(13,c,o,g),r.elementType=N,r.lanes=v,r;case V:return r=Ln(19,c,o,g),r.elementType=V,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case R:E=10;break e;case T:E=9;break e;case A:E=11;break e;case H:E=14;break e;case z:E=16,f=null;break e}E=29,c=Error(i(130,r===null?"null":typeof r,"")),f=null}return o=Ln(E,c,o,g),o.elementType=r,o.type=f,o.lanes=v,o}function Ds(r,o,c,f){return r=Ln(7,r,f,o),r.lanes=c,r}function Kf(r,o,c){return r=Ln(6,r,null,o),r.lanes=c,r}function ob(r){var o=Ln(18,null,null,0);return o.stateNode=r,o}function Yf(r,o,c){return o=Ln(4,r.children!==null?r.children:[],r.key,o),o.lanes=c,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}var ab=new WeakMap;function Xn(r,o){if(typeof r=="object"&&r!==null){var c=ab.get(r);return c!==void 0?c:(o={value:r,source:o,stack:cn(o)},ab.set(r,o),o)}return{value:r,source:o,stack:cn(o)}}var Oo=[],Lo=0,ou=null,ol=0,Zn=[],Qn=0,Dr=null,Ti=1,Ai="";function Zi(r,o){Oo[Lo++]=ol,Oo[Lo++]=ou,ou=r,ol=o}function lb(r,o,c){Zn[Qn++]=Ti,Zn[Qn++]=Ai,Zn[Qn++]=Dr,Dr=r;var f=Ti;r=Ai;var g=32-Nn(f)-1;f&=~(1<<g),c+=1;var v=32-Nn(o)+g;if(30<v){var E=g-g%5;v=(f&(1<<E)-1).toString(32),f>>=E,g-=E,Ti=1<<32-Nn(o)+g|c<<g|f,Ai=v+r}else Ti=1<<v|c<<g|f,Ai=r}function Xf(r){r.return!==null&&(Zi(r,1),lb(r,1,0))}function Zf(r){for(;r===ou;)ou=Oo[--Lo],Oo[Lo]=null,ol=Oo[--Lo],Oo[Lo]=null;for(;r===Dr;)Dr=Zn[--Qn],Zn[Qn]=null,Ai=Zn[--Qn],Zn[Qn]=null,Ti=Zn[--Qn],Zn[Qn]=null}function cb(r,o){Zn[Qn++]=Ti,Zn[Qn++]=Ai,Zn[Qn++]=Dr,Ti=o.id,Ai=o.overflow,Dr=r}var tn=null,ct=null,Ge=!1,Nr=null,Jn=!1,Qf=Error(i(519));function Or(r){var o=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw al(Xn(o,r)),Qf}function ub(r){var o=r.stateNode,c=r.type,f=r.memoizedProps;switch(o[en]=r,o[wn]=f,c){case"dialog":Fe("cancel",o),Fe("close",o);break;case"iframe":case"object":case"embed":Fe("load",o);break;case"video":case"audio":for(c=0;c<Rl.length;c++)Fe(Rl[c],o);break;case"source":Fe("error",o);break;case"img":case"image":case"link":Fe("error",o),Fe("load",o);break;case"details":Fe("toggle",o);break;case"input":Fe("invalid",o),x0(o,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Fe("invalid",o);break;case"textarea":Fe("invalid",o),E0(o,f.value,f.defaultValue,f.children)}c=f.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||o.textContent===""+c||f.suppressHydrationWarning===!0||Tw(o.textContent,c)?(f.popover!=null&&(Fe("beforetoggle",o),Fe("toggle",o)),f.onScroll!=null&&Fe("scroll",o),f.onScrollEnd!=null&&Fe("scrollend",o),f.onClick!=null&&(o.onclick=Ki),o=!0):o=!1,o||Or(r,!0)}function hb(r){for(tn=r.return;tn;)switch(tn.tag){case 5:case 31:case 13:Jn=!1;return;case 27:case 3:Jn=!0;return;default:tn=tn.return}}function Po(r){if(r!==tn)return!1;if(!Ge)return hb(r),Ge=!0,!1;var o=r.tag,c;if((c=o!==3&&o!==27)&&((c=o===5)&&(c=r.type,c=!(c!=="form"&&c!=="button")||gm(r.type,r.memoizedProps)),c=!c),c&&ct&&Or(r),hb(r),o===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));ct=Bw(r)}else if(o===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));ct=Bw(r)}else o===27?(o=ct,qr(r.type)?(r=Sm,Sm=null,ct=r):ct=o):ct=tn?ti(r.stateNode.nextSibling):null;return!0}function Ns(){ct=tn=null,Ge=!1}function Jf(){var r=Nr;return r!==null&&(Tn===null?Tn=r:Tn.push.apply(Tn,r),Nr=null),r}function al(r){Nr===null?Nr=[r]:Nr.push(r)}var ep=L(null),Os=null,Qi=null;function Lr(r,o,c){ie(ep,o._currentValue),o._currentValue=c}function Ji(r){r._currentValue=ep.current,Z(ep)}function tp(r,o,c){for(;r!==null;){var f=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,f!==null&&(f.childLanes|=o)):f!==null&&(f.childLanes&o)!==o&&(f.childLanes|=o),r===c)break;r=r.return}}function np(r,o,c,f){var g=r.child;for(g!==null&&(g.return=r);g!==null;){var v=g.dependencies;if(v!==null){var E=g.child;v=v.firstContext;e:for(;v!==null;){var D=v;v=g;for(var Y=0;Y<o.length;Y++)if(D.context===o[Y]){v.lanes|=c,D=v.alternate,D!==null&&(D.lanes|=c),tp(v.return,c,r),f||(E=null);break e}v=D.next}}else if(g.tag===18){if(E=g.return,E===null)throw Error(i(341));E.lanes|=c,v=E.alternate,v!==null&&(v.lanes|=c),tp(E,c,r),E=null}else E=g.child;if(E!==null)E.return=g;else for(E=g;E!==null;){if(E===r){E=null;break}if(g=E.sibling,g!==null){g.return=E.return,E=g;break}E=E.return}g=E}}function Bo(r,o,c,f){r=null;for(var g=o,v=!1;g!==null;){if(!v){if((g.flags&524288)!==0)v=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var E=g.alternate;if(E===null)throw Error(i(387));if(E=E.memoizedProps,E!==null){var D=g.type;On(g.pendingProps.value,E.value)||(r!==null?r.push(D):r=[D])}}else if(g===q.current){if(E=g.alternate,E===null)throw Error(i(387));E.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(r!==null?r.push(Ll):r=[Ll])}g=g.return}r!==null&&np(o,r,c,f),o.flags|=262144}function au(r){for(r=r.firstContext;r!==null;){if(!On(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Ls(r){Os=r,Qi=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function nn(r){return db(Os,r)}function lu(r,o){return Os===null&&Ls(r),db(r,o)}function db(r,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},Qi===null){if(r===null)throw Error(i(308));Qi=o,r.dependencies={lanes:0,firstContext:o},r.flags|=524288}else Qi=Qi.next=o;return c}var GN=typeof AbortController<"u"?AbortController:function(){var r=[],o=this.signal={aborted:!1,addEventListener:function(c,f){r.push(f)}};this.abort=function(){o.aborted=!0,r.forEach(function(c){return c()})}},qN=e.unstable_scheduleCallback,KN=e.unstable_NormalPriority,At={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ip(){return{controller:new GN,data:new Map,refCount:0}}function ll(r){r.refCount--,r.refCount===0&&qN(KN,function(){r.controller.abort()})}var cl=null,rp=0,Io=0,jo=null;function YN(r,o){if(cl===null){var c=cl=[];rp=0,Io=am(),jo={status:"pending",value:void 0,then:function(f){c.push(f)}}}return rp++,o.then(fb,fb),o}function fb(){if(--rp===0&&cl!==null){jo!==null&&(jo.status="fulfilled");var r=cl;cl=null,Io=0,jo=null;for(var o=0;o<r.length;o++)(0,r[o])()}}function XN(r,o){var c=[],f={status:"pending",value:null,reason:null,then:function(g){c.push(g)}};return r.then(function(){f.status="fulfilled",f.value=o;for(var g=0;g<c.length;g++)(0,c[g])(o)},function(g){for(f.status="rejected",f.reason=g,g=0;g<c.length;g++)(0,c[g])(void 0)}),f}var pb=M.S;M.S=function(r,o){ZS=Jt(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&YN(r,o),pb!==null&&pb(r,o)};var Ps=L(null);function sp(){var r=Ps.current;return r!==null?r:st.pooledCache}function cu(r,o){o===null?ie(Ps,Ps.current):ie(Ps,o.pool)}function mb(){var r=sp();return r===null?null:{parent:At._currentValue,pool:r}}var zo=Error(i(460)),op=Error(i(474)),uu=Error(i(542)),hu={then:function(){}};function gb(r){return r=r.status,r==="fulfilled"||r==="rejected"}function _b(r,o,c){switch(c=r[c],c===void 0?r.push(o):c!==o&&(o.then(Ki,Ki),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,yb(r),r;default:if(typeof o.status=="string")o.then(Ki,Ki);else{if(r=st,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=o,r.status="pending",r.then(function(f){if(o.status==="pending"){var g=o;g.status="fulfilled",g.value=f}},function(f){if(o.status==="pending"){var g=o;g.status="rejected",g.reason=f}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,yb(r),r}throw Is=o,zo}}function Bs(r){try{var o=r._init;return o(r._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Is=c,zo):c}}var Is=null;function vb(){if(Is===null)throw Error(i(459));var r=Is;return Is=null,r}function yb(r){if(r===zo||r===uu)throw Error(i(483))}var Ho=null,ul=0;function du(r){var o=ul;return ul+=1,Ho===null&&(Ho=[]),_b(Ho,r,o)}function hl(r,o){o=o.props.ref,r.ref=o!==void 0?o:null}function fu(r,o){throw o.$$typeof===_?Error(i(525)):(r=Object.prototype.toString.call(o),Error(i(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r)))}function bb(r){function o(te,Q){if(r){var se=te.deletions;se===null?(te.deletions=[Q],te.flags|=16):se.push(Q)}}function c(te,Q){if(!r)return null;for(;Q!==null;)o(te,Q),Q=Q.sibling;return null}function f(te){for(var Q=new Map;te!==null;)te.key!==null?Q.set(te.key,te):Q.set(te.index,te),te=te.sibling;return Q}function g(te,Q){return te=Xi(te,Q),te.index=0,te.sibling=null,te}function v(te,Q,se){return te.index=se,r?(se=te.alternate,se!==null?(se=se.index,se<Q?(te.flags|=67108866,Q):se):(te.flags|=67108866,Q)):(te.flags|=1048576,Q)}function E(te){return r&&te.alternate===null&&(te.flags|=67108866),te}function D(te,Q,se,ue){return Q===null||Q.tag!==6?(Q=Kf(se,te.mode,ue),Q.return=te,Q):(Q=g(Q,se),Q.return=te,Q)}function Y(te,Q,se,ue){var ke=se.type;return ke===S?ce(te,Q,se.props.children,ue,se.key):Q!==null&&(Q.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===z&&Bs(ke)===Q.type)?(Q=g(Q,se.props),hl(Q,se),Q.return=te,Q):(Q=su(se.type,se.key,se.props,null,te.mode,ue),hl(Q,se),Q.return=te,Q)}function oe(te,Q,se,ue){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==se.containerInfo||Q.stateNode.implementation!==se.implementation?(Q=Yf(se,te.mode,ue),Q.return=te,Q):(Q=g(Q,se.children||[]),Q.return=te,Q)}function ce(te,Q,se,ue,ke){return Q===null||Q.tag!==7?(Q=Ds(se,te.mode,ue,ke),Q.return=te,Q):(Q=g(Q,se),Q.return=te,Q)}function he(te,Q,se){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=Kf(""+Q,te.mode,se),Q.return=te,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case y:return se=su(Q.type,Q.key,Q.props,null,te.mode,se),hl(se,Q),se.return=te,se;case b:return Q=Yf(Q,te.mode,se),Q.return=te,Q;case z:return Q=Bs(Q),he(te,Q,se)}if(W(Q)||I(Q))return Q=Ds(Q,te.mode,se,null),Q.return=te,Q;if(typeof Q.then=="function")return he(te,du(Q),se);if(Q.$$typeof===R)return he(te,lu(te,Q),se);fu(te,Q)}return null}function ae(te,Q,se,ue){var ke=Q!==null?Q.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return ke!==null?null:D(te,Q,""+se,ue);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case y:return se.key===ke?Y(te,Q,se,ue):null;case b:return se.key===ke?oe(te,Q,se,ue):null;case z:return se=Bs(se),ae(te,Q,se,ue)}if(W(se)||I(se))return ke!==null?null:ce(te,Q,se,ue,null);if(typeof se.then=="function")return ae(te,Q,du(se),ue);if(se.$$typeof===R)return ae(te,Q,lu(te,se),ue);fu(te,se)}return null}function le(te,Q,se,ue,ke){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return te=te.get(se)||null,D(Q,te,""+ue,ke);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:return te=te.get(ue.key===null?se:ue.key)||null,Y(Q,te,ue,ke);case b:return te=te.get(ue.key===null?se:ue.key)||null,oe(Q,te,ue,ke);case z:return ue=Bs(ue),le(te,Q,se,ue,ke)}if(W(ue)||I(ue))return te=te.get(se)||null,ce(Q,te,ue,ke,null);if(typeof ue.then=="function")return le(te,Q,se,du(ue),ke);if(ue.$$typeof===R)return le(te,Q,se,lu(Q,ue),ke);fu(Q,ue)}return null}function ve(te,Q,se,ue){for(var ke=null,Ke=null,we=Q,Be=Q=0,We=null;we!==null&&Be<se.length;Be++){we.index>Be?(We=we,we=null):We=we.sibling;var Ye=ae(te,we,se[Be],ue);if(Ye===null){we===null&&(we=We);break}r&&we&&Ye.alternate===null&&o(te,we),Q=v(Ye,Q,Be),Ke===null?ke=Ye:Ke.sibling=Ye,Ke=Ye,we=We}if(Be===se.length)return c(te,we),Ge&&Zi(te,Be),ke;if(we===null){for(;Be<se.length;Be++)we=he(te,se[Be],ue),we!==null&&(Q=v(we,Q,Be),Ke===null?ke=we:Ke.sibling=we,Ke=we);return Ge&&Zi(te,Be),ke}for(we=f(we);Be<se.length;Be++)We=le(we,te,Be,se[Be],ue),We!==null&&(r&&We.alternate!==null&&we.delete(We.key===null?Be:We.key),Q=v(We,Q,Be),Ke===null?ke=We:Ke.sibling=We,Ke=We);return r&&we.forEach(function(Qr){return o(te,Qr)}),Ge&&Zi(te,Be),ke}function Te(te,Q,se,ue){if(se==null)throw Error(i(151));for(var ke=null,Ke=null,we=Q,Be=Q=0,We=null,Ye=se.next();we!==null&&!Ye.done;Be++,Ye=se.next()){we.index>Be?(We=we,we=null):We=we.sibling;var Qr=ae(te,we,Ye.value,ue);if(Qr===null){we===null&&(we=We);break}r&&we&&Qr.alternate===null&&o(te,we),Q=v(Qr,Q,Be),Ke===null?ke=Qr:Ke.sibling=Qr,Ke=Qr,we=We}if(Ye.done)return c(te,we),Ge&&Zi(te,Be),ke;if(we===null){for(;!Ye.done;Be++,Ye=se.next())Ye=he(te,Ye.value,ue),Ye!==null&&(Q=v(Ye,Q,Be),Ke===null?ke=Ye:Ke.sibling=Ye,Ke=Ye);return Ge&&Zi(te,Be),ke}for(we=f(we);!Ye.done;Be++,Ye=se.next())Ye=le(we,te,Be,Ye.value,ue),Ye!==null&&(r&&Ye.alternate!==null&&we.delete(Ye.key===null?Be:Ye.key),Q=v(Ye,Q,Be),Ke===null?ke=Ye:Ke.sibling=Ye,Ke=Ye);return r&&we.forEach(function(aL){return o(te,aL)}),Ge&&Zi(te,Be),ke}function it(te,Q,se,ue){if(typeof se=="object"&&se!==null&&se.type===S&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case y:e:{for(var ke=se.key;Q!==null;){if(Q.key===ke){if(ke=se.type,ke===S){if(Q.tag===7){c(te,Q.sibling),ue=g(Q,se.props.children),ue.return=te,te=ue;break e}}else if(Q.elementType===ke||typeof ke=="object"&&ke!==null&&ke.$$typeof===z&&Bs(ke)===Q.type){c(te,Q.sibling),ue=g(Q,se.props),hl(ue,se),ue.return=te,te=ue;break e}c(te,Q);break}else o(te,Q);Q=Q.sibling}se.type===S?(ue=Ds(se.props.children,te.mode,ue,se.key),ue.return=te,te=ue):(ue=su(se.type,se.key,se.props,null,te.mode,ue),hl(ue,se),ue.return=te,te=ue)}return E(te);case b:e:{for(ke=se.key;Q!==null;){if(Q.key===ke)if(Q.tag===4&&Q.stateNode.containerInfo===se.containerInfo&&Q.stateNode.implementation===se.implementation){c(te,Q.sibling),ue=g(Q,se.children||[]),ue.return=te,te=ue;break e}else{c(te,Q);break}else o(te,Q);Q=Q.sibling}ue=Yf(se,te.mode,ue),ue.return=te,te=ue}return E(te);case z:return se=Bs(se),it(te,Q,se,ue)}if(W(se))return ve(te,Q,se,ue);if(I(se)){if(ke=I(se),typeof ke!="function")throw Error(i(150));return se=ke.call(se),Te(te,Q,se,ue)}if(typeof se.then=="function")return it(te,Q,du(se),ue);if(se.$$typeof===R)return it(te,Q,lu(te,se),ue);fu(te,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,Q!==null&&Q.tag===6?(c(te,Q.sibling),ue=g(Q,se),ue.return=te,te=ue):(c(te,Q),ue=Kf(se,te.mode,ue),ue.return=te,te=ue),E(te)):c(te,Q)}return function(te,Q,se,ue){try{ul=0;var ke=it(te,Q,se,ue);return Ho=null,ke}catch(we){if(we===zo||we===uu)throw we;var Ke=Ln(29,we,null,te.mode);return Ke.lanes=ue,Ke.return=te,Ke}}}var js=bb(!0),Sb=bb(!1),Pr=!1;function ap(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lp(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Br(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Ir(r,o,c){var f=r.updateQueue;if(f===null)return null;if(f=f.shared,(Xe&2)!==0){var g=f.pending;return g===null?o.next=o:(o.next=g.next,g.next=o),f.pending=o,o=ru(r),rb(r,null,c),o}return iu(r,f,o,c),ru(r)}function dl(r,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194048)!==0)){var f=o.lanes;f&=r.pendingLanes,c|=f,o.lanes=c,d0(r,c)}}function cp(r,o){var c=r.updateQueue,f=r.alternate;if(f!==null&&(f=f.updateQueue,c===f)){var g=null,v=null;if(c=c.firstBaseUpdate,c!==null){do{var E={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};v===null?g=v=E:v=v.next=E,c=c.next}while(c!==null);v===null?g=v=o:v=v.next=o}else g=v=o;c={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:v,shared:f.shared,callbacks:f.callbacks},r.updateQueue=c;return}r=c.lastBaseUpdate,r===null?c.firstBaseUpdate=o:r.next=o,c.lastBaseUpdate=o}var up=!1;function fl(){if(up){var r=jo;if(r!==null)throw r}}function pl(r,o,c,f){up=!1;var g=r.updateQueue;Pr=!1;var v=g.firstBaseUpdate,E=g.lastBaseUpdate,D=g.shared.pending;if(D!==null){g.shared.pending=null;var Y=D,oe=Y.next;Y.next=null,E===null?v=oe:E.next=oe,E=Y;var ce=r.alternate;ce!==null&&(ce=ce.updateQueue,D=ce.lastBaseUpdate,D!==E&&(D===null?ce.firstBaseUpdate=oe:D.next=oe,ce.lastBaseUpdate=Y))}if(v!==null){var he=g.baseState;E=0,ce=oe=Y=null,D=v;do{var ae=D.lane&-536870913,le=ae!==D.lane;if(le?($e&ae)===ae:(f&ae)===ae){ae!==0&&ae===Io&&(up=!0),ce!==null&&(ce=ce.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var ve=r,Te=D;ae=o;var it=c;switch(Te.tag){case 1:if(ve=Te.payload,typeof ve=="function"){he=ve.call(it,he,ae);break e}he=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Te.payload,ae=typeof ve=="function"?ve.call(it,he,ae):ve,ae==null)break e;he=m({},he,ae);break e;case 2:Pr=!0}}ae=D.callback,ae!==null&&(r.flags|=64,le&&(r.flags|=8192),le=g.callbacks,le===null?g.callbacks=[ae]:le.push(ae))}else le={lane:ae,tag:D.tag,payload:D.payload,callback:D.callback,next:null},ce===null?(oe=ce=le,Y=he):ce=ce.next=le,E|=ae;if(D=D.next,D===null){if(D=g.shared.pending,D===null)break;le=D,D=le.next,le.next=null,g.lastBaseUpdate=le,g.shared.pending=null}}while(!0);ce===null&&(Y=he),g.baseState=Y,g.firstBaseUpdate=oe,g.lastBaseUpdate=ce,v===null&&(g.shared.lanes=0),Ur|=E,r.lanes=E,r.memoizedState=he}}function wb(r,o){if(typeof r!="function")throw Error(i(191,r));r.call(o)}function xb(r,o){var c=r.callbacks;if(c!==null)for(r.callbacks=null,r=0;r<c.length;r++)wb(c[r],o)}var Vo=L(null),pu=L(0);function Cb(r,o){r=lr,ie(pu,r),ie(Vo,o),lr=r|o.baseLanes}function hp(){ie(pu,lr),ie(Vo,Vo.current)}function dp(){lr=pu.current,Z(Vo),Z(pu)}var Pn=L(null),ei=null;function jr(r){var o=r.alternate;ie(Ct,Ct.current&1),ie(Pn,r),ei===null&&(o===null||Vo.current!==null||o.memoizedState!==null)&&(ei=r)}function fp(r){ie(Ct,Ct.current),ie(Pn,r),ei===null&&(ei=r)}function Eb(r){r.tag===22?(ie(Ct,Ct.current),ie(Pn,r),ei===null&&(ei=r)):zr()}function zr(){ie(Ct,Ct.current),ie(Pn,Pn.current)}function Bn(r){Z(Pn),ei===r&&(ei=null),Z(Ct)}var Ct=L(0);function mu(r){for(var o=r;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||ym(c)||bm(c)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var er=0,Le=null,tt=null,Rt=null,gu=!1,Uo=!1,zs=!1,_u=0,ml=0,Fo=null,ZN=0;function yt(){throw Error(i(321))}function pp(r,o){if(o===null)return!1;for(var c=0;c<o.length&&c<r.length;c++)if(!On(r[c],o[c]))return!1;return!0}function mp(r,o,c,f,g,v){return er=v,Le=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,M.H=r===null||r.memoizedState===null?lS:Mp,zs=!1,v=c(f,g),zs=!1,Uo&&(v=Tb(o,c,f,g)),kb(r),v}function kb(r){M.H=vl;var o=tt!==null&&tt.next!==null;if(er=0,Rt=tt=Le=null,gu=!1,ml=0,Fo=null,o)throw Error(i(300));r===null||Mt||(r=r.dependencies,r!==null&&au(r)&&(Mt=!0))}function Tb(r,o,c,f){Le=r;var g=0;do{if(Uo&&(Fo=null),ml=0,Uo=!1,25<=g)throw Error(i(301));if(g+=1,Rt=tt=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}M.H=cS,v=o(c,f)}while(Uo);return v}function QN(){var r=M.H,o=r.useState()[0];return o=typeof o.then=="function"?gl(o):o,r=r.useState()[0],(tt!==null?tt.memoizedState:null)!==r&&(Le.flags|=1024),o}function gp(){var r=_u!==0;return _u=0,r}function _p(r,o,c){o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~c}function vp(r){if(gu){for(r=r.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}gu=!1}er=0,Rt=tt=Le=null,Uo=!1,ml=_u=0,Fo=null}function mn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?Le.memoizedState=Rt=r:Rt=Rt.next=r,Rt}function Et(){if(tt===null){var r=Le.alternate;r=r!==null?r.memoizedState:null}else r=tt.next;var o=Rt===null?Le.memoizedState:Rt.next;if(o!==null)Rt=o,tt=r;else{if(r===null)throw Le.alternate===null?Error(i(467)):Error(i(310));tt=r,r={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},Rt===null?Le.memoizedState=Rt=r:Rt=Rt.next=r}return Rt}function vu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gl(r){var o=ml;return ml+=1,Fo===null&&(Fo=[]),r=_b(Fo,r,o),o=Le,(Rt===null?o.memoizedState:Rt.next)===null&&(o=o.alternate,M.H=o===null||o.memoizedState===null?lS:Mp),r}function yu(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return gl(r);if(r.$$typeof===R)return nn(r)}throw Error(i(438,String(r)))}function yp(r){var o=null,c=Le.updateQueue;if(c!==null&&(o=c.memoCache),o==null){var f=Le.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(o={data:f.data.map(function(g){return g.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),c===null&&(c=vu(),Le.updateQueue=c),c.memoCache=o,c=o.data[o.index],c===void 0)for(c=o.data[o.index]=Array(r),f=0;f<r;f++)c[f]=$;return o.index++,c}function tr(r,o){return typeof o=="function"?o(r):o}function bu(r){var o=Et();return bp(o,tt,r)}function bp(r,o,c){var f=r.queue;if(f===null)throw Error(i(311));f.lastRenderedReducer=c;var g=r.baseQueue,v=f.pending;if(v!==null){if(g!==null){var E=g.next;g.next=v.next,v.next=E}o.baseQueue=g=v,f.pending=null}if(v=r.baseState,g===null)r.memoizedState=v;else{o=g.next;var D=E=null,Y=null,oe=o,ce=!1;do{var he=oe.lane&-536870913;if(he!==oe.lane?($e&he)===he:(er&he)===he){var ae=oe.revertLane;if(ae===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),he===Io&&(ce=!0);else if((er&ae)===ae){oe=oe.next,ae===Io&&(ce=!0);continue}else he={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},Y===null?(D=Y=he,E=v):Y=Y.next=he,Le.lanes|=ae,Ur|=ae;he=oe.action,zs&&c(v,he),v=oe.hasEagerState?oe.eagerState:c(v,he)}else ae={lane:he,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},Y===null?(D=Y=ae,E=v):Y=Y.next=ae,Le.lanes|=he,Ur|=he;oe=oe.next}while(oe!==null&&oe!==o);if(Y===null?E=v:Y.next=D,!On(v,r.memoizedState)&&(Mt=!0,ce&&(c=jo,c!==null)))throw c;r.memoizedState=v,r.baseState=E,r.baseQueue=Y,f.lastRenderedState=v}return g===null&&(f.lanes=0),[r.memoizedState,f.dispatch]}function Sp(r){var o=Et(),c=o.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=r;var f=c.dispatch,g=c.pending,v=o.memoizedState;if(g!==null){c.pending=null;var E=g=g.next;do v=r(v,E.action),E=E.next;while(E!==g);On(v,o.memoizedState)||(Mt=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),c.lastRenderedState=v}return[v,f]}function Ab(r,o,c){var f=Le,g=Et(),v=Ge;if(v){if(c===void 0)throw Error(i(407));c=c()}else c=o();var E=!On((tt||g).memoizedState,c);if(E&&(g.memoizedState=c,Mt=!0),g=g.queue,Cp(Db.bind(null,f,g,r),[r]),g.getSnapshot!==o||E||Rt!==null&&Rt.memoizedState.tag&1){if(f.flags|=2048,$o(9,{destroy:void 0},Mb.bind(null,f,g,c,o),null),st===null)throw Error(i(349));v||(er&127)!==0||Rb(f,o,c)}return c}function Rb(r,o,c){r.flags|=16384,r={getSnapshot:o,value:c},o=Le.updateQueue,o===null?(o=vu(),Le.updateQueue=o,o.stores=[r]):(c=o.stores,c===null?o.stores=[r]:c.push(r))}function Mb(r,o,c,f){o.value=c,o.getSnapshot=f,Nb(o)&&Ob(r)}function Db(r,o,c){return c(function(){Nb(o)&&Ob(r)})}function Nb(r){var o=r.getSnapshot;r=r.value;try{var c=o();return!On(r,c)}catch{return!0}}function Ob(r){var o=Ms(r,2);o!==null&&An(o,r,2)}function wp(r){var o=mn();if(typeof r=="function"){var c=r;if(r=c(),zs){Ar(!0);try{c()}finally{Ar(!1)}}}return o.memoizedState=o.baseState=r,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:r},o}function Lb(r,o,c,f){return r.baseState=c,bp(r,tt,typeof f=="function"?f:tr)}function JN(r,o,c,f,g){if(xu(r))throw Error(i(485));if(r=o.action,r!==null){var v={payload:g,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){v.listeners.push(E)}};M.T!==null?c(!0):v.isTransition=!1,f(v),c=o.pending,c===null?(v.next=o.pending=v,Pb(o,v)):(v.next=c.next,o.pending=c.next=v)}}function Pb(r,o){var c=o.action,f=o.payload,g=r.state;if(o.isTransition){var v=M.T,E={};M.T=E;try{var D=c(g,f),Y=M.S;Y!==null&&Y(E,D),Bb(r,o,D)}catch(oe){xp(r,o,oe)}finally{v!==null&&E.types!==null&&(v.types=E.types),M.T=v}}else try{v=c(g,f),Bb(r,o,v)}catch(oe){xp(r,o,oe)}}function Bb(r,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(f){Ib(r,o,f)},function(f){return xp(r,o,f)}):Ib(r,o,c)}function Ib(r,o,c){o.status="fulfilled",o.value=c,jb(o),r.state=c,o=r.pending,o!==null&&(c=o.next,c===o?r.pending=null:(c=c.next,o.next=c,Pb(r,c)))}function xp(r,o,c){var f=r.pending;if(r.pending=null,f!==null){f=f.next;do o.status="rejected",o.reason=c,jb(o),o=o.next;while(o!==f)}r.action=null}function jb(r){r=r.listeners;for(var o=0;o<r.length;o++)(0,r[o])()}function zb(r,o){return o}function Hb(r,o){if(Ge){var c=st.formState;if(c!==null){e:{var f=Le;if(Ge){if(ct){t:{for(var g=ct,v=Jn;g.nodeType!==8;){if(!v){g=null;break t}if(g=ti(g.nextSibling),g===null){g=null;break t}}v=g.data,g=v==="F!"||v==="F"?g:null}if(g){ct=ti(g.nextSibling),f=g.data==="F!";break e}}Or(f)}f=!1}f&&(o=c[0])}}return c=mn(),c.memoizedState=c.baseState=o,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zb,lastRenderedState:o},c.queue=f,c=sS.bind(null,Le,f),f.dispatch=c,f=wp(!1),v=Rp.bind(null,Le,!1,f.queue),f=mn(),g={state:o,dispatch:null,action:r,pending:null},f.queue=g,c=JN.bind(null,Le,g,v,c),g.dispatch=c,f.memoizedState=r,[o,c,!1]}function Vb(r){var o=Et();return Ub(o,tt,r)}function Ub(r,o,c){if(o=bp(r,o,zb)[0],r=bu(tr)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var f=gl(o)}catch(E){throw E===zo?uu:E}else f=o;o=Et();var g=o.queue,v=g.dispatch;return c!==o.memoizedState&&(Le.flags|=2048,$o(9,{destroy:void 0},eO.bind(null,g,c),null)),[f,v,r]}function eO(r,o){r.action=o}function Fb(r){var o=Et(),c=tt;if(c!==null)return Ub(o,c,r);Et(),o=o.memoizedState,c=Et();var f=c.queue.dispatch;return c.memoizedState=r,[o,f,!1]}function $o(r,o,c,f){return r={tag:r,create:c,deps:f,inst:o,next:null},o=Le.updateQueue,o===null&&(o=vu(),Le.updateQueue=o),c=o.lastEffect,c===null?o.lastEffect=r.next=r:(f=c.next,c.next=r,r.next=f,o.lastEffect=r),r}function $b(){return Et().memoizedState}function Su(r,o,c,f){var g=mn();Le.flags|=r,g.memoizedState=$o(1|o,{destroy:void 0},c,f===void 0?null:f)}function wu(r,o,c,f){var g=Et();f=f===void 0?null:f;var v=g.memoizedState.inst;tt!==null&&f!==null&&pp(f,tt.memoizedState.deps)?g.memoizedState=$o(o,v,c,f):(Le.flags|=r,g.memoizedState=$o(1|o,v,c,f))}function Wb(r,o){Su(8390656,8,r,o)}function Cp(r,o){wu(2048,8,r,o)}function tO(r){Le.flags|=4;var o=Le.updateQueue;if(o===null)o=vu(),Le.updateQueue=o,o.events=[r];else{var c=o.events;c===null?o.events=[r]:c.push(r)}}function Gb(r){var o=Et().memoizedState;return tO({ref:o,nextImpl:r}),function(){if((Xe&2)!==0)throw Error(i(440));return o.impl.apply(void 0,arguments)}}function qb(r,o){return wu(4,2,r,o)}function Kb(r,o){return wu(4,4,r,o)}function Yb(r,o){if(typeof o=="function"){r=r();var c=o(r);return function(){typeof c=="function"?c():o(null)}}if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function Xb(r,o,c){c=c!=null?c.concat([r]):null,wu(4,4,Yb.bind(null,o,r),c)}function Ep(){}function Zb(r,o){var c=Et();o=o===void 0?null:o;var f=c.memoizedState;return o!==null&&pp(o,f[1])?f[0]:(c.memoizedState=[r,o],r)}function Qb(r,o){var c=Et();o=o===void 0?null:o;var f=c.memoizedState;if(o!==null&&pp(o,f[1]))return f[0];if(f=r(),zs){Ar(!0);try{r()}finally{Ar(!1)}}return c.memoizedState=[f,o],f}function kp(r,o,c){return c===void 0||(er&1073741824)!==0&&($e&261930)===0?r.memoizedState=o:(r.memoizedState=c,r=JS(),Le.lanes|=r,Ur|=r,c)}function Jb(r,o,c,f){return On(c,o)?c:Vo.current!==null?(r=kp(r,c,f),On(r,o)||(Mt=!0),r):(er&42)===0||(er&1073741824)!==0&&($e&261930)===0?(Mt=!0,r.memoizedState=c):(r=JS(),Le.lanes|=r,Ur|=r,o)}function eS(r,o,c,f,g){var v=U.p;U.p=v!==0&&8>v?v:8;var E=M.T,D={};M.T=D,Rp(r,!1,o,c);try{var Y=g(),oe=M.S;if(oe!==null&&oe(D,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var ce=XN(Y,f);_l(r,o,ce,zn(r))}else _l(r,o,f,zn(r))}catch(he){_l(r,o,{then:function(){},status:"rejected",reason:he},zn())}finally{U.p=v,E!==null&&D.types!==null&&(E.types=D.types),M.T=E}}function nO(){}function Tp(r,o,c,f){if(r.tag!==5)throw Error(i(476));var g=tS(r).queue;eS(r,g,o,j,c===null?nO:function(){return nS(r),c(f)})}function tS(r){var o=r.memoizedState;if(o!==null)return o;o={memoizedState:j,baseState:j,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:j},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:c},next:null},r.memoizedState=o,r=r.alternate,r!==null&&(r.memoizedState=o),o}function nS(r){var o=tS(r);o.next===null&&(o=r.alternate.memoizedState),_l(r,o.next.queue,{},zn())}function Ap(){return nn(Ll)}function iS(){return Et().memoizedState}function rS(){return Et().memoizedState}function iO(r){for(var o=r.return;o!==null;){switch(o.tag){case 24:case 3:var c=zn();r=Br(c);var f=Ir(o,r,c);f!==null&&(An(f,o,c),dl(f,o,c)),o={cache:ip()},r.payload=o;return}o=o.return}}function rO(r,o,c){var f=zn();c={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},xu(r)?oS(o,c):(c=Gf(r,o,c,f),c!==null&&(An(c,r,f),aS(c,o,f)))}function sS(r,o,c){var f=zn();_l(r,o,c,f)}function _l(r,o,c,f){var g={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(xu(r))oS(o,g);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var E=o.lastRenderedState,D=v(E,c);if(g.hasEagerState=!0,g.eagerState=D,On(D,E))return iu(r,o,g,0),st===null&&nu(),!1}catch{}if(c=Gf(r,o,g,f),c!==null)return An(c,r,f),aS(c,o,f),!0}return!1}function Rp(r,o,c,f){if(f={lane:2,revertLane:am(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},xu(r)){if(o)throw Error(i(479))}else o=Gf(r,c,f,2),o!==null&&An(o,r,2)}function xu(r){var o=r.alternate;return r===Le||o!==null&&o===Le}function oS(r,o){Uo=gu=!0;var c=r.pending;c===null?o.next=o:(o.next=c.next,c.next=o),r.pending=o}function aS(r,o,c){if((c&4194048)!==0){var f=o.lanes;f&=r.pendingLanes,c|=f,o.lanes=c,d0(r,c)}}var vl={readContext:nn,use:yu,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt};vl.useEffectEvent=yt;var lS={readContext:nn,use:yu,useCallback:function(r,o){return mn().memoizedState=[r,o===void 0?null:o],r},useContext:nn,useEffect:Wb,useImperativeHandle:function(r,o,c){c=c!=null?c.concat([r]):null,Su(4194308,4,Yb.bind(null,o,r),c)},useLayoutEffect:function(r,o){return Su(4194308,4,r,o)},useInsertionEffect:function(r,o){Su(4,2,r,o)},useMemo:function(r,o){var c=mn();o=o===void 0?null:o;var f=r();if(zs){Ar(!0);try{r()}finally{Ar(!1)}}return c.memoizedState=[f,o],f},useReducer:function(r,o,c){var f=mn();if(c!==void 0){var g=c(o);if(zs){Ar(!0);try{c(o)}finally{Ar(!1)}}}else g=o;return f.memoizedState=f.baseState=g,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:g},f.queue=r,r=r.dispatch=rO.bind(null,Le,r),[f.memoizedState,r]},useRef:function(r){var o=mn();return r={current:r},o.memoizedState=r},useState:function(r){r=wp(r);var o=r.queue,c=sS.bind(null,Le,o);return o.dispatch=c,[r.memoizedState,c]},useDebugValue:Ep,useDeferredValue:function(r,o){var c=mn();return kp(c,r,o)},useTransition:function(){var r=wp(!1);return r=eS.bind(null,Le,r.queue,!0,!1),mn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,o,c){var f=Le,g=mn();if(Ge){if(c===void 0)throw Error(i(407));c=c()}else{if(c=o(),st===null)throw Error(i(349));($e&127)!==0||Rb(f,o,c)}g.memoizedState=c;var v={value:c,getSnapshot:o};return g.queue=v,Wb(Db.bind(null,f,v,r),[r]),f.flags|=2048,$o(9,{destroy:void 0},Mb.bind(null,f,v,c,o),null),c},useId:function(){var r=mn(),o=st.identifierPrefix;if(Ge){var c=Ai,f=Ti;c=(f&~(1<<32-Nn(f)-1)).toString(32)+c,o="_"+o+"R_"+c,c=_u++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=ZN++,o="_"+o+"r_"+c.toString(32)+"_";return r.memoizedState=o},useHostTransitionStatus:Ap,useFormState:Hb,useActionState:Hb,useOptimistic:function(r){var o=mn();o.memoizedState=o.baseState=r;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=Rp.bind(null,Le,!0,c),c.dispatch=o,[r,o]},useMemoCache:yp,useCacheRefresh:function(){return mn().memoizedState=iO.bind(null,Le)},useEffectEvent:function(r){var o=mn(),c={impl:r};return o.memoizedState=c,function(){if((Xe&2)!==0)throw Error(i(440));return c.impl.apply(void 0,arguments)}}},Mp={readContext:nn,use:yu,useCallback:Zb,useContext:nn,useEffect:Cp,useImperativeHandle:Xb,useInsertionEffect:qb,useLayoutEffect:Kb,useMemo:Qb,useReducer:bu,useRef:$b,useState:function(){return bu(tr)},useDebugValue:Ep,useDeferredValue:function(r,o){var c=Et();return Jb(c,tt.memoizedState,r,o)},useTransition:function(){var r=bu(tr)[0],o=Et().memoizedState;return[typeof r=="boolean"?r:gl(r),o]},useSyncExternalStore:Ab,useId:iS,useHostTransitionStatus:Ap,useFormState:Vb,useActionState:Vb,useOptimistic:function(r,o){var c=Et();return Lb(c,tt,r,o)},useMemoCache:yp,useCacheRefresh:rS};Mp.useEffectEvent=Gb;var cS={readContext:nn,use:yu,useCallback:Zb,useContext:nn,useEffect:Cp,useImperativeHandle:Xb,useInsertionEffect:qb,useLayoutEffect:Kb,useMemo:Qb,useReducer:Sp,useRef:$b,useState:function(){return Sp(tr)},useDebugValue:Ep,useDeferredValue:function(r,o){var c=Et();return tt===null?kp(c,r,o):Jb(c,tt.memoizedState,r,o)},useTransition:function(){var r=Sp(tr)[0],o=Et().memoizedState;return[typeof r=="boolean"?r:gl(r),o]},useSyncExternalStore:Ab,useId:iS,useHostTransitionStatus:Ap,useFormState:Fb,useActionState:Fb,useOptimistic:function(r,o){var c=Et();return tt!==null?Lb(c,tt,r,o):(c.baseState=r,[r,c.queue.dispatch])},useMemoCache:yp,useCacheRefresh:rS};cS.useEffectEvent=Gb;function Dp(r,o,c,f){o=r.memoizedState,c=c(f,o),c=c==null?o:m({},o,c),r.memoizedState=c,r.lanes===0&&(r.updateQueue.baseState=c)}var Np={enqueueSetState:function(r,o,c){r=r._reactInternals;var f=zn(),g=Br(f);g.payload=o,c!=null&&(g.callback=c),o=Ir(r,g,f),o!==null&&(An(o,r,f),dl(o,r,f))},enqueueReplaceState:function(r,o,c){r=r._reactInternals;var f=zn(),g=Br(f);g.tag=1,g.payload=o,c!=null&&(g.callback=c),o=Ir(r,g,f),o!==null&&(An(o,r,f),dl(o,r,f))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var c=zn(),f=Br(c);f.tag=2,o!=null&&(f.callback=o),o=Ir(r,f,c),o!==null&&(An(o,r,c),dl(o,r,c))}};function uS(r,o,c,f,g,v,E){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(f,v,E):o.prototype&&o.prototype.isPureReactComponent?!rl(c,f)||!rl(g,v):!0}function hS(r,o,c,f){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,f),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,f),o.state!==r&&Np.enqueueReplaceState(o,o.state,null)}function Hs(r,o){var c=o;if("ref"in o){c={};for(var f in o)f!=="ref"&&(c[f]=o[f])}if(r=r.defaultProps){c===o&&(c=m({},c));for(var g in r)c[g]===void 0&&(c[g]=r[g])}return c}function dS(r){tu(r)}function fS(r){console.error(r)}function pS(r){tu(r)}function Cu(r,o){try{var c=r.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(f){setTimeout(function(){throw f})}}function mS(r,o,c){try{var f=r.onCaughtError;f(c.value,{componentStack:c.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Op(r,o,c){return c=Br(c),c.tag=3,c.payload={element:null},c.callback=function(){Cu(r,o)},c}function gS(r){return r=Br(r),r.tag=3,r}function _S(r,o,c,f){var g=c.type.getDerivedStateFromError;if(typeof g=="function"){var v=f.value;r.payload=function(){return g(v)},r.callback=function(){mS(o,c,f)}}var E=c.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(r.callback=function(){mS(o,c,f),typeof g!="function"&&(Fr===null?Fr=new Set([this]):Fr.add(this));var D=f.stack;this.componentDidCatch(f.value,{componentStack:D!==null?D:""})})}function sO(r,o,c,f,g){if(c.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(o=c.alternate,o!==null&&Bo(o,c,g,!0),c=Pn.current,c!==null){switch(c.tag){case 31:case 13:return ei===null?Bu():c.alternate===null&&bt===0&&(bt=3),c.flags&=-257,c.flags|=65536,c.lanes=g,f===hu?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([f]):o.add(f),rm(r,f,g)),!1;case 22:return c.flags|=65536,f===hu?c.flags|=16384:(o=c.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([f])},c.updateQueue=o):(c=o.retryQueue,c===null?o.retryQueue=new Set([f]):c.add(f)),rm(r,f,g)),!1}throw Error(i(435,c.tag))}return rm(r,f,g),Bu(),!1}if(Ge)return o=Pn.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=g,f!==Qf&&(r=Error(i(422),{cause:f}),al(Xn(r,c)))):(f!==Qf&&(o=Error(i(423),{cause:f}),al(Xn(o,c))),r=r.current.alternate,r.flags|=65536,g&=-g,r.lanes|=g,f=Xn(f,c),g=Op(r.stateNode,f,g),cp(r,g),bt!==4&&(bt=2)),!1;var v=Error(i(520),{cause:f});if(v=Xn(v,c),kl===null?kl=[v]:kl.push(v),bt!==4&&(bt=2),o===null)return!0;f=Xn(f,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,r=g&-g,c.lanes|=r,r=Op(c.stateNode,f,r),cp(c,r),!1;case 1:if(o=c.type,v=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Fr===null||!Fr.has(v))))return c.flags|=65536,g&=-g,c.lanes|=g,g=gS(g),_S(g,r,c,f),cp(c,g),!1}c=c.return}while(c!==null);return!1}var Lp=Error(i(461)),Mt=!1;function rn(r,o,c,f){o.child=r===null?Sb(o,null,c,f):js(o,r.child,c,f)}function vS(r,o,c,f,g){c=c.render;var v=o.ref;if("ref"in f){var E={};for(var D in f)D!=="ref"&&(E[D]=f[D])}else E=f;return Ls(o),f=mp(r,o,c,E,v,g),D=gp(),r!==null&&!Mt?(_p(r,o,g),nr(r,o,g)):(Ge&&D&&Xf(o),o.flags|=1,rn(r,o,f,g),o.child)}function yS(r,o,c,f,g){if(r===null){var v=c.type;return typeof v=="function"&&!qf(v)&&v.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=v,bS(r,o,v,f,g)):(r=su(c.type,null,f,o,o.mode,g),r.ref=o.ref,r.return=o,o.child=r)}if(v=r.child,!Up(r,g)){var E=v.memoizedProps;if(c=c.compare,c=c!==null?c:rl,c(E,f)&&r.ref===o.ref)return nr(r,o,g)}return o.flags|=1,r=Xi(v,f),r.ref=o.ref,r.return=o,o.child=r}function bS(r,o,c,f,g){if(r!==null){var v=r.memoizedProps;if(rl(v,f)&&r.ref===o.ref)if(Mt=!1,o.pendingProps=f=v,Up(r,g))(r.flags&131072)!==0&&(Mt=!0);else return o.lanes=r.lanes,nr(r,o,g)}return Pp(r,o,c,f,g)}function SS(r,o,c,f){var g=f.children,v=r!==null?r.memoizedState:null;if(r===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((o.flags&128)!==0){if(v=v!==null?v.baseLanes|c:c,r!==null){for(f=o.child=r.child,g=0;f!==null;)g=g|f.lanes|f.childLanes,f=f.sibling;f=g&~v}else f=0,o.child=null;return wS(r,o,v,c,f)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},r!==null&&cu(o,v!==null?v.cachePool:null),v!==null?Cb(o,v):hp(),Eb(o);else return f=o.lanes=536870912,wS(r,o,v!==null?v.baseLanes|c:c,c,f)}else v!==null?(cu(o,v.cachePool),Cb(o,v),zr(),o.memoizedState=null):(r!==null&&cu(o,null),hp(),zr());return rn(r,o,g,c),o.child}function yl(r,o){return r!==null&&r.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function wS(r,o,c,f,g){var v=sp();return v=v===null?null:{parent:At._currentValue,pool:v},o.memoizedState={baseLanes:c,cachePool:v},r!==null&&cu(o,null),hp(),Eb(o),r!==null&&Bo(r,o,f,!0),o.childLanes=g,null}function Eu(r,o){return o=Tu({mode:o.mode,children:o.children},r.mode),o.ref=r.ref,r.child=o,o.return=r,o}function xS(r,o,c){return js(o,r.child,null,c),r=Eu(o,o.pendingProps),r.flags|=2,Bn(o),o.memoizedState=null,r}function oO(r,o,c){var f=o.pendingProps,g=(o.flags&128)!==0;if(o.flags&=-129,r===null){if(Ge){if(f.mode==="hidden")return r=Eu(o,f),o.lanes=536870912,yl(null,r);if(fp(o),(r=ct)?(r=Pw(r,Jn),r=r!==null&&r.data==="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:Dr!==null?{id:Ti,overflow:Ai}:null,retryLane:536870912,hydrationErrors:null},c=ob(r),c.return=o,o.child=c,tn=o,ct=null)):r=null,r===null)throw Or(o);return o.lanes=536870912,null}return Eu(o,f)}var v=r.memoizedState;if(v!==null){var E=v.dehydrated;if(fp(o),g)if(o.flags&256)o.flags&=-257,o=xS(r,o,c);else if(o.memoizedState!==null)o.child=r.child,o.flags|=128,o=null;else throw Error(i(558));else if(Mt||Bo(r,o,c,!1),g=(c&r.childLanes)!==0,Mt||g){if(f=st,f!==null&&(E=f0(f,c),E!==0&&E!==v.retryLane))throw v.retryLane=E,Ms(r,E),An(f,r,E),Lp;Bu(),o=xS(r,o,c)}else r=v.treeContext,ct=ti(E.nextSibling),tn=o,Ge=!0,Nr=null,Jn=!1,r!==null&&cb(o,r),o=Eu(o,f),o.flags|=4096;return o}return r=Xi(r.child,{mode:f.mode,children:f.children}),r.ref=o.ref,o.child=r,r.return=o,r}function ku(r,o){var c=o.ref;if(c===null)r!==null&&r.ref!==null&&(o.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(i(284));(r===null||r.ref!==c)&&(o.flags|=4194816)}}function Pp(r,o,c,f,g){return Ls(o),c=mp(r,o,c,f,void 0,g),f=gp(),r!==null&&!Mt?(_p(r,o,g),nr(r,o,g)):(Ge&&f&&Xf(o),o.flags|=1,rn(r,o,c,g),o.child)}function CS(r,o,c,f,g,v){return Ls(o),o.updateQueue=null,c=Tb(o,f,c,g),kb(r),f=gp(),r!==null&&!Mt?(_p(r,o,v),nr(r,o,v)):(Ge&&f&&Xf(o),o.flags|=1,rn(r,o,c,v),o.child)}function ES(r,o,c,f,g){if(Ls(o),o.stateNode===null){var v=No,E=c.contextType;typeof E=="object"&&E!==null&&(v=nn(E)),v=new c(f,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Np,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=f,v.state=o.memoizedState,v.refs={},ap(o),E=c.contextType,v.context=typeof E=="object"&&E!==null?nn(E):No,v.state=o.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(Dp(o,c,E,f),v.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(E=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),E!==v.state&&Np.enqueueReplaceState(v,v.state,null),pl(o,f,v,g),fl(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),f=!0}else if(r===null){v=o.stateNode;var D=o.memoizedProps,Y=Hs(c,D);v.props=Y;var oe=v.context,ce=c.contextType;E=No,typeof ce=="object"&&ce!==null&&(E=nn(ce));var he=c.getDerivedStateFromProps;ce=typeof he=="function"||typeof v.getSnapshotBeforeUpdate=="function",D=o.pendingProps!==D,ce||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(D||oe!==E)&&hS(o,v,f,E),Pr=!1;var ae=o.memoizedState;v.state=ae,pl(o,f,v,g),fl(),oe=o.memoizedState,D||ae!==oe||Pr?(typeof he=="function"&&(Dp(o,c,he,f),oe=o.memoizedState),(Y=Pr||uS(o,c,Y,f,ae,oe,E))?(ce||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(o.flags|=4194308)):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=f,o.memoizedState=oe),v.props=f,v.state=oe,v.context=E,f=Y):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),f=!1)}else{v=o.stateNode,lp(r,o),E=o.memoizedProps,ce=Hs(c,E),v.props=ce,he=o.pendingProps,ae=v.context,oe=c.contextType,Y=No,typeof oe=="object"&&oe!==null&&(Y=nn(oe)),D=c.getDerivedStateFromProps,(oe=typeof D=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(E!==he||ae!==Y)&&hS(o,v,f,Y),Pr=!1,ae=o.memoizedState,v.state=ae,pl(o,f,v,g),fl();var le=o.memoizedState;E!==he||ae!==le||Pr||r!==null&&r.dependencies!==null&&au(r.dependencies)?(typeof D=="function"&&(Dp(o,c,D,f),le=o.memoizedState),(ce=Pr||uS(o,c,ce,f,ae,le,Y)||r!==null&&r.dependencies!==null&&au(r.dependencies))?(oe||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(f,le,Y),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(f,le,Y)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||E===r.memoizedProps&&ae===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&ae===r.memoizedState||(o.flags|=1024),o.memoizedProps=f,o.memoizedState=le),v.props=f,v.state=le,v.context=Y,f=ce):(typeof v.componentDidUpdate!="function"||E===r.memoizedProps&&ae===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&ae===r.memoizedState||(o.flags|=1024),f=!1)}return v=f,ku(r,o),f=(o.flags&128)!==0,v||f?(v=o.stateNode,c=f&&typeof c.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,r!==null&&f?(o.child=js(o,r.child,null,g),o.child=js(o,null,c,g)):rn(r,o,c,g),o.memoizedState=v.state,r=o.child):r=nr(r,o,g),r}function kS(r,o,c,f){return Ns(),o.flags|=256,rn(r,o,c,f),o.child}var Bp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ip(r){return{baseLanes:r,cachePool:mb()}}function jp(r,o,c){return r=r!==null?r.childLanes&~c:0,o&&(r|=jn),r}function TS(r,o,c){var f=o.pendingProps,g=!1,v=(o.flags&128)!==0,E;if((E=v)||(E=r!==null&&r.memoizedState===null?!1:(Ct.current&2)!==0),E&&(g=!0,o.flags&=-129),E=(o.flags&32)!==0,o.flags&=-33,r===null){if(Ge){if(g?jr(o):zr(),(r=ct)?(r=Pw(r,Jn),r=r!==null&&r.data!=="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:Dr!==null?{id:Ti,overflow:Ai}:null,retryLane:536870912,hydrationErrors:null},c=ob(r),c.return=o,o.child=c,tn=o,ct=null)):r=null,r===null)throw Or(o);return bm(r)?o.lanes=32:o.lanes=536870912,null}var D=f.children;return f=f.fallback,g?(zr(),g=o.mode,D=Tu({mode:"hidden",children:D},g),f=Ds(f,g,c,null),D.return=o,f.return=o,D.sibling=f,o.child=D,f=o.child,f.memoizedState=Ip(c),f.childLanes=jp(r,E,c),o.memoizedState=Bp,yl(null,f)):(jr(o),zp(o,D))}var Y=r.memoizedState;if(Y!==null&&(D=Y.dehydrated,D!==null)){if(v)o.flags&256?(jr(o),o.flags&=-257,o=Hp(r,o,c)):o.memoizedState!==null?(zr(),o.child=r.child,o.flags|=128,o=null):(zr(),D=f.fallback,g=o.mode,f=Tu({mode:"visible",children:f.children},g),D=Ds(D,g,c,null),D.flags|=2,f.return=o,D.return=o,f.sibling=D,o.child=f,js(o,r.child,null,c),f=o.child,f.memoizedState=Ip(c),f.childLanes=jp(r,E,c),o.memoizedState=Bp,o=yl(null,f));else if(jr(o),bm(D)){if(E=D.nextSibling&&D.nextSibling.dataset,E)var oe=E.dgst;E=oe,f=Error(i(419)),f.stack="",f.digest=E,al({value:f,source:null,stack:null}),o=Hp(r,o,c)}else if(Mt||Bo(r,o,c,!1),E=(c&r.childLanes)!==0,Mt||E){if(E=st,E!==null&&(f=f0(E,c),f!==0&&f!==Y.retryLane))throw Y.retryLane=f,Ms(r,f),An(E,r,f),Lp;ym(D)||Bu(),o=Hp(r,o,c)}else ym(D)?(o.flags|=192,o.child=r.child,o=null):(r=Y.treeContext,ct=ti(D.nextSibling),tn=o,Ge=!0,Nr=null,Jn=!1,r!==null&&cb(o,r),o=zp(o,f.children),o.flags|=4096);return o}return g?(zr(),D=f.fallback,g=o.mode,Y=r.child,oe=Y.sibling,f=Xi(Y,{mode:"hidden",children:f.children}),f.subtreeFlags=Y.subtreeFlags&65011712,oe!==null?D=Xi(oe,D):(D=Ds(D,g,c,null),D.flags|=2),D.return=o,f.return=o,f.sibling=D,o.child=f,yl(null,f),f=o.child,D=r.child.memoizedState,D===null?D=Ip(c):(g=D.cachePool,g!==null?(Y=At._currentValue,g=g.parent!==Y?{parent:Y,pool:Y}:g):g=mb(),D={baseLanes:D.baseLanes|c,cachePool:g}),f.memoizedState=D,f.childLanes=jp(r,E,c),o.memoizedState=Bp,yl(r.child,f)):(jr(o),c=r.child,r=c.sibling,c=Xi(c,{mode:"visible",children:f.children}),c.return=o,c.sibling=null,r!==null&&(E=o.deletions,E===null?(o.deletions=[r],o.flags|=16):E.push(r)),o.child=c,o.memoizedState=null,c)}function zp(r,o){return o=Tu({mode:"visible",children:o},r.mode),o.return=r,r.child=o}function Tu(r,o){return r=Ln(22,r,null,o),r.lanes=0,r}function Hp(r,o,c){return js(o,r.child,null,c),r=zp(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function AS(r,o,c){r.lanes|=o;var f=r.alternate;f!==null&&(f.lanes|=o),tp(r.return,o,c)}function Vp(r,o,c,f,g,v){var E=r.memoizedState;E===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:f,tail:c,tailMode:g,treeForkCount:v}:(E.isBackwards=o,E.rendering=null,E.renderingStartTime=0,E.last=f,E.tail=c,E.tailMode=g,E.treeForkCount=v)}function RS(r,o,c){var f=o.pendingProps,g=f.revealOrder,v=f.tail;f=f.children;var E=Ct.current,D=(E&2)!==0;if(D?(E=E&1|2,o.flags|=128):E&=1,ie(Ct,E),rn(r,o,f,c),f=Ge?ol:0,!D&&r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&AS(r,c,o);else if(r.tag===19)AS(r,c,o);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===o)break e;for(;r.sibling===null;){if(r.return===null||r.return===o)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(g){case"forwards":for(c=o.child,g=null;c!==null;)r=c.alternate,r!==null&&mu(r)===null&&(g=c),c=c.sibling;c=g,c===null?(g=o.child,o.child=null):(g=c.sibling,c.sibling=null),Vp(o,!1,g,c,v,f);break;case"backwards":case"unstable_legacy-backwards":for(c=null,g=o.child,o.child=null;g!==null;){if(r=g.alternate,r!==null&&mu(r)===null){o.child=g;break}r=g.sibling,g.sibling=c,c=g,g=r}Vp(o,!0,c,null,v,f);break;case"together":Vp(o,!1,null,null,void 0,f);break;default:o.memoizedState=null}return o.child}function nr(r,o,c){if(r!==null&&(o.dependencies=r.dependencies),Ur|=o.lanes,(c&o.childLanes)===0)if(r!==null){if(Bo(r,o,c,!1),(c&o.childLanes)===0)return null}else return null;if(r!==null&&o.child!==r.child)throw Error(i(153));if(o.child!==null){for(r=o.child,c=Xi(r,r.pendingProps),o.child=c,c.return=o;r.sibling!==null;)r=r.sibling,c=c.sibling=Xi(r,r.pendingProps),c.return=o;c.sibling=null}return o.child}function Up(r,o){return(r.lanes&o)!==0?!0:(r=r.dependencies,!!(r!==null&&au(r)))}function aO(r,o,c){switch(o.tag){case 3:ne(o,o.stateNode.containerInfo),Lr(o,At,r.memoizedState.cache),Ns();break;case 27:case 5:fe(o);break;case 4:ne(o,o.stateNode.containerInfo);break;case 10:Lr(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,fp(o),null;break;case 13:var f=o.memoizedState;if(f!==null)return f.dehydrated!==null?(jr(o),o.flags|=128,null):(c&o.child.childLanes)!==0?TS(r,o,c):(jr(o),r=nr(r,o,c),r!==null?r.sibling:null);jr(o);break;case 19:var g=(r.flags&128)!==0;if(f=(c&o.childLanes)!==0,f||(Bo(r,o,c,!1),f=(c&o.childLanes)!==0),g){if(f)return RS(r,o,c);o.flags|=128}if(g=o.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),ie(Ct,Ct.current),f)break;return null;case 22:return o.lanes=0,SS(r,o,c,o.pendingProps);case 24:Lr(o,At,r.memoizedState.cache)}return nr(r,o,c)}function MS(r,o,c){if(r!==null)if(r.memoizedProps!==o.pendingProps)Mt=!0;else{if(!Up(r,c)&&(o.flags&128)===0)return Mt=!1,aO(r,o,c);Mt=(r.flags&131072)!==0}else Mt=!1,Ge&&(o.flags&1048576)!==0&&lb(o,ol,o.index);switch(o.lanes=0,o.tag){case 16:e:{var f=o.pendingProps;if(r=Bs(o.elementType),o.type=r,typeof r=="function")qf(r)?(f=Hs(r,f),o.tag=1,o=ES(null,o,r,f,c)):(o.tag=0,o=Pp(null,o,r,f,c));else{if(r!=null){var g=r.$$typeof;if(g===A){o.tag=11,o=vS(null,o,r,f,c);break e}else if(g===H){o.tag=14,o=yS(null,o,r,f,c);break e}}throw o=B(r)||r,Error(i(306,o,""))}}return o;case 0:return Pp(r,o,o.type,o.pendingProps,c);case 1:return f=o.type,g=Hs(f,o.pendingProps),ES(r,o,f,g,c);case 3:e:{if(ne(o,o.stateNode.containerInfo),r===null)throw Error(i(387));f=o.pendingProps;var v=o.memoizedState;g=v.element,lp(r,o),pl(o,f,null,c);var E=o.memoizedState;if(f=E.cache,Lr(o,At,f),f!==v.cache&&np(o,[At],c,!0),fl(),f=E.element,v.isDehydrated)if(v={element:f,isDehydrated:!1,cache:E.cache},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){o=kS(r,o,f,c);break e}else if(f!==g){g=Xn(Error(i(424)),o),al(g),o=kS(r,o,f,c);break e}else for(r=o.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,ct=ti(r.firstChild),tn=o,Ge=!0,Nr=null,Jn=!0,c=Sb(o,null,f,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Ns(),f===g){o=nr(r,o,c);break e}rn(r,o,f,c)}o=o.child}return o;case 26:return ku(r,o),r===null?(c=Vw(o.type,null,o.pendingProps,null))?o.memoizedState=c:Ge||(c=o.type,r=o.pendingProps,f=Fu(G.current).createElement(c),f[en]=o,f[wn]=r,sn(f,c,r),Wt(f),o.stateNode=f):o.memoizedState=Vw(o.type,r.memoizedProps,o.pendingProps,r.memoizedState),null;case 27:return fe(o),r===null&&Ge&&(f=o.stateNode=jw(o.type,o.pendingProps,G.current),tn=o,Jn=!0,g=ct,qr(o.type)?(Sm=g,ct=ti(f.firstChild)):ct=g),rn(r,o,o.pendingProps.children,c),ku(r,o),r===null&&(o.flags|=4194304),o.child;case 5:return r===null&&Ge&&((g=f=ct)&&(f=IO(f,o.type,o.pendingProps,Jn),f!==null?(o.stateNode=f,tn=o,ct=ti(f.firstChild),Jn=!1,g=!0):g=!1),g||Or(o)),fe(o),g=o.type,v=o.pendingProps,E=r!==null?r.memoizedProps:null,f=v.children,gm(g,v)?f=null:E!==null&&gm(g,E)&&(o.flags|=32),o.memoizedState!==null&&(g=mp(r,o,QN,null,null,c),Ll._currentValue=g),ku(r,o),rn(r,o,f,c),o.child;case 6:return r===null&&Ge&&((r=c=ct)&&(c=jO(c,o.pendingProps,Jn),c!==null?(o.stateNode=c,tn=o,ct=null,r=!0):r=!1),r||Or(o)),null;case 13:return TS(r,o,c);case 4:return ne(o,o.stateNode.containerInfo),f=o.pendingProps,r===null?o.child=js(o,null,f,c):rn(r,o,f,c),o.child;case 11:return vS(r,o,o.type,o.pendingProps,c);case 7:return rn(r,o,o.pendingProps,c),o.child;case 8:return rn(r,o,o.pendingProps.children,c),o.child;case 12:return rn(r,o,o.pendingProps.children,c),o.child;case 10:return f=o.pendingProps,Lr(o,o.type,f.value),rn(r,o,f.children,c),o.child;case 9:return g=o.type._context,f=o.pendingProps.children,Ls(o),g=nn(g),f=f(g),o.flags|=1,rn(r,o,f,c),o.child;case 14:return yS(r,o,o.type,o.pendingProps,c);case 15:return bS(r,o,o.type,o.pendingProps,c);case 19:return RS(r,o,c);case 31:return oO(r,o,c);case 22:return SS(r,o,c,o.pendingProps);case 24:return Ls(o),f=nn(At),r===null?(g=sp(),g===null&&(g=st,v=ip(),g.pooledCache=v,v.refCount++,v!==null&&(g.pooledCacheLanes|=c),g=v),o.memoizedState={parent:f,cache:g},ap(o),Lr(o,At,g)):((r.lanes&c)!==0&&(lp(r,o),pl(o,null,null,c),fl()),g=r.memoizedState,v=o.memoizedState,g.parent!==f?(g={parent:f,cache:f},o.memoizedState=g,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=g),Lr(o,At,f)):(f=v.cache,Lr(o,At,f),f!==g.cache&&np(o,[At],c,!0))),rn(r,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(i(156,o.tag))}function ir(r){r.flags|=4}function Fp(r,o,c,f,g){if((o=(r.mode&32)!==0)&&(o=!1),o){if(r.flags|=16777216,(g&335544128)===g)if(r.stateNode.complete)r.flags|=8192;else if(iw())r.flags|=8192;else throw Is=hu,op}else r.flags&=-16777217}function DS(r,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Gw(o))if(iw())r.flags|=8192;else throw Is=hu,op}function Au(r,o){o!==null&&(r.flags|=4),r.flags&16384&&(o=r.tag!==22?u0():536870912,r.lanes|=o,Ko|=o)}function bl(r,o){if(!Ge)switch(r.tailMode){case"hidden":o=r.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?r.tail=null:c.sibling=null;break;case"collapsed":c=r.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:f.sibling=null}}function ut(r){var o=r.alternate!==null&&r.alternate.child===r.child,c=0,f=0;if(o)for(var g=r.child;g!==null;)c|=g.lanes|g.childLanes,f|=g.subtreeFlags&65011712,f|=g.flags&65011712,g.return=r,g=g.sibling;else for(g=r.child;g!==null;)c|=g.lanes|g.childLanes,f|=g.subtreeFlags,f|=g.flags,g.return=r,g=g.sibling;return r.subtreeFlags|=f,r.childLanes=c,o}function lO(r,o,c){var f=o.pendingProps;switch(Zf(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(o),null;case 1:return ut(o),null;case 3:return c=o.stateNode,f=null,r!==null&&(f=r.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),Ji(At),re(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(r===null||r.child===null)&&(Po(o)?ir(o):r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Jf())),ut(o),null;case 26:var g=o.type,v=o.memoizedState;return r===null?(ir(o),v!==null?(ut(o),DS(o,v)):(ut(o),Fp(o,g,null,f,c))):v?v!==r.memoizedState?(ir(o),ut(o),DS(o,v)):(ut(o),o.flags&=-16777217):(r=r.memoizedProps,r!==f&&ir(o),ut(o),Fp(o,g,r,f,c)),null;case 27:if(pe(o),c=G.current,g=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==f&&ir(o);else{if(!f){if(o.stateNode===null)throw Error(i(166));return ut(o),null}r=F.current,Po(o)?ub(o):(r=jw(g,f,c),o.stateNode=r,ir(o))}return ut(o),null;case 5:if(pe(o),g=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==f&&ir(o);else{if(!f){if(o.stateNode===null)throw Error(i(166));return ut(o),null}if(v=F.current,Po(o))ub(o);else{var E=Fu(G.current);switch(v){case 1:v=E.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:v=E.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":v=E.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":v=E.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":v=E.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof f.is=="string"?E.createElement("select",{is:f.is}):E.createElement("select"),f.multiple?v.multiple=!0:f.size&&(v.size=f.size);break;default:v=typeof f.is=="string"?E.createElement(g,{is:f.is}):E.createElement(g)}}v[en]=o,v[wn]=f;e:for(E=o.child;E!==null;){if(E.tag===5||E.tag===6)v.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===o)break e;for(;E.sibling===null;){if(E.return===null||E.return===o)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}o.stateNode=v;e:switch(sn(v,g,f),g){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&ir(o)}}return ut(o),Fp(o,o.type,r===null?null:r.memoizedProps,o.pendingProps,c),null;case 6:if(r&&o.stateNode!=null)r.memoizedProps!==f&&ir(o);else{if(typeof f!="string"&&o.stateNode===null)throw Error(i(166));if(r=G.current,Po(o)){if(r=o.stateNode,c=o.memoizedProps,f=null,g=tn,g!==null)switch(g.tag){case 27:case 5:f=g.memoizedProps}r[en]=o,r=!!(r.nodeValue===c||f!==null&&f.suppressHydrationWarning===!0||Tw(r.nodeValue,c)),r||Or(o,!0)}else r=Fu(r).createTextNode(f),r[en]=o,o.stateNode=r}return ut(o),null;case 31:if(c=o.memoizedState,r===null||r.memoizedState!==null){if(f=Po(o),c!==null){if(r===null){if(!f)throw Error(i(318));if(r=o.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(557));r[en]=o}else Ns(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;ut(o),r=!1}else c=Jf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=c),r=!0;if(!r)return o.flags&256?(Bn(o),o):(Bn(o),null);if((o.flags&128)!==0)throw Error(i(558))}return ut(o),null;case 13:if(f=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(g=Po(o),f!==null&&f.dehydrated!==null){if(r===null){if(!g)throw Error(i(318));if(g=o.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(i(317));g[en]=o}else Ns(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;ut(o),g=!1}else g=Jf(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=g),g=!0;if(!g)return o.flags&256?(Bn(o),o):(Bn(o),null)}return Bn(o),(o.flags&128)!==0?(o.lanes=c,o):(c=f!==null,r=r!==null&&r.memoizedState!==null,c&&(f=o.child,g=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(g=f.alternate.memoizedState.cachePool.pool),v=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(v=f.memoizedState.cachePool.pool),v!==g&&(f.flags|=2048)),c!==r&&c&&(o.child.flags|=8192),Au(o,o.updateQueue),ut(o),null);case 4:return re(),r===null&&hm(o.stateNode.containerInfo),ut(o),null;case 10:return Ji(o.type),ut(o),null;case 19:if(Z(Ct),f=o.memoizedState,f===null)return ut(o),null;if(g=(o.flags&128)!==0,v=f.rendering,v===null)if(g)bl(f,!1);else{if(bt!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(v=mu(r),v!==null){for(o.flags|=128,bl(f,!1),r=v.updateQueue,o.updateQueue=r,Au(o,r),o.subtreeFlags=0,r=c,c=o.child;c!==null;)sb(c,r),c=c.sibling;return ie(Ct,Ct.current&1|2),Ge&&Zi(o,f.treeForkCount),o.child}r=r.sibling}f.tail!==null&&Jt()>Ou&&(o.flags|=128,g=!0,bl(f,!1),o.lanes=4194304)}else{if(!g)if(r=mu(v),r!==null){if(o.flags|=128,g=!0,r=r.updateQueue,o.updateQueue=r,Au(o,r),bl(f,!0),f.tail===null&&f.tailMode==="hidden"&&!v.alternate&&!Ge)return ut(o),null}else 2*Jt()-f.renderingStartTime>Ou&&c!==536870912&&(o.flags|=128,g=!0,bl(f,!1),o.lanes=4194304);f.isBackwards?(v.sibling=o.child,o.child=v):(r=f.last,r!==null?r.sibling=v:o.child=v,f.last=v)}return f.tail!==null?(r=f.tail,f.rendering=r,f.tail=r.sibling,f.renderingStartTime=Jt(),r.sibling=null,c=Ct.current,ie(Ct,g?c&1|2:c&1),Ge&&Zi(o,f.treeForkCount),r):(ut(o),null);case 22:case 23:return Bn(o),dp(),f=o.memoizedState!==null,r!==null?r.memoizedState!==null!==f&&(o.flags|=8192):f&&(o.flags|=8192),f?(c&536870912)!==0&&(o.flags&128)===0&&(ut(o),o.subtreeFlags&6&&(o.flags|=8192)):ut(o),c=o.updateQueue,c!==null&&Au(o,c.retryQueue),c=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),f=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),f!==c&&(o.flags|=2048),r!==null&&Z(Ps),null;case 24:return c=null,r!==null&&(c=r.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),Ji(At),ut(o),null;case 25:return null;case 30:return null}throw Error(i(156,o.tag))}function cO(r,o){switch(Zf(o),o.tag){case 1:return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return Ji(At),re(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 26:case 27:case 5:return pe(o),null;case 31:if(o.memoizedState!==null){if(Bn(o),o.alternate===null)throw Error(i(340));Ns()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 13:if(Bn(o),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(i(340));Ns()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return Z(Ct),null;case 4:return re(),null;case 10:return Ji(o.type),null;case 22:case 23:return Bn(o),dp(),r!==null&&Z(Ps),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 24:return Ji(At),null;case 25:return null;default:return null}}function NS(r,o){switch(Zf(o),o.tag){case 3:Ji(At),re();break;case 26:case 27:case 5:pe(o);break;case 4:re();break;case 31:o.memoizedState!==null&&Bn(o);break;case 13:Bn(o);break;case 19:Z(Ct);break;case 10:Ji(o.type);break;case 22:case 23:Bn(o),dp(),r!==null&&Z(Ps);break;case 24:Ji(At)}}function Sl(r,o){try{var c=o.updateQueue,f=c!==null?c.lastEffect:null;if(f!==null){var g=f.next;c=g;do{if((c.tag&r)===r){f=void 0;var v=c.create,E=c.inst;f=v(),E.destroy=f}c=c.next}while(c!==g)}}catch(D){Je(o,o.return,D)}}function Hr(r,o,c){try{var f=o.updateQueue,g=f!==null?f.lastEffect:null;if(g!==null){var v=g.next;f=v;do{if((f.tag&r)===r){var E=f.inst,D=E.destroy;if(D!==void 0){E.destroy=void 0,g=o;var Y=c,oe=D;try{oe()}catch(ce){Je(g,Y,ce)}}}f=f.next}while(f!==v)}}catch(ce){Je(o,o.return,ce)}}function OS(r){var o=r.updateQueue;if(o!==null){var c=r.stateNode;try{xb(o,c)}catch(f){Je(r,r.return,f)}}}function LS(r,o,c){c.props=Hs(r.type,r.memoizedProps),c.state=r.memoizedState;try{c.componentWillUnmount()}catch(f){Je(r,o,f)}}function wl(r,o){try{var c=r.ref;if(c!==null){switch(r.tag){case 26:case 27:case 5:var f=r.stateNode;break;case 30:f=r.stateNode;break;default:f=r.stateNode}typeof c=="function"?r.refCleanup=c(f):c.current=f}}catch(g){Je(r,o,g)}}function Ri(r,o){var c=r.ref,f=r.refCleanup;if(c!==null)if(typeof f=="function")try{f()}catch(g){Je(r,o,g)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(g){Je(r,o,g)}else c.current=null}function PS(r){var o=r.type,c=r.memoizedProps,f=r.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":c.autoFocus&&f.focus();break e;case"img":c.src?f.src=c.src:c.srcSet&&(f.srcset=c.srcSet)}}catch(g){Je(r,r.return,g)}}function $p(r,o,c){try{var f=r.stateNode;DO(f,r.type,c,o),f[wn]=o}catch(g){Je(r,r.return,g)}}function BS(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&qr(r.type)||r.tag===4}function Wp(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||BS(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&qr(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Gp(r,o,c){var f=r.tag;if(f===5||f===6)r=r.stateNode,o?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(r,o):(o=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,o.appendChild(r),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=Ki));else if(f!==4&&(f===27&&qr(r.type)&&(c=r.stateNode,o=null),r=r.child,r!==null))for(Gp(r,o,c),r=r.sibling;r!==null;)Gp(r,o,c),r=r.sibling}function Ru(r,o,c){var f=r.tag;if(f===5||f===6)r=r.stateNode,o?c.insertBefore(r,o):c.appendChild(r);else if(f!==4&&(f===27&&qr(r.type)&&(c=r.stateNode),r=r.child,r!==null))for(Ru(r,o,c),r=r.sibling;r!==null;)Ru(r,o,c),r=r.sibling}function IS(r){var o=r.stateNode,c=r.memoizedProps;try{for(var f=r.type,g=o.attributes;g.length;)o.removeAttributeNode(g[0]);sn(o,f,c),o[en]=r,o[wn]=c}catch(v){Je(r,r.return,v)}}var rr=!1,Dt=!1,qp=!1,jS=typeof WeakSet=="function"?WeakSet:Set,Gt=null;function uO(r,o){if(r=r.containerInfo,pm=Xu,r=X0(r),Hf(r)){if("selectionStart"in r)var c={start:r.selectionStart,end:r.selectionEnd};else e:{c=(c=r.ownerDocument)&&c.defaultView||window;var f=c.getSelection&&c.getSelection();if(f&&f.rangeCount!==0){c=f.anchorNode;var g=f.anchorOffset,v=f.focusNode;f=f.focusOffset;try{c.nodeType,v.nodeType}catch{c=null;break e}var E=0,D=-1,Y=-1,oe=0,ce=0,he=r,ae=null;t:for(;;){for(var le;he!==c||g!==0&&he.nodeType!==3||(D=E+g),he!==v||f!==0&&he.nodeType!==3||(Y=E+f),he.nodeType===3&&(E+=he.nodeValue.length),(le=he.firstChild)!==null;)ae=he,he=le;for(;;){if(he===r)break t;if(ae===c&&++oe===g&&(D=E),ae===v&&++ce===f&&(Y=E),(le=he.nextSibling)!==null)break;he=ae,ae=he.parentNode}he=le}c=D===-1||Y===-1?null:{start:D,end:Y}}else c=null}c=c||{start:0,end:0}}else c=null;for(mm={focusedElem:r,selectionRange:c},Xu=!1,Gt=o;Gt!==null;)if(o=Gt,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,Gt=r;else for(;Gt!==null;){switch(o=Gt,v=o.alternate,r=o.flags,o.tag){case 0:if((r&4)!==0&&(r=o.updateQueue,r=r!==null?r.events:null,r!==null))for(c=0;c<r.length;c++)g=r[c],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,c=o,g=v.memoizedProps,v=v.memoizedState,f=c.stateNode;try{var ve=Hs(c.type,g);r=f.getSnapshotBeforeUpdate(ve,v),f.__reactInternalSnapshotBeforeUpdate=r}catch(Te){Je(c,c.return,Te)}}break;case 3:if((r&1024)!==0){if(r=o.stateNode.containerInfo,c=r.nodeType,c===9)vm(r);else if(c===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":vm(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(i(163))}if(r=o.sibling,r!==null){r.return=o.return,Gt=r;break}Gt=o.return}}function zS(r,o,c){var f=c.flags;switch(c.tag){case 0:case 11:case 15:or(r,c),f&4&&Sl(5,c);break;case 1:if(or(r,c),f&4)if(r=c.stateNode,o===null)try{r.componentDidMount()}catch(E){Je(c,c.return,E)}else{var g=Hs(c.type,o.memoizedProps);o=o.memoizedState;try{r.componentDidUpdate(g,o,r.__reactInternalSnapshotBeforeUpdate)}catch(E){Je(c,c.return,E)}}f&64&&OS(c),f&512&&wl(c,c.return);break;case 3:if(or(r,c),f&64&&(r=c.updateQueue,r!==null)){if(o=null,c.child!==null)switch(c.child.tag){case 27:case 5:o=c.child.stateNode;break;case 1:o=c.child.stateNode}try{xb(r,o)}catch(E){Je(c,c.return,E)}}break;case 27:o===null&&f&4&&IS(c);case 26:case 5:or(r,c),o===null&&f&4&&PS(c),f&512&&wl(c,c.return);break;case 12:or(r,c);break;case 31:or(r,c),f&4&&US(r,c);break;case 13:or(r,c),f&4&&FS(r,c),f&64&&(r=c.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(c=yO.bind(null,c),zO(r,c))));break;case 22:if(f=c.memoizedState!==null||rr,!f){o=o!==null&&o.memoizedState!==null||Dt,g=rr;var v=Dt;rr=f,(Dt=o)&&!v?ar(r,c,(c.subtreeFlags&8772)!==0):or(r,c),rr=g,Dt=v}break;case 30:break;default:or(r,c)}}function HS(r){var o=r.alternate;o!==null&&(r.alternate=null,HS(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&xf(o)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var dt=null,Cn=!1;function sr(r,o,c){for(c=c.child;c!==null;)VS(r,o,c),c=c.sibling}function VS(r,o,c){if(Dn&&typeof Dn.onCommitFiberUnmount=="function")try{Dn.onCommitFiberUnmount(Ga,c)}catch{}switch(c.tag){case 26:Dt||Ri(c,o),sr(r,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:Dt||Ri(c,o);var f=dt,g=Cn;qr(c.type)&&(dt=c.stateNode,Cn=!1),sr(r,o,c),Dl(c.stateNode),dt=f,Cn=g;break;case 5:Dt||Ri(c,o);case 6:if(f=dt,g=Cn,dt=null,sr(r,o,c),dt=f,Cn=g,dt!==null)if(Cn)try{(dt.nodeType===9?dt.body:dt.nodeName==="HTML"?dt.ownerDocument.body:dt).removeChild(c.stateNode)}catch(v){Je(c,o,v)}else try{dt.removeChild(c.stateNode)}catch(v){Je(c,o,v)}break;case 18:dt!==null&&(Cn?(r=dt,Ow(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,c.stateNode),na(r)):Ow(dt,c.stateNode));break;case 4:f=dt,g=Cn,dt=c.stateNode.containerInfo,Cn=!0,sr(r,o,c),dt=f,Cn=g;break;case 0:case 11:case 14:case 15:Hr(2,c,o),Dt||Hr(4,c,o),sr(r,o,c);break;case 1:Dt||(Ri(c,o),f=c.stateNode,typeof f.componentWillUnmount=="function"&&LS(c,o,f)),sr(r,o,c);break;case 21:sr(r,o,c);break;case 22:Dt=(f=Dt)||c.memoizedState!==null,sr(r,o,c),Dt=f;break;default:sr(r,o,c)}}function US(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{na(r)}catch(c){Je(o,o.return,c)}}}function FS(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{na(r)}catch(c){Je(o,o.return,c)}}function hO(r){switch(r.tag){case 31:case 13:case 19:var o=r.stateNode;return o===null&&(o=r.stateNode=new jS),o;case 22:return r=r.stateNode,o=r._retryCache,o===null&&(o=r._retryCache=new jS),o;default:throw Error(i(435,r.tag))}}function Mu(r,o){var c=hO(r);o.forEach(function(f){if(!c.has(f)){c.add(f);var g=bO.bind(null,r,f);f.then(g,g)}})}function En(r,o){var c=o.deletions;if(c!==null)for(var f=0;f<c.length;f++){var g=c[f],v=r,E=o,D=E;e:for(;D!==null;){switch(D.tag){case 27:if(qr(D.type)){dt=D.stateNode,Cn=!1;break e}break;case 5:dt=D.stateNode,Cn=!1;break e;case 3:case 4:dt=D.stateNode.containerInfo,Cn=!0;break e}D=D.return}if(dt===null)throw Error(i(160));VS(v,E,g),dt=null,Cn=!1,v=g.alternate,v!==null&&(v.return=null),g.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)$S(o,r),o=o.sibling}var pi=null;function $S(r,o){var c=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:En(o,r),kn(r),f&4&&(Hr(3,r,r.return),Sl(3,r),Hr(5,r,r.return));break;case 1:En(o,r),kn(r),f&512&&(Dt||c===null||Ri(c,c.return)),f&64&&rr&&(r=r.updateQueue,r!==null&&(f=r.callbacks,f!==null&&(c=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=c===null?f:c.concat(f))));break;case 26:var g=pi;if(En(o,r),kn(r),f&512&&(Dt||c===null||Ri(c,c.return)),f&4){var v=c!==null?c.memoizedState:null;if(f=r.memoizedState,c===null)if(f===null)if(r.stateNode===null){e:{f=r.type,c=r.memoizedProps,g=g.ownerDocument||g;t:switch(f){case"title":v=g.getElementsByTagName("title")[0],(!v||v[Ya]||v[en]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=g.createElement(f),g.head.insertBefore(v,g.querySelector("head > title"))),sn(v,f,c),v[en]=r,Wt(v),f=v;break e;case"link":var E=$w("link","href",g).get(f+(c.href||""));if(E){for(var D=0;D<E.length;D++)if(v=E[D],v.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&v.getAttribute("rel")===(c.rel==null?null:c.rel)&&v.getAttribute("title")===(c.title==null?null:c.title)&&v.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){E.splice(D,1);break t}}v=g.createElement(f),sn(v,f,c),g.head.appendChild(v);break;case"meta":if(E=$w("meta","content",g).get(f+(c.content||""))){for(D=0;D<E.length;D++)if(v=E[D],v.getAttribute("content")===(c.content==null?null:""+c.content)&&v.getAttribute("name")===(c.name==null?null:c.name)&&v.getAttribute("property")===(c.property==null?null:c.property)&&v.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&v.getAttribute("charset")===(c.charSet==null?null:c.charSet)){E.splice(D,1);break t}}v=g.createElement(f),sn(v,f,c),g.head.appendChild(v);break;default:throw Error(i(468,f))}v[en]=r,Wt(v),f=v}r.stateNode=f}else Ww(g,r.type,r.stateNode);else r.stateNode=Fw(g,f,r.memoizedProps);else v!==f?(v===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):v.count--,f===null?Ww(g,r.type,r.stateNode):Fw(g,f,r.memoizedProps)):f===null&&r.stateNode!==null&&$p(r,r.memoizedProps,c.memoizedProps)}break;case 27:En(o,r),kn(r),f&512&&(Dt||c===null||Ri(c,c.return)),c!==null&&f&4&&$p(r,r.memoizedProps,c.memoizedProps);break;case 5:if(En(o,r),kn(r),f&512&&(Dt||c===null||Ri(c,c.return)),r.flags&32){g=r.stateNode;try{Eo(g,"")}catch(ve){Je(r,r.return,ve)}}f&4&&r.stateNode!=null&&(g=r.memoizedProps,$p(r,g,c!==null?c.memoizedProps:g)),f&1024&&(qp=!0);break;case 6:if(En(o,r),kn(r),f&4){if(r.stateNode===null)throw Error(i(162));f=r.memoizedProps,c=r.stateNode;try{c.nodeValue=f}catch(ve){Je(r,r.return,ve)}}break;case 3:if(Gu=null,g=pi,pi=$u(o.containerInfo),En(o,r),pi=g,kn(r),f&4&&c!==null&&c.memoizedState.isDehydrated)try{na(o.containerInfo)}catch(ve){Je(r,r.return,ve)}qp&&(qp=!1,WS(r));break;case 4:f=pi,pi=$u(r.stateNode.containerInfo),En(o,r),kn(r),pi=f;break;case 12:En(o,r),kn(r);break;case 31:En(o,r),kn(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Mu(r,f)));break;case 13:En(o,r),kn(r),r.child.flags&8192&&r.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Nu=Jt()),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Mu(r,f)));break;case 22:g=r.memoizedState!==null;var Y=c!==null&&c.memoizedState!==null,oe=rr,ce=Dt;if(rr=oe||g,Dt=ce||Y,En(o,r),Dt=ce,rr=oe,kn(r),f&8192)e:for(o=r.stateNode,o._visibility=g?o._visibility&-2:o._visibility|1,g&&(c===null||Y||rr||Dt||Vs(r)),c=null,o=r;;){if(o.tag===5||o.tag===26){if(c===null){Y=c=o;try{if(v=Y.stateNode,g)E=v.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{D=Y.stateNode;var he=Y.memoizedProps.style,ae=he!=null&&he.hasOwnProperty("display")?he.display:null;D.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(ve){Je(Y,Y.return,ve)}}}else if(o.tag===6){if(c===null){Y=o;try{Y.stateNode.nodeValue=g?"":Y.memoizedProps}catch(ve){Je(Y,Y.return,ve)}}}else if(o.tag===18){if(c===null){Y=o;try{var le=Y.stateNode;g?Lw(le,!0):Lw(Y.stateNode,!1)}catch(ve){Je(Y,Y.return,ve)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===r)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break e;for(;o.sibling===null;){if(o.return===null||o.return===r)break e;c===o&&(c=null),o=o.return}c===o&&(c=null),o.sibling.return=o.return,o=o.sibling}f&4&&(f=r.updateQueue,f!==null&&(c=f.retryQueue,c!==null&&(f.retryQueue=null,Mu(r,c))));break;case 19:En(o,r),kn(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Mu(r,f)));break;case 30:break;case 21:break;default:En(o,r),kn(r)}}function kn(r){var o=r.flags;if(o&2){try{for(var c,f=r.return;f!==null;){if(BS(f)){c=f;break}f=f.return}if(c==null)throw Error(i(160));switch(c.tag){case 27:var g=c.stateNode,v=Wp(r);Ru(r,v,g);break;case 5:var E=c.stateNode;c.flags&32&&(Eo(E,""),c.flags&=-33);var D=Wp(r);Ru(r,D,E);break;case 3:case 4:var Y=c.stateNode.containerInfo,oe=Wp(r);Gp(r,oe,Y);break;default:throw Error(i(161))}}catch(ce){Je(r,r.return,ce)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function WS(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var o=r;WS(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),r=r.sibling}}function or(r,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)zS(r,o.alternate,o),o=o.sibling}function Vs(r){for(r=r.child;r!==null;){var o=r;switch(o.tag){case 0:case 11:case 14:case 15:Hr(4,o,o.return),Vs(o);break;case 1:Ri(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&LS(o,o.return,c),Vs(o);break;case 27:Dl(o.stateNode);case 26:case 5:Ri(o,o.return),Vs(o);break;case 22:o.memoizedState===null&&Vs(o);break;case 30:Vs(o);break;default:Vs(o)}r=r.sibling}}function ar(r,o,c){for(c=c&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var f=o.alternate,g=r,v=o,E=v.flags;switch(v.tag){case 0:case 11:case 15:ar(g,v,c),Sl(4,v);break;case 1:if(ar(g,v,c),f=v,g=f.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(oe){Je(f,f.return,oe)}if(f=v,g=f.updateQueue,g!==null){var D=f.stateNode;try{var Y=g.shared.hiddenCallbacks;if(Y!==null)for(g.shared.hiddenCallbacks=null,g=0;g<Y.length;g++)wb(Y[g],D)}catch(oe){Je(f,f.return,oe)}}c&&E&64&&OS(v),wl(v,v.return);break;case 27:IS(v);case 26:case 5:ar(g,v,c),c&&f===null&&E&4&&PS(v),wl(v,v.return);break;case 12:ar(g,v,c);break;case 31:ar(g,v,c),c&&E&4&&US(g,v);break;case 13:ar(g,v,c),c&&E&4&&FS(g,v);break;case 22:v.memoizedState===null&&ar(g,v,c),wl(v,v.return);break;case 30:break;default:ar(g,v,c)}o=o.sibling}}function Kp(r,o){var c=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),r=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(r=o.memoizedState.cachePool.pool),r!==c&&(r!=null&&r.refCount++,c!=null&&ll(c))}function Yp(r,o){r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&ll(r))}function mi(r,o,c,f){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)GS(r,o,c,f),o=o.sibling}function GS(r,o,c,f){var g=o.flags;switch(o.tag){case 0:case 11:case 15:mi(r,o,c,f),g&2048&&Sl(9,o);break;case 1:mi(r,o,c,f);break;case 3:mi(r,o,c,f),g&2048&&(r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&ll(r)));break;case 12:if(g&2048){mi(r,o,c,f),r=o.stateNode;try{var v=o.memoizedProps,E=v.id,D=v.onPostCommit;typeof D=="function"&&D(E,o.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(Y){Je(o,o.return,Y)}}else mi(r,o,c,f);break;case 31:mi(r,o,c,f);break;case 13:mi(r,o,c,f);break;case 23:break;case 22:v=o.stateNode,E=o.alternate,o.memoizedState!==null?v._visibility&2?mi(r,o,c,f):xl(r,o):v._visibility&2?mi(r,o,c,f):(v._visibility|=2,Wo(r,o,c,f,(o.subtreeFlags&10256)!==0||!1)),g&2048&&Kp(E,o);break;case 24:mi(r,o,c,f),g&2048&&Yp(o.alternate,o);break;default:mi(r,o,c,f)}}function Wo(r,o,c,f,g){for(g=g&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=r,E=o,D=c,Y=f,oe=E.flags;switch(E.tag){case 0:case 11:case 15:Wo(v,E,D,Y,g),Sl(8,E);break;case 23:break;case 22:var ce=E.stateNode;E.memoizedState!==null?ce._visibility&2?Wo(v,E,D,Y,g):xl(v,E):(ce._visibility|=2,Wo(v,E,D,Y,g)),g&&oe&2048&&Kp(E.alternate,E);break;case 24:Wo(v,E,D,Y,g),g&&oe&2048&&Yp(E.alternate,E);break;default:Wo(v,E,D,Y,g)}o=o.sibling}}function xl(r,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var c=r,f=o,g=f.flags;switch(f.tag){case 22:xl(c,f),g&2048&&Kp(f.alternate,f);break;case 24:xl(c,f),g&2048&&Yp(f.alternate,f);break;default:xl(c,f)}o=o.sibling}}var Cl=8192;function Go(r,o,c){if(r.subtreeFlags&Cl)for(r=r.child;r!==null;)qS(r,o,c),r=r.sibling}function qS(r,o,c){switch(r.tag){case 26:Go(r,o,c),r.flags&Cl&&r.memoizedState!==null&&ZO(c,pi,r.memoizedState,r.memoizedProps);break;case 5:Go(r,o,c);break;case 3:case 4:var f=pi;pi=$u(r.stateNode.containerInfo),Go(r,o,c),pi=f;break;case 22:r.memoizedState===null&&(f=r.alternate,f!==null&&f.memoizedState!==null?(f=Cl,Cl=16777216,Go(r,o,c),Cl=f):Go(r,o,c));break;default:Go(r,o,c)}}function KS(r){var o=r.alternate;if(o!==null&&(r=o.child,r!==null)){o.child=null;do o=r.sibling,r.sibling=null,r=o;while(r!==null)}}function El(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var f=o[c];Gt=f,XS(f,r)}KS(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)YS(r),r=r.sibling}function YS(r){switch(r.tag){case 0:case 11:case 15:El(r),r.flags&2048&&Hr(9,r,r.return);break;case 3:El(r);break;case 12:El(r);break;case 22:var o=r.stateNode;r.memoizedState!==null&&o._visibility&2&&(r.return===null||r.return.tag!==13)?(o._visibility&=-3,Du(r)):El(r);break;default:El(r)}}function Du(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var f=o[c];Gt=f,XS(f,r)}KS(r)}for(r=r.child;r!==null;){switch(o=r,o.tag){case 0:case 11:case 15:Hr(8,o,o.return),Du(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,Du(o));break;default:Du(o)}r=r.sibling}}function XS(r,o){for(;Gt!==null;){var c=Gt;switch(c.tag){case 0:case 11:case 15:Hr(8,c,o);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var f=c.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:ll(c.memoizedState.cache)}if(f=c.child,f!==null)f.return=c,Gt=f;else e:for(c=r;Gt!==null;){f=Gt;var g=f.sibling,v=f.return;if(HS(f),f===c){Gt=null;break e}if(g!==null){g.return=v,Gt=g;break e}Gt=v}}}var dO={getCacheForType:function(r){var o=nn(At),c=o.data.get(r);return c===void 0&&(c=r(),o.data.set(r,c)),c},cacheSignal:function(){return nn(At).controller.signal}},fO=typeof WeakMap=="function"?WeakMap:Map,Xe=0,st=null,Ue=null,$e=0,Qe=0,In=null,Vr=!1,qo=!1,Xp=!1,lr=0,bt=0,Ur=0,Us=0,Zp=0,jn=0,Ko=0,kl=null,Tn=null,Qp=!1,Nu=0,ZS=0,Ou=1/0,Lu=null,Fr=null,It=0,$r=null,Yo=null,cr=0,Jp=0,em=null,QS=null,Tl=0,tm=null;function zn(){return(Xe&2)!==0&&$e!==0?$e&-$e:M.T!==null?am():p0()}function JS(){if(jn===0)if(($e&536870912)===0||Ge){var r=Uc;Uc<<=1,(Uc&3932160)===0&&(Uc=262144),jn=r}else jn=536870912;return r=Pn.current,r!==null&&(r.flags|=32),jn}function An(r,o,c){(r===st&&(Qe===2||Qe===9)||r.cancelPendingCommit!==null)&&(Xo(r,0),Wr(r,$e,jn,!1)),Ka(r,c),((Xe&2)===0||r!==st)&&(r===st&&((Xe&2)===0&&(Us|=c),bt===4&&Wr(r,$e,jn,!1)),Mi(r))}function ew(r,o,c){if((Xe&6)!==0)throw Error(i(327));var f=!c&&(o&127)===0&&(o&r.expiredLanes)===0||qa(r,o),g=f?gO(r,o):im(r,o,!0),v=f;do{if(g===0){qo&&!f&&Wr(r,o,0,!1);break}else{if(c=r.current.alternate,v&&!pO(c)){g=im(r,o,!1),v=!1;continue}if(g===2){if(v=o,r.errorRecoveryDisabledLanes&v)var E=0;else E=r.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){o=E;e:{var D=r;g=kl;var Y=D.current.memoizedState.isDehydrated;if(Y&&(Xo(D,E).flags|=256),E=im(D,E,!1),E!==2){if(Xp&&!Y){D.errorRecoveryDisabledLanes|=v,Us|=v,g=4;break e}v=Tn,Tn=g,v!==null&&(Tn===null?Tn=v:Tn.push.apply(Tn,v))}g=E}if(v=!1,g!==2)continue}}if(g===1){Xo(r,0),Wr(r,o,0,!0);break}e:{switch(f=r,v=g,v){case 0:case 1:throw Error(i(345));case 4:if((o&4194048)!==o)break;case 6:Wr(f,o,jn,!Vr);break e;case 2:Tn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((o&62914560)===o&&(g=Nu+300-Jt(),10<g)){if(Wr(f,o,jn,!Vr),$c(f,0,!0)!==0)break e;cr=o,f.timeoutHandle=Dw(tw.bind(null,f,c,Tn,Lu,Qp,o,jn,Us,Ko,Vr,v,"Throttled",-0,0),g);break e}tw(f,c,Tn,Lu,Qp,o,jn,Us,Ko,Vr,v,null,-0,0)}}break}while(!0);Mi(r)}function tw(r,o,c,f,g,v,E,D,Y,oe,ce,he,ae,le){if(r.timeoutHandle=-1,he=o.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ki},qS(o,v,he);var ve=(v&62914560)===v?Nu-Jt():(v&4194048)===v?ZS-Jt():0;if(ve=QO(he,ve),ve!==null){cr=v,r.cancelPendingCommit=ve(cw.bind(null,r,o,v,c,f,g,E,D,Y,ce,he,null,ae,le)),Wr(r,v,E,!oe);return}}cw(r,o,v,c,f,g,E,D,Y)}function pO(r){for(var o=r;;){var c=o.tag;if((c===0||c===11||c===15)&&o.flags&16384&&(c=o.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var f=0;f<c.length;f++){var g=c[f],v=g.getSnapshot;g=g.value;try{if(!On(v(),g))return!1}catch{return!1}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;else{if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Wr(r,o,c,f){o&=~Zp,o&=~Us,r.suspendedLanes|=o,r.pingedLanes&=~o,f&&(r.warmLanes|=o),f=r.expirationTimes;for(var g=o;0<g;){var v=31-Nn(g),E=1<<v;f[v]=-1,g&=~E}c!==0&&h0(r,c,o)}function Pu(){return(Xe&6)===0?(Al(0),!1):!0}function nm(){if(Ue!==null){if(Qe===0)var r=Ue.return;else r=Ue,Qi=Os=null,vp(r),Ho=null,ul=0,r=Ue;for(;r!==null;)NS(r.alternate,r),r=r.return;Ue=null}}function Xo(r,o){var c=r.timeoutHandle;c!==-1&&(r.timeoutHandle=-1,LO(c)),c=r.cancelPendingCommit,c!==null&&(r.cancelPendingCommit=null,c()),cr=0,nm(),st=r,Ue=c=Xi(r.current,null),$e=o,Qe=0,In=null,Vr=!1,qo=qa(r,o),Xp=!1,Ko=jn=Zp=Us=Ur=bt=0,Tn=kl=null,Qp=!1,(o&8)!==0&&(o|=o&32);var f=r.entangledLanes;if(f!==0)for(r=r.entanglements,f&=o;0<f;){var g=31-Nn(f),v=1<<g;o|=r[g],f&=~v}return lr=o,nu(),c}function nw(r,o){Le=null,M.H=vl,o===zo||o===uu?(o=vb(),Qe=3):o===op?(o=vb(),Qe=4):Qe=o===Lp?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,In=o,Ue===null&&(bt=1,Cu(r,Xn(o,r.current)))}function iw(){var r=Pn.current;return r===null?!0:($e&4194048)===$e?ei===null:($e&62914560)===$e||($e&536870912)!==0?r===ei:!1}function rw(){var r=M.H;return M.H=vl,r===null?vl:r}function sw(){var r=M.A;return M.A=dO,r}function Bu(){bt=4,Vr||($e&4194048)!==$e&&Pn.current!==null||(qo=!0),(Ur&134217727)===0&&(Us&134217727)===0||st===null||Wr(st,$e,jn,!1)}function im(r,o,c){var f=Xe;Xe|=2;var g=rw(),v=sw();(st!==r||$e!==o)&&(Lu=null,Xo(r,o)),o=!1;var E=bt;e:do try{if(Qe!==0&&Ue!==null){var D=Ue,Y=In;switch(Qe){case 8:nm(),E=6;break e;case 3:case 2:case 9:case 6:Pn.current===null&&(o=!0);var oe=Qe;if(Qe=0,In=null,Zo(r,D,Y,oe),c&&qo){E=0;break e}break;default:oe=Qe,Qe=0,In=null,Zo(r,D,Y,oe)}}mO(),E=bt;break}catch(ce){nw(r,ce)}while(!0);return o&&r.shellSuspendCounter++,Qi=Os=null,Xe=f,M.H=g,M.A=v,Ue===null&&(st=null,$e=0,nu()),E}function mO(){for(;Ue!==null;)ow(Ue)}function gO(r,o){var c=Xe;Xe|=2;var f=rw(),g=sw();st!==r||$e!==o?(Lu=null,Ou=Jt()+500,Xo(r,o)):qo=qa(r,o);e:do try{if(Qe!==0&&Ue!==null){o=Ue;var v=In;t:switch(Qe){case 1:Qe=0,In=null,Zo(r,o,v,1);break;case 2:case 9:if(gb(v)){Qe=0,In=null,aw(o);break}o=function(){Qe!==2&&Qe!==9||st!==r||(Qe=7),Mi(r)},v.then(o,o);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:gb(v)?(Qe=0,In=null,aw(o)):(Qe=0,In=null,Zo(r,o,v,7));break;case 5:var E=null;switch(Ue.tag){case 26:E=Ue.memoizedState;case 5:case 27:var D=Ue;if(E?Gw(E):D.stateNode.complete){Qe=0,In=null;var Y=D.sibling;if(Y!==null)Ue=Y;else{var oe=D.return;oe!==null?(Ue=oe,Iu(oe)):Ue=null}break t}}Qe=0,In=null,Zo(r,o,v,5);break;case 6:Qe=0,In=null,Zo(r,o,v,6);break;case 8:nm(),bt=6;break e;default:throw Error(i(462))}}_O();break}catch(ce){nw(r,ce)}while(!0);return Qi=Os=null,M.H=f,M.A=g,Xe=c,Ue!==null?0:(st=null,$e=0,nu(),bt)}function _O(){for(;Ue!==null&&!Cs();)ow(Ue)}function ow(r){var o=MS(r.alternate,r,lr);r.memoizedProps=r.pendingProps,o===null?Iu(r):Ue=o}function aw(r){var o=r,c=o.alternate;switch(o.tag){case 15:case 0:o=CS(c,o,o.pendingProps,o.type,void 0,$e);break;case 11:o=CS(c,o,o.pendingProps,o.type.render,o.ref,$e);break;case 5:vp(o);default:NS(c,o),o=Ue=sb(o,lr),o=MS(c,o,lr)}r.memoizedProps=r.pendingProps,o===null?Iu(r):Ue=o}function Zo(r,o,c,f){Qi=Os=null,vp(o),Ho=null,ul=0;var g=o.return;try{if(sO(r,g,o,c,$e)){bt=1,Cu(r,Xn(c,r.current)),Ue=null;return}}catch(v){if(g!==null)throw Ue=g,v;bt=1,Cu(r,Xn(c,r.current)),Ue=null;return}o.flags&32768?(Ge||f===1?r=!0:qo||($e&536870912)!==0?r=!1:(Vr=r=!0,(f===2||f===9||f===3||f===6)&&(f=Pn.current,f!==null&&f.tag===13&&(f.flags|=16384))),lw(o,r)):Iu(o)}function Iu(r){var o=r;do{if((o.flags&32768)!==0){lw(o,Vr);return}r=o.return;var c=lO(o.alternate,o,lr);if(c!==null){Ue=c;return}if(o=o.sibling,o!==null){Ue=o;return}Ue=o=r}while(o!==null);bt===0&&(bt=5)}function lw(r,o){do{var c=cO(r.alternate,r);if(c!==null){c.flags&=32767,Ue=c;return}if(c=r.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!o&&(r=r.sibling,r!==null)){Ue=r;return}Ue=r=c}while(r!==null);bt=6,Ue=null}function cw(r,o,c,f,g,v,E,D,Y){r.cancelPendingCommit=null;do ju();while(It!==0);if((Xe&6)!==0)throw Error(i(327));if(o!==null){if(o===r.current)throw Error(i(177));if(v=o.lanes|o.childLanes,v|=Wf,XD(r,c,v,E,D,Y),r===st&&(Ue=st=null,$e=0),Yo=o,$r=r,cr=c,Jp=v,em=g,QS=f,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,SO(Hc,function(){return pw(),null})):(r.callbackNode=null,r.callbackPriority=0),f=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||f){f=M.T,M.T=null,g=U.p,U.p=2,E=Xe,Xe|=4;try{uO(r,o,c)}finally{Xe=E,U.p=g,M.T=f}}It=1,uw(),hw(),dw()}}function uw(){if(It===1){It=0;var r=$r,o=Yo,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=M.T,M.T=null;var f=U.p;U.p=2;var g=Xe;Xe|=4;try{$S(o,r);var v=mm,E=X0(r.containerInfo),D=v.focusedElem,Y=v.selectionRange;if(E!==D&&D&&D.ownerDocument&&Y0(D.ownerDocument.documentElement,D)){if(Y!==null&&Hf(D)){var oe=Y.start,ce=Y.end;if(ce===void 0&&(ce=oe),"selectionStart"in D)D.selectionStart=oe,D.selectionEnd=Math.min(ce,D.value.length);else{var he=D.ownerDocument||document,ae=he&&he.defaultView||window;if(ae.getSelection){var le=ae.getSelection(),ve=D.textContent.length,Te=Math.min(Y.start,ve),it=Y.end===void 0?Te:Math.min(Y.end,ve);!le.extend&&Te>it&&(E=it,it=Te,Te=E);var te=K0(D,Te),Q=K0(D,it);if(te&&Q&&(le.rangeCount!==1||le.anchorNode!==te.node||le.anchorOffset!==te.offset||le.focusNode!==Q.node||le.focusOffset!==Q.offset)){var se=he.createRange();se.setStart(te.node,te.offset),le.removeAllRanges(),Te>it?(le.addRange(se),le.extend(Q.node,Q.offset)):(se.setEnd(Q.node,Q.offset),le.addRange(se))}}}}for(he=[],le=D;le=le.parentNode;)le.nodeType===1&&he.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<he.length;D++){var ue=he[D];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}Xu=!!pm,mm=pm=null}finally{Xe=g,U.p=f,M.T=c}}r.current=o,It=2}}function hw(){if(It===2){It=0;var r=$r,o=Yo,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=M.T,M.T=null;var f=U.p;U.p=2;var g=Xe;Xe|=4;try{zS(r,o.alternate,o)}finally{Xe=g,U.p=f,M.T=c}}It=3}}function dw(){if(It===4||It===3){It=0,vf();var r=$r,o=Yo,c=cr,f=QS;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?It=5:(It=0,Yo=$r=null,fw(r,r.pendingLanes));var g=r.pendingLanes;if(g===0&&(Fr=null),Sf(c),o=o.stateNode,Dn&&typeof Dn.onCommitFiberRoot=="function")try{Dn.onCommitFiberRoot(Ga,o,void 0,(o.current.flags&128)===128)}catch{}if(f!==null){o=M.T,g=U.p,U.p=2,M.T=null;try{for(var v=r.onRecoverableError,E=0;E<f.length;E++){var D=f[E];v(D.value,{componentStack:D.stack})}}finally{M.T=o,U.p=g}}(cr&3)!==0&&ju(),Mi(r),g=r.pendingLanes,(c&261930)!==0&&(g&42)!==0?r===tm?Tl++:(Tl=0,tm=r):Tl=0,Al(0)}}function fw(r,o){(r.pooledCacheLanes&=o)===0&&(o=r.pooledCache,o!=null&&(r.pooledCache=null,ll(o)))}function ju(){return uw(),hw(),dw(),pw()}function pw(){if(It!==5)return!1;var r=$r,o=Jp;Jp=0;var c=Sf(cr),f=M.T,g=U.p;try{U.p=32>c?32:c,M.T=null,c=em,em=null;var v=$r,E=cr;if(It=0,Yo=$r=null,cr=0,(Xe&6)!==0)throw Error(i(331));var D=Xe;if(Xe|=4,YS(v.current),GS(v,v.current,E,c),Xe=D,Al(0,!1),Dn&&typeof Dn.onPostCommitFiberRoot=="function")try{Dn.onPostCommitFiberRoot(Ga,v)}catch{}return!0}finally{U.p=g,M.T=f,fw(r,o)}}function mw(r,o,c){o=Xn(c,o),o=Op(r.stateNode,o,2),r=Ir(r,o,2),r!==null&&(Ka(r,2),Mi(r))}function Je(r,o,c){if(r.tag===3)mw(r,r,c);else for(;o!==null;){if(o.tag===3){mw(o,r,c);break}else if(o.tag===1){var f=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Fr===null||!Fr.has(f))){r=Xn(c,r),c=gS(2),f=Ir(o,c,2),f!==null&&(_S(c,f,o,r),Ka(f,2),Mi(f));break}}o=o.return}}function rm(r,o,c){var f=r.pingCache;if(f===null){f=r.pingCache=new fO;var g=new Set;f.set(o,g)}else g=f.get(o),g===void 0&&(g=new Set,f.set(o,g));g.has(c)||(Xp=!0,g.add(c),r=vO.bind(null,r,o,c),o.then(r,r))}function vO(r,o,c){var f=r.pingCache;f!==null&&f.delete(o),r.pingedLanes|=r.suspendedLanes&c,r.warmLanes&=~c,st===r&&($e&c)===c&&(bt===4||bt===3&&($e&62914560)===$e&&300>Jt()-Nu?(Xe&2)===0&&Xo(r,0):Zp|=c,Ko===$e&&(Ko=0)),Mi(r)}function gw(r,o){o===0&&(o=u0()),r=Ms(r,o),r!==null&&(Ka(r,o),Mi(r))}function yO(r){var o=r.memoizedState,c=0;o!==null&&(c=o.retryLane),gw(r,c)}function bO(r,o){var c=0;switch(r.tag){case 31:case 13:var f=r.stateNode,g=r.memoizedState;g!==null&&(c=g.retryLane);break;case 19:f=r.stateNode;break;case 22:f=r.stateNode._retryCache;break;default:throw Error(i(314))}f!==null&&f.delete(o),gw(r,c)}function SO(r,o){return Tr(r,o)}var zu=null,Qo=null,sm=!1,Hu=!1,om=!1,Gr=0;function Mi(r){r!==Qo&&r.next===null&&(Qo===null?zu=Qo=r:Qo=Qo.next=r),Hu=!0,sm||(sm=!0,xO())}function Al(r,o){if(!om&&Hu){om=!0;do for(var c=!1,f=zu;f!==null;){if(r!==0){var g=f.pendingLanes;if(g===0)var v=0;else{var E=f.suspendedLanes,D=f.pingedLanes;v=(1<<31-Nn(42|r)+1)-1,v&=g&~(E&~D),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(c=!0,bw(f,v))}else v=$e,v=$c(f,f===st?v:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(v&3)===0||qa(f,v)||(c=!0,bw(f,v));f=f.next}while(c);om=!1}}function wO(){_w()}function _w(){Hu=sm=!1;var r=0;Gr!==0&&OO()&&(r=Gr);for(var o=Jt(),c=null,f=zu;f!==null;){var g=f.next,v=vw(f,o);v===0?(f.next=null,c===null?zu=g:c.next=g,g===null&&(Qo=c)):(c=f,(r!==0||(v&3)!==0)&&(Hu=!0)),f=g}It!==0&&It!==5||Al(r),Gr!==0&&(Gr=0)}function vw(r,o){for(var c=r.suspendedLanes,f=r.pingedLanes,g=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var E=31-Nn(v),D=1<<E,Y=g[E];Y===-1?((D&c)===0||(D&f)!==0)&&(g[E]=YD(D,o)):Y<=o&&(r.expiredLanes|=D),v&=~D}if(o=st,c=$e,c=$c(r,r===o?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f=r.callbackNode,c===0||r===o&&(Qe===2||Qe===9)||r.cancelPendingCommit!==null)return f!==null&&f!==null&&ki(f),r.callbackNode=null,r.callbackPriority=0;if((c&3)===0||qa(r,c)){if(o=c&-c,o===r.callbackPriority)return o;switch(f!==null&&ki(f),Sf(c)){case 2:case 8:c=l0;break;case 32:c=Hc;break;case 268435456:c=c0;break;default:c=Hc}return f=yw.bind(null,r),c=Tr(c,f),r.callbackPriority=o,r.callbackNode=c,o}return f!==null&&f!==null&&ki(f),r.callbackPriority=2,r.callbackNode=null,2}function yw(r,o){if(It!==0&&It!==5)return r.callbackNode=null,r.callbackPriority=0,null;var c=r.callbackNode;if(ju()&&r.callbackNode!==c)return null;var f=$e;return f=$c(r,r===st?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f===0?null:(ew(r,f,o),vw(r,Jt()),r.callbackNode!=null&&r.callbackNode===c?yw.bind(null,r):null)}function bw(r,o){if(ju())return null;ew(r,o,!0)}function xO(){PO(function(){(Xe&6)!==0?Tr(a0,wO):_w()})}function am(){if(Gr===0){var r=Io;r===0&&(r=Vc,Vc<<=1,(Vc&261888)===0&&(Vc=256)),Gr=r}return Gr}function Sw(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Kc(""+r)}function ww(r,o){var c=o.ownerDocument.createElement("input");return c.name=o.name,c.value=o.value,r.id&&c.setAttribute("form",r.id),o.parentNode.insertBefore(c,o),r=new FormData(r),c.parentNode.removeChild(c),r}function CO(r,o,c,f,g){if(o==="submit"&&c&&c.stateNode===g){var v=Sw((g[wn]||null).action),E=f.submitter;E&&(o=(o=E[wn]||null)?Sw(o.formAction):E.getAttribute("formAction"),o!==null&&(v=o,E=null));var D=new Qc("action","action",null,f,g);r.push({event:D,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Gr!==0){var Y=E?ww(g,E):new FormData(g);Tp(c,{pending:!0,data:Y,method:g.method,action:v},null,Y)}}else typeof v=="function"&&(D.preventDefault(),Y=E?ww(g,E):new FormData(g),Tp(c,{pending:!0,data:Y,method:g.method,action:v},v,Y))},currentTarget:g}]})}}for(var lm=0;lm<$f.length;lm++){var cm=$f[lm],EO=cm.toLowerCase(),kO=cm[0].toUpperCase()+cm.slice(1);fi(EO,"on"+kO)}fi(J0,"onAnimationEnd"),fi(eb,"onAnimationIteration"),fi(tb,"onAnimationStart"),fi("dblclick","onDoubleClick"),fi("focusin","onFocus"),fi("focusout","onBlur"),fi(UN,"onTransitionRun"),fi(FN,"onTransitionStart"),fi($N,"onTransitionCancel"),fi(nb,"onTransitionEnd"),xo("onMouseEnter",["mouseout","mouseover"]),xo("onMouseLeave",["mouseout","mouseover"]),xo("onPointerEnter",["pointerout","pointerover"]),xo("onPointerLeave",["pointerout","pointerover"]),ks("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ks("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ks("onBeforeInput",["compositionend","keypress","textInput","paste"]),ks("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ks("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ks("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rl="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(" "),TO=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Rl));function xw(r,o){o=(o&4)!==0;for(var c=0;c<r.length;c++){var f=r[c],g=f.event;f=f.listeners;e:{var v=void 0;if(o)for(var E=f.length-1;0<=E;E--){var D=f[E],Y=D.instance,oe=D.currentTarget;if(D=D.listener,Y!==v&&g.isPropagationStopped())break e;v=D,g.currentTarget=oe;try{v(g)}catch(ce){tu(ce)}g.currentTarget=null,v=Y}else for(E=0;E<f.length;E++){if(D=f[E],Y=D.instance,oe=D.currentTarget,D=D.listener,Y!==v&&g.isPropagationStopped())break e;v=D,g.currentTarget=oe;try{v(g)}catch(ce){tu(ce)}g.currentTarget=null,v=Y}}}}function Fe(r,o){var c=o[wf];c===void 0&&(c=o[wf]=new Set);var f=r+"__bubble";c.has(f)||(Cw(o,r,2,!1),c.add(f))}function um(r,o,c){var f=0;o&&(f|=4),Cw(c,r,f,o)}var Vu="_reactListening"+Math.random().toString(36).slice(2);function hm(r){if(!r[Vu]){r[Vu]=!0,_0.forEach(function(c){c!=="selectionchange"&&(TO.has(c)||um(c,!1,r),um(c,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[Vu]||(o[Vu]=!0,um("selectionchange",!1,o))}}function Cw(r,o,c,f){switch(Jw(o)){case 2:var g=tL;break;case 8:g=nL;break;default:g=km}c=g.bind(null,o,c,r),g=void 0,!Df||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(g=!0),f?g!==void 0?r.addEventListener(o,c,{capture:!0,passive:g}):r.addEventListener(o,c,!0):g!==void 0?r.addEventListener(o,c,{passive:g}):r.addEventListener(o,c,!1)}function dm(r,o,c,f,g){var v=f;if((o&1)===0&&(o&2)===0&&f!==null)e:for(;;){if(f===null)return;var E=f.tag;if(E===3||E===4){var D=f.stateNode.containerInfo;if(D===g)break;if(E===4)for(E=f.return;E!==null;){var Y=E.tag;if((Y===3||Y===4)&&E.stateNode.containerInfo===g)return;E=E.return}for(;D!==null;){if(E=bo(D),E===null)return;if(Y=E.tag,Y===5||Y===6||Y===26||Y===27){f=v=E;continue e}D=D.parentNode}}f=f.return}R0(function(){var oe=v,ce=Rf(c),he=[];e:{var ae=ib.get(r);if(ae!==void 0){var le=Qc,ve=r;switch(r){case"keypress":if(Xc(c)===0)break e;case"keydown":case"keyup":le=bN;break;case"focusin":ve="focus",le=Pf;break;case"focusout":ve="blur",le=Pf;break;case"beforeblur":case"afterblur":le=Pf;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=N0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=lN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=xN;break;case J0:case eb:case tb:le=hN;break;case nb:le=EN;break;case"scroll":case"scrollend":le=oN;break;case"wheel":le=TN;break;case"copy":case"cut":case"paste":le=fN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=L0;break;case"toggle":case"beforetoggle":le=RN}var Te=(o&4)!==0,it=!Te&&(r==="scroll"||r==="scrollend"),te=Te?ae!==null?ae+"Capture":null:ae;Te=[];for(var Q=oe,se;Q!==null;){var ue=Q;if(se=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||se===null||te===null||(ue=Za(Q,te),ue!=null&&Te.push(Ml(Q,ue,se))),it)break;Q=Q.return}0<Te.length&&(ae=new le(ae,ve,null,c,ce),he.push({event:ae,listeners:Te}))}}if((o&7)===0){e:{if(ae=r==="mouseover"||r==="pointerover",le=r==="mouseout"||r==="pointerout",ae&&c!==Af&&(ve=c.relatedTarget||c.fromElement)&&(bo(ve)||ve[yo]))break e;if((le||ae)&&(ae=ce.window===ce?ce:(ae=ce.ownerDocument)?ae.defaultView||ae.parentWindow:window,le?(ve=c.relatedTarget||c.toElement,le=oe,ve=ve?bo(ve):null,ve!==null&&(it=a(ve),Te=ve.tag,ve!==it||Te!==5&&Te!==27&&Te!==6)&&(ve=null)):(le=null,ve=oe),le!==ve)){if(Te=N0,ue="onMouseLeave",te="onMouseEnter",Q="mouse",(r==="pointerout"||r==="pointerover")&&(Te=L0,ue="onPointerLeave",te="onPointerEnter",Q="pointer"),it=le==null?ae:Xa(le),se=ve==null?ae:Xa(ve),ae=new Te(ue,Q+"leave",le,c,ce),ae.target=it,ae.relatedTarget=se,ue=null,bo(ce)===oe&&(Te=new Te(te,Q+"enter",ve,c,ce),Te.target=se,Te.relatedTarget=it,ue=Te),it=ue,le&&ve)t:{for(Te=AO,te=le,Q=ve,se=0,ue=te;ue;ue=Te(ue))se++;ue=0;for(var ke=Q;ke;ke=Te(ke))ue++;for(;0<se-ue;)te=Te(te),se--;for(;0<ue-se;)Q=Te(Q),ue--;for(;se--;){if(te===Q||Q!==null&&te===Q.alternate){Te=te;break t}te=Te(te),Q=Te(Q)}Te=null}else Te=null;le!==null&&Ew(he,ae,le,Te,!1),ve!==null&&it!==null&&Ew(he,it,ve,Te,!0)}}e:{if(ae=oe?Xa(oe):window,le=ae.nodeName&&ae.nodeName.toLowerCase(),le==="select"||le==="input"&&ae.type==="file")var Ke=U0;else if(H0(ae))if(F0)Ke=zN;else{Ke=IN;var we=BN}else le=ae.nodeName,!le||le.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?oe&&Tf(oe.elementType)&&(Ke=U0):Ke=jN;if(Ke&&(Ke=Ke(r,oe))){V0(he,Ke,c,ce);break e}we&&we(r,ae,oe),r==="focusout"&&oe&&ae.type==="number"&&oe.memoizedProps.value!=null&&kf(ae,"number",ae.value)}switch(we=oe?Xa(oe):window,r){case"focusin":(H0(we)||we.contentEditable==="true")&&(Ro=we,Vf=oe,sl=null);break;case"focusout":sl=Vf=Ro=null;break;case"mousedown":Uf=!0;break;case"contextmenu":case"mouseup":case"dragend":Uf=!1,Z0(he,c,ce);break;case"selectionchange":if(VN)break;case"keydown":case"keyup":Z0(he,c,ce)}var Be;if(If)e:{switch(r){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else Ao?j0(r,c)&&(We="onCompositionEnd"):r==="keydown"&&c.keyCode===229&&(We="onCompositionStart");We&&(P0&&c.locale!=="ko"&&(Ao||We!=="onCompositionStart"?We==="onCompositionEnd"&&Ao&&(Be=M0()):(Mr=ce,Nf="value"in Mr?Mr.value:Mr.textContent,Ao=!0)),we=Uu(oe,We),0<we.length&&(We=new O0(We,r,null,c,ce),he.push({event:We,listeners:we}),Be?We.data=Be:(Be=z0(c),Be!==null&&(We.data=Be)))),(Be=DN?NN(r,c):ON(r,c))&&(We=Uu(oe,"onBeforeInput"),0<We.length&&(we=new O0("onBeforeInput","beforeinput",null,c,ce),he.push({event:we,listeners:We}),we.data=Be)),CO(he,r,oe,c,ce)}xw(he,o)})}function Ml(r,o,c){return{instance:r,listener:o,currentTarget:c}}function Uu(r,o){for(var c=o+"Capture",f=[];r!==null;){var g=r,v=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||v===null||(g=Za(r,c),g!=null&&f.unshift(Ml(r,g,v)),g=Za(r,o),g!=null&&f.push(Ml(r,g,v))),r.tag===3)return f;r=r.return}return[]}function AO(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function Ew(r,o,c,f,g){for(var v=o._reactName,E=[];c!==null&&c!==f;){var D=c,Y=D.alternate,oe=D.stateNode;if(D=D.tag,Y!==null&&Y===f)break;D!==5&&D!==26&&D!==27||oe===null||(Y=oe,g?(oe=Za(c,v),oe!=null&&E.unshift(Ml(c,oe,Y))):g||(oe=Za(c,v),oe!=null&&E.push(Ml(c,oe,Y)))),c=c.return}E.length!==0&&r.push({event:o,listeners:E})}var RO=/\r\n?/g,MO=/\u0000|\uFFFD/g;function kw(r){return(typeof r=="string"?r:""+r).replace(RO,`
|
|
10
|
+
`).replace(MO,"")}function Tw(r,o){return o=kw(o),kw(r)===o}function nt(r,o,c,f,g,v){switch(c){case"children":typeof f=="string"?o==="body"||o==="textarea"&&f===""||Eo(r,f):(typeof f=="number"||typeof f=="bigint")&&o!=="body"&&Eo(r,""+f);break;case"className":Gc(r,"class",f);break;case"tabIndex":Gc(r,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":Gc(r,c,f);break;case"style":T0(r,f,v);break;case"data":if(o!=="object"){Gc(r,"data",f);break}case"src":case"href":if(f===""&&(o!=="a"||c!=="href")){r.removeAttribute(c);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(c);break}f=Kc(""+f),r.setAttribute(c,f);break;case"action":case"formAction":if(typeof f=="function"){r.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(c==="formAction"?(o!=="input"&&nt(r,o,"name",g.name,g,null),nt(r,o,"formEncType",g.formEncType,g,null),nt(r,o,"formMethod",g.formMethod,g,null),nt(r,o,"formTarget",g.formTarget,g,null)):(nt(r,o,"encType",g.encType,g,null),nt(r,o,"method",g.method,g,null),nt(r,o,"target",g.target,g,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(c);break}f=Kc(""+f),r.setAttribute(c,f);break;case"onClick":f!=null&&(r.onclick=Ki);break;case"onScroll":f!=null&&Fe("scroll",r);break;case"onScrollEnd":f!=null&&Fe("scrollend",r);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(i(61));if(c=f.__html,c!=null){if(g.children!=null)throw Error(i(60));r.innerHTML=c}}break;case"multiple":r.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":r.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){r.removeAttribute("xlink:href");break}c=Kc(""+f),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(c,""+f):r.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":f&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(c,""):r.removeAttribute(c);break;case"capture":case"download":f===!0?r.setAttribute(c,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(c,f):r.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?r.setAttribute(c,f):r.removeAttribute(c);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?r.removeAttribute(c):r.setAttribute(c,f);break;case"popover":Fe("beforetoggle",r),Fe("toggle",r),Wc(r,"popover",f);break;case"xlinkActuate":qi(r,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":qi(r,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":qi(r,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":qi(r,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":qi(r,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":qi(r,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":qi(r,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":qi(r,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":qi(r,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Wc(r,"is",f);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=rN.get(c)||c,Wc(r,c,f))}}function fm(r,o,c,f,g,v){switch(c){case"style":T0(r,f,v);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(i(61));if(c=f.__html,c!=null){if(g.children!=null)throw Error(i(60));r.innerHTML=c}}break;case"children":typeof f=="string"?Eo(r,f):(typeof f=="number"||typeof f=="bigint")&&Eo(r,""+f);break;case"onScroll":f!=null&&Fe("scroll",r);break;case"onScrollEnd":f!=null&&Fe("scrollend",r);break;case"onClick":f!=null&&(r.onclick=Ki);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!v0.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(g=c.endsWith("Capture"),o=c.slice(2,g?c.length-7:void 0),v=r[wn]||null,v=v!=null?v[c]:null,typeof v=="function"&&r.removeEventListener(o,v,g),typeof f=="function")){typeof v!="function"&&v!==null&&(c in r?r[c]=null:r.hasAttribute(c)&&r.removeAttribute(c)),r.addEventListener(o,f,g);break e}c in r?r[c]=f:f===!0?r.setAttribute(c,""):Wc(r,c,f)}}}function sn(r,o,c){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",r),Fe("load",r);var f=!1,g=!1,v;for(v in c)if(c.hasOwnProperty(v)){var E=c[v];if(E!=null)switch(v){case"src":f=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:nt(r,o,v,E,c,null)}}g&&nt(r,o,"srcSet",c.srcSet,c,null),f&&nt(r,o,"src",c.src,c,null);return;case"input":Fe("invalid",r);var D=v=E=g=null,Y=null,oe=null;for(f in c)if(c.hasOwnProperty(f)){var ce=c[f];if(ce!=null)switch(f){case"name":g=ce;break;case"type":E=ce;break;case"checked":Y=ce;break;case"defaultChecked":oe=ce;break;case"value":v=ce;break;case"defaultValue":D=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(i(137,o));break;default:nt(r,o,f,ce,c,null)}}x0(r,v,D,Y,oe,E,g,!1);return;case"select":Fe("invalid",r),f=E=v=null;for(g in c)if(c.hasOwnProperty(g)&&(D=c[g],D!=null))switch(g){case"value":v=D;break;case"defaultValue":E=D;break;case"multiple":f=D;default:nt(r,o,g,D,c,null)}o=v,c=E,r.multiple=!!f,o!=null?Co(r,!!f,o,!1):c!=null&&Co(r,!!f,c,!0);return;case"textarea":Fe("invalid",r),v=g=f=null;for(E in c)if(c.hasOwnProperty(E)&&(D=c[E],D!=null))switch(E){case"value":f=D;break;case"defaultValue":g=D;break;case"children":v=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(i(91));break;default:nt(r,o,E,D,c,null)}E0(r,f,g,v);return;case"option":for(Y in c)c.hasOwnProperty(Y)&&(f=c[Y],f!=null)&&(Y==="selected"?r.selected=f&&typeof f!="function"&&typeof f!="symbol":nt(r,o,Y,f,c,null));return;case"dialog":Fe("beforetoggle",r),Fe("toggle",r),Fe("cancel",r),Fe("close",r);break;case"iframe":case"object":Fe("load",r);break;case"video":case"audio":for(f=0;f<Rl.length;f++)Fe(Rl[f],r);break;case"image":Fe("error",r),Fe("load",r);break;case"details":Fe("toggle",r);break;case"embed":case"source":case"link":Fe("error",r),Fe("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(oe in c)if(c.hasOwnProperty(oe)&&(f=c[oe],f!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,o));default:nt(r,o,oe,f,c,null)}return;default:if(Tf(o)){for(ce in c)c.hasOwnProperty(ce)&&(f=c[ce],f!==void 0&&fm(r,o,ce,f,c,void 0));return}}for(D in c)c.hasOwnProperty(D)&&(f=c[D],f!=null&&nt(r,o,D,f,c,null))}function DO(r,o,c,f){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,v=null,E=null,D=null,Y=null,oe=null,ce=null;for(le in c){var he=c[le];if(c.hasOwnProperty(le)&&he!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":Y=he;default:f.hasOwnProperty(le)||nt(r,o,le,null,f,he)}}for(var ae in f){var le=f[ae];if(he=c[ae],f.hasOwnProperty(ae)&&(le!=null||he!=null))switch(ae){case"type":v=le;break;case"name":g=le;break;case"checked":oe=le;break;case"defaultChecked":ce=le;break;case"value":E=le;break;case"defaultValue":D=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(i(137,o));break;default:le!==he&&nt(r,o,ae,le,f,he)}}Ef(r,E,D,Y,oe,ce,v,g);return;case"select":le=E=D=ae=null;for(v in c)if(Y=c[v],c.hasOwnProperty(v)&&Y!=null)switch(v){case"value":break;case"multiple":le=Y;default:f.hasOwnProperty(v)||nt(r,o,v,null,f,Y)}for(g in f)if(v=f[g],Y=c[g],f.hasOwnProperty(g)&&(v!=null||Y!=null))switch(g){case"value":ae=v;break;case"defaultValue":D=v;break;case"multiple":E=v;default:v!==Y&&nt(r,o,g,v,f,Y)}o=D,c=E,f=le,ae!=null?Co(r,!!c,ae,!1):!!f!=!!c&&(o!=null?Co(r,!!c,o,!0):Co(r,!!c,c?[]:"",!1));return;case"textarea":le=ae=null;for(D in c)if(g=c[D],c.hasOwnProperty(D)&&g!=null&&!f.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:nt(r,o,D,null,f,g)}for(E in f)if(g=f[E],v=c[E],f.hasOwnProperty(E)&&(g!=null||v!=null))switch(E){case"value":ae=g;break;case"defaultValue":le=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(i(91));break;default:g!==v&&nt(r,o,E,g,f,v)}C0(r,ae,le);return;case"option":for(var ve in c)ae=c[ve],c.hasOwnProperty(ve)&&ae!=null&&!f.hasOwnProperty(ve)&&(ve==="selected"?r.selected=!1:nt(r,o,ve,null,f,ae));for(Y in f)ae=f[Y],le=c[Y],f.hasOwnProperty(Y)&&ae!==le&&(ae!=null||le!=null)&&(Y==="selected"?r.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":nt(r,o,Y,ae,f,le));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Te in c)ae=c[Te],c.hasOwnProperty(Te)&&ae!=null&&!f.hasOwnProperty(Te)&&nt(r,o,Te,null,f,ae);for(oe in f)if(ae=f[oe],le=c[oe],f.hasOwnProperty(oe)&&ae!==le&&(ae!=null||le!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(i(137,o));break;default:nt(r,o,oe,ae,f,le)}return;default:if(Tf(o)){for(var it in c)ae=c[it],c.hasOwnProperty(it)&&ae!==void 0&&!f.hasOwnProperty(it)&&fm(r,o,it,void 0,f,ae);for(ce in f)ae=f[ce],le=c[ce],!f.hasOwnProperty(ce)||ae===le||ae===void 0&&le===void 0||fm(r,o,ce,ae,f,le);return}}for(var te in c)ae=c[te],c.hasOwnProperty(te)&&ae!=null&&!f.hasOwnProperty(te)&&nt(r,o,te,null,f,ae);for(he in f)ae=f[he],le=c[he],!f.hasOwnProperty(he)||ae===le||ae==null&&le==null||nt(r,o,he,ae,f,le)}function Aw(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function NO(){if(typeof performance.getEntriesByType=="function"){for(var r=0,o=0,c=performance.getEntriesByType("resource"),f=0;f<c.length;f++){var g=c[f],v=g.transferSize,E=g.initiatorType,D=g.duration;if(v&&D&&Aw(E)){for(E=0,D=g.responseEnd,f+=1;f<c.length;f++){var Y=c[f],oe=Y.startTime;if(oe>D)break;var ce=Y.transferSize,he=Y.initiatorType;ce&&Aw(he)&&(Y=Y.responseEnd,E+=ce*(Y<D?1:(D-oe)/(Y-oe)))}if(--f,o+=8*(v+E)/(g.duration/1e3),r++,10<r)break}}if(0<r)return o/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var pm=null,mm=null;function Fu(r){return r.nodeType===9?r:r.ownerDocument}function Rw(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Mw(r,o){if(r===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&o==="foreignObject"?0:r}function gm(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var _m=null;function OO(){var r=window.event;return r&&r.type==="popstate"?r===_m?!1:(_m=r,!0):(_m=null,!1)}var Dw=typeof setTimeout=="function"?setTimeout:void 0,LO=typeof clearTimeout=="function"?clearTimeout:void 0,Nw=typeof Promise=="function"?Promise:void 0,PO=typeof queueMicrotask=="function"?queueMicrotask:typeof Nw<"u"?function(r){return Nw.resolve(null).then(r).catch(BO)}:Dw;function BO(r){setTimeout(function(){throw r})}function qr(r){return r==="head"}function Ow(r,o){var c=o,f=0;do{var g=c.nextSibling;if(r.removeChild(c),g&&g.nodeType===8)if(c=g.data,c==="/$"||c==="/&"){if(f===0){r.removeChild(g),na(o);return}f--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")f++;else if(c==="html")Dl(r.ownerDocument.documentElement);else if(c==="head"){c=r.ownerDocument.head,Dl(c);for(var v=c.firstChild;v;){var E=v.nextSibling,D=v.nodeName;v[Ya]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&v.rel.toLowerCase()==="stylesheet"||c.removeChild(v),v=E}}else c==="body"&&Dl(r.ownerDocument.body);c=g}while(c);na(o)}function Lw(r,o){var c=r;r=0;do{var f=c.nextSibling;if(c.nodeType===1?o?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(o?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),f&&f.nodeType===8)if(c=f.data,c==="/$"){if(r===0)break;r--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||r++;c=f}while(c)}function vm(r){var o=r.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var c=o;switch(o=o.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":vm(c),xf(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}r.removeChild(c)}}function IO(r,o,c,f){for(;r.nodeType===1;){var g=c;if(r.nodeName.toLowerCase()!==o.toLowerCase()){if(!f&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(f){if(!r[Ya])switch(o){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==g.rel||r.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||r.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||r.getAttribute("title")!==(g.title==null?null:g.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(g.src==null?null:g.src)||r.getAttribute("type")!==(g.type==null?null:g.type)||r.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(o==="input"&&r.type==="hidden"){var v=g.name==null?null:""+g.name;if(g.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=ti(r.nextSibling),r===null)break}return null}function jO(r,o,c){if(o==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!c||(r=ti(r.nextSibling),r===null))return null;return r}function Pw(r,o){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=ti(r.nextSibling),r===null))return null;return r}function ym(r){return r.data==="$?"||r.data==="$~"}function bm(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function zO(r,o){var c=r.ownerDocument;if(r.data==="$~")r._reactRetry=o;else if(r.data!=="$?"||c.readyState!=="loading")o();else{var f=function(){o(),c.removeEventListener("DOMContentLoaded",f)};c.addEventListener("DOMContentLoaded",f),r._reactRetry=f}}function ti(r){for(;r!=null;r=r.nextSibling){var o=r.nodeType;if(o===1||o===3)break;if(o===8){if(o=r.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return r}var Sm=null;function Bw(r){r=r.nextSibling;for(var o=0;r;){if(r.nodeType===8){var c=r.data;if(c==="/$"||c==="/&"){if(o===0)return ti(r.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}r=r.nextSibling}return null}function Iw(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var c=r.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(o===0)return r;o--}else c!=="/$"&&c!=="/&"||o++}r=r.previousSibling}return null}function jw(r,o,c){switch(o=Fu(c),r){case"html":if(r=o.documentElement,!r)throw Error(i(452));return r;case"head":if(r=o.head,!r)throw Error(i(453));return r;case"body":if(r=o.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function Dl(r){for(var o=r.attributes;o.length;)r.removeAttributeNode(o[0]);xf(r)}var ni=new Map,zw=new Set;function $u(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ur=U.d;U.d={f:HO,r:VO,D:UO,C:FO,L:$O,m:WO,X:qO,S:GO,M:KO};function HO(){var r=ur.f(),o=Pu();return r||o}function VO(r){var o=So(r);o!==null&&o.tag===5&&o.type==="form"?nS(o):ur.r(r)}var Jo=typeof document>"u"?null:document;function Hw(r,o,c){var f=Jo;if(f&&typeof o=="string"&&o){var g=Kn(o);g='link[rel="'+r+'"][href="'+g+'"]',typeof c=="string"&&(g+='[crossorigin="'+c+'"]'),zw.has(g)||(zw.add(g),r={rel:r,crossOrigin:c,href:o},f.querySelector(g)===null&&(o=f.createElement("link"),sn(o,"link",r),Wt(o),f.head.appendChild(o)))}}function UO(r){ur.D(r),Hw("dns-prefetch",r,null)}function FO(r,o){ur.C(r,o),Hw("preconnect",r,o)}function $O(r,o,c){ur.L(r,o,c);var f=Jo;if(f&&r&&o){var g='link[rel="preload"][as="'+Kn(o)+'"]';o==="image"&&c&&c.imageSrcSet?(g+='[imagesrcset="'+Kn(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(g+='[imagesizes="'+Kn(c.imageSizes)+'"]')):g+='[href="'+Kn(r)+'"]';var v=g;switch(o){case"style":v=ea(r);break;case"script":v=ta(r)}ni.has(v)||(r=m({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:r,as:o},c),ni.set(v,r),f.querySelector(g)!==null||o==="style"&&f.querySelector(Nl(v))||o==="script"&&f.querySelector(Ol(v))||(o=f.createElement("link"),sn(o,"link",r),Wt(o),f.head.appendChild(o)))}}function WO(r,o){ur.m(r,o);var c=Jo;if(c&&r){var f=o&&typeof o.as=="string"?o.as:"script",g='link[rel="modulepreload"][as="'+Kn(f)+'"][href="'+Kn(r)+'"]',v=g;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=ta(r)}if(!ni.has(v)&&(r=m({rel:"modulepreload",href:r},o),ni.set(v,r),c.querySelector(g)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Ol(v)))return}f=c.createElement("link"),sn(f,"link",r),Wt(f),c.head.appendChild(f)}}}function GO(r,o,c){ur.S(r,o,c);var f=Jo;if(f&&r){var g=wo(f).hoistableStyles,v=ea(r);o=o||"default";var E=g.get(v);if(!E){var D={loading:0,preload:null};if(E=f.querySelector(Nl(v)))D.loading=5;else{r=m({rel:"stylesheet",href:r,"data-precedence":o},c),(c=ni.get(v))&&wm(r,c);var Y=E=f.createElement("link");Wt(Y),sn(Y,"link",r),Y._p=new Promise(function(oe,ce){Y.onload=oe,Y.onerror=ce}),Y.addEventListener("load",function(){D.loading|=1}),Y.addEventListener("error",function(){D.loading|=2}),D.loading|=4,Wu(E,o,f)}E={type:"stylesheet",instance:E,count:1,state:D},g.set(v,E)}}}function qO(r,o){ur.X(r,o);var c=Jo;if(c&&r){var f=wo(c).hoistableScripts,g=ta(r),v=f.get(g);v||(v=c.querySelector(Ol(g)),v||(r=m({src:r,async:!0},o),(o=ni.get(g))&&xm(r,o),v=c.createElement("script"),Wt(v),sn(v,"link",r),c.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},f.set(g,v))}}function KO(r,o){ur.M(r,o);var c=Jo;if(c&&r){var f=wo(c).hoistableScripts,g=ta(r),v=f.get(g);v||(v=c.querySelector(Ol(g)),v||(r=m({src:r,async:!0,type:"module"},o),(o=ni.get(g))&&xm(r,o),v=c.createElement("script"),Wt(v),sn(v,"link",r),c.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},f.set(g,v))}}function Vw(r,o,c,f){var g=(g=G.current)?$u(g):null;if(!g)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=ea(c.href),c=wo(g).hoistableStyles,f=c.get(o),f||(f={type:"style",instance:null,count:0,state:null},c.set(o,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){r=ea(c.href);var v=wo(g).hoistableStyles,E=v.get(r);if(E||(g=g.ownerDocument||g,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,E),(v=g.querySelector(Nl(r)))&&!v._p&&(E.instance=v,E.state.loading=5),ni.has(r)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},ni.set(r,c),v||YO(g,r,c,E.state))),o&&f===null)throw Error(i(528,""));return E}if(o&&f!==null)throw Error(i(529,""));return null;case"script":return o=c.async,c=c.src,typeof c=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=ta(c),c=wo(g).hoistableScripts,f=c.get(o),f||(f={type:"script",instance:null,count:0,state:null},c.set(o,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function ea(r){return'href="'+Kn(r)+'"'}function Nl(r){return'link[rel="stylesheet"]['+r+"]"}function Uw(r){return m({},r,{"data-precedence":r.precedence,precedence:null})}function YO(r,o,c,f){r.querySelector('link[rel="preload"][as="style"]['+o+"]")?f.loading=1:(o=r.createElement("link"),f.preload=o,o.addEventListener("load",function(){return f.loading|=1}),o.addEventListener("error",function(){return f.loading|=2}),sn(o,"link",c),Wt(o),r.head.appendChild(o))}function ta(r){return'[src="'+Kn(r)+'"]'}function Ol(r){return"script[async]"+r}function Fw(r,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var f=r.querySelector('style[data-href~="'+Kn(c.href)+'"]');if(f)return o.instance=f,Wt(f),f;var g=m({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return f=(r.ownerDocument||r).createElement("style"),Wt(f),sn(f,"style",g),Wu(f,c.precedence,r),o.instance=f;case"stylesheet":g=ea(c.href);var v=r.querySelector(Nl(g));if(v)return o.state.loading|=4,o.instance=v,Wt(v),v;f=Uw(c),(g=ni.get(g))&&wm(f,g),v=(r.ownerDocument||r).createElement("link"),Wt(v);var E=v;return E._p=new Promise(function(D,Y){E.onload=D,E.onerror=Y}),sn(v,"link",f),o.state.loading|=4,Wu(v,c.precedence,r),o.instance=v;case"script":return v=ta(c.src),(g=r.querySelector(Ol(v)))?(o.instance=g,Wt(g),g):(f=c,(g=ni.get(v))&&(f=m({},c),xm(f,g)),r=r.ownerDocument||r,g=r.createElement("script"),Wt(g),sn(g,"link",f),r.head.appendChild(g),o.instance=g);case"void":return null;default:throw Error(i(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(f=o.instance,o.state.loading|=4,Wu(f,c.precedence,r));return o.instance}function Wu(r,o,c){for(var f=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=f.length?f[f.length-1]:null,v=g,E=0;E<f.length;E++){var D=f[E];if(D.dataset.precedence===o)v=D;else if(v!==g)break}v?v.parentNode.insertBefore(r,v.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(r,o.firstChild))}function wm(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.title==null&&(r.title=o.title)}function xm(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.integrity==null&&(r.integrity=o.integrity)}var Gu=null;function $w(r,o,c){if(Gu===null){var f=new Map,g=Gu=new Map;g.set(c,f)}else g=Gu,f=g.get(c),f||(f=new Map,g.set(c,f));if(f.has(r))return f;for(f.set(r,null),c=c.getElementsByTagName(r),g=0;g<c.length;g++){var v=c[g];if(!(v[Ya]||v[en]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var E=v.getAttribute(o)||"";E=r+E;var D=f.get(E);D?D.push(v):f.set(E,[v])}}return f}function Ww(r,o,c){r=r.ownerDocument||r,r.head.insertBefore(c,o==="title"?r.querySelector("head > title"):null)}function XO(r,o,c){if(c===1||o.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(r=o.disabled,typeof o.precedence=="string"&&r==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function Gw(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function ZO(r,o,c,f){if(c.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var g=ea(f.href),v=o.querySelector(Nl(g));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(r.count++,r=qu.bind(r),o.then(r,r)),c.state.loading|=4,c.instance=v,Wt(v);return}v=o.ownerDocument||o,f=Uw(f),(g=ni.get(g))&&wm(f,g),v=v.createElement("link"),Wt(v);var E=v;E._p=new Promise(function(D,Y){E.onload=D,E.onerror=Y}),sn(v,"link",f),c.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(r.count++,c=qu.bind(r),o.addEventListener("load",c),o.addEventListener("error",c))}}var Cm=0;function QO(r,o){return r.stylesheets&&r.count===0&&Yu(r,r.stylesheets),0<r.count||0<r.imgCount?function(c){var f=setTimeout(function(){if(r.stylesheets&&Yu(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+o);0<r.imgBytes&&Cm===0&&(Cm=62500*NO());var g=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Yu(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>Cm?50:800)+o);return r.unsuspend=c,function(){r.unsuspend=null,clearTimeout(f),clearTimeout(g)}}:null}function qu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yu(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Ku=null;function Yu(r,o){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Ku=new Map,o.forEach(JO,r),Ku=null,qu.call(r))}function JO(r,o){if(!(o.state.loading&4)){var c=Ku.get(r);if(c)var f=c.get(null);else{c=new Map,Ku.set(r,c);for(var g=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<g.length;v++){var E=g[v];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(c.set(E.dataset.precedence,E),f=E)}f&&c.set(null,f)}g=o.instance,E=g.getAttribute("data-precedence"),v=c.get(E)||f,v===f&&c.set(null,g),c.set(E,g),this.count++,f=qu.bind(this),g.addEventListener("load",f),g.addEventListener("error",f),v?v.parentNode.insertBefore(g,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(g,r.firstChild)),o.state.loading|=4}}var Ll={$$typeof:R,Provider:null,Consumer:null,_currentValue:j,_currentValue2:j,_threadCount:0};function eL(r,o,c,f,g,v,E,D,Y){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=yf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yf(0),this.hiddenUpdates=yf(null),this.identifierPrefix=f,this.onUncaughtError=g,this.onCaughtError=v,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function qw(r,o,c,f,g,v,E,D,Y,oe,ce,he){return r=new eL(r,o,c,E,Y,oe,ce,he,D),o=1,v===!0&&(o|=24),v=Ln(3,null,null,o),r.current=v,v.stateNode=r,o=ip(),o.refCount++,r.pooledCache=o,o.refCount++,v.memoizedState={element:f,isDehydrated:c,cache:o},ap(v),r}function Kw(r){return r?(r=No,r):No}function Yw(r,o,c,f,g,v){g=Kw(g),f.context===null?f.context=g:f.pendingContext=g,f=Br(o),f.payload={element:c},v=v===void 0?null:v,v!==null&&(f.callback=v),c=Ir(r,f,o),c!==null&&(An(c,r,o),dl(c,r,o))}function Xw(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var c=r.retryLane;r.retryLane=c!==0&&c<o?c:o}}function Em(r,o){Xw(r,o),(r=r.alternate)&&Xw(r,o)}function Zw(r){if(r.tag===13||r.tag===31){var o=Ms(r,67108864);o!==null&&An(o,r,67108864),Em(r,67108864)}}function Qw(r){if(r.tag===13||r.tag===31){var o=zn();o=bf(o);var c=Ms(r,o);c!==null&&An(c,r,o),Em(r,o)}}var Xu=!0;function tL(r,o,c,f){var g=M.T;M.T=null;var v=U.p;try{U.p=2,km(r,o,c,f)}finally{U.p=v,M.T=g}}function nL(r,o,c,f){var g=M.T;M.T=null;var v=U.p;try{U.p=8,km(r,o,c,f)}finally{U.p=v,M.T=g}}function km(r,o,c,f){if(Xu){var g=Tm(f);if(g===null)dm(r,o,f,Zu,c),e1(r,f);else if(rL(g,r,o,c,f))f.stopPropagation();else if(e1(r,f),o&4&&-1<iL.indexOf(r)){for(;g!==null;){var v=So(g);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var E=Es(v.pendingLanes);if(E!==0){var D=v;for(D.pendingLanes|=2,D.entangledLanes|=2;E;){var Y=1<<31-Nn(E);D.entanglements[1]|=Y,E&=~Y}Mi(v),(Xe&6)===0&&(Ou=Jt()+500,Al(0))}}break;case 31:case 13:D=Ms(v,2),D!==null&&An(D,v,2),Pu(),Em(v,2)}if(v=Tm(f),v===null&&dm(r,o,f,Zu,c),v===g)break;g=v}g!==null&&f.stopPropagation()}else dm(r,o,f,null,c)}}function Tm(r){return r=Rf(r),Am(r)}var Zu=null;function Am(r){if(Zu=null,r=bo(r),r!==null){var o=a(r);if(o===null)r=null;else{var c=o.tag;if(c===13){if(r=l(o),r!==null)return r;r=null}else if(c===31){if(r=u(o),r!==null)return r;r=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null)}}return Zu=r,null}function Jw(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(UD()){case a0:return 2;case l0:return 8;case Hc:case FD:return 32;case c0:return 268435456;default:return 32}default:return 32}}var Rm=!1,Kr=null,Yr=null,Xr=null,Pl=new Map,Bl=new Map,Zr=[],iL="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function e1(r,o){switch(r){case"focusin":case"focusout":Kr=null;break;case"dragenter":case"dragleave":Yr=null;break;case"mouseover":case"mouseout":Xr=null;break;case"pointerover":case"pointerout":Pl.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bl.delete(o.pointerId)}}function Il(r,o,c,f,g,v){return r===null||r.nativeEvent!==v?(r={blockedOn:o,domEventName:c,eventSystemFlags:f,nativeEvent:v,targetContainers:[g]},o!==null&&(o=So(o),o!==null&&Zw(o)),r):(r.eventSystemFlags|=f,o=r.targetContainers,g!==null&&o.indexOf(g)===-1&&o.push(g),r)}function rL(r,o,c,f,g){switch(o){case"focusin":return Kr=Il(Kr,r,o,c,f,g),!0;case"dragenter":return Yr=Il(Yr,r,o,c,f,g),!0;case"mouseover":return Xr=Il(Xr,r,o,c,f,g),!0;case"pointerover":var v=g.pointerId;return Pl.set(v,Il(Pl.get(v)||null,r,o,c,f,g)),!0;case"gotpointercapture":return v=g.pointerId,Bl.set(v,Il(Bl.get(v)||null,r,o,c,f,g)),!0}return!1}function t1(r){var o=bo(r.target);if(o!==null){var c=a(o);if(c!==null){if(o=c.tag,o===13){if(o=l(c),o!==null){r.blockedOn=o,m0(r.priority,function(){Qw(c)});return}}else if(o===31){if(o=u(c),o!==null){r.blockedOn=o,m0(r.priority,function(){Qw(c)});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){r.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Qu(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var c=Tm(r.nativeEvent);if(c===null){c=r.nativeEvent;var f=new c.constructor(c.type,c);Af=f,c.target.dispatchEvent(f),Af=null}else return o=So(c),o!==null&&Zw(o),r.blockedOn=c,!1;o.shift()}return!0}function n1(r,o,c){Qu(r)&&c.delete(o)}function sL(){Rm=!1,Kr!==null&&Qu(Kr)&&(Kr=null),Yr!==null&&Qu(Yr)&&(Yr=null),Xr!==null&&Qu(Xr)&&(Xr=null),Pl.forEach(n1),Bl.forEach(n1)}function Ju(r,o){r.blockedOn===o&&(r.blockedOn=null,Rm||(Rm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,sL)))}var eh=null;function i1(r){eh!==r&&(eh=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){eh===r&&(eh=null);for(var o=0;o<r.length;o+=3){var c=r[o],f=r[o+1],g=r[o+2];if(typeof f!="function"){if(Am(f||c)===null)continue;break}var v=So(c);v!==null&&(r.splice(o,3),o-=3,Tp(v,{pending:!0,data:g,method:c.method,action:f},f,g))}}))}function na(r){function o(Y){return Ju(Y,r)}Kr!==null&&Ju(Kr,r),Yr!==null&&Ju(Yr,r),Xr!==null&&Ju(Xr,r),Pl.forEach(o),Bl.forEach(o);for(var c=0;c<Zr.length;c++){var f=Zr[c];f.blockedOn===r&&(f.blockedOn=null)}for(;0<Zr.length&&(c=Zr[0],c.blockedOn===null);)t1(c),c.blockedOn===null&&Zr.shift();if(c=(r.ownerDocument||r).$$reactFormReplay,c!=null)for(f=0;f<c.length;f+=3){var g=c[f],v=c[f+1],E=g[wn]||null;if(typeof v=="function")E||i1(c);else if(E){var D=null;if(v&&v.hasAttribute("formAction")){if(g=v,E=v[wn]||null)D=E.formAction;else if(Am(g)!==null)continue}else D=E.action;typeof D=="function"?c[f+1]=D:(c.splice(f,3),f-=3),i1(c)}}}function r1(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(E){return g=E})},focusReset:"manual",scroll:"manual"})}function o(){g!==null&&(g(),g=null),f||setTimeout(c,20)}function c(){if(!f&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,g=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(c,100),function(){f=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),g!==null&&(g(),g=null)}}}function Mm(r){this._internalRoot=r}th.prototype.render=Mm.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(i(409));var c=o.current,f=zn();Yw(c,f,r,o,null,null)},th.prototype.unmount=Mm.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;Yw(r.current,2,null,r,null,null),Pu(),o[yo]=null}};function th(r){this._internalRoot=r}th.prototype.unstable_scheduleHydration=function(r){if(r){var o=p0();r={blockedOn:null,target:r,priority:o};for(var c=0;c<Zr.length&&o!==0&&o<Zr[c].priority;c++);Zr.splice(c,0,r),c===0&&t1(r)}};var s1=t.version;if(s1!=="19.2.4")throw Error(i(527,s1,"19.2.4"));U.findDOMNode=function(r){var o=r._reactInternals;if(o===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=d(o),r=r!==null?p(r):null,r=r===null?null:r.stateNode,r};var oL={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nh.isDisabled&&nh.supportsFiber)try{Ga=nh.inject(oL),Dn=nh}catch{}}return zl.createRoot=function(r,o){if(!s(r))throw Error(i(299));var c=!1,f="",g=dS,v=fS,E=pS;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(f=o.identifierPrefix),o.onUncaughtError!==void 0&&(g=o.onUncaughtError),o.onCaughtError!==void 0&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),o=qw(r,1,!1,null,null,c,f,null,g,v,E,r1),r[yo]=o.current,hm(r),new Mm(o)},zl.hydrateRoot=function(r,o,c){if(!s(r))throw Error(i(299));var f=!1,g="",v=dS,E=fS,D=pS,Y=null;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onUncaughtError!==void 0&&(v=c.onUncaughtError),c.onCaughtError!==void 0&&(E=c.onCaughtError),c.onRecoverableError!==void 0&&(D=c.onRecoverableError),c.formState!==void 0&&(Y=c.formState)),o=qw(r,1,!0,o,c??null,f,g,Y,v,E,D,r1),o.context=Kw(null),c=o.current,f=zn(),f=bf(f),g=Br(f),g.callback=null,Ir(c,g,f),c=f,o.current.lanes=c,Ka(o,c),Mi(o),r[yo]=o.current,hm(r),new th(o)},zl.version="19.2.4",zl}var m1;function gL(){if(m1)return Om.exports;m1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Om.exports=mL(),Om.exports}var _L=gL(),Ec=p2();const vL=d2(Ec);function g1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function m2(...e){return t=>{let n=!1;const i=e.map(s=>{const a=g1(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<i.length;s++){const a=i[s];typeof a=="function"?a():g1(e[s],null)}}}}function Ze(...e){return x.useCallback(m2(...e),e)}function ka(e){const t=yL(e),n=x.forwardRef((i,s)=>{const{children:a,...l}=i,u=x.Children.toArray(a),h=u.find(SL);if(h){const d=h.props.children,p=u.map(m=>m===h?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:m);return w.jsx(t,{...l,ref:s,children:x.isValidElement(d)?x.cloneElement(d,void 0,p):null})}return w.jsx(t,{...l,ref:s,children:a})});return n.displayName=`${e}.Slot`,n}var g2=ka("Slot");function yL(e){const t=x.forwardRef((n,i)=>{const{children:s,...a}=n;if(x.isValidElement(s)){const l=xL(s),u=wL(a,s.props);return s.type!==x.Fragment&&(u.ref=i?m2(i,l):l),x.cloneElement(s,u)}return x.Children.count(s)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _2=Symbol("radix.slottable");function bL(e){const t=({children:n})=>w.jsx(w.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=_2,t}function SL(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_2}function wL(e,t){const n={...t};for(const i in t){const s=e[i],a=t[i];/^on[A-Z]/.test(i)?s&&a?n[i]=(...u)=>{const h=a(...u);return s(...u),h}:s&&(n[i]=s):i==="style"?n[i]={...s,...a}:i==="className"&&(n[i]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function xL(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var CL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],je=CL.reduce((e,t)=>{const n=ka(`Primitive.${t}`),i=x.forwardRef((s,a)=>{const{asChild:l,...u}=s,h=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(h,{...u,ref:a})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function EL(e,t){e&&Ec.flushSync(()=>e.dispatchEvent(t))}var v2=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"}),kL="VisuallyHidden",y2=x.forwardRef((e,t)=>w.jsx(je.span,{...e,ref:t,style:{...v2,...e.style}}));y2.displayName=kL;var TL=y2;function AL(e,t){const n=x.createContext(t),i=a=>{const{children:l,...u}=a,h=x.useMemo(()=>u,Object.values(u));return w.jsx(n.Provider,{value:h,children:l})};i.displayName=e+"Provider";function s(a){const l=x.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[i,s]}function vs(e,t=[]){let n=[];function i(a,l){const u=x.createContext(l),h=n.length;n=[...n,l];const d=m=>{const{scope:_,children:y,...b}=m,S=_?.[e]?.[h]||u,C=x.useMemo(()=>b,Object.values(b));return w.jsx(S.Provider,{value:C,children:y})};d.displayName=a+"Provider";function p(m,_){const y=_?.[e]?.[h]||u,b=x.useContext(y);if(b)return b;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[d,p]}const s=()=>{const a=n.map(l=>x.createContext(l));return function(u){const h=u?.[e]||a;return x.useMemo(()=>({[`__scope${e}`]:{...u,[e]:h}}),[u,h])}};return s.scopeName=e,[i,RL(s,...t)]}function RL(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const l=i.reduce((u,{useScope:h,scopeName:d})=>{const m=h(a)[`__scope${d}`];return{...u,...m}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function b2(e){const t=e+"CollectionProvider",[n,i]=vs(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=S=>{const{scope:C,children:k}=S,T=ss.useRef(null),R=ss.useRef(new Map).current;return w.jsx(s,{scope:C,itemMap:R,collectionRef:T,children:k})};l.displayName=t;const u=e+"CollectionSlot",h=ka(u),d=ss.forwardRef((S,C)=>{const{scope:k,children:T}=S,R=a(u,k),A=Ze(C,R.collectionRef);return w.jsx(h,{ref:A,children:T})});d.displayName=u;const p=e+"CollectionItemSlot",m="data-radix-collection-item",_=ka(p),y=ss.forwardRef((S,C)=>{const{scope:k,children:T,...R}=S,A=ss.useRef(null),N=Ze(C,A),V=a(p,k);return ss.useEffect(()=>(V.itemMap.set(A,{ref:A,...R}),()=>{V.itemMap.delete(A)})),w.jsx(_,{[m]:"",ref:N,children:T})});y.displayName=p;function b(S){const C=a(e+"CollectionConsumer",S);return ss.useCallback(()=>{const T=C.collectionRef.current;if(!T)return[];const R=Array.from(T.querySelectorAll(`[${m}]`));return Array.from(C.itemMap.values()).sort((V,H)=>R.indexOf(V.ref.current)-R.indexOf(H.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:d,ItemSlot:y},b,i]}function Re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}var ln=globalThis?.document?x.useLayoutEffect:()=>{},ML=f2[" useInsertionEffect ".trim().toString()]||ln;function Ta({prop:e,defaultProp:t,onChange:n=()=>{},caller:i}){const[s,a,l]=DL({defaultProp:t,onChange:n}),u=e!==void 0,h=u?e:s;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const m=p.current;m!==u&&console.warn(`${i} is changing from ${m?"controlled":"uncontrolled"} to ${u?"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.`),p.current=u},[u,i])}const d=x.useCallback(p=>{if(u){const m=NL(p)?p(e):p;m!==e&&l.current?.(m)}else a(p)},[u,e,a,l]);return[h,d]}function DL({defaultProp:e,onChange:t}){const[n,i]=x.useState(e),s=x.useRef(n),a=x.useRef(t);return ML(()=>{a.current=t},[t]),x.useEffect(()=>{s.current!==n&&(a.current?.(n),s.current=n)},[n,s]),[n,i,a]}function NL(e){return typeof e=="function"}function OL(e,t){return x.useReducer((n,i)=>t[n][i]??n,e)}var Ci=e=>{const{present:t,children:n}=e,i=LL(t),s=typeof n=="function"?n({present:i.isPresent}):x.Children.only(n),a=Ze(i.ref,PL(s));return typeof n=="function"||i.isPresent?x.cloneElement(s,{ref:a}):null};Ci.displayName="Presence";function LL(e){const[t,n]=x.useState(),i=x.useRef(null),s=x.useRef(e),a=x.useRef("none"),l=e?"mounted":"unmounted",[u,h]=OL(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const d=ih(i.current);a.current=u==="mounted"?d:"none"},[u]),ln(()=>{const d=i.current,p=s.current;if(p!==e){const _=a.current,y=ih(d);e?h("MOUNT"):y==="none"||d?.display==="none"?h("UNMOUNT"):h(p&&_!==y?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),ln(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,m=y=>{const S=ih(i.current).includes(CSS.escape(y.animationName));if(y.target===t&&S&&(h("ANIMATION_END"),!s.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},_=y=>{y.target===t&&(a.current=ih(i.current))};return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:x.useCallback(d=>{i.current=d?getComputedStyle(d):null,n(d)},[])}}function ih(e){return e?.animationName||"none"}function PL(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var BL=f2[" useId ".trim().toString()]||(()=>{}),IL=0;function vr(e){const[t,n]=x.useState(BL());return ln(()=>{n(i=>i??String(IL++))},[e]),e||(t?`radix-${t}`:"")}var jL=x.createContext(void 0);function Id(e){const t=x.useContext(jL);return e||t||"ltr"}function _n(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>t.current?.(...n),[])}function zL(e,t=globalThis?.document){const n=_n(e);x.useEffect(()=>{const i=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",i,{capture:!0}),()=>t.removeEventListener("keydown",i,{capture:!0})},[n,t])}var HL="DismissableLayer",qg="dismissableLayer.update",VL="dismissableLayer.pointerDownOutside",UL="dismissableLayer.focusOutside",_1,S2=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jd=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:u,...h}=e,d=x.useContext(S2),[p,m]=x.useState(null),_=p?.ownerDocument??globalThis?.document,[,y]=x.useState({}),b=Ze(t,H=>m(H)),S=Array.from(d.layers),[C]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),k=S.indexOf(C),T=p?S.indexOf(p):-1,R=d.layersWithOutsidePointerEventsDisabled.size>0,A=T>=k,N=WL(H=>{const z=H.target,J=[...d.branches].some($=>$.contains(z));!A||J||(s?.(H),l?.(H),H.defaultPrevented||u?.())},_),V=GL(H=>{const z=H.target;[...d.branches].some($=>$.contains(z))||(a?.(H),l?.(H),H.defaultPrevented||u?.())},_);return zL(H=>{T===d.layers.size-1&&(i?.(H),!H.defaultPrevented&&u&&(H.preventDefault(),u()))},_),x.useEffect(()=>{if(p)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(_1=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),v1(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=_1)}},[p,_,n,d]),x.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),v1())},[p,d]),x.useEffect(()=>{const H=()=>y({});return document.addEventListener(qg,H),()=>document.removeEventListener(qg,H)},[]),w.jsx(je.div,{...h,ref:b,style:{pointerEvents:R?A?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,V.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,V.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,N.onPointerDownCapture)})});jd.displayName=HL;var FL="DismissableLayerBranch",$L=x.forwardRef((e,t)=>{const n=x.useContext(S2),i=x.useRef(null),s=Ze(t,i);return x.useEffect(()=>{const a=i.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),w.jsx(je.div,{...e,ref:s})});$L.displayName=FL;function WL(e,t=globalThis?.document){const n=_n(e),i=x.useRef(!1),s=x.useRef(()=>{});return x.useEffect(()=>{const a=u=>{if(u.target&&!i.current){let h=function(){w2(VL,n,d,{discrete:!0})};const d={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=h,t.addEventListener("click",s.current,{once:!0})):h()}else t.removeEventListener("click",s.current);i.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>i.current=!0}}function GL(e,t=globalThis?.document){const n=_n(e),i=x.useRef(!1);return x.useEffect(()=>{const s=a=>{a.target&&!i.current&&w2(UL,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function v1(){const e=new CustomEvent(qg);document.dispatchEvent(e)}function w2(e,t,n,{discrete:i}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),i?EL(s,a):s.dispatchEvent(a)}var Im="focusScope.autoFocusOnMount",jm="focusScope.autoFocusOnUnmount",y1={bubbles:!1,cancelable:!0},qL="FocusScope",Pv=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[u,h]=x.useState(null),d=_n(s),p=_n(a),m=x.useRef(null),_=Ze(t,S=>h(S)),y=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(i){let S=function(R){if(y.paused||!u)return;const A=R.target;u.contains(A)?m.current=A:os(m.current,{select:!0})},C=function(R){if(y.paused||!u)return;const A=R.relatedTarget;A!==null&&(u.contains(A)||os(m.current,{select:!0}))},k=function(R){if(document.activeElement===document.body)for(const N of R)N.removedNodes.length>0&&os(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const T=new MutationObserver(k);return u&&T.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),T.disconnect()}}},[i,u,y.paused]),x.useEffect(()=>{if(u){S1.add(y);const S=document.activeElement;if(!u.contains(S)){const k=new CustomEvent(Im,y1);u.addEventListener(Im,d),u.dispatchEvent(k),k.defaultPrevented||(KL(JL(x2(u)),{select:!0}),document.activeElement===S&&os(u))}return()=>{u.removeEventListener(Im,d),setTimeout(()=>{const k=new CustomEvent(jm,y1);u.addEventListener(jm,p),u.dispatchEvent(k),k.defaultPrevented||os(S??document.body,{select:!0}),u.removeEventListener(jm,p),S1.remove(y)},0)}}},[u,d,p,y]);const b=x.useCallback(S=>{if(!n&&!i||y.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,k=document.activeElement;if(C&&k){const T=S.currentTarget,[R,A]=YL(T);R&&A?!S.shiftKey&&k===A?(S.preventDefault(),n&&os(R,{select:!0})):S.shiftKey&&k===R&&(S.preventDefault(),n&&os(A,{select:!0})):k===T&&S.preventDefault()}},[n,i,y.paused]);return w.jsx(je.div,{tabIndex:-1,...l,ref:_,onKeyDown:b})});Pv.displayName=qL;function KL(e,{select:t=!1}={}){const n=document.activeElement;for(const i of e)if(os(i,{select:t}),document.activeElement!==n)return}function YL(e){const t=x2(e),n=b1(t,e),i=b1(t.reverse(),e);return[n,i]}function x2(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const s=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||s?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function b1(e,t){for(const n of e)if(!XL(n,{upTo:t}))return n}function XL(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 ZL(e){return e instanceof HTMLInputElement&&"select"in e}function os(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ZL(e)&&t&&e.select()}}var S1=QL();function QL(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=w1(e,t),e.unshift(t)},remove(t){e=w1(e,t),e[0]?.resume()}}}function w1(e,t){const n=[...e],i=n.indexOf(t);return i!==-1&&n.splice(i,1),n}function JL(e){return e.filter(t=>t.tagName!=="A")}var e3="Portal",zd=x.forwardRef((e,t)=>{const{container:n,...i}=e,[s,a]=x.useState(!1);ln(()=>a(!0),[]);const l=n||s&&globalThis?.document?.body;return l?vL.createPortal(w.jsx(je.div,{...i,ref:t}),l):null});zd.displayName=e3;var zm=0;function C2(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??x1()),document.body.insertAdjacentElement("beforeend",e[1]??x1()),zm++,()=>{zm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),zm--}},[])}function x1(){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 Bi=function(){return Bi=Object.assign||function(t){for(var n,i=1,s=arguments.length;i<s;i++){n=arguments[i];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Bi.apply(this,arguments)};function E2(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]]);return n}function t3(e,t,n){if(n||arguments.length===2)for(var i=0,s=t.length,a;i<s;i++)(a||!(i in t))&&(a||(a=Array.prototype.slice.call(t,0,i)),a[i]=t[i]);return e.concat(a||Array.prototype.slice.call(t))}var Dh="right-scroll-bar-position",Nh="width-before-scroll-bar",n3="with-scroll-bars-hidden",i3="--removed-body-scroll-bar-size";function Hm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function r3(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(i){var s=n.value;s!==i&&(n.value=i,n.callback(i,s))}}}})[0];return n.callback=t,n.facade}var s3=typeof window<"u"?x.useLayoutEffect:x.useEffect,C1=new WeakMap;function o3(e,t){var n=r3(null,function(i){return e.forEach(function(s){return Hm(s,i)})});return s3(function(){var i=C1.get(n);if(i){var s=new Set(i),a=new Set(e),l=n.current;s.forEach(function(u){a.has(u)||Hm(u,null)}),a.forEach(function(u){s.has(u)||Hm(u,l)})}C1.set(n,e)},[e]),n}function a3(e){return e}function l3(e,t){t===void 0&&(t=a3);var n=[],i=!1,s={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var l=t(a,i);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(a){for(i=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(u){return a(u)},filter:function(){return n}}},assignMedium:function(a){i=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(a),l=n}var h=function(){var p=l;l=[],p.forEach(a)},d=function(){return Promise.resolve().then(h)};d(),n={push:function(p){l.push(p),d()},filter:function(p){return l=l.filter(p),n}}}};return s}function c3(e){e===void 0&&(e={});var t=l3(null);return t.options=Bi({async:!0,ssr:!1},e),t}var k2=function(e){var t=e.sideCar,n=E2(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=t.read();if(!i)throw new Error("Sidecar medium not found");return x.createElement(i,Bi({},n))};k2.isSideCarExport=!0;function u3(e,t){return e.useMedium(t),k2}var T2=c3(),Vm=function(){},Hd=x.forwardRef(function(e,t){var n=x.useRef(null),i=x.useState({onScrollCapture:Vm,onWheelCapture:Vm,onTouchMoveCapture:Vm}),s=i[0],a=i[1],l=e.forwardProps,u=e.children,h=e.className,d=e.removeScrollBar,p=e.enabled,m=e.shards,_=e.sideCar,y=e.noRelative,b=e.noIsolation,S=e.inert,C=e.allowPinchZoom,k=e.as,T=k===void 0?"div":k,R=e.gapMode,A=E2(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=_,V=o3([n,t]),H=Bi(Bi({},A),s);return x.createElement(x.Fragment,null,p&&x.createElement(N,{sideCar:T2,removeScrollBar:d,shards:m,noRelative:y,noIsolation:b,inert:S,setCallbacks:a,allowPinchZoom:!!C,lockRef:n,gapMode:R}),l?x.cloneElement(x.Children.only(u),Bi(Bi({},H),{ref:V})):x.createElement(T,Bi({},H,{className:h,ref:V}),u))});Hd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Hd.classNames={fullWidth:Nh,zeroRight:Dh};var h3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function d3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=h3();return t&&e.setAttribute("nonce",t),e}function f3(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function p3(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var m3=function(){var e=0,t=null;return{add:function(n){e==0&&(t=d3())&&(f3(t,n),p3(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},g3=function(){var e=m3();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},A2=function(){var e=g3(),t=function(n){var i=n.styles,s=n.dynamic;return e(i,s),null};return t},_3={left:0,top:0,right:0,gap:0},Um=function(e){return parseInt(e||"",10)||0},v3=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],i=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Um(n),Um(i),Um(s)]},y3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return _3;var t=v3(e),n=document.documentElement.clientWidth,i=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,i-n+t[2]-t[0])}},b3=A2(),ba="data-scroll-locked",S3=function(e,t,n,i){var s=e.left,a=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
11
|
+
.`.concat(n3,` {
|
|
12
|
+
overflow: hidden `).concat(i,`;
|
|
13
|
+
padding-right: `).concat(u,"px ").concat(i,`;
|
|
14
|
+
}
|
|
15
|
+
body[`).concat(ba,`] {
|
|
16
|
+
overflow: hidden `).concat(i,`;
|
|
17
|
+
overscroll-behavior: contain;
|
|
18
|
+
`).concat([t&&"position: relative ".concat(i,";"),n==="margin"&&`
|
|
19
|
+
padding-left: `.concat(s,`px;
|
|
20
|
+
padding-top: `).concat(a,`px;
|
|
21
|
+
padding-right: `).concat(l,`px;
|
|
22
|
+
margin-left:0;
|
|
23
|
+
margin-top:0;
|
|
24
|
+
margin-right: `).concat(u,"px ").concat(i,`;
|
|
25
|
+
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(i,";")].filter(Boolean).join(""),`
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.`).concat(Dh,` {
|
|
29
|
+
right: `).concat(u,"px ").concat(i,`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.`).concat(Nh,` {
|
|
33
|
+
margin-right: `).concat(u,"px ").concat(i,`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.`).concat(Dh," .").concat(Dh,` {
|
|
37
|
+
right: 0 `).concat(i,`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.`).concat(Nh," .").concat(Nh,` {
|
|
41
|
+
margin-right: 0 `).concat(i,`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
body[`).concat(ba,`] {
|
|
45
|
+
`).concat(i3,": ").concat(u,`px;
|
|
46
|
+
}
|
|
47
|
+
`)},E1=function(){var e=parseInt(document.body.getAttribute(ba)||"0",10);return isFinite(e)?e:0},w3=function(){x.useEffect(function(){return document.body.setAttribute(ba,(E1()+1).toString()),function(){var e=E1()-1;e<=0?document.body.removeAttribute(ba):document.body.setAttribute(ba,e.toString())}},[])},x3=function(e){var t=e.noRelative,n=e.noImportant,i=e.gapMode,s=i===void 0?"margin":i;w3();var a=x.useMemo(function(){return y3(s)},[s]);return x.createElement(b3,{styles:S3(a,!t,s,n?"":"!important")})},Kg=!1;if(typeof window<"u")try{var rh=Object.defineProperty({},"passive",{get:function(){return Kg=!0,!0}});window.addEventListener("test",rh,rh),window.removeEventListener("test",rh,rh)}catch{Kg=!1}var ia=Kg?{passive:!1}:!1,C3=function(e){return e.tagName==="TEXTAREA"},R2=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!C3(e)&&n[t]==="visible")},E3=function(e){return R2(e,"overflowY")},k3=function(e){return R2(e,"overflowX")},k1=function(e,t){var n=t.ownerDocument,i=t;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var s=M2(e,i);if(s){var a=D2(e,i),l=a[1],u=a[2];if(l>u)return!0}i=i.parentNode}while(i&&i!==n.body);return!1},T3=function(e){var t=e.scrollTop,n=e.scrollHeight,i=e.clientHeight;return[t,n,i]},A3=function(e){var t=e.scrollLeft,n=e.scrollWidth,i=e.clientWidth;return[t,n,i]},M2=function(e,t){return e==="v"?E3(t):k3(t)},D2=function(e,t){return e==="v"?T3(t):A3(t)},R3=function(e,t){return e==="h"&&t==="rtl"?-1:1},M3=function(e,t,n,i,s){var a=R3(e,window.getComputedStyle(t).direction),l=a*i,u=n.target,h=t.contains(u),d=!1,p=l>0,m=0,_=0;do{if(!u)break;var y=D2(e,u),b=y[0],S=y[1],C=y[2],k=S-C-a*b;(b||k)&&M2(e,u)&&(m+=k,_+=b);var T=u.parentNode;u=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!h&&u!==document.body||h&&(t.contains(u)||t===u));return(p&&Math.abs(m)<1||!p&&Math.abs(_)<1)&&(d=!0),d},sh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},T1=function(e){return[e.deltaX,e.deltaY]},A1=function(e){return e&&"current"in e?e.current:e},D3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},N3=function(e){return`
|
|
48
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
49
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
50
|
+
`)},O3=0,ra=[];function L3(e){var t=x.useRef([]),n=x.useRef([0,0]),i=x.useRef(),s=x.useState(O3++)[0],a=x.useState(A2)[0],l=x.useRef(e);x.useEffect(function(){l.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var S=t3([e.lockRef.current],(e.shards||[]).map(A1),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=x.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!l.current.allowPinchZoom;var k=sh(S),T=n.current,R="deltaX"in S?S.deltaX:T[0]-k[0],A="deltaY"in S?S.deltaY:T[1]-k[1],N,V=S.target,H=Math.abs(R)>Math.abs(A)?"h":"v";if("touches"in S&&H==="h"&&V.type==="range")return!1;var z=window.getSelection(),J=z&&z.anchorNode,$=J?J===V||J.contains(V):!1;if($)return!1;var K=k1(H,V);if(!K)return!0;if(K?N=H:(N=H==="v"?"h":"v",K=k1(H,V)),!K)return!1;if(!i.current&&"changedTouches"in S&&(R||A)&&(i.current=N),!N)return!0;var I=i.current||N;return M3(I,C,S,I==="h"?R:A)},[]),h=x.useCallback(function(S){var C=S;if(!(!ra.length||ra[ra.length-1]!==a)){var k="deltaY"in C?T1(C):sh(C),T=t.current.filter(function(N){return N.name===C.type&&(N.target===C.target||C.target===N.shadowParent)&&D3(N.delta,k)})[0];if(T&&T.should){C.cancelable&&C.preventDefault();return}if(!T){var R=(l.current.shards||[]).map(A1).filter(Boolean).filter(function(N){return N.contains(C.target)}),A=R.length>0?u(C,R[0]):!l.current.noIsolation;A&&C.cancelable&&C.preventDefault()}}},[]),d=x.useCallback(function(S,C,k,T){var R={name:S,delta:C,target:k,should:T,shadowParent:P3(k)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(A){return A!==R})},1)},[]),p=x.useCallback(function(S){n.current=sh(S),i.current=void 0},[]),m=x.useCallback(function(S){d(S.type,T1(S),S.target,u(S,e.lockRef.current))},[]),_=x.useCallback(function(S){d(S.type,sh(S),S.target,u(S,e.lockRef.current))},[]);x.useEffect(function(){return ra.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:_}),document.addEventListener("wheel",h,ia),document.addEventListener("touchmove",h,ia),document.addEventListener("touchstart",p,ia),function(){ra=ra.filter(function(S){return S!==a}),document.removeEventListener("wheel",h,ia),document.removeEventListener("touchmove",h,ia),document.removeEventListener("touchstart",p,ia)}},[]);var y=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(a,{styles:N3(s)}):null,y?x.createElement(x3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function P3(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const B3=u3(T2,L3);var Bv=x.forwardRef(function(e,t){return x.createElement(Hd,Bi({},e,{ref:t,sideCar:B3}))});Bv.classNames=Hd.classNames;var I3=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},sa=new WeakMap,oh=new WeakMap,ah={},Fm=0,N2=function(e){return e&&(e.host||N2(e.parentNode))},j3=function(e,t){return t.map(function(n){if(e.contains(n))return n;var i=N2(n);return i&&e.contains(i)?i:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},z3=function(e,t,n,i){var s=j3(t,Array.isArray(e)?e:[e]);ah[n]||(ah[n]=new WeakMap);var a=ah[n],l=[],u=new Set,h=new Set(s),d=function(m){!m||u.has(m)||(u.add(m),d(m.parentNode))};s.forEach(d);var p=function(m){!m||h.has(m)||Array.prototype.forEach.call(m.children,function(_){if(u.has(_))p(_);else try{var y=_.getAttribute(i),b=y!==null&&y!=="false",S=(sa.get(_)||0)+1,C=(a.get(_)||0)+1;sa.set(_,S),a.set(_,C),l.push(_),S===1&&b&&oh.set(_,!0),C===1&&_.setAttribute(n,"true"),b||_.setAttribute(i,"true")}catch(k){console.error("aria-hidden: cannot operate on ",_,k)}})};return p(t),u.clear(),Fm++,function(){l.forEach(function(m){var _=sa.get(m)-1,y=a.get(m)-1;sa.set(m,_),a.set(m,y),_||(oh.has(m)||m.removeAttribute(i),oh.delete(m)),y||m.removeAttribute(n)}),Fm--,Fm||(sa=new WeakMap,sa=new WeakMap,oh=new WeakMap,ah={})}},O2=function(e,t,n){n===void 0&&(n="data-aria-hidden");var i=Array.from(Array.isArray(e)?e:[e]),s=I3(e);return s?(i.push.apply(i,Array.from(s.querySelectorAll("[aria-live], script"))),z3(i,s,n,"aria-hidden")):function(){return null}},Vd="Dialog",[L2]=vs(Vd),[H3,Ei]=L2(Vd),P2=e=>{const{__scopeDialog:t,children:n,open:i,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,u=x.useRef(null),h=x.useRef(null),[d,p]=Ta({prop:i,defaultProp:s??!1,onChange:a,caller:Vd});return w.jsx(H3,{scope:t,triggerRef:u,contentRef:h,contentId:vr(),titleId:vr(),descriptionId:vr(),open:d,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(m=>!m),[p]),modal:l,children:n})};P2.displayName=Vd;var B2="DialogTrigger",V3=x.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=Ei(B2,n),a=Ze(t,s.triggerRef);return w.jsx(je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":zv(s.open),...i,ref:a,onClick:Re(e.onClick,s.onOpenToggle)})});V3.displayName=B2;var Iv="DialogPortal",[U3,I2]=L2(Iv,{forceMount:void 0}),j2=e=>{const{__scopeDialog:t,forceMount:n,children:i,container:s}=e,a=Ei(Iv,t);return w.jsx(U3,{scope:t,forceMount:n,children:x.Children.map(i,l=>w.jsx(Ci,{present:n||a.open,children:w.jsx(zd,{asChild:!0,container:s,children:l})}))})};j2.displayName=Iv;var td="DialogOverlay",z2=x.forwardRef((e,t)=>{const n=I2(td,e.__scopeDialog),{forceMount:i=n.forceMount,...s}=e,a=Ei(td,e.__scopeDialog);return a.modal?w.jsx(Ci,{present:i||a.open,children:w.jsx($3,{...s,ref:t})}):null});z2.displayName=td;var F3=ka("DialogOverlay.RemoveScroll"),$3=x.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=Ei(td,n);return w.jsx(Bv,{as:F3,allowPinchZoom:!0,shards:[s.contentRef],children:w.jsx(je.div,{"data-state":zv(s.open),...i,ref:t,style:{pointerEvents:"auto",...i.style}})})}),ao="DialogContent",H2=x.forwardRef((e,t)=>{const n=I2(ao,e.__scopeDialog),{forceMount:i=n.forceMount,...s}=e,a=Ei(ao,e.__scopeDialog);return w.jsx(Ci,{present:i||a.open,children:a.modal?w.jsx(W3,{...s,ref:t}):w.jsx(G3,{...s,ref:t})})});H2.displayName=ao;var W3=x.forwardRef((e,t)=>{const n=Ei(ao,e.__scopeDialog),i=x.useRef(null),s=Ze(t,n.contentRef,i);return x.useEffect(()=>{const a=i.current;if(a)return O2(a)},[]),w.jsx(V2,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&a.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,a=>a.preventDefault())})}),G3=x.forwardRef((e,t)=>{const n=Ei(ao,e.__scopeDialog),i=x.useRef(!1),s=x.useRef(!1);return w.jsx(V2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(i.current||n.triggerRef.current?.focus(),a.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(i.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=a.target;n.triggerRef.current?.contains(l)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),V2=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,...l}=e,u=Ei(ao,n),h=x.useRef(null),d=Ze(t,h);return C2(),w.jsxs(w.Fragment,{children:[w.jsx(Pv,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:a,children:w.jsx(jd,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":zv(u.open),...l,ref:d,onDismiss:()=>u.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(q3,{titleId:u.titleId}),w.jsx(Y3,{contentRef:h,descriptionId:u.descriptionId})]})]})}),jv="DialogTitle",U2=x.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=Ei(jv,n);return w.jsx(je.h2,{id:s.titleId,...i,ref:t})});U2.displayName=jv;var F2="DialogDescription",$2=x.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=Ei(F2,n);return w.jsx(je.p,{id:s.descriptionId,...i,ref:t})});$2.displayName=F2;var W2="DialogClose",G2=x.forwardRef((e,t)=>{const{__scopeDialog:n,...i}=e,s=Ei(W2,n);return w.jsx(je.button,{type:"button",...i,ref:t,onClick:Re(e.onClick,()=>s.onOpenChange(!1))})});G2.displayName=W2;function zv(e){return e?"open":"closed"}var q2="DialogTitleWarning",[DK,K2]=AL(q2,{contentName:ao,titleName:jv,docsSlug:"dialog"}),q3=({titleId:e})=>{const t=K2(q2),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
51
|
+
|
|
52
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
53
|
+
|
|
54
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},K3="DialogDescriptionWarning",Y3=({contentRef:e,descriptionId:t})=>{const i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${K2(K3).contentName}}.`;return x.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(i))},[i,e,t]),null},X3=P2,Z3=j2,Q3=z2,J3=H2,e5=U2,t5=$2,Y2=G2;function n5(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function i5(e){const[t,n]=x.useState(void 0);return ln(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let l,u;if("borderBoxSize"in a){const h=a.borderBoxSize,d=Array.isArray(h)?h[0]:h;l=d.inlineSize,u=d.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}const r5=["top","right","bottom","left"],ms=Math.min,$n=Math.max,nd=Math.round,lh=Math.floor,zi=e=>({x:e,y:e}),s5={left:"right",right:"left",bottom:"top",top:"bottom"};function Yg(e,t,n){return $n(e,ms(t,n))}function br(e,t){return typeof e=="function"?e(t):e}function Sr(e){return e.split("-")[0]}function Pa(e){return e.split("-")[1]}function Hv(e){return e==="x"?"y":"x"}function Vv(e){return e==="y"?"height":"width"}function Ii(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Uv(e){return Hv(Ii(e))}function o5(e,t,n){n===void 0&&(n=!1);const i=Pa(e),s=Uv(e),a=Vv(s);let l=s==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=id(l)),[l,id(l)]}function a5(e){const t=id(e);return[Xg(e),t,Xg(t)]}function Xg(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const R1=["left","right"],M1=["right","left"],l5=["top","bottom"],c5=["bottom","top"];function u5(e,t,n){switch(e){case"top":case"bottom":return n?t?M1:R1:t?R1:M1;case"left":case"right":return t?l5:c5;default:return[]}}function h5(e,t,n,i){const s=Pa(e);let a=u5(Sr(e),n==="start",i);return s&&(a=a.map(l=>l+"-"+s),t&&(a=a.concat(a.map(Xg)))),a}function id(e){const t=Sr(e);return s5[t]+e.slice(t.length)}function d5(e){return{top:0,right:0,bottom:0,left:0,...e}}function X2(e){return typeof e!="number"?d5(e):{top:e,right:e,bottom:e,left:e}}function rd(e){const{x:t,y:n,width:i,height:s}=e;return{width:i,height:s,top:n,left:t,right:t+i,bottom:n+s,x:t,y:n}}function D1(e,t,n){let{reference:i,floating:s}=e;const a=Ii(t),l=Uv(t),u=Vv(l),h=Sr(t),d=a==="y",p=i.x+i.width/2-s.width/2,m=i.y+i.height/2-s.height/2,_=i[u]/2-s[u]/2;let y;switch(h){case"top":y={x:p,y:i.y-s.height};break;case"bottom":y={x:p,y:i.y+i.height};break;case"right":y={x:i.x+i.width,y:m};break;case"left":y={x:i.x-s.width,y:m};break;default:y={x:i.x,y:i.y}}switch(Pa(t)){case"start":y[l]-=_*(n&&d?-1:1);break;case"end":y[l]+=_*(n&&d?-1:1);break}return y}async function f5(e,t){var n;t===void 0&&(t={});const{x:i,y:s,platform:a,rects:l,elements:u,strategy:h}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:_=!1,padding:y=0}=br(t,e),b=X2(y),C=u[_?m==="floating"?"reference":"floating":m],k=rd(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(C)))==null||n?C:C.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(u.floating)),boundary:d,rootBoundary:p,strategy:h})),T=m==="floating"?{x:i,y:s,width:l.floating.width,height:l.floating.height}:l.reference,R=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u.floating)),A=await(a.isElement==null?void 0:a.isElement(R))?await(a.getScale==null?void 0:a.getScale(R))||{x:1,y:1}:{x:1,y:1},N=rd(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:T,offsetParent:R,strategy:h}):T);return{top:(k.top-N.top+b.top)/A.y,bottom:(N.bottom-k.bottom+b.bottom)/A.y,left:(k.left-N.left+b.left)/A.x,right:(N.right-k.right+b.right)/A.x}}const p5=50,m5=async(e,t,n)=>{const{placement:i="bottom",strategy:s="absolute",middleware:a=[],platform:l}=n,u=l.detectOverflow?l:{...l,detectOverflow:f5},h=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:p,y:m}=D1(d,i,h),_=i,y=0;const b={};for(let S=0;S<a.length;S++){const C=a[S];if(!C)continue;const{name:k,fn:T}=C,{x:R,y:A,data:N,reset:V}=await T({x:p,y:m,initialPlacement:i,placement:_,strategy:s,middlewareData:b,rects:d,platform:u,elements:{reference:e,floating:t}});p=R??p,m=A??m,b[k]={...b[k],...N},V&&y<p5&&(y++,typeof V=="object"&&(V.placement&&(_=V.placement),V.rects&&(d=V.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):V.rects),{x:p,y:m}=D1(d,_,h)),S=-1)}return{x:p,y:m,placement:_,strategy:s,middlewareData:b}},g5=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:s,rects:a,platform:l,elements:u,middlewareData:h}=t,{element:d,padding:p=0}=br(e,t)||{};if(d==null)return{};const m=X2(p),_={x:n,y:i},y=Uv(s),b=Vv(y),S=await l.getDimensions(d),C=y==="y",k=C?"top":"left",T=C?"bottom":"right",R=C?"clientHeight":"clientWidth",A=a.reference[b]+a.reference[y]-_[y]-a.floating[b],N=_[y]-a.reference[y],V=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d));let H=V?V[R]:0;(!H||!await(l.isElement==null?void 0:l.isElement(V)))&&(H=u.floating[R]||a.floating[b]);const z=A/2-N/2,J=H/2-S[b]/2-1,$=ms(m[k],J),K=ms(m[T],J),I=$,P=H-S[b]-K,B=H/2-S[b]/2+z,W=Yg(I,B,P),M=!h.arrow&&Pa(s)!=null&&B!==W&&a.reference[b]/2-(B<I?$:K)-S[b]/2<0,U=M?B<I?B-I:B-P:0;return{[y]:_[y]+U,data:{[y]:W,centerOffset:B-W-U,...M&&{alignmentOffset:U}},reset:M}}}),_5=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:s,middlewareData:a,rects:l,initialPlacement:u,platform:h,elements:d}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:_,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:S=!0,...C}=br(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const k=Sr(s),T=Ii(u),R=Sr(u)===u,A=await(h.isRTL==null?void 0:h.isRTL(d.floating)),N=_||(R||!S?[id(u)]:a5(u)),V=b!=="none";!_&&V&&N.push(...h5(u,S,b,A));const H=[u,...N],z=await h.detectOverflow(t,C),J=[];let $=((i=a.flip)==null?void 0:i.overflows)||[];if(p&&J.push(z[k]),m){const B=o5(s,l,A);J.push(z[B[0]],z[B[1]])}if($=[...$,{placement:s,overflows:J}],!J.every(B=>B<=0)){var K,I;const B=(((K=a.flip)==null?void 0:K.index)||0)+1,W=H[B];if(W&&(!(m==="alignment"?T!==Ii(W):!1)||$.every(j=>Ii(j.placement)===T?j.overflows[0]>0:!0)))return{data:{index:B,overflows:$},reset:{placement:W}};let M=(I=$.filter(U=>U.overflows[0]<=0).sort((U,j)=>U.overflows[1]-j.overflows[1])[0])==null?void 0:I.placement;if(!M)switch(y){case"bestFit":{var P;const U=(P=$.filter(j=>{if(V){const ee=Ii(j.placement);return ee===T||ee==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(ee=>ee>0).reduce((ee,X)=>ee+X,0)]).sort((j,ee)=>j[1]-ee[1])[0])==null?void 0:P[0];U&&(M=U);break}case"initialPlacement":M=u;break}if(s!==M)return{reset:{placement:M}}}return{}}}};function N1(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function O1(e){return r5.some(t=>e[t]>=0)}const v5=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:s="referenceHidden",...a}=br(e,t);switch(s){case"referenceHidden":{const l=await i.detectOverflow(t,{...a,elementContext:"reference"}),u=N1(l,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:O1(u)}}}case"escaped":{const l=await i.detectOverflow(t,{...a,altBoundary:!0}),u=N1(l,n.floating);return{data:{escapedOffsets:u,escaped:O1(u)}}}default:return{}}}}},Z2=new Set(["left","top"]);async function y5(e,t){const{placement:n,platform:i,elements:s}=e,a=await(i.isRTL==null?void 0:i.isRTL(s.floating)),l=Sr(n),u=Pa(n),h=Ii(n)==="y",d=Z2.has(l)?-1:1,p=a&&h?-1:1,m=br(t,e);let{mainAxis:_,crossAxis:y,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof b=="number"&&(y=u==="end"?b*-1:b),h?{x:y*p,y:_*d}:{x:_*d,y:y*p}}const b5=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:s,y:a,placement:l,middlewareData:u}=t,h=await y5(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(i=u.arrow)!=null&&i.alignmentOffset?{}:{x:s+h.x,y:a+h.y,data:{...h,placement:l}}}}},S5=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:s,platform:a}=t,{mainAxis:l=!0,crossAxis:u=!1,limiter:h={fn:k=>{let{x:T,y:R}=k;return{x:T,y:R}}},...d}=br(e,t),p={x:n,y:i},m=await a.detectOverflow(t,d),_=Ii(Sr(s)),y=Hv(_);let b=p[y],S=p[_];if(l){const k=y==="y"?"top":"left",T=y==="y"?"bottom":"right",R=b+m[k],A=b-m[T];b=Yg(R,b,A)}if(u){const k=_==="y"?"top":"left",T=_==="y"?"bottom":"right",R=S+m[k],A=S-m[T];S=Yg(R,S,A)}const C=h.fn({...t,[y]:b,[_]:S});return{...C,data:{x:C.x-n,y:C.y-i,enabled:{[y]:l,[_]:u}}}}}},w5=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:i,placement:s,rects:a,middlewareData:l}=t,{offset:u=0,mainAxis:h=!0,crossAxis:d=!0}=br(e,t),p={x:n,y:i},m=Ii(s),_=Hv(m);let y=p[_],b=p[m];const S=br(u,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(h){const R=_==="y"?"height":"width",A=a.reference[_]-a.floating[R]+C.mainAxis,N=a.reference[_]+a.reference[R]-C.mainAxis;y<A?y=A:y>N&&(y=N)}if(d){var k,T;const R=_==="y"?"width":"height",A=Z2.has(Sr(s)),N=a.reference[m]-a.floating[R]+(A&&((k=l.offset)==null?void 0:k[m])||0)+(A?0:C.crossAxis),V=a.reference[m]+a.reference[R]+(A?0:((T=l.offset)==null?void 0:T[m])||0)-(A?C.crossAxis:0);b<N?b=N:b>V&&(b=V)}return{[_]:y,[m]:b}}}},x5=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,i;const{placement:s,rects:a,platform:l,elements:u}=t,{apply:h=()=>{},...d}=br(e,t),p=await l.detectOverflow(t,d),m=Sr(s),_=Pa(s),y=Ii(s)==="y",{width:b,height:S}=a.floating;let C,k;m==="top"||m==="bottom"?(C=m,k=_===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(k=m,C=_==="end"?"top":"bottom");const T=S-p.top-p.bottom,R=b-p.left-p.right,A=ms(S-p[C],T),N=ms(b-p[k],R),V=!t.middlewareData.shift;let H=A,z=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(z=R),(i=t.middlewareData.shift)!=null&&i.enabled.y&&(H=T),V&&!_){const $=$n(p.left,0),K=$n(p.right,0),I=$n(p.top,0),P=$n(p.bottom,0);y?z=b-2*($!==0||K!==0?$+K:$n(p.left,p.right)):H=S-2*(I!==0||P!==0?I+P:$n(p.top,p.bottom))}await h({...t,availableWidth:z,availableHeight:H});const J=await l.getDimensions(u.floating);return b!==J.width||S!==J.height?{reset:{rects:!0}}:{}}}};function Ud(){return typeof window<"u"}function Ba(e){return Q2(e)?(e.nodeName||"").toLowerCase():"#document"}function Wn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $i(e){var t;return(t=(Q2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Q2(e){return Ud()?e instanceof Node||e instanceof Wn(e).Node:!1}function Si(e){return Ud()?e instanceof Element||e instanceof Wn(e).Element:!1}function xr(e){return Ud()?e instanceof HTMLElement||e instanceof Wn(e).HTMLElement:!1}function L1(e){return!Ud()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Wn(e).ShadowRoot}function kc(e){const{overflow:t,overflowX:n,overflowY:i,display:s}=wi(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&s!=="inline"&&s!=="contents"}function C5(e){return/^(table|td|th)$/.test(Ba(e))}function Fd(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const E5=/transform|translate|scale|rotate|perspective|filter/,k5=/paint|layout|strict|content/,Fs=e=>!!e&&e!=="none";let $m;function Fv(e){const t=Si(e)?wi(e):e;return Fs(t.transform)||Fs(t.translate)||Fs(t.scale)||Fs(t.rotate)||Fs(t.perspective)||!$v()&&(Fs(t.backdropFilter)||Fs(t.filter))||E5.test(t.willChange||"")||k5.test(t.contain||"")}function T5(e){let t=gs(e);for(;xr(t)&&!Aa(t);){if(Fv(t))return t;if(Fd(t))return null;t=gs(t)}return null}function $v(){return $m==null&&($m=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),$m}function Aa(e){return/^(html|body|#document)$/.test(Ba(e))}function wi(e){return Wn(e).getComputedStyle(e)}function $d(e){return Si(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function gs(e){if(Ba(e)==="html")return e;const t=e.assignedSlot||e.parentNode||L1(e)&&e.host||$i(e);return L1(t)?t.host:t}function J2(e){const t=gs(e);return Aa(t)?e.ownerDocument?e.ownerDocument.body:e.body:xr(t)&&kc(t)?t:J2(t)}function hc(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=J2(e),a=s===((i=e.ownerDocument)==null?void 0:i.body),l=Wn(s);if(a){const u=Zg(l);return t.concat(l,l.visualViewport||[],kc(s)?s:[],u&&n?hc(u):[])}else return t.concat(s,hc(s,[],n))}function Zg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ek(e){const t=wi(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const s=xr(e),a=s?e.offsetWidth:n,l=s?e.offsetHeight:i,u=nd(n)!==a||nd(i)!==l;return u&&(n=a,i=l),{width:n,height:i,$:u}}function Wv(e){return Si(e)?e:e.contextElement}function Sa(e){const t=Wv(e);if(!xr(t))return zi(1);const n=t.getBoundingClientRect(),{width:i,height:s,$:a}=ek(t);let l=(a?nd(n.width):n.width)/i,u=(a?nd(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const A5=zi(0);function tk(e){const t=Wn(e);return!$v()||!t.visualViewport?A5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function R5(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Wn(e)?!1:t}function lo(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=Wv(e);let l=zi(1);t&&(i?Si(i)&&(l=Sa(i)):l=Sa(e));const u=R5(a,n,i)?tk(a):zi(0);let h=(s.left+u.x)/l.x,d=(s.top+u.y)/l.y,p=s.width/l.x,m=s.height/l.y;if(a){const _=Wn(a),y=i&&Si(i)?Wn(i):i;let b=_,S=Zg(b);for(;S&&i&&y!==b;){const C=Sa(S),k=S.getBoundingClientRect(),T=wi(S),R=k.left+(S.clientLeft+parseFloat(T.paddingLeft))*C.x,A=k.top+(S.clientTop+parseFloat(T.paddingTop))*C.y;h*=C.x,d*=C.y,p*=C.x,m*=C.y,h+=R,d+=A,b=Wn(S),S=Zg(b)}}return rd({width:p,height:m,x:h,y:d})}function Wd(e,t){const n=$d(e).scrollLeft;return t?t.left+n:lo($i(e)).left+n}function nk(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-Wd(e,n),s=n.top+t.scrollTop;return{x:i,y:s}}function M5(e){let{elements:t,rect:n,offsetParent:i,strategy:s}=e;const a=s==="fixed",l=$i(i),u=t?Fd(t.floating):!1;if(i===l||u&&a)return n;let h={scrollLeft:0,scrollTop:0},d=zi(1);const p=zi(0),m=xr(i);if((m||!m&&!a)&&((Ba(i)!=="body"||kc(l))&&(h=$d(i)),m)){const y=lo(i);d=Sa(i),p.x=y.x+i.clientLeft,p.y=y.y+i.clientTop}const _=l&&!m&&!a?nk(l,h):zi(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-h.scrollLeft*d.x+p.x+_.x,y:n.y*d.y-h.scrollTop*d.y+p.y+_.y}}function D5(e){return Array.from(e.getClientRects())}function N5(e){const t=$i(e),n=$d(e),i=e.ownerDocument.body,s=$n(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),a=$n(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let l=-n.scrollLeft+Wd(e);const u=-n.scrollTop;return wi(i).direction==="rtl"&&(l+=$n(t.clientWidth,i.clientWidth)-s),{width:s,height:a,x:l,y:u}}const P1=25;function O5(e,t){const n=Wn(e),i=$i(e),s=n.visualViewport;let a=i.clientWidth,l=i.clientHeight,u=0,h=0;if(s){a=s.width,l=s.height;const p=$v();(!p||p&&t==="fixed")&&(u=s.offsetLeft,h=s.offsetTop)}const d=Wd(i);if(d<=0){const p=i.ownerDocument,m=p.body,_=getComputedStyle(m),y=p.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,b=Math.abs(i.clientWidth-m.clientWidth-y);b<=P1&&(a-=b)}else d<=P1&&(a+=d);return{width:a,height:l,x:u,y:h}}function L5(e,t){const n=lo(e,!0,t==="fixed"),i=n.top+e.clientTop,s=n.left+e.clientLeft,a=xr(e)?Sa(e):zi(1),l=e.clientWidth*a.x,u=e.clientHeight*a.y,h=s*a.x,d=i*a.y;return{width:l,height:u,x:h,y:d}}function B1(e,t,n){let i;if(t==="viewport")i=O5(e,n);else if(t==="document")i=N5($i(e));else if(Si(t))i=L5(t,n);else{const s=tk(e);i={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return rd(i)}function ik(e,t){const n=gs(e);return n===t||!Si(n)||Aa(n)?!1:wi(n).position==="fixed"||ik(n,t)}function P5(e,t){const n=t.get(e);if(n)return n;let i=hc(e,[],!1).filter(u=>Si(u)&&Ba(u)!=="body"),s=null;const a=wi(e).position==="fixed";let l=a?gs(e):e;for(;Si(l)&&!Aa(l);){const u=wi(l),h=Fv(l);!h&&u.position==="fixed"&&(s=null),(a?!h&&!s:!h&&u.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||kc(l)&&!h&&ik(e,l))?i=i.filter(p=>p!==l):s=u,l=gs(l)}return t.set(e,i),i}function B5(e){let{element:t,boundary:n,rootBoundary:i,strategy:s}=e;const l=[...n==="clippingAncestors"?Fd(t)?[]:P5(t,this._c):[].concat(n),i],u=B1(t,l[0],s);let h=u.top,d=u.right,p=u.bottom,m=u.left;for(let _=1;_<l.length;_++){const y=B1(t,l[_],s);h=$n(y.top,h),d=ms(y.right,d),p=ms(y.bottom,p),m=$n(y.left,m)}return{width:d-m,height:p-h,x:m,y:h}}function I5(e){const{width:t,height:n}=ek(e);return{width:t,height:n}}function j5(e,t,n){const i=xr(t),s=$i(t),a=n==="fixed",l=lo(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const h=zi(0);function d(){h.x=Wd(s)}if(i||!i&&!a)if((Ba(t)!=="body"||kc(s))&&(u=$d(t)),i){const y=lo(t,!0,a,t);h.x=y.x+t.clientLeft,h.y=y.y+t.clientTop}else s&&d();a&&!i&&s&&d();const p=s&&!i&&!a?nk(s,u):zi(0),m=l.left+u.scrollLeft-h.x-p.x,_=l.top+u.scrollTop-h.y-p.y;return{x:m,y:_,width:l.width,height:l.height}}function Wm(e){return wi(e).position==="static"}function I1(e,t){if(!xr(e)||wi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $i(e)===n&&(n=n.ownerDocument.body),n}function rk(e,t){const n=Wn(e);if(Fd(e))return n;if(!xr(e)){let s=gs(e);for(;s&&!Aa(s);){if(Si(s)&&!Wm(s))return s;s=gs(s)}return n}let i=I1(e,t);for(;i&&C5(i)&&Wm(i);)i=I1(i,t);return i&&Aa(i)&&Wm(i)&&!Fv(i)?n:i||T5(e)||n}const z5=async function(e){const t=this.getOffsetParent||rk,n=this.getDimensions,i=await n(e.floating);return{reference:j5(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function H5(e){return wi(e).direction==="rtl"}const V5={convertOffsetParentRelativeRectToViewportRelativeRect:M5,getDocumentElement:$i,getClippingRect:B5,getOffsetParent:rk,getElementRects:z5,getClientRects:D5,getDimensions:I5,getScale:Sa,isElement:Si,isRTL:H5};function sk(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function U5(e,t){let n=null,i;const s=$i(e);function a(){var u;clearTimeout(i),(u=n)==null||u.disconnect(),n=null}function l(u,h){u===void 0&&(u=!1),h===void 0&&(h=1),a();const d=e.getBoundingClientRect(),{left:p,top:m,width:_,height:y}=d;if(u||t(),!_||!y)return;const b=lh(m),S=lh(s.clientWidth-(p+_)),C=lh(s.clientHeight-(m+y)),k=lh(p),R={rootMargin:-b+"px "+-S+"px "+-C+"px "+-k+"px",threshold:$n(0,ms(1,h))||1};let A=!0;function N(V){const H=V[0].intersectionRatio;if(H!==h){if(!A)return l();H?l(!1,H):i=setTimeout(()=>{l(!1,1e-7)},1e3)}H===1&&!sk(d,e.getBoundingClientRect())&&l(),A=!1}try{n=new IntersectionObserver(N,{...R,root:s.ownerDocument})}catch{n=new IntersectionObserver(N,R)}n.observe(e)}return l(!0),a}function F5(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:h=!1}=i,d=Wv(e),p=s||a?[...d?hc(d):[],...t?hc(t):[]]:[];p.forEach(k=>{s&&k.addEventListener("scroll",n,{passive:!0}),a&&k.addEventListener("resize",n)});const m=d&&u?U5(d,n):null;let _=-1,y=null;l&&(y=new ResizeObserver(k=>{let[T]=k;T&&T.target===d&&y&&t&&(y.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var R;(R=y)==null||R.observe(t)})),n()}),d&&!h&&y.observe(d),t&&y.observe(t));let b,S=h?lo(e):null;h&&C();function C(){const k=lo(e);S&&!sk(S,k)&&n(),S=k,b=requestAnimationFrame(C)}return n(),()=>{var k;p.forEach(T=>{s&&T.removeEventListener("scroll",n),a&&T.removeEventListener("resize",n)}),m?.(),(k=y)==null||k.disconnect(),y=null,h&&cancelAnimationFrame(b)}}const $5=b5,W5=S5,G5=_5,q5=x5,K5=v5,j1=g5,Y5=w5,X5=(e,t,n)=>{const i=new Map,s={platform:V5,...n},a={...s.platform,_c:i};return m5(e,t,{...s,platform:a})};var Z5=typeof document<"u",Q5=function(){},Oh=Z5?x.useLayoutEffect:Q5;function sd(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 n,i,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!sd(e[i],t[i]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,s[i]))return!1;for(i=n;i--!==0;){const a=s[i];if(!(a==="_owner"&&e.$$typeof)&&!sd(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function ok(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function z1(e,t){const n=ok(e);return Math.round(t*n)/n}function Gm(e){const t=x.useRef(e);return Oh(()=>{t.current=e}),t}function J5(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:s,elements:{reference:a,floating:l}={},transform:u=!0,whileElementsMounted:h,open:d}=e,[p,m]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[_,y]=x.useState(i);sd(_,i)||y(i);const[b,S]=x.useState(null),[C,k]=x.useState(null),T=x.useCallback(j=>{j!==V.current&&(V.current=j,S(j))},[]),R=x.useCallback(j=>{j!==H.current&&(H.current=j,k(j))},[]),A=a||b,N=l||C,V=x.useRef(null),H=x.useRef(null),z=x.useRef(p),J=h!=null,$=Gm(h),K=Gm(s),I=Gm(d),P=x.useCallback(()=>{if(!V.current||!H.current)return;const j={placement:t,strategy:n,middleware:_};K.current&&(j.platform=K.current),X5(V.current,H.current,j).then(ee=>{const X={...ee,isPositioned:I.current!==!1};B.current&&!sd(z.current,X)&&(z.current=X,Ec.flushSync(()=>{m(X)}))})},[_,t,n,K,I]);Oh(()=>{d===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,m(j=>({...j,isPositioned:!1})))},[d]);const B=x.useRef(!1);Oh(()=>(B.current=!0,()=>{B.current=!1}),[]),Oh(()=>{if(A&&(V.current=A),N&&(H.current=N),A&&N){if($.current)return $.current(A,N,P);P()}},[A,N,P,$,J]);const W=x.useMemo(()=>({reference:V,floating:H,setReference:T,setFloating:R}),[T,R]),M=x.useMemo(()=>({reference:A,floating:N}),[A,N]),U=x.useMemo(()=>{const j={position:n,left:0,top:0};if(!M.floating)return j;const ee=z1(M.floating,p.x),X=z1(M.floating,p.y);return u?{...j,transform:"translate("+ee+"px, "+X+"px)",...ok(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:X}},[n,u,M.floating,p.x,p.y]);return x.useMemo(()=>({...p,update:P,refs:W,elements:M,floatingStyles:U}),[p,P,W,M,U])}const eP=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:s}=typeof e=="function"?e(n):e;return i&&t(i)?i.current!=null?j1({element:i.current,padding:s}).fn(n):{}:i?j1({element:i,padding:s}).fn(n):{}}}},tP=(e,t)=>{const n=$5(e);return{name:n.name,fn:n.fn,options:[e,t]}},nP=(e,t)=>{const n=W5(e);return{name:n.name,fn:n.fn,options:[e,t]}},iP=(e,t)=>({fn:Y5(e).fn,options:[e,t]}),rP=(e,t)=>{const n=G5(e);return{name:n.name,fn:n.fn,options:[e,t]}},sP=(e,t)=>{const n=q5(e);return{name:n.name,fn:n.fn,options:[e,t]}},oP=(e,t)=>{const n=K5(e);return{name:n.name,fn:n.fn,options:[e,t]}},aP=(e,t)=>{const n=eP(e);return{name:n.name,fn:n.fn,options:[e,t]}};var lP="Arrow",ak=x.forwardRef((e,t)=>{const{children:n,width:i=10,height:s=5,...a}=e;return w.jsx(je.svg,{...a,ref:t,width:i,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});ak.displayName=lP;var cP=ak,Gv="Popper",[lk,Gd]=vs(Gv),[uP,ck]=lk(Gv),uk=e=>{const{__scopePopper:t,children:n}=e,[i,s]=x.useState(null);return w.jsx(uP,{scope:t,anchor:i,onAnchorChange:s,children:n})};uk.displayName=Gv;var hk="PopperAnchor",dk=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:i,...s}=e,a=ck(hk,n),l=x.useRef(null),u=Ze(t,l),h=x.useRef(null);return x.useEffect(()=>{const d=h.current;h.current=i?.current||l.current,d!==h.current&&a.onAnchorChange(h.current)}),i?null:w.jsx(je.div,{...s,ref:u})});dk.displayName=hk;var qv="PopperContent",[hP,dP]=lk(qv),fk=x.forwardRef((e,t)=>{const{__scopePopper:n,side:i="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:h=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:_=!1,updatePositionStrategy:y="optimized",onPlaced:b,...S}=e,C=ck(qv,n),[k,T]=x.useState(null),R=Ze(t,q=>T(q)),[A,N]=x.useState(null),V=i5(A),H=V?.width??0,z=V?.height??0,J=i+(a!=="center"?"-"+a:""),$=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},K=Array.isArray(d)?d:[d],I=K.length>0,P={padding:$,boundary:K.filter(pP),altBoundary:I},{refs:B,floatingStyles:W,placement:M,isPositioned:U,middlewareData:j}=J5({strategy:"fixed",placement:J,whileElementsMounted:(...q)=>F5(...q,{animationFrame:y==="always"}),elements:{reference:C.anchor},middleware:[tP({mainAxis:s+z,alignmentAxis:l}),h&&nP({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?iP():void 0,...P}),h&&rP({...P}),sP({...P,apply:({elements:q,rects:ne,availableWidth:re,availableHeight:fe})=>{const{width:pe,height:xe}=ne.reference,Ee=q.floating.style;Ee.setProperty("--radix-popper-available-width",`${re}px`),Ee.setProperty("--radix-popper-available-height",`${fe}px`),Ee.setProperty("--radix-popper-anchor-width",`${pe}px`),Ee.setProperty("--radix-popper-anchor-height",`${xe}px`)}}),A&&aP({element:A,padding:u}),mP({arrowWidth:H,arrowHeight:z}),_&&oP({strategy:"referenceHidden",...P})]}),[ee,X]=gk(M),L=_n(b);ln(()=>{U&&L?.()},[U,L]);const Z=j.arrow?.x,ie=j.arrow?.y,F=j.arrow?.centerOffset!==0,[O,G]=x.useState();return ln(()=>{k&&G(window.getComputedStyle(k).zIndex)},[k]),w.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:U?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:O,"--radix-popper-transform-origin":[j.transformOrigin?.x,j.transformOrigin?.y].join(" "),...j.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:w.jsx(hP,{scope:n,placedSide:ee,onArrowChange:N,arrowX:Z,arrowY:ie,shouldHideArrow:F,children:w.jsx(je.div,{"data-side":ee,"data-align":X,...S,ref:R,style:{...S.style,animation:U?void 0:"none"}})})})});fk.displayName=qv;var pk="PopperArrow",fP={top:"bottom",right:"left",bottom:"top",left:"right"},mk=x.forwardRef(function(t,n){const{__scopePopper:i,...s}=t,a=dP(pk,i),l=fP[a.placedSide];return w.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:w.jsx(cP,{...s,ref:n,style:{...s.style,display:"block"}})})});mk.displayName=pk;function pP(e){return e!==null}var mP=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:i,middlewareData:s}=t,l=s.arrow?.centerOffset!==0,u=l?0:e.arrowWidth,h=l?0:e.arrowHeight,[d,p]=gk(n),m={start:"0%",center:"50%",end:"100%"}[p],_=(s.arrow?.x??0)+u/2,y=(s.arrow?.y??0)+h/2;let b="",S="";return d==="bottom"?(b=l?m:`${_}px`,S=`${-h}px`):d==="top"?(b=l?m:`${_}px`,S=`${i.floating.height+h}px`):d==="right"?(b=`${-h}px`,S=l?m:`${y}px`):d==="left"&&(b=`${i.floating.width+h}px`,S=l?m:`${y}px`),{data:{x:b,y:S}}}});function gk(e){const[t,n="center"]=e.split("-");return[t,n]}var _k=uk,vk=dk,yk=fk,bk=mk,qm="rovingFocusGroup.onEntryFocus",gP={bubbles:!1,cancelable:!0},Tc="RovingFocusGroup",[Qg,Sk,_P]=b2(Tc),[vP,wk]=vs(Tc,[_P]),[yP,bP]=vP(Tc),xk=x.forwardRef((e,t)=>w.jsx(Qg.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(Qg.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(SP,{...e,ref:t})})}));xk.displayName=Tc;var SP=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:i,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:h,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=e,_=x.useRef(null),y=Ze(t,_),b=Id(a),[S,C]=Ta({prop:l,defaultProp:u??null,onChange:h,caller:Tc}),[k,T]=x.useState(!1),R=_n(d),A=Sk(n),N=x.useRef(!1),[V,H]=x.useState(0);return x.useEffect(()=>{const z=_.current;if(z)return z.addEventListener(qm,R),()=>z.removeEventListener(qm,R)},[R]),w.jsx(yP,{scope:n,orientation:i,dir:b,loop:s,currentTabStopId:S,onItemFocus:x.useCallback(z=>C(z),[C]),onItemShiftTab:x.useCallback(()=>T(!0),[]),onFocusableItemAdd:x.useCallback(()=>H(z=>z+1),[]),onFocusableItemRemove:x.useCallback(()=>H(z=>z-1),[]),children:w.jsx(je.div,{tabIndex:k||V===0?-1:0,"data-orientation":i,...m,ref:y,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{N.current=!0}),onFocus:Re(e.onFocus,z=>{const J=!N.current;if(z.target===z.currentTarget&&J&&!k){const $=new CustomEvent(qm,gP);if(z.currentTarget.dispatchEvent($),!$.defaultPrevented){const K=A().filter(M=>M.focusable),I=K.find(M=>M.active),P=K.find(M=>M.id===S),W=[I,P,...K].filter(Boolean).map(M=>M.ref.current);kk(W,p)}}N.current=!1}),onBlur:Re(e.onBlur,()=>T(!1))})})}),Ck="RovingFocusGroupItem",Ek=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:i=!0,active:s=!1,tabStopId:a,children:l,...u}=e,h=vr(),d=a||h,p=bP(Ck,n),m=p.currentTabStopId===d,_=Sk(n),{onFocusableItemAdd:y,onFocusableItemRemove:b,currentTabStopId:S}=p;return x.useEffect(()=>{if(i)return y(),()=>b()},[i,y,b]),w.jsx(Qg.ItemSlot,{scope:n,id:d,focusable:i,active:s,children:w.jsx(je.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...u,ref:t,onMouseDown:Re(e.onMouseDown,C=>{i?p.onItemFocus(d):C.preventDefault()}),onFocus:Re(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:Re(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){p.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const k=CP(C,p.orientation,p.dir);if(k!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let R=_().filter(A=>A.focusable).map(A=>A.ref.current);if(k==="last")R.reverse();else if(k==="prev"||k==="next"){k==="prev"&&R.reverse();const A=R.indexOf(C.currentTarget);R=p.loop?EP(R,A+1):R.slice(A+1)}setTimeout(()=>kk(R))}}),children:typeof l=="function"?l({isCurrentTabStop:m,hasTabStop:S!=null}):l})})});Ek.displayName=Ck;var wP={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function xP(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function CP(e,t,n){const i=xP(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return wP[i]}function kk(e,t=!1){const n=document.activeElement;for(const i of e)if(i===n||(i.focus({preventScroll:t}),document.activeElement!==n))return}function EP(e,t){return e.map((n,i)=>e[(t+i)%e.length])}var kP=xk,TP=Ek,AP="Label",Tk=x.forwardRef((e,t)=>w.jsx(je.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Tk.displayName=AP;var RP=Tk;function Jg(e,[t,n]){return Math.min(n,Math.max(t,e))}function MP(e,t){return x.useReducer((n,i)=>t[n][i]??n,e)}var Kv="ScrollArea",[Ak]=vs(Kv),[DP,di]=Ak(Kv),Rk=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:i="hover",dir:s,scrollHideDelay:a=600,...l}=e,[u,h]=x.useState(null),[d,p]=x.useState(null),[m,_]=x.useState(null),[y,b]=x.useState(null),[S,C]=x.useState(null),[k,T]=x.useState(0),[R,A]=x.useState(0),[N,V]=x.useState(!1),[H,z]=x.useState(!1),J=Ze(t,K=>h(K)),$=Id(s);return w.jsx(DP,{scope:n,type:i,dir:$,scrollHideDelay:a,scrollArea:u,viewport:d,onViewportChange:p,content:m,onContentChange:_,scrollbarX:y,onScrollbarXChange:b,scrollbarXEnabled:N,onScrollbarXEnabledChange:V,scrollbarY:S,onScrollbarYChange:C,scrollbarYEnabled:H,onScrollbarYEnabledChange:z,onCornerWidthChange:T,onCornerHeightChange:A,children:w.jsx(je.div,{dir:$,...l,ref:J,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":R+"px",...e.style}})})});Rk.displayName=Kv;var Mk="ScrollAreaViewport",Dk=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:i,nonce:s,...a}=e,l=di(Mk,n),u=x.useRef(null),h=Ze(t,u,l.onViewportChange);return w.jsxs(w.Fragment,{children:[w.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),w.jsx(je.div,{"data-radix-scroll-area-viewport":"",...a,ref:h,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:w.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})});Dk.displayName=Mk;var Wi="ScrollAreaScrollbar",Nk=x.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=di(Wi,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:l}=s,u=e.orientation==="horizontal";return x.useEffect(()=>(u?a(!0):l(!0),()=>{u?a(!1):l(!1)}),[u,a,l]),s.type==="hover"?w.jsx(NP,{...i,ref:t,forceMount:n}):s.type==="scroll"?w.jsx(OP,{...i,ref:t,forceMount:n}):s.type==="auto"?w.jsx(Ok,{...i,ref:t,forceMount:n}):s.type==="always"?w.jsx(Yv,{...i,ref:t}):null});Nk.displayName=Wi;var NP=x.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=di(Wi,e.__scopeScrollArea),[a,l]=x.useState(!1);return x.useEffect(()=>{const u=s.scrollArea;let h=0;if(u){const d=()=>{window.clearTimeout(h),l(!0)},p=()=>{h=window.setTimeout(()=>l(!1),s.scrollHideDelay)};return u.addEventListener("pointerenter",d),u.addEventListener("pointerleave",p),()=>{window.clearTimeout(h),u.removeEventListener("pointerenter",d),u.removeEventListener("pointerleave",p)}}},[s.scrollArea,s.scrollHideDelay]),w.jsx(Ci,{present:n||a,children:w.jsx(Ok,{"data-state":a?"visible":"hidden",...i,ref:t})})}),OP=x.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=di(Wi,e.__scopeScrollArea),a=e.orientation==="horizontal",l=Kd(()=>h("SCROLL_END"),100),[u,h]=MP("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return x.useEffect(()=>{if(u==="idle"){const d=window.setTimeout(()=>h("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(d)}},[u,s.scrollHideDelay,h]),x.useEffect(()=>{const d=s.viewport,p=a?"scrollLeft":"scrollTop";if(d){let m=d[p];const _=()=>{const y=d[p];m!==y&&(h("SCROLL"),l()),m=y};return d.addEventListener("scroll",_),()=>d.removeEventListener("scroll",_)}},[s.viewport,a,h,l]),w.jsx(Ci,{present:n||u!=="hidden",children:w.jsx(Yv,{"data-state":u==="hidden"?"hidden":"visible",...i,ref:t,onPointerEnter:Re(e.onPointerEnter,()=>h("POINTER_ENTER")),onPointerLeave:Re(e.onPointerLeave,()=>h("POINTER_LEAVE"))})})}),Ok=x.forwardRef((e,t)=>{const n=di(Wi,e.__scopeScrollArea),{forceMount:i,...s}=e,[a,l]=x.useState(!1),u=e.orientation==="horizontal",h=Kd(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,p=n.viewport.offsetHeight<n.viewport.scrollHeight;l(u?d:p)}},10);return Ra(n.viewport,h),Ra(n.content,h),w.jsx(Ci,{present:i||a,children:w.jsx(Yv,{"data-state":a?"visible":"hidden",...s,ref:t})})}),Yv=x.forwardRef((e,t)=>{const{orientation:n="vertical",...i}=e,s=di(Wi,e.__scopeScrollArea),a=x.useRef(null),l=x.useRef(0),[u,h]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=jk(u.viewport,u.content),p={...i,sizes:u,onSizesChange:h,hasThumb:d>0&&d<1,onThumbChange:_=>a.current=_,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:_=>l.current=_};function m(_,y){return zP(_,l.current,u,y)}return n==="horizontal"?w.jsx(LP,{...p,ref:t,onThumbPositionChange:()=>{if(s.viewport&&a.current){const _=s.viewport.scrollLeft,y=H1(_,u,s.dir);a.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:_=>{s.viewport&&(s.viewport.scrollLeft=_)},onDragScroll:_=>{s.viewport&&(s.viewport.scrollLeft=m(_,s.dir))}}):n==="vertical"?w.jsx(PP,{...p,ref:t,onThumbPositionChange:()=>{if(s.viewport&&a.current){const _=s.viewport.scrollTop,y=H1(_,u);a.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:_=>{s.viewport&&(s.viewport.scrollTop=_)},onDragScroll:_=>{s.viewport&&(s.viewport.scrollTop=m(_))}}):null}),LP=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...s}=e,a=di(Wi,e.__scopeScrollArea),[l,u]=x.useState(),h=x.useRef(null),d=Ze(t,h,a.onScrollbarXChange);return x.useEffect(()=>{h.current&&u(getComputedStyle(h.current))},[h]),w.jsx(Pk,{"data-orientation":"horizontal",...s,ref:d,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":qd(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,m)=>{if(a.viewport){const _=a.viewport.scrollLeft+p.deltaX;e.onWheelScroll(_),Hk(_,m)&&p.preventDefault()}},onResize:()=>{h.current&&a.viewport&&l&&i({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:h.current.clientWidth,paddingStart:ad(l.paddingLeft),paddingEnd:ad(l.paddingRight)}})}})}),PP=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:i,...s}=e,a=di(Wi,e.__scopeScrollArea),[l,u]=x.useState(),h=x.useRef(null),d=Ze(t,h,a.onScrollbarYChange);return x.useEffect(()=>{h.current&&u(getComputedStyle(h.current))},[h]),w.jsx(Pk,{"data-orientation":"vertical",...s,ref:d,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":qd(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,m)=>{if(a.viewport){const _=a.viewport.scrollTop+p.deltaY;e.onWheelScroll(_),Hk(_,m)&&p.preventDefault()}},onResize:()=>{h.current&&a.viewport&&l&&i({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:h.current.clientHeight,paddingStart:ad(l.paddingTop),paddingEnd:ad(l.paddingBottom)}})}})}),[BP,Lk]=Ak(Wi),Pk=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:i,hasThumb:s,onThumbChange:a,onThumbPointerUp:l,onThumbPointerDown:u,onThumbPositionChange:h,onDragScroll:d,onWheelScroll:p,onResize:m,..._}=e,y=di(Wi,n),[b,S]=x.useState(null),C=Ze(t,J=>S(J)),k=x.useRef(null),T=x.useRef(""),R=y.viewport,A=i.content-i.viewport,N=_n(p),V=_n(h),H=Kd(m,10);function z(J){if(k.current){const $=J.clientX-k.current.left,K=J.clientY-k.current.top;d({x:$,y:K})}}return x.useEffect(()=>{const J=$=>{const K=$.target;b?.contains(K)&&N($,A)};return document.addEventListener("wheel",J,{passive:!1}),()=>document.removeEventListener("wheel",J,{passive:!1})},[R,b,A,N]),x.useEffect(V,[i,V]),Ra(b,H),Ra(y.content,H),w.jsx(BP,{scope:n,scrollbar:b,hasThumb:s,onThumbChange:_n(a),onThumbPointerUp:_n(l),onThumbPositionChange:V,onThumbPointerDown:_n(u),children:w.jsx(je.div,{..._,ref:C,style:{position:"absolute",..._.style},onPointerDown:Re(e.onPointerDown,J=>{J.button===0&&(J.target.setPointerCapture(J.pointerId),k.current=b.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),z(J))}),onPointerMove:Re(e.onPointerMove,z),onPointerUp:Re(e.onPointerUp,J=>{const $=J.target;$.hasPointerCapture(J.pointerId)&&$.releasePointerCapture(J.pointerId),document.body.style.webkitUserSelect=T.current,y.viewport&&(y.viewport.style.scrollBehavior=""),k.current=null})})})}),od="ScrollAreaThumb",Bk=x.forwardRef((e,t)=>{const{forceMount:n,...i}=e,s=Lk(od,e.__scopeScrollArea);return w.jsx(Ci,{present:n||s.hasThumb,children:w.jsx(IP,{ref:t,...i})})}),IP=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:i,...s}=e,a=di(od,n),l=Lk(od,n),{onThumbPositionChange:u}=l,h=Ze(t,m=>l.onThumbChange(m)),d=x.useRef(void 0),p=Kd(()=>{d.current&&(d.current(),d.current=void 0)},100);return x.useEffect(()=>{const m=a.viewport;if(m){const _=()=>{if(p(),!d.current){const y=HP(m,u);d.current=y,u()}};return u(),m.addEventListener("scroll",_),()=>m.removeEventListener("scroll",_)}},[a.viewport,p,u]),w.jsx(je.div,{"data-state":l.hasThumb?"visible":"hidden",...s,ref:h,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:Re(e.onPointerDownCapture,m=>{const y=m.target.getBoundingClientRect(),b=m.clientX-y.left,S=m.clientY-y.top;l.onThumbPointerDown({x:b,y:S})}),onPointerUp:Re(e.onPointerUp,l.onThumbPointerUp)})});Bk.displayName=od;var Xv="ScrollAreaCorner",Ik=x.forwardRef((e,t)=>{const n=di(Xv,e.__scopeScrollArea),i=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&i?w.jsx(jP,{...e,ref:t}):null});Ik.displayName=Xv;var jP=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,...i}=e,s=di(Xv,n),[a,l]=x.useState(0),[u,h]=x.useState(0),d=!!(a&&u);return Ra(s.scrollbarX,()=>{const p=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(p),h(p)}),Ra(s.scrollbarY,()=>{const p=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(p),l(p)}),d?w.jsx(je.div,{...i,ref:t,style:{width:a,height:u,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function ad(e){return e?parseInt(e,10):0}function jk(e,t){const n=e/t;return isNaN(n)?0:n}function qd(e){const t=jk(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=(e.scrollbar.size-n)*t;return Math.max(i,18)}function zP(e,t,n,i="ltr"){const s=qd(n),a=s/2,l=t||a,u=s-l,h=n.scrollbar.paddingStart+l,d=n.scrollbar.size-n.scrollbar.paddingEnd-u,p=n.content-n.viewport,m=i==="ltr"?[0,p]:[p*-1,0];return zk([h,d],m)(e)}function H1(e,t,n="ltr"){const i=qd(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-s,l=t.content-t.viewport,u=a-i,h=n==="ltr"?[0,l]:[l*-1,0],d=Jg(e,h);return zk([0,l],[0,u])(d)}function zk(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const i=(t[1]-t[0])/(e[1]-e[0]);return t[0]+i*(n-e[0])}}function Hk(e,t){return e>0&&e<t}var HP=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},i=0;return(function s(){const a={left:e.scrollLeft,top:e.scrollTop},l=n.left!==a.left,u=n.top!==a.top;(l||u)&&t(),n=a,i=window.requestAnimationFrame(s)})(),()=>window.cancelAnimationFrame(i)};function Kd(e,t){const n=_n(e),i=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(i.current),[]),x.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(n,t)},[n,t])}function Ra(e,t){const n=_n(t);ln(()=>{let i=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(i),i=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(i),s.unobserve(e)}}},[e,n])}var VP=Rk,UP=Dk,FP=Ik,$P=[" ","Enter","ArrowUp","ArrowDown"],WP=[" ","Enter"],co="Select",[Yd,Xd,GP]=b2(co),[Ia]=vs(co,[GP,Gd]),Zd=Gd(),[qP,ys]=Ia(co),[KP,YP]=Ia(co),Vk=e=>{const{__scopeSelect:t,children:n,open:i,defaultOpen:s,onOpenChange:a,value:l,defaultValue:u,onValueChange:h,dir:d,name:p,autoComplete:m,disabled:_,required:y,form:b}=e,S=Zd(t),[C,k]=x.useState(null),[T,R]=x.useState(null),[A,N]=x.useState(!1),V=Id(d),[H,z]=Ta({prop:i,defaultProp:s??!1,onChange:a,caller:co}),[J,$]=Ta({prop:l,defaultProp:u,onChange:h,caller:co}),K=x.useRef(null),I=C?b||!!C.closest("form"):!0,[P,B]=x.useState(new Set),W=Array.from(P).map(M=>M.props.value).join(";");return w.jsx(_k,{...S,children:w.jsxs(qP,{required:y,scope:t,trigger:C,onTriggerChange:k,valueNode:T,onValueNodeChange:R,valueNodeHasChildren:A,onValueNodeHasChildrenChange:N,contentId:vr(),value:J,onValueChange:$,open:H,onOpenChange:z,dir:V,triggerPointerDownPosRef:K,disabled:_,children:[w.jsx(Yd.Provider,{scope:t,children:w.jsx(KP,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(M=>{B(U=>new Set(U).add(M))},[]),onNativeOptionRemove:x.useCallback(M=>{B(U=>{const j=new Set(U);return j.delete(M),j})},[]),children:n})}),I?w.jsxs(cT,{"aria-hidden":!0,required:y,tabIndex:-1,name:p,autoComplete:m,value:J,onChange:M=>$(M.target.value),disabled:_,form:b,children:[J===void 0?w.jsx("option",{value:""}):null,Array.from(P)]},W):null]})})};Vk.displayName=co;var Uk="SelectTrigger",Fk=x.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:i=!1,...s}=e,a=Zd(n),l=ys(Uk,n),u=l.disabled||i,h=Ze(t,l.onTriggerChange),d=Xd(n),p=x.useRef("touch"),[m,_,y]=hT(S=>{const C=d().filter(R=>!R.disabled),k=C.find(R=>R.value===l.value),T=dT(C,S,k);T!==void 0&&l.onValueChange(T.value)}),b=S=>{u||(l.onOpenChange(!0),y()),S&&(l.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return w.jsx(vk,{asChild:!0,...a,children:w.jsx(je.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":uT(l.value)?"":void 0,...s,ref:h,onClick:Re(s.onClick,S=>{S.currentTarget.focus(),p.current!=="mouse"&&b(S)}),onPointerDown:Re(s.onPointerDown,S=>{p.current=S.pointerType;const C=S.target;C.hasPointerCapture(S.pointerId)&&C.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(b(S),S.preventDefault())}),onKeyDown:Re(s.onKeyDown,S=>{const C=m.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&_(S.key),!(C&&S.key===" ")&&$P.includes(S.key)&&(b(),S.preventDefault())})})})});Fk.displayName=Uk;var $k="SelectValue",Wk=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:i,style:s,children:a,placeholder:l="",...u}=e,h=ys($k,n),{onValueNodeHasChildrenChange:d}=h,p=a!==void 0,m=Ze(t,h.onValueNodeChange);return ln(()=>{d(p)},[d,p]),w.jsx(je.span,{...u,ref:m,style:{pointerEvents:"none"},children:uT(h.value)?w.jsx(w.Fragment,{children:l}):a})});Wk.displayName=$k;var XP="SelectIcon",Gk=x.forwardRef((e,t)=>{const{__scopeSelect:n,children:i,...s}=e;return w.jsx(je.span,{"aria-hidden":!0,...s,ref:t,children:i||"▼"})});Gk.displayName=XP;var ZP="SelectPortal",qk=e=>w.jsx(zd,{asChild:!0,...e});qk.displayName=ZP;var uo="SelectContent",Kk=x.forwardRef((e,t)=>{const n=ys(uo,e.__scopeSelect),[i,s]=x.useState();if(ln(()=>{s(new DocumentFragment)},[]),!n.open){const a=i;return a?Ec.createPortal(w.jsx(Yk,{scope:e.__scopeSelect,children:w.jsx(Yd.Slot,{scope:e.__scopeSelect,children:w.jsx("div",{children:e.children})})}),a):null}return w.jsx(Xk,{...e,ref:t})});Kk.displayName=uo;var _i=10,[Yk,bs]=Ia(uo),QP="SelectContentImpl",JP=ka("SelectContent.RemoveScroll"),Xk=x.forwardRef((e,t)=>{const{__scopeSelect:n,position:i="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:l,side:u,sideOffset:h,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:_,collisionPadding:y,sticky:b,hideWhenDetached:S,avoidCollisions:C,...k}=e,T=ys(uo,n),[R,A]=x.useState(null),[N,V]=x.useState(null),H=Ze(t,q=>A(q)),[z,J]=x.useState(null),[$,K]=x.useState(null),I=Xd(n),[P,B]=x.useState(!1),W=x.useRef(!1);x.useEffect(()=>{if(R)return O2(R)},[R]),C2();const M=x.useCallback(q=>{const[ne,...re]=I().map(xe=>xe.ref.current),[fe]=re.slice(-1),pe=document.activeElement;for(const xe of q)if(xe===pe||(xe?.scrollIntoView({block:"nearest"}),xe===ne&&N&&(N.scrollTop=0),xe===fe&&N&&(N.scrollTop=N.scrollHeight),xe?.focus(),document.activeElement!==pe))return},[I,N]),U=x.useCallback(()=>M([z,R]),[M,z,R]);x.useEffect(()=>{P&&U()},[P,U]);const{onOpenChange:j,triggerPointerDownPosRef:ee}=T;x.useEffect(()=>{if(R){let q={x:0,y:0};const ne=fe=>{q={x:Math.abs(Math.round(fe.pageX)-(ee.current?.x??0)),y:Math.abs(Math.round(fe.pageY)-(ee.current?.y??0))}},re=fe=>{q.x<=10&&q.y<=10?fe.preventDefault():R.contains(fe.target)||j(!1),document.removeEventListener("pointermove",ne),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",ne),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",re,{capture:!0})}}},[R,j,ee]),x.useEffect(()=>{const q=()=>j(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[j]);const[X,L]=hT(q=>{const ne=I().filter(pe=>!pe.disabled),re=ne.find(pe=>pe.ref.current===document.activeElement),fe=dT(ne,q,re);fe&&setTimeout(()=>fe.ref.current.focus())}),Z=x.useCallback((q,ne,re)=>{const fe=!W.current&&!re;(T.value!==void 0&&T.value===ne||fe)&&(J(q),fe&&(W.current=!0))},[T.value]),ie=x.useCallback(()=>R?.focus(),[R]),F=x.useCallback((q,ne,re)=>{const fe=!W.current&&!re;(T.value!==void 0&&T.value===ne||fe)&&K(q)},[T.value]),O=i==="popper"?e_:Zk,G=O===e_?{side:u,sideOffset:h,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:_,collisionPadding:y,sticky:b,hideWhenDetached:S,avoidCollisions:C}:{};return w.jsx(Yk,{scope:n,content:R,viewport:N,onViewportChange:V,itemRefCallback:Z,selectedItem:z,onItemLeave:ie,itemTextRefCallback:F,focusSelectedItem:U,selectedItemText:$,position:i,isPositioned:P,searchRef:X,children:w.jsx(Bv,{as:JP,allowPinchZoom:!0,children:w.jsx(Pv,{asChild:!0,trapped:T.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:Re(s,q=>{T.trigger?.focus({preventScroll:!0}),q.preventDefault()}),children:w.jsx(jd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:w.jsx(O,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:q=>q.preventDefault(),...k,...G,onPlaced:()=>B(!0),ref:H,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:Re(k.onKeyDown,q=>{const ne=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!ne&&q.key.length===1&&L(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let fe=I().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(q.key)&&(fe=fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const pe=q.target,xe=fe.indexOf(pe);fe=fe.slice(xe+1)}setTimeout(()=>M(fe)),q.preventDefault()}})})})})})})});Xk.displayName=QP;var eB="SelectItemAlignedPosition",Zk=x.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:i,...s}=e,a=ys(uo,n),l=bs(uo,n),[u,h]=x.useState(null),[d,p]=x.useState(null),m=Ze(t,H=>p(H)),_=Xd(n),y=x.useRef(!1),b=x.useRef(!0),{viewport:S,selectedItem:C,selectedItemText:k,focusSelectedItem:T}=l,R=x.useCallback(()=>{if(a.trigger&&a.valueNode&&u&&d&&S&&C&&k){const H=a.trigger.getBoundingClientRect(),z=d.getBoundingClientRect(),J=a.valueNode.getBoundingClientRect(),$=k.getBoundingClientRect();if(a.dir!=="rtl"){const pe=$.left-z.left,xe=J.left-pe,Ee=H.left-xe,Pe=H.width+Ee,Ce=Math.max(Pe,z.width),De=window.innerWidth-_i,vt=Jg(xe,[_i,Math.max(_i,De-Ce)]);u.style.minWidth=Pe+"px",u.style.left=vt+"px"}else{const pe=z.right-$.right,xe=window.innerWidth-J.right-pe,Ee=window.innerWidth-H.right-xe,Pe=H.width+Ee,Ce=Math.max(Pe,z.width),De=window.innerWidth-_i,vt=Jg(xe,[_i,Math.max(_i,De-Ce)]);u.style.minWidth=Pe+"px",u.style.right=vt+"px"}const K=_(),I=window.innerHeight-_i*2,P=S.scrollHeight,B=window.getComputedStyle(d),W=parseInt(B.borderTopWidth,10),M=parseInt(B.paddingTop,10),U=parseInt(B.borderBottomWidth,10),j=parseInt(B.paddingBottom,10),ee=W+M+P+j+U,X=Math.min(C.offsetHeight*5,ee),L=window.getComputedStyle(S),Z=parseInt(L.paddingTop,10),ie=parseInt(L.paddingBottom,10),F=H.top+H.height/2-_i,O=I-F,G=C.offsetHeight/2,q=C.offsetTop+G,ne=W+M+q,re=ee-ne;if(ne<=F){const pe=K.length>0&&C===K[K.length-1].ref.current;u.style.bottom="0px";const xe=d.clientHeight-S.offsetTop-S.offsetHeight,Ee=Math.max(O,G+(pe?ie:0)+xe+U),Pe=ne+Ee;u.style.height=Pe+"px"}else{const pe=K.length>0&&C===K[0].ref.current;u.style.top="0px";const Ee=Math.max(F,W+S.offsetTop+(pe?Z:0)+G)+re;u.style.height=Ee+"px",S.scrollTop=ne-F+S.offsetTop}u.style.margin=`${_i}px 0`,u.style.minHeight=X+"px",u.style.maxHeight=I+"px",i?.(),requestAnimationFrame(()=>y.current=!0)}},[_,a.trigger,a.valueNode,u,d,S,C,k,a.dir,i]);ln(()=>R(),[R]);const[A,N]=x.useState();ln(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const V=x.useCallback(H=>{H&&b.current===!0&&(R(),T?.(),b.current=!1)},[R,T]);return w.jsx(nB,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:y,onScrollButtonChange:V,children:w.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:w.jsx(je.div,{...s,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Zk.displayName=eB;var tB="SelectPopperPosition",e_=x.forwardRef((e,t)=>{const{__scopeSelect:n,align:i="start",collisionPadding:s=_i,...a}=e,l=Zd(n);return w.jsx(yk,{...l,...a,ref:t,align:i,collisionPadding:s,style:{boxSizing:"border-box",...a.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)"}})});e_.displayName=tB;var[nB,Zv]=Ia(uo,{}),t_="SelectViewport",Qk=x.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:i,...s}=e,a=bs(t_,n),l=Zv(t_,n),u=Ze(t,a.onViewportChange),h=x.useRef(0);return w.jsxs(w.Fragment,{children:[w.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:i}),w.jsx(Yd.Slot,{scope:n,children:w.jsx(je.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Re(s.onScroll,d=>{const p=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:_}=l;if(_?.current&&m){const y=Math.abs(h.current-p.scrollTop);if(y>0){const b=window.innerHeight-_i*2,S=parseFloat(m.style.minHeight),C=parseFloat(m.style.height),k=Math.max(S,C);if(k<b){const T=k+y,R=Math.min(b,T),A=T-R;m.style.height=R+"px",m.style.bottom==="0px"&&(p.scrollTop=A>0?A:0,m.style.justifyContent="flex-end")}}}h.current=p.scrollTop})})})]})});Qk.displayName=t_;var Jk="SelectGroup",[iB,rB]=Ia(Jk),sB=x.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,s=vr();return w.jsx(iB,{scope:n,id:s,children:w.jsx(je.div,{role:"group","aria-labelledby":s,...i,ref:t})})});sB.displayName=Jk;var eT="SelectLabel",oB=x.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,s=rB(eT,n);return w.jsx(je.div,{id:s.id,...i,ref:t})});oB.displayName=eT;var ld="SelectItem",[aB,tT]=Ia(ld),nT=x.forwardRef((e,t)=>{const{__scopeSelect:n,value:i,disabled:s=!1,textValue:a,...l}=e,u=ys(ld,n),h=bs(ld,n),d=u.value===i,[p,m]=x.useState(a??""),[_,y]=x.useState(!1),b=Ze(t,T=>h.itemRefCallback?.(T,i,s)),S=vr(),C=x.useRef("touch"),k=()=>{s||(u.onValueChange(i),u.onOpenChange(!1))};if(i==="")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 w.jsx(aB,{scope:n,value:i,disabled:s,textId:S,isSelected:d,onItemTextChange:x.useCallback(T=>{m(R=>R||(T?.textContent??"").trim())},[]),children:w.jsx(Yd.ItemSlot,{scope:n,value:i,disabled:s,textValue:p,children:w.jsx(je.div,{role:"option","aria-labelledby":S,"data-highlighted":_?"":void 0,"aria-selected":d&&_,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:b,onFocus:Re(l.onFocus,()=>y(!0)),onBlur:Re(l.onBlur,()=>y(!1)),onClick:Re(l.onClick,()=>{C.current!=="mouse"&&k()}),onPointerUp:Re(l.onPointerUp,()=>{C.current==="mouse"&&k()}),onPointerDown:Re(l.onPointerDown,T=>{C.current=T.pointerType}),onPointerMove:Re(l.onPointerMove,T=>{C.current=T.pointerType,s?h.onItemLeave?.():C.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(l.onPointerLeave,T=>{T.currentTarget===document.activeElement&&h.onItemLeave?.()}),onKeyDown:Re(l.onKeyDown,T=>{h.searchRef?.current!==""&&T.key===" "||(WP.includes(T.key)&&k(),T.key===" "&&T.preventDefault())})})})})});nT.displayName=ld;var Yl="SelectItemText",iT=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:i,style:s,...a}=e,l=ys(Yl,n),u=bs(Yl,n),h=tT(Yl,n),d=YP(Yl,n),[p,m]=x.useState(null),_=Ze(t,k=>m(k),h.onItemTextChange,k=>u.itemTextRefCallback?.(k,h.value,h.disabled)),y=p?.textContent,b=x.useMemo(()=>w.jsx("option",{value:h.value,disabled:h.disabled,children:y},h.value),[h.disabled,h.value,y]),{onNativeOptionAdd:S,onNativeOptionRemove:C}=d;return ln(()=>(S(b),()=>C(b)),[S,C,b]),w.jsxs(w.Fragment,{children:[w.jsx(je.span,{id:h.textId,...a,ref:_}),h.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Ec.createPortal(a.children,l.valueNode):null]})});iT.displayName=Yl;var rT="SelectItemIndicator",sT=x.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e;return tT(rT,n).isSelected?w.jsx(je.span,{"aria-hidden":!0,...i,ref:t}):null});sT.displayName=rT;var n_="SelectScrollUpButton",oT=x.forwardRef((e,t)=>{const n=bs(n_,e.__scopeSelect),i=Zv(n_,e.__scopeSelect),[s,a]=x.useState(!1),l=Ze(t,i.onScrollButtonChange);return ln(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=h.scrollTop>0;a(d)};const h=n.viewport;return u(),h.addEventListener("scroll",u),()=>h.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?w.jsx(lT,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:h}=n;u&&h&&(u.scrollTop=u.scrollTop-h.offsetHeight)}}):null});oT.displayName=n_;var i_="SelectScrollDownButton",aT=x.forwardRef((e,t)=>{const n=bs(i_,e.__scopeSelect),i=Zv(i_,e.__scopeSelect),[s,a]=x.useState(!1),l=Ze(t,i.onScrollButtonChange);return ln(()=>{if(n.viewport&&n.isPositioned){let u=function(){const d=h.scrollHeight-h.clientHeight,p=Math.ceil(h.scrollTop)<d;a(p)};const h=n.viewport;return u(),h.addEventListener("scroll",u),()=>h.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),s?w.jsx(lT,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:h}=n;u&&h&&(u.scrollTop=u.scrollTop+h.offsetHeight)}}):null});aT.displayName=i_;var lT=x.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:i,...s}=e,a=bs("SelectScrollButton",n),l=x.useRef(null),u=Xd(n),h=x.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return x.useEffect(()=>()=>h(),[h]),ln(()=>{u().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),w.jsx(je.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Re(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(i,50))}),onPointerMove:Re(s.onPointerMove,()=>{a.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(i,50))}),onPointerLeave:Re(s.onPointerLeave,()=>{h()})})}),lB="SelectSeparator",cB=x.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e;return w.jsx(je.div,{"aria-hidden":!0,...i,ref:t})});cB.displayName=lB;var r_="SelectArrow",uB=x.forwardRef((e,t)=>{const{__scopeSelect:n,...i}=e,s=Zd(n),a=ys(r_,n),l=bs(r_,n);return a.open&&l.position==="popper"?w.jsx(bk,{...s,...i,ref:t}):null});uB.displayName=r_;var hB="SelectBubbleInput",cT=x.forwardRef(({__scopeSelect:e,value:t,...n},i)=>{const s=x.useRef(null),a=Ze(i,s),l=n5(t);return x.useEffect(()=>{const u=s.current;if(!u)return;const h=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(h,"value").set;if(l!==t&&p){const m=new Event("change",{bubbles:!0});p.call(u,t),u.dispatchEvent(m)}},[l,t]),w.jsx(je.select,{...n,style:{...v2,...n.style},ref:a,defaultValue:t})});cT.displayName=hB;function uT(e){return e===""||e===void 0}function hT(e){const t=_n(e),n=x.useRef(""),i=x.useRef(0),s=x.useCallback(l=>{const u=n.current+l;t(u),(function h(d){n.current=d,window.clearTimeout(i.current),d!==""&&(i.current=window.setTimeout(()=>h(""),1e3))})(u)},[t]),a=x.useCallback(()=>{n.current="",window.clearTimeout(i.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(i.current),[]),[n,s,a]}function dT(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let l=dB(e,Math.max(a,0));s.length===1&&(l=l.filter(d=>d!==n));const h=l.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function dB(e,t){return e.map((n,i)=>e[(t+i)%e.length])}var fB=Vk,pB=Fk,mB=Wk,gB=Gk,_B=qk,vB=Kk,yB=Qk,bB=nT,SB=iT,wB=sT,xB=oT,CB=aT,EB="Separator",V1="horizontal",kB=["horizontal","vertical"],fT=x.forwardRef((e,t)=>{const{decorative:n,orientation:i=V1,...s}=e,a=TB(i)?i:V1,u=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return w.jsx(je.div,{"data-orientation":a,...u,...s,ref:t})});fT.displayName=EB;function TB(e){return kB.includes(e)}var AB=fT,Qd="Tabs",[RB]=vs(Qd,[wk]),pT=wk(),[MB,Qv]=RB(Qd),mT=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:i,onValueChange:s,defaultValue:a,orientation:l="horizontal",dir:u,activationMode:h="automatic",...d}=e,p=Id(u),[m,_]=Ta({prop:i,onChange:s,defaultProp:a??"",caller:Qd});return w.jsx(MB,{scope:n,baseId:vr(),value:m,onValueChange:_,orientation:l,dir:p,activationMode:h,children:w.jsx(je.div,{dir:p,"data-orientation":l,...d,ref:t})})});mT.displayName=Qd;var gT="TabsList",_T=x.forwardRef((e,t)=>{const{__scopeTabs:n,loop:i=!0,...s}=e,a=Qv(gT,n),l=pT(n);return w.jsx(kP,{asChild:!0,...l,orientation:a.orientation,dir:a.dir,loop:i,children:w.jsx(je.div,{role:"tablist","aria-orientation":a.orientation,...s,ref:t})})});_T.displayName=gT;var vT="TabsTrigger",yT=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:i,disabled:s=!1,...a}=e,l=Qv(vT,n),u=pT(n),h=wT(l.baseId,i),d=xT(l.baseId,i),p=i===l.value;return w.jsx(TP,{asChild:!0,...u,focusable:!s,active:p,children:w.jsx(je.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:h,...a,ref:t,onMouseDown:Re(e.onMouseDown,m=>{!s&&m.button===0&&m.ctrlKey===!1?l.onValueChange(i):m.preventDefault()}),onKeyDown:Re(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&l.onValueChange(i)}),onFocus:Re(e.onFocus,()=>{const m=l.activationMode!=="manual";!p&&!s&&m&&l.onValueChange(i)})})})});yT.displayName=vT;var bT="TabsContent",ST=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:i,forceMount:s,children:a,...l}=e,u=Qv(bT,n),h=wT(u.baseId,i),d=xT(u.baseId,i),p=i===u.value,m=x.useRef(p);return x.useEffect(()=>{const _=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(_)},[]),w.jsx(Ci,{present:s||p,children:({present:_})=>w.jsx(je.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":h,hidden:!_,id:d,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:_&&a})})});ST.displayName=bT;function wT(e,t){return`${e}-trigger-${t}`}function xT(e,t){return`${e}-content-${t}`}var DB=mT,NB=_T,OB=yT,LB=ST,[Jd]=vs("Tooltip",[Gd]),ef=Gd(),CT="TooltipProvider",PB=700,s_="tooltip.open",[BB,Jv]=Jd(CT),ET=e=>{const{__scopeTooltip:t,delayDuration:n=PB,skipDelayDuration:i=300,disableHoverableContent:s=!1,children:a}=e,l=x.useRef(!0),u=x.useRef(!1),h=x.useRef(0);return x.useEffect(()=>{const d=h.current;return()=>window.clearTimeout(d)},[]),w.jsx(BB,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(h.current),l.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>l.current=!0,i)},[i]),isPointerInTransitRef:u,onPointerInTransitChange:x.useCallback(d=>{u.current=d},[]),disableHoverableContent:s,children:a})};ET.displayName=CT;var dc="Tooltip",[IB,Ac]=Jd(dc),kT=e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:s,onOpenChange:a,disableHoverableContent:l,delayDuration:u}=e,h=Jv(dc,e.__scopeTooltip),d=ef(t),[p,m]=x.useState(null),_=vr(),y=x.useRef(0),b=l??h.disableHoverableContent,S=u??h.delayDuration,C=x.useRef(!1),[k,T]=Ta({prop:i,defaultProp:s??!1,onChange:H=>{H?(h.onOpen(),document.dispatchEvent(new CustomEvent(s_))):h.onClose(),a?.(H)},caller:dc}),R=x.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),A=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,C.current=!1,T(!0)},[T]),N=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,T(!1)},[T]),V=x.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,T(!0),y.current=0},S)},[S,T]);return x.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),w.jsx(_k,{...d,children:w.jsx(IB,{scope:t,contentId:_,open:k,stateAttribute:R,trigger:p,onTriggerChange:m,onTriggerEnter:x.useCallback(()=>{h.isOpenDelayedRef.current?V():A()},[h.isOpenDelayedRef,V,A]),onTriggerLeave:x.useCallback(()=>{b?N():(window.clearTimeout(y.current),y.current=0)},[N,b]),onOpen:A,onClose:N,disableHoverableContent:b,children:n})})};kT.displayName=dc;var o_="TooltipTrigger",TT=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...i}=e,s=Ac(o_,n),a=Jv(o_,n),l=ef(n),u=x.useRef(null),h=Ze(t,u,s.onTriggerChange),d=x.useRef(!1),p=x.useRef(!1),m=x.useCallback(()=>d.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),w.jsx(vk,{asChild:!0,...l,children:w.jsx(je.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...i,ref:h,onPointerMove:Re(e.onPointerMove,_=>{_.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),p.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{s.onTriggerLeave(),p.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:Re(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:Re(e.onBlur,s.onClose),onClick:Re(e.onClick,s.onClose)})})});TT.displayName=o_;var ey="TooltipPortal",[jB,zB]=Jd(ey,{forceMount:void 0}),AT=e=>{const{__scopeTooltip:t,forceMount:n,children:i,container:s}=e,a=Ac(ey,t);return w.jsx(jB,{scope:t,forceMount:n,children:w.jsx(Ci,{present:n||a.open,children:w.jsx(zd,{asChild:!0,container:s,children:i})})})};AT.displayName=ey;var Ma="TooltipContent",RT=x.forwardRef((e,t)=>{const n=zB(Ma,e.__scopeTooltip),{forceMount:i=n.forceMount,side:s="top",...a}=e,l=Ac(Ma,e.__scopeTooltip);return w.jsx(Ci,{present:i||l.open,children:l.disableHoverableContent?w.jsx(MT,{side:s,...a,ref:t}):w.jsx(HB,{side:s,...a,ref:t})})}),HB=x.forwardRef((e,t)=>{const n=Ac(Ma,e.__scopeTooltip),i=Jv(Ma,e.__scopeTooltip),s=x.useRef(null),a=Ze(t,s),[l,u]=x.useState(null),{trigger:h,onClose:d}=n,p=s.current,{onPointerInTransitChange:m}=i,_=x.useCallback(()=>{u(null),m(!1)},[m]),y=x.useCallback((b,S)=>{const C=b.currentTarget,k={x:b.clientX,y:b.clientY},T=$B(k,C.getBoundingClientRect()),R=WB(k,T),A=GB(S.getBoundingClientRect()),N=KB([...R,...A]);u(N),m(!0)},[m]);return x.useEffect(()=>()=>_(),[_]),x.useEffect(()=>{if(h&&p){const b=C=>y(C,p),S=C=>y(C,h);return h.addEventListener("pointerleave",b),p.addEventListener("pointerleave",S),()=>{h.removeEventListener("pointerleave",b),p.removeEventListener("pointerleave",S)}}},[h,p,y,_]),x.useEffect(()=>{if(l){const b=S=>{const C=S.target,k={x:S.clientX,y:S.clientY},T=h?.contains(C)||p?.contains(C),R=!qB(k,l);T?_():R&&(_(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[h,p,l,d,_]),w.jsx(MT,{...e,ref:a})}),[VB,UB]=Jd(dc,{isInside:!1}),FB=bL("TooltipContent"),MT=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:i,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:l,...u}=e,h=Ac(Ma,n),d=ef(n),{onClose:p}=h;return x.useEffect(()=>(document.addEventListener(s_,p),()=>document.removeEventListener(s_,p)),[p]),x.useEffect(()=>{if(h.trigger){const m=_=>{_.target?.contains(h.trigger)&&p()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[h.trigger,p]),w.jsx(jd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:p,children:w.jsxs(yk,{"data-state":h.stateAttribute,...d,...u,ref:t,style:{...u.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:[w.jsx(FB,{children:i}),w.jsx(VB,{scope:n,isInside:!0,children:w.jsx(TL,{id:h.contentId,role:"tooltip",children:s||i})})]})})});RT.displayName=Ma;var DT="TooltipArrow",NT=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...i}=e,s=ef(n);return UB(DT,n).isInside?null:w.jsx(bk,{...s,...i,ref:t})});NT.displayName=DT;function $B(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,i,s,a)){case a:return"left";case s:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function WB(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}function GB(e){const{top:t,right:n,bottom:i,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:i},{x:s,y:i}]}function qB(e,t){const{x:n,y:i}=e;let s=!1;for(let a=0,l=t.length-1;a<t.length;l=a++){const u=t[a],h=t[l],d=u.x,p=u.y,m=h.x,_=h.y;p>i!=_>i&&n<(m-d)*(i-p)/(_-p)+d&&(s=!s)}return s}function KB(e){const t=e.slice();return t.sort((n,i)=>n.x<i.x?-1:n.x>i.x?1:n.y<i.y?-1:n.y>i.y?1:0),YB(t)}function YB(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i<e.length;i++){const s=e[i];for(;t.length>=2;){const a=t[t.length-1],l=t[t.length-2];if((a.x-l.x)*(s.y-l.y)>=(a.y-l.y)*(s.x-l.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const s=e[i];for(;n.length>=2;){const a=n[n.length-1],l=n[n.length-2];if((a.x-l.x)*(s.y-l.y)>=(a.y-l.y)*(s.x-l.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var XB=ET,ZB=kT,QB=TT,JB=AT,e4=RT,t4=NT;function OT(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=OT(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function LT(){for(var e,t,n=0,i="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=OT(e))&&(i&&(i+=" "),i+=t);return i}const n4=(e,t)=>{const n=new Array(e.length+t.length);for(let i=0;i<e.length;i++)n[i]=e[i];for(let i=0;i<t.length;i++)n[e.length+i]=t[i];return n},i4=(e,t)=>({classGroupId:e,validator:t}),PT=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),cd="-",U1=[],r4="arbitrary..",s4=e=>{const t=a4(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return o4(l);const u=l.split(cd),h=u[0]===""&&u.length>1?1:0;return BT(u,h,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const h=i[l],d=n[l];return h?d?n4(d,h):h:d||U1}return n[l]||U1}}},BT=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],a=n.nextPart.get(s);if(a){const d=BT(e,t+1,a);if(d)return d}const l=n.validators;if(l===null)return;const u=t===0?e.join(cd):e.slice(t).join(cd),h=l.length;for(let d=0;d<h;d++){const p=l[d];if(p.validator(u))return p.classGroupId}},o4=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),i=t.slice(0,n);return i?r4+i:void 0})(),a4=e=>{const{theme:t,classGroups:n}=e;return l4(n,t)},l4=(e,t)=>{const n=PT();for(const i in e){const s=e[i];ty(s,n,i,t)}return n},ty=(e,t,n,i)=>{const s=e.length;for(let a=0;a<s;a++){const l=e[a];c4(l,t,n,i)}},c4=(e,t,n,i)=>{if(typeof e=="string"){u4(e,t,n);return}if(typeof e=="function"){h4(e,t,n,i);return}d4(e,t,n,i)},u4=(e,t,n)=>{const i=e===""?t:IT(t,e);i.classGroupId=n},h4=(e,t,n,i)=>{if(f4(e)){ty(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(i4(n,e))},d4=(e,t,n,i)=>{const s=Object.entries(e),a=s.length;for(let l=0;l<a;l++){const[u,h]=s[l];ty(h,IT(t,u),n,i)}},IT=(e,t)=>{let n=e;const i=t.split(cd),s=i.length;for(let a=0;a<s;a++){const l=i[a];let u=n.nextPart.get(l);u||(u=PT(),n.nextPart.set(l,u)),n=u}return n},f4=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,p4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),i=Object.create(null);const s=(a,l)=>{n[a]=l,t++,t>e&&(t=0,i=n,n=Object.create(null))};return{get(a){let l=n[a];if(l!==void 0)return l;if((l=i[a])!==void 0)return s(a,l),l},set(a,l){a in n?n[a]=l:s(a,l)}}},a_="!",F1=":",m4=[],$1=(e,t,n,i,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:i,isExternal:s}),g4=e=>{const{prefix:t,experimentalParseClassName:n}=e;let i=s=>{const a=[];let l=0,u=0,h=0,d;const p=s.length;for(let S=0;S<p;S++){const C=s[S];if(l===0&&u===0){if(C===F1){a.push(s.slice(h,S)),h=S+1;continue}if(C==="/"){d=S;continue}}C==="["?l++:C==="]"?l--:C==="("?u++:C===")"&&u--}const m=a.length===0?s:s.slice(h);let _=m,y=!1;m.endsWith(a_)?(_=m.slice(0,-1),y=!0):m.startsWith(a_)&&(_=m.slice(1),y=!0);const b=d&&d>h?d-h:void 0;return $1(a,y,_,b)};if(t){const s=t+F1,a=i;i=l=>l.startsWith(s)?a(l.slice(s.length)):$1(m4,!1,l,void 0,!0)}if(n){const s=i;i=a=>n({className:a,parseClassName:s})}return i},_4=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,i)=>{t.set(n,1e6+i)}),n=>{const i=[];let s=[];for(let a=0;a<n.length;a++){const l=n[a],u=l[0]==="[",h=t.has(l);u||h?(s.length>0&&(s.sort(),i.push(...s),s=[]),i.push(l)):s.push(l)}return s.length>0&&(s.sort(),i.push(...s)),i}},v4=e=>({cache:p4(e.cacheSize),parseClassName:g4(e),sortModifiers:_4(e),...s4(e)}),y4=/\s+/,b4=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:s,sortModifiers:a}=t,l=[],u=e.trim().split(y4);let h="";for(let d=u.length-1;d>=0;d-=1){const p=u[d],{isExternal:m,modifiers:_,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:S}=n(p);if(m){h=p+(h.length>0?" "+h:h);continue}let C=!!S,k=i(C?b.substring(0,S):b);if(!k){if(!C){h=p+(h.length>0?" "+h:h);continue}if(k=i(b),!k){h=p+(h.length>0?" "+h:h);continue}C=!1}const T=_.length===0?"":_.length===1?_[0]:a(_).join(":"),R=y?T+a_:T,A=R+k;if(l.indexOf(A)>-1)continue;l.push(A);const N=s(k,C);for(let V=0;V<N.length;++V){const H=N[V];l.push(R+H)}h=p+(h.length>0?" "+h:h)}return h},S4=(...e)=>{let t=0,n,i,s="";for(;t<e.length;)(n=e[t++])&&(i=jT(n))&&(s&&(s+=" "),s+=i);return s},jT=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=jT(e[i]))&&(n&&(n+=" "),n+=t);return n},w4=(e,...t)=>{let n,i,s,a;const l=h=>{const d=t.reduce((p,m)=>m(p),e());return n=v4(d),i=n.cache.get,s=n.cache.set,a=u,u(h)},u=h=>{const d=i(h);if(d)return d;const p=b4(h,n);return s(h,p),p};return a=l,(...h)=>a(S4(...h))},x4=[],jt=e=>{const t=n=>n[e]||x4;return t.isThemeGetter=!0,t},zT=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,HT=/^\((?:(\w[\w-]*):)?(.+)\)$/i,C4=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,E4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,k4=/\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$/,T4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,A4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,R4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jr=e=>C4.test(e),He=e=>!!e&&!Number.isNaN(Number(e)),es=e=>!!e&&Number.isInteger(Number(e)),Km=e=>e.endsWith("%")&&He(e.slice(0,-1)),hr=e=>E4.test(e),VT=()=>!0,M4=e=>k4.test(e)&&!T4.test(e),ny=()=>!1,D4=e=>A4.test(e),N4=e=>R4.test(e),O4=e=>!ye(e)&&!Se(e),L4=e=>Ss(e,$T,ny),ye=e=>zT.test(e),$s=e=>Ss(e,WT,M4),W1=e=>Ss(e,U4,He),P4=e=>Ss(e,qT,VT),B4=e=>Ss(e,GT,ny),G1=e=>Ss(e,UT,ny),I4=e=>Ss(e,FT,N4),ch=e=>Ss(e,KT,D4),Se=e=>HT.test(e),Hl=e=>go(e,WT),j4=e=>go(e,GT),q1=e=>go(e,UT),z4=e=>go(e,$T),H4=e=>go(e,FT),uh=e=>go(e,KT,!0),V4=e=>go(e,qT,!0),Ss=(e,t,n)=>{const i=zT.exec(e);return i?i[1]?t(i[1]):n(i[2]):!1},go=(e,t,n=!1)=>{const i=HT.exec(e);return i?i[1]?t(i[1]):n:!1},UT=e=>e==="position"||e==="percentage",FT=e=>e==="image"||e==="url",$T=e=>e==="length"||e==="size"||e==="bg-size",WT=e=>e==="length",U4=e=>e==="number",GT=e=>e==="family-name",qT=e=>e==="number"||e==="weight",KT=e=>e==="shadow",F4=()=>{const e=jt("color"),t=jt("font"),n=jt("text"),i=jt("font-weight"),s=jt("tracking"),a=jt("leading"),l=jt("breakpoint"),u=jt("container"),h=jt("spacing"),d=jt("radius"),p=jt("shadow"),m=jt("inset-shadow"),_=jt("text-shadow"),y=jt("drop-shadow"),b=jt("blur"),S=jt("perspective"),C=jt("aspect"),k=jt("ease"),T=jt("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...A(),Se,ye],V=()=>["auto","hidden","clip","visible","scroll"],H=()=>["auto","contain","none"],z=()=>[Se,ye,h],J=()=>[Jr,"full","auto",...z()],$=()=>[es,"none","subgrid",Se,ye],K=()=>["auto",{span:["full",es,Se,ye]},es,Se,ye],I=()=>[es,"auto",Se,ye],P=()=>["auto","min","max","fr",Se,ye],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...z()],U=()=>[Jr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],j=()=>[Jr,"screen","full","dvw","lvw","svw","min","max","fit",...z()],ee=()=>[Jr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...z()],X=()=>[e,Se,ye],L=()=>[...A(),q1,G1,{position:[Se,ye]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ie=()=>["auto","cover","contain",z4,L4,{size:[Se,ye]}],F=()=>[Km,Hl,$s],O=()=>["","none","full",d,Se,ye],G=()=>["",He,Hl,$s],q=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[He,Km,q1,G1],fe=()=>["","none",b,Se,ye],pe=()=>["none",He,Se,ye],xe=()=>["none",He,Se,ye],Ee=()=>[He,Se,ye],Pe=()=>[Jr,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[hr],breakpoint:[hr],color:[VT],container:[hr],"drop-shadow":[hr],ease:["in","out","in-out"],font:[O4],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[hr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[hr],shadow:[hr],spacing:["px",He],text:[hr],"text-shadow":[hr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Jr,ye,Se,C]}],container:["container"],columns:[{columns:[He,ye,Se,u]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:N()}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:J()}],"inset-x":[{"inset-x":J()}],"inset-y":[{"inset-y":J()}],start:[{"inset-s":J(),start:J()}],end:[{"inset-e":J(),end:J()}],"inset-bs":[{"inset-bs":J()}],"inset-be":[{"inset-be":J()}],top:[{top:J()}],right:[{right:J()}],bottom:[{bottom:J()}],left:[{left:J()}],visibility:["visible","invisible","collapse"],z:[{z:[es,"auto",Se,ye]}],basis:[{basis:[Jr,"full","auto",u,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[He,Jr,"auto","initial","none",ye]}],grow:[{grow:["",He,Se,ye]}],shrink:[{shrink:["",He,Se,ye]}],order:[{order:[es,"first","last","none",Se,ye]}],"grid-cols":[{"grid-cols":$()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":$()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":P()}],"auto-rows":[{"auto-rows":P()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pbs:[{pbs:z()}],pbe:[{pbe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],"inline-size":[{inline:["auto",...j()]}],"min-inline-size":[{"min-inline":["auto",...j()]}],"max-inline-size":[{"max-inline":["none",...j()]}],"block-size":[{block:["auto",...ee()]}],"min-block-size":[{"min-block":["auto",...ee()]}],"max-block-size":[{"max-block":["none",...ee()]}],w:[{w:[u,"screen",...U()]}],"min-w":[{"min-w":[u,"screen","none",...U()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...U()]}],h:[{h:["screen","lh",...U()]}],"min-h":[{"min-h":["screen","lh","none",...U()]}],"max-h":[{"max-h":["screen","lh",...U()]}],"font-size":[{text:["base",n,Hl,$s]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,V4,P4]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Km,ye]}],"font-family":[{font:[j4,B4,t]}],"font-features":[{"font-features":[ye]}],"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,Se,ye]}],"line-clamp":[{"line-clamp":[He,"none",Se,W1]}],leading:[{leading:[a,...z()]}],"list-image":[{"list-image":["none",Se,ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Se,ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:X()}],"text-color":[{text:X()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:[He,"from-font","auto",Se,$s]}],"text-decoration-color":[{decoration:X()}],"underline-offset":[{"underline-offset":[He,"auto",Se,ye]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se,ye]}],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",Se,ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},es,Se,ye],radial:["",Se,ye],conic:[es,Se,ye]},H4,I4]}],"bg-color":[{bg:X()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:X()}],"gradient-via":[{via:X()}],"gradient-to":[{to:X()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:G()}],"border-w-x":[{"border-x":G()}],"border-w-y":[{"border-y":G()}],"border-w-s":[{"border-s":G()}],"border-w-e":[{"border-e":G()}],"border-w-bs":[{"border-bs":G()}],"border-w-be":[{"border-be":G()}],"border-w-t":[{"border-t":G()}],"border-w-r":[{"border-r":G()}],"border-w-b":[{"border-b":G()}],"border-w-l":[{"border-l":G()}],"divide-x":[{"divide-x":G()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":G()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...q(),"hidden","none"]}],"divide-style":[{divide:[...q(),"hidden","none"]}],"border-color":[{border:X()}],"border-color-x":[{"border-x":X()}],"border-color-y":[{"border-y":X()}],"border-color-s":[{"border-s":X()}],"border-color-e":[{"border-e":X()}],"border-color-bs":[{"border-bs":X()}],"border-color-be":[{"border-be":X()}],"border-color-t":[{"border-t":X()}],"border-color-r":[{"border-r":X()}],"border-color-b":[{"border-b":X()}],"border-color-l":[{"border-l":X()}],"divide-color":[{divide:X()}],"outline-style":[{outline:[...q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[He,Se,ye]}],"outline-w":[{outline:["",He,Hl,$s]}],"outline-color":[{outline:X()}],shadow:[{shadow:["","none",p,uh,ch]}],"shadow-color":[{shadow:X()}],"inset-shadow":[{"inset-shadow":["none",m,uh,ch]}],"inset-shadow-color":[{"inset-shadow":X()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:X()}],"ring-offset-w":[{"ring-offset":[He,$s]}],"ring-offset-color":[{"ring-offset":X()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":X()}],"text-shadow":[{"text-shadow":["none",_,uh,ch]}],"text-shadow-color":[{"text-shadow":X()}],opacity:[{opacity:[He,Se,ye]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"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":[He]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":X()}],"mask-image-linear-to-color":[{"mask-linear-to":X()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":X()}],"mask-image-t-to-color":[{"mask-t-to":X()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":X()}],"mask-image-r-to-color":[{"mask-r-to":X()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":X()}],"mask-image-b-to-color":[{"mask-b-to":X()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":X()}],"mask-image-l-to-color":[{"mask-l-to":X()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":X()}],"mask-image-x-to-color":[{"mask-x-to":X()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":X()}],"mask-image-y-to-color":[{"mask-y-to":X()}],"mask-image-radial":[{"mask-radial":[Se,ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":X()}],"mask-image-radial-to-color":[{"mask-radial-to":X()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[He]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":X()}],"mask-image-conic-to-color":[{"mask-conic-to":X()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Se,ye]}],filter:[{filter:["","none",Se,ye]}],blur:[{blur:fe()}],brightness:[{brightness:[He,Se,ye]}],contrast:[{contrast:[He,Se,ye]}],"drop-shadow":[{"drop-shadow":["","none",y,uh,ch]}],"drop-shadow-color":[{"drop-shadow":X()}],grayscale:[{grayscale:["",He,Se,ye]}],"hue-rotate":[{"hue-rotate":[He,Se,ye]}],invert:[{invert:["",He,Se,ye]}],saturate:[{saturate:[He,Se,ye]}],sepia:[{sepia:["",He,Se,ye]}],"backdrop-filter":[{"backdrop-filter":["","none",Se,ye]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[He,Se,ye]}],"backdrop-contrast":[{"backdrop-contrast":[He,Se,ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",He,Se,ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[He,Se,ye]}],"backdrop-invert":[{"backdrop-invert":["",He,Se,ye]}],"backdrop-opacity":[{"backdrop-opacity":[He,Se,ye]}],"backdrop-saturate":[{"backdrop-saturate":[He,Se,ye]}],"backdrop-sepia":[{"backdrop-sepia":["",He,Se,ye]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Se,ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[He,"initial",Se,ye]}],ease:[{ease:["linear","initial",k,Se,ye]}],delay:[{delay:[He,Se,ye]}],animate:[{animate:["none",T,Se,ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Se,ye]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:xe()}],"scale-x":[{"scale-x":xe()}],"scale-y":[{"scale-y":xe()}],"scale-z":[{"scale-z":xe()}],"scale-3d":["scale-3d"],skew:[{skew:Ee()}],"skew-x":[{"skew-x":Ee()}],"skew-y":[{"skew-y":Ee()}],transform:[{transform:[Se,ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Pe()}],"translate-x":[{"translate-x":Pe()}],"translate-y":[{"translate-y":Pe()}],"translate-z":[{"translate-z":Pe()}],"translate-none":["translate-none"],accent:[{accent:X()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:X()}],"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",Se,ye]}],"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":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mbs":[{"scroll-mbs":z()}],"scroll-mbe":[{"scroll-mbe":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pbs":[{"scroll-pbs":z()}],"scroll-pbe":[{"scroll-pbe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",Se,ye]}],fill:[{fill:["none",...X()]}],"stroke-w":[{stroke:[He,Hl,$s,W1]}],stroke:[{stroke:["none",...X()]}],"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"]}},$4=w4(F4);function lt(...e){return $4(LT(e))}function ho({className:e,children:t,...n}){return w.jsxs(VP,{"data-slot":"scroll-area",type:"hover",scrollHideDelay:300,className:lt("relative",e),...n,children:[w.jsx(UP,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:t}),w.jsx(W4,{}),w.jsx(FP,{})]})}function W4({className:e,orientation:t="vertical",...n}){return w.jsx(Nk,{"data-slot":"scroll-area-scrollbar",orientation:t,className:lt("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-3 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:w.jsx(Bk,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}const YT=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();const G4=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const q4=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase());const K1=e=>{const t=q4(e);return t.charAt(0).toUpperCase()+t.slice(1)};var K4={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Y4=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const X4=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:s="",children:a,iconNode:l,...u},h)=>x.createElement("svg",{ref:h,...K4,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:YT("lucide",s),...!a&&!Y4(u)&&{"aria-hidden":"true"},...u},[...l.map(([d,p])=>x.createElement(d,p)),...Array.isArray(a)?a:[a]]));const qe=(e,t)=>{const n=x.forwardRef(({className:i,...s},a)=>x.createElement(X4,{ref:a,iconNode:t,className:YT(`lucide-${G4(K1(e))}`,`lucide-${e}`,i),...s}));return n.displayName=K1(e),n};const Z4=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]],Q4=qe("arrow-down-up",Z4);const J4=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],iy=qe("arrow-left",J4);const eI=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],tI=qe("book-open",eI);const nI=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],iI=qe("check",nI);const rI=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ry=qe("chevron-down",rI);const sI=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],oI=qe("chevron-right",sI);const aI=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],lI=qe("chevron-up",aI);const cI=[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]],Ym=qe("cog",cI);const uI=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],Xm=qe("file-braces",uI);const hI=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],ts=qe("file-code",hI);const dI=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]],fI=qe("file-diff",dI);const pI=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],mI=qe("file-image",pI);const gI=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],hh=qe("file-text",gI);const _I=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],XT=qe("file",_I);const vI=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],yI=qe("folder-open",vI);const bI=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],SI=qe("folder-tree",bI);const wI=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],xI=qe("folder",wI);const CI=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],EI=qe("git-branch",CI);const kI=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],TI=qe("git-commit-horizontal",kI);const AI=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],RI=qe("globe",AI);const MI=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],DI=qe("hash",MI);const NI=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],OI=qe("network",NI);const LI=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Y1=qe("package",LI);const PI=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],X1=qe("palette",PI);const BI=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],II=qe("panel-right-close",BI);const jI=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],zI=qe("panel-right-open",jI);const HI=[["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"}]],VI=qe("refresh-cw",HI);const UI=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],FI=qe("search",UI);const $I=[["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"}]],WI=qe("settings",$I);const GI=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],qI=qe("square-terminal",GI);const KI=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],YI=qe("terminal",KI);const XI=[["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"}]],ZI=qe("trash-2",XI);const QI=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],sy=qe("x",QI);function wa({className:e,...t}){return w.jsx("div",{"data-slot":"skeleton",className:lt("animate-pulse rounded-md bg-accent",e),...t})}function JI({className:e,...t}){return w.jsx("div",{"data-slot":"card",className:lt("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}const Z1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Q1=LT,oy=(e,t)=>n=>{var i;if(t?.variants==null)return Q1(e,n?.class,n?.className);const{variants:s,defaultVariants:a}=t,l=Object.keys(s).map(d=>{const p=n?.[d],m=a?.[d];if(p===null)return null;const _=Z1(p)||Z1(m);return s[d][_]}),u=n&&Object.entries(n).reduce((d,p)=>{let[m,_]=p;return _===void 0||(d[m]=_),d},{}),h=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((d,p)=>{let{class:m,className:_,...y}=p;return Object.entries(y).every(b=>{let[S,C]=b;return Array.isArray(C)?C.includes({...a,...u}[S]):{...a,...u}[S]===C})?[...d,m,_]:d},[]);return Q1(e,l,h,n?.class,n?.className)},e6=oy("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-sm border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function ud({className:e,variant:t="default",asChild:n=!1,...i}){const s=n?g2:"span";return w.jsx(s,{"data-slot":"badge","data-variant":t,className:lt(e6({variant:t}),e),...i})}function ZT({delayDuration:e=0,...t}){return w.jsx(XB,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function QT({...e}){return w.jsx(ZB,{"data-slot":"tooltip",...e})}function JT({...e}){return w.jsx(QB,{"data-slot":"tooltip-trigger",...e})}function eA({className:e,sideOffset:t=0,children:n,...i}){return w.jsx(JB,{children:w.jsxs(e4,{"data-slot":"tooltip-content",sideOffset:t,className:lt("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-balance text-popover-foreground shadow-md fade-in-0 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...i,children:[n,w.jsx(t4,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-popover fill-popover"})]})})}function t6(){const[e,t]=x.useState(!0);return x.useEffect(()=>{const n=setTimeout(()=>t(!1),1800);return()=>clearTimeout(n)},[]),e?w.jsxs("div",{className:"celebration-overlay","aria-hidden":"true",children:[w.jsx("div",{className:"sparkle sparkle-1"}),w.jsx("div",{className:"sparkle sparkle-2"}),w.jsx("div",{className:"sparkle sparkle-3"}),w.jsx("div",{className:"sparkle sparkle-4"}),w.jsx("div",{className:"sparkle sparkle-5"}),w.jsx("div",{className:"sparkle sparkle-6"}),w.jsx("div",{className:"kawaii-star",children:w.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",style:{imageRendering:"pixelated"},children:[w.jsx("rect",{x:"10",y:"0",width:"4",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"8",y:"2",width:"8",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"0",y:"4",width:"24",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"2",y:"6",width:"20",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"4",y:"8",width:"16",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"2",y:"10",width:"20",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"0",y:"12",width:"24",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"8",y:"14",width:"8",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"10",y:"16",width:"4",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"8",y:"6",width:"2",height:"2",fill:"#1a1a2e"}),w.jsx("rect",{x:"14",y:"6",width:"2",height:"2",fill:"#1a1a2e"}),w.jsx("rect",{x:"10",y:"10",width:"4",height:"2",fill:"#ff6b9d"}),w.jsx("rect",{x:"6",y:"8",width:"2",height:"2",fill:"#ff6b9d",opacity:"0.5"}),w.jsx("rect",{x:"16",y:"8",width:"2",height:"2",fill:"#ff6b9d",opacity:"0.5"})]})})]}):null}const J1={0:"text-[#f85149]",1:"text-[#e3b341]",2:"text-[#58a6ff]",3:"text-[#7d8590]",4:"text-muted-foreground"},n6={bug:"bg-[#da3633]/15 text-[#f85149] border-[#da3633]/30",feature:"bg-[#8957e5]/15 text-[#bc8cff] border-[#8957e5]/30",task:"bg-[#2dd4bf]/15 text-[#5eead4] border-[#2dd4bf]/30",epic:"bg-[#d29922]/15 text-[#e3b341] border-[#d29922]/30",chore:"bg-[#7d8590]/15 text-[#7d8590] border-[#7d8590]/30"};function i6({issue:e,onClick:t,celebrating:n}){const i=e.dependencies?.length||0,s=x.useRef(null),a=()=>{if(!t)return;const l=s.current;if(l){const u=l.getBoundingClientRect();t(e.id,{top:u.top,left:u.left,width:u.width,height:u.height})}else t(e.id)};return w.jsxs("div",{className:n?"celebration-card-wrapper":void 0,children:[n&&w.jsx(t6,{}),w.jsxs(JI,{ref:s,"data-bead-id":e.id,className:"mb-2 p-2.5 gap-1 border-border animate-bead-enter cursor-pointer hover:border-primary/50 transition-colors",onClick:a,children:[w.jsxs("div",{className:"flex items-center justify-between gap-2",children:[w.jsx("code",{className:"text-xs text-muted-foreground",children:e.id}),w.jsxs("span",{className:`text-xs font-semibold ${J1[e.priority]||J1[4]}`,children:["P",e.priority]})]}),w.jsx(ZT,{children:w.jsxs(QT,{children:[w.jsx(JT,{asChild:!0,children:w.jsx("p",{className:"text-sm font-medium leading-tight line-clamp-2",children:e.title})}),w.jsx(eA,{children:w.jsx("p",{children:e.title})})]})}),w.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap mt-1",children:[e.type&&w.jsx(ud,{variant:"outline",className:n6[e.type]||"",children:e.type}),i>0&&w.jsxs("span",{className:"text-xs text-muted-foreground",children:[i," dep",i>1?"s":""]}),e.assignee&&w.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:e.assignee})]})]})]})}function r6(e,t){return[...e].sort((n,i)=>{if(t==="priority"){const s=(n.priority??4)-(i.priority??4);return s!==0?s:(i.updated_at??"").localeCompare(n.updated_at??"")}return(i.updated_at??"").localeCompare(n.updated_at??"")})}function dh({title:e,issues:t,accentColor:n,loading:i,sortable:s,onIssueClick:a,celebratingIds:l}){const[u,h]=x.useState("recent"),d=x.useMemo(()=>s?r6(t,u):t,[t,u,s]),p=()=>h(m=>m==="recent"?"priority":"recent");return w.jsxs("div",{className:"min-w-0 flex-1",children:[w.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 border-b-2 sticky top-0 z-10 bg-background ${n}`,children:[w.jsx("h2",{className:"text-sm font-semibold",children:e}),w.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",t.length,")"]}),s&&w.jsxs("button",{onClick:p,title:u==="recent"?"Sorted by recent — click for priority":"Sorted by priority — click for recent",className:"ml-auto flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[w.jsx(Q4,{className:"h-3 w-3"}),w.jsx("span",{children:u==="recent"?"Recent":"Priority"})]})]}),w.jsx("div",{className:"p-2",children:i?Array.from({length:3}).map((m,_)=>w.jsx(wa,{className:"h-24 mb-2 rounded-lg"},_)):d.length===0?w.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No issues"}):d.map(m=>w.jsx(i6,{issue:m,onClick:a,celebrating:l?.has(m.id)},m.id))})]})}function s6(e){const t=x.useMemo(()=>e.map(l=>l.id).sort(),[e]),n=t.join(","),i=x.useRef(null),[s,a]=x.useState(new Set);return x.useEffect(()=>{const l=new Set(t);if(i.current===null||i.current.size===0){i.current=l;return}const u=new Set;for(const h of l)i.current.has(h)||u.add(h);if(i.current=l,u.size>0){a(u);const h=setTimeout(()=>a(new Set),2e3);return()=>clearTimeout(h)}},[n]),s}function o6({issues:e,allIssues:t,ready:n,blocked:i,loading:s,onIssueClick:a}){const l=new Set(n.map(_=>_.id)),u=e.filter(_=>_.status==="in_progress"),h=e.filter(_=>_.status==="closed"),d=x.useMemo(()=>(t||e).filter(_=>_.status==="closed"),[t,e]),p=s6(d),m=e.filter(_=>_.status!=="in_progress"&&_.status!=="closed"&&!l.has(_.id));return w.jsx(ho,{className:"h-full",children:w.jsxs("div",{className:"flex gap-3",children:[w.jsx(dh,{title:"Backlog",issues:m,accentColor:"border-[#7d8590]",loading:s,onIssueClick:a}),w.jsx(dh,{title:"Ready",issues:n,accentColor:"border-[#238636]",loading:s,onIssueClick:a}),w.jsx(dh,{title:"In Progress",issues:u,accentColor:"border-[#1f6feb]",loading:s,onIssueClick:a}),w.jsx(dh,{title:"Done",issues:h,accentColor:"border-[#484f58]",loading:s,sortable:!0,onIssueClick:a,celebratingIds:p})]})})}function a6({className:e,orientation:t="horizontal",...n}){return w.jsx(DB,{"data-slot":"tabs","data-orientation":t,orientation:t,className:lt("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...n})}const l6=oy("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function c6({className:e,variant:t="default",...n}){return w.jsx(NB,{"data-slot":"tabs-list","data-variant":t,className:lt(l6({variant:t}),e),...n})}function Zm({className:e,...t}){return w.jsx(OB,{"data-slot":"tabs-trigger",className:lt("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function Qm({className:e,...t}){return w.jsx(LB,{"data-slot":"tabs-content",className:lt("flex-1 outline-none",e),...t})}function Lh({...e}){return w.jsx(fB,{"data-slot":"select",...e})}function Ph({...e}){return w.jsx(mB,{"data-slot":"select-value",...e})}function Bh({className:e,size:t="default",children:n,...i}){return w.jsxs(pB,{"data-slot":"select-trigger","data-size":t,className:lt("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...i,children:[n,w.jsx(gB,{asChild:!0,children:w.jsx(ry,{className:"size-4 opacity-50"})})]})}function Ih({className:e,children:t,position:n="item-aligned",align:i="center",...s}){return w.jsx(_B,{children:w.jsxs(vB,{"data-slot":"select-content",className:lt("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",n==="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:n,align:i,...s,children:[w.jsx(u6,{}),w.jsx(yB,{className:lt("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),w.jsx(h6,{})]})})}function Xl({className:e,children:t,...n}){return w.jsxs(bB,{"data-slot":"select-item",className:lt("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[w.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:w.jsx(wB,{children:w.jsx(iI,{className:"size-4"})})}),w.jsx(SB,{children:t})]})}function u6({className:e,...t}){return w.jsx(xB,{"data-slot":"select-scroll-up-button",className:lt("flex cursor-default items-center justify-center py-1",e),...t,children:w.jsx(lI,{className:"size-4"})})}function h6({className:e,...t}){return w.jsx(CB,{"data-slot":"select-scroll-down-button",className:lt("flex cursor-default items-center justify-center py-1",e),...t,children:w.jsx(ry,{className:"size-4"})})}function d6({branches:e,current:t,onSelect:n}){return w.jsxs(Lh,{value:t,onValueChange:n,children:[w.jsx(Bh,{className:"w-full",children:w.jsx(Ph,{placeholder:"Select branch"})}),w.jsx(Ih,{children:e.map(i=>w.jsx(Xl,{value:i,children:i},i))})]})}const l_=/\b([\w]+-[\w]+-[a-z0-9]{2,8})\b/;function f6(e){const t=new Date(e),i=new Date().getTime()-t.getTime(),s=Math.floor(i/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const a=Math.floor(s/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}function ex(e,t){return e.split(new RegExp(l_.source,"g")).map((i,s)=>l_.test(i)?w.jsx(ud,{variant:"outline",className:t?"mx-0.5 text-xs cursor-pointer hover:underline hover:bg-accent/50 transition-colors":"mx-0.5 text-xs",onClick:t?a=>{a.stopPropagation(),t(i)}:void 0,children:i},s):w.jsx("span",{children:i},s))}function p6(e){const t=[];let n;const i=new RegExp(l_.source,"g");for(;(n=i.exec(e))!==null;)t.push(n[1]);return t}function m6({commit:e,onBeadClick:t,highlightedBeadId:n}){const i=p6(e.message),s=n?i.includes(n):!1;return w.jsxs("div",{className:`flex flex-col gap-0.5 py-2 px-3 border-b border-border last:border-0 animate-bead-enter min-w-0 transition-colors ${s?"animate-commit-highlight bg-primary/10":""}`,...i.length>0?{"data-commit-beads":i.join(" ")}:{},children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("code",{className:"text-xs text-muted-foreground shrink-0",children:e.hash}),w.jsx("span",{className:"text-xs text-muted-foreground ml-auto shrink-0",children:f6(e.date)})]}),e.body?w.jsx(ZT,{children:w.jsxs(QT,{children:[w.jsx(JT,{asChild:!0,children:w.jsx("p",{className:"text-sm leading-tight break-words cursor-help",children:ex(e.message,t)})}),w.jsxs(eA,{side:"bottom",className:"max-w-sm whitespace-pre-wrap text-xs",children:[w.jsx("p",{className:"font-semibold mb-1",children:e.message}),w.jsx("p",{children:e.body})]})]})}):w.jsx("p",{className:"text-sm leading-tight break-words",children:ex(e.message,t)}),w.jsx("span",{className:"text-xs text-muted-foreground",children:e.author})]})}function ws(e,t=5e3){const[n,i]=x.useState(null),[s,a]=x.useState(null),[l,u]=x.useState(!0),[h,d]=x.useState(null),p=x.useRef(null),m=x.useCallback(async()=>{try{const _=await e();i(_),a(null),d(new Date)}catch(_){a(_ instanceof Error?_.message:"Unknown error")}finally{u(!1)}},[e]);return x.useEffect(()=>(m(),p.current=setInterval(m,t),()=>{p.current&&clearInterval(p.current)}),[m,t]),{data:n,error:s,loading:l,lastUpdated:h}}const g6="";async function Cr(e){const t=await fetch(`${g6}${e}`);if(!t.ok)throw new Error(`API error: ${t.status}`);return t.json()}function _6(){const e=x.useCallback(()=>Cr("/api/issues"),[]);return ws(e)}function v6(){const e=x.useCallback(()=>Cr("/api/ready"),[]);return ws(e)}function y6(){const e=x.useCallback(()=>Cr("/api/blocked"),[]);return ws(e)}function b6(e,t=50){const n=x.useCallback(()=>Cr(`/api/git-log?branch=${encodeURIComponent(e)}&limit=${t}`),[e,t]);return ws(n)}function S6(){const e=x.useCallback(()=>Cr("/api/branches"),[]);return ws(e,3e4)}function w6(e){const t=x.useCallback(()=>e?Cr(`/api/git-diff?file=${encodeURIComponent(e)}`):Promise.resolve(null),[e]);return ws(t,1e4)}function x6(){const e=x.useCallback(()=>Cr("/api/git-status"),[]);return ws(e)}function C6(){const e=x.useCallback(()=>Cr("/api/project"),[]);return ws(e,6e4)}function E6(e){const[t,n]=x.useState(null),[i,s]=x.useState(!0);return x.useEffect(()=>{e&&(s(!0),Cr(`/api/file-content?path=${encodeURIComponent(e)}`).then(n).catch(()=>n(null)).finally(()=>s(!1)))},[e]),{data:t,loading:i}}function k6(e){const t=e.split(`
|
|
55
|
+
`),n=[];for(const i of t)i.startsWith("@@")?n.push({type:"hunk",content:i}):i.startsWith("---")||i.startsWith("+++")?n.push({type:"header",content:i}):i.startsWith("+")?n.push({type:"add",content:i.substring(1)}):i.startsWith("-")?n.push({type:"remove",content:i.substring(1)}):i===""?n.push({type:"empty",content:""}):n.push({type:"context",content:i.startsWith(" ")?i.substring(1):i});return n}const T6={header:"bg-muted/50 text-muted-foreground font-bold",hunk:"bg-blue-500/10 text-blue-400",add:"bg-green-500/15 text-green-300",remove:"bg-red-500/15 text-red-300",context:"text-foreground/80",empty:"text-foreground/80"},A6={header:"",hunk:"",add:"+",remove:"-",context:" ",empty:" "};function R6({file:e,onBack:t}){const{data:n,loading:i}=w6(e),s=n?.diff?k6(n.diff):[],a=e.split("/").pop()||e;return w.jsxs("div",{className:"flex flex-col h-full",children:[w.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border shrink-0",children:[w.jsx("button",{onClick:t,className:"p-1 rounded-md hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:"Back to file list",children:w.jsx(iy,{className:"h-4 w-4"})}),w.jsx("span",{className:"text-xs font-mono text-foreground truncate",title:e,children:a})]}),w.jsx(ho,{className:"flex-1 min-h-0",children:i&&!n?Array.from({length:8}).map((l,u)=>w.jsx(wa,{className:"h-5 mx-3 mb-1 rounded"},u)):s.length>0?w.jsx("div",{className:"text-xs font-mono leading-5",children:s.map((l,u)=>w.jsxs("div",{className:`px-3 ${T6[l.type]}`,children:[w.jsx("span",{className:"inline-block w-4 text-muted-foreground/50 select-none mr-2 text-right",children:A6[l.type]}),w.jsx("span",{className:"whitespace-pre-wrap break-all",children:(l.type==="hunk",l.content)})]},u))}):w.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No diff available"})})]})}const M6="modulepreload",D6=function(e){return"/"+e},tx={},Me=function(t,n,i){let s=Promise.resolve();if(n&&n.length>0){let d=function(p){return Promise.all(p.map(m=>Promise.resolve(m).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};var l=d;document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),h=u?.nonce||u?.getAttribute("nonce");s=d(n.map(p=>{if(p=D6(p),p in tx)return;tx[p]=!0;const m=p.endsWith(".css"),_=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${_}`))return;const y=document.createElement("link");if(y.rel=m?"stylesheet":M6,m||(y.as="script"),y.crossOrigin="",y.href=p,h&&y.setAttribute("nonce",h),document.head.appendChild(y),m)return new Promise((b,S)=>{y.addEventListener("load",b),y.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${p}`)))})}))}function a(u){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=u,window.dispatchEvent(h),!h.defaultPrevented)throw u}return s.then(u=>{for(const h of u||[])h.status==="rejected"&&a(h.reason);return t().catch(a)})};var ft=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function N6(e){return ay(e)}function ay(e){return Array.isArray(e)?O6(e):e instanceof RegExp?e:typeof e=="object"?L6(e):e}function O6(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=ay(e[n]);return t}function L6(e){let t={};for(let n in e)t[n]=ay(e[n]);return t}function tA(e,...t){return t.forEach(n=>{for(let i in n)e[i]=n[i]}),e}function nA(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?nA(e.substring(0,e.length-1)):e.substr(~t+1)}var Jm=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,fh=class{static hasCaptures(e){return e===null?!1:(Jm.lastIndex=0,Jm.test(e))}static replaceCaptures(e,t,n){return e.replace(Jm,(i,s,a,l)=>{let u=n[parseInt(s||a,10)];if(u){let h=t.substring(u.start,u.end);for(;h[0]===".";)h=h.substring(1);switch(l){case"downcase":return h.toLowerCase();case"upcase":return h.toUpperCase();default:return h}}else return i})}};function iA(e,t){return e<t?-1:e>t?1:0}function rA(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,i=t.length;if(n===i){for(let s=0;s<n;s++){let a=iA(e[s],t[s]);if(a!==0)return a}return 0}return n-i}function nx(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function sA(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var oA=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},hd=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(I6(e),t)}static createFromParsedTheme(e,t){return z6(e,t)}_cachedMatchRoot=new oA(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,i=this._cachedMatchRoot.get(t).find(s=>P6(e.parent,s.parentScopes));return i?new aA(i.fontStyle,i.foreground,i.background):null}},eg=class jh{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const i of n)t=new jh(t,i);return t}static from(...t){let n=null;for(let i=0;i<t.length;i++)n=new jh(n,t[i]);return n}push(t){return new jh(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let i=this;for(;i&&i!==t;)n.push(i.scopeName),i=i.parent;return i===t?n.reverse():void 0}};function P6(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let i=t[n],s=!1;if(i===">"){if(n===t.length-1)return!1;i=t[++n],s=!0}for(;e&&!B6(e.scopeName,i);){if(s)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function B6(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var aA=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function I6(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],i=0;for(let s=0,a=t.length;s<a;s++){let l=t[s];if(!l.settings)continue;let u;if(typeof l.scope=="string"){let m=l.scope;m=m.replace(/^[,]+/,""),m=m.replace(/[,]+$/,""),u=m.split(",")}else Array.isArray(l.scope)?u=l.scope:u=[""];let h=-1;if(typeof l.settings.fontStyle=="string"){h=0;let m=l.settings.fontStyle.split(" ");for(let _=0,y=m.length;_<y;_++)switch(m[_]){case"italic":h=h|1;break;case"bold":h=h|2;break;case"underline":h=h|4;break;case"strikethrough":h=h|8;break}}let d=null;typeof l.settings.foreground=="string"&&nx(l.settings.foreground)&&(d=l.settings.foreground);let p=null;typeof l.settings.background=="string"&&nx(l.settings.background)&&(p=l.settings.background);for(let m=0,_=u.length;m<_;m++){let b=u[m].trim().split(" "),S=b[b.length-1],C=null;b.length>1&&(C=b.slice(0,b.length-1),C.reverse()),n[i++]=new j6(S,C,s,h,d,p)}}return n}var j6=class{constructor(e,t,n,i,s,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=i,this.foreground=s,this.background=a}},fn=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(fn||{});function z6(e,t){e.sort((h,d)=>{let p=iA(h.scope,d.scope);return p!==0||(p=rA(h.parentScopes,d.parentScopes),p!==0)?p:h.index-d.index});let n=0,i="#000000",s="#ffffff";for(;e.length>=1&&e[0].scope==="";){let h=e.shift();h.fontStyle!==-1&&(n=h.fontStyle),h.foreground!==null&&(i=h.foreground),h.background!==null&&(s=h.background)}let a=new H6(t),l=new aA(n,a.getId(i),a.getId(s)),u=new U6(new c_(0,null,-1,0,0),[]);for(let h=0,d=e.length;h<d;h++){let p=e[h];u.insert(0,p.scope,p.parentScopes,p.fontStyle,a.getId(p.foreground),a.getId(p.background))}return new hd(a,l,u)}var H6=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},V6=Object.freeze([]),c_=class lA{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,i,s,a){this.scopeDepth=t,this.parentScopes=n||V6,this.fontStyle=i,this.foreground=s,this.background=a}clone(){return new lA(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let i=0,s=t.length;i<s;i++)n[i]=t[i].clone();return n}acceptOverwrite(t,n,i,s){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),i!==0&&(this.foreground=i),s!==0&&(this.background=s)}},U6=class u_{constructor(t,n=[],i={}){this._mainRule=t,this._children=i,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let i=0,s=0;for(;t.parentScopes[i]===">"&&i++,n.parentScopes[s]===">"&&s++,!(i>=t.parentScopes.length||s>=n.parentScopes.length);){const a=n.parentScopes[s].length-t.parentScopes[i].length;if(a!==0)return a;i++,s++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let i=t.indexOf("."),s,a;if(i===-1?(s=t,a=""):(s=t.substring(0,i),a=t.substring(i+1)),this._children.hasOwnProperty(s))return this._children[s].match(a)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(u_._cmpBySpecificity),n}insert(t,n,i,s,a,l){if(n===""){this._doInsertHere(t,i,s,a,l);return}let u=n.indexOf("."),h,d;u===-1?(h=n,d=""):(h=n.substring(0,u),d=n.substring(u+1));let p;this._children.hasOwnProperty(h)?p=this._children[h]:(p=new u_(this._mainRule.clone(),c_.cloneArr(this._rulesWithParentScopes)),this._children[h]=p),p.insert(t+1,d,i,s,a,l)}_doInsertHere(t,n,i,s,a){if(n===null){this._mainRule.acceptOverwrite(t,i,s,a);return}for(let l=0,u=this._rulesWithParentScopes.length;l<u;l++){let h=this._rulesWithParentScopes[l];if(rA(h.parentScopes,n)===0){h.acceptOverwrite(t,i,s,a);return}}i===-1&&(i=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),a===0&&(a=this._mainRule.background),this._rulesWithParentScopes.push(new c_(t,n,i,s,a))}},Da=class ri{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=ri.getLanguageId(t),i=ri.getTokenType(t),s=ri.getFontStyle(t),a=ri.getForeground(t),l=ri.getBackground(t);console.log({languageId:n,tokenType:i,fontStyle:s,foreground:a,background:l})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,i,s,a,l,u){let h=ri.getLanguageId(t),d=ri.getTokenType(t),p=ri.containsBalancedBrackets(t)?1:0,m=ri.getFontStyle(t),_=ri.getForeground(t),y=ri.getBackground(t);return n!==0&&(h=n),i!==8&&(d=i),s!==null&&(p=s?1:0),a!==-1&&(m=a),l!==0&&(_=l),u!==0&&(y=u),(h<<0|d<<8|p<<10|m<<11|_<<15|y<<24)>>>0}};function dd(e,t){const n=[],i=F6(e);let s=i.next();for(;s!==null;){let h=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":h=1;break;case"L":h=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=i.next()}let d=l();if(n.push({matcher:d,priority:h}),s!==",")break;s=i.next()}return n;function a(){if(s==="-"){s=i.next();const h=a();return d=>!!h&&!h(d)}if(s==="("){s=i.next();const h=u();return s===")"&&(s=i.next()),h}if(ix(s)){const h=[];do h.push(s),s=i.next();while(ix(s));return d=>t(h,d)}return null}function l(){const h=[];let d=a();for(;d;)h.push(d),d=a();return p=>h.every(m=>m(p))}function u(){const h=[];let d=l();for(;d&&(h.push(d),s==="|"||s===",");){do s=i.next();while(s==="|"||s===",");d=l()}return p=>h.some(m=>m(p))}}function ix(e){return!!e&&!!e.match(/[\w\.:]+/)}function F6(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const i=n[0];return n=t.exec(e),i}}}function cA(e){typeof e.dispose=="function"&&e.dispose()}var fc=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},$6=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},W6=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},G6=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new fc(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new W6;for(const n of e)q6(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof fc){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function q6(e,t,n,i){const s=n.lookup(e.scopeName);if(!s){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const a=n.lookup(t);e instanceof fc?zh({baseGrammar:a,selfGrammar:s},i):h_(e.ruleName,{baseGrammar:a,selfGrammar:s,repository:s.repository},i);const l=n.injections(e.scopeName);if(l)for(const u of l)i.add(new fc(u))}function h_(e,t,n){if(t.repository&&t.repository[e]){const i=t.repository[e];fd([i],t,n)}}function zh(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&fd(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&fd(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function fd(e,t,n){for(const i of e){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);const s=i.repository?tA({},t.repository,i.repository):t.repository;Array.isArray(i.patterns)&&fd(i.patterns,{...t,repository:s},n);const a=i.include;if(!a)continue;const l=uA(a);switch(l.kind){case 0:zh({...t,selfGrammar:t.baseGrammar},n);break;case 1:zh(t,n);break;case 2:h_(l.ruleName,{...t,repository:s},n);break;case 3:case 4:const u=l.scopeName===t.selfGrammar.scopeName?t.selfGrammar:l.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(u){const h={baseGrammar:t.baseGrammar,selfGrammar:u,repository:s};l.kind===4?h_(l.ruleName,h,n):zh(h,n)}else l.kind===4?n.add(new $6(l.scopeName,l.ruleName)):n.add(new fc(l.scopeName));break}}}var K6=class{kind=0},Y6=class{kind=1},X6=class{constructor(e){this.ruleName=e}kind=2},Z6=class{constructor(e){this.scopeName=e}kind=3},Q6=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function uA(e){if(e==="$base")return new K6;if(e==="$self")return new Y6;const t=e.indexOf("#");if(t===-1)return new Z6(e);if(t===0)return new X6(e.substring(1));{const n=e.substring(0,t),i=e.substring(t+1);return new Q6(n,i)}}var J6=/\\(\d+)/,rx=/\\(\d+)/g,ej=-1,hA=-2;var Rc=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,i){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=fh.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=fh.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${nA(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:fh.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:fh.replaceCaptures(this._contentName,e,t)}},tj=class extends Rc{retokenizeCapturedWithRuleId;constructor(e,t,n,i,s){super(e,t,n,i),this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,i){throw new Error("Not supported!")}},nj=class extends Rc{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,i,s){super(e,t,n,null),this._match=new pc(i,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new mc,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},sx=class extends Rc{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,s){super(e,t,n,i),this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new mc,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},d_=class extends Rc{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,s,a,l,u,h,d){super(e,t,n,i),this._begin=new pc(s,this.id),this.beginCaptures=a,this._end=new pc(l||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=u,this.applyEndPatternLast=h||!1,this.patterns=d.patterns,this.hasMissingPatterns=d.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,i)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new mc;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},pd=class extends Rc{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,i,s,a,l,u,h){super(e,t,n,i),this._begin=new pc(s,this.id),this.beginCaptures=a,this.whileCaptures=u,this._while=new pc(l,hA),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=h.patterns,this.hasMissingPatterns=h.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new mc;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,i){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,i)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new mc,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},dA=class hn{static createCaptureRule(t,n,i,s,a){return t.registerRule(l=>new tj(n,l,i,s,a))}static getCompiledRuleId(t,n,i){return t.id||n.registerRule(s=>{if(t.id=s,t.match)return new nj(t.$vscodeTextmateLocation,t.id,t.name,t.match,hn._compileCaptures(t.captures,n,i));if(typeof t.begin>"u"){t.repository&&(i=tA({},i,t.repository));let a=t.patterns;return typeof a>"u"&&t.include&&(a=[{include:t.include}]),new sx(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,hn._compilePatterns(a,n,i))}return t.while?new pd(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,hn._compileCaptures(t.beginCaptures||t.captures,n,i),t.while,hn._compileCaptures(t.whileCaptures||t.captures,n,i),hn._compilePatterns(t.patterns,n,i)):new d_(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,hn._compileCaptures(t.beginCaptures||t.captures,n,i),t.end,hn._compileCaptures(t.endCaptures||t.captures,n,i),t.applyEndPatternLast,hn._compilePatterns(t.patterns,n,i))}),t.id}static _compileCaptures(t,n,i){let s=[];if(t){let a=0;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const u=parseInt(l,10);u>a&&(a=u)}for(let l=0;l<=a;l++)s[l]=null;for(const l in t){if(l==="$vscodeTextmateLocation")continue;const u=parseInt(l,10);let h=0;t[l].patterns&&(h=hn.getCompiledRuleId(t[l],n,i)),s[u]=hn.createCaptureRule(n,t[l].$vscodeTextmateLocation,t[l].name,t[l].contentName,h)}}return s}static _compilePatterns(t,n,i){let s=[];if(t)for(let a=0,l=t.length;a<l;a++){const u=t[a];let h=-1;if(u.include){const d=uA(u.include);switch(d.kind){case 0:case 1:h=hn.getCompiledRuleId(i[u.include],n,i);break;case 2:let p=i[d.ruleName];p&&(h=hn.getCompiledRuleId(p,n,i));break;case 3:case 4:const m=d.scopeName,_=d.kind===4?d.ruleName:null,y=n.getExternalGrammar(m,i);if(y)if(_){let b=y.repository[_];b&&(h=hn.getCompiledRuleId(b,n,y.repository))}else h=hn.getCompiledRuleId(y.repository.$self,n,y.repository);break}}else h=hn.getCompiledRuleId(u,n,i);if(h!==-1){const d=n.getRule(h);let p=!1;if((d instanceof sx||d instanceof d_||d instanceof pd)&&d.hasMissingPatterns&&d.patterns.length===0&&(p=!0),p)continue;s.push(h)}}return{patterns:s,hasMissingPatterns:(t?t.length:0)!==s.length}}},pc=class fA{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const i=t.length;let s=0,a=[],l=!1;for(let u=0;u<i;u++)if(t.charAt(u)==="\\"&&u+1<i){const d=t.charAt(u+1);d==="z"?(a.push(t.substring(s,u)),a.push("$(?!\\n)(?<!\\n)"),s=u+2):(d==="A"||d==="G")&&(l=!0),u++}this.hasAnchor=l,s===0?this.source=t:(a.push(t.substring(s,i)),this.source=a.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=J6.test(this.source):this.hasBackReferences=!1}clone(){return new fA(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let i=n.map(s=>t.substring(s.start,s.end));return rx.lastIndex=0,this.source.replace(rx,(s,a)=>sA(i[parseInt(a,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],i=[],s=[],a,l,u,h;for(a=0,l=this.source.length;a<l;a++)u=this.source.charAt(a),t[a]=u,n[a]=u,i[a]=u,s[a]=u,u==="\\"&&a+1<l&&(h=this.source.charAt(a+1),h==="A"?(t[a+1]="",n[a+1]="",i[a+1]="A",s[a+1]="A"):h==="G"?(t[a+1]="",n[a+1]="G",i[a+1]="",s[a+1]="G"):(t[a+1]=h,n[a+1]=h,i[a+1]=h,s[a+1]=h),a++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:i.join(""),A1_G1:s.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},mc=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new ox(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let i=this._items.map(s=>s.resolveAnchors(t,n));return new ox(e,i,this._items.map(s=>s.ruleId))}},ox=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
56
|
+
`)}findNextMatchSync(e,t,n){const i=this.scanner.findNextMatchSync(e,t,n);return i?{ruleId:this.rules[i.index],captureIndices:i.captureIndices}:null}},tg=class{constructor(e,t){this.languageId=e,this.tokenType=t}},ij=class f_{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new tg(t,8),this._embeddedLanguagesMatcher=new rj(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?f_._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new tg(0,0);_getBasicScopeAttributes=new oA(t=>{const n=this._scopeToLanguage(t),i=this._toStandardTokenType(t);return new tg(n,i)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(f_.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},rj=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,i])=>sA(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},ax=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function pA(e,t,n,i,s,a,l,u){const h=t.content.length;let d=!1,p=-1;if(l){const y=sj(e,t,n,i,s,a);s=y.stack,i=y.linePos,n=y.isFirstLine,p=y.anchorPosition}const m=Date.now();for(;!d;){if(u!==0&&Date.now()-m>u)return new ax(s,!0);_()}return new ax(s,!1);function _(){const y=oj(e,t,n,i,s,p);if(!y){a.produce(s,h),d=!0;return}const b=y.captureIndices,S=y.matchedRuleId,C=b&&b.length>0?b[0].end>i:!1;if(S===ej){const k=s.getRule(e);a.produce(s,b[0].start),s=s.withContentNameScopesList(s.nameScopesList),Zl(e,t,n,s,a,k.endCaptures,b),a.produce(s,b[0].end);const T=s;if(s=s.parent,p=T.getAnchorPos(),!C&&T.getEnterPos()===i){s=T,a.produce(s,h),d=!0;return}}else{const k=e.getRule(S);a.produce(s,b[0].start);const T=s,R=k.getName(t.content,b),A=s.contentNameScopesList.pushAttributed(R,e);if(s=s.push(S,i,p,b[0].end===h,null,A,A),k instanceof d_){const N=k;Zl(e,t,n,s,a,N.beginCaptures,b),a.produce(s,b[0].end),p=b[0].end;const V=N.getContentName(t.content,b),H=A.pushAttributed(V,e);if(s=s.withContentNameScopesList(H),N.endHasBackReferences&&(s=s.withEndRule(N.getEndWithResolvedBackReferences(t.content,b))),!C&&T.hasSameRuleAs(s)){s=s.pop(),a.produce(s,h),d=!0;return}}else if(k instanceof pd){const N=k;Zl(e,t,n,s,a,N.beginCaptures,b),a.produce(s,b[0].end),p=b[0].end;const V=N.getContentName(t.content,b),H=A.pushAttributed(V,e);if(s=s.withContentNameScopesList(H),N.whileHasBackReferences&&(s=s.withEndRule(N.getWhileWithResolvedBackReferences(t.content,b))),!C&&T.hasSameRuleAs(s)){s=s.pop(),a.produce(s,h),d=!0;return}}else if(Zl(e,t,n,s,a,k.captures,b),a.produce(s,b[0].end),s=s.pop(),!C){s=s.safePop(),a.produce(s,h),d=!0;return}}b[0].end>i&&(i=b[0].end,n=!1)}}function sj(e,t,n,i,s,a){let l=s.beginRuleCapturedEOL?0:-1;const u=[];for(let h=s;h;h=h.pop()){const d=h.getRule(e);d instanceof pd&&u.push({rule:d,stack:h})}for(let h=u.pop();h;h=u.pop()){const{ruleScanner:d,findOptions:p}=cj(h.rule,e,h.stack.endRule,n,i===l),m=d.findNextMatchSync(t,i,p);if(m){if(m.ruleId!==hA){s=h.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(a.produce(h.stack,m.captureIndices[0].start),Zl(e,t,n,h.stack,a,h.rule.whileCaptures,m.captureIndices),a.produce(h.stack,m.captureIndices[0].end),l=m.captureIndices[0].end,m.captureIndices[0].end>i&&(i=m.captureIndices[0].end,n=!1))}else{s=h.stack.pop();break}}return{stack:s,linePos:i,anchorPosition:l,isFirstLine:n}}function oj(e,t,n,i,s,a){const l=aj(e,t,n,i,s,a),u=e.getInjections();if(u.length===0)return l;const h=lj(u,e,t,n,i,s,a);if(!h)return l;if(!l)return h;const d=l.captureIndices[0].start,p=h.captureIndices[0].start;return p<d||h.priorityMatch&&p===d?h:l}function aj(e,t,n,i,s,a){const l=s.getRule(e),{ruleScanner:u,findOptions:h}=mA(l,e,s.endRule,n,i===a),d=u.findNextMatchSync(t,i,h);return d?{captureIndices:d.captureIndices,matchedRuleId:d.ruleId}:null}function lj(e,t,n,i,s,a,l){let u=Number.MAX_VALUE,h=null,d,p=0;const m=a.contentNameScopesList.getScopeNames();for(let _=0,y=e.length;_<y;_++){const b=e[_];if(!b.matcher(m))continue;const S=t.getRule(b.ruleId),{ruleScanner:C,findOptions:k}=mA(S,t,null,i,s===l),T=C.findNextMatchSync(n,s,k);if(!T)continue;const R=T.captureIndices[0].start;if(!(R>=u)&&(u=R,h=T.captureIndices,d=T.ruleId,p=b.priority,u===s))break}return h?{priorityMatch:p===-1,captureIndices:h,matchedRuleId:d}:null}function mA(e,t,n,i,s){return{ruleScanner:e.compileAG(t,n,i,s),findOptions:0}}function cj(e,t,n,i,s){return{ruleScanner:e.compileWhileAG(t,n,i,s),findOptions:0}}function Zl(e,t,n,i,s,a,l){if(a.length===0)return;const u=t.content,h=Math.min(a.length,l.length),d=[],p=l[0].end;for(let m=0;m<h;m++){const _=a[m];if(_===null)continue;const y=l[m];if(y.length===0)continue;if(y.start>p)break;for(;d.length>0&&d[d.length-1].endPos<=y.start;)s.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop();if(d.length>0?s.produceFromScopes(d[d.length-1].scopes,y.start):s.produce(i,y.start),_.retokenizeCapturedWithRuleId){const S=_.getName(u,l),C=i.contentNameScopesList.pushAttributed(S,e),k=_.getContentName(u,l),T=C.pushAttributed(k,e),R=i.push(_.retokenizeCapturedWithRuleId,y.start,-1,!1,null,C,T),A=e.createOnigString(u.substring(0,y.end));pA(e,A,n&&y.start===0,y.start,R,s,!1,0),cA(A);continue}const b=_.getName(u,l);if(b!==null){const C=(d.length>0?d[d.length-1].scopes:i.contentNameScopesList).pushAttributed(b,e);d.push(new uj(C,y.end))}}for(;d.length>0;)s.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}var uj=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function hj(e,t,n,i,s,a,l,u){return new fj(e,t,n,i,s,a,l,u)}function lx(e,t,n,i,s){const a=dd(t,md),l=dA.getCompiledRuleId(n,i,s.repository);for(const u of a)e.push({debugSelector:t,matcher:u.matcher,ruleId:l,grammar:s,priority:u.priority})}function md(e,t){if(t.length<e.length)return!1;let n=0;return e.every(i=>{for(let s=n;s<t.length;s++)if(dj(t[s],i))return n=s+1,!0;return!1})}function dj(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var fj=class{constructor(e,t,n,i,s,a,l,u){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=u,this._basicScopeAttributesProvider=new ij(n,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=l,this._grammar=cx(t,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const h of Object.keys(s)){const d=dd(h,md);for(const p of d)this._tokenTypeMatchers.push({matcher:p.matcher,type:s[h]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),injections:s=>this._grammarRepository.injections(s)},t=[],n=this._rootScopeName,i=e.lookup(n);if(i){const s=i.injections;if(s)for(let l in s)lx(t,l,s[l],this,i);const a=this._grammarRepository.injections(n);a&&a.forEach(l=>{const u=this.getExternalGrammar(l);if(u){const h=u.injectionSelector;h&&lx(t,h,u,this,u)}})}return t.sort((s,a)=>s.priority-a.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=cx(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const i=this._tokenize(e,t,!1,n);return{tokens:i.lineTokens.getResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}tokenizeLine2(e,t,n=0){const i=this._tokenize(e,t,!0,n);return{tokens:i.lineTokens.getBinaryResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}_tokenize(e,t,n,i){this._rootId===-1&&(this._rootId=dA.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!t||t===p_.NULL){s=!0;const d=this._basicScopeAttributesProvider.getDefaultAttributes(),p=this.themeProvider.getDefaults(),m=Da.set(0,d.languageId,d.tokenType,null,p.fontStyle,p.foregroundId,p.backgroundId),_=this.getRule(this._rootId).getName(null,null);let y;_?y=rc.createRootAndLookUpScopeName(_,m,this):y=rc.createRoot("unknown",m),t=new p_(null,this._rootId,-1,-1,!1,null,y,y)}else s=!1,t.reset();e=e+`
|
|
57
|
+
`;const a=this.createOnigString(e),l=a.content.length,u=new mj(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),h=pA(this,a,s,0,t,u,!0,i);return cA(a),{lineLength:l,lineTokens:u,ruleStack:h.stack,stoppedEarly:h.stoppedEarly}}};function cx(e,t){return e=N6(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var rc=class Oi{constructor(t,n,i){this.parent=t,this.scopePath=n,this.tokenAttributes=i}static fromExtension(t,n){let i=t,s=t?.scopePath??null;for(const a of n)s=eg.push(s,a.scopeNames),i=new Oi(i,s,a.encodedTokenAttributes);return i}static createRoot(t,n){return new Oi(null,new eg(null,t),n)}static createRootAndLookUpScopeName(t,n,i){const s=i.getMetadataForScope(t),a=new eg(null,t),l=i.themeProvider.themeMatch(a),u=Oi.mergeAttributes(n,s,l);return new Oi(null,a,u)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Oi.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,i){let s=-1,a=0,l=0;return i!==null&&(s=i.fontStyle,a=i.foregroundId,l=i.backgroundId),Da.set(t,n.languageId,n.tokenType,null,s,a,l)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Oi._pushAttributed(this,t,n);const i=t.split(/ /g);let s=this;for(const a of i)s=Oi._pushAttributed(s,a,n);return s}static _pushAttributed(t,n,i){const s=i.getMetadataForScope(n),a=t.scopePath.push(n),l=i.themeProvider.themeMatch(a),u=Oi.mergeAttributes(t.tokenAttributes,s,l);return new Oi(t,a,u)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let i=this;for(;i&&i!==t;)n.push({encodedTokenAttributes:i.tokenAttributes,scopeNames:i.scopePath.getExtensionIfDefined(i.parent?.scopePath??null)}),i=i.parent;return i===t?n.reverse():void 0}},p_=class Ks{constructor(t,n,i,s,a,l,u,h){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=a,this.endRule=l,this.nameScopesList=u,this.contentNameScopesList=h,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=i,this._anchorPos=s}_stackElementBrand=void 0;static NULL=new Ks(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:Ks._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?rc.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Ks._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,i,s,a,l,u){return new Ks(this,t,n,i,s,a,l,u)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Ks(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const i=rc.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new Ks(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,i,rc.fromExtension(i,n.contentNameScopesList))}},pj=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):dd(n,md).map(i=>i.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>dd(n,md).map(i=>i.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},mj=class{constructor(e,t,n,i){this.balancedBracketSelectors=i,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let i=e?.tokenAttributes??0,s=!1;if(this.balancedBracketSelectors?.matchesAlways&&(s=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const a=e?.getScopeNames()??[];for(const l of this._tokenTypeOverrides)l.matcher(a)&&(i=Da.set(i,0,l.type,null,-1,0,0));this.balancedBracketSelectors&&(s=this.balancedBracketSelectors.match(a))}if(s&&(i=Da.set(i,0,8,s,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===i){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(i),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let i=0,s=this._binaryTokens.length;i<s;i++)n[i]=this._binaryTokens[i];return n}},gj=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,i,s){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,hj(e,a,t,n,i,s,this,this._onigLib))}return this._grammars.get(e)}},_j=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new gj(hd.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(hd.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,i){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:i})}loadGrammarWithConfiguration(t,n,i){return this._loadGrammar(t,n,i.embeddedLanguages,i.tokenTypes,new pj(i.balancedBracketSelectors||[],i.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,i,s,a){const l=new G6(this._syncRegistry,t);for(;l.Q.length>0;)l.Q.map(u=>this._loadSingleGrammar(u.scopeName)),l.processQueue();return this._grammarForScopeName(t,n,i,s,a)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const i=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,i)}}addGrammar(t,n=[],i=0,s=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,i,s)}_grammarForScopeName(t,n=0,i=null,s=null,a=null){return this._syncRegistry.grammarForScopeName(t,n,i,s,a)}},m_=p_.NULL;function gd(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},i=typeof e=="string"?e:e.name;for(const[s,a]of Object.entries(t?.colorReplacements||{}))typeof a=="string"?n[s]=a:s===i&&Object.assign(n,a);return n}function fs(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function vj(e){return Array.isArray(e)?e:[e]}async function gA(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function tf(e){return!e||["plaintext","txt","text","plain"].includes(e)}function yj(e){return e==="ansi"||tf(e)}function nf(e){return e==="none"}function bj(e){return nf(e)}function rf(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(/(\r?\n)/g);let i=0;const s=[];for(let a=0;a<n.length;a+=2){const l=t?n[a]+(n[a+1]||""):n[a];s.push([l,i]),i+=n[a].length,i+=n[a+1]?.length||0}return s}const ux={light:"#333333",dark:"#bbbbbb"},hx={light:"#fffffe",dark:"#1e1e1e"},dx="__shiki_resolved";function ly(e){if(e?.[dx])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:i}=t;if(!n||!i){const u=t.settings?t.settings.find(h=>!h.name&&!h.scope):void 0;u?.settings?.foreground&&(i=u.settings.foreground),u?.settings?.background&&(n=u.settings.background),!i&&t?.colors?.["editor.foreground"]&&(i=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),i||(i=t.type==="light"?ux.light:ux.dark),n||(n=t.type==="light"?hx.light:hx.dark),t.fg=i,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let s=0;const a=new Map;function l(u){if(a.has(u))return a.get(u);s+=1;const h=`#${s.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${h}`]?l(u):(a.set(u,h),h)}t.settings=t.settings.map(u=>{const h=u.settings?.foreground&&!u.settings.foreground.startsWith("#"),d=u.settings?.background&&!u.settings.background.startsWith("#");if(!h&&!d)return u;const p={...u,settings:{...u.settings}};if(h){const m=l(u.settings.foreground);t.colorReplacements[m]=u.settings.foreground,p.settings.foreground=m}if(d){const m=l(u.settings.background);t.colorReplacements[m]=u.settings.background,p.settings.background=m}return p});for(const u of Object.keys(t.colors||{}))if((u==="editor.foreground"||u==="editor.background"||u.startsWith("terminal.ansi"))&&!t.colors[u]?.startsWith("#")){const h=l(t.colors[u]);t.colorReplacements[h]=t.colors[u],t.colors[u]=h}return Object.defineProperty(t,dx,{enumerable:!1,writable:!1,value:!0}),t}async function _A(e){return Array.from(new Set((await Promise.all(e.filter(t=>!yj(t)).map(async t=>await gA(t).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function vA(e){return(await Promise.all(e.map(async t=>bj(t)?null:ly(await gA(t))))).filter(t=>!!t)}function yA(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new ft(`Circular alias \`${Array.from(n).join(" -> ")} -> ${e}\``);n.add(e)}}return e}var Sj=class extends _j{_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,i={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=i,this._themes.map(s=>this.loadTheme(s)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=ly(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=hd.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=yA(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(s=>s.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const i=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(i.name=e.name,this._resolvedGrammars.set(e.name,i),e.aliases&&e.aliases.forEach(s=>{this._alias[s]=e.name}),this._loadedLanguagesCache=null,t.size)for(const s of t)this._resolvedGrammars.delete(s.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(s.scopeName),this._syncRegistry?._grammars?.delete(s.scopeName),this.loadLanguage(this._langMap.get(s.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const i of e)this.resolveEmbeddedLanguages(i);const t=Array.from(this._langGraph.entries()),n=t.filter(([i,s])=>!s);if(n.length){const i=t.filter(([s,a])=>a?(a.embeddedLanguages||a.embeddedLangs)?.some(l=>n.map(([u])=>u).includes(l)):!1).filter(s=>!n.includes(s));throw new ft(`Missing languages ${n.map(([s])=>`\`${s}\``).join(", ")}, required by ${i.map(([s])=>`\`${s}\``).join(", ")}`)}for(const[i,s]of t)this._resolver.addLanguage(s);for(const[i,s]of t)this.loadLanguage(s)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const n of t)this._langGraph.set(n,this._langMap.get(n))}},wj=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let i=1;i<=t.length;i++){const s=t.slice(0,i).join(".");n=[...n,...this._injections.get(s)||[]]}return n}};let Vl=0;function xj(e){Vl+=1,e.warnings!==!1&&Vl>=10&&Vl%10===0&&console.warn(`[Shiki] ${Vl} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new ft("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),i=(e.themes||[]).flat(1).map(ly),s=new Sj(new wj(e.engine,n),i,n,e.langAlias);let a;function l(T){return yA(T,e.langAlias)}function u(T){C();const R=s.getGrammar(typeof T=="string"?T:T.name);if(!R)throw new ft(`Language \`${T}\` not found, you may need to load it first`);return R}function h(T){if(T==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};C();const R=s.getTheme(T);if(!R)throw new ft(`Theme \`${T}\` not found, you may need to load it first`);return R}function d(T){C();const R=h(T);return a!==T&&(s.setTheme(R),a=T),{theme:R,colorMap:s.getColorMap()}}function p(){return C(),s.getLoadedThemes()}function m(){return C(),s.getLoadedLanguages()}function _(...T){C(),s.loadLanguages(T.flat(1))}async function y(...T){return _(await _A(T))}function b(...T){C();for(const R of T.flat(1))s.loadTheme(R)}async function S(...T){return C(),b(await vA(T))}function C(){if(t)throw new ft("Shiki instance has been disposed")}function k(){t||(t=!0,s.dispose(),Vl-=1)}return{setTheme:d,getTheme:h,getLanguage:u,getLoadedThemes:p,getLoadedLanguages:m,resolveLangAlias:l,loadLanguage:y,loadLanguageSync:_,loadTheme:S,loadThemeSync:b,dispose:k,[Symbol.dispose]:k}}async function Cj(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,i]=await Promise.all([vA(e.themes||[]),_A(e.langs||[]),e.engine]);return xj({...e,themes:t,langs:n,engine:i})}const bA=new WeakMap;function sf(e,t){bA.set(e,t)}function gc(e){return bA.get(e)}var of=class SA{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new SA(Object.fromEntries(vj(n).map(i=>[i,m_])),t)}constructor(...t){if(t.length===2){const[n,i]=t;this.lang=i,this._stacks=n}else{const[n,i,s]=t;this.lang=i,this._stacks={[s]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return Ej(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Ej(e){const t=[],n=new Set;function i(s){if(n.has(s))return;n.add(s);const a=s?.nameScopesList?.scopeName;a&&t.push(a),s.parent&&i(s.parent)}return i(e),t}function kj(e,t){if(!(e instanceof of))throw new ft("Invalid grammar state");return e.getInternalStack(t)}function wA(e,t,n={}){const{theme:i=e.getLoadedThemes()[0]}=n;if(tf(e.resolveLangAlias(n.lang||"text"))||nf(i))return rf(t).map(u=>[{content:u[0],offset:u[1]}]);const{theme:s,colorMap:a}=e.setTheme(i),l=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==l.name)throw new ft(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${l.name}"`);if(!n.grammarState.themes.includes(s.name))throw new ft(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return Aj(t,l,s,a,n)}function Tj(...e){if(e.length===2)return gc(e[1]);const[t,n,i={}]=e,{lang:s="text",theme:a=t.getLoadedThemes()[0]}=i;if(tf(s)||nf(a))throw new ft("Plain language does not have grammar state");if(s==="ansi")throw new ft("ANSI language does not have grammar state");const{theme:l,colorMap:u}=t.setTheme(a),h=t.getLanguage(s);return new of(cy(n,h,l,u,i).stateStack,h.name,l.name)}function Aj(e,t,n,i,s){const a=cy(e,t,n,i,s),l=new of(a.stateStack,t.name,n.name);return sf(a.tokens,l),a.tokens}function cy(e,t,n,i,s){const a=gd(n,s),{tokenizeMaxLineLength:l=0,tokenizeTimeLimit:u=500}=s,h=rf(e);let d=s.grammarState?kj(s.grammarState,n.name)??m_:s.grammarContextCode!=null?cy(s.grammarContextCode,t,n,i,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:m_,p=[];const m=[];for(let _=0,y=h.length;_<y;_++){const[b,S]=h[_];if(b===""){p=[],m.push([]);continue}if(l>0&&b.length>=l){p=[],m.push([{content:b,offset:S,color:"",fontStyle:0}]);continue}let C,k,T;s.includeExplanation&&(C=t.tokenizeLine(b,d,u),k=C.tokens,T=0);const R=t.tokenizeLine2(b,d,u),A=R.tokens.length/2;for(let N=0;N<A;N++){const V=R.tokens[2*N],H=N+1<A?R.tokens[2*N+2]:b.length;if(V===H)continue;const z=R.tokens[2*N+1],J=fs(i[Da.getForeground(z)],a),$=Da.getFontStyle(z),K={content:b.substring(V,H),offset:S+V,color:J,fontStyle:$};if(s.includeExplanation){const I=[];if(s.includeExplanation!=="scopeName")for(const B of n.settings){let W;switch(typeof B.scope){case"string":W=B.scope.split(/,/).map(M=>M.trim());break;case"object":W=B.scope;break;default:continue}I.push({settings:B,selectors:W.map(M=>M.split(/ /))})}K.explanation=[];let P=0;for(;V+P<H;){const B=k[T],W=b.substring(B.startIndex,B.endIndex);P+=W.length,K.explanation.push({content:W,scopes:s.includeExplanation==="scopeName"?Rj(B.scopes):Mj(I,B.scopes)}),T+=1}}p.push(K)}m.push(p),p=[],d=R.ruleStack}return{tokens:m,stateStack:d}}function Rj(e){return e.map(t=>({scopeName:t}))}function Mj(e,t){const n=[];for(let i=0,s=t.length;i<s;i++){const a=t[i];n[i]={scopeName:a,themeMatches:Nj(e,a,t.slice(0,i))}}return n}function fx(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function Dj(e,t,n){if(!fx(e[e.length-1],t))return!1;let i=e.length-2,s=n.length-1;for(;i>=0&&s>=0;)fx(e[i],n[s])&&(i-=1),s-=1;return i===-1}function Nj(e,t,n){const i=[];for(const{selectors:s,settings:a}of e)for(const l of s)if(Dj(l,t,n)){i.push(a);break}return i}function xA(e,t,n,i=wA){const s=Object.entries(n.themes).filter(d=>d[1]).map(d=>({color:d[0],theme:d[1]})),a=s.map(d=>{const p=i(e,t,{...n,theme:d.theme});return{tokens:p,state:gc(p),theme:typeof d.theme=="string"?d.theme:d.theme.name}}),l=Oj(...a.map(d=>d.tokens)),u=l[0].map((d,p)=>d.map((m,_)=>{const y={content:m.content,variants:{},offset:m.offset};return"includeExplanation"in n&&n.includeExplanation&&(y.explanation=m.explanation),l.forEach((b,S)=>{const{content:C,explanation:k,offset:T,...R}=b[p][_];y.variants[s[S].color]=R}),y})),h=a[0].state?new of(Object.fromEntries(a.map(d=>[d.theme,d.state?.getInternalStack(d.theme)])),a[0].state.lang):void 0;return h&&sf(u,h),u}function Oj(...e){const t=e.map(()=>[]),n=e.length;for(let i=0;i<e[0].length;i++){const s=e.map(h=>h[i]),a=t.map(()=>[]);t.forEach((h,d)=>h.push(a[d]));const l=s.map(()=>0),u=s.map(h=>h[0]);for(;u.every(h=>h);){const h=Math.min(...u.map(d=>d.content.length));for(let d=0;d<n;d++){const p=u[d];p.content.length===h?(a[d].push(p),l[d]+=1,u[d]=s[d][l[d]]):(a[d].push({...p,content:p.content.slice(0,h)}),u[d]={...p,content:p.content.slice(h),offset:p.offset+h})}}}return t}const Lj=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Mc{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}Mc.prototype.normal={};Mc.prototype.property={};Mc.prototype.space=void 0;function CA(e,t){const n={},i={};for(const s of e)Object.assign(n,s.property),Object.assign(i,s.normal);return new Mc(n,i,t)}function g_(e){return e.toLowerCase()}class Mn{constructor(t,n){this.attribute=n,this.property=t}}Mn.prototype.attribute="";Mn.prototype.booleanish=!1;Mn.prototype.boolean=!1;Mn.prototype.commaOrSpaceSeparated=!1;Mn.prototype.commaSeparated=!1;Mn.prototype.defined=!1;Mn.prototype.mustUseProperty=!1;Mn.prototype.number=!1;Mn.prototype.overloadedBoolean=!1;Mn.prototype.property="";Mn.prototype.spaceSeparated=!1;Mn.prototype.space=void 0;let Pj=0;const Ie=_o(),Nt=_o(),__=_o(),me=_o(),ot=_o(),xa=_o(),Un=_o();function _o(){return 2**++Pj}const v_=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Nt,commaOrSpaceSeparated:Un,commaSeparated:xa,number:me,overloadedBoolean:__,spaceSeparated:ot},Symbol.toStringTag,{value:"Module"})),ng=Object.keys(v_);class uy extends Mn{constructor(t,n,i,s){let a=-1;if(super(t,n),px(this,"space",s),typeof i=="number")for(;++a<ng.length;){const l=ng[a];px(this,ng[a],(i&v_[l])===v_[l])}}}uy.prototype.defined=!0;function px(e,t,n){n&&(e[t]=n)}function ja(e){const t={},n={};for(const[i,s]of Object.entries(e.properties)){const a=new uy(i,e.transform(e.attributes||{},i),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(a.mustUseProperty=!0),t[i]=a,n[g_(i)]=i,n[g_(a.attribute)]=i}return new Mc(t,n,e.space)}const EA=ja({properties:{ariaActiveDescendant:null,ariaAtomic:Nt,ariaAutoComplete:null,ariaBusy:Nt,ariaChecked:Nt,ariaColCount:me,ariaColIndex:me,ariaColSpan:me,ariaControls:ot,ariaCurrent:null,ariaDescribedBy:ot,ariaDetails:null,ariaDisabled:Nt,ariaDropEffect:ot,ariaErrorMessage:null,ariaExpanded:Nt,ariaFlowTo:ot,ariaGrabbed:Nt,ariaHasPopup:null,ariaHidden:Nt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ot,ariaLevel:me,ariaLive:null,ariaModal:Nt,ariaMultiLine:Nt,ariaMultiSelectable:Nt,ariaOrientation:null,ariaOwns:ot,ariaPlaceholder:null,ariaPosInSet:me,ariaPressed:Nt,ariaReadOnly:Nt,ariaRelevant:null,ariaRequired:Nt,ariaRoleDescription:ot,ariaRowCount:me,ariaRowIndex:me,ariaRowSpan:me,ariaSelected:Nt,ariaSetSize:me,ariaSort:null,ariaValueMax:me,ariaValueMin:me,ariaValueNow:me,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function kA(e,t){return t in e?e[t]:t}function TA(e,t){return kA(e,t.toLowerCase())}const Bj=ja({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:xa,acceptCharset:ot,accessKey:ot,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:ot,autoFocus:Ie,autoPlay:Ie,blocking:ot,capture:null,charSet:null,checked:Ie,cite:null,className:ot,cols:me,colSpan:null,content:null,contentEditable:Nt,controls:Ie,controlsList:ot,coords:me|xa,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:__,draggable:Nt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:ot,height:me,hidden:__,high:me,href:null,hrefLang:null,htmlFor:ot,httpEquiv:ot,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:ot,itemRef:ot,itemScope:Ie,itemType:ot,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:me,manifest:null,max:null,maxLength:me,media:null,method:null,min:null,minLength:me,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ie,optimum:me,pattern:null,ping:ot,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:ot,required:Ie,reversed:Ie,rows:me,rowSpan:me,sandbox:ot,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shape:null,size:me,sizes:null,slot:null,span:me,spellCheck:Nt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:me,step:null,style:null,tabIndex:me,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Nt,width:me,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ot,axis:null,background:null,bgColor:null,border:me,borderColor:null,bottomMargin:me,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:me,leftMargin:me,link:null,longDesc:null,lowSrc:null,marginHeight:me,marginWidth:me,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:me,rules:null,scheme:null,scrolling:Nt,standby:null,summary:null,text:null,topMargin:me,valueType:null,version:null,vAlign:null,vLink:null,vSpace:me,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ie,disableRemotePlayback:Ie,prefix:null,property:null,results:me,security:null,unselectable:null},space:"html",transform:TA}),Ij=ja({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Un,accentHeight:me,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:me,amplitude:me,arabicForm:null,ascent:me,attributeName:null,attributeType:null,azimuth:me,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:me,by:null,calcMode:null,capHeight:me,className:ot,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:me,diffuseConstant:me,direction:null,display:null,dur:null,divisor:me,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:me,enableBackground:null,end:null,event:null,exponent:me,externalResourcesRequired:null,fill:null,fillOpacity:me,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:xa,g2:xa,glyphName:xa,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:me,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:me,horizOriginX:me,horizOriginY:me,id:null,ideographic:me,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:me,k:me,k1:me,k2:me,k3:me,k4:me,kernelMatrix:Un,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:me,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:me,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:me,overlineThickness:me,paintOrder:null,panose1:null,path:null,pathLength:me,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ot,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:me,pointsAtY:me,pointsAtZ:me,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Un,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Un,rev:Un,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Un,requiredFeatures:Un,requiredFonts:Un,requiredFormats:Un,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:me,specularExponent:me,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:me,strikethroughThickness:me,string:null,stroke:null,strokeDashArray:Un,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:me,strokeOpacity:me,strokeWidth:null,style:null,surfaceScale:me,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Un,tabIndex:me,tableValues:null,target:null,targetX:me,targetY:me,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Un,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:me,underlineThickness:me,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:me,values:null,vAlphabetic:me,vMathematical:me,vectorEffect:null,vHanging:me,vIdeographic:me,version:null,vertAdvY:me,vertOriginX:me,vertOriginY:me,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:me,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:kA}),AA=ja({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),RA=ja({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:TA}),MA=ja({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),jj=/[A-Z]/g,mx=/-[a-z]/g,zj=/^data[-\w.:]+$/i;function Hj(e,t){const n=g_(t);let i=t,s=Mn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&zj.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(mx,Uj);i="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!mx.test(a)){let l=a.replace(jj,Vj);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}s=uy}return new s(i,t)}function Vj(e){return"-"+e.toLowerCase()}function Uj(e){return e.charAt(1).toUpperCase()}const Fj=CA([EA,Bj,AA,RA,MA],"html"),DA=CA([EA,Ij,AA,RA,MA],"svg"),gx={}.hasOwnProperty;function $j(e,t){const n=t||{};function i(s,...a){let l=i.invalid;const u=i.handlers;if(s&&gx.call(s,e)){const h=String(s[e]);l=gx.call(u,h)?u[h]:i.unknown}if(l)return l.call(this,s,...a)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}const Wj=/["&'<>`]/g,Gj=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,qj=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Kj=/[|\\{}()[\]^$+*?.]/g,_x=new WeakMap;function Yj(e,t){if(e=e.replace(t.subset?Xj(t.subset):Wj,i),t.subset||t.escapeOnly)return e;return e.replace(Gj,n).replace(qj,i);function n(s,a,l){return t.format((s.charCodeAt(0)-55296)*1024+s.charCodeAt(1)-56320+65536,l.charCodeAt(a+2),t)}function i(s,a,l){return t.format(s.charCodeAt(0),l.charCodeAt(a+1),t)}}function Xj(e){let t=_x.get(e);return t||(t=Zj(e),_x.set(e,t)),t}function Zj(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Kj,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Qj=/[\dA-Fa-f]/;function Jj(e,t,n){const i="&#x"+e.toString(16).toUpperCase();return n&&t&&!Qj.test(String.fromCharCode(t))?i:i+";"}const ez=/\d/;function tz(e,t,n){const i="&#"+String(e);return n&&t&&!ez.test(String.fromCharCode(t))?i:i+";"}const nz=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],ig={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},iz=["cent","copy","divide","gt","lt","not","para","times"],NA={}.hasOwnProperty,y_={};let ph;for(ph in ig)NA.call(ig,ph)&&(y_[ig[ph]]=ph);const rz=/[^\dA-Za-z]/;function sz(e,t,n,i){const s=String.fromCharCode(e);if(NA.call(y_,s)){const a=y_[s],l="&"+a;return n&&nz.includes(a)&&!iz.includes(a)&&(!i||t&&t!==61&&rz.test(String.fromCharCode(t)))?l:l+";"}return""}function oz(e,t,n){let i=Jj(e,t,n.omitOptionalSemicolons),s;if((n.useNamedReferences||n.useShortestReferences)&&(s=sz(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!s)&&n.useShortestReferences){const a=tz(e,t,n.omitOptionalSemicolons);a.length<i.length&&(i=a)}return s&&(!n.useShortestReferences||s.length<i.length)?s:i}function Ca(e,t){return Yj(e,Object.assign({format:oz},t))}const az=/^>|^->|<!--|-->|--!>|<!-$/g,lz=[">"],cz=["<",">"];function uz(e,t,n,i){return i.settings.bogusComments?"<?"+Ca(e.value,Object.assign({},i.settings.characterReferences,{subset:lz}))+">":"<!--"+e.value.replace(az,s)+"-->";function s(a){return Ca(a,Object.assign({},i.settings.characterReferences,{subset:cz}))}}function hz(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"}function vx(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,s=n.indexOf(t);for(;s!==-1;)i++,s=n.indexOf(t,s+t.length);return i}function dz(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function fz(e){return e.join(" ").trim()}const pz=/[ \t\n\f\r]/g;function hy(e){return typeof e=="object"?e.type==="text"?yx(e.value):!1:yx(e)}function yx(e){return e.replace(pz,"")===""}const $t=LA(1),OA=LA(-1),mz=[];function LA(e){return t;function t(n,i,s){const a=n?n.children:mz;let l=(i||0)+e,u=a[l];if(!s)for(;u&&hy(u);)l+=e,u=a[l];return u}}const gz={}.hasOwnProperty;function PA(e){return t;function t(n,i,s){return gz.call(e,n.tagName)&&e[n.tagName](n,i,s)}}const dy=PA({body:vz,caption:rg,colgroup:rg,dd:wz,dt:Sz,head:rg,html:_z,li:bz,optgroup:xz,option:Cz,p:yz,rp:bx,rt:bx,tbody:kz,td:Sx,tfoot:Tz,th:Sx,thead:Ez,tr:Az});function rg(e,t,n){const i=$t(n,t,!0);return!i||i.type!=="comment"&&!(i.type==="text"&&hy(i.value.charAt(0)))}function _z(e,t,n){const i=$t(n,t);return!i||i.type!=="comment"}function vz(e,t,n){const i=$t(n,t);return!i||i.type!=="comment"}function yz(e,t,n){const i=$t(n,t);return i?i.type==="element"&&(i.tagName==="address"||i.tagName==="article"||i.tagName==="aside"||i.tagName==="blockquote"||i.tagName==="details"||i.tagName==="div"||i.tagName==="dl"||i.tagName==="fieldset"||i.tagName==="figcaption"||i.tagName==="figure"||i.tagName==="footer"||i.tagName==="form"||i.tagName==="h1"||i.tagName==="h2"||i.tagName==="h3"||i.tagName==="h4"||i.tagName==="h5"||i.tagName==="h6"||i.tagName==="header"||i.tagName==="hgroup"||i.tagName==="hr"||i.tagName==="main"||i.tagName==="menu"||i.tagName==="nav"||i.tagName==="ol"||i.tagName==="p"||i.tagName==="pre"||i.tagName==="section"||i.tagName==="table"||i.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function bz(e,t,n){const i=$t(n,t);return!i||i.type==="element"&&i.tagName==="li"}function Sz(e,t,n){const i=$t(n,t);return!!(i&&i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd"))}function wz(e,t,n){const i=$t(n,t);return!i||i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd")}function bx(e,t,n){const i=$t(n,t);return!i||i.type==="element"&&(i.tagName==="rp"||i.tagName==="rt")}function xz(e,t,n){const i=$t(n,t);return!i||i.type==="element"&&i.tagName==="optgroup"}function Cz(e,t,n){const i=$t(n,t);return!i||i.type==="element"&&(i.tagName==="option"||i.tagName==="optgroup")}function Ez(e,t,n){const i=$t(n,t);return!!(i&&i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot"))}function kz(e,t,n){const i=$t(n,t);return!i||i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot")}function Tz(e,t,n){return!$t(n,t)}function Az(e,t,n){const i=$t(n,t);return!i||i.type==="element"&&i.tagName==="tr"}function Sx(e,t,n){const i=$t(n,t);return!i||i.type==="element"&&(i.tagName==="td"||i.tagName==="th")}const Rz=PA({body:Nz,colgroup:Oz,head:Dz,html:Mz,tbody:Lz});function Mz(e){const t=$t(e,-1);return!t||t.type!=="comment"}function Dz(e){const t=new Set;for(const i of e.children)if(i.type==="element"&&(i.tagName==="base"||i.tagName==="title")){if(t.has(i.tagName))return!1;t.add(i.tagName)}const n=e.children[0];return!n||n.type==="element"}function Nz(e){const t=$t(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&hy(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Oz(e,t,n){const i=OA(n,t),s=$t(e,-1,!0);return n&&i&&i.type==="element"&&i.tagName==="colgroup"&&dy(i,n.children.indexOf(i),n)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function Lz(e,t,n){const i=OA(n,t),s=$t(e,-1);return n&&i&&i.type==="element"&&(i.tagName==="thead"||i.tagName==="tbody")&&dy(i,n.children.indexOf(i),n)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const mh={name:[[`
|
|
58
|
+
\f\r &/=>`.split(""),`
|
|
59
|
+
\f\r "&'/=>\``.split("")],[`\0
|
|
60
|
+
\f\r "&'/<=>`.split(""),`\0
|
|
61
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
62
|
+
\f\r &>`.split(""),`\0
|
|
63
|
+
\f\r "&'<=>\``.split("")],[`\0
|
|
64
|
+
\f\r "&'<=>\``.split(""),`\0
|
|
65
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Pz(e,t,n,i){const s=i.schema,a=s.space==="svg"?!1:i.settings.omitOptionalTags;let l=s.space==="svg"?i.settings.closeEmptyElements:i.settings.voids.includes(e.tagName.toLowerCase());const u=[];let h;s.space==="html"&&e.tagName==="svg"&&(i.schema=DA);const d=Bz(i,e.properties),p=i.all(s.space==="html"&&e.tagName==="template"?e.content:e);return i.schema=s,p&&(l=!1),(d||!a||!Rz(e,t,n))&&(u.push("<",e.tagName,d?" "+d:""),l&&(s.space==="svg"||i.settings.closeSelfClosing)&&(h=d.charAt(d.length-1),(!i.settings.tightSelfClosing||h==="/"||h&&h!=='"'&&h!=="'")&&u.push(" "),u.push("/")),u.push(">")),u.push(p),!l&&(!a||!dy(e,t,n))&&u.push("</"+e.tagName+">"),u.join("")}function Bz(e,t){const n=[];let i=-1,s;if(t){for(s in t)if(t[s]!==null&&t[s]!==void 0){const a=Iz(e,s,t[s]);a&&n.push(a)}}for(;++i<n.length;){const a=e.settings.tightAttributes?n[i].charAt(n[i].length-1):void 0;i!==n.length-1&&a!=='"'&&a!=="'"&&(n[i]+=" ")}return n.join("")}function Iz(e,t,n){const i=Hj(e.schema,t),s=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,a=e.settings.allowDangerousCharacters?0:1;let l=e.quote,u;if(i.overloadedBoolean&&(n===i.attribute||n==="")?n=!0:(i.boolean||i.overloadedBoolean)&&(typeof n!="string"||n===i.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const h=Ca(i.attribute,Object.assign({},e.settings.characterReferences,{subset:mh.name[s][a]}));return n===!0||(n=Array.isArray(n)?(i.commaSeparated?dz:fz)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?h:(e.settings.preferUnquoted&&(u=Ca(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:mh.unquoted[s][a]}))),u!==n&&(e.settings.quoteSmart&&vx(n,l)>vx(n,e.alternative)&&(l=e.alternative),u=l+Ca(n,Object.assign({},e.settings.characterReferences,{subset:(l==="'"?mh.single:mh.double)[s][a],attribute:!0}))+l),h+(u&&"="+u))}const jz=["<","&"];function BA(e,t,n,i){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Ca(e.value,Object.assign({},i.settings.characterReferences,{subset:jz}))}function zz(e,t,n,i){return i.settings.allowDangerousHtml?e.value:BA(e,t,n,i)}function Hz(e,t,n,i){return i.all(e)}const Vz=$j("type",{invalid:Uz,unknown:Fz,handlers:{comment:uz,doctype:hz,element:Pz,raw:zz,root:Hz,text:BA}});function Uz(e){throw new Error("Expected node, not `"+e+"`")}function Fz(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const $z={},Wz={},Gz=[];function qz(e,t){const n=t||$z,i=n.quote||'"',s=i==='"'?"'":'"';if(i!=='"'&&i!=="'")throw new Error("Invalid quote `"+i+"`, expected `'` or `\"`");return{one:Kz,all:Yz,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Lj,characterReferences:n.characterReferences||Wz,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?DA:Fj,quote:i,alternative:s}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Kz(e,t,n){return Vz(e,t,n,this)}function Yz(e){const t=[],n=e&&e.children||Gz;let i=-1;for(;++i<n.length;)t[i]=this.one(n[i],i,e);return t.join("")}function IA(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(/\s+/g);for(const i of n)i&&!e.properties.class.includes(i)&&e.properties.class.push(i);return e}function Xz(e){const t=rf(e,!0).map(([s])=>s);function n(s){if(s===e.length)return{line:t.length-1,character:t[t.length-1].length};let a=s,l=0;for(const u of t){if(a<u.length)break;a-=u.length,l++}return{line:l,character:a}}function i(s,a){let l=0;for(let u=0;u<s;u++)l+=t[u].length;return l+=a,l}return{lines:t,indexToPos:n,posToIndex:i}}const fy="light-dark()",Zz=["color","background-color"];function Qz(e,t){let n=0;const i=[];for(const s of t)s>n&&i.push({...e,content:e.content.slice(n,s),offset:e.offset+n}),n=s;return n<e.content.length&&i.push({...e,content:e.content.slice(n),offset:e.offset+n}),i}function Jz(e,t){const n=Array.from(t instanceof Set?t:new Set(t)).sort((i,s)=>i-s);return n.length?e.map(i=>i.flatMap(s=>{const a=n.filter(l=>s.offset<l&&l<s.offset+s.content.length).map(l=>l-s.offset).sort((l,u)=>l-u);return a.length?Qz(s,a):s})):e}function e8(e,t,n,i,s="css-vars"){const a={content:e.content,explanation:e.explanation,offset:e.offset},l=t.map(p=>_d(e.variants[p])),u=new Set(l.flatMap(p=>Object.keys(p))),h={},d=(p,m)=>{const _=m==="color"?"":m==="background-color"?"-bg":`-${m}`;return n+t[p]+(m==="color"?"":_)};return l.forEach((p,m)=>{for(const _ of u){const y=p[_]||"inherit";if(m===0&&i&&Zz.includes(_))if(i===fy&&l.length>1){const b=t.findIndex(C=>C==="light"),S=t.findIndex(C=>C==="dark");if(b===-1||S===-1)throw new ft('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');h[_]=`light-dark(${l[b][_]||"inherit"}, ${l[S][_]||"inherit"})`,s==="css-vars"&&(h[d(m,_)]=y)}else h[_]=y;else s==="css-vars"&&(h[d(m,_)]=y)}}),a.htmlStyle=h,a}function _d(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&fn.Italic&&(t["font-style"]="italic"),e.fontStyle&fn.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&fn.Underline&&n.push("underline"),e.fontStyle&fn.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function b_(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function t8(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let a=function(u){if(typeof u=="number"){if(u<0||u>n.source.length)throw new ft(`Invalid decoration offset: ${u}. Code length: ${n.source.length}`);return{...s.indexToPos(u),offset:u}}else{const h=s.lines[u.line];if(h===void 0)throw new ft(`Invalid decoration position ${JSON.stringify(u)}. Lines length: ${s.lines.length}`);let d=u.character;if(d<0&&(d=h.length+d),d<0||d>h.length)throw new ft(`Invalid decoration position ${JSON.stringify(u)}. Line ${u.line} length: ${h.length}`);return{...u,character:d,offset:s.posToIndex(u.line,d)}}};var i=a;const s=Xz(n.source),l=(n.options.decorations||[]).map(u=>({...u,start:a(u.start),end:a(u.end)}));n8(l),e.set(n.meta,{decorations:l,converter:s,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return Jz(n,t(this).decorations.flatMap(i=>[i.start.offset,i.end.offset]))},code(n){if(!this.options.decorations?.length)return;const i=t(this),s=Array.from(n.children).filter(p=>p.type==="element"&&p.tagName==="span");if(s.length!==i.converter.lines.length)throw new ft(`Number of lines in code element (${s.length}) does not match the number of lines in the source (${i.converter.lines.length}). Failed to apply decorations.`);function a(p,m,_,y){const b=s[p];let S="",C=-1,k=-1;if(m===0&&(C=0),_===0&&(k=0),_===Number.POSITIVE_INFINITY&&(k=b.children.length),C===-1||k===-1)for(let R=0;R<b.children.length;R++)S+=jA(b.children[R]),C===-1&&S.length===m&&(C=R+1),k===-1&&S.length===_&&(k=R+1);if(C===-1)throw new ft(`Failed to find start index for decoration ${JSON.stringify(y.start)}`);if(k===-1)throw new ft(`Failed to find end index for decoration ${JSON.stringify(y.end)}`);const T=b.children.slice(C,k);if(!y.alwaysWrap&&T.length===b.children.length)u(b,y,"line");else if(!y.alwaysWrap&&T.length===1&&T[0].type==="element")u(T[0],y,"token");else{const R={type:"element",tagName:"span",properties:{},children:T};u(R,y,"wrapper"),b.children.splice(C,T.length,R)}}function l(p,m){s[p]=u(s[p],m,"line")}function u(p,m,_){const y=m.properties||{},b=m.transform||(S=>S);return p.tagName=m.tagName||"span",p.properties={...p.properties,...y,class:p.properties.class},m.properties?.class&&IA(p,m.properties.class),p=b(p,_)||p,p}const h=[],d=i.decorations.sort((p,m)=>m.start.offset-p.start.offset||p.end.offset-m.end.offset);for(const p of d){const{start:m,end:_}=p;if(m.line===_.line)a(m.line,m.character,_.character,p);else if(m.line<_.line){a(m.line,m.character,Number.POSITIVE_INFINITY,p);for(let y=m.line+1;y<_.line;y++)h.unshift(()=>l(y,p));a(_.line,0,_.character,p)}}h.forEach(p=>p())}}}function n8(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new ft(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let i=t+1;i<e.length;i++){const s=e[i],a=n.start.offset<=s.start.offset&&s.start.offset<n.end.offset,l=n.start.offset<s.end.offset&&s.end.offset<=n.end.offset,u=s.start.offset<=n.start.offset&&n.start.offset<s.end.offset,h=s.start.offset<n.end.offset&&n.end.offset<=s.end.offset;if(a||l||u||h){if(a&&l||u&&h||u&&n.start.offset===n.end.offset||l&&s.start.offset===s.end.offset)continue;throw new ft(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(s.start)} intersect.`)}}}}function jA(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(jA).join(""):""}const i8=[t8()];function vd(e){const t=r8(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...i8]}function r8(e){const t=[],n=[],i=[];for(const s of e)switch(s.enforce){case"pre":t.push(s);break;case"post":n.push(s);break;default:i.push(s)}return{pre:t,post:n,normal:i}}var eo=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],sg={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function s8(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const i=e.indexOf("m",n);if(i!==-1)return{sequence:e.substring(n+2,i).split(";"),startPosition:n,position:i+1}}return{position:e.length}}function wx(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(i=>Number.parseInt(i));return n.length!==3||n.some(i=>Number.isNaN(i))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function o8(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const i=Number.parseInt(n);if(!Number.isNaN(i))if(i===0)t.push({type:"resetAll"});else if(i<=9)sg[i]&&t.push({type:"setDecoration",value:sg[i]});else if(i<=29){const s=sg[i-20];s&&(t.push({type:"resetDecoration",value:s}),s==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(i<=37)t.push({type:"setForegroundColor",value:{type:"named",name:eo[i-30]}});else if(i===38){const s=wx(e);s&&t.push({type:"setForegroundColor",value:s})}else if(i===39)t.push({type:"resetForegroundColor"});else if(i<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:eo[i-40]}});else if(i===48){const s=wx(e);s&&t.push({type:"setBackgroundColor",value:s})}else i===49?t.push({type:"resetBackgroundColor"}):i===53?t.push({type:"setDecoration",value:"overline"}):i===55?t.push({type:"resetDecoration",value:"overline"}):i>=90&&i<=97?t.push({type:"setForegroundColor",value:{type:"named",name:eo[i-90+8]}}):i>=100&&i<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:eo[i-100+8]}})}return t}function a8(){let e=null,t=null,n=new Set;return{parse(i){const s=[];let a=0;do{const l=s8(i,a),u=l.sequence?i.substring(a,l.startPosition):i.substring(a);if(u.length>0&&s.push({value:u,foreground:e,background:t,decorations:new Set(n)}),l.sequence){const h=o8(l.sequence);for(const d of h)d.type==="resetAll"?(e=null,t=null,n.clear()):d.type==="resetForegroundColor"?e=null:d.type==="resetBackgroundColor"?t=null:d.type==="resetDecoration"&&n.delete(d.value);for(const d of h)d.type==="setForegroundColor"?e=d.value:d.type==="setBackgroundColor"?t=d.value:d.type==="setDecoration"&&n.add(d.value)}a=l.position}while(a<i.length);return s}}}var l8={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function c8(e=l8){function t(u){return e[u]}function n(u){return`#${u.map(h=>Math.max(0,Math.min(h,255)).toString(16).padStart(2,"0")).join("")}`}let i;function s(){if(i)return i;i=[];for(let d=0;d<eo.length;d++)i.push(t(eo[d]));let u=[0,95,135,175,215,255];for(let d=0;d<6;d++)for(let p=0;p<6;p++)for(let m=0;m<6;m++)i.push(n([u[d],u[p],u[m]]));let h=8;for(let d=0;d<24;d++,h+=10)i.push(n([h,h,h]));return i}function a(u){return s()[u]}function l(u){switch(u.type){case"named":return t(u.name);case"rgb":return n(u.rgb);case"table":return a(u.index)}}return{value:l}}const u8={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function h8(e,t,n){const i=gd(e,n),s=rf(t),a=c8(Object.fromEntries(eo.map(u=>{const h=`terminal.ansi${u[0].toUpperCase()}${u.substring(1)}`;return[u,e.colors?.[h]||u8[u]]}))),l=a8();return s.map(u=>l.parse(u[0]).map(h=>{let d,p;h.decorations.has("reverse")?(d=h.background?a.value(h.background):e.bg,p=h.foreground?a.value(h.foreground):e.fg):(d=h.foreground?a.value(h.foreground):e.fg,p=h.background?a.value(h.background):void 0),d=fs(d,i),p=fs(p,i),h.decorations.has("dim")&&(d=d8(d));let m=fn.None;return h.decorations.has("bold")&&(m|=fn.Bold),h.decorations.has("italic")&&(m|=fn.Italic),h.decorations.has("underline")&&(m|=fn.Underline),h.decorations.has("strikethrough")&&(m|=fn.Strikethrough),{content:h.value,offset:u[1],color:d,bgColor:p,fontStyle:m}}))}function d8(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const i=t[1];if(i.length===8){const s=Math.round(Number.parseInt(i.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${i.slice(0,6)}${s}`}else{if(i.length===6)return`#${i}80`;if(i.length===4){const s=i[0],a=i[1],l=i[2],u=i[3];return`#${s}${s}${a}${a}${l}${l}${Math.round(Number.parseInt(`${u}${u}`,16)/2).toString(16).padStart(2,"0")}`}else if(i.length===3){const s=i[0],a=i[1],l=i[2];return`#${s}${s}${a}${a}${l}${l}80`}}}const n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function S_(e,t,n={}){const i=e.resolveLangAlias(n.lang||"text"),{theme:s=e.getLoadedThemes()[0]}=n;if(!tf(i)&&!nf(s)&&i==="ansi"){const{theme:a}=e.setTheme(s);return h8(a,t,n)}return wA(e,t,n)}function yd(e,t,n){let i,s,a,l,u,h;if("themes"in n){const{defaultColor:d="light",cssVariablePrefix:p="--shiki-",colorsRendering:m="css-vars"}=n,_=Object.entries(n.themes).filter(k=>k[1]).map(k=>({color:k[0],theme:k[1]})).sort((k,T)=>k.color===d?-1:T.color===d?1:0);if(_.length===0)throw new ft("`themes` option must not be empty");const y=xA(e,t,n,S_);if(h=gc(y),d&&fy!==d&&!_.find(k=>k.color===d))throw new ft(`\`themes\` option must contain the defaultColor key \`${d}\``);const b=_.map(k=>e.getTheme(k.theme)),S=_.map(k=>k.color);a=y.map(k=>k.map(T=>e8(T,S,p,d,m))),h&&sf(a,h);const C=_.map(k=>gd(k.theme,n));s=xx(_,b,C,p,d,"fg",m),i=xx(_,b,C,p,d,"bg",m),l=`shiki-themes ${b.map(k=>k.name).join(" ")}`,u=d?void 0:[s,i].join(";")}else if("theme"in n){const d=gd(n.theme,n);a=S_(e,t,n);const p=e.getTheme(n.theme);i=fs(p.bg,d),s=fs(p.fg,d),l=p.name,h=gc(a)}else throw new ft("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:s,bg:i,themeName:l,rootStyle:u,grammarState:h}}function xx(e,t,n,i,s,a,l){return e.map((u,h)=>{const d=fs(t[h][a],n[h])||"inherit",p=`${i+u.color}${a==="bg"?"-bg":""}:${d}`;if(h===0&&s){if(s===fy&&e.length>1){const m=e.findIndex(y=>y.color==="light"),_=e.findIndex(y=>y.color==="dark");if(m===-1||_===-1)throw new ft('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${fs(t[m][a],n[m])||"inherit"}, ${fs(t[_][a],n[_])||"inherit"});${p}`}return d}return l==="css-vars"?p:null}).filter(u=>!!u).join(";")}function bd(e,t,n,i={meta:{},options:n,codeToHast:(s,a)=>bd(e,s,a),codeToTokens:(s,a)=>yd(e,s,a)}){let s=t;for(const b of vd(n))s=b.preprocess?.call(i,s,n)||s;let{tokens:a,fg:l,bg:u,themeName:h,rootStyle:d,grammarState:p}=yd(e,s,n);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:_=!1}=n;m===!0?a=p8(a):m==="never"&&(a=m8(a)),_&&(a=g8(a));const y={...i,get source(){return s}};for(const b of vd(n))a=b.tokens?.call(y,a)||a;return f8(a,{...n,fg:l,bg:u,themeName:h,rootStyle:n.rootStyle===!1?!1:n.rootStyle??d},y,p)}function f8(e,t,n,i=gc(e)){const s=vd(t),a=[],l={type:"root",children:[]},{structure:u="classic",tabindex:h="0"}=t,d={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?d.style=t.rootStyle:d.style=`background-color:${t.bg};color:${t.fg}`),h!==!1&&h!=null&&(d.tabindex=h.toString());for(const[S,C]of Object.entries(t.meta||{}))S.startsWith("_")||(d[S]=C);let p={type:"element",tagName:"pre",properties:d,children:[],data:t.data},m={type:"element",tagName:"code",properties:{},children:a};const _=[],y={...n,structure:u,addClassToHast:IA,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return l},get pre(){return p},get code(){return m},get lines(){return _}};if(e.forEach((S,C)=>{C&&(u==="inline"?l.children.push({type:"element",tagName:"br",properties:{},children:[]}):u==="classic"&&a.push({type:"text",value:`
|
|
66
|
+
`}));let k={type:"element",tagName:"span",properties:{class:"line"},children:[]},T=0;for(const R of S){let A={type:"element",tagName:"span",properties:{...R.htmlAttrs},children:[{type:"text",value:R.content}]};const N=b_(R.htmlStyle||_d(R));N&&(A.properties.style=N);for(const V of s)A=V?.span?.call(y,A,C+1,T,k,R)||A;u==="inline"?l.children.push(A):u==="classic"&&k.children.push(A),T+=R.content.length}if(u==="classic"){for(const R of s)k=R?.line?.call(y,k,C+1)||k;_.push(k),a.push(k)}else u==="inline"&&_.push(k)}),u==="classic"){for(const S of s)m=S?.code?.call(y,m)||m;p.children.push(m);for(const S of s)p=S?.pre?.call(y,p)||p;l.children.push(p)}else if(u==="inline"){const S=[];let C={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const T of l.children)T.type==="element"&&T.tagName==="br"?(S.push(C),C={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(T.type==="element"||T.type==="text")&&C.children.push(T);S.push(C);let k={type:"element",tagName:"code",properties:{},children:S};for(const T of s)k=T?.code?.call(y,k)||k;l.children=[];for(let T=0;T<k.children.length;T++){T>0&&l.children.push({type:"element",tagName:"br",properties:{},children:[]});const R=k.children[T];R.type==="element"&&l.children.push(...R.children)}}let b=l;for(const S of s)b=S?.root?.call(y,b)||b;return i&&sf(b,i),b}function p8(e){return e.map(t=>{const n=[];let i="",s;return t.forEach((a,l)=>{const u=!(a.fontStyle&&(a.fontStyle&fn.Underline||a.fontStyle&fn.Strikethrough));u&&a.content.match(/^\s+$/)&&t[l+1]?(s===void 0&&(s=a.offset),i+=a.content):i?(u?n.push({...a,offset:s,content:i+a.content}):n.push({content:i,offset:s},a),s=void 0,i=""):n.push(a)}),n})}function m8(e){return e.map(t=>t.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const i=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!i)return n;const[,s,a,l]=i;if(!s&&!l)return n;const u=[{...n,offset:n.offset+s.length,content:a}];return s&&u.unshift({content:s,offset:n.offset}),l&&u.push({content:l,offset:n.offset+s.length+a.length}),u}))}function g8(e){return e.map(t=>{const n=[];for(const i of t){if(n.length===0){n.push({...i});continue}const s=n[n.length-1],a=b_(s.htmlStyle||_d(s)),l=b_(i.htmlStyle||_d(i)),u=s.fontStyle&&(s.fontStyle&fn.Underline||s.fontStyle&fn.Strikethrough),h=i.fontStyle&&(i.fontStyle&fn.Underline||i.fontStyle&fn.Strikethrough);!u&&!h&&a===l?s.content+=i.content:n.push({...i})}return n})}const _8=qz;function v8(e,t,n){const i={meta:{},options:n,codeToHast:(a,l)=>bd(e,a,l),codeToTokens:(a,l)=>yd(e,a,l)};let s=_8(bd(e,t,n,i));for(const a of vd(n))s=a.postprocess?.call(i,s,n)||s;return s}async function y8(e){const t=await Cj(e);return{getLastGrammarState:(...n)=>Tj(t,...n),codeToTokensBase:(n,i)=>S_(t,n,i),codeToTokensWithThemes:(n,i)=>xA(t,n,i),codeToTokens:(n,i)=>yd(t,n,i),codeToHast:(n,i)=>bd(t,n,i),codeToHtml:(n,i)=>v8(t,n,i),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}const Cx=4294967295;var b8=class{regexps;constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:n=!1,cache:i,regexConstructor:s}=t;if(!s)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(a=>{if(typeof a!="string")return a;const l=i?.get(a);if(l){if(l instanceof RegExp)return l;if(n)return null;throw l}try{const u=s(a);return i?.set(a,u),u}catch(u){if(i?.set(a,u),n)return null;throw u}})}findNextMatchSync(e,t,n){const i=typeof e=="string"?e:e.content,s=[];function a(l,u,h=0){return{index:l,captureIndices:u.indices.map(d=>d==null?{start:Cx,end:Cx,length:0}:{start:d[0]+h,end:d[1]+h,length:d[1]-d[0]})}}for(let l=0;l<this.regexps.length;l++){const u=this.regexps[l];if(u)try{u.lastIndex=t;const h=u.exec(i);if(!h)continue;if(h.index===t)return a(l,h,0);s.push([l,h,0])}catch(h){if(this.options.forgiving)continue;throw h}}if(s.length){const l=Math.min(...s.map(u=>u[1].index));for(const[u,h,d]of s)if(h.index===l)return a(u,h,d)}return null}};function za(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function S8(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const py=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),Zt=String.raw;function Ha(e,t){if(e==null)throw new Error(t??"Value expected");return e}const zA=Zt`\[\^?`,HA=`c.? | C(?:-.?)?|${Zt`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Zt`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Zt`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Zt`o\{[^\}]*\}?`}|${Zt`\d{1,3}`}`,my=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,gh=new RegExp(Zt`
|
|
67
|
+
\\ (?:
|
|
68
|
+
${HA}
|
|
69
|
+
| [gk]<[^>]*>?
|
|
70
|
+
| [gk]'[^']*'?
|
|
71
|
+
| .
|
|
72
|
+
)
|
|
73
|
+
| \( (?:
|
|
74
|
+
\? (?:
|
|
75
|
+
[:=!>({]
|
|
76
|
+
| <[=!]
|
|
77
|
+
| <[^>]*>
|
|
78
|
+
| '[^']*'
|
|
79
|
+
| ~\|?
|
|
80
|
+
| #(?:[^)\\]|\\.?)*
|
|
81
|
+
| [^:)]*[:)]
|
|
82
|
+
)?
|
|
83
|
+
| \*[^\)]*\)?
|
|
84
|
+
)?
|
|
85
|
+
| (?:${my.source})+
|
|
86
|
+
| ${zA}
|
|
87
|
+
| .
|
|
88
|
+
`.replace(/\s+/g,""),"gsu"),og=new RegExp(Zt`
|
|
89
|
+
\\ (?:
|
|
90
|
+
${HA}
|
|
91
|
+
| .
|
|
92
|
+
)
|
|
93
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
94
|
+
| ${zA}
|
|
95
|
+
| &&
|
|
96
|
+
| .
|
|
97
|
+
`.replace(/\s+/g,""),"gsu");function w8(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const i=V8(n.flags),s=[i.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return s.at(-1)},numOpenGroups:0,popModX(){s.pop()},pushModX(m){s.push(m)},replaceCurrentModX(m){s[s.length-1]=m},singleline:n.rules.singleline};let l=[],u;for(gh.lastIndex=0;u=gh.exec(e);){const m=x8(a,e,u[0],gh.lastIndex);m.tokens?l.push(...m.tokens):m.token&&l.push(m.token),m.lastIndex!==void 0&&(gh.lastIndex=m.lastIndex)}const h=[];let d=0;l.filter(m=>m.type==="GroupOpen").forEach(m=>{m.kind==="capturing"?m.number=++d:m.raw==="("&&h.push(m)}),d||h.forEach((m,_)=>{m.kind="capturing",m.number=_+1});const p=d||h.length;return{tokens:l.map(m=>m.type==="EscapedNumber"?F8(m,p):m).flat(),flags:i}}function x8(e,t,n,i){const[s,a]=n;if(n==="["||n==="[^"){const l=C8(t,n,i);return{tokens:l.tokens,lastIndex:l.lastIndex}}if(s==="\\"){if("AbBGyYzZ".includes(a))return{token:Ex(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:L8(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:UA(n)}}if(a==="K")return{token:FA("keep",n)};if(a==="N"||a==="R")return{token:to("newline",n,{negate:a==="N"})};if(a==="O")return{token:to("any",n)};if(a==="X")return{token:to("text_segment",n)};const l=VA(n,{inCharClass:!1});return Array.isArray(l)?{tokens:l}:{token:l}}if(s==="("){if(a==="*")return{token:j8(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[i]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:i+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:I8(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:ua("group",n)};if(n==="(?>")return{token:ua("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:ua(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:ua("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:ua("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:D8(n)}}if(e.getCurrentModX()){if(n==="#"){const l=t.indexOf(`
|
|
98
|
+
`,i);return{lastIndex:l===-1?t.length:l}}if(/^\s$/.test(n)){const l=/\s+/y;return l.lastIndex=i,{lastIndex:l.exec(t)?l.lastIndex:i}}}if(n===".")return{token:to("dot",n)};if(n==="^"||n==="$"){const l=e.singleline?{"^":Zt`\A`,$:Zt`\Z`}[n]:n;return{token:Ex(l,n)}}return n==="|"?{token:k8(n)}:my.test(n)?{tokens:$8(n)}:{token:gr(za(n),n)}}function C8(e,t,n){const i=[kx(t[1]==="^",t)];let s=1,a;for(og.lastIndex=n;a=og.exec(e);){const l=a[0];if(l[0]==="["&&l[1]!==":")s++,i.push(kx(l[1]==="^",l));else if(l==="]"){if(i.at(-1).type==="CharacterClassOpen")i.push(gr(93,l));else if(s--,i.push(T8(l)),!s)break}else{const u=E8(l);Array.isArray(u)?i.push(...u):i.push(u)}}return{tokens:i,lastIndex:og.lastIndex||e.length}}function E8(e){if(e[0]==="\\")return VA(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!py.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return to("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?A8(e):e==="&&"?R8(e):gr(za(e),e)}function VA(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return B8(e);if("dDhHsSwW".includes(n))return z8(e);if(e.startsWith(Zt`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return H8(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const i=e.split(/\\x/).slice(1).map(l=>parseInt(l,16)),s=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(i)),a=new TextEncoder;return[...s].map(l=>{const u=[...a.encode(l)].map(h=>`\\x${h.toString(16)}`).join("");return gr(za(l),u)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return gr(U8(e),e);if(Tx.has(n))return gr(Tx.get(n),e);if(/\d/.test(n))return M8(t,e);if(e==="\\")throw new Error(Zt`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return gr(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function k8(e){return{type:"Alternator",raw:e}}function Ex(e,t){return{type:"Assertion",kind:e,raw:t}}function UA(e){return{type:"Backreference",raw:e}}function gr(e,t){return{type:"Character",value:e,raw:t}}function T8(e){return{type:"CharacterClassClose",raw:e}}function A8(e){return{type:"CharacterClassHyphen",raw:e}}function R8(e){return{type:"CharacterClassIntersector",raw:e}}function kx(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function to(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function FA(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Ha(n.flags),raw:t}}function M8(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function D8(e){return{type:"GroupClose",raw:e}}function ua(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function N8(e,t,n,i){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:i}}function O8(e,t,n,i){return{type:"Quantifier",kind:e,min:t,max:n,raw:i}}function L8(e){return{type:"Subroutine",raw:e}}const P8=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Tx=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function B8(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return gr(za(t.toUpperCase())-64,e)}function I8(e,t){let{on:n,off:i}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;i??="";const s=(t.getCurrentModX()||n.includes("x"))&&!i.includes("x"),a=Rx(n),l=Rx(i),u={};if(a&&(u.enable=a),l&&(u.disable=l),e.endsWith(")"))return t.replaceCurrentModX(s),FA("flags",e,{flags:u});if(e.endsWith(":"))return t.pushModX(s),t.numOpenGroups++,ua("group",e,{...(a||l)&&{flags:u}});throw new Error(`Unexpected flag modifier "${e}"`)}function j8(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:i,args:s}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(i==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const a=s?s.split(",").filter(p=>p!=="").map(p=>/^[+-]?\d+$/.test(p)?+p:p):[],[l,u,h]=a,d=P8.has(n)?n.toLowerCase():"custom";switch(d){case"fail":case"mismatch":case"skip":if(a.length>0)throw new Error(`Named callout arguments not allowed "${a}"`);break;case"error":if(a.length>1)throw new Error(`Named callout allows only one argument "${a}"`);if(typeof l=="string")throw new Error(`Named callout argument must be a number "${l}"`);break;case"max":if(!a.length||a.length>2)throw new Error(`Named callout must have one or two arguments "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument one must be a tag or number "${l}"`);if(a.length===2&&(typeof u=="number"||!/^[<>X]$/.test(u)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${u}"`);break;case"count":case"total_count":if(a.length>1)throw new Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof l=="number"||!/^[<>X]$/.test(l)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${l}"`);break;case"cmp":if(a.length!==3)throw new Error(`Named callout must have three arguments "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument one must be a tag or number "${l}"`);if(typeof u=="number"||!/^(?:[<>!=]=|[<>])$/.test(u))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${u}"`);if(typeof h=="string"&&!/^[A-Za-z_]\w*$/.test(h))throw new Error(`Named callout argument three must be a tag or number "${h}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${d}"`)}return N8(d,i??null,s?.split(",")??null,e)}function Ax(e){let t=null,n,i;if(e[0]==="{"){const{minStr:s,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,l=1e5;if(+s>l||a&&+a>l)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+s,i=a===void 0?+s:a===""?1/0:+a,n>i&&(t="possessive",[n,i]=[i,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,i=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return O8(t,n,i,e)}function z8(e){const t=e[1].toLowerCase();return to({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function H8(e){const{p:t,neg:n,value:i}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return to("property",e,{value:i,negate:t==="P"&&!n||t==="p"&&!!n})}function Rx(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function V8(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const i=e[n];if(!"imxDPSWy".includes(i))throw new Error(`Invalid flag "${i}"`);if(i==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[i]]=!0}return t}function U8(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function F8(e,t){const{raw:n,inCharClass:i}=e,s=n.slice(1);if(!i&&(s!=="0"&&s.length===1||s[0]!=="0"&&+s<=t))return[UA(n)];const a=[],l=s.match(/^[0-7]+|\d/g);for(let u=0;u<l.length;u++){const h=l[u];let d;if(u===0&&h!=="8"&&h!=="9"){if(d=parseInt(h,8),d>127)throw new Error(Zt`Octal encoded byte above 177 unsupported "${n}"`)}else d=za(h);a.push(gr(d,(u===0?"\\":"")+h))}return a}function $8(e){const t=[],n=new RegExp(my,"gy");let i;for(;i=n.exec(e);){const s=i[0];if(s[0]==="{"){const a=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(s);if(a){const{min:l,max:u}=a.groups;if(+l>+u&&s.endsWith("?")){n.lastIndex--,t.push(Ax(s.slice(0,-1)));continue}}}t.push(Ax(s))}return t}function $A(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(i=>t[i]===n[i])}function W8(e){return G8.has(e.type)}const G8=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function WA(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},i=w8(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),s=(_,y)=>{const b=i.tokens[a.nextIndex];switch(a.parent=_,a.nextIndex++,b.type){case"Alternator":return fo();case"Assertion":return q8(b);case"Backreference":return K8(b,a);case"Character":return af(b.value,{useLastValid:!!y.isCheckingRangeEnd});case"CharacterClassHyphen":return Y8(b,a,y);case"CharacterClassOpen":return X8(b,a,y);case"CharacterSet":return Z8(b,a);case"Directive":return iH(b.kind,{flags:b.flags});case"GroupOpen":return Q8(b,a,y);case"NamedCallout":return sH(b.kind,b.tag,b.arguments);case"Quantifier":return J8(b,a);case"Subroutine":return eH(b,a);default:throw new Error(`Unexpected token type "${b.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:i.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:s},l=aH(rH(i.flags));let u=l.body[0];for(;a.nextIndex<i.tokens.length;){const _=s(u,{});_.type==="Alternative"?(l.body.push(_),u=_):u.body.push(_)}const{capturingGroups:h,hasNumberedRef:d,namedGroupsByName:p,subroutines:m}=a;if(d&&p.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:_}of m)if(typeof _=="number"){if(_>h.length)throw new Error("Subroutine uses a group number that's not defined");_&&(h[_-1].isSubroutined=!0)}else if(p.has(_)){if(p.get(_).length>1)throw new Error(Zt`Subroutine uses a duplicate group name "\g<${_}>"`);p.get(_)[0].isSubroutined=!0}else throw new Error(Zt`Subroutine uses a group name that's not defined "\g<${_}>"`);return l}function q8({kind:e}){return w_(Ha({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===Zt`\B`||e===Zt`\Y`})}function K8({raw:e},t){const n=/^\\k[<']/.test(e),i=n?e.slice(3,-1):e.slice(1),s=(a,l=!1)=>{const u=t.capturingGroups.length;let h=!1;if(a>u)if(t.skipBackrefValidation)h=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,x_(l?u+1-a:a,{orphan:h})};if(n){const a=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(i);if(a)return s(+a.groups.num,!!a.groups.sign);if(/[-+]/.test(i))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(i))throw new Error(`Group name not defined to the left "${e}"`);return x_(i)}return s(+i)}function Y8(e,t,n){const{tokens:i,walk:s}=t,a=t.parent,l=a.body.at(-1),u=i[t.nextIndex];if(!n.isCheckingRangeEnd&&l&&l.type!=="CharacterClass"&&l.type!=="CharacterClassRange"&&u&&u.type!=="CharacterClassOpen"&&u.type!=="CharacterClassClose"&&u.type!=="CharacterClassIntersector"){const h=s(a,{...n,isCheckingRangeEnd:!0});if(l.type==="Character"&&h.type==="Character")return a.body.pop(),nH(l,h);throw new Error("Invalid character class range")}return af(za("-"))}function X8({negate:e},t,n){const{tokens:i,walk:s}=t,a=i[t.nextIndex],l=[Hh()];let u=Nx(a);for(;u.type!=="CharacterClassClose";){if(u.type==="CharacterClassIntersector")l.push(Hh()),t.nextIndex++;else{const d=l.at(-1);d.body.push(s(d,n))}u=Nx(i[t.nextIndex],a)}const h=Hh({negate:e});return l.length===1?h.body=l[0].body:(h.kind="intersection",h.body=l.map(d=>d.body.length===1?d.body[0]:d)),t.nextIndex++,h}function Z8({kind:e,negate:t,value:n},i){const{normalizeUnknownPropertyNames:s,skipPropertyNameValidation:a,unicodePropertyMap:l}=i;if(e==="property"){const u=lf(n);if(py.has(u)&&!l?.has(u))e="posix",n=u;else return ha(n,{negate:t,normalizeUnknownPropertyNames:s,skipPropertyNameValidation:a,unicodePropertyMap:l})}return e==="posix"?oH(n,{negate:t}):C_(e,{negate:t})}function Q8(e,t,n){const{tokens:i,capturingGroups:s,namedGroupsByName:a,skipLookbehindValidation:l,walk:u}=t,h=lH(e),d=h.type==="AbsenceFunction",p=Dx(h),m=p&&h.negate;if(h.type==="CapturingGroup"&&(s.push(h),h.name&&S8(a,h.name,[]).push(h)),d&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let _=Ox(i[t.nextIndex]);for(;_.type!=="GroupClose";){if(_.type==="Alternator")h.body.push(fo()),t.nextIndex++;else{const y=h.body.at(-1),b=u(y,{...n,isInAbsenceFunction:n.isInAbsenceFunction||d,isInLookbehind:n.isInLookbehind||p,isInNegLookbehind:n.isInNegLookbehind||m});if(y.body.push(b),(p||n.isInLookbehind)&&!l){const S="Lookbehind includes a pattern not allowed by Oniguruma";if(m||n.isInNegLookbehind){if(Mx(b)||b.type==="CapturingGroup")throw new Error(S)}else if(Mx(b)||Dx(b)&&b.negate)throw new Error(S)}}_=Ox(i[t.nextIndex])}return t.nextIndex++,h}function J8({kind:e,min:t,max:n},i){const s=i.parent,a=s.body.at(-1);if(!a||!W8(a))throw new Error("Quantifier requires a repeatable token");const l=qA(e,t,n,a);return s.body.pop(),l}function eH({raw:e},t){const{capturingGroups:n,subroutines:i}=t;let s=e.slice(3,-1);const a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(s);if(a){const u=+a.groups.num,h=n.length;if(t.hasNumberedRef=!0,s={"":u,"+":h+u,"-":h+1-u}[a.groups.sign],s<1)throw new Error("Invalid subroutine number")}else s==="0"&&(s=0);const l=KA(s);return i.push(l),l}function tH(e,t){return{type:"AbsenceFunction",kind:e,body:Dc(t?.body)}}function fo(e){return{type:"Alternative",body:YA(e?.body)}}function w_(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function x_(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function GA(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!cH(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:Dc(t?.body)}}function af(e,t){const n={useLastValid:!1,...t};if(e>1114111){const i=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${i}}"`):new Error(`Invalid code point out of range in JS "\\x{${i}}"`)}return{type:"Character",value:e}}function Hh(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:YA(e?.body)}}function nH(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function C_(e,t){const n=!!t?.negate,i={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(i.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(i.variableLength=!0),i}function iH(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Ha(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function rH(e){return{type:"Flags",...e}}function yi(e){const t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:Dc(e?.body)}}function Js(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:Dc(e?.body)}}function sH(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function oH(e,t){const n=!!t?.negate;if(!py.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function qA(e,t,n,i){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:i}}function aH(e,t){return{type:"Regex",body:Dc(t?.body),flags:e}}function KA(e){return{type:"Subroutine",ref:e}}function ha(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let i=n.unicodePropertyMap?.get(lf(e));if(!i){if(n.normalizeUnknownPropertyNames)i=uH(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(Zt`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:i??e,negate:n.negate}}function lH({flags:e,kind:t,name:n,negate:i,number:s}){switch(t){case"absence_repeater":return tH("repeater");case"atomic":return yi({atomic:!0});case"capturing":return GA(s,{name:n});case"group":return yi({flags:e});case"lookahead":case"lookbehind":return Js({behind:t==="lookbehind",negate:i});default:throw new Error(`Unexpected group kind "${t}"`)}}function Dc(e){if(e===void 0)e=[fo()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function YA(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function Mx(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function Dx(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function cH(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function uH(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function lf(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Nx(e,t){return Ha(e,`${t?.type==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function Ox(e){return Ha(e,"Unclosed group")}function sc(e,t,n=null){function i(a,l){for(let u=0;u<a.length;u++){const h=s(a[u],l,u,a);u=Math.max(-1,u+h)}}function s(a,l=null,u=null,h=null){let d=0,p=!1;const m={node:a,parent:l,key:u,container:h,root:e,remove(){_h(h).splice(Math.max(0,oa(u)+d),1),d--,p=!0},removeAllNextSiblings(){return _h(h).splice(oa(u)+1)},removeAllPrevSiblings(){const k=oa(u)+d;return d-=k,_h(h).splice(0,Math.max(0,k))},replaceWith(k,T={}){const R=!!T.traverse;h?h[Math.max(0,oa(u)+d)]=k:Ha(l,"Can't replace root node")[u]=k,R&&s(k,l,u,h),p=!0},replaceWithMultiple(k,T={}){const R=!!T.traverse;if(_h(h).splice(Math.max(0,oa(u)+d),1,...k),d+=k.length-1,R){let A=0;for(let N=0;N<k.length;N++)A+=s(k[N],l,oa(u)+N+A,h)}p=!0},skip(){p=!0}},{type:_}=a,y=t["*"],b=t[_],S=typeof y=="function"?y:y?.enter,C=typeof b=="function"?b:b?.enter;if(S?.(m,n),C?.(m,n),!p)switch(_){case"AbsenceFunction":case"CapturingGroup":case"Group":i(a.body,a);break;case"Alternative":case"CharacterClass":i(a.body,a);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":s(a.min,a,"min"),s(a.max,a,"max");break;case"LookaroundAssertion":i(a.body,a);break;case"Quantifier":s(a.body,a,"body");break;case"Regex":i(a.body,a),s(a.flags,a,"flags");break;default:throw new Error(`Unexpected node type "${_}"`)}return b?.exit?.(m,n),y?.exit?.(m,n),d}return s(e),e}function _h(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function oa(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const hH=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function dH(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function fH(e,t,n,i){return e.slice(0,t)+i+e.slice(t+n.length)}const li=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function gy(e,t,n,i){const s=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),a=[!1];let l=0,u="";for(const h of e.matchAll(s)){const{0:d,groups:{$skip:p}}=h;if(!p&&(!i||i===li.DEFAULT==!l)){n instanceof Function?u+=n(h,{context:l?li.CHAR_CLASS:li.DEFAULT,negated:a[a.length-1]}):u+=n;continue}d[0]==="["?(l++,a.push(d[1]==="^")):d==="]"&&l&&(l--,a.pop()),u+=d}return u}function XA(e,t,n,i){gy(e,t,n,i)}function pH(e,t,n=0,i){if(!new RegExp(t,"su").test(e))return null;const s=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");s.lastIndex=n;let a=0,l;for(;l=s.exec(e);){const{0:u,groups:{$skip:h}}=l;if(!h&&(!i||i===li.DEFAULT==!a))return l;u==="["?a++:u==="]"&&a&&a--,s.lastIndex==l.index&&s.lastIndex++}return null}function vh(e,t,n){return!!pH(e,t,0,n)}function mH(e,t){const n=/\\?./gsu;n.lastIndex=t;let i=e.length,s=0,a=1,l;for(;l=n.exec(e);){const[u]=l;if(u==="[")s++;else if(s)u==="]"&&s--;else if(u==="(")a++;else if(u===")"&&(a--,!a)){i=l.index;break}}return e.slice(t,i)}const Lx=new RegExp(String.raw`(?<noncapturingStart>${hH})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function gH(e,t){const n=t?.hiddenCaptures??[];let i=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};const s="(?>",a="(?:(?=(",l=[0],u=[];let h=0,d=0,p=NaN,m;do{m=!1;let _=0,y=0,b=!1,S;for(Lx.lastIndex=Number.isNaN(p)?0:p+a.length;S=Lx.exec(e);){const{0:C,index:k,groups:{capturingStart:T,noncapturingStart:R}}=S;if(C==="[")_++;else if(_)C==="]"&&_--;else if(C===s&&!b)p=k,b=!0;else if(b&&R)y++;else if(T)b?y++:(h++,l.push(h+d));else if(C===")"&&b){if(!y){d++;const A=h+d;if(e=`${e.slice(0,p)}${a}${e.slice(p+s.length,k)}))<$$${A}>)${e.slice(k+1)}`,m=!0,u.push(A),dH(n,A),i.size){const N=new Map;i.forEach((V,H)=>{N.set(H>=A?H+1:H,V.map(z=>z>=A?z+1:z))}),i=N}break}y--}}}while(m);return n.push(...u),e=gy(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:_,groups:{backrefNum:y,wrappedBackrefNum:b}})=>{if(y){const S=+y;if(S>l.length-1)throw new Error(`Backref "${_}" greater than number of captures`);return`\\${l[S]}`}return`\\${b}`},li.DEFAULT),{pattern:e,captureTransfers:i,hiddenCaptures:n}}const ZA=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,ag=new RegExp(String.raw`
|
|
99
|
+
\\(?: \d+
|
|
100
|
+
| c[A-Za-z]
|
|
101
|
+
| [gk]<[^>]+>
|
|
102
|
+
| [pPu]\{[^\}]+\}
|
|
103
|
+
| u[A-Fa-f\d]{4}
|
|
104
|
+
| x[A-Fa-f\d]{2}
|
|
105
|
+
)
|
|
106
|
+
| \((?: \? (?: [:=!>]
|
|
107
|
+
| <(?:[=!]|[^>]+>)
|
|
108
|
+
| [A-Za-z\-]+:
|
|
109
|
+
| \(DEFINE\)
|
|
110
|
+
))?
|
|
111
|
+
| (?<qBase>${ZA})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
112
|
+
| \\?.
|
|
113
|
+
`.replace(/\s+/g,""),"gsu");function _H(e){if(!new RegExp(`${ZA}\\+`).test(e))return{pattern:e};const t=[];let n=null,i=null,s="",a=0,l;for(ag.lastIndex=0;l=ag.exec(e);){const{0:u,index:h,groups:{qBase:d,qMod:p,invalidQ:m}}=l;if(u==="[")a||(i=h),a++;else if(u==="]")a?a--:i=null;else if(!a)if(p==="+"&&s&&!s.startsWith("(")){if(m)throw new Error(`Invalid quantifier "${u}"`);let _=-1;if(/^\{\d+\}$/.test(d))e=fH(e,h+d.length,p,"");else{if(s===")"||s==="]"){const y=s===")"?n:i;if(y===null)throw new Error(`Invalid unmatched "${s}"`);e=`${e.slice(0,y)}(?>${e.slice(y,h)}${d})${e.slice(h+u.length)}`}else e=`${e.slice(0,h-s.length)}(?>${s}${d})${e.slice(h+u.length)}`;_+=4}ag.lastIndex+=_}else u[0]==="("?t.push(h):u===")"&&(n=t.length?t.pop():null);s=u}return{pattern:e}}const ai=String.raw,vH=ai`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,E_=ai`\(\?R=(?<rDepth>[^\)]+)\)|${vH}`,cf=ai`\(\?<(?![=!])(?<captureName>[^>]+)>`,QA=ai`${cf}|(?<unnamed>\()(?!\?)`,Ws=new RegExp(ai`${cf}|${E_}|\(\?|\\?.`,"gsu"),lg="Cannot use multiple overlapping recursions";function yH(e,t){const{hiddenCaptures:n,mode:i}={hiddenCaptures:[],mode:"plugin",...t};let s=t?.captureTransfers??new Map;if(!new RegExp(E_,"su").test(e))return{pattern:e,captureTransfers:s,hiddenCaptures:n};if(i==="plugin"&&vh(e,ai`\(\?\(DEFINE\)`,li.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const a=[],l=vh(e,ai`\\[1-9]`,li.DEFAULT),u=new Map,h=[];let d=!1,p=0,m=0,_;for(Ws.lastIndex=0;_=Ws.exec(e);){const{0:y,groups:{captureName:b,rDepth:S,gRNameOrNum:C,gRDepth:k}}=_;if(y==="[")p++;else if(p)y==="]"&&p--;else if(S){if(Px(S),d)throw new Error(lg);if(l)throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const T=e.slice(0,_.index),R=e.slice(Ws.lastIndex);if(vh(R,E_,li.DEFAULT))throw new Error(lg);const A=+S-1;e=Bx(T,R,A,!1,n,a,m),s=jx(s,T,A,a.length,0,m);break}else if(C){Px(k);let T=!1;for(const I of h)if(I.name===C||I.num===+C){if(T=!0,I.hasRecursedWithin)throw new Error(lg);break}if(!T)throw new Error(ai`Recursive \g cannot be used outside the referenced group "${i==="external"?C:ai`\g<${C}&R=${k}>`}"`);const R=u.get(C),A=mH(e,R);if(l&&vh(A,ai`${cf}|\((?!\?)`,li.DEFAULT))throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const N=e.slice(R,_.index),V=A.slice(N.length+y.length),H=a.length,z=+k-1,J=Bx(N,V,z,!0,n,a,m);s=jx(s,N,z,a.length-H,H,m);const $=e.slice(0,R),K=e.slice(R+A.length);e=`${$}${J}${K}`,Ws.lastIndex+=J.length-y.length-N.length-V.length,h.forEach(I=>I.hasRecursedWithin=!0),d=!0}else if(b)m++,u.set(String(m),Ws.lastIndex),u.set(b,Ws.lastIndex),h.push({num:m,name:b});else if(y[0]==="("){const T=y==="(";T&&(m++,u.set(String(m),Ws.lastIndex)),h.push(T?{num:m}:{})}else y===")"&&h.pop()}return n.push(...a),{pattern:e,captureTransfers:s,hiddenCaptures:n}}function Px(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function Bx(e,t,n,i,s,a,l){const u=new Set;i&&XA(e+t,cf,({groups:{captureName:d}})=>{u.add(d)},li.DEFAULT);const h=[n,i?u:null,s,a,l];return`${e}${Ix(`(?:${e}`,"forward",...h)}(?:)${Ix(`${t})`,"backward",...h)}${t}`}function Ix(e,t,n,i,s,a,l){const h=p=>t==="forward"?p+2:n-p+2-1;let d="";for(let p=0;p<n;p++){const m=h(p);d+=gy(e,ai`${QA}|\\k<(?<backref>[^>]+)>`,({0:_,groups:{captureName:y,unnamed:b,backref:S}})=>{if(S&&i&&!i.has(S))return _;const C=`_$${m}`;if(b||y){const k=l+a.length+1;return a.push(k),bH(s,k),b?_:`(?<${y}${C}>`}return ai`\k<${S}${C}>`},li.DEFAULT)}return d}function bH(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function jx(e,t,n,i,s,a){if(e.size&&i){let l=0;XA(t,QA,()=>l++,li.DEFAULT);const u=a-l+s,h=new Map;return e.forEach((d,p)=>{const m=(i-l*n)/n,_=l*n,y=p>u+l?p+i:p,b=[];for(const S of d)if(S<=u)b.push(S);else if(S>u+l+m)b.push(S+i);else if(S<=u+l)for(let C=0;C<=n;C++)b.push(S+l*C);else for(let C=0;C<=n;C++)b.push(S+_+m*C);h.set(y,b)}),h}return e}var Ut=String.fromCodePoint,Oe=String.raw,yr={flagGroups:(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),unicodeSets:(()=>{try{new RegExp("[[]]","v")}catch{return!1}return!0})()};yr.bugFlagVLiteralHyphenIsRange=yr.unicodeSets?(()=>{try{new RegExp(Oe`[\d\-a]`,"v")}catch{return!0}return!1})():!1;yr.bugNestedClassIgnoresNegation=yr.unicodeSets&&new RegExp("[[^a]]","v").test("a");function Sd(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function _c(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function k_(e,t){return zx[e]>=zx[t]}function SH(e,t){if(e==null)throw new Error(t??"Value expected");return e}var zx={ES2025:2025,ES2024:2024,ES2018:2018},wH={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function JA(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!wH[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=yr.flagGroups?"ES2025":yr.unicodeSets?"ES2024":"ES2018"),t}var xH="[ -\r ]",CH=new Set([Ut(304),Ut(305)]),dr=Oe`[\p{L}\p{M}\p{N}\p{Pc}]`;function eR(e){if(CH.has(e))return[e];const t=new Set,n=e.toLowerCase(),i=n.toUpperCase(),s=TH.get(n),a=EH.get(n),l=kH.get(n);return[...i].length===1&&t.add(i),l&&t.add(l),s&&t.add(s),t.add(n),a&&t.add(a),[...t]}var _y=new Map(`C Other
|
|
114
|
+
Cc Control cntrl
|
|
115
|
+
Cf Format
|
|
116
|
+
Cn Unassigned
|
|
117
|
+
Co Private_Use
|
|
118
|
+
Cs Surrogate
|
|
119
|
+
L Letter
|
|
120
|
+
LC Cased_Letter
|
|
121
|
+
Ll Lowercase_Letter
|
|
122
|
+
Lm Modifier_Letter
|
|
123
|
+
Lo Other_Letter
|
|
124
|
+
Lt Titlecase_Letter
|
|
125
|
+
Lu Uppercase_Letter
|
|
126
|
+
M Mark Combining_Mark
|
|
127
|
+
Mc Spacing_Mark
|
|
128
|
+
Me Enclosing_Mark
|
|
129
|
+
Mn Nonspacing_Mark
|
|
130
|
+
N Number
|
|
131
|
+
Nd Decimal_Number digit
|
|
132
|
+
Nl Letter_Number
|
|
133
|
+
No Other_Number
|
|
134
|
+
P Punctuation punct
|
|
135
|
+
Pc Connector_Punctuation
|
|
136
|
+
Pd Dash_Punctuation
|
|
137
|
+
Pe Close_Punctuation
|
|
138
|
+
Pf Final_Punctuation
|
|
139
|
+
Pi Initial_Punctuation
|
|
140
|
+
Po Other_Punctuation
|
|
141
|
+
Ps Open_Punctuation
|
|
142
|
+
S Symbol
|
|
143
|
+
Sc Currency_Symbol
|
|
144
|
+
Sk Modifier_Symbol
|
|
145
|
+
Sm Math_Symbol
|
|
146
|
+
So Other_Symbol
|
|
147
|
+
Z Separator
|
|
148
|
+
Zl Line_Separator
|
|
149
|
+
Zp Paragraph_Separator
|
|
150
|
+
Zs Space_Separator
|
|
151
|
+
ASCII
|
|
152
|
+
ASCII_Hex_Digit AHex
|
|
153
|
+
Alphabetic Alpha
|
|
154
|
+
Any
|
|
155
|
+
Assigned
|
|
156
|
+
Bidi_Control Bidi_C
|
|
157
|
+
Bidi_Mirrored Bidi_M
|
|
158
|
+
Case_Ignorable CI
|
|
159
|
+
Cased
|
|
160
|
+
Changes_When_Casefolded CWCF
|
|
161
|
+
Changes_When_Casemapped CWCM
|
|
162
|
+
Changes_When_Lowercased CWL
|
|
163
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
164
|
+
Changes_When_Titlecased CWT
|
|
165
|
+
Changes_When_Uppercased CWU
|
|
166
|
+
Dash
|
|
167
|
+
Default_Ignorable_Code_Point DI
|
|
168
|
+
Deprecated Dep
|
|
169
|
+
Diacritic Dia
|
|
170
|
+
Emoji
|
|
171
|
+
Emoji_Component EComp
|
|
172
|
+
Emoji_Modifier EMod
|
|
173
|
+
Emoji_Modifier_Base EBase
|
|
174
|
+
Emoji_Presentation EPres
|
|
175
|
+
Extended_Pictographic ExtPict
|
|
176
|
+
Extender Ext
|
|
177
|
+
Grapheme_Base Gr_Base
|
|
178
|
+
Grapheme_Extend Gr_Ext
|
|
179
|
+
Hex_Digit Hex
|
|
180
|
+
IDS_Binary_Operator IDSB
|
|
181
|
+
IDS_Trinary_Operator IDST
|
|
182
|
+
ID_Continue IDC
|
|
183
|
+
ID_Start IDS
|
|
184
|
+
Ideographic Ideo
|
|
185
|
+
Join_Control Join_C
|
|
186
|
+
Logical_Order_Exception LOE
|
|
187
|
+
Lowercase Lower
|
|
188
|
+
Math
|
|
189
|
+
Noncharacter_Code_Point NChar
|
|
190
|
+
Pattern_Syntax Pat_Syn
|
|
191
|
+
Pattern_White_Space Pat_WS
|
|
192
|
+
Quotation_Mark QMark
|
|
193
|
+
Radical
|
|
194
|
+
Regional_Indicator RI
|
|
195
|
+
Sentence_Terminal STerm
|
|
196
|
+
Soft_Dotted SD
|
|
197
|
+
Terminal_Punctuation Term
|
|
198
|
+
Unified_Ideograph UIdeo
|
|
199
|
+
Uppercase Upper
|
|
200
|
+
Variation_Selector VS
|
|
201
|
+
White_Space space
|
|
202
|
+
XID_Continue XIDC
|
|
203
|
+
XID_Start XIDS`.split(/\s/).map(e=>[lf(e),e])),EH=new Map([["s",Ut(383)],[Ut(383),"s"]]),kH=new Map([[Ut(223),Ut(7838)],[Ut(107),Ut(8490)],[Ut(229),Ut(8491)],[Ut(969),Ut(8486)]]),TH=new Map([as(453),as(456),as(459),as(498),...cg(8072,8079),...cg(8088,8095),...cg(8104,8111),as(8124),as(8140),as(8188)]),AH=new Map([["alnum",Oe`[\p{Alpha}\p{Nd}]`],["alpha",Oe`\p{Alpha}`],["ascii",Oe`\p{ASCII}`],["blank",Oe`[\p{Zs}\t]`],["cntrl",Oe`\p{Cc}`],["digit",Oe`\p{Nd}`],["graph",Oe`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Oe`\p{Lower}`],["print",Oe`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Oe`[\p{P}\p{S}]`],["space",Oe`\p{space}`],["upper",Oe`\p{Upper}`],["word",Oe`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Oe`\p{AHex}`]]);function RH(e,t){const n=[];for(let i=e;i<=t;i++)n.push(i);return n}function as(e){const t=Ut(e);return[t.toLowerCase(),t]}function cg(e,t){return RH(e,t).map(n=>as(n))}var tR=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function MH(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};nR(e);const i={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:k_(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};sc(e,DH,i);const s={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:s,prevFlags:null,globalFlags:s,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:i.subroutineRefMap};sc(e,NH,a);const l={groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer};return sc(e,OH,l),e._originMap=a.groupOriginByCopy,e._strategy=i.strategy,e}var DH={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:i,kind:s}=e;if(s==="repeater"){const a=yi();a.body[0].body.push(Js({negate:!0,body:i}),ha("Any"));const l=yi();l.body[0].body.push(qA("greedy",0,1/0,a)),n(Tt(l,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:i}){const s=e.body.filter(a=>a.kind==="flags");for(let a=n+1;a<t.body.length;a++){const l=t.body[a];_c(i,l,[]).push(...s)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=rR(t.get(e));if(n){const i=yi({flags:n});i.body[0].body=e.body,e.body=[Tt(i,e)]}}}},Assertion({node:e,parent:t,key:n,container:i,root:s,remove:a,replaceWith:l},u){const{kind:h,negate:d}=e,{asciiWordBoundaries:p,avoidSubclass:m,supportedGNodes:_,wordIsAscii:y}=u;if(h==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${d?"Y":"y"}"`);if(h==="line_end")l(Tt(Js({body:[fo({body:[w_("string_end")]}),fo({body:[af(10)]})]}),t));else if(h==="line_start")l(Tt(fr(Oe`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(h==="search_start")if(_.has(e))s.flags.sticky=!0,a();else{const b=i[n-1];if(b&&zH(b))l(Tt(Js({negate:!0}),t));else{if(m)throw new Error(Oe`Uses "\G" in a way that requires a subclass`);l(ls(w_("string_start"),t)),u.strategy="clip_search"}}else if(!(h==="string_end"||h==="string_start"))if(h==="string_end_newline")l(Tt(fr(Oe`(?=\n?\z)`),t));else if(h==="word_boundary"){if(!y&&!p){const b=`(?:(?<=${dr})(?!${dr})|(?<!${dr})(?=${dr}))`,S=`(?:(?<=${dr})(?=${dr})|(?<!${dr})(?!${dr}))`;l(Tt(fr(d?S:b),t))}}else throw new Error(`Unexpected assertion kind "${h}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!hg(n)&&(n=ug(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:i}=e;i&&!hg(i)&&(i=ug(i,t),e.name=i),n.set(e.number,e),i&&n.set(i,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const i=Hh({body:[e]});n(Tt(i,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:i,minTargetEs2024:s,digitIsAscii:a,spaceIsAscii:l,wordIsAscii:u}){const{kind:h,negate:d,value:p}=e;if(a&&(h==="digit"||p==="digit")){n(ls(C_("digit",{negate:d}),t));return}if(l&&(h==="space"||p==="space")){n(Tt(dg(fr(xH),d),t));return}if(u&&(h==="word"||p==="word")){n(ls(C_("word",{negate:d}),t));return}if(h==="any")n(ls(ha("Any"),t));else if(h==="digit")n(ls(ha("Nd",{negate:d}),t));else if(h!=="dot")if(h==="text_segment"){if(i==="strict")throw new Error(Oe`Use of "\X" requires non-strict accuracy`);const m="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",_=Oe`\p{RI}{2}|${m}(?:\u200D${m})*`;n(Tt(fr(Oe`(?>\r\n|${s?Oe`\p{RGI_Emoji}`:_}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(h==="hex")n(ls(ha("AHex",{negate:d}),t));else if(h==="newline")n(Tt(fr(d?`[^
|
|
204
|
+
]`:`(?>\r
|
|
205
|
+
?|[
|
|
206
|
+
\v\f
\u2028\u2029])`),t));else if(h==="posix")if(!s&&(p==="graph"||p==="print")){if(i==="strict")throw new Error(`POSIX class "${p}" requires min target ES2024 or non-strict accuracy`);let m={graph:"!-~",print:" -~"}[p];d&&(m=`\0-${Ut(m.codePointAt(0)-1)}${Ut(m.codePointAt(2)+1)}-`),n(Tt(fr(`[${m}]`),t))}else n(Tt(dg(fr(AH.get(p)),d),t));else if(h==="property")_y.has(lf(p))||(e.key="sc");else if(h==="space")n(ls(ha("space",{negate:d}),t));else if(h==="word")n(Tt(dg(fr(dr),d),t));else throw new Error(`Unexpected character set kind "${h}"`)},Directive({node:e,parent:t,root:n,remove:i,replaceWith:s,removeAllPrevSiblings:a,removeAllNextSiblings:l}){const{kind:u,flags:h}=e;if(u==="flags")if(!h.enable&&!h.disable)i();else{const d=yi({flags:h});d.body[0].body=l(),s(Tt(d,t),{traverse:!0})}else if(u==="keep"){const d=n.body[0],m=n.body.length===1&&$A(d,{type:"Group"})&&d.body[0].body.length===1?d.body[0]:n;if(t.parent!==m||m.body.length>1)throw new Error(Oe`Uses "\K" in a way that's unsupported`);const _=Js({behind:!0});_.body[0].body=a(),s(Tt(_,t))}else throw new Error(`Unexpected directive kind "${u}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:i}=e;if(i==="fail")n(Tt(Js({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${i.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=yi();t.body[0].body.push(e.body),e.body=Tt(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let i=!1,s=!1;for(const a of e.body)if(a.body.length===1&&a.body[0].kind==="search_start")a.body.pop();else{const l=oR(a.body);l?(i=!0,Array.isArray(l)?n.push(...l):n.push(l)):s=!0}i&&!s&&n.forEach(a=>t.add(a))},exit(e,{accuracy:t,passedLookbehind:n,strategy:i}){if(t==="strict"&&n&&i)throw new Error(Oe`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!hg(n)&&(n=ug(n,t),e.ref=n)}},NH={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:i,ref:s}=e;i||n.set(e,[...t.get(s).map(({node:a})=>a)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:i},{groupOriginByCopy:s,groupsByName:a,multiplexCapturesToLeftByRef:l,openRefs:u,reffedNodesByReferencer:h}){const d=s.get(e);if(d&&u.has(e.number)){const m=ls(Hx(e.number),t);h.set(m,u.get(e.number)),n(m);return}u.set(e.number,e),l.set(e.number,[]),e.name&&_c(l,e.name,[]);const p=l.get(e.name??e.number);for(let m=0;m<p.length;m++){const _=p[m];if(d===_.node||d&&d===_.origin||e===_.origin){p.splice(m,1);break}}if(l.get(e.number).push({node:e,origin:d}),e.name&&l.get(e.name).push({node:e,origin:d}),e.name){const m=_c(a,e.name,new Map);let _=!1;if(d)_=!0;else for(const y of m.values())if(!y.hasDuplicateNameToRemove){_=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:_})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Sd(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},i){const{isRecursive:s,ref:a}=e;if(s){let p=t;for(;(p=p.parent)&&!(p.type==="CapturingGroup"&&(p.name===a||p.number===a)););i.reffedNodesByReferencer.set(e,p);return}const l=i.subroutineRefMap.get(a),u=a===0,h=u?Hx(0):iR(l,i.groupOriginByCopy,null);let d=h;if(!u){const p=rR(BH(l,_=>_.type==="Group"&&!!_.flags)),m=p?Sd(i.globalFlags,p):i.globalFlags;LH(m,i.currentFlags)||(d=yi({flags:IH(m)}),d.body[0].body.push(h))}n(Tt(d,t),{traverse:!u})}},OH={Backreference({node:e,parent:t,replaceWith:n},i){if(e.orphan){i.highestOrphanBackref=Math.max(i.highestOrphanBackref,e.ref);return}const a=i.reffedNodesByReferencer.get(e).filter(l=>PH(l,e));if(!a.length)n(Tt(Js({negate:!0}),t));else if(a.length>1){const l=yi({atomic:!0,body:a.reverse().map(u=>fo({body:[x_(u.number)]}))});n(Tt(l,t))}else e.ref=a[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let i=0;i<n;i++){const s=GA();e.body.at(-1).body.push(s)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function nR(e){sc(e,{"*"({node:t,parent:n}){t.parent=n}})}function LH(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function PH(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const i=sR(n.parent);for(const s of i){if(s===n)break;if(s===e||aR(s,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function iR(e,t,n,i){const s=Array.isArray(e)?[]:{};for(const[a,l]of Object.entries(e))a==="parent"?s.parent=Array.isArray(n)?i:n:l&&typeof l=="object"?s[a]=iR(l,t,s,n):(a==="type"&&l==="CapturingGroup"&&t.set(s,t.get(e)??e),s[a]=l);return s}function Hx(e){const t=KA(e);return t.isRecursive=!0,t}function BH(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function ug(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function rR(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:i})=>{t.forEach(s=>{i.enable?.[s]&&(delete n.disable[s],n.enable[s]=!0),i.disable?.[s]&&(n.disable[s]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function IH({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function sR(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function oR(e){const t=e.find(n=>n.kind==="search_start"||HH(n,{negate:!1})||!jH(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const i of t.body){const s=oR(i.body);if(!s)return null;Array.isArray(s)?n.push(...s):n.push(s)}return n}return null}function aR(e,t){const n=sR(e)??[];for(const i of n)if(i===t||aR(i,t))return!0;return!1}function jH({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function zH(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function HH(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&$A(e.body[0],{type:"Assertion",kind:"search_start"})}function hg(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function fr(e,t){const i=WA(e,{...t,unicodePropertyMap:_y}).body;return i.length>1||i[0].body.length>1?yi({body:i}):i[0].body[0]}function dg(e,t){return e.negate=t,e}function ls(e,t){return e.parent=t,e}function Tt(e,t){return nR(e),e.parent=t,e}function VH(e,t){const n=JA(t),i=k_(n.target,"ES2024"),s=k_(n.target,"ES2025"),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw new Error("Invalid recursionLimit; use 2-20");let l=null,u=null;if(!s){const y=[e.flags.ignoreCase];sc(e,UH,{getCurrentModI:()=>y.at(-1),popModI(){y.pop()},pushModI(b){y.push(b)},setHasCasedChar(){y.at(-1)?l=!0:u=!0}})}const h={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||l)&&!u)};let d=e;const p={accuracy:n.accuracy,appliedGlobalFlags:h,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:d,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!s&&l&&u),useFlagMods:s,useFlagV:i,verbose:n.verbose};function m(y){return p.lastNode=d,d=y,SH(FH[y.type],`Unexpected node type "${y.type}"`)(y,p,m)}const _={pattern:e.body.map(m).join("|"),flags:m(e.flags),options:{...e.options}};return i||(delete _.options.force.v,_.options.disable.v=!0,_.options.unicodeSetsPlugin=null),_._captureTransfers=new Map,_._hiddenCaptures=[],p.captureMap.forEach((y,b)=>{y.hidden&&_._hiddenCaptures.push(b),y.transferTo&&_c(_._captureTransfers,y.transferTo,[]).push(b)}),_}var UH={"*":{enter({node:e},t){if(Ux(e)){const n=t.getCurrentModI();t.pushModI(e.flags?Sd({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Ux(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){vy(Ut(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),lR(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&tR.has(e.value)&&t.setHasCasedChar()}},FH={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?Oe`\B`:Oe`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:i,name:s,number:a}=e,l={ignoreCase:t.currentFlags.ignoreCase},u=t.originMap.get(e);return u&&(l.hidden=!0,a>u.number&&(l.transferTo=u.number)),t.captureMap.set(a,l),`(${s?`?<${s}>`:""}${i.map(n).join("|")})`},Character({value:e},t){const n=Ut(e),i=aa(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(i!==n)return i;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&vy(n)){const s=eR(n);return t.inCharClass?s.join(""):s.length>1?`[${s.join("")}]`:s[0]}return n},CharacterClass(e,t,n){const{kind:i,negate:s,parent:a}=e;let{body:l}=e;if(i==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");yr.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&l.some(Fx)&&(l=[af(45),...l.filter(d=>!Fx(d))]);const u=()=>`[${s?"^":""}${l.map(n).join(i==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||yr.bugNestedClassIgnoresNegation)&&!s){const p=l.filter(m=>m.type==="CharacterClass"&&m.kind==="union"&&m.negate);if(p.length){const m=yi(),_=m.body[0];return m.parent=a,_.parent=m,l=l.filter(y=>!p.includes(y)),e.body=l,l.length?(e.parent=_,_.body.push(e)):m.body.pop(),p.forEach(y=>{const b=fo({body:[y]});y.parent=b,b.parent=m,m.body.push(b)}),n(m)}}t.inCharClass=!0;const d=u();return t.inCharClass=!1,d}const h=l[0];if(i==="union"&&!s&&h&&((!t.useFlagV||!t.verbose)&&a.kind==="union"&&!(yr.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind==="intersection"&&l.length===1&&h.type!=="CharacterClassRange"))return l.map(n).join("");if(!t.useFlagV&&a.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return u()},CharacterClassRange(e,t){const n=e.min.value,i=e.max.value,s={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=aa(n,s),l=aa(i,s),u=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const h=lR(e);KH(h).forEach(p=>{u.add(Array.isArray(p)?`${aa(p[0],s)}-${aa(p[1],s)}`:aa(p,s))})}return`${a}-${l}${[...u].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:i},s){if(e==="dot")return s.currentFlags.dotAll?s.appliedGlobalFlags.dotAll||s.useFlagMods?".":"[^]":Oe`[^\n]`;if(e==="digit")return t?Oe`\D`:Oe`\d`;if(e==="property"){if(s.useAppliedIgnoreCase&&s.currentFlags.ignoreCase&&tR.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Oe`\P`:Oe`\p`}{${i?`${i}=`:""}${n}}`}if(e==="word")return t?Oe`\W`:Oe`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:i},s,a){const l=s.currentFlags;n&&(s.currentFlags=Sd(l,n));const u=t.map(a).join("|"),h=!s.verbose&&t.length===1&&i.type!=="Quantifier"&&!e&&(!s.useFlagMods||!n)?u:`(?${YH(e,n,s.useFlagMods)}${u})`;return s.currentFlags=l,h},LookaroundAssertion({body:e,kind:t,negate:n},i,s){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(s).join("|")})`},Quantifier(e,t,n){return n(e.body)+XH(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const i=n.recursionLimit;return t===0?`(?R=${i})`:Oe`\g<${t}&R=${i}>`}},$H=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),WH=new Set(["-","\\","]","^","["]),GH=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Vx=new Map([[9,Oe`\t`],[10,Oe`\n`],[11,Oe`\v`],[12,Oe`\f`],[13,Oe`\r`],[8232,Oe`\u2028`],[8233,Oe`\u2029`],[65279,Oe`\uFEFF`]]),qH=new RegExp("^\\p{Cased}$","u");function vy(e){return qH.test(e)}function lR(e,t){const n=!!t?.firstOnly,i=e.min.value,s=e.max.value,a=[];if(i<65&&(s===65535||s>=131071)||i===65536&&s>=131071)return a;for(let l=i;l<=s;l++){const u=Ut(l);if(!vy(u))continue;const h=eR(u).filter(d=>{const p=d.codePointAt(0);return p<i||p>s});if(h.length&&(a.push(...h),n))break}return a}function aa(e,{escDigit:t,inCharClass:n,useFlagV:i}){if(Vx.has(e))return Vx.get(e);if(e<32||e>126&&e<160||e>262143||t&&ZH(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const s=n?i?GH:WH:$H,a=Ut(e);return(s.has(a)?"\\":"")+a}function KH(e){const t=e.map(s=>s.codePointAt(0)).sort((s,a)=>s-a),n=[];let i=null;for(let s=0;s<t.length;s++)t[s+1]===t[s]+1?i??=t[s]:i===null?n.push(t[s]):(n.push([i,t[s]]),i=null);return n}function YH(e,t,n){if(e)return">";let i="";if(t&&n){const{enable:s,disable:a}=t;i=(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")+(a?"-":"")+(a?.ignoreCase?"i":"")+(a?.dotAll?"s":"")}return`${i}:`}function XH({kind:e,max:t,min:n}){let i;return!n&&t===1?i="?":!n&&t===1/0?i="*":n===1&&t===1/0?i="+":n===t?i=`{${n}}`:i=`{${n},${t===1/0?"":t}}`,i+{greedy:"",lazy:"?",possessive:"+"}[e]}function Ux({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function ZH(e){return e>47&&e<58}function Fx({type:e,value:t}){return e==="Character"&&t===45}var QH=class T_ extends RegExp{#t=new Map;#e=null;#i;#n=null;#r=null;rawOptions={};get source(){return this.#i||"(?:)"}constructor(t,n,i){const s=!!i?.lazyCompile;if(t instanceof RegExp){if(i)throw new Error("Cannot provide options when copying a regexp");const a=t;super(a,n),this.#i=a.source,a instanceof T_&&(this.#t=a.#t,this.#n=a.#n,this.#r=a.#r,this.rawOptions=a.rawOptions)}else{const a={hiddenCaptures:[],strategy:null,transfers:[],...i};super(s?"":t,n),this.#i=t,this.#t=eV(a.hiddenCaptures,a.transfers),this.#r=a.strategy,this.rawOptions=i??{}}s||(this.#e=this)}exec(t){if(!this.#e){const{lazyCompile:s,...a}=this.rawOptions;this.#e=new T_(this.#i,this.flags,a)}const n=this.global||this.sticky,i=this.lastIndex;if(this.#r==="clip_search"&&n&&i){this.lastIndex=0;const s=this.#s(t.slice(i));return s&&(JH(s,i,t,this.hasIndices),this.lastIndex+=i),s}return this.#s(t)}#s(t){this.#e.lastIndex=this.lastIndex;const n=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;const i=[...n];n.length=1;let s;this.hasIndices&&(s=[...n.indices],n.indices.length=1);const a=[0];for(let l=1;l<i.length;l++){const{hidden:u,transferTo:h}=this.#t.get(l)??{};if(u?a.push(null):(a.push(n.length),n.push(i[l]),this.hasIndices&&n.indices.push(s[l])),h&&i[l]!==void 0){const d=a[h];if(!d)throw new Error(`Invalid capture transfer to "${d}"`);if(n[d]=i[l],this.hasIndices&&(n.indices[d]=s[l]),n.groups){this.#n||(this.#n=tV(this.source));const p=this.#n.get(h);p&&(n.groups[p]=i[l],this.hasIndices&&(n.indices.groups[p]=s[l]))}}}return n}};function JH(e,t,n,i){if(e.index+=t,e.input=n,i){const s=e.indices;for(let l=0;l<s.length;l++){const u=s[l];u&&(s[l]=[u[0]+t,u[1]+t])}const a=s.groups;a&&Object.keys(a).forEach(l=>{const u=a[l];u&&(a[l]=[u[0]+t,u[1]+t])})}}function eV(e,t){const n=new Map;for(const i of e)n.set(i,{hidden:!0});for(const[i,s]of t)for(const a of s)_c(n,a,{}).transferTo=i;return n}function tV(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let i=0,s=0,a;for(;a=t.exec(e);){const{0:l,groups:{capture:u,name:h}}=a;l==="["?i++:i?l==="]"&&i--:u&&(s++,h&&n.set(s,h))}return n}function nV(e,t){const n=iV(e,t);return n.options?new QH(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function iV(e,t){const n=JA(t),i=WA(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:_y}),s=MH(i,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),a=VH(s,n),l=yH(a.pattern,{captureTransfers:a._captureTransfers,hiddenCaptures:a._hiddenCaptures,mode:"external"}),u=_H(l.pattern),h=gH(u.pattern,{captureTransfers:l.captureTransfers,hiddenCaptures:l.hiddenCaptures}),d={pattern:h.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${a.flags}${a.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const p=h.hiddenCaptures.sort((b,S)=>b-S),m=Array.from(h.captureTransfers),_=s._strategy,y=d.pattern.length>=n.lazyCompileLength;(p.length||m.length||_||y)&&(d.options={...p.length&&{hiddenCaptures:p},...m.length&&{transfers:m},..._&&{strategy:_},...y&&{lazyCompile:y}})}return d}function rV(e,t){return nV(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function sV(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||=n=>rV(n,{target:t.target}),{createScanner(n){return new b8(n,t)},createString(n){return{content:n}}}}const oV={"angular-html":()=>Me(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])),"angular-ts":()=>Me(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])),bash:()=>Me(()=>import("./shellscript-DfDnw5Jg.js").then(e=>e.b),[]),c:()=>Me(()=>import("./c-BIGW1oBm.js"),[]),cpp:()=>Me(()=>import("./cpp-BRuaLJcg.js"),__vite__mapDeps([6,7,8])),csharp:()=>Me(()=>import("./csharp-COcwbKMJ.js"),[]),css:()=>Me(()=>import("./css-CLj8gQPS.js"),[]),dockerfile:()=>Me(()=>import("./dockerfile-BcOcwvcX.js"),[]),dotenv:()=>Me(()=>import("./dotenv-Da5cRb03.js"),[]),go:()=>Me(()=>import("./go-C27-OAKa.js"),[]),graphql:()=>Me(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([9,2,10,11,12])),html:()=>Me(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])),http:()=>Me(()=>import("./http-l_GQhCeT.js"),__vite__mapDeps([13,14,15,16,17,9,2,10,11,12])),ini:()=>Me(()=>import("./ini-BEwlwnbL.js"),[]),java:()=>Me(()=>import("./java-CylS5w8V.js"),[]),javascript:()=>Me(()=>import("./javascript-wDzz0qaB.js"),[]),json:()=>Me(()=>import("./json-Cp-IABpG.js"),[]),jsonc:()=>Me(()=>import("./jsonc-Des-eS-w.js"),[]),jsonl:()=>Me(()=>import("./jsonl-DcaNXYhu.js"),[]),jsx:()=>Me(()=>import("./jsx-g9-lgVsj.js"),[]),kotlin:()=>Me(()=>import("./kotlin-BdnUsdx6.js"),[]),kusto:()=>Me(()=>import("./kusto-wEQ09or8.js"),[]),latex:()=>Me(()=>import("./latex-DdMFrP5M.js"),[]),markdown:()=>Me(()=>import("./markdown-Cvjx9yec.js"),[]),mdc:()=>Me(()=>import("./mdc-Dz5ISc6g.js"),__vite__mapDeps([18,19,20,21,1,2,3])),mdx:()=>Me(()=>import("./mdx-Cmh6b_Ma.js"),[]),mermaid:()=>Me(()=>import("./mermaid-mWjccvbQ.js"),[]),php:()=>Me(()=>import("./php-R6g_5hLQ.js"),__vite__mapDeps([22,1,2,3,16,17,8,15])),powershell:()=>Me(()=>import("./powershell-Dpen1YoG.js"),[]),python:()=>Me(()=>import("./python-B6aJPvgy.js"),[]),ruby:()=>Me(()=>import("./ruby-AcS3PBV-.js"),__vite__mapDeps([23,1,2,3,16,17,8,9,10,11,12,6,7,14,20])),rust:()=>Me(()=>import("./rust-B1yitclQ.js"),[]),sass:()=>Me(()=>import("./sass-Cj5Yp3dK.js"),[]),scss:()=>Me(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])),shell:()=>Me(()=>import("./shellscript-DfDnw5Jg.js").then(e=>e.a),[]),sql:()=>Me(()=>import("./sql-BLtJtn59.js"),[]),svelte:()=>Me(()=>import("./svelte-DR4MIrkg.js"),__vite__mapDeps([24,2,10,3])),swift:()=>Me(()=>import("./swift-D82vCrfD.js"),[]),toml:()=>Me(()=>import("./toml-vGWfd6FD.js"),[]),tsx:()=>Me(()=>import("./tsx-COt5Ahok.js"),[]),typescript:()=>Me(()=>import("./typescript-BPQ3VLAy.js"),[]),vue:()=>Me(()=>import("./vue-CJgBXYWu.js"),__vite__mapDeps([25,3,2,10,15,1,21])),xml:()=>Me(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([16,17])),yaml:()=>Me(()=>import("./yaml-Buea-lGh.js"),[]),zig:()=>Me(()=>import("./zig-VOosw3JB.js"),[])};let fg=null;function aV(){return fg||(fg=y8({themes:[Me(()=>import("./github-dark-DHJKELXO.js"),[])],langs:[],engine:sV()})),fg}async function lV(e,t){const n=await aV(),i=oV[t];if(i&&!n.getLoadedLanguages().includes(t)){const a=await i();await n.loadLanguage(a)}const s=n.getLoadedLanguages().includes(t)?t:"text";return n.codeToHtml(e,{lang:s,theme:"github-dark"})}function cV({file:e,onBack:t}){const{data:n,loading:i}=E6(e),[s,a]=x.useState(null),l=e;return x.useEffect(()=>{if(!n?.content){a(null);return}let u=!1;return lV(n.content,n.language).then(h=>{u||a(h)}).catch(()=>{u||a(null)}),()=>{u=!0}},[n]),w.jsxs("div",{className:"flex flex-col h-full",children:[w.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border shrink-0",children:[w.jsx("button",{onClick:t,className:"p-1 rounded-md hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:"Back to file list",children:w.jsx(iy,{className:"h-4 w-4"})}),w.jsx("span",{className:"text-xs font-mono text-foreground truncate",title:e,children:l}),n?.language&&n.language!=="text"&&w.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:n.language})]}),w.jsx(ho,{className:"flex-1 min-h-0",children:i&&!n?Array.from({length:8}).map((u,h)=>w.jsx(wa,{className:"h-5 mx-3 mb-1 rounded"},h)):s?w.jsx("div",{className:"text-xs leading-5 [&_pre]:!bg-transparent [&_pre]:p-3 [&_pre]:m-0 [&_code]:!bg-transparent",dangerouslySetInnerHTML:{__html:s}}):n?.content?w.jsx("div",{className:"text-xs font-mono leading-5 p-3 whitespace-pre-wrap break-all text-foreground/80",children:n.content}):w.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"Unable to load file"})})]})}const $x={".js":"javascript",".jsx":"javascript",".ts":"typescript",".tsx":"typescript",".mjs":"javascript",".cjs":"javascript",".html":"html",".htm":"html",".css":"css",".scss":"css",".less":"css",".svg":"image",".png":"image",".jpg":"image",".jpeg":"image",".gif":"image",".ico":"image",".webp":"image",".json":"json",".yaml":"yaml",".yml":"yaml",".toml":"config",".xml":"xml",".csv":"data",".md":"markdown",".mdx":"markdown",".txt":"text",".pdf":"document",".env":"config",".gitignore":"config",".editorconfig":"config",".sh":"shell",".bash":"shell",".zsh":"shell",".bat":"shell",".cmd":"shell",".ps1":"shell",".py":"python",".go":"go",".rs":"rust",".java":"java",".c":"c",".cpp":"cpp",".h":"c",".hpp":"cpp"},Wx={"package.json":"npm","package-lock.json":"npm","tsconfig.json":"typescript","vite.config.ts":"vite","vite.config.js":"vite","tailwind.config.js":"tailwind","tailwind.config.ts":"tailwind","postcss.config.js":"config","postcss.config.cjs":"config",".gitignore":"git",".eslintrc":"eslint",".eslintrc.js":"eslint",".eslintrc.json":"eslint","eslint.config.js":"eslint",Dockerfile:"docker","docker-compose.yml":"docker","README.md":"readme",LICENSE:"license",Makefile:"config"};function uV(e){if(Wx[e])return Wx[e];const t=e.lastIndexOf(".");if(t!==-1){const n=e.slice(t).toLowerCase();if($x[n])return $x[n]}return"file"}const hV={typescript:ts,javascript:ts,json:Xm,npm:Y1,html:RI,css:X1,image:mI,markdown:hh,readme:tI,text:hh,config:Ym,shell:YI,git:EI,yaml:Xm,xml:Xm,data:DI,python:ts,go:ts,rust:ts,java:ts,c:ts,cpp:ts,docker:Y1,eslint:Ym,vite:Ym,tailwind:X1,license:hh,document:hh,file:XT},dV={typescript:"text-blue-400",javascript:"text-yellow-400",json:"text-yellow-600",npm:"text-red-400",html:"text-orange-400",css:"text-blue-300",image:"text-green-400",markdown:"text-gray-400",readme:"text-blue-300",config:"text-gray-500",shell:"text-green-500",git:"text-orange-500",yaml:"text-purple-400",python:"text-yellow-500",vite:"text-purple-400",tailwind:"text-cyan-400"};function cR({entry:e,depth:t,onDirectoryToggle:n,onFileClick:i,expandedDirs:s,dirCache:a,loadingDirs:l}){const u=e.type==="directory",h=s.has(e.path),d=l.has(e.path),p=x.useCallback(()=>{u?n(e.path):i?.(e.path)},[u,e.path,n,i]),m=u?null:uV(e.name),_=m?hV[m]||XT:null,y=m?dV[m]||"text-muted-foreground":"",b=u?a[e.path]:void 0;return w.jsxs(w.Fragment,{children:[w.jsxs("button",{onClick:p,className:"flex items-center w-full px-1 py-0.5 text-sm hover:bg-accent/50 rounded-sm transition-colors group text-left",style:{paddingLeft:`${t*16+4}px`},children:[u?w.jsx("span",{className:"w-4 h-4 flex items-center justify-center shrink-0 mr-0.5",children:h?w.jsx(ry,{className:"h-3.5 w-3.5 text-muted-foreground"}):w.jsx(oI,{className:"h-3.5 w-3.5 text-muted-foreground"})}):w.jsx("span",{className:"w-4 h-4 shrink-0 mr-0.5"}),u?h?w.jsx(yI,{className:"h-4 w-4 text-yellow-500 shrink-0 mr-1.5"}):w.jsx(xI,{className:"h-4 w-4 text-yellow-600 shrink-0 mr-1.5"}):_&&w.jsx(_,{className:`h-4 w-4 shrink-0 mr-1.5 ${y}`}),w.jsx("span",{className:"truncate text-foreground/90",children:e.name})]}),u&&h&&w.jsx(w.Fragment,{children:d?w.jsx("div",{className:"flex items-center text-xs text-muted-foreground animate-pulse",style:{paddingLeft:`${(t+1)*16+24}px`},children:"Loading..."}):b&&b.length===0?w.jsx("div",{className:"text-xs text-muted-foreground italic",style:{paddingLeft:`${(t+1)*16+24}px`},children:"(empty)"}):b?.map(S=>w.jsx(cR,{entry:S,depth:t+1,onDirectoryToggle:n,onFileClick:i,expandedDirs:s,dirCache:a,loadingDirs:l},S.path))})]})}async function pg(e){const t=await fetch(`/api/files?path=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`API error: ${t.status}`);return t.json()}const fV=x.forwardRef(function({onFileClick:t},n){const[i,s]=x.useState([]),[a,l]=x.useState({}),[u,h]=x.useState(new Set),[d,p]=x.useState(new Set),[m,_]=x.useState(null);x.useEffect(()=>{pg("").then(C=>{s(C),_(null)}).catch(C=>{_(C.message)})},[]);const y=x.useCallback(()=>{l({}),h(new Set),pg("").then(C=>{s(C),_(null)}).catch(C=>{_(C.message)})},[]);x.useImperativeHandle(n,()=>({refresh:y}),[y]);const b=x.useCallback(C=>{h(k=>{const T=new Set(k);return T.has(C)?T.delete(C):(T.add(C),a[C]||(p(R=>new Set(R).add(C)),pg(C).then(R=>{l(A=>({...A,[C]:R})),p(A=>{const N=new Set(A);return N.delete(C),N})}).catch(()=>{p(R=>{const A=new Set(R);return A.delete(C),A})}))),T})},[a]),S=x.useCallback(C=>C.map(k=>w.jsx(cR,{entry:k,depth:0,onDirectoryToggle:b,onFileClick:t,expandedDirs:u,dirCache:a,loadingDirs:d},k.path)),[a,u,d,b,t]);return w.jsx(ho,{className:"h-full",children:w.jsx("div",{className:"py-1",children:m?w.jsx("div",{className:"px-3 py-2 text-xs text-destructive",children:m}):i.length===0?w.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground animate-pulse",children:"Loading..."}):S(i)})})}),pV={M:{label:"Modified",color:"text-yellow-400"},A:{label:"Added",color:"text-green-400"},D:{label:"Deleted",color:"text-red-400"},R:{label:"Renamed",color:"text-blue-400"},C:{label:"Copied",color:"text-blue-400"},"??":{label:"Untracked",color:"text-muted-foreground"},MM:{label:"Modified",color:"text-yellow-400"},AM:{label:"Added",color:"text-green-400"}};function mV(e){return pV[e]||{label:e,color:"text-muted-foreground"}}function gV({onCollapse:e,onBeadClick:t,highlightedBeadId:n}){const{data:i,loading:s}=S6(),[a,l]=x.useState(""),[u,h]=x.useState(()=>localStorage.getItem("beads-board-git-tab")||"log"),[d,p]=x.useState(null),[m,_]=x.useState(null),y=x.useRef(null),b=a||i?.current||"",{data:S,loading:C}=b6(b),{data:k,loading:T}=x6(),R=!!(m||d);return w.jsxs("div",{className:"flex flex-col h-full border-l border-border",children:[m?w.jsx(cV,{file:m,onBack:()=>_(null)}):d?w.jsx(R6,{file:d,onBack:()=>p(null)}):null,w.jsxs("div",{className:`flex flex-col flex-1 min-h-0 ${R?"hidden":""}`,children:[w.jsxs("div",{className:"p-3 border-b border-border shrink-0",children:[w.jsxs("div",{className:"flex items-center justify-between mb-2",children:[w.jsx("h2",{className:"text-sm font-semibold",children:"Git"}),e&&w.jsx("button",{onClick:e,className:"p-1 rounded-md hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:"Collapse git log",children:w.jsx(II,{className:"h-4 w-4"})})]}),s?w.jsx(wa,{className:"h-9 w-full"}):i?w.jsx(d6,{branches:i.branches,current:b,onSelect:l}):null]}),w.jsxs(a6,{value:u,onValueChange:A=>{h(A),localStorage.setItem("beads-board-git-tab",A)},className:"flex flex-col flex-1 min-h-0",children:[w.jsxs("div",{className:"flex items-center justify-between mx-3 mt-2 shrink-0",children:[w.jsxs(c6,{children:[w.jsxs(Zm,{value:"files",className:"gap-1.5",children:[w.jsx(SI,{className:"h-3.5 w-3.5"}),"Files"]}),w.jsxs(Zm,{value:"log",className:"gap-1.5",children:[w.jsx(TI,{className:"h-3.5 w-3.5"}),"Log"]}),w.jsxs(Zm,{value:"diff",className:"gap-1.5",children:[w.jsx(fI,{className:"h-3.5 w-3.5"}),"Diff",k&&k.length>0&&w.jsx("span",{className:"ml-1 text-xs bg-primary/20 text-primary rounded-full px-1.5",children:k.length})]})]}),u==="files"&&w.jsx("button",{onClick:()=>y.current?.refresh(),className:"rounded-md p-1 hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:"Refresh files",children:w.jsx(VI,{className:"h-3.5 w-3.5"})})]}),w.jsx(Qm,{value:"files",className:"flex-1 min-h-0 mt-0",children:w.jsx(fV,{ref:y,onFileClick:_})}),w.jsx(Qm,{value:"log",className:"flex-1 min-h-0 mt-0",children:w.jsx(ho,{className:"h-full",children:C?Array.from({length:5}).map((A,N)=>w.jsx(wa,{className:"h-16 mx-3 mb-2 rounded"},N)):S?.length?S.map(A=>w.jsx(m6,{commit:A,onBeadClick:t,highlightedBeadId:n},A.hash)):w.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No commits"})})}),w.jsx(Qm,{value:"diff",className:"flex-1 min-h-0 mt-0",children:w.jsx(ho,{className:"h-full",children:T?Array.from({length:3}).map((A,N)=>w.jsx(wa,{className:"h-8 mx-3 mb-2 rounded"},N)):k?.length?w.jsx("div",{className:"px-3 py-2 space-y-1",children:k.map((A,N)=>{const V=mV(A.status);return w.jsxs("div",{className:"flex items-center gap-2 py-1.5 px-2 rounded-md hover:bg-accent/50 text-xs font-mono cursor-pointer",onClick:()=>p(A.path),children:[w.jsx("span",{className:"text-foreground truncate flex-1",title:A.path,children:A.path}),w.jsx("span",{className:`shrink-0 w-20 text-right ${V.color}`,children:V.label})]},N)})}):w.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"Working tree clean"})})})]})]})]})}function _V(){const[e,t]=x.useState(()=>typeof window>"u"?"dark":localStorage.getItem("beads-board-theme")||"dark");return x.useEffect(()=>{const i=document.documentElement;i.classList.remove("light","dark"),i.classList.add(e),localStorage.setItem("beads-board-theme",e)},[e]),{theme:e,toggle:()=>t(i=>i==="dark"?"light":"dark")}}function vV(){const{theme:e,toggle:t}=_V();return w.jsx("button",{onClick:t,className:"rounded-md p-2 hover:bg-muted transition-colors","aria-label":"Toggle theme",children:e==="dark"?"☀️":"🌙"})}const yy=x.createContext({});function by(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const yV=typeof window<"u",uR=yV?x.useLayoutEffect:x.useEffect,uf=x.createContext(null);function Sy(e,t){e.indexOf(t)===-1&&e.push(t)}function wd(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Ui=(e,t,n)=>n>t?t:n<e?e:n;let wy=()=>{};const wr={},hR=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function dR(e){return typeof e=="object"&&e!==null}const fR=e=>/^0[^.\s]+$/u.test(e);function pR(e){let t;return()=>(t===void 0&&(t=e()),t)}const ui=e=>e,bV=(e,t)=>n=>t(e(n)),Nc=(...e)=>e.reduce(bV),vc=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i};class xy{constructor(){this.subscriptions=[]}add(t){return Sy(this.subscriptions,t),()=>wd(this.subscriptions,t)}notify(t,n,i){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,i);else for(let a=0;a<s;a++){const l=this.subscriptions[a];l&&l(t,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Gn=e=>e*1e3,ci=e=>e/1e3;function mR(e,t){return t?e*(1e3/t):0}const gR=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,SV=1e-7,wV=12;function xV(e,t,n,i,s){let a,l,u=0;do l=t+(n-t)/2,a=gR(l,i,s)-e,a>0?n=l:t=l;while(Math.abs(a)>SV&&++u<wV);return l}function Oc(e,t,n,i){if(e===t&&n===i)return ui;const s=a=>xV(a,0,1,e,n);return a=>a===0||a===1?a:gR(s(a),t,i)}const _R=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,vR=e=>t=>1-e(1-t),yR=Oc(.33,1.53,.69,.99),Cy=vR(yR),bR=_R(Cy),SR=e=>(e*=2)<1?.5*Cy(e):.5*(2-Math.pow(2,-10*(e-1))),Ey=e=>1-Math.sin(Math.acos(e)),wR=vR(Ey),xR=_R(Ey),CV=Oc(.42,0,1,1),EV=Oc(0,0,.58,1),CR=Oc(.42,0,.58,1),kV=e=>Array.isArray(e)&&typeof e[0]!="number",ER=e=>Array.isArray(e)&&typeof e[0]=="number",TV={linear:ui,easeIn:CV,easeInOut:CR,easeOut:EV,circIn:Ey,circInOut:xR,circOut:wR,backIn:Cy,backInOut:bR,backOut:yR,anticipate:SR},AV=e=>typeof e=="string",Gx=e=>{if(ER(e)){wy(e.length===4);const[t,n,i,s]=e;return Oc(t,n,i,s)}else if(AV(e))return TV[e];return e},yh=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function RV(e,t){let n=new Set,i=new Set,s=!1,a=!1;const l=new WeakSet;let u={delta:0,timestamp:0,isProcessing:!1};function h(p){l.has(p)&&(d.schedule(p),e()),p(u)}const d={schedule:(p,m=!1,_=!1)=>{const b=_&&s?n:i;return m&&l.add(p),b.has(p)||b.add(p),p},cancel:p=>{i.delete(p),l.delete(p)},process:p=>{if(u=p,s){a=!0;return}s=!0,[n,i]=[i,n],n.forEach(h),n.clear(),s=!1,a&&(a=!1,d.process(p))}};return d}const MV=40;function kR(e,t){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,l=yh.reduce((R,A)=>(R[A]=RV(a),R),{}),{setup:u,read:h,resolveKeyframes:d,preUpdate:p,update:m,preRender:_,render:y,postRender:b}=l,S=()=>{const R=wr.useManualTiming?s.timestamp:performance.now();n=!1,wr.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(R-s.timestamp,MV),1)),s.timestamp=R,s.isProcessing=!0,u.process(s),h.process(s),d.process(s),p.process(s),m.process(s),_.process(s),y.process(s),b.process(s),s.isProcessing=!1,n&&t&&(i=!1,e(S))},C=()=>{n=!0,i=!0,s.isProcessing||e(S)};return{schedule:yh.reduce((R,A)=>{const N=l[A];return R[A]=(V,H=!1,z=!1)=>(n||C(),N.schedule(V,H,z)),R},{}),cancel:R=>{for(let A=0;A<yh.length;A++)l[yh[A]].cancel(R)},state:s,steps:l}}const{schedule:at,cancel:_s,state:on,steps:mg}=kR(typeof requestAnimationFrame<"u"?requestAnimationFrame:ui,!0);let Vh;function DV(){Vh=void 0}const vn={now:()=>(Vh===void 0&&vn.set(on.isProcessing||wr.useManualTiming?on.timestamp:performance.now()),Vh),set:e=>{Vh=e,queueMicrotask(DV)}},TR=e=>t=>typeof t=="string"&&t.startsWith(e),AR=TR("--"),NV=TR("var(--"),ky=e=>NV(e)?OV.test(e.split("/*")[0].trim()):!1,OV=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function qx(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Va={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},yc={...Va,transform:e=>Ui(0,1,e)},bh={...Va,default:1},oc=e=>Math.round(e*1e5)/1e5,Ty=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function LV(e){return e==null}const PV=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ay=(e,t)=>n=>!!(typeof n=="string"&&PV.test(n)&&n.startsWith(e)||t&&!LV(n)&&Object.prototype.hasOwnProperty.call(n,t)),RR=(e,t,n)=>i=>{if(typeof i!="string")return i;const[s,a,l,u]=i.match(Ty);return{[e]:parseFloat(s),[t]:parseFloat(a),[n]:parseFloat(l),alpha:u!==void 0?parseFloat(u):1}},BV=e=>Ui(0,255,e),gg={...Va,transform:e=>Math.round(BV(e))},no={test:Ay("rgb","red"),parse:RR("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+gg.transform(e)+", "+gg.transform(t)+", "+gg.transform(n)+", "+oc(yc.transform(i))+")"};function IV(e){let t="",n="",i="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,i+=i,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}}const A_={test:Ay("#"),parse:IV,transform:no.transform},Lc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),cs=Lc("deg"),Hi=Lc("%"),be=Lc("px"),jV=Lc("vh"),zV=Lc("vw"),Kx={...Hi,parse:e=>Hi.parse(e)/100,transform:e=>Hi.transform(e*100)},pa={test:Ay("hsl","hue"),parse:RR("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+Hi.transform(oc(t))+", "+Hi.transform(oc(n))+", "+oc(yc.transform(i))+")"},Lt={test:e=>no.test(e)||A_.test(e)||pa.test(e),parse:e=>no.test(e)?no.parse(e):pa.test(e)?pa.parse(e):A_.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?no.transform(e):pa.transform(e),getAnimatableNone:e=>{const t=Lt.parse(e);return t.alpha=0,Lt.transform(t)}},HV=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function VV(e){return isNaN(e)&&typeof e=="string"&&(e.match(Ty)?.length||0)+(e.match(HV)?.length||0)>0}const MR="number",DR="color",UV="var",FV="var(",Yx="${}",$V=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Na(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},s=[];let a=0;const u=t.replace($V,h=>(Lt.test(h)?(i.color.push(a),s.push(DR),n.push(Lt.parse(h))):h.startsWith(FV)?(i.var.push(a),s.push(UV),n.push(h)):(i.number.push(a),s.push(MR),n.push(parseFloat(h))),++a,Yx)).split(Yx);return{values:n,split:u,indexes:i,types:s}}function WV(e){return Na(e).values}function NR({split:e,types:t}){const n=e.length;return i=>{let s="";for(let a=0;a<n;a++)if(s+=e[a],i[a]!==void 0){const l=t[a];l===MR?s+=oc(i[a]):l===DR?s+=Lt.transform(i[a]):s+=i[a]}return s}}function GV(e){return NR(Na(e))}const qV=e=>typeof e=="number"?0:Lt.test(e)?Lt.getAnimatableNone(e):e,KV=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:qV(e);function YV(e){const t=Na(e);return NR(t)(t.values.map((i,s)=>KV(i,t.split[s])))}const bi={test:VV,parse:WV,createTransformer:GV,getAnimatableNone:YV};function _g(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function XV({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let s=0,a=0,l=0;if(!t)s=a=l=n;else{const u=n<.5?n*(1+t):n+t-n*t,h=2*n-u;s=_g(h,u,e+1/3),a=_g(h,u,e),l=_g(h,u,e-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(l*255),alpha:i}}function xd(e,t){return n=>n>0?t:e}const _t=(e,t,n)=>e+(t-e)*n,vg=(e,t,n)=>{const i=e*e,s=n*(t*t-i)+i;return s<0?0:Math.sqrt(s)},ZV=[A_,no,pa],QV=e=>ZV.find(t=>t.test(e));function Xx(e){const t=QV(e);if(!t)return!1;let n=t.parse(e);return t===pa&&(n=XV(n)),n}const Zx=(e,t)=>{const n=Xx(e),i=Xx(t);if(!n||!i)return xd(e,t);const s={...n};return a=>(s.red=vg(n.red,i.red,a),s.green=vg(n.green,i.green,a),s.blue=vg(n.blue,i.blue,a),s.alpha=_t(n.alpha,i.alpha,a),no.transform(s))},R_=new Set(["none","hidden"]);function JV(e,t){return R_.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function e7(e,t){return n=>_t(e,t,n)}function Ry(e){return typeof e=="number"?e7:typeof e=="string"?ky(e)?xd:Lt.test(e)?Zx:i7:Array.isArray(e)?OR:typeof e=="object"?Lt.test(e)?Zx:t7:xd}function OR(e,t){const n=[...e],i=n.length,s=e.map((a,l)=>Ry(a)(a,t[l]));return a=>{for(let l=0;l<i;l++)n[l]=s[l](a);return n}}function t7(e,t){const n={...e,...t},i={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(i[s]=Ry(e[s])(e[s],t[s]));return s=>{for(const a in i)n[a]=i[a](s);return n}}function n7(e,t){const n=[],i={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const a=t.types[s],l=e.indexes[a][i[a]],u=e.values[l]??0;n[s]=u,i[a]++}return n}const i7=(e,t)=>{const n=bi.createTransformer(t),i=Na(e),s=Na(t);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?R_.has(e)&&!s.values.length||R_.has(t)&&!i.values.length?JV(e,t):Nc(OR(n7(i,s),s.values),n):xd(e,t)};function LR(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?_t(e,t,n):Ry(e)(e,t)}const r7=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>at.update(t,n),stop:()=>_s(t),now:()=>on.isProcessing?on.timestamp:vn.now()}},PR=(e,t,n=10)=>{let i="";const s=Math.max(Math.round(t/n),2);for(let a=0;a<s;a++)i+=Math.round(e(a/(s-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Cd=2e4;function My(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<Cd;)t+=n,i=e.next(t);return t>=Cd?1/0:t}function s7(e,t=100,n){const i=n({...e,keyframes:[0,t]}),s=Math.min(My(i),Cd);return{type:"keyframes",ease:a=>i.next(s*a).value/t,duration:ci(s)}}const St={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function M_(e,t){return e*Math.sqrt(1-t*t)}const o7=12;function a7(e,t,n){let i=n;for(let s=1;s<o7;s++)i=i-e(i)/t(i);return i}const yg=.001;function l7({duration:e=St.duration,bounce:t=St.bounce,velocity:n=St.velocity,mass:i=St.mass}){let s,a,l=1-t;l=Ui(St.minDamping,St.maxDamping,l),e=Ui(St.minDuration,St.maxDuration,ci(e)),l<1?(s=d=>{const p=d*l,m=p*e,_=p-n,y=M_(d,l),b=Math.exp(-m);return yg-_/y*b},a=d=>{const m=d*l*e,_=m*n+n,y=Math.pow(l,2)*Math.pow(d,2)*e,b=Math.exp(-m),S=M_(Math.pow(d,2),l);return(-s(d)+yg>0?-1:1)*((_-y)*b)/S}):(s=d=>{const p=Math.exp(-d*e),m=(d-n)*e+1;return-yg+p*m},a=d=>{const p=Math.exp(-d*e),m=(n-d)*(e*e);return p*m});const u=5/e,h=a7(s,a,u);if(e=Gn(e),isNaN(h))return{stiffness:St.stiffness,damping:St.damping,duration:e};{const d=Math.pow(h,2)*i;return{stiffness:d,damping:l*2*Math.sqrt(i*d),duration:e}}}const c7=["duration","bounce"],u7=["stiffness","damping","mass"];function Qx(e,t){return t.some(n=>e[n]!==void 0)}function h7(e){let t={velocity:St.velocity,stiffness:St.stiffness,damping:St.damping,mass:St.mass,isResolvedFromDuration:!1,...e};if(!Qx(e,u7)&&Qx(e,c7))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),s=i*i,a=2*Ui(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:St.mass,stiffness:s,damping:a}}else{const n=l7({...e,velocity:0});t={...t,...n,mass:St.mass},t.isResolvedFromDuration=!0}return t}function Ed(e=St.visualDuration,t=St.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:s}=n;const a=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],u={done:!1,value:a},{stiffness:h,damping:d,mass:p,duration:m,velocity:_,isResolvedFromDuration:y}=h7({...n,velocity:-ci(n.velocity||0)}),b=_||0,S=d/(2*Math.sqrt(h*p)),C=l-a,k=ci(Math.sqrt(h/p)),T=Math.abs(C)<5;i||(i=T?St.restSpeed.granular:St.restSpeed.default),s||(s=T?St.restDelta.granular:St.restDelta.default);let R,A,N,V,H,z;if(S<1)N=M_(k,S),V=(b+S*k*C)/N,R=$=>{const K=Math.exp(-S*k*$);return l-K*(V*Math.sin(N*$)+C*Math.cos(N*$))},H=S*k*V+C*N,z=S*k*C-V*N,A=$=>Math.exp(-S*k*$)*(H*Math.sin(N*$)+z*Math.cos(N*$));else if(S===1){R=K=>l-Math.exp(-k*K)*(C+(b+k*C)*K);const $=b+k*C;A=K=>Math.exp(-k*K)*(k*$*K-b)}else{const $=k*Math.sqrt(S*S-1);R=B=>{const W=Math.exp(-S*k*B),M=Math.min($*B,300);return l-W*((b+S*k*C)*Math.sinh(M)+$*C*Math.cosh(M))/$};const K=(b+S*k*C)/$,I=S*k*K-C*$,P=S*k*C-K*$;A=B=>{const W=Math.exp(-S*k*B),M=Math.min($*B,300);return W*(I*Math.sinh(M)+P*Math.cosh(M))}}const J={calculatedDuration:y&&m||null,velocity:$=>Gn(A($)),next:$=>{if(!y&&S<1){const I=Math.exp(-S*k*$),P=Math.sin(N*$),B=Math.cos(N*$),W=l-I*(V*P+C*B),M=Gn(I*(H*P+z*B));return u.done=Math.abs(M)<=i&&Math.abs(l-W)<=s,u.value=u.done?l:W,u}const K=R($);if(y)u.done=$>=m;else{const I=Gn(A($));u.done=Math.abs(I)<=i&&Math.abs(l-K)<=s}return u.value=u.done?l:K,u},toString:()=>{const $=Math.min(My(J),Cd),K=PR(I=>J.next($*I).value,$,30);return $+"ms "+K},toTransition:()=>{}};return J}Ed.applyToOptions=e=>{const t=s7(e,100,Ed);return e.ease=t.ease,e.duration=Gn(t.duration),e.type="keyframes",e};const d7=5;function BR(e,t,n){const i=Math.max(t-d7,0);return mR(n-e(i),t-i)}function D_({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:a=500,modifyTarget:l,min:u,max:h,restDelta:d=.5,restSpeed:p}){const m=e[0],_={done:!1,value:m},y=z=>u!==void 0&&z<u||h!==void 0&&z>h,b=z=>u===void 0?h:h===void 0||Math.abs(u-z)<Math.abs(h-z)?u:h;let S=n*t;const C=m+S,k=l===void 0?C:l(C);k!==C&&(S=k-m);const T=z=>-S*Math.exp(-z/i),R=z=>k+T(z),A=z=>{const J=T(z),$=R(z);_.done=Math.abs(J)<=d,_.value=_.done?k:$};let N,V;const H=z=>{y(_.value)&&(N=z,V=Ed({keyframes:[_.value,b(_.value)],velocity:BR(R,z,_.value),damping:s,stiffness:a,restDelta:d,restSpeed:p}))};return H(0),{calculatedDuration:null,next:z=>{let J=!1;return!V&&N===void 0&&(J=!0,A(z),H(z)),N!==void 0&&z>=N?V.next(z-N):(!J&&A(z),_)}}}function f7(e,t,n){const i=[],s=n||wr.mix||LR,a=e.length-1;for(let l=0;l<a;l++){let u=s(e[l],e[l+1]);if(t){const h=Array.isArray(t)?t[l]||ui:t;u=Nc(h,u)}i.push(u)}return i}function p7(e,t,{clamp:n=!0,ease:i,mixer:s}={}){const a=e.length;if(wy(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=f7(t,i,s),h=u.length,d=p=>{if(l&&p<e[0])return t[0];let m=0;if(h>1)for(;m<e.length-2&&!(p<e[m+1]);m++);const _=vc(e[m],e[m+1],p);return u[m](_)};return n?p=>d(Ui(e[0],e[a-1],p)):d}function m7(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const s=vc(0,t,i);e.push(_t(n,1,s))}}function g7(e){const t=[0];return m7(t,e.length-1),t}function _7(e,t){return e.map(n=>n*t)}function v7(e,t){return e.map(()=>t||CR).splice(0,e.length-1)}function ac({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const s=kV(i)?i.map(Gx):Gx(i),a={done:!1,value:t[0]},l=_7(n&&n.length===t.length?n:g7(t),e),u=p7(l,t,{ease:Array.isArray(s)?s:v7(t,s)});return{calculatedDuration:e,next:h=>(a.value=u(h),a.done=h>=e,a)}}const y7=e=>e!==null;function Dy(e,{repeat:t,repeatType:n="loop"},i,s=1){const a=e.filter(y7),u=s<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!u||i===void 0?a[u]:i}const b7={decay:D_,inertia:D_,tween:ac,keyframes:ac,spring:Ed};function IR(e){typeof e.type=="string"&&(e.type=b7[e.type])}class Ny{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const S7=e=>e/100;class Oy extends Ny{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==vn.now()&&this.tick(vn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;IR(t);const{type:n=ac,repeat:i=0,repeatDelay:s=0,repeatType:a,velocity:l=0}=t;let{keyframes:u}=t;const h=n||ac;h!==ac&&typeof u[0]!="number"&&(this.mixKeyframes=Nc(S7,LR(u[0],u[1])),u=[0,100]);const d=h({...t,keyframes:u});a==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...u].reverse(),velocity:-l})),d.calculatedDuration===null&&(d.calculatedDuration=My(d));const{calculatedDuration:p}=d;this.calculatedDuration=p,this.resolvedDuration=p+s,this.totalDuration=this.resolvedDuration*(i+1)-s,this.generator=d}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:i,totalDuration:s,mixKeyframes:a,mirroredGenerator:l,resolvedDuration:u,calculatedDuration:h}=this;if(this.startTime===null)return i.next(0);const{delay:d=0,keyframes:p,repeat:m,repeatType:_,repeatDelay:y,type:b,onUpdate:S,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const k=this.currentTime-d*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?k<0:k>s;this.currentTime=Math.max(k,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let R=this.currentTime,A=i;if(m){const z=Math.min(this.currentTime,s)/u;let J=Math.floor(z),$=z%1;!$&&z>=1&&($=1),$===1&&J--,J=Math.min(J,m+1),J%2&&(_==="reverse"?($=1-$,y&&($-=y/u)):_==="mirror"&&(A=l)),R=Ui(0,1,$)*u}const N=T?{done:!1,value:p[0]}:A.next(R);a&&!T&&(N.value=a(N.value));let{done:V}=N;!T&&h!==null&&(V=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const H=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&V);return H&&b!==D_&&(N.value=Dy(p,this.options,C,this.speed)),S&&S(N.value),H&&this.finish(),N}then(t,n){return this.finished.then(t,n)}get duration(){return ci(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ci(t)}get time(){return ci(this.currentTime)}set time(t){t=Gn(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return BR(i=>this.generator.next(i).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(vn.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=ci(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=r7,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=n??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(vn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function w7(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const io=e=>e*180/Math.PI,N_=e=>{const t=io(Math.atan2(e[1],e[0]));return O_(t)},x7={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:N_,rotateZ:N_,skewX:e=>io(Math.atan(e[1])),skewY:e=>io(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},O_=e=>(e=e%360,e<0&&(e+=360),e),Jx=N_,eC=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),tC=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),C7={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:eC,scaleY:tC,scale:e=>(eC(e)+tC(e))/2,rotateX:e=>O_(io(Math.atan2(e[6],e[5]))),rotateY:e=>O_(io(Math.atan2(-e[2],e[0]))),rotateZ:Jx,rotate:Jx,skewX:e=>io(Math.atan(e[4])),skewY:e=>io(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function L_(e){return e.includes("scale")?1:0}function P_(e,t){if(!e||e==="none")return L_(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=C7,s=n;else{const u=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=x7,s=u}if(!s)return L_(t);const a=i[t],l=s[1].split(",").map(k7);return typeof a=="function"?a(l):l[a]}const E7=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return P_(n,t)};function k7(e){return parseFloat(e.trim())}const Ua=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Fa=new Set(Ua),nC=e=>e===Va||e===be,T7=new Set(["x","y","z"]),A7=Ua.filter(e=>!T7.has(e));function R7(e){const t=[];return A7.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const hs={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>P_(t,"x"),y:(e,{transform:t})=>P_(t,"y")};hs.translateX=hs.x;hs.translateY=hs.y;const so=new Set;let B_=!1,I_=!1,j_=!1;function jR(){if(I_){const e=Array.from(so).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const s=R7(i);s.length&&(n.set(i,s),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const s=n.get(i);s&&s.forEach(([a,l])=>{i.getValue(a)?.set(l)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}I_=!1,B_=!1,so.forEach(e=>e.complete(j_)),so.clear()}function zR(){so.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(I_=!0)})}function M7(){j_=!0,zR(),jR(),j_=!1}class Ly{constructor(t,n,i,s,a,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=s,this.element=a,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(so.add(this),B_||(B_=!0,at.read(zR),at.resolveKeyframes(jR))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:s}=this;if(t[0]===null){const a=s?.get(),l=t[t.length-1];if(a!==void 0)t[0]=a;else if(i&&n){const u=i.readValue(n,l);u!=null&&(t[0]=u)}t[0]===void 0&&(t[0]=l),s&&a===void 0&&s.set(t[0])}w7(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),so.delete(this)}cancel(){this.state==="scheduled"&&(so.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const D7=e=>e.startsWith("--");function HR(e,t,n){D7(t)?e.style.setProperty(t,n):e.style[t]=n}const N7={};function VR(e,t){const n=pR(e);return()=>N7[t]??n()}const O7=VR(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),UR=VR(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ql=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,iC={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ql([0,.65,.55,1]),circOut:Ql([.55,0,1,.45]),backIn:Ql([.31,.01,.66,-.59]),backOut:Ql([.33,1.53,.69,.99])};function FR(e,t){if(e)return typeof e=="function"?UR()?PR(e,t):"ease-out":ER(e)?Ql(e):Array.isArray(e)?e.map(n=>FR(n,t)||iC.easeOut):iC[e]}function L7(e,t,n,{delay:i=0,duration:s=300,repeat:a=0,repeatType:l="loop",ease:u="easeOut",times:h}={},d=void 0){const p={[t]:n};h&&(p.offset=h);const m=FR(u,s);Array.isArray(m)&&(p.easing=m);const _={delay:i,duration:s,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:a+1,direction:l==="reverse"?"alternate":"normal"};return d&&(_.pseudoElement=d),e.animate(p,_)}function $R(e){return typeof e=="function"&&"applyToOptions"in e}function P7({type:e,...t}){return $R(e)&&UR()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class WR extends Ny{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:s,pseudoElement:a,allowFlatten:l=!1,finalKeyframe:u,onComplete:h}=t;this.isPseudoElement=!!a,this.allowFlatten=l,this.options=t,wy(typeof t.type!="string");const d=P7(t);this.animation=L7(n,i,s,d,a),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const p=Dy(s,this.options,u,this.speed);this.updateMotionValue&&this.updateMotionValue(p),HR(n,i,p),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return ci(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ci(t)}get time(){return ci(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Gn(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:i,observe:s}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&O7()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),ui):s(this)}}const GR={anticipate:SR,backInOut:bR,circInOut:xR};function B7(e){return e in GR}function I7(e){typeof e.ease=="string"&&B7(e.ease)&&(e.ease=GR[e.ease])}const bg=10;class j7 extends WR{constructor(t){I7(t),IR(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:i,onComplete:s,element:a,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const u=new Oy({...l,autoplay:!1}),h=Math.max(bg,vn.now()-this.startTime),d=Ui(0,bg,h-bg),p=u.sample(h).value,{name:m}=this.options;a&&m&&HR(a,m,p),n.setWithVelocity(u.sample(Math.max(0,h-d)).value,p,d),u.stop()}}const rC=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(bi.test(e)||e==="0")&&!e.startsWith("url("));function z7(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function H7(e,t,n,i){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],l=rC(s,t),u=rC(a,t);return!l||!u?!1:z7(e)||(n==="spring"||$R(n))&&i}function z_(e){e.duration=0,e.type="keyframes"}const V7=new Set(["opacity","clipPath","filter","transform"]),U7=pR(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function F7(e){const{motionValue:t,name:n,repeatDelay:i,repeatType:s,damping:a,type:l}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:d}=t.owner.getProps();return U7()&&n&&V7.has(n)&&(n!=="transform"||!d)&&!h&&!i&&s!=="mirror"&&a!==0&&l!=="inertia"}const $7=40;class W7 extends Ny{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:s=0,repeatDelay:a=0,repeatType:l="loop",keyframes:u,name:h,motionValue:d,element:p,...m}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=vn.now();const _={autoplay:t,delay:n,type:i,repeat:s,repeatDelay:a,repeatType:l,name:h,motionValue:d,element:p,...m},y=p?.KeyframeResolver||Ly;this.keyframeResolver=new y(u,(b,S,C)=>this.onKeyframesResolved(b,S,_,!C),h,d,p),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,i,s){this.keyframeResolver=void 0;const{name:a,type:l,velocity:u,delay:h,isHandoff:d,onUpdate:p}=i;this.resolvedAt=vn.now(),H7(t,a,l,u)||((wr.instantAnimations||!h)&&p?.(Dy(t,i,n)),t[0]=t[t.length-1],z_(i),i.repeat=0);const _={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>$7?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},y=!d&&F7(_),b=_.motionValue?.owner?.current,S=y?new j7({..._,element:b}):new Oy(_);S.finished.then(()=>{this.notifyFinished()}).catch(ui),this.pendingTimeline&&(this.stopTimeline=S.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=S}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),M7()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function qR(e,t,n,i=0,s=1){const a=Array.from(e).sort((d,p)=>d.sortNodePosition(p)).indexOf(t),l=e.size,u=(l-1)*i;return typeof n=="function"?n(a,l):s===1?a*i:u-a*i}const G7=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function q7(e){const t=G7.exec(e);if(!t)return[,];const[,n,i,s]=t;return[`--${n??i}`,s]}function KR(e,t,n=1){const[i,s]=q7(e);if(!i)return;const a=window.getComputedStyle(t).getPropertyValue(i);if(a){const l=a.trim();return hR(l)?parseFloat(l):l}return ky(s)?KR(s,t,n+1):s}const K7={type:"spring",stiffness:500,damping:25,restSpeed:10},Y7=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),X7={type:"keyframes",duration:.8},Z7={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Q7=(e,{keyframes:t})=>t.length>2?X7:Fa.has(e)?e.startsWith("scale")?Y7(t[1]):K7:Z7,J7=e=>e!==null;function eU(e,{repeat:t,repeatType:n="loop"},i){const s=e.filter(J7),a=t&&n!=="loop"&&t%2===1?0:s.length-1;return s[a]}function YR(e,t){if(e?.inherit&&t){const{inherit:n,...i}=e;return{...t,...i}}return e}function Py(e,t){const n=e?.[t]??e?.default??e;return n!==e?YR(n,e):n}function tU({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:a,repeatType:l,repeatDelay:u,from:h,elapsed:d,...p}){return!!Object.keys(p).length}const By=(e,t,n,i={},s,a)=>l=>{const u=Py(i,e)||{},h=u.delay||i.delay||0;let{elapsed:d=0}=i;d=d-Gn(h);const p={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-d,onUpdate:_=>{t.set(_),u.onUpdate&&u.onUpdate(_)},onComplete:()=>{l(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:a?void 0:s};tU(u)||Object.assign(p,Q7(e,p)),p.duration&&(p.duration=Gn(p.duration)),p.repeatDelay&&(p.repeatDelay=Gn(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let m=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(z_(p),p.delay===0&&(m=!0)),(wr.instantAnimations||wr.skipAnimations||s?.shouldSkipAnimations)&&(m=!0,z_(p),p.delay=0),p.allowFlatten=!u.type&&!u.ease,m&&!a&&t.get()!==void 0){const _=eU(p.keyframes,u);if(_!==void 0){at.update(()=>{p.onUpdate(_),p.onComplete()});return}}return u.isSync?new Oy(p):new W7(p)};function sC(e){const t=[{},{}];return e?.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function Iy(e,t,n,i){if(typeof t=="function"){const[s,a]=sC(i);t=t(n!==void 0?n:e.custom,s,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,a]=sC(i);t=t(n!==void 0?n:e.custom,s,a)}return t}function Ea(e,t,n){const i=e.getProps();return Iy(i,t,n!==void 0?n:i.custom,e)}const XR=new Set(["width","height","top","left","right","bottom",...Ua]),oC=30,nU=e=>!isNaN(parseFloat(e));class iU{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const s=vn.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=vn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=nU(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new xy);const i=this.events[t].add(n);return t==="change"?()=>{i(),at.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=vn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>oC)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,oC);return mR(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Oa(e,t){return new iU(e,t)}const H_=e=>Array.isArray(e);function rU(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Oa(n))}function sU(e){return H_(e)?e[e.length-1]||0:e}function oU(e,t){const n=Ea(e,t);let{transitionEnd:i={},transition:s={},...a}=n||{};a={...a,...i};for(const l in a){const u=sU(a[l]);rU(e,l,u)}}const pn=e=>!!(e&&e.getVelocity);function aU(e){return!!(pn(e)&&e.add)}function V_(e,t){const n=e.getValue("willChange");if(aU(n))return n.add(t);if(!n&&wr.WillChange){const i=new wr.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function jy(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const lU="framerAppearId",ZR="data-"+jy(lU);function QR(e){return e.props[ZR]}function cU({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function JR(e,t,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:a,transitionEnd:l,...u}=t;const h=e.getDefaultTransition();a=a?YR(a,h):h;const d=a?.reduceMotion;i&&(a=i);const p=[],m=s&&e.animationState&&e.animationState.getState()[s];for(const _ in u){const y=e.getValue(_,e.latestValues[_]??null),b=u[_];if(b===void 0||m&&cU(m,_))continue;const S={delay:n,...Py(a||{},_)},C=y.get();if(C!==void 0&&!y.isAnimating&&!Array.isArray(b)&&b===C&&!S.velocity)continue;let k=!1;if(window.MotionHandoffAnimation){const A=QR(e);if(A){const N=window.MotionHandoffAnimation(A,_,at);N!==null&&(S.startTime=N,k=!0)}}V_(e,_);const T=d??e.shouldReduceMotion;y.start(By(_,y,b,T&&XR.has(_)?{type:!1}:S,e,k));const R=y.animation;R&&p.push(R)}if(l){const _=()=>at.update(()=>{l&&oU(e,l)});p.length?Promise.all(p).then(_):_()}return p}function U_(e,t,n={}){const i=Ea(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const a=i?()=>Promise.all(JR(e,i,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(h=0)=>{const{delayChildren:d=0,staggerChildren:p,staggerDirection:m}=s;return uU(e,t,h,d,p,m,n)}:()=>Promise.resolve(),{when:u}=s;if(u){const[h,d]=u==="beforeChildren"?[a,l]:[l,a];return h().then(()=>d())}else return Promise.all([a(),l(n.delay)])}function uU(e,t,n=0,i=0,s=0,a=1,l){const u=[];for(const h of e.variantChildren)h.notify("AnimationStart",t),u.push(U_(h,t,{...l,delay:n+(typeof i=="function"?0:i)+qR(e.variantChildren,h,i,s,a)}).then(()=>h.notify("AnimationComplete",t)));return Promise.all(u)}function hU(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const s=t.map(a=>U_(e,a,n));i=Promise.all(s)}else if(typeof t=="string")i=U_(e,t,n);else{const s=typeof t=="function"?Ea(e,t,n.custom):t;i=Promise.all(JR(e,s,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const dU={test:e=>e==="auto",parse:e=>e},eM=e=>t=>t.test(e),tM=[Va,be,Hi,cs,zV,jV,dU],aC=e=>tM.find(eM(e));function fU(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||fR(e):!0}const pU=new Set(["brightness","contrast","saturate","opacity"]);function mU(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(Ty)||[];if(!i)return e;const s=n.replace(i,"");let a=pU.has(t)?1:0;return i!==n&&(a*=100),t+"("+a+s+")"}const gU=/\b([a-z-]*)\(.*?\)/gu,F_={...bi,getAnimatableNone:e=>{const t=e.match(gU);return t?t.map(mU).join(" "):e}},$_={...bi,getAnimatableNone:e=>{const t=bi.parse(e);return bi.createTransformer(e)(t.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},lC={...Va,transform:Math.round},_U={rotate:cs,rotateX:cs,rotateY:cs,rotateZ:cs,scale:bh,scaleX:bh,scaleY:bh,scaleZ:bh,skew:cs,skewX:cs,skewY:cs,distance:be,translateX:be,translateY:be,translateZ:be,x:be,y:be,z:be,perspective:be,transformPerspective:be,opacity:yc,originX:Kx,originY:Kx,originZ:be},zy={borderWidth:be,borderTopWidth:be,borderRightWidth:be,borderBottomWidth:be,borderLeftWidth:be,borderRadius:be,borderTopLeftRadius:be,borderTopRightRadius:be,borderBottomRightRadius:be,borderBottomLeftRadius:be,width:be,maxWidth:be,height:be,maxHeight:be,top:be,right:be,bottom:be,left:be,inset:be,insetBlock:be,insetBlockStart:be,insetBlockEnd:be,insetInline:be,insetInlineStart:be,insetInlineEnd:be,padding:be,paddingTop:be,paddingRight:be,paddingBottom:be,paddingLeft:be,paddingBlock:be,paddingBlockStart:be,paddingBlockEnd:be,paddingInline:be,paddingInlineStart:be,paddingInlineEnd:be,margin:be,marginTop:be,marginRight:be,marginBottom:be,marginLeft:be,marginBlock:be,marginBlockStart:be,marginBlockEnd:be,marginInline:be,marginInlineStart:be,marginInlineEnd:be,fontSize:be,backgroundPositionX:be,backgroundPositionY:be,..._U,zIndex:lC,fillOpacity:yc,strokeOpacity:yc,numOctaves:lC},vU={...zy,color:Lt,backgroundColor:Lt,outlineColor:Lt,fill:Lt,stroke:Lt,borderColor:Lt,borderTopColor:Lt,borderRightColor:Lt,borderBottomColor:Lt,borderLeftColor:Lt,filter:F_,WebkitFilter:F_,mask:$_,WebkitMask:$_},nM=e=>vU[e],yU=new Set([F_,$_]);function iM(e,t){let n=nM(e);return yU.has(n)||(n=bi),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const bU=new Set(["auto","none","0"]);function SU(e,t,n){let i=0,s;for(;i<e.length&&!s;){const a=e[i];typeof a=="string"&&!bU.has(a)&&Na(a).values.length&&(s=e[i]),i++}if(s&&n)for(const a of t)e[a]=iM(n,s)}class wU extends Ly{constructor(t,n,i,s,a){super(t,n,i,s,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let p=0;p<t.length;p++){let m=t[p];if(typeof m=="string"&&(m=m.trim(),ky(m))){const _=KR(m,n.current);_!==void 0&&(t[p]=_),p===t.length-1&&(this.finalKeyframe=m)}}if(this.resolveNoneKeyframes(),!XR.has(i)||t.length!==2)return;const[s,a]=t,l=aC(s),u=aC(a),h=qx(s),d=qx(a);if(h!==d&&hs[i]){this.needsMeasurement=!0;return}if(l!==u)if(nC(l)&&nC(u))for(let p=0;p<t.length;p++){const m=t[p];typeof m=="string"&&(t[p]=parseFloat(m))}else hs[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,i=[];for(let s=0;s<t.length;s++)(t[s]===null||fU(t[s]))&&i.push(s);i.length&&SU(t,i,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:i}=this;if(!t||!t.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=hs[i](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(i,s).jump(s,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:i}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const a=i.length-1,l=i[a];i[a]=hs[n](t.measureViewportBox(),window.getComputedStyle(t.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),this.removedTransforms?.length&&this.removedTransforms.forEach(([u,h])=>{t.getValue(u).set(h)}),this.resolveNoneKeyframes()}}const xU=new Set(["opacity","clipPath","filter","transform"]);function rM(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let i=document;const s=n?.[e]??i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(i=>i!=null)}const sM=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Uh(e){return dR(e)&&"offsetHeight"in e}const{schedule:Hy}=kR(queueMicrotask,!1),vi={x:!1,y:!1};function oM(){return vi.x||vi.y}function CU(e){return e==="x"||e==="y"?vi[e]?null:(vi[e]=!0,()=>{vi[e]=!1}):vi.x||vi.y?null:(vi.x=vi.y=!0,()=>{vi.x=vi.y=!1})}function aM(e,t){const n=rM(e),i=new AbortController,s={passive:!0,...t,signal:i.signal};return[n,s,()=>i.abort()]}function EU(e){return!(e.pointerType==="touch"||oM())}function kU(e,t,n={}){const[i,s,a]=aM(e,n);return i.forEach(l=>{let u=!1,h=!1,d;const p=()=>{l.removeEventListener("pointerleave",b)},m=C=>{d&&(d(C),d=void 0),p()},_=C=>{u=!1,window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_),h&&(h=!1,m(C))},y=()=>{u=!0,window.addEventListener("pointerup",_,s),window.addEventListener("pointercancel",_,s)},b=C=>{if(C.pointerType!=="touch"){if(u){h=!0;return}m(C)}},S=C=>{if(!EU(C))return;h=!1;const k=t(l,C);typeof k=="function"&&(d=k,l.addEventListener("pointerleave",b,s))};l.addEventListener("pointerenter",S,s),l.addEventListener("pointerdown",y,s)}),a}const lM=(e,t)=>t?e===t?!0:lM(e,t.parentElement):!1,Vy=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,TU=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function AU(e){return TU.has(e.tagName)||e.isContentEditable===!0}const RU=new Set(["INPUT","SELECT","TEXTAREA"]);function MU(e){return RU.has(e.tagName)||e.isContentEditable===!0}const Fh=new WeakSet;function cC(e){return t=>{t.key==="Enter"&&e(t)}}function Sg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const DU=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=cC(()=>{if(Fh.has(n))return;Sg(n,"down");const s=cC(()=>{Sg(n,"up")}),a=()=>Sg(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function uC(e){return Vy(e)&&!oM()}const hC=new WeakSet;function NU(e,t,n={}){const[i,s,a]=aM(e,n),l=u=>{const h=u.currentTarget;if(!uC(u)||hC.has(u))return;Fh.add(h),n.stopPropagation&&hC.add(u);const d=t(h,u),p=(y,b)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",_),Fh.has(h)&&Fh.delete(h),uC(y)&&typeof d=="function"&&d(y,{success:b})},m=y=>{p(y,h===window||h===document||n.useGlobalTarget||lM(h,y.target))},_=y=>{p(y,!1)};window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",_,s)};return i.forEach(u=>{(n.useGlobalTarget?window:u).addEventListener("pointerdown",l,s),Uh(u)&&(u.addEventListener("focus",d=>DU(d,s)),!AU(u)&&!u.hasAttribute("tabindex")&&(u.tabIndex=0))}),a}function Uy(e){return dR(e)&&"ownerSVGElement"in e}const $h=new WeakMap;let Wh;const cM=(e,t,n)=>(i,s)=>s&&s[0]?s[0][e+"Size"]:Uy(i)&&"getBBox"in i?i.getBBox()[t]:i[n],OU=cM("inline","width","offsetWidth"),LU=cM("block","height","offsetHeight");function PU({target:e,borderBoxSize:t}){$h.get(e)?.forEach(n=>{n(e,{get width(){return OU(e,t)},get height(){return LU(e,t)}})})}function BU(e){e.forEach(PU)}function IU(){typeof ResizeObserver>"u"||(Wh=new ResizeObserver(BU))}function jU(e,t){Wh||IU();const n=rM(e);return n.forEach(i=>{let s=$h.get(i);s||(s=new Set,$h.set(i,s)),s.add(t),Wh?.observe(i)}),()=>{n.forEach(i=>{const s=$h.get(i);s?.delete(t),s?.size||Wh?.unobserve(i)})}}const Gh=new Set;let ma;function zU(){ma=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Gh.forEach(t=>t(e))},window.addEventListener("resize",ma)}function HU(e){return Gh.add(e),ma||zU(),()=>{Gh.delete(e),!Gh.size&&typeof ma=="function"&&(window.removeEventListener("resize",ma),ma=void 0)}}function dC(e,t){return typeof e=="function"?HU(e):jU(e,t)}function VU(e){return Uy(e)&&e.tagName==="svg"}const UU=[...tM,Lt,bi],FU=e=>UU.find(eM(e)),fC=()=>({translate:0,scale:1,origin:0,originPoint:0}),ga=()=>({x:fC(),y:fC()}),pC=()=>({min:0,max:0}),Vt=()=>({x:pC(),y:pC()}),$U=new WeakMap;function hf(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function bc(e){return typeof e=="string"||Array.isArray(e)}const Fy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$y=["initial",...Fy];function df(e){return hf(e.animate)||$y.some(t=>bc(e[t]))}function uM(e){return!!(df(e)||e.variants)}function WU(e,t,n){for(const i in t){const s=t[i],a=n[i];if(pn(s))e.addValue(i,s);else if(pn(a))e.addValue(i,Oa(s,{owner:e}));else if(a!==s)if(e.hasValue(i)){const l=e.getValue(i);l.liveStyle===!0?l.jump(s):l.hasAnimated||l.set(s)}else{const l=e.getStaticValue(i);e.addValue(i,Oa(l!==void 0?l:s,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const W_={current:null},hM={current:!1},GU=typeof window<"u";function qU(){if(hM.current=!0,!!GU)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>W_.current=e.matches;e.addEventListener("change",t),t()}else W_.current=!1}const mC=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let kd={};function dM(e){kd=e}function KU(){return kd}class YU{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:s,skipAnimations:a,blockInitialAnimation:l,visualState:u},h={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ly,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=vn.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,at.render(this.render,!1,!0))};const{latestValues:d,renderState:p}=u;this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=p,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=a,this.options=h,this.blockInitialAnimation=!!l,this.isControllingVariants=df(n),this.isVariantNode=uM(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:m,..._}=this.scrapeMotionValuesFromProps(n,{},this);for(const y in _){const b=_[y];d[y]!==void 0&&pn(b)&&b.set(d[y])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,$U.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(hM.current||qU(),this.shouldReduceMotion=W_.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),_s(this.notifyUpdate),_s(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&xU.has(t)&&this.current instanceof HTMLElement){const{factory:l,keyframes:u,times:h,ease:d,duration:p}=n.accelerate,m=new WR({element:this.current,name:t,keyframes:u,times:h,ease:d,duration:Gn(p)}),_=l(m);this.valueSubscriptions.set(t,()=>{_(),m.cancel()});return}const i=Fa.has(t);i&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&at.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in kd){const n=kd[t];if(!n)continue;const{isEnabled:i,Feature:s}=n;if(!this.features[t]&&s&&i(this.props)&&(this.features[t]=new s(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Vt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<mC.length;i++){const s=mC[i];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const a="on"+s,l=t[a];l&&(this.propEventSubscriptions[s]=this.on(s,l))}this.prevMotionValues=WU(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const i=this.values.get(t);n!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=Oa(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(hR(i)||fR(i))?i=parseFloat(i):!FU(i)&&bi.test(n)&&(i=iM(t,n)),this.setBaseTarget(t,pn(i)?i.get():i)),pn(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const a=Iy(this.props,n,this.presenceContext?.custom);a&&(i=a[t])}if(n&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!pn(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new xy),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Hy.render(this.render)}}class fM extends YU{constructor(){super(...arguments),this.KeyframeResolver=wU}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const i=t.style;return i?i[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;pn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class xs{constructor(t){this.isMounted=!1,this.node=t}update(){}}function pM({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function XU({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ZU(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function wg(e){return e===void 0||e===1}function G_({scale:e,scaleX:t,scaleY:n}){return!wg(e)||!wg(t)||!wg(n)}function Ys(e){return G_(e)||mM(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function mM(e){return gC(e.x)||gC(e.y)}function gC(e){return e&&e!=="0%"}function Td(e,t,n){const i=e-n,s=t*i;return n+s}function _C(e,t,n,i,s){return s!==void 0&&(e=Td(e,s,i)),Td(e,n,i)+t}function q_(e,t=0,n=1,i,s){e.min=_C(e.min,t,n,i,s),e.max=_C(e.max,t,n,i,s)}function gM(e,{x:t,y:n}){q_(e.x,t.translate,t.scale,t.originPoint),q_(e.y,n.translate,n.scale,n.originPoint)}const vC=.999999999999,yC=1.0000000000001;function QU(e,t,n,i=!1){const s=n.length;if(!s)return;t.x=t.y=1;let a,l;for(let u=0;u<s;u++){a=n[u],l=a.projectionDelta;const{visualElement:h}=a.options;h&&h.props.style&&h.props.style.display==="contents"||(i&&a.options.layoutScroll&&a.scroll&&a!==a.root&&va(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,gM(e,l)),i&&Ys(a.latestValues)&&va(e,a.latestValues,a.layout?.layoutBox))}t.x<yC&&t.x>vC&&(t.x=1),t.y<yC&&t.y>vC&&(t.y=1)}function _a(e,t){e.min=e.min+t,e.max=e.max+t}function bC(e,t,n,i,s=.5){const a=_t(e.min,e.max,s);q_(e,t,n,a,i)}function SC(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function va(e,t,n){const i=n??e;bC(e.x,SC(t.x,i.x),t.scaleX,t.scale,t.originX),bC(e.y,SC(t.y,i.y),t.scaleY,t.scale,t.originY)}function _M(e,t){return pM(ZU(e.getBoundingClientRect(),t))}function JU(e,t,n){const i=_M(e,n),{scroll:s}=t;return s&&(_a(i.x,s.offset.x),_a(i.y,s.offset.y)),i}const eF={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tF=Ua.length;function nF(e,t,n){let i="",s=!0;for(let a=0;a<tF;a++){const l=Ua[a],u=e[l];if(u===void 0)continue;let h=!0;if(typeof u=="number")h=u===(l.startsWith("scale")?1:0);else{const d=parseFloat(u);h=l.startsWith("scale")?d===1:d===0}if(!h||n){const d=sM(u,zy[l]);if(!h){s=!1;const p=eF[l]||l;i+=`${p}(${d}) `}n&&(t[l]=d)}}return i=i.trim(),n?i=n(t,s?"":i):s&&(i="none"),i}function Wy(e,t,n){const{style:i,vars:s,transformOrigin:a}=e;let l=!1,u=!1;for(const h in t){const d=t[h];if(Fa.has(h)){l=!0;continue}else if(AR(h)){s[h]=d;continue}else{const p=sM(d,zy[h]);h.startsWith("origin")?(u=!0,a[h]=p):i[h]=p}}if(t.transform||(l||n?i.transform=nF(t,e.transform,n):i.transform&&(i.transform="none")),u){const{originX:h="50%",originY:d="50%",originZ:p=0}=a;i.transformOrigin=`${h} ${d} ${p}`}}function vM(e,{style:t,vars:n},i,s){const a=e.style;let l;for(l in t)a[l]=t[l];s?.applyProjectionStyles(a,i);for(l in n)a.setProperty(l,n[l])}function wC(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ul={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(be.test(e))e=parseFloat(e);else return e;const n=wC(e,t.target.x),i=wC(e,t.target.y);return`${n}% ${i}%`}},iF={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,s=bi.parse(e);if(s.length>5)return i;const a=bi.createTransformer(e),l=typeof s[0]!="number"?1:0,u=n.x.scale*t.x,h=n.y.scale*t.y;s[0+l]/=u,s[1+l]/=h;const d=_t(u,h,.5);return typeof s[2+l]=="number"&&(s[2+l]/=d),typeof s[3+l]=="number"&&(s[3+l]/=d),a(s)}},K_={borderRadius:{...Ul,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ul,borderTopRightRadius:Ul,borderBottomLeftRadius:Ul,borderBottomRightRadius:Ul,boxShadow:iF};function yM(e,{layout:t,layoutId:n}){return Fa.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!K_[e]||e==="opacity")}function Gy(e,t,n){const i=e.style,s=t?.style,a={};if(!i)return a;for(const l in i)(pn(i[l])||s&&pn(s[l])||yM(l,e)||n?.getValue(l)?.liveStyle!==void 0)&&(a[l]=i[l]);return a}function rF(e){return window.getComputedStyle(e)}class sF extends fM{constructor(){super(...arguments),this.type="html",this.renderInstance=vM}readValueFromInstance(t,n){if(Fa.has(n))return this.projection?.isProjecting?L_(n):E7(t,n);{const i=rF(t),s=(AR(n)?i.getPropertyValue(n):i[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return _M(t,n)}build(t,n,i){Wy(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return Gy(t,n,i)}}const oF={offset:"stroke-dashoffset",array:"stroke-dasharray"},aF={offset:"strokeDashoffset",array:"strokeDasharray"};function lF(e,t,n=1,i=0,s=!0){e.pathLength=1;const a=s?oF:aF;e[a.offset]=`${-i}`,e[a.array]=`${t} ${n}`}const cF=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function bM(e,{attrX:t,attrY:n,attrScale:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...u},h,d,p){if(Wy(e,u,d),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:m,style:_}=e;m.transform&&(_.transform=m.transform,delete m.transform),(_.transform||m.transformOrigin)&&(_.transformOrigin=m.transformOrigin??"50% 50%",delete m.transformOrigin),_.transform&&(_.transformBox=p?.transformBox??"fill-box",delete m.transformBox);for(const y of cF)m[y]!==void 0&&(_[y]=m[y],delete m[y]);t!==void 0&&(m.x=t),n!==void 0&&(m.y=n),i!==void 0&&(m.scale=i),s!==void 0&&lF(m,s,a,l,!1)}const SM=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),wM=e=>typeof e=="string"&&e.toLowerCase()==="svg";function uF(e,t,n,i){vM(e,t,void 0,i);for(const s in t.attrs)e.setAttribute(SM.has(s)?s:jy(s),t.attrs[s])}function xM(e,t,n){const i=Gy(e,t,n);for(const s in e)if(pn(e[s])||pn(t[s])){const a=Ua.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;i[a]=e[s]}return i}class hF extends fM{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Vt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Fa.has(n)){const i=nM(n);return i&&i.default||0}return n=SM.has(n)?n:jy(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return xM(t,n,i)}build(t,n,i){bM(t,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,n,i,s){uF(t,n,i,s)}mount(t){this.isSVGTag=wM(t.tagName),super.mount(t)}}const dF=$y.length;function CM(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?CM(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<dF;n++){const i=$y[n],s=e.props[i];(bc(s)||s===!1)&&(t[i]=s)}return t}function EM(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}const fF=[...Fy].reverse(),pF=Fy.length;function mF(e){return t=>Promise.all(t.map(({animation:n,options:i})=>hU(e,n,i)))}function gF(e){let t=mF(e),n=xC(),i=!0,s=!1;const a=d=>(p,m)=>{const _=Ea(e,m,d==="exit"?e.presenceContext?.custom:void 0);if(_){const{transition:y,transitionEnd:b,...S}=_;p={...p,...S,...b}}return p};function l(d){t=d(e)}function u(d){const{props:p}=e,m=CM(e.parent)||{},_=[],y=new Set;let b={},S=1/0;for(let k=0;k<pF;k++){const T=fF[k],R=n[T],A=p[T]!==void 0?p[T]:m[T],N=bc(A),V=T===d?R.isActive:null;V===!1&&(S=k);let H=A===m[T]&&A!==p[T]&&N;if(H&&(i||s)&&e.manuallyAnimateOnMount&&(H=!1),R.protectedKeys={...b},!R.isActive&&V===null||!A&&!R.prevProp||hf(A)||typeof A=="boolean")continue;if(T==="exit"&&R.isActive&&V!==!0){R.prevResolvedValues&&(b={...b,...R.prevResolvedValues});continue}const z=_F(R.prevProp,A);let J=z||T===d&&R.isActive&&!H&&N||k>S&&N,$=!1;const K=Array.isArray(A)?A:[A];let I=K.reduce(a(T),{});V===!1&&(I={});const{prevResolvedValues:P={}}=R,B={...P,...I},W=j=>{J=!0,y.has(j)&&($=!0,y.delete(j)),R.needsAnimating[j]=!0;const ee=e.getValue(j);ee&&(ee.liveStyle=!1)};for(const j in B){const ee=I[j],X=P[j];if(b.hasOwnProperty(j))continue;let L=!1;H_(ee)&&H_(X)?L=!EM(ee,X):L=ee!==X,L?ee!=null?W(j):y.add(j):ee!==void 0&&y.has(j)?W(j):R.protectedKeys[j]=!0}R.prevProp=A,R.prevResolvedValues=I,R.isActive&&(b={...b,...I}),(i||s)&&e.blockInitialAnimation&&(J=!1);const M=H&&z;J&&(!M||$)&&_.push(...K.map(j=>{const ee={type:T};if(typeof j=="string"&&(i||s)&&!M&&e.manuallyAnimateOnMount&&e.parent){const{parent:X}=e,L=Ea(X,j);if(X.enteringChildren&&L){const{delayChildren:Z}=L.transition||{};ee.delay=qR(X.enteringChildren,e,Z)}}return{animation:j,options:ee}}))}if(y.size){const k={};if(typeof p.initial!="boolean"){const T=Ea(e,Array.isArray(p.initial)?p.initial[0]:p.initial);T&&T.transition&&(k.transition=T.transition)}y.forEach(T=>{const R=e.getBaseTarget(T),A=e.getValue(T);A&&(A.liveStyle=!0),k[T]=R??null}),_.push({animation:k})}let C=!!_.length;return i&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(C=!1),i=!1,s=!1,C?t(_):Promise.resolve()}function h(d,p){if(n[d].isActive===p)return Promise.resolve();e.variantChildren?.forEach(_=>_.animationState?.setActive(d,p)),n[d].isActive=p;const m=u(d);for(const _ in n)n[_].protectedKeys={};return m}return{animateChanges:u,setActive:h,setAnimateFunction:l,getState:()=>n,reset:()=>{n=xC(),s=!0}}}function _F(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!EM(t,e):!1}function Gs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function xC(){return{animate:Gs(!0),whileInView:Gs(),whileHover:Gs(),whileTap:Gs(),whileDrag:Gs(),whileFocus:Gs(),exit:Gs()}}function CC(e,t){e.min=t.min,e.max=t.max}function gi(e,t){CC(e.x,t.x),CC(e.y,t.y)}function EC(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const kM=1e-4,vF=1-kM,yF=1+kM,TM=.01,bF=0-TM,SF=0+TM;function yn(e){return e.max-e.min}function wF(e,t,n){return Math.abs(e-t)<=n}function kC(e,t,n,i=.5){e.origin=i,e.originPoint=_t(t.min,t.max,e.origin),e.scale=yn(n)/yn(t),e.translate=_t(n.min,n.max,e.origin)-e.originPoint,(e.scale>=vF&&e.scale<=yF||isNaN(e.scale))&&(e.scale=1),(e.translate>=bF&&e.translate<=SF||isNaN(e.translate))&&(e.translate=0)}function lc(e,t,n,i){kC(e.x,t.x,n.x,i?i.originX:void 0),kC(e.y,t.y,n.y,i?i.originY:void 0)}function TC(e,t,n){e.min=n.min+t.min,e.max=e.min+yn(t)}function xF(e,t,n){TC(e.x,t.x,n.x),TC(e.y,t.y,n.y)}function AC(e,t,n){e.min=t.min-n.min,e.max=e.min+yn(t)}function Ad(e,t,n){AC(e.x,t.x,n.x),AC(e.y,t.y,n.y)}function RC(e,t,n,i,s){return e-=t,e=Td(e,1/n,i),s!==void 0&&(e=Td(e,1/s,i)),e}function CF(e,t=0,n=1,i=.5,s,a=e,l=e){if(Hi.test(t)&&(t=parseFloat(t),t=_t(l.min,l.max,t/100)-l.min),typeof t!="number")return;let u=_t(a.min,a.max,i);e===a&&(u-=t),e.min=RC(e.min,t,n,u,s),e.max=RC(e.max,t,n,u,s)}function MC(e,t,[n,i,s],a,l){CF(e,t[n],t[i],t[s],t.scale,a,l)}const EF=["x","scaleX","originX"],kF=["y","scaleY","originY"];function DC(e,t,n,i){MC(e.x,t,EF,n?n.x:void 0,i?i.x:void 0),MC(e.y,t,kF,n?n.y:void 0,i?i.y:void 0)}function NC(e){return e.translate===0&&e.scale===1}function AM(e){return NC(e.x)&&NC(e.y)}function OC(e,t){return e.min===t.min&&e.max===t.max}function TF(e,t){return OC(e.x,t.x)&&OC(e.y,t.y)}function LC(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function RM(e,t){return LC(e.x,t.x)&&LC(e.y,t.y)}function PC(e){return yn(e.x)/yn(e.y)}function BC(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Pi(e){return[e("x"),e("y")]}function AF(e,t,n){let i="";const s=e.x.translate/t.x,a=e.y.translate/t.y,l=n?.z||0;if((s||a||l)&&(i=`translate3d(${s}px, ${a}px, ${l}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:d,rotate:p,rotateX:m,rotateY:_,skewX:y,skewY:b}=n;d&&(i=`perspective(${d}px) ${i}`),p&&(i+=`rotate(${p}deg) `),m&&(i+=`rotateX(${m}deg) `),_&&(i+=`rotateY(${_}deg) `),y&&(i+=`skewX(${y}deg) `),b&&(i+=`skewY(${b}deg) `)}const u=e.x.scale*t.x,h=e.y.scale*t.y;return(u!==1||h!==1)&&(i+=`scale(${u}, ${h})`),i||"none"}const MM=["TopLeft","TopRight","BottomLeft","BottomRight"],RF=MM.length,IC=e=>typeof e=="string"?parseFloat(e):e,jC=e=>typeof e=="number"||be.test(e);function MF(e,t,n,i,s,a){s?(e.opacity=_t(0,n.opacity??1,DF(i)),e.opacityExit=_t(t.opacity??1,0,NF(i))):a&&(e.opacity=_t(t.opacity??1,n.opacity??1,i));for(let l=0;l<RF;l++){const u=`border${MM[l]}Radius`;let h=zC(t,u),d=zC(n,u);if(h===void 0&&d===void 0)continue;h||(h=0),d||(d=0),h===0||d===0||jC(h)===jC(d)?(e[u]=Math.max(_t(IC(h),IC(d),i),0),(Hi.test(d)||Hi.test(h))&&(e[u]+="%")):e[u]=d}(t.rotate||n.rotate)&&(e.rotate=_t(t.rotate||0,n.rotate||0,i))}function zC(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const DF=DM(0,.5,wR),NF=DM(.5,.95,ui);function DM(e,t,n){return i=>i<e?0:i>t?1:n(vc(e,t,i))}function OF(e,t,n){const i=pn(e)?e:Oa(e);return i.start(By("",i,t,n)),i.animation}function Sc(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}const LF=(e,t)=>e.depth-t.depth;class PF{constructor(){this.children=[],this.isDirty=!1}add(t){Sy(this.children,t),this.isDirty=!0}remove(t){wd(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(LF),this.isDirty=!1,this.children.forEach(t)}}function BF(e,t){const n=vn.now(),i=({timestamp:s})=>{const a=s-n;a>=t&&(_s(i),e(a-t))};return at.setup(i,!0),()=>_s(i)}function qh(e){return pn(e)?e.get():e}class IF{constructor(){this.members=[]}add(t){Sy(this.members,t);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===t||i===this.lead||i===this.prevLead)continue;const s=i.instance;(!s||s.isConnected===!1)&&!i.snapshot&&(wd(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(wd(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){for(let n=this.members.indexOf(t)-1;n>=0;n--){const i=this.members[n];if(i.isPresent!==!1&&i.instance?.isConnected!==!1)return this.promote(i),!0}return!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();const{layoutDependency:s}=i.options,{layoutDependency:a}=t.options;(s===void 0||s!==a)&&(t.resumeFrom=i,n&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Kh={hasAnimatedSinceResize:!0,hasEverUpdated:!1},xg=["","X","Y","Z"],jF=1e3;let zF=0;function Cg(e,t,n,i){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),i&&(i[e]=0))}function NM(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=QR(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",at,!(s||a))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&NM(i)}function OM({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(l={},u=t?.()){this.id=zF++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(UF),this.nodes.forEach(GF),this.nodes.forEach(qF),this.nodes.forEach(FF)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new PF)}addEventListener(l,u){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new xy),this.eventHandlers.get(l).add(u)}notifyListeners(l,...u){const h=this.eventHandlers.get(l);h&&h.notify(...u)}hasListeners(l){return this.eventHandlers.has(l)}mount(l){if(this.instance)return;this.isSVG=Uy(l)&&!VU(l),this.instance=l;const{layoutId:u,layout:h,visualElement:d}=this.options;if(d&&!d.current&&d.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||u)&&(this.isLayoutDirty=!0),e){let p,m=0;const _=()=>this.root.updateBlockedByResize=!1;at.read(()=>{m=window.innerWidth}),e(l,()=>{const y=window.innerWidth;y!==m&&(m=y,this.root.updateBlockedByResize=!0,p&&p(),p=BF(_,250),Kh.hasAnimatedSinceResize&&(Kh.hasAnimatedSinceResize=!1,this.nodes.forEach(UC)))})}u&&this.root.registerSharedNode(u,this),this.options.animate!==!1&&d&&(u||h)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:m,hasRelativeLayoutChanged:_,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||QF,{onLayoutAnimationStart:S,onLayoutAnimationComplete:C}=d.getProps(),k=!this.targetLayout||!RM(this.targetLayout,y),T=!m&&_;if(this.options.layoutRoot||this.resumeFrom||T||m&&(k||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const R={...Py(b,"layout"),onPlay:S,onComplete:C};(d.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R),this.setAnimationOrigin(p,T)}else m||UC(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),_s(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(KF),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&NM(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const m=this.path[p];m.shouldResetTransform=!0,(typeof m.latestValues.x=="string"||typeof m.latestValues.y=="string")&&(m.isLayoutDirty=!0),m.updateScroll("snapshot"),m.options.layoutRoot&&m.willUpdate(!1)}const{layoutId:u,layout:h}=this.options;if(u===void 0&&!h)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(HC);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(VC);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(WF),this.nodes.forEach(HF),this.nodes.forEach(VF)):this.nodes.forEach(VC),this.clearAllSnapshots();const u=vn.now();on.delta=Ui(0,1e3/60,u-on.timestamp),on.timestamp=u,on.isProcessing=!0,mg.update.process(on),mg.preRender.process(on),mg.render.process(on),on.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Hy.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach($F),this.sharedNodes.forEach(YF)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,at.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){at.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!yn(this.snapshot.measuredBox.x)&&!yn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Vt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(u=!1),u&&this.instance){const h=i(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!s)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!AM(this.projectionDelta),h=this.getTransformTemplate(),d=h?h(this.latestValues,""):void 0,p=d!==this.prevTransformTemplateValue;l&&this.instance&&(u||Ys(this.latestValues)||p)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const u=this.measurePageBox();let h=this.removeElementScroll(u);return l&&(h=this.removeTransform(h)),JF(h),{animationId:this.root.animationId,measuredBox:u,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:l}=this.options;if(!l)return Vt();const u=l.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(e9))){const{scroll:d}=this.root;d&&(_a(u.x,d.offset.x),_a(u.y,d.offset.y))}return u}removeElementScroll(l){const u=Vt();if(gi(u,l),this.scroll?.wasRoot)return u;for(let h=0;h<this.path.length;h++){const d=this.path[h],{scroll:p,options:m}=d;d!==this.root&&p&&m.layoutScroll&&(p.wasRoot&&gi(u,l),_a(u.x,p.offset.x),_a(u.y,p.offset.y))}return u}applyTransform(l,u=!1){const h=Vt();gi(h,l);for(let d=0;d<this.path.length;d++){const p=this.path[d];!u&&p.options.layoutScroll&&p.scroll&&p!==p.root&&va(h,{x:-p.scroll.offset.x,y:-p.scroll.offset.y}),Ys(p.latestValues)&&va(h,p.latestValues,p.layout?.layoutBox)}return Ys(this.latestValues)&&va(h,this.latestValues,this.layout?.layoutBox),h}removeTransform(l){const u=Vt();gi(u,l);for(let h=0;h<this.path.length;h++){const d=this.path[h];if(!Ys(d.latestValues))continue;let p;d.instance&&(G_(d.latestValues)&&d.updateSnapshot(),p=Vt(),gi(p,d.measurePageBox())),DC(u,d.latestValues,d.snapshot?.layoutBox,p)}return Ys(this.latestValues)&&DC(u,this.latestValues),u}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==on.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){const u=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=u.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=u.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=u.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==u;if(!(l||h&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:m}=this.options;if(!this.layout||!(p||m))return;this.resolvedRelativeTargetAt=on.timestamp;const _=this.getClosestProjectingParent();_&&this.linkedParentVersion!==_.layoutVersion&&!_.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(_&&_.layout?this.createRelativeTarget(_,this.layout.layoutBox,_.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Vt(),this.targetWithTransforms=Vt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),xF(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):gi(this.target,this.layout.layoutBox),gM(this.target,this.targetDelta)):gi(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,_&&!!_.resumingFrom==!!this.resumingFrom&&!_.options.layoutScroll&&_.target&&this.animationProgress!==1?this.createRelativeTarget(_,this.target,_.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||G_(this.parent.latestValues)||mM(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(l,u,h){this.relativeParent=l,this.linkedParentVersion=l.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Vt(),this.relativeTargetOrigin=Vt(),Ad(this.relativeTargetOrigin,u,h),gi(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const l=this.getLead(),u=!!this.resumingFrom||this!==l;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),u&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===on.timestamp&&(h=!1),h)return;const{layout:d,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||p))return;gi(this.layoutCorrected,this.layout.layoutBox);const m=this.treeScale.x,_=this.treeScale.y;QU(this.layoutCorrected,this.treeScale,this.path,u),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Vt());const{target:y}=l;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(EC(this.prevProjectionDelta.x,this.projectionDelta.x),EC(this.prevProjectionDelta.y,this.projectionDelta.y)),lc(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==m||this.treeScale.y!==_||!BC(this.projectionDelta.x,this.prevProjectionDelta.x)||!BC(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){if(this.options.visualElement?.scheduleRender(),l){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ga(),this.projectionDelta=ga(),this.projectionDeltaWithTransform=ga()}setAnimationOrigin(l,u=!1){const h=this.snapshot,d=h?h.latestValues:{},p={...this.latestValues},m=ga();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const _=Vt(),y=h?h.source:void 0,b=this.layout?this.layout.source:void 0,S=y!==b,C=this.getStack(),k=!C||C.members.length<=1,T=!!(S&&!k&&this.options.crossfade===!0&&!this.path.some(ZF));this.animationProgress=0;let R;this.mixTargetDelta=A=>{const N=A/1e3;FC(m.x,l.x,N),FC(m.y,l.y,N),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ad(_,this.layout.layoutBox,this.relativeParent.layout.layoutBox),XF(this.relativeTarget,this.relativeTargetOrigin,_,N),R&&TF(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=Vt()),gi(R,this.relativeTarget)),S&&(this.animationValues=p,MF(p,d,this.latestValues,N,T,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=N},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(_s(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=at.update(()=>{Kh.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Oa(0)),this.motionValue.jump(0,!1),this.currentAnimation=OF(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:u=>{this.mixTargetDelta(u),l.onUpdate&&l.onUpdate(u)},onStop:()=>{},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(jF),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:u,target:h,layout:d,latestValues:p}=l;if(!(!u||!h||!d)){if(this!==l&&this.layout&&d&&LM(this.options.animationType,this.layout.layoutBox,d.layoutBox)){h=this.target||Vt();const m=yn(this.layout.layoutBox.x);h.x.min=l.target.x.min,h.x.max=h.x.min+m;const _=yn(this.layout.layoutBox.y);h.y.min=l.target.y.min,h.y.max=h.y.min+_}gi(u,h),va(u,p),lc(this.projectionDeltaWithTransform,this.layoutCorrected,u,p)}}registerSharedNode(l,u){this.sharedNodes.has(l)||this.sharedNodes.set(l,new IF),this.sharedNodes.get(l).add(u);const d=u.options.initialPromotionConfig;u.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(u):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){const{layoutId:l}=this.options;return l?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:l}=this.options;return l?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:u,preserveFollowOpacity:h}={}){const d=this.getStack();d&&d.promote(this,h),l&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let u=!1;const{latestValues:h}=l;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(u=!0),!u)return;const d={};h.z&&Cg("z",l,d,this.animationValues);for(let p=0;p<xg.length;p++)Cg(`rotate${xg[p]}`,l,d,this.animationValues),Cg(`skew${xg[p]}`,l,d,this.animationValues);l.render();for(const p in d)l.setStaticValue(p,d[p]),this.animationValues&&(this.animationValues[p]=d[p]);l.scheduleRender()}applyProjectionStyles(l,u){if(!this.instance||this.isSVG)return;if(!this.isVisible){l.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,l.visibility="",l.opacity="",l.pointerEvents=qh(u?.pointerEvents)||"",l.transform=h?h(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(l.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,l.pointerEvents=qh(u?.pointerEvents)||""),this.hasProjected&&!Ys(this.latestValues)&&(l.transform=h?h({},""):"none",this.hasProjected=!1);return}l.visibility="";const p=d.animationValues||d.latestValues;this.applyTransformsToTarget();let m=AF(this.projectionDeltaWithTransform,this.treeScale,p);h&&(m=h(p,m)),l.transform=m;const{x:_,y}=this.projectionDelta;l.transformOrigin=`${_.origin*100}% ${y.origin*100}% 0`,d.animationValues?l.opacity=d===this?p.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:l.opacity=d===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const b in K_){if(p[b]===void 0)continue;const{correct:S,applyTo:C,isCSSVariable:k}=K_[b],T=m==="none"?p[b]:S(p[b],d);if(C){const R=C.length;for(let A=0;A<R;A++)l[C[A]]=T}else k?this.options.visualElement.renderState.vars[b]=T:l[b]=T}this.options.layoutId&&(l.pointerEvents=d===this?qh(u?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>l.currentAnimation?.stop()),this.root.nodes.forEach(HC),this.root.sharedNodes.clear()}}}function HF(e){e.updateLayout()}function VF(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=e.layout,{animationType:s}=e.options,a=t.source!==e.layout.source;s==="size"?Pi(p=>{const m=a?t.measuredBox[p]:t.layoutBox[p],_=yn(m);m.min=n[p].min,m.max=m.min+_}):LM(s,t.layoutBox,n)&&Pi(p=>{const m=a?t.measuredBox[p]:t.layoutBox[p],_=yn(n[p]);m.max=m.min+_,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+_)});const l=ga();lc(l,n,t.layoutBox);const u=ga();a?lc(u,e.applyTransform(i,!0),t.measuredBox):lc(u,n,t.layoutBox);const h=!AM(l);let d=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:m,layout:_}=p;if(m&&_){const y=Vt();Ad(y,t.layoutBox,m.layoutBox);const b=Vt();Ad(b,n,_.layoutBox),RM(y,b)||(d=!0),p.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=y,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:u,layoutDelta:l,hasLayoutChanged:h,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function UF(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function FF(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function $F(e){e.clearSnapshot()}function HC(e){e.clearMeasurements()}function VC(e){e.isLayoutDirty=!1}function WF(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function UC(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function GF(e){e.resolveTargetDelta()}function qF(e){e.calcProjection()}function KF(e){e.resetSkewAndRotation()}function YF(e){e.removeLeadSnapshot()}function FC(e,t,n){e.translate=_t(t.translate,0,n),e.scale=_t(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function $C(e,t,n,i){e.min=_t(t.min,n.min,i),e.max=_t(t.max,n.max,i)}function XF(e,t,n,i){$C(e.x,t.x,n.x,i),$C(e.y,t.y,n.y,i)}function ZF(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const QF={duration:.45,ease:[.4,0,.1,1]},WC=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),GC=WC("applewebkit/")&&!WC("chrome/")?Math.round:ui;function qC(e){e.min=GC(e.min),e.max=GC(e.max)}function JF(e){qC(e.x),qC(e.y)}function LM(e,t,n){return e==="position"||e==="preserve-aspect"&&!wF(PC(t),PC(n),.2)}function e9(e){return e!==e.root&&e.scroll?.wasRoot}const t9=OM({attachResizeListener:(e,t)=>Sc(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Eg={current:void 0},PM=OM({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Eg.current){const e=new t9({});e.mount(window),e.setOptions({layoutScroll:!0}),Eg.current=e}return Eg.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),qy=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function KC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function n9(...e){return t=>{let n=!1;const i=e.map(s=>{const a=KC(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<i.length;s++){const a=i[s];typeof a=="function"?a():KC(e[s],null)}}}}function i9(...e){return x.useCallback(n9(...e),e)}class r9 extends x.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Uh(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const i=n.offsetParent,s=Uh(i)&&i.offsetWidth||0,a=Uh(i)&&i.offsetHeight||0,l=getComputedStyle(n),u=this.props.sizeRef.current;u.height=parseFloat(l.height),u.width=parseFloat(l.width),u.top=n.offsetTop,u.left=n.offsetLeft,u.right=s-u.width-u.left,u.bottom=a-u.height-u.top}return null}componentDidUpdate(){}render(){return this.props.children}}function s9({children:e,isPresent:t,anchorX:n,anchorY:i,root:s,pop:a}){const l=x.useId(),u=x.useRef(null),h=x.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:d}=x.useContext(qy),p=e.props?.ref??e?.ref,m=i9(u,p);return x.useInsertionEffect(()=>{const{width:_,height:y,top:b,left:S,right:C,bottom:k}=h.current;if(t||a===!1||!u.current||!_||!y)return;const T=n==="left"?`left: ${S}`:`right: ${C}`,R=i==="bottom"?`bottom: ${k}`:`top: ${b}`;u.current.dataset.motionPopId=l;const A=document.createElement("style");d&&(A.nonce=d);const N=s??document.head;return N.appendChild(A),A.sheet&&A.sheet.insertRule(`
|
|
207
|
+
[data-motion-pop-id="${l}"] {
|
|
208
|
+
position: absolute !important;
|
|
209
|
+
width: ${_}px !important;
|
|
210
|
+
height: ${y}px !important;
|
|
211
|
+
${T}px !important;
|
|
212
|
+
${R}px !important;
|
|
213
|
+
}
|
|
214
|
+
`),()=>{N.contains(A)&&N.removeChild(A)}},[t]),w.jsx(r9,{isPresent:t,childRef:u,sizeRef:h,pop:a,children:a===!1?e:x.cloneElement(e,{ref:m})})}const o9=({children:e,initial:t,isPresent:n,onExitComplete:i,custom:s,presenceAffectsLayout:a,mode:l,anchorX:u,anchorY:h,root:d})=>{const p=by(a9),m=x.useId();let _=!0,y=x.useMemo(()=>(_=!1,{id:m,initial:t,isPresent:n,custom:s,onExitComplete:b=>{p.set(b,!0);for(const S of p.values())if(!S)return;i&&i()},register:b=>(p.set(b,!1),()=>p.delete(b))}),[n,p,i]);return a&&_&&(y={...y}),x.useMemo(()=>{p.forEach((b,S)=>p.set(S,!1))},[n]),x.useEffect(()=>{!n&&!p.size&&i&&i()},[n]),e=w.jsx(s9,{pop:l==="popLayout",isPresent:n,anchorX:u,anchorY:h,root:d,children:e}),w.jsx(uf.Provider,{value:y,children:e})};function a9(){return new Map}function BM(e=!0){const t=x.useContext(uf);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:s}=t,a=x.useId();x.useEffect(()=>{if(e)return s(a)},[e]);const l=x.useCallback(()=>e&&i&&i(a),[a,i,e]);return!n&&i?[!1,l]:[!0]}const Sh=e=>e.key||"";function YC(e){const t=[];return x.Children.forEach(e,n=>{x.isValidElement(n)&&t.push(n)}),t}const l9=({children:e,custom:t,initial:n=!0,onExitComplete:i,presenceAffectsLayout:s=!0,mode:a="sync",propagate:l=!1,anchorX:u="left",anchorY:h="top",root:d})=>{const[p,m]=BM(l),_=x.useMemo(()=>YC(e),[e]),y=l&&!p?[]:_.map(Sh),b=x.useRef(!0),S=x.useRef(_),C=by(()=>new Map),k=x.useRef(new Set),[T,R]=x.useState(_),[A,N]=x.useState(_);uR(()=>{b.current=!1,S.current=_;for(let z=0;z<A.length;z++){const J=Sh(A[z]);y.includes(J)?(C.delete(J),k.current.delete(J)):C.get(J)!==!0&&C.set(J,!1)}},[A,y.length,y.join("-")]);const V=[];if(_!==T){let z=[..._];for(let J=0;J<A.length;J++){const $=A[J],K=Sh($);y.includes(K)||(z.splice(J,0,$),V.push($))}return a==="wait"&&V.length&&(z=V),N(YC(z)),R(_),null}const{forceRender:H}=x.useContext(yy);return w.jsx(w.Fragment,{children:A.map(z=>{const J=Sh(z),$=l&&!p?!1:_===A||y.includes(J),K=()=>{if(k.current.has(J))return;if(k.current.add(J),C.has(J))C.set(J,!0);else return;let I=!0;C.forEach(P=>{P||(I=!1)}),I&&(H?.(),N(S.current),l&&m?.(),i&&i())};return w.jsx(o9,{isPresent:$,initial:!b.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:a,root:d,onExitComplete:$?void 0:K,anchorX:u,anchorY:h,children:z},J)})})},IM=x.createContext({strict:!1}),XC={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let ZC=!1;function c9(){if(ZC)return;const e={};for(const t in XC)e[t]={isEnabled:n=>XC[t].some(i=>!!n[i])};dM(e),ZC=!0}function jM(){return c9(),KU()}function u9(e){const t=jM();for(const n in e)t[n]={...t[n],...e[n]};dM(t)}const h9=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Rd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||h9.has(e)}let zM=e=>!Rd(e);function d9(e){typeof e=="function"&&(zM=t=>t.startsWith("on")?!Rd(t):e(t))}try{d9(require("@emotion/is-prop-valid").default)}catch{}function f9(e,t,n){const i={};for(const s in e)s==="values"&&typeof e.values=="object"||(zM(s)||n===!0&&Rd(s)||!t&&!Rd(s)||e.draggable&&s.startsWith("onDrag"))&&(i[s]=e[s]);return i}const ff=x.createContext({});function p9(e,t){if(df(e)){const{initial:n,animate:i}=e;return{initial:n===!1||bc(n)?n:void 0,animate:bc(i)?i:void 0}}return e.inherit!==!1?t:{}}function m9(e){const{initial:t,animate:n}=p9(e,x.useContext(ff));return x.useMemo(()=>({initial:t,animate:n}),[QC(t),QC(n)])}function QC(e){return Array.isArray(e)?e.join(" "):e}const Ky=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function HM(e,t,n){for(const i in t)!pn(t[i])&&!yM(i,n)&&(e[i]=t[i])}function g9({transformTemplate:e},t){return x.useMemo(()=>{const n=Ky();return Wy(n,t,e),Object.assign({},n.vars,n.style)},[t])}function _9(e,t){const n=e.style||{},i={};return HM(i,n,e),Object.assign(i,g9(e,t)),i}function v9(e,t){const n={},i=_9(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n}const VM=()=>({...Ky(),attrs:{}});function y9(e,t,n,i){const s=x.useMemo(()=>{const a=VM();return bM(a,t,wM(i),e.transformTemplate,e.style),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};HM(a,e.style,e),s.style={...a,...s.style}}return s}const b9=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Yy(e){return typeof e!="string"||e.includes("-")?!1:!!(b9.indexOf(e)>-1||/[A-Z]/u.test(e))}function S9(e,t,n,{latestValues:i},s,a=!1,l){const h=(l??Yy(e)?y9:v9)(t,i,s,e),d=f9(t,typeof e=="string",a),p=e!==x.Fragment?{...d,...h,ref:n}:{},{children:m}=t,_=x.useMemo(()=>pn(m)?m.get():m,[m]);return x.createElement(e,{...p,children:_})}function w9({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,s){return{latestValues:x9(n,i,s,e),renderState:t()}}function x9(e,t,n,i){const s={},a=i(e,{});for(const _ in a)s[_]=qh(a[_]);let{initial:l,animate:u}=e;const h=df(e),d=uM(e);t&&d&&!h&&e.inherit!==!1&&(l===void 0&&(l=t.initial),u===void 0&&(u=t.animate));let p=n?n.initial===!1:!1;p=p||l===!1;const m=p?u:l;if(m&&typeof m!="boolean"&&!hf(m)){const _=Array.isArray(m)?m:[m];for(let y=0;y<_.length;y++){const b=Iy(e,_[y]);if(b){const{transitionEnd:S,transition:C,...k}=b;for(const T in k){let R=k[T];if(Array.isArray(R)){const A=p?R.length-1:0;R=R[A]}R!==null&&(s[T]=R)}for(const T in S)s[T]=S[T]}}}return s}const UM=e=>(t,n)=>{const i=x.useContext(ff),s=x.useContext(uf),a=()=>w9(e,t,i,s);return n?a():by(a)},C9=UM({scrapeMotionValuesFromProps:Gy,createRenderState:Ky}),E9=UM({scrapeMotionValuesFromProps:xM,createRenderState:VM}),k9=Symbol.for("motionComponentSymbol");function T9(e,t,n){const i=x.useRef(n);x.useInsertionEffect(()=>{i.current=n});const s=x.useRef(null);return x.useCallback(a=>{a&&e.onMount?.(a);const l=i.current;if(typeof l=="function")if(a){const u=l(a);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):l(a);else l&&(l.current=a);t&&(a?t.mount(a):t.unmount())},[t])}const FM=x.createContext({});function da(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function A9(e,t,n,i,s,a){const{visualElement:l}=x.useContext(ff),u=x.useContext(IM),h=x.useContext(uf),d=x.useContext(qy),p=d.reducedMotion,m=d.skipAnimations,_=x.useRef(null),y=x.useRef(!1);i=i||u.renderer,!_.current&&i&&(_.current=i(e,{visualState:t,parent:l,props:n,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:p,skipAnimations:m,isSVG:a}),y.current&&_.current&&(_.current.manuallyAnimateOnMount=!0));const b=_.current,S=x.useContext(FM);b&&!b.projection&&s&&(b.type==="html"||b.type==="svg")&&R9(_.current,n,s,S);const C=x.useRef(!1);x.useInsertionEffect(()=>{b&&C.current&&b.update(n,h)});const k=n[ZR],T=x.useRef(!!k&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(k)&&window.MotionHasOptimisedAnimation?.(k));return uR(()=>{y.current=!0,b&&(C.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),T.current&&b.animationState&&b.animationState.animateChanges())}),x.useEffect(()=>{b&&(!T.current&&b.animationState&&b.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(k)}),T.current=!1),b.enteringChildren=void 0)}),b}function R9(e,t,n,i){const{layoutId:s,layout:a,drag:l,dragConstraints:u,layoutScroll:h,layoutRoot:d,layoutCrossfade:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:$M(e.parent)),e.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!l||u&&da(u),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:i,crossfade:p,layoutScroll:h,layoutRoot:d})}function $M(e){if(e)return e.options.allowProjection!==!1?e.projection:$M(e.parent)}function kg(e,{forwardMotionProps:t=!1,type:n}={},i,s){i&&u9(i);const a=n?n==="svg":Yy(e),l=a?E9:C9;function u(d,p){let m;const _={...x.useContext(qy),...d,layoutId:M9(d)},{isStatic:y}=_,b=m9(d),S=l(d,y);if(!y&&typeof window<"u"){D9();const C=N9(_);m=C.MeasureLayout,b.visualElement=A9(e,S,_,s,C.ProjectionNode,a)}return w.jsxs(ff.Provider,{value:b,children:[m&&b.visualElement?w.jsx(m,{visualElement:b.visualElement,..._}):null,S9(e,d,T9(S,b.visualElement,p),S,y,t,a)]})}u.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const h=x.forwardRef(u);return h[k9]=e,h}function M9({layoutId:e}){const t=x.useContext(yy).id;return t&&e!==void 0?t+"-"+e:e}function D9(e,t){x.useContext(IM).strict}function N9(e){const t=jM(),{drag:n,layout:i}=t;if(!n&&!i)return{};const s={...n,...i};return{MeasureLayout:n?.isEnabled(e)||i?.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function O9(e,t){if(typeof Proxy>"u")return kg;const n=new Map,i=(a,l)=>kg(a,l,e,t),s=(a,l)=>i(a,l);return new Proxy(s,{get:(a,l)=>l==="create"?i:(n.has(l)||n.set(l,kg(l,void 0,e,t)),n.get(l))})}const L9=(e,t)=>t.isSVG??Yy(e)?new hF(t):new sF(t,{allowProjection:e!==x.Fragment});class P9 extends xs{constructor(t){super(t),t.animationState||(t.animationState=gF(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();hf(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let B9=0;class I9 extends xs{constructor(){super(...arguments),this.id=B9++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const j9={animation:{Feature:P9},exit:{Feature:I9}};function Pc(e){return{point:{x:e.pageX,y:e.pageY}}}const z9=e=>t=>Vy(t)&&e(t,Pc(t));function cc(e,t,n,i){return Sc(e,t,z9(n),i)}const WM=({current:e})=>e?e.ownerDocument.defaultView:null,JC=(e,t)=>Math.abs(e-t);function H9(e,t){const n=JC(e.x,t.x),i=JC(e.y,t.y);return Math.sqrt(n**2+i**2)}const eE=new Set(["auto","scroll"]);class GM{constructor(t,n,{transformPagePoint:i,contextWindow:s=window,dragSnapToOrigin:a=!1,distanceThreshold:l=3,element:u}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=y=>{this.handleScroll(y.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=wh(this.lastRawMoveEventInfo,this.transformPagePoint));const y=Tg(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,S=H9(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!b&&!S)return;const{point:C}=y,{timestamp:k}=on;this.history.push({...C,timestamp:k});const{onStart:T,onMove:R}=this.handlers;b||(T&&T(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),R&&R(this.lastMoveEvent,y)},this.handlePointerMove=(y,b)=>{this.lastMoveEvent=y,this.lastRawMoveEventInfo=b,this.lastMoveEventInfo=wh(b,this.transformPagePoint),at.update(this.updatePoint,!0)},this.handlePointerUp=(y,b)=>{this.end();const{onEnd:S,onSessionEnd:C,resumeAnimation:k}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&k&&k(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const T=Tg(y.type==="pointercancel"?this.lastMoveEventInfo:wh(b,this.transformPagePoint),this.history);this.startEvent&&S&&S(y,T),C&&C(y,T)},!Vy(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=l,this.contextWindow=s||window;const h=Pc(t),d=wh(h,this.transformPagePoint),{point:p}=d,{timestamp:m}=on;this.history=[{...p,timestamp:m}];const{onSessionStart:_}=n;_&&_(t,Tg(d,this.history)),this.removeListeners=Nc(cc(this.contextWindow,"pointermove",this.handlePointerMove),cc(this.contextWindow,"pointerup",this.handlePointerUp),cc(this.contextWindow,"pointercancel",this.handlePointerUp)),u&&this.startScrollTracking(u)}startScrollTracking(t){let n=t.parentElement;for(;n;){const i=getComputedStyle(n);(eE.has(i.overflowX)||eE.has(i.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const i=t===window,s=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},a={x:s.x-n.x,y:s.y-n.y};a.x===0&&a.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(t,s),at.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),_s(this.updatePoint)}}function wh(e,t){return t?{point:t(e.point)}:e}function tE(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Tg({point:e},t){return{point:e,delta:tE(e,qM(t)),offset:tE(e,V9(t)),velocity:U9(t,.1)}}function V9(e){return e[0]}function qM(e){return e[e.length-1]}function U9(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const s=qM(e);for(;n>=0&&(i=e[n],!(s.timestamp-i.timestamp>Gn(t)));)n--;if(!i)return{x:0,y:0};i===e[0]&&e.length>2&&s.timestamp-i.timestamp>Gn(t)*2&&(i=e[1]);const a=ci(s.timestamp-i.timestamp);if(a===0)return{x:0,y:0};const l={x:(s.x-i.x)/a,y:(s.y-i.y)/a};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function F9(e,{min:t,max:n},i){return t!==void 0&&e<t?e=i?_t(t,e,i.min):Math.max(e,t):n!==void 0&&e>n&&(e=i?_t(n,e,i.max):Math.min(e,n)),e}function nE(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function $9(e,{top:t,left:n,bottom:i,right:s}){return{x:nE(e.x,n,s),y:nE(e.y,t,i)}}function iE(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,i]=[i,n]),{min:n,max:i}}function W9(e,t){return{x:iE(e.x,t.x),y:iE(e.y,t.y)}}function G9(e,t){let n=.5;const i=yn(e),s=yn(t);return s>i?n=vc(t.min,t.max-i,e.min):i>s&&(n=vc(e.min,e.max-s,t.min)),Ui(0,1,n)}function q9(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Y_=.35;function K9(e=Y_){return e===!1?e=0:e===!0&&(e=Y_),{x:rE(e,"left","right"),y:rE(e,"top","bottom")}}function rE(e,t,n){return{min:sE(e,t),max:sE(e,n)}}function sE(e,t){return typeof e=="number"?e:e[t]||0}const Y9=new WeakMap;class X9{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Vt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const a=m=>{n&&this.snapToCursor(Pc(m).point),this.stopAnimation()},l=(m,_)=>{const{drag:y,dragPropagation:b,onDragStart:S}=this.getProps();if(y&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=CU(y),!this.openDragLock))return;this.latestPointerEvent=m,this.latestPanInfo=_,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Pi(k=>{let T=this.getAxisMotionValue(k).get()||0;if(Hi.test(T)){const{projection:R}=this.visualElement;if(R&&R.layout){const A=R.layout.layoutBox[k];A&&(T=yn(A)*(parseFloat(T)/100))}}this.originPoint[k]=T}),S&&at.update(()=>S(m,_),!1,!0),V_(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},u=(m,_)=>{this.latestPointerEvent=m,this.latestPanInfo=_;const{dragPropagation:y,dragDirectionLock:b,onDirectionLock:S,onDrag:C}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:k}=_;if(b&&this.currentDirection===null){this.currentDirection=Q9(k),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",_.point,k),this.updateAxis("y",_.point,k),this.visualElement.render(),C&&at.update(()=>C(m,_),!1,!0)},h=(m,_)=>{this.latestPointerEvent=m,this.latestPanInfo=_,this.stop(m,_),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:m}=this.getProps();(m||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:p}=this.getProps();this.panSession=new GM(t,{onSessionStart:a,onStart:l,onMove:u,onSessionEnd:h,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:i,contextWindow:WM(this.visualElement),element:this.visualElement.current})}stop(t,n){const i=t||this.latestPointerEvent,s=n||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!s||!i)return;const{velocity:l}=s;this.startAnimation(l);const{onDragEnd:u}=this.getProps();u&&at.postRender(()=>u(i,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,i){const{drag:s}=this.getProps();if(!i||!xh(t,s,this.currentDirection))return;const a=this.getAxisMotionValue(t);let l=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(l=F9(l,this.constraints[t],this.elastic[t])),a.set(l)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&da(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=$9(i.layoutBox,t):this.constraints=!1,this.elastic=K9(n),s!==this.constraints&&!da(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&Pi(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=q9(i.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!da(t))return!1;const i=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const a=JU(i,s.root,this.visualElement.getTransformPagePoint());let l=W9(s.layout.layoutBox,a);if(n){const u=n(XU(l));this.hasMutatedConstraints=!!u,u&&(l=pM(u))}return l}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:s,dragTransition:a,dragSnapToOrigin:l,onDragTransitionEnd:u}=this.getProps(),h=this.constraints||{},d=Pi(p=>{if(!xh(p,n,this.currentDirection))return;let m=h&&h[p]||{};l&&(m={min:0,max:0});const _=s?200:1e6,y=s?40:1e7,b={type:"inertia",velocity:i?t[p]:0,bounceStiffness:_,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...a,...m};return this.startAxisValueAnimation(p,b)});return Promise.all(d).then(u)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return V_(this.visualElement,t),i.start(By(t,i,0,n,this.visualElement,!1))}stopAnimation(){Pi(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),s=i[n];return s||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){Pi(n=>{const{drag:i}=this.getProps();if(!xh(n,i,this.currentDirection))return;const{projection:s}=this.visualElement,a=this.getAxisMotionValue(n);if(s&&s.layout){const{min:l,max:u}=s.layout.layoutBox[n],h=a.get()||0;a.set(t[n]-_t(l,u,.5)+h)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!da(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Pi(l=>{const u=this.getAxisMotionValue(l);if(u&&this.constraints!==!1){const h=u.get();s[l]=G9({min:h,max:h},this.constraints[l])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),Pi(l=>{if(!xh(l,t,null))return;const u=this.getAxisMotionValue(l),{min:h,max:d}=this.constraints[l];u.set(_t(h,d,s[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Y9.set(this.visualElement,this);const t=this.visualElement.current,n=cc(t,"pointerdown",d=>{const{drag:p,dragListener:m=!0}=this.getProps(),_=d.target,y=_!==t&&MU(_);p&&m&&!y&&this.start(d)});let i;const s=()=>{const{dragConstraints:d}=this.getProps();da(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),i||(i=Z9(t,d.current,()=>this.scalePositionWithinConstraints())))},{projection:a}=this.visualElement,l=a.addEventListener("measure",s);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),at.read(s);const u=Sc(window,"resize",()=>this.scalePositionWithinConstraints()),h=a.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:p})=>{this.isDragging&&p&&(Pi(m=>{const _=this.getAxisMotionValue(m);_&&(this.originPoint[m]+=d[m].translate,_.set(_.get()+d[m].translate))}),this.visualElement.render())}));return()=>{u(),n(),l(),h&&h(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:a=!1,dragElastic:l=Y_,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:s,dragConstraints:a,dragElastic:l,dragMomentum:u}}}function oE(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Z9(e,t,n){const i=dC(e,oE(n)),s=dC(t,oE(n));return()=>{i(),s()}}function xh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Q9(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class J9 extends xs{constructor(t){super(t),this.removeGroupControls=ui,this.removeListeners=ui,this.controls=new X9(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ui}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Ag=e=>(t,n)=>{e&&at.update(()=>e(t,n),!1,!0)};class e$ extends xs{constructor(){super(...arguments),this.removePointerDownListener=ui}onPointerDown(t){this.session=new GM(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:WM(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:Ag(t),onStart:Ag(n),onMove:Ag(i),onEnd:(a,l)=>{delete this.session,s&&at.postRender(()=>s(a,l))}}}mount(){this.removePointerDownListener=cc(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Rg=!1;class t$ extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:s}=this.props,{projection:a}=t;a&&(n.group&&n.group.add(a),i&&i.register&&s&&i.register(a),Rg&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Kh.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:s,isPresent:a}=this.props,{projection:l}=i;return l&&(l.isPresent=a,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),Rg=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==a?l.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?l.promote():l.relegate()||at.postRender(()=>{const u=l.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Hy.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:s}=t;Rg=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function KM(e){const[t,n]=BM(),i=x.useContext(yy);return w.jsx(t$,{...e,layoutGroup:i,switchLayoutGroup:x.useContext(FM),isPresent:t,safeToRemove:n})}const n$={pan:{Feature:e$},drag:{Feature:J9,ProjectionNode:PM,MeasureLayout:KM}};function aE(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,a=i[s];a&&at.postRender(()=>a(t,Pc(t)))}class i$ extends xs{mount(){const{current:t}=this.node;t&&(this.unmount=kU(t,(n,i)=>(aE(this.node,i,"Start"),s=>aE(this.node,s,"End"))))}unmount(){}}class r$ extends xs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Nc(Sc(this.node.current,"focus",()=>this.onFocus()),Sc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function lE(e,t,n){const{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),a=i[s];a&&at.postRender(()=>a(t,Pc(t)))}class s$ extends xs{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=NU(t,(s,a)=>(lE(this.node,a,"Start"),(l,{success:u})=>lE(this.node,l,u?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const X_=new WeakMap,Mg=new WeakMap,o$=e=>{const t=X_.get(e.target);t&&t(e)},a$=e=>{e.forEach(o$)};function l$({root:e,...t}){const n=e||document;Mg.has(n)||Mg.set(n,{});const i=Mg.get(n),s=JSON.stringify(t);return i[s]||(i[s]=new IntersectionObserver(a$,{root:e,...t})),i[s]}function c$(e,t,n){const i=l$(t);return X_.set(e,n),i.observe(e),()=>{X_.delete(e),i.unobserve(e)}}const u$={some:0,all:1};class h$ extends xs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:s="some",once:a}=t,l={root:n?n.current:void 0,rootMargin:i,threshold:typeof s=="number"?s:u$[s]},u=h=>{const{isIntersecting:d}=h;if(this.isInView===d||(this.isInView=d,a&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:p,onViewportLeave:m}=this.node.getProps(),_=d?p:m;_&&_(h)};return c$(this.node.current,l,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(d$(t,n))&&this.startObserver()}unmount(){}}function d$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const f$={inView:{Feature:h$},tap:{Feature:s$},focus:{Feature:r$},hover:{Feature:i$}},p$={layout:{ProjectionNode:PM,MeasureLayout:KM}},m$={...j9,...f$,...n$,...p$},cE=O9(m$,L9);function Dg({className:e,orientation:t="horizontal",decorative:n=!0,...i}){return w.jsx(AB,{"data-slot":"separator",decorative:n,orientation:t,className:lt("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...i})}const uE={0:"text-[#f85149]",1:"text-[#e3b341]",2:"text-[#58a6ff]",3:"text-[#7d8590]",4:"text-muted-foreground"},g$={bug:"bg-[#da3633]/15 text-[#f85149] border-[#da3633]/30",feature:"bg-[#8957e5]/15 text-[#bc8cff] border-[#8957e5]/30",task:"bg-[#2dd4bf]/15 text-[#5eead4] border-[#2dd4bf]/30",epic:"bg-[#d29922]/15 text-[#e3b341] border-[#d29922]/30",chore:"bg-[#7d8590]/15 text-[#7d8590] border-[#7d8590]/30"},_$={open:"bg-[#238636]/20 text-[#3fb950] border border-[#238636]/40",in_progress:"bg-[#1f6feb]/20 text-[#58a6ff] border border-[#1f6feb]/40",closed:"bg-[#7d8590]/20 text-[#7d8590] border border-[#7d8590]/40",blocked:"bg-[#da3633]/20 text-[#f85149] border border-[#da3633]/40"};function Ng(e){return e?new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}):null}function hE({dep:e,onNavigate:t}){const n=e.status==="closed"?"✓":e.status==="in_progress"?"◐":"○";return w.jsxs("div",{className:"flex items-start gap-2 py-1",children:[w.jsx("span",{className:"text-xs leading-4 text-foreground",children:n}),w.jsxs("div",{className:"min-w-0",children:[w.jsxs("div",{className:"flex items-center gap-1",children:[w.jsx("code",{className:"text-xs leading-4 text-muted-foreground cursor-pointer hover:underline hover:text-foreground transition-colors",onClick:()=>t?.(e.id),children:e.id}),e.dependency_type&&w.jsxs("span",{className:"text-xs leading-4 text-muted-foreground",children:["(",e.dependency_type,")"]})]}),w.jsx("p",{className:"text-sm leading-tight text-foreground",children:e.title})]})]})}function v$(e){if(!e)return{opacity:0,scale:.92,y:8};const t=Math.min(560,window.innerWidth-32),n=Math.min(window.innerHeight*.85,640),i=window.innerWidth/2,s=window.innerHeight/2,a=e.left+e.width/2,l=e.top+e.height/2;return{opacity:0,scale:Math.max(e.width/t,e.height/n),x:a-i,y:l-s}}const y$={type:"spring",damping:28,stiffness:380,mass:.8},b$={duration:.2,ease:[.4,0,.2,1]},dE=new Map;function S$({issueId:e,open:t,onClose:n,sourceRect:i,issues:s}){const[a,l]=x.useState(null),[u,h]=x.useState(!1),[d,p]=x.useState([]),[m,_]=x.useState(e),[y,b]=x.useState(!1),S=x.useRef(null);x.useEffect(()=>{_(e),p([]),b(!1),S.current=null},[e]),x.useEffect(()=>{t||(p([]),b(!1),S.current=null)},[t]);const C=x.useCallback(V=>{m&&p(H=>[...H,m]),_(V),b(!1),S.current=null},[m]),k=x.useCallback(()=>{p(V=>{const H=[...V],z=H.pop();return z&&_(z),b(!1),S.current=null,H})},[]),[T,R]=x.useState(!1);x.useEffect(()=>{if(!m||!t)return;const V=dE.get(m);if(V)S.current=V,l(V),b(!0);else if(s){const H=s.find(z=>z.id===m);if(H){const z={id:H.id,title:H.title,status:H.status,priority:H.priority,issue_type:H.issue_type||H.type,description:H.description,created_at:H.created_at,updated_at:H.updated_at,parent:H.parent};S.current=z,l(z),b(!0)}}h(!V&&!s?.find(H=>H.id===m)),fetch(`/api/issue/${m}`).then(H=>{if(!H.ok)throw new Error(`HTTP ${H.status}`);return H.json()}).then(H=>{const z=Array.isArray(H)?H[0]:H;z&&dE.set(m,z),S.current=z||null,T&&(l(z||null),b(!0))}).catch(()=>{V||(S.current=null,T&&(l(null),b(!0)))}).finally(()=>h(!1))},[m,t]),x.useEffect(()=>{T&&!u&&S.current!==void 0&&(l(S.current),b(!0))},[T,u]);const A=x.useCallback(V=>{V.key==="Escape"&&n()},[n]);x.useEffect(()=>{if(t)return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[t,A]);const N=v$(i||null);return x.useEffect(()=>{t||R(!1)},[t]),w.jsx(l9,{children:t&&w.jsxs(w.Fragment,{children:[w.jsx(cE.div,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-[2px]",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:b$,onClick:n},"overlay"),w.jsxs(cE.div,{role:"dialog","aria-modal":"true","aria-labelledby":"issue-detail-title",className:"fixed z-50 w-full sm:max-w-[560px] max-w-[calc(100%-2rem)] max-h-[85vh] rounded-xl border bg-card text-card-foreground border-border shadow-2xl p-0 outline-none overflow-hidden",style:{top:"50%",left:"50%",translateX:"-50%",translateY:"-50%"},initial:N,animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.95,y:6,transition:{duration:.15,ease:[.4,0,1,1]}},transition:y$,onAnimationComplete:()=>R(!0),children:[d.length>0&&w.jsxs("button",{onClick:k,className:"absolute top-4 left-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden",children:[w.jsx(iy,{className:"size-4"}),w.jsx("span",{className:"sr-only",children:"Back"})]}),w.jsxs("button",{onClick:n,className:"absolute top-4 right-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden",children:[w.jsx(sy,{className:"size-4"}),w.jsx("span",{className:"sr-only",children:"Close"})]}),y?a?w.jsxs(ho,{className:"max-h-[80vh]",children:[w.jsxs("div",{className:"p-5 pb-3",children:[w.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-2",children:[w.jsxs("span",{className:`text-xs font-semibold ${uE[a.priority]||uE[4]}`,children:["P",a.priority]}),w.jsx("code",{className:"text-xs text-muted-foreground",children:a.id}),a.issue_type&&w.jsx(ud,{variant:"outline",className:g$[a.issue_type]||"",children:a.issue_type}),w.jsx(ud,{className:_$[a.status]||"",children:a.status.replace("_"," ")})]}),w.jsx("h2",{id:"issue-detail-title",className:"text-base leading-tight font-semibold text-foreground",children:a.title}),a.owner&&w.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:a.owner})]}),w.jsx(Dg,{}),w.jsxs("div",{className:"p-5 space-y-4",children:[a.description&&w.jsxs("div",{children:[w.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Description"}),w.jsx("p",{className:"text-sm whitespace-pre-wrap text-foreground leading-relaxed",children:a.description})]}),a.close_reason&&w.jsxs("div",{children:[w.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Close Reason"}),w.jsx("p",{className:"text-sm text-foreground",children:a.close_reason})]}),a.parent&&w.jsxs("div",{children:[w.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Parent"}),w.jsx("code",{className:"text-xs text-muted-foreground cursor-pointer hover:underline hover:text-foreground transition-colors",onClick:()=>C(a.parent),children:a.parent})]}),a.dependencies&&a.dependencies.length>0&&w.jsxs("div",{children:[w.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Dependencies"}),a.dependencies.map(V=>w.jsx(hE,{dep:V,onNavigate:C},V.id))]}),a.dependents&&a.dependents.length>0&&w.jsxs("div",{children:[w.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Blocks"}),a.dependents.map(V=>w.jsx(hE,{dep:V,onNavigate:C},V.id))]}),w.jsx(Dg,{}),w.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs text-muted-foreground",children:[a.created_at&&w.jsxs("div",{children:[w.jsx("span",{className:"font-semibold",children:"Created"}),w.jsx("p",{children:Ng(a.created_at)})]}),a.updated_at&&w.jsxs("div",{children:[w.jsx("span",{className:"font-semibold",children:"Updated"}),w.jsx("p",{children:Ng(a.updated_at)})]}),a.closed_at&&w.jsxs("div",{children:[w.jsx("span",{className:"font-semibold",children:"Closed"}),w.jsx("p",{children:Ng(a.closed_at)})]})]})]})]}):w.jsx("div",{className:"flex items-center justify-center py-12",children:w.jsx("span",{className:"text-sm text-muted-foreground",children:"Issue not found"})}):w.jsxs("div",{className:"p-5 pb-3 space-y-4 animate-pulse",children:[w.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[w.jsx("div",{className:"h-4 w-6 rounded bg-muted"}),w.jsx("div",{className:"h-4 w-24 rounded bg-muted"}),w.jsx("div",{className:"h-5 w-12 rounded-full bg-muted"}),w.jsx("div",{className:"h-5 w-16 rounded-full bg-muted"})]}),w.jsx("div",{className:"h-5 w-3/4 rounded bg-muted"}),w.jsx("div",{className:"h-4 w-1/3 rounded bg-muted"}),w.jsx(Dg,{}),w.jsxs("div",{className:"space-y-2 pt-2",children:[w.jsx("div",{className:"h-3 w-20 rounded bg-muted"}),w.jsx("div",{className:"h-4 w-full rounded bg-muted"}),w.jsx("div",{className:"h-4 w-full rounded bg-muted"}),w.jsx("div",{className:"h-4 w-2/3 rounded bg-muted"})]})]})]},"modal")]})})}var et=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),xi=et((e,t)=>{var n=Object.defineProperty,i=(P,B,W)=>B in P?n(P,B,{enumerable:!0,configurable:!0,writable:!0,value:W}):P[B]=W,s=(P,B)=>()=>(B||P((B={exports:{}}).exports,B),B.exports),a=(P,B,W)=>i(P,typeof B!="symbol"?B+"":B,W),l=s((P,B)=>{var W="\0",M="\0",U="",j=class{constructor(F){a(this,"_isDirected",!0),a(this,"_isMultigraph",!1),a(this,"_isCompound",!1),a(this,"_label"),a(this,"_defaultNodeLabelFn",()=>{}),a(this,"_defaultEdgeLabelFn",()=>{}),a(this,"_nodes",{}),a(this,"_in",{}),a(this,"_preds",{}),a(this,"_out",{}),a(this,"_sucs",{}),a(this,"_edgeObjs",{}),a(this,"_edgeLabels",{}),a(this,"_nodeCount",0),a(this,"_edgeCount",0),a(this,"_parent"),a(this,"_children"),F&&(this._isDirected=Object.hasOwn(F,"directed")?F.directed:!0,this._isMultigraph=Object.hasOwn(F,"multigraph")?F.multigraph:!1,this._isCompound=Object.hasOwn(F,"compound")?F.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[M]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(F){return this._label=F,this}graph(){return this._label}setDefaultNodeLabel(F){return this._defaultNodeLabelFn=F,typeof F!="function"&&(this._defaultNodeLabelFn=()=>F),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var F=this;return this.nodes().filter(O=>Object.keys(F._in[O]).length===0)}sinks(){var F=this;return this.nodes().filter(O=>Object.keys(F._out[O]).length===0)}setNodes(F,O){var G=arguments,q=this;return F.forEach(function(ne){G.length>1?q.setNode(ne,O):q.setNode(ne)}),this}setNode(F,O){return Object.hasOwn(this._nodes,F)?(arguments.length>1&&(this._nodes[F]=O),this):(this._nodes[F]=arguments.length>1?O:this._defaultNodeLabelFn(F),this._isCompound&&(this._parent[F]=M,this._children[F]={},this._children[M][F]=!0),this._in[F]={},this._preds[F]={},this._out[F]={},this._sucs[F]={},++this._nodeCount,this)}node(F){return this._nodes[F]}hasNode(F){return Object.hasOwn(this._nodes,F)}removeNode(F){var O=this;if(Object.hasOwn(this._nodes,F)){var G=q=>O.removeEdge(O._edgeObjs[q]);delete this._nodes[F],this._isCompound&&(this._removeFromParentsChildList(F),delete this._parent[F],this.children(F).forEach(function(q){O.setParent(q)}),delete this._children[F]),Object.keys(this._in[F]).forEach(G),delete this._in[F],delete this._preds[F],Object.keys(this._out[F]).forEach(G),delete this._out[F],delete this._sucs[F],--this._nodeCount}return this}setParent(F,O){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(O===void 0)O=M;else{O+="";for(var G=O;G!==void 0;G=this.parent(G))if(G===F)throw new Error("Setting "+O+" as parent of "+F+" would create a cycle");this.setNode(O)}return this.setNode(F),this._removeFromParentsChildList(F),this._parent[F]=O,this._children[O][F]=!0,this}_removeFromParentsChildList(F){delete this._children[this._parent[F]][F]}parent(F){if(this._isCompound){var O=this._parent[F];if(O!==M)return O}}children(F=M){if(this._isCompound){var O=this._children[F];if(O)return Object.keys(O)}else{if(F===M)return this.nodes();if(this.hasNode(F))return[]}}predecessors(F){var O=this._preds[F];if(O)return Object.keys(O)}successors(F){var O=this._sucs[F];if(O)return Object.keys(O)}neighbors(F){var O=this.predecessors(F);if(O){let q=new Set(O);for(var G of this.successors(F))q.add(G);return Array.from(q.values())}}isLeaf(F){var O;return this.isDirected()?O=this.successors(F):O=this.neighbors(F),O.length===0}filterNodes(F){var O=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});O.setGraph(this.graph());var G=this;Object.entries(this._nodes).forEach(function([re,fe]){F(re)&&O.setNode(re,fe)}),Object.values(this._edgeObjs).forEach(function(re){O.hasNode(re.v)&&O.hasNode(re.w)&&O.setEdge(re,G.edge(re))});var q={};function ne(re){var fe=G.parent(re);return fe===void 0||O.hasNode(fe)?(q[re]=fe,fe):fe in q?q[fe]:ne(fe)}return this._isCompound&&O.nodes().forEach(re=>O.setParent(re,ne(re))),O}setDefaultEdgeLabel(F){return this._defaultEdgeLabelFn=F,typeof F!="function"&&(this._defaultEdgeLabelFn=()=>F),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(F,O){var G=this,q=arguments;return F.reduce(function(ne,re){return q.length>1?G.setEdge(ne,re,O):G.setEdge(ne,re),re}),this}setEdge(){var F,O,G,q,ne=!1,re=arguments[0];typeof re=="object"&&re!==null&&"v"in re?(F=re.v,O=re.w,G=re.name,arguments.length===2&&(q=arguments[1],ne=!0)):(F=re,O=arguments[1],G=arguments[3],arguments.length>2&&(q=arguments[2],ne=!0)),F=""+F,O=""+O,G!==void 0&&(G=""+G);var fe=L(this._isDirected,F,O,G);if(Object.hasOwn(this._edgeLabels,fe))return ne&&(this._edgeLabels[fe]=q),this;if(G!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(F),this.setNode(O),this._edgeLabels[fe]=ne?q:this._defaultEdgeLabelFn(F,O,G);var pe=Z(this._isDirected,F,O,G);return F=pe.v,O=pe.w,Object.freeze(pe),this._edgeObjs[fe]=pe,ee(this._preds[O],F),ee(this._sucs[F],O),this._in[O][fe]=pe,this._out[F][fe]=pe,this._edgeCount++,this}edge(F,O,G){var q=arguments.length===1?ie(this._isDirected,arguments[0]):L(this._isDirected,F,O,G);return this._edgeLabels[q]}edgeAsObj(){let F=this.edge(...arguments);return typeof F!="object"?{label:F}:F}hasEdge(F,O,G){var q=arguments.length===1?ie(this._isDirected,arguments[0]):L(this._isDirected,F,O,G);return Object.hasOwn(this._edgeLabels,q)}removeEdge(F,O,G){var q=arguments.length===1?ie(this._isDirected,arguments[0]):L(this._isDirected,F,O,G),ne=this._edgeObjs[q];return ne&&(F=ne.v,O=ne.w,delete this._edgeLabels[q],delete this._edgeObjs[q],X(this._preds[O],F),X(this._sucs[F],O),delete this._in[O][q],delete this._out[F][q],this._edgeCount--),this}inEdges(F,O){return this.isDirected()?this.filterEdges(this._in[F],F,O):this.nodeEdges(F,O)}outEdges(F,O){return this.isDirected()?this.filterEdges(this._out[F],F,O):this.nodeEdges(F,O)}nodeEdges(F,O){if(F in this._nodes)return this.filterEdges({...this._in[F],...this._out[F]},F,O)}filterEdges(F,O,G){if(F){var q=Object.values(F);return G?q.filter(function(ne){return ne.v===O&&ne.w===G||ne.v===G&&ne.w===O}):q}}};function ee(F,O){F[O]?F[O]++:F[O]=1}function X(F,O){--F[O]||delete F[O]}function L(F,O,G,q){var ne=""+O,re=""+G;if(!F&&ne>re){var fe=ne;ne=re,re=fe}return ne+U+re+U+(q===void 0?W:q)}function Z(F,O,G,q){var ne=""+O,re=""+G;if(!F&&ne>re){var fe=ne;ne=re,re=fe}var pe={v:ne,w:re};return q&&(pe.name=q),pe}function ie(F,O){return L(F,O.v,O.w,O.name)}B.exports=j}),u=s((P,B)=>{B.exports="3.0.2"}),h=s((P,B)=>{B.exports={Graph:l(),version:u()}}),d=s((P,B)=>{var W=l();B.exports={write:M,read:ee};function M(X){var L={options:{directed:X.isDirected(),multigraph:X.isMultigraph(),compound:X.isCompound()},nodes:U(X),edges:j(X)};return X.graph()!==void 0&&(L.value=structuredClone(X.graph())),L}function U(X){return X.nodes().map(function(L){var Z=X.node(L),ie=X.parent(L),F={v:L};return Z!==void 0&&(F.value=Z),ie!==void 0&&(F.parent=ie),F})}function j(X){return X.edges().map(function(L){var Z=X.edge(L),ie={v:L.v,w:L.w};return L.name!==void 0&&(ie.name=L.name),Z!==void 0&&(ie.value=Z),ie})}function ee(X){var L=new W(X.options).setGraph(X.value);return X.nodes.forEach(function(Z){L.setNode(Z.v,Z.value),Z.parent&&L.setParent(Z.v,Z.parent)}),X.edges.forEach(function(Z){L.setEdge({v:Z.v,w:Z.w,name:Z.name},Z.value)}),L}}),p=s((P,B)=>{B.exports=M;var W=()=>1;function M(j,ee,X,L){return U(j,String(ee),X||W,L||function(Z){return j.outEdges(Z)})}function U(j,ee,X,L){var Z={},ie=!0,F=0,O=j.nodes(),G=function(fe){var pe=X(fe);Z[fe.v].distance+pe<Z[fe.w].distance&&(Z[fe.w]={distance:Z[fe.v].distance+pe,predecessor:fe.v},ie=!0)},q=function(){O.forEach(function(fe){L(fe).forEach(function(pe){var xe=pe.v===fe?pe.v:pe.w,Ee=xe===pe.v?pe.w:pe.v;G({v:xe,w:Ee})})})};O.forEach(function(fe){var pe=fe===ee?0:Number.POSITIVE_INFINITY;Z[fe]={distance:pe}});for(var ne=O.length,re=1;re<ne&&(ie=!1,F++,q(),!!ie);re++);if(F===ne-1&&(ie=!1,q(),ie))throw new Error("The graph contains a negative weight cycle");return Z}}),m=s((P,B)=>{B.exports=W;function W(M){var U={},j=[],ee;function X(L){Object.hasOwn(U,L)||(U[L]=!0,ee.push(L),M.successors(L).forEach(X),M.predecessors(L).forEach(X))}return M.nodes().forEach(function(L){ee=[],X(L),ee.length&&j.push(ee)}),j}}),_=s((P,B)=>{var W=class{constructor(){a(this,"_arr",[]),a(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(M){return M.key})}has(M){return Object.hasOwn(this._keyIndices,M)}priority(M){var U=this._keyIndices[M];if(U!==void 0)return this._arr[U].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(M,U){var j=this._keyIndices;if(M=String(M),!Object.hasOwn(j,M)){var ee=this._arr,X=ee.length;return j[M]=X,ee.push({key:M,priority:U}),this._decrease(X),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var M=this._arr.pop();return delete this._keyIndices[M.key],this._heapify(0),M.key}decrease(M,U){var j=this._keyIndices[M];if(U>this._arr[j].priority)throw new Error("New priority is greater than current priority. Key: "+M+" Old: "+this._arr[j].priority+" New: "+U);this._arr[j].priority=U,this._decrease(j)}_heapify(M){var U=this._arr,j=2*M,ee=j+1,X=M;j<U.length&&(X=U[j].priority<U[X].priority?j:X,ee<U.length&&(X=U[ee].priority<U[X].priority?ee:X),X!==M&&(this._swap(M,X),this._heapify(X)))}_decrease(M){for(var U=this._arr,j=U[M].priority,ee;M!==0&&(ee=M>>1,!(U[ee].priority<j));)this._swap(M,ee),M=ee}_swap(M,U){var j=this._arr,ee=this._keyIndices,X=j[M],L=j[U];j[M]=L,j[U]=X,ee[L.key]=M,ee[X.key]=U}};B.exports=W}),y=s((P,B)=>{var W=_();B.exports=U;var M=()=>1;function U(ee,X,L,Z){var ie=function(F){return ee.outEdges(F)};return j(ee,String(X),L||M,Z||ie)}function j(ee,X,L,Z){var ie={},F=new W,O,G,q=function(ne){var re=ne.v!==O?ne.v:ne.w,fe=ie[re],pe=L(ne),xe=G.distance+pe;if(pe<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+ne+" Weight: "+pe);xe<fe.distance&&(fe.distance=xe,fe.predecessor=O,F.decrease(re,xe))};for(ee.nodes().forEach(function(ne){var re=ne===X?0:Number.POSITIVE_INFINITY;ie[ne]={distance:re},F.add(ne,re)});F.size()>0&&(O=F.removeMin(),G=ie[O],G.distance!==Number.POSITIVE_INFINITY);)Z(O).forEach(q);return ie}}),b=s((P,B)=>{var W=y();B.exports=M;function M(U,j,ee){return U.nodes().reduce(function(X,L){return X[L]=W(U,L,j,ee),X},{})}}),S=s((P,B)=>{B.exports=W;function W(U,j,ee){if(U[j].predecessor!==void 0)throw new Error("Invalid source vertex");if(U[ee].predecessor===void 0&&ee!==j)throw new Error("Invalid destination vertex");return{weight:U[ee].distance,path:M(U,j,ee)}}function M(U,j,ee){for(var X=[],L=ee;L!==j;)X.push(L),L=U[L].predecessor;return X.push(j),X.reverse()}}),C=s((P,B)=>{B.exports=W;function W(M){var U=0,j=[],ee={},X=[];function L(Z){var ie=ee[Z]={onStack:!0,lowlink:U,index:U++};if(j.push(Z),M.successors(Z).forEach(function(G){Object.hasOwn(ee,G)?ee[G].onStack&&(ie.lowlink=Math.min(ie.lowlink,ee[G].index)):(L(G),ie.lowlink=Math.min(ie.lowlink,ee[G].lowlink))}),ie.lowlink===ie.index){var F=[],O;do O=j.pop(),ee[O].onStack=!1,F.push(O);while(Z!==O);X.push(F)}}return M.nodes().forEach(function(Z){Object.hasOwn(ee,Z)||L(Z)}),X}}),k=s((P,B)=>{var W=C();B.exports=M;function M(U){return W(U).filter(function(j){return j.length>1||j.length===1&&U.hasEdge(j[0],j[0])})}}),T=s((P,B)=>{B.exports=M;var W=()=>1;function M(j,ee,X){return U(j,ee||W,X||function(L){return j.outEdges(L)})}function U(j,ee,X){var L={},Z=j.nodes();return Z.forEach(function(ie){L[ie]={},L[ie][ie]={distance:0},Z.forEach(function(F){ie!==F&&(L[ie][F]={distance:Number.POSITIVE_INFINITY})}),X(ie).forEach(function(F){var O=F.v===ie?F.w:F.v,G=ee(F);L[ie][O]={distance:G,predecessor:ie}})}),Z.forEach(function(ie){var F=L[ie];Z.forEach(function(O){var G=L[O];Z.forEach(function(q){var ne=G[ie],re=F[q],fe=G[q],pe=ne.distance+re.distance;pe<fe.distance&&(fe.distance=pe,fe.predecessor=re.predecessor)})})}),L}}),R=s((P,B)=>{function W(U){var j={},ee={},X=[];function L(Z){if(Object.hasOwn(ee,Z))throw new M;Object.hasOwn(j,Z)||(ee[Z]=!0,j[Z]=!0,U.predecessors(Z).forEach(L),delete ee[Z],X.push(Z))}if(U.sinks().forEach(L),Object.keys(j).length!==U.nodeCount())throw new M;return X}var M=class extends Error{constructor(){super(...arguments)}};B.exports=W,W.CycleException=M}),A=s((P,B)=>{var W=R();B.exports=M;function M(U){try{W(U)}catch(j){if(j instanceof W.CycleException)return!1;throw j}return!0}}),N=s((P,B)=>{B.exports=W;function W(U,j,ee,X,L){Array.isArray(j)||(j=[j]);var Z=(U.isDirected()?U.successors:U.neighbors).bind(U),ie={};return j.forEach(function(F){if(!U.hasNode(F))throw new Error("Graph does not have node: "+F);L=M(U,F,ee==="post",ie,Z,X,L)}),L}function M(U,j,ee,X,L,Z,ie){return Object.hasOwn(X,j)||(X[j]=!0,ee||(ie=Z(ie,j)),L(j).forEach(function(F){ie=M(U,F,ee,X,L,Z,ie)}),ee&&(ie=Z(ie,j))),ie}}),V=s((P,B)=>{var W=N();B.exports=M;function M(U,j,ee){return W(U,j,ee,function(X,L){return X.push(L),X},[])}}),H=s((P,B)=>{var W=V();B.exports=M;function M(U,j){return W(U,j,"post")}}),z=s((P,B)=>{var W=V();B.exports=M;function M(U,j){return W(U,j,"pre")}}),J=s((P,B)=>{var W=l(),M=_();B.exports=U;function U(j,ee){var X=new W,L={},Z=new M,ie;function F(G){var q=G.v===ie?G.w:G.v,ne=Z.priority(q);if(ne!==void 0){var re=ee(G);re<ne&&(L[q]=ie,Z.decrease(q,re))}}if(j.nodeCount()===0)return X;j.nodes().forEach(function(G){Z.add(G,Number.POSITIVE_INFINITY),X.setNode(G)}),Z.decrease(j.nodes()[0],0);for(var O=!1;Z.size()>0;){if(ie=Z.removeMin(),Object.hasOwn(L,ie))X.setEdge(ie,L[ie]);else{if(O)throw new Error("Input graph is not connected: "+j);O=!0}j.nodeEdges(ie).forEach(F)}return X}}),$=s((P,B)=>{var W=y(),M=p();B.exports=U;function U(ee,X,L,Z){return j(ee,X,L,Z||function(ie){return ee.outEdges(ie)})}function j(ee,X,L,Z){if(L===void 0)return W(ee,X,L,Z);for(var ie=!1,F=ee.nodes(),O=0;O<F.length;O++){for(var G=Z(F[O]),q=0;q<G.length;q++){var ne=G[q],re=ne.v===F[O]?ne.v:ne.w,fe=re===ne.v?ne.w:ne.v;L({v:re,w:fe})<0&&(ie=!0)}if(ie)return M(ee,X,L,Z)}return W(ee,X,L,Z)}}),K=s((P,B)=>{B.exports={bellmanFord:p(),components:m(),dijkstra:y(),dijkstraAll:b(),extractPath:S(),findCycles:k(),floydWarshall:T(),isAcyclic:A(),postorder:H(),preorder:z(),prim:J(),shortestPaths:$(),reduce:N(),tarjan:C(),topsort:R()}}),I=h();t.exports={Graph:I.Graph,json:d(),alg:K(),version:I.version}}),w$=et((e,t)=>{var n=class{constructor(){let a={};a._next=a._prev=a,this._sentinel=a}dequeue(){let a=this._sentinel,l=a._prev;if(l!==a)return i(l),l}enqueue(a){let l=this._sentinel;a._prev&&a._next&&i(a),a._next=l._next,l._next._prev=a,l._next=a,a._prev=l}toString(){let a=[],l=this._sentinel,u=l._prev;for(;u!==l;)a.push(JSON.stringify(u,s)),u=u._prev;return"["+a.join(", ")+"]"}};function i(a){a._prev._next=a._next,a._next._prev=a._prev,delete a._next,delete a._prev}function s(a,l){if(a!=="_next"&&a!=="_prev")return l}t.exports=n}),x$=et((e,t)=>{var n=xi().Graph,i=w$();t.exports=a;var s=()=>1;function a(m,_){if(m.nodeCount()<=1)return[];let y=h(m,_||s);return l(y.graph,y.buckets,y.zeroIdx).flatMap(b=>m.outEdges(b.v,b.w))}function l(m,_,y){let b=[],S=_[_.length-1],C=_[0],k;for(;m.nodeCount();){for(;k=C.dequeue();)u(m,_,y,k);for(;k=S.dequeue();)u(m,_,y,k);if(m.nodeCount()){for(let T=_.length-2;T>0;--T)if(k=_[T].dequeue(),k){b=b.concat(u(m,_,y,k,!0));break}}}return b}function u(m,_,y,b,S){let C=S?[]:void 0;return m.inEdges(b.v).forEach(k=>{let T=m.edge(k),R=m.node(k.v);S&&C.push({v:k.v,w:k.w}),R.out-=T,d(_,y,R)}),m.outEdges(b.v).forEach(k=>{let T=m.edge(k),R=k.w,A=m.node(R);A.in-=T,d(_,y,A)}),m.removeNode(b.v),C}function h(m,_){let y=new n,b=0,S=0;m.nodes().forEach(T=>{y.setNode(T,{v:T,in:0,out:0})}),m.edges().forEach(T=>{let R=y.edge(T.v,T.w)||0,A=_(T),N=R+A;y.setEdge(T.v,T.w,N),S=Math.max(S,y.node(T.v).out+=A),b=Math.max(b,y.node(T.w).in+=A)});let C=p(S+b+3).map(()=>new i),k=b+1;return y.nodes().forEach(T=>{d(C,k,y.node(T))}),{graph:y,buckets:C,zeroIdx:k}}function d(m,_,y){y.out?y.in?m[y.out-y.in+_].enqueue(y):m[m.length-1].enqueue(y):m[0].enqueue(y)}function p(m){let _=[];for(let y=0;y<m;y++)_.push(y);return _}}),Bt=et((e,t)=>{var n=xi().Graph;t.exports={addBorderNode:_,addDummyNode:i,applyWithChunking:S,asNonCompoundGraph:a,buildLayerMatrix:d,intersectRect:h,mapValues:z,maxRank:C,normalizeRanks:p,notime:R,partition:k,pick:H,predecessorWeights:u,range:V,removeEmptyRanks:m,simplify:s,successorWeights:l,time:T,uniqueId:N,zipObject:J};function i($,K,I,P){for(var B=P;$.hasNode(B);)B=N(P);return I.dummy=K,$.setNode(B,I),B}function s($){let K=new n().setGraph($.graph());return $.nodes().forEach(I=>K.setNode(I,$.node(I))),$.edges().forEach(I=>{let P=K.edge(I.v,I.w)||{weight:0,minlen:1},B=$.edge(I);K.setEdge(I.v,I.w,{weight:P.weight+B.weight,minlen:Math.max(P.minlen,B.minlen)})}),K}function a($){let K=new n({multigraph:$.isMultigraph()}).setGraph($.graph());return $.nodes().forEach(I=>{$.children(I).length||K.setNode(I,$.node(I))}),$.edges().forEach(I=>{K.setEdge(I,$.edge(I))}),K}function l($){let K=$.nodes().map(I=>{let P={};return $.outEdges(I).forEach(B=>{P[B.w]=(P[B.w]||0)+$.edge(B).weight}),P});return J($.nodes(),K)}function u($){let K=$.nodes().map(I=>{let P={};return $.inEdges(I).forEach(B=>{P[B.v]=(P[B.v]||0)+$.edge(B).weight}),P});return J($.nodes(),K)}function h($,K){let I=$.x,P=$.y,B=K.x-I,W=K.y-P,M=$.width/2,U=$.height/2;if(!B&&!W)throw new Error("Not possible to find intersection inside of the rectangle");let j,ee;return Math.abs(W)*M>Math.abs(B)*U?(W<0&&(U=-U),j=U*B/W,ee=U):(B<0&&(M=-M),j=M,ee=M*W/B),{x:I+j,y:P+ee}}function d($){let K=V(C($)+1).map(()=>[]);return $.nodes().forEach(I=>{let P=$.node(I),B=P.rank;B!==void 0&&(K[B][P.order]=I)}),K}function p($){let K=$.nodes().map(P=>{let B=$.node(P).rank;return B===void 0?Number.MAX_VALUE:B}),I=S(Math.min,K);$.nodes().forEach(P=>{let B=$.node(P);Object.hasOwn(B,"rank")&&(B.rank-=I)})}function m($){let K=$.nodes().map(M=>$.node(M).rank).filter(M=>M!==void 0),I=S(Math.min,K),P=[];$.nodes().forEach(M=>{let U=$.node(M).rank-I;P[U]||(P[U]=[]),P[U].push(M)});let B=0,W=$.graph().nodeRankFactor;Array.from(P).forEach((M,U)=>{M===void 0&&U%W!==0?--B:M!==void 0&&B&&M.forEach(j=>$.node(j).rank+=B)})}function _($,K,I,P){let B={width:0,height:0};return arguments.length>=4&&(B.rank=I,B.order=P),i($,"border",B,K)}function y($,K=b){let I=[];for(let P=0;P<$.length;P+=K){let B=$.slice(P,P+K);I.push(B)}return I}var b=65535;function S($,K){if(K.length>b){let I=y(K);return $.apply(null,I.map(P=>$.apply(null,P)))}else return $.apply(null,K)}function C($){let K=$.nodes().map(I=>{let P=$.node(I).rank;return P===void 0?Number.MIN_VALUE:P});return S(Math.max,K)}function k($,K){let I={lhs:[],rhs:[]};return $.forEach(P=>{K(P)?I.lhs.push(P):I.rhs.push(P)}),I}function T($,K){let I=Date.now();try{return K()}finally{console.log($+" time: "+(Date.now()-I)+"ms")}}function R($,K){return K()}var A=0;function N($){var K=++A;return $+(""+K)}function V($,K,I=1){K==null&&(K=$,$=0);let P=W=>W<K;I<0&&(P=W=>K<W);let B=[];for(let W=$;P(W);W+=I)B.push(W);return B}function H($,K){let I={};for(let P of K)$[P]!==void 0&&(I[P]=$[P]);return I}function z($,K){let I=K;return typeof K=="string"&&(I=P=>P[K]),Object.entries($).reduce((P,[B,W])=>(P[B]=I(W,B),P),{})}function J($,K){return $.reduce((I,P,B)=>(I[P]=K[B],I),{})}}),C$=et((e,t)=>{var n=x$(),i=Bt().uniqueId;t.exports={run:s,undo:l};function s(u){(u.graph().acyclicer==="greedy"?n(u,h(u)):a(u)).forEach(d=>{let p=u.edge(d);u.removeEdge(d),p.forwardName=d.name,p.reversed=!0,u.setEdge(d.w,d.v,p,i("rev"))});function h(d){return p=>d.edge(p).weight}}function a(u){let h=[],d={},p={};function m(_){Object.hasOwn(p,_)||(p[_]=!0,d[_]=!0,u.outEdges(_).forEach(y=>{Object.hasOwn(d,y.w)?h.push(y):m(y.w)}),delete d[_])}return u.nodes().forEach(m),h}function l(u){u.edges().forEach(h=>{let d=u.edge(h);if(d.reversed){u.removeEdge(h);let p=d.forwardName;delete d.reversed,delete d.forwardName,u.setEdge(h.w,h.v,d,p)}})}}),E$=et((e,t)=>{var n=Bt();t.exports={run:i,undo:a};function i(l){l.graph().dummyChains=[],l.edges().forEach(u=>s(l,u))}function s(l,u){let h=u.v,d=l.node(h).rank,p=u.w,m=l.node(p).rank,_=u.name,y=l.edge(u),b=y.labelRank;if(m===d+1)return;l.removeEdge(u);let S,C,k;for(k=0,++d;d<m;++k,++d)y.points=[],C={width:0,height:0,edgeLabel:y,edgeObj:u,rank:d},S=n.addDummyNode(l,"edge",C,"_d"),d===b&&(C.width=y.width,C.height=y.height,C.dummy="edge-label",C.labelpos=y.labelpos),l.setEdge(h,S,{weight:y.weight},_),k===0&&l.graph().dummyChains.push(S),h=S;l.setEdge(h,p,{weight:y.weight},_)}function a(l){l.graph().dummyChains.forEach(u=>{let h=l.node(u),d=h.edgeLabel,p;for(l.setEdge(h.edgeObj,d);h.dummy;)p=l.successors(u)[0],l.removeNode(u),d.points.push({x:h.x,y:h.y}),h.dummy==="edge-label"&&(d.x=h.x,d.y=h.y,d.width=h.width,d.height=h.height),u=p,h=l.node(u)})}}),Md=et((e,t)=>{var{applyWithChunking:n}=Bt();t.exports={longestPath:i,slack:s};function i(a){var l={};function u(h){var d=a.node(h);if(Object.hasOwn(l,h))return d.rank;l[h]=!0;let p=a.outEdges(h).map(_=>_==null?Number.POSITIVE_INFINITY:u(_.w)-a.edge(_).minlen);var m=n(Math.min,p);return m===Number.POSITIVE_INFINITY&&(m=0),d.rank=m}a.sources().forEach(u)}function s(a,l){return a.node(l.w).rank-a.node(l.v).rank-a.edge(l).minlen}}),YM=et((e,t)=>{var n=xi().Graph,i=Md().slack;t.exports=s;function s(h){var d=new n({directed:!1}),p=h.nodes()[0],m=h.nodeCount();d.setNode(p,{});for(var _,y;a(d,h)<m;)_=l(d,h),y=d.hasNode(_.v)?i(h,_):-i(h,_),u(d,h,y);return d}function a(h,d){function p(m){d.nodeEdges(m).forEach(_=>{var y=_.v,b=m===y?_.w:y;!h.hasNode(b)&&!i(d,_)&&(h.setNode(b,{}),h.setEdge(m,b,{}),p(b))})}return h.nodes().forEach(p),h.nodeCount()}function l(h,d){return d.edges().reduce((p,m)=>{let _=Number.POSITIVE_INFINITY;return h.hasNode(m.v)!==h.hasNode(m.w)&&(_=i(d,m)),_<p[0]?[_,m]:p},[Number.POSITIVE_INFINITY,null])[1]}function u(h,d,p){h.nodes().forEach(m=>d.node(m).rank+=p)}}),k$=et((e,t)=>{var n=YM(),i=Md().slack,s=Md().longestPath,a=xi().alg.preorder,l=xi().alg.postorder,u=Bt().simplify;t.exports=h,h.initLowLimValues=_,h.initCutValues=d,h.calcCutValue=m,h.leaveEdge=b,h.enterEdge=S,h.exchangeEdges=C;function h(A){A=u(A),s(A);var N=n(A);_(N),d(N,A);for(var V,H;V=b(N);)H=S(N,A,V),C(N,A,V,H)}function d(A,N){var V=l(A,A.nodes());V=V.slice(0,V.length-1),V.forEach(H=>p(A,N,H))}function p(A,N,V){var H=A.node(V),z=H.parent;A.edge(V,z).cutvalue=m(A,N,V)}function m(A,N,V){var H=A.node(V),z=H.parent,J=!0,$=N.edge(V,z),K=0;return $||(J=!1,$=N.edge(z,V)),K=$.weight,N.nodeEdges(V).forEach(I=>{var P=I.v===V,B=P?I.w:I.v;if(B!==z){var W=P===J,M=N.edge(I).weight;if(K+=W?M:-M,T(A,V,B)){var U=A.edge(V,B).cutvalue;K+=W?-U:U}}}),K}function _(A,N){arguments.length<2&&(N=A.nodes()[0]),y(A,{},1,N)}function y(A,N,V,H,z){var J=V,$=A.node(H);return N[H]=!0,A.neighbors(H).forEach(K=>{Object.hasOwn(N,K)||(V=y(A,N,V,K,H))}),$.low=J,$.lim=V++,z?$.parent=z:delete $.parent,V}function b(A){return A.edges().find(N=>A.edge(N).cutvalue<0)}function S(A,N,V){var H=V.v,z=V.w;N.hasEdge(H,z)||(H=V.w,z=V.v);var J=A.node(H),$=A.node(z),K=J,I=!1;J.lim>$.lim&&(K=$,I=!0);var P=N.edges().filter(B=>I===R(A,A.node(B.v),K)&&I!==R(A,A.node(B.w),K));return P.reduce((B,W)=>i(N,W)<i(N,B)?W:B)}function C(A,N,V,H){var z=V.v,J=V.w;A.removeEdge(z,J),A.setEdge(H.v,H.w,{}),_(A),d(A,N),k(A,N)}function k(A,N){var V=A.nodes().find(z=>!N.node(z).parent),H=a(A,V);H=H.slice(1),H.forEach(z=>{var J=A.node(z).parent,$=N.edge(z,J),K=!1;$||($=N.edge(J,z),K=!0),N.node(z).rank=N.node(J).rank+(K?$.minlen:-$.minlen)})}function T(A,N,V){return A.hasEdge(N,V)}function R(A,N,V){return V.low<=N.lim&&N.lim<=V.lim}}),T$=et((e,t)=>{var n=Md(),i=n.longestPath,s=YM(),a=k$();t.exports=l;function l(p){var m=p.graph().ranker;if(m instanceof Function)return m(p);switch(p.graph().ranker){case"network-simplex":d(p);break;case"tight-tree":h(p);break;case"longest-path":u(p);break;case"none":break;default:d(p)}}var u=i;function h(p){i(p),s(p)}function d(p){a(p)}}),A$=et((e,t)=>{t.exports=n;function n(a){let l=s(a);a.graph().dummyChains.forEach(u=>{let h=a.node(u),d=h.edgeObj,p=i(a,l,d.v,d.w),m=p.path,_=p.lca,y=0,b=m[y],S=!0;for(;u!==d.w;){if(h=a.node(u),S){for(;(b=m[y])!==_&&a.node(b).maxRank<h.rank;)y++;b===_&&(S=!1)}if(!S){for(;y<m.length-1&&a.node(b=m[y+1]).minRank<=h.rank;)y++;b=m[y]}a.setParent(u,b),u=a.successors(u)[0]}})}function i(a,l,u,h){let d=[],p=[],m=Math.min(l[u].low,l[h].low),_=Math.max(l[u].lim,l[h].lim),y,b;y=u;do y=a.parent(y),d.push(y);while(y&&(l[y].low>m||_>l[y].lim));for(b=y,y=h;(y=a.parent(y))!==b;)p.push(y);return{path:d.concat(p.reverse()),lca:b}}function s(a){let l={},u=0;function h(d){let p=u;a.children(d).forEach(h),l[d]={low:p,lim:u++}}return a.children().forEach(h),l}}),R$=et((e,t)=>{var n=Bt();t.exports={run:i,cleanup:u};function i(h){let d=n.addDummyNode(h,"root",{},"_root"),p=a(h),m=Object.values(p),_=n.applyWithChunking(Math.max,m)-1,y=2*_+1;h.graph().nestingRoot=d,h.edges().forEach(S=>h.edge(S).minlen*=y);let b=l(h)+1;h.children().forEach(S=>s(h,d,y,b,_,p,S)),h.graph().nodeRankFactor=y}function s(h,d,p,m,_,y,b){let S=h.children(b);if(!S.length){b!==d&&h.setEdge(d,b,{weight:0,minlen:p});return}let C=n.addBorderNode(h,"_bt"),k=n.addBorderNode(h,"_bb"),T=h.node(b);h.setParent(C,b),T.borderTop=C,h.setParent(k,b),T.borderBottom=k,S.forEach(R=>{s(h,d,p,m,_,y,R);let A=h.node(R),N=A.borderTop?A.borderTop:R,V=A.borderBottom?A.borderBottom:R,H=A.borderTop?m:2*m,z=N!==V?1:_-y[b]+1;h.setEdge(C,N,{weight:H,minlen:z,nestingEdge:!0}),h.setEdge(V,k,{weight:H,minlen:z,nestingEdge:!0})}),h.parent(b)||h.setEdge(d,C,{weight:0,minlen:_+y[b]})}function a(h){var d={};function p(m,_){var y=h.children(m);y&&y.length&&y.forEach(b=>p(b,_+1)),d[m]=_}return h.children().forEach(m=>p(m,1)),d}function l(h){return h.edges().reduce((d,p)=>d+h.edge(p).weight,0)}function u(h){var d=h.graph();h.removeNode(d.nestingRoot),delete d.nestingRoot,h.edges().forEach(p=>{var m=h.edge(p);m.nestingEdge&&h.removeEdge(p)})}}),M$=et((e,t)=>{var n=Bt();t.exports=i;function i(a){function l(u){let h=a.children(u),d=a.node(u);if(h.length&&h.forEach(l),Object.hasOwn(d,"minRank")){d.borderLeft=[],d.borderRight=[];for(let p=d.minRank,m=d.maxRank+1;p<m;++p)s(a,"borderLeft","_bl",u,d,p),s(a,"borderRight","_br",u,d,p)}}a.children().forEach(l)}function s(a,l,u,h,d,p){let m={width:0,height:0,rank:p,borderType:l},_=d[l][p-1],y=n.addDummyNode(a,"border",m,u);d[l][p]=y,a.setParent(y,h),_&&a.setEdge(_,y,{weight:1})}}),D$=et((e,t)=>{t.exports={adjust:n,undo:i};function n(p){let m=p.graph().rankdir.toLowerCase();(m==="lr"||m==="rl")&&s(p)}function i(p){let m=p.graph().rankdir.toLowerCase();(m==="bt"||m==="rl")&&l(p),(m==="lr"||m==="rl")&&(h(p),s(p))}function s(p){p.nodes().forEach(m=>a(p.node(m))),p.edges().forEach(m=>a(p.edge(m)))}function a(p){let m=p.width;p.width=p.height,p.height=m}function l(p){p.nodes().forEach(m=>u(p.node(m))),p.edges().forEach(m=>{let _=p.edge(m);_.points.forEach(u),Object.hasOwn(_,"y")&&u(_)})}function u(p){p.y=-p.y}function h(p){p.nodes().forEach(m=>d(p.node(m))),p.edges().forEach(m=>{let _=p.edge(m);_.points.forEach(d),Object.hasOwn(_,"x")&&d(_)})}function d(p){let m=p.x;p.x=p.y,p.y=m}}),N$=et((e,t)=>{var n=Bt();t.exports=i;function i(s){let a={},l=s.nodes().filter(m=>!s.children(m).length),u=l.map(m=>s.node(m).rank),h=n.applyWithChunking(Math.max,u),d=n.range(h+1).map(()=>[]);function p(m){if(a[m])return;a[m]=!0;let _=s.node(m);d[_.rank].push(m),s.successors(m).forEach(p)}return l.sort((m,_)=>s.node(m).rank-s.node(_).rank).forEach(p),d}}),O$=et((e,t)=>{var n=Bt().zipObject;t.exports=i;function i(a,l){let u=0;for(let h=1;h<l.length;++h)u+=s(a,l[h-1],l[h]);return u}function s(a,l,u){let h=n(u,u.map((b,S)=>S)),d=l.flatMap(b=>a.outEdges(b).map(S=>({pos:h[S.w],weight:a.edge(S).weight})).sort((S,C)=>S.pos-C.pos)),p=1;for(;p<u.length;)p<<=1;let m=2*p-1;p-=1;let _=new Array(m).fill(0),y=0;return d.forEach(b=>{let S=b.pos+p;_[S]+=b.weight;let C=0;for(;S>0;)S%2&&(C+=_[S+1]),S=S-1>>1,_[S]+=b.weight;y+=b.weight*C}),y}}),L$=et((e,t)=>{t.exports=n;function n(i,s=[]){return s.map(a=>{let l=i.inEdges(a);if(l.length){let u=l.reduce((h,d)=>{let p=i.edge(d),m=i.node(d.v);return{sum:h.sum+p.weight*m.order,weight:h.weight+p.weight}},{sum:0,weight:0});return{v:a,barycenter:u.sum/u.weight,weight:u.weight}}else return{v:a}})}}),P$=et((e,t)=>{var n=Bt();t.exports=i;function i(l,u){let h={};l.forEach((p,m)=>{let _=h[p.v]={indegree:0,in:[],out:[],vs:[p.v],i:m};p.barycenter!==void 0&&(_.barycenter=p.barycenter,_.weight=p.weight)}),u.edges().forEach(p=>{let m=h[p.v],_=h[p.w];m!==void 0&&_!==void 0&&(_.indegree++,m.out.push(h[p.w]))});let d=Object.values(h).filter(p=>!p.indegree);return s(d)}function s(l){let u=[];function h(p){return m=>{m.merged||(m.barycenter===void 0||p.barycenter===void 0||m.barycenter>=p.barycenter)&&a(p,m)}}function d(p){return m=>{m.in.push(p),--m.indegree===0&&l.push(m)}}for(;l.length;){let p=l.pop();u.push(p),p.in.reverse().forEach(h(p)),p.out.forEach(d(p))}return u.filter(p=>!p.merged).map(p=>n.pick(p,["vs","i","barycenter","weight"]))}function a(l,u){let h=0,d=0;l.weight&&(h+=l.barycenter*l.weight,d+=l.weight),u.weight&&(h+=u.barycenter*u.weight,d+=u.weight),l.vs=u.vs.concat(l.vs),l.barycenter=h/d,l.weight=d,l.i=Math.min(u.i,l.i),u.merged=!0}}),B$=et((e,t)=>{var n=Bt();t.exports=i;function i(l,u){let h=n.partition(l,C=>Object.hasOwn(C,"barycenter")),d=h.lhs,p=h.rhs.sort((C,k)=>k.i-C.i),m=[],_=0,y=0,b=0;d.sort(a(!!u)),b=s(m,p,b),d.forEach(C=>{b+=C.vs.length,m.push(C.vs),_+=C.barycenter*C.weight,y+=C.weight,b=s(m,p,b)});let S={vs:m.flat(!0)};return y&&(S.barycenter=_/y,S.weight=y),S}function s(l,u,h){let d;for(;u.length&&(d=u[u.length-1]).i<=h;)u.pop(),l.push(d.vs),h++;return h}function a(l){return(u,h)=>u.barycenter<h.barycenter?-1:u.barycenter>h.barycenter?1:l?h.i-u.i:u.i-h.i}}),I$=et((e,t)=>{var n=L$(),i=P$(),s=B$();t.exports=a;function a(h,d,p,m){let _=h.children(d),y=h.node(d),b=y?y.borderLeft:void 0,S=y?y.borderRight:void 0,C={};b&&(_=_.filter(A=>A!==b&&A!==S));let k=n(h,_);k.forEach(A=>{if(h.children(A.v).length){let N=a(h,A.v,p,m);C[A.v]=N,Object.hasOwn(N,"barycenter")&&u(A,N)}});let T=i(k,p);l(T,C);let R=s(T,m);if(b&&(R.vs=[b,R.vs,S].flat(!0),h.predecessors(b).length)){let A=h.node(h.predecessors(b)[0]),N=h.node(h.predecessors(S)[0]);Object.hasOwn(R,"barycenter")||(R.barycenter=0,R.weight=0),R.barycenter=(R.barycenter*R.weight+A.order+N.order)/(R.weight+2),R.weight+=2}return R}function l(h,d){h.forEach(p=>{p.vs=p.vs.flatMap(m=>d[m]?d[m].vs:m)})}function u(h,d){h.barycenter!==void 0?(h.barycenter=(h.barycenter*h.weight+d.barycenter*d.weight)/(h.weight+d.weight),h.weight+=d.weight):(h.barycenter=d.barycenter,h.weight=d.weight)}}),j$=et((e,t)=>{var n=xi().Graph,i=Bt();t.exports=s;function s(l,u,h,d){d||(d=l.nodes());let p=a(l),m=new n({compound:!0}).setGraph({root:p}).setDefaultNodeLabel(_=>l.node(_));return d.forEach(_=>{let y=l.node(_),b=l.parent(_);(y.rank===u||y.minRank<=u&&u<=y.maxRank)&&(m.setNode(_),m.setParent(_,b||p),l[h](_).forEach(S=>{let C=S.v===_?S.w:S.v,k=m.edge(C,_),T=k!==void 0?k.weight:0;m.setEdge(C,_,{weight:l.edge(S).weight+T})}),Object.hasOwn(y,"minRank")&&m.setNode(_,{borderLeft:y.borderLeft[u],borderRight:y.borderRight[u]}))}),m}function a(l){for(var u;l.hasNode(u=i.uniqueId("_root")););return u}}),z$=et((e,t)=>{t.exports=n;function n(i,s,a){let l={},u;a.forEach(h=>{let d=i.parent(h),p,m;for(;d;){if(p=i.parent(d),p?(m=l[p],l[p]=d):(m=u,u=d),m&&m!==d){s.setEdge(m,d);return}d=p}})}}),H$=et((e,t)=>{var n=N$(),i=O$(),s=I$(),a=j$(),l=z$(),u=xi().Graph,h=Bt();t.exports=d;function d(y,b={}){if(typeof b.customOrder=="function"){b.customOrder(y,d);return}let S=h.maxRank(y),C=p(y,h.range(1,S+1),"inEdges"),k=p(y,h.range(S-1,-1,-1),"outEdges"),T=n(y);if(_(y,T),b.disableOptimalOrderHeuristic)return;let R=Number.POSITIVE_INFINITY,A,N=b.constraints||[];for(let V=0,H=0;H<4;++V,++H){m(V%2?C:k,V%4>=2,N),T=h.buildLayerMatrix(y);let z=i(y,T);z<R?(H=0,A=Object.assign({},T),R=z):z===R&&(A=structuredClone(T))}_(y,A)}function p(y,b,S){let C=new Map,k=(T,R)=>{C.has(T)||C.set(T,[]),C.get(T).push(R)};for(let T of y.nodes()){let R=y.node(T);if(typeof R.rank=="number"&&k(R.rank,T),typeof R.minRank=="number"&&typeof R.maxRank=="number")for(let A=R.minRank;A<=R.maxRank;A++)A!==R.rank&&k(A,T)}return b.map(function(T){return a(y,T,S,C.get(T)||[])})}function m(y,b,S){let C=new u;y.forEach(function(k){S.forEach(A=>C.setEdge(A.left,A.right));let T=k.graph().root,R=s(k,T,C,b);R.vs.forEach((A,N)=>k.node(A).order=N),l(k,C,R.vs)})}function _(y,b){Object.values(b).forEach(S=>S.forEach((C,k)=>y.node(C).order=k))}}),V$=et((e,t)=>{var n=xi().Graph,i=Bt();t.exports={positionX:S,findType1Conflicts:s,findType2Conflicts:a,addConflict:u,hasConflict:h,verticalAlignment:d,horizontalCompaction:p,alignCoordinates:y,findSmallestWidthAlignment:_,balance:b};function s(T,R){let A={};function N(V,H){let z=0,J=0,$=V.length,K=H[H.length-1];return H.forEach((I,P)=>{let B=l(T,I),W=B?T.node(B).order:$;(B||I===K)&&(H.slice(J,P+1).forEach(M=>{T.predecessors(M).forEach(U=>{let j=T.node(U),ee=j.order;(ee<z||W<ee)&&!(j.dummy&&T.node(M).dummy)&&u(A,U,M)})}),J=P+1,z=W)}),H}return R.length&&R.reduce(N),A}function a(T,R){let A={};function N(H,z,J,$,K){let I;i.range(z,J).forEach(P=>{I=H[P],T.node(I).dummy&&T.predecessors(I).forEach(B=>{let W=T.node(B);W.dummy&&(W.order<$||W.order>K)&&u(A,B,I)})})}function V(H,z){let J=-1,$,K=0;return z.forEach((I,P)=>{if(T.node(I).dummy==="border"){let B=T.predecessors(I);B.length&&($=T.node(B[0]).order,N(z,K,P,J,$),K=P,J=$)}N(z,K,z.length,$,H.length)}),z}return R.length&&R.reduce(V),A}function l(T,R){if(T.node(R).dummy)return T.predecessors(R).find(A=>T.node(A).dummy)}function u(T,R,A){if(R>A){let V=R;R=A,A=V}let N=T[R];N||(T[R]=N={}),N[A]=!0}function h(T,R,A){if(R>A){let N=R;R=A,A=N}return!!T[R]&&Object.hasOwn(T[R],A)}function d(T,R,A,N){let V={},H={},z={};return R.forEach(J=>{J.forEach(($,K)=>{V[$]=$,H[$]=$,z[$]=K})}),R.forEach(J=>{let $=-1;J.forEach(K=>{let I=N(K);if(I.length){I=I.sort((B,W)=>z[B]-z[W]);let P=(I.length-1)/2;for(let B=Math.floor(P),W=Math.ceil(P);B<=W;++B){let M=I[B];H[K]===K&&$<z[M]&&!h(A,K,M)&&(H[M]=K,H[K]=V[K]=V[M],$=z[M])}}})}),{root:V,align:H}}function p(T,R,A,N,V){let H={},z=m(T,R,A,V),J=V?"borderLeft":"borderRight";function $(P,B){let W=z.nodes().slice(),M={},U=W.pop();for(;U;){if(M[U])P(U);else{M[U]=!0,W.push(U);for(let j of B(U))W.push(j)}U=W.pop()}}function K(P){H[P]=z.inEdges(P).reduce((B,W)=>Math.max(B,H[W.v]+z.edge(W)),0)}function I(P){let B=z.outEdges(P).reduce((M,U)=>Math.min(M,H[U.w]-z.edge(U)),Number.POSITIVE_INFINITY),W=T.node(P);B!==Number.POSITIVE_INFINITY&&W.borderType!==J&&(H[P]=Math.max(H[P],B))}return $(K,z.predecessors.bind(z)),$(I,z.successors.bind(z)),Object.keys(N).forEach(P=>H[P]=H[A[P]]),H}function m(T,R,A,N){let V=new n,H=T.graph(),z=C(H.nodesep,H.edgesep,N);return R.forEach(J=>{let $;J.forEach(K=>{let I=A[K];if(V.setNode(I),$){var P=A[$],B=V.edge(P,I);V.setEdge(P,I,Math.max(z(T,K,$),B||0))}$=K})}),V}function _(T,R){return Object.values(R).reduce((A,N)=>{let V=Number.NEGATIVE_INFINITY,H=Number.POSITIVE_INFINITY;Object.entries(N).forEach(([J,$])=>{let K=k(T,J)/2;V=Math.max($+K,V),H=Math.min($-K,H)});let z=V-H;return z<A[0]&&(A=[z,N]),A},[Number.POSITIVE_INFINITY,null])[1]}function y(T,R){let A=Object.values(R),N=i.applyWithChunking(Math.min,A),V=i.applyWithChunking(Math.max,A);["u","d"].forEach(H=>{["l","r"].forEach(z=>{let J=H+z,$=T[J];if($===R)return;let K=Object.values($),I=N-i.applyWithChunking(Math.min,K);z!=="l"&&(I=V-i.applyWithChunking(Math.max,K)),I&&(T[J]=i.mapValues($,P=>P+I))})})}function b(T,R){return i.mapValues(T.ul,(A,N)=>{if(R)return T[R.toLowerCase()][N];{let V=Object.values(T).map(H=>H[N]).sort((H,z)=>H-z);return(V[1]+V[2])/2}})}function S(T){let R=i.buildLayerMatrix(T),A=Object.assign(s(T,R),a(T,R)),N={},V;["u","d"].forEach(z=>{V=z==="u"?R:Object.values(R).reverse(),["l","r"].forEach(J=>{J==="r"&&(V=V.map(P=>Object.values(P).reverse()));let $=(z==="u"?T.predecessors:T.successors).bind(T),K=d(T,V,A,$),I=p(T,V,K.root,K.align,J==="r");J==="r"&&(I=i.mapValues(I,P=>-P)),N[z+J]=I})});let H=_(T,N);return y(N,H),b(N,T.graph().align)}function C(T,R,A){return(N,V,H)=>{let z=N.node(V),J=N.node(H),$=0,K;if($+=z.width/2,Object.hasOwn(z,"labelpos"))switch(z.labelpos.toLowerCase()){case"l":K=-z.width/2;break;case"r":K=z.width/2;break}if(K&&($+=A?K:-K),K=0,$+=(z.dummy?R:T)/2,$+=(J.dummy?R:T)/2,$+=J.width/2,Object.hasOwn(J,"labelpos"))switch(J.labelpos.toLowerCase()){case"l":K=J.width/2;break;case"r":K=-J.width/2;break}return K&&($+=A?K:-K),K=0,$}}function k(T,R){return T.node(R).width}}),U$=et((e,t)=>{var n=Bt(),i=V$().positionX;t.exports=s;function s(l){l=n.asNonCompoundGraph(l),a(l),Object.entries(i(l)).forEach(([u,h])=>l.node(u).x=h)}function a(l){let u=n.buildLayerMatrix(l),h=l.graph().ranksep,d=l.graph().rankalign,p=0;u.forEach(m=>{let _=m.reduce((y,b)=>{let S=l.node(b).height;return y>S?y:S},0);m.forEach(y=>{let b=l.node(y);d==="top"?b.y=p+b.height/2:d==="bottom"?b.y=p+_-b.height/2:b.y=p+_/2}),p+=_+h})}}),F$=et((e,t)=>{var n=C$(),i=E$(),s=T$(),a=Bt().normalizeRanks,l=A$(),u=Bt().removeEmptyRanks,h=R$(),d=M$(),p=D$(),m=H$(),_=U$(),y=Bt(),b=xi().Graph;t.exports=S;function S(O,G={}){let q=G.debugTiming?y.time:y.notime;return q("layout",()=>{let ne=q(" buildLayoutGraph",()=>$(O));return q(" runLayout",()=>C(ne,q,G)),q(" updateInputGraph",()=>k(O,ne)),ne})}function C(O,G,q){G(" makeSpaceForEdgeLabels",()=>K(O)),G(" removeSelfEdges",()=>X(O)),G(" acyclic",()=>n.run(O)),G(" nestingGraph.run",()=>h.run(O)),G(" rank",()=>s(y.asNonCompoundGraph(O))),G(" injectEdgeLabelProxies",()=>I(O)),G(" removeEmptyRanks",()=>u(O)),G(" nestingGraph.cleanup",()=>h.cleanup(O)),G(" normalizeRanks",()=>a(O)),G(" assignRankMinMax",()=>P(O)),G(" removeEdgeLabelProxies",()=>B(O)),G(" normalize.run",()=>i.run(O)),G(" parentDummyChains",()=>l(O)),G(" addBorderSegments",()=>d(O)),G(" order",()=>m(O,q)),G(" insertSelfEdges",()=>L(O)),G(" adjustCoordinateSystem",()=>p.adjust(O)),G(" position",()=>_(O)),G(" positionSelfEdges",()=>Z(O)),G(" removeBorderNodes",()=>ee(O)),G(" normalize.undo",()=>i.undo(O)),G(" fixupEdgeLabelCoords",()=>U(O)),G(" undoCoordinateSystem",()=>p.undo(O)),G(" translateGraph",()=>W(O)),G(" assignNodeIntersects",()=>M(O)),G(" reversePoints",()=>j(O)),G(" acyclic.undo",()=>n.undo(O))}function k(O,G){O.nodes().forEach(q=>{let ne=O.node(q),re=G.node(q);ne&&(ne.x=re.x,ne.y=re.y,ne.order=re.order,ne.rank=re.rank,G.children(q).length&&(ne.width=re.width,ne.height=re.height))}),O.edges().forEach(q=>{let ne=O.edge(q),re=G.edge(q);ne.points=re.points,Object.hasOwn(re,"x")&&(ne.x=re.x,ne.y=re.y)}),O.graph().width=G.graph().width,O.graph().height=G.graph().height}var T=["nodesep","edgesep","ranksep","marginx","marginy"],R={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},A=["acyclicer","ranker","rankdir","align","rankalign"],N=["width","height","rank"],V={width:0,height:0},H=["minlen","weight","width","height","labeloffset"],z={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},J=["labelpos"];function $(O){let G=new b({multigraph:!0,compound:!0}),q=F(O.graph());return G.setGraph(Object.assign({},R,ie(q,T),y.pick(q,A))),O.nodes().forEach(ne=>{let re=F(O.node(ne)),fe=ie(re,N);Object.keys(V).forEach(pe=>{fe[pe]===void 0&&(fe[pe]=V[pe])}),G.setNode(ne,fe),G.setParent(ne,O.parent(ne))}),O.edges().forEach(ne=>{let re=F(O.edge(ne));G.setEdge(ne,Object.assign({},z,ie(re,H),y.pick(re,J)))}),G}function K(O){let G=O.graph();G.ranksep/=2,O.edges().forEach(q=>{let ne=O.edge(q);ne.minlen*=2,ne.labelpos.toLowerCase()!=="c"&&(G.rankdir==="TB"||G.rankdir==="BT"?ne.width+=ne.labeloffset:ne.height+=ne.labeloffset)})}function I(O){O.edges().forEach(G=>{let q=O.edge(G);if(q.width&&q.height){let ne=O.node(G.v),re={rank:(O.node(G.w).rank-ne.rank)/2+ne.rank,e:G};y.addDummyNode(O,"edge-proxy",re,"_ep")}})}function P(O){let G=0;O.nodes().forEach(q=>{let ne=O.node(q);ne.borderTop&&(ne.minRank=O.node(ne.borderTop).rank,ne.maxRank=O.node(ne.borderBottom).rank,G=Math.max(G,ne.maxRank))}),O.graph().maxRank=G}function B(O){O.nodes().forEach(G=>{let q=O.node(G);q.dummy==="edge-proxy"&&(O.edge(q.e).labelRank=q.rank,O.removeNode(G))})}function W(O){let G=Number.POSITIVE_INFINITY,q=0,ne=Number.POSITIVE_INFINITY,re=0,fe=O.graph(),pe=fe.marginx||0,xe=fe.marginy||0;function Ee(Pe){let Ce=Pe.x,De=Pe.y,vt=Pe.width,cn=Pe.height;G=Math.min(G,Ce-vt/2),q=Math.max(q,Ce+vt/2),ne=Math.min(ne,De-cn/2),re=Math.max(re,De+cn/2)}O.nodes().forEach(Pe=>Ee(O.node(Pe))),O.edges().forEach(Pe=>{let Ce=O.edge(Pe);Object.hasOwn(Ce,"x")&&Ee(Ce)}),G-=pe,ne-=xe,O.nodes().forEach(Pe=>{let Ce=O.node(Pe);Ce.x-=G,Ce.y-=ne}),O.edges().forEach(Pe=>{let Ce=O.edge(Pe);Ce.points.forEach(De=>{De.x-=G,De.y-=ne}),Object.hasOwn(Ce,"x")&&(Ce.x-=G),Object.hasOwn(Ce,"y")&&(Ce.y-=ne)}),fe.width=q-G+pe,fe.height=re-ne+xe}function M(O){O.edges().forEach(G=>{let q=O.edge(G),ne=O.node(G.v),re=O.node(G.w),fe,pe;q.points?(fe=q.points[0],pe=q.points[q.points.length-1]):(q.points=[],fe=re,pe=ne),q.points.unshift(y.intersectRect(ne,fe)),q.points.push(y.intersectRect(re,pe))})}function U(O){O.edges().forEach(G=>{let q=O.edge(G);if(Object.hasOwn(q,"x"))switch((q.labelpos==="l"||q.labelpos==="r")&&(q.width-=q.labeloffset),q.labelpos){case"l":q.x-=q.width/2+q.labeloffset;break;case"r":q.x+=q.width/2+q.labeloffset;break}})}function j(O){O.edges().forEach(G=>{let q=O.edge(G);q.reversed&&q.points.reverse()})}function ee(O){O.nodes().forEach(G=>{if(O.children(G).length){let q=O.node(G),ne=O.node(q.borderTop),re=O.node(q.borderBottom),fe=O.node(q.borderLeft[q.borderLeft.length-1]),pe=O.node(q.borderRight[q.borderRight.length-1]);q.width=Math.abs(pe.x-fe.x),q.height=Math.abs(re.y-ne.y),q.x=fe.x+q.width/2,q.y=ne.y+q.height/2}}),O.nodes().forEach(G=>{O.node(G).dummy==="border"&&O.removeNode(G)})}function X(O){O.edges().forEach(G=>{if(G.v===G.w){var q=O.node(G.v);q.selfEdges||(q.selfEdges=[]),q.selfEdges.push({e:G,label:O.edge(G)}),O.removeEdge(G)}})}function L(O){var G=y.buildLayerMatrix(O);G.forEach(q=>{var ne=0;q.forEach((re,fe)=>{var pe=O.node(re);pe.order=fe+ne,(pe.selfEdges||[]).forEach(xe=>{y.addDummyNode(O,"selfedge",{width:xe.label.width,height:xe.label.height,rank:pe.rank,order:fe+ ++ne,e:xe.e,label:xe.label},"_se")}),delete pe.selfEdges})})}function Z(O){O.nodes().forEach(G=>{var q=O.node(G);if(q.dummy==="selfedge"){var ne=O.node(q.e.v),re=ne.x+ne.width/2,fe=ne.y,pe=q.x-re,xe=ne.height/2;O.setEdge(q.e,q.label),O.removeNode(G),q.label.points=[{x:re+2*pe/3,y:fe-xe},{x:re+5*pe/6,y:fe-xe},{x:re+pe,y:fe},{x:re+5*pe/6,y:fe+xe},{x:re+2*pe/3,y:fe+xe}],q.label.x=q.x,q.label.y=q.y}})}function ie(O,G){return y.mapValues(y.pick(O,G),Number)}function F(O){var G={};return O&&Object.entries(O).forEach(([q,ne])=>{typeof q=="string"&&(q=q.toLowerCase()),G[q]=ne}),G}}),$$=et((e,t)=>{var n=Bt(),i=xi().Graph;t.exports={debugOrdering:s};function s(a){let l=n.buildLayerMatrix(a),u=new i({compound:!0,multigraph:!0}).setGraph({});return a.nodes().forEach(h=>{u.setNode(h,{label:h}),u.setParent(h,"layer"+a.node(h).rank)}),a.edges().forEach(h=>u.setEdge(h.v,h.w,{},h.name)),l.forEach((h,d)=>{let p="layer"+d;u.setNode(p,{rank:"same"}),h.reduce((m,_)=>(u.setEdge(m,_,{style:"invis"}),_))}),u}}),W$=et((e,t)=>{t.exports="2.0.4"}),G$=et((e,t)=>{t.exports={graphlib:xi(),layout:F$(),debug:$$(),util:{time:Bt().time,notime:Bt().notime},version:W$()}});const fE=G$();const q$={open:{bg:"#1a2e1a",border:"#238636",text:"#7ee787"},in_progress:{bg:"#152238",border:"#1f6feb",text:"#79c0ff"},closed:{bg:"#1c1c1c",border:"#484f58",text:"#8b949e"},blocked:{bg:"#3b1a1a",border:"#da3633",text:"#ff7b72"},deferred:{bg:"#2a2017",border:"#9e6a03",text:"#e3b341"}},K$={open:{bg:"#dafbe1",border:"#238636",text:"#116329"},in_progress:{bg:"#ddf4ff",border:"#1f6feb",text:"#0550ae"},closed:{bg:"#f0f0f0",border:"#8b949e",text:"#57606a"},blocked:{bg:"#ffebe9",border:"#da3633",text:"#cf222e"},deferred:{bg:"#fff8c5",border:"#9e6a03",text:"#6f4e00"}},pE={0:"#f85149",1:"#e3b341",2:"#58a6ff",3:"#7d8590",4:"#484f58"},Y$={bg:"#1c1c1c",border:"#484f58",text:"#8b949e"},X$={bg:"#f6f8fa",border:"#d0d7de",text:"#57606a"},Xs=200,fa=62,Ch=40;function Xy(e){return typeof e=="string"?{depends_on_id:e,type:"blocks"}:{depends_on_id:e.depends_on_id,type:e.type||"blocks"}}function Z$(e){const t=new fE.graphlib.Graph;t.setGraph({rankdir:"TB",nodesep:40,ranksep:60,marginx:Ch,marginy:Ch}),t.setDefaultEdgeLabel(()=>({}));const n=new Map(e.map(d=>[d.id,d]));for(const d of e)t.setNode(d.id,{width:Xs,height:fa});const i=new Map;for(const d of e)if(d.dependencies)for(const p of d.dependencies){const m=Xy(p);if(n.has(m.depends_on_id)){const _=`${d.id}|${m.depends_on_id}`;i.set(_,m.type),t.setEdge(d.id,m.depends_on_id)}}for(const d of e)if(d.parent&&n.has(d.parent)){const p=`${d.parent}|${d.id}`;i.has(p)||(i.set(p,"parent-child"),t.setEdge(d.parent,d.id))}fE.layout(t);const s=[],a=[];for(const d of t.nodes()){const p=t.node(d),m=n.get(d);p&&m&&s.push({id:d,x:p.x,y:p.y,issue:m})}for(const d of t.edges()){const p=t.edge(d);if(p&&p.points){const m=`${d.v}|${d.w}`;a.push({from:d.v,to:d.w,type:i.get(m)||"blocks",points:p.points})}}const l=t.graph(),u=(l?.width||800)+Ch*2,h=(l?.height||600)+Ch*2;return{nodes:s,edges:a,width:u,height:h}}function XM(e,t,n=new Set){if(n.has(e))return n;n.add(e);const i=t.get(e);if(i?.dependencies)for(const s of i.dependencies){const a=Xy(s);t.has(a.depends_on_id)&&XM(a.depends_on_id,t,n)}return n}function ZM(e,t,n=new Set){if(n.has(e))return n;n.add(e);const i=t.get(e)||[];for(const s of i)ZM(s,t,n);return n}function Q$(e){if(e.length<2)return"";if(e.length===2)return`M ${e[0].x} ${e[0].y} L ${e[1].x} ${e[1].y}`;let t=`M ${e[0].x} ${e[0].y}`;for(let i=1;i<e.length-1;i++){const s=e[i],a=e[i+1],l=(s.x+a.x)/2,u=(s.y+a.y)/2;i===1?t+=` Q ${s.x} ${s.y} ${l} ${u}`:t+=` T ${l} ${u}`}const n=e[e.length-1];return t+=` L ${n.x} ${n.y}`,t}function J$(e,t){return e.length<=t?e:e.slice(0,t-1)+"…"}function eW({issues:e,onNodeClick:t}){const n=x.useRef(null),[i,s]=x.useState(null),[a,l]=x.useState({x:0,y:0,scale:1}),[u,h]=x.useState(!1),d=x.useRef({x:0,y:0,tx:0,ty:0}),[p,m]=x.useState(!0);x.useEffect(()=>{const I=()=>m(document.documentElement.classList.contains("dark"));I();const P=new MutationObserver(I);return P.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>P.disconnect()},[]);const _=p?q$:K$,y=p?Y$:X$,b=x.useMemo(()=>new Map(e.map(I=>[I.id,I])),[e]),S=x.useMemo(()=>{const I=new Map;for(const P of e){if(P.dependencies)for(const B of P.dependencies){const W=Xy(B),M=I.get(W.depends_on_id)||[];M.push(P.id),I.set(W.depends_on_id,M)}if(P.parent){const B=I.get(P.parent)||[];B.push(P.id),I.set(P.parent,B)}}return I},[e]),C=x.useMemo(()=>Z$(e),[e]),k=x.useMemo(()=>{if(!i)return null;const I=XM(i,b),P=ZM(i,S);return new Set([...I,...P])},[i,b,S]);x.useEffect(()=>{if(!n.current)return;const{width:I,height:P}=C,B=n.current.clientWidth,W=n.current.clientHeight;if(I===0||P===0)return;const M=Math.min(B/I,W/P,1)*.9,U=(B-I*M)/2,j=(W-P*M)/2;l({x:U,y:j,scale:M})},[C]);const T=x.useCallback(I=>{I.preventDefault();const P=I.deltaY>0?.9:1.1;l(B=>{const W=Math.min(3,Math.max(.1,B.scale*P)),M=n.current?.getBoundingClientRect();if(!M)return{...B,scale:W};const U=I.clientX-M.left,j=I.clientY-M.top;return{scale:W,x:U-(U-B.x)*(W/B.scale),y:j-(j-B.y)*(W/B.scale)}})},[]),R=x.useCallback(I=>{I.button===0&&(I.target.closest(".dag-node")||(h(!0),d.current={x:I.clientX,y:I.clientY,tx:a.x,ty:a.y}))},[a]),A=x.useCallback(I=>{u&&l({...a,x:d.current.tx+(I.clientX-d.current.x),y:d.current.ty+(I.clientY-d.current.y)})},[u,a]),N=x.useCallback(()=>{h(!1)},[]),V=x.useCallback(I=>{s(P=>P===I?null:I),t?.(I)},[t]),H=p?"#0d1117":"#ffffff",z=p?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.04)",J=p?"rgba(139,148,158,0.3)":"rgba(87,96,106,0.25)",$=p?"rgba(136,192,255,0.7)":"rgba(31,111,235,0.6)",K=p?"rgba(139,148,158,0.08)":"rgba(87,96,106,0.08)";return e.length===0?w.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"No issues to display"}):w.jsxs("div",{ref:n,className:"w-full h-full relative overflow-hidden",style:{background:H,cursor:u?"grabbing":"grab"},onWheel:T,onMouseDown:R,onMouseMove:A,onMouseUp:N,onMouseLeave:N,children:[w.jsxs("svg",{width:"100%",height:"100%",style:{position:"absolute",top:0,left:0},children:[w.jsxs("defs",{children:[w.jsx("pattern",{id:"dag-grid",width:"20",height:"20",patternUnits:"userSpaceOnUse",patternTransform:`translate(${a.x},${a.y}) scale(${a.scale})`,children:w.jsx("circle",{cx:"10",cy:"10",r:"0.5",fill:z})}),w.jsx("marker",{id:"dag-arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:w.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:J})}),w.jsx("marker",{id:"dag-arrow-highlight",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:w.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:$})}),w.jsx("marker",{id:"dag-arrow-dim",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:w.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:K})}),w.jsxs("filter",{id:"dag-glow",children:[w.jsx("feGaussianBlur",{stdDeviation:"3",result:"coloredBlur"}),w.jsxs("feMerge",{children:[w.jsx("feMergeNode",{in:"coloredBlur"}),w.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),w.jsx("rect",{width:"100%",height:"100%",fill:"url(#dag-grid)"}),w.jsxs("g",{transform:`translate(${a.x},${a.y}) scale(${a.scale})`,children:[C.edges.map((I,P)=>{const B=k?k.has(I.from)&&k.has(I.to):!1,W=k!==null&&!B,M=W?K:B?$:J,U=W?"dag-arrow-dim":B?"dag-arrow-highlight":"dag-arrow",j=I.type==="parent-child";return w.jsx("path",{d:Q$(I.points),fill:"none",stroke:M,strokeWidth:B?2:1.5,strokeDasharray:j?"6 3":void 0,markerEnd:`url(#${U})`,style:{transition:"stroke 0.3s, stroke-width 0.3s, opacity 0.3s"}},`edge-${P}`)}),C.nodes.map(I=>{const P=I.issue.status||"open",B=_[P]||y,W=i===I.id,M=k?k.has(I.id):!1,j=k!==null&&!M?.2:1,ee=pE[I.issue.priority]||pE[3];return w.jsxs("g",{className:"dag-node",transform:`translate(${I.x-Xs/2},${I.y-fa/2})`,onClick:()=>V(I.id),style:{cursor:"pointer",opacity:j,transition:"opacity 0.3s"},children:[w.jsx("rect",{width:Xs,height:fa,rx:8,ry:8,fill:B.bg,stroke:W?B.text:B.border,strokeWidth:W?2.5:1.5,filter:W?"url(#dag-glow)":void 0,style:{transition:"stroke 0.2s, stroke-width 0.2s"}}),w.jsx("rect",{x:0,y:0,width:4,height:fa,rx:2,fill:B.border}),w.jsx("circle",{cx:Xs-12,cy:fa/2,r:4,fill:ee,opacity:.8}),w.jsx("text",{x:Xs-12,y:fa/2+3.5,fill:p?"#0d1117":"#ffffff",fontSize:7,fontFamily:"system-ui, sans-serif",fontWeight:700,textAnchor:"middle",children:I.issue.priority}),w.jsx("text",{x:14,y:20,fill:B.text,fontSize:11,fontFamily:"ui-monospace, SFMono-Regular, monospace",fontWeight:600,children:I.issue.id}),w.jsx("text",{x:14,y:40,fill:p?"#c9d1d9":"#1f2328",fontSize:11,fontFamily:"system-ui, -apple-system, sans-serif",children:J$(I.issue.title,24)}),w.jsx("rect",{x:Xs-80,y:6,width:56,height:18,rx:9,fill:B.border,opacity:.3}),w.jsx("text",{x:Xs-52,y:18,fill:B.text,fontSize:9,fontFamily:"system-ui, sans-serif",textAnchor:"middle",children:P.replace("_"," ")})]},I.id)})]})]}),w.jsxs("div",{className:"absolute bottom-4 left-4 rounded-lg border p-3 text-xs space-y-1.5",style:{background:p?"rgba(13,17,23,0.9)":"rgba(255,255,255,0.9)",borderColor:p?"rgba(48,54,61,0.8)":"rgba(208,215,222,0.8)",backdropFilter:"blur(8px)"},children:[w.jsx("div",{className:"font-semibold text-foreground mb-1",children:"Status"}),Object.entries(_).map(([I,P])=>w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:"inline-block w-3 h-3 rounded-sm",style:{background:P.border}}),w.jsx("span",{style:{color:P.text},children:I.replace("_"," ")})]},I)),w.jsxs("div",{className:"border-t pt-1.5 mt-1.5",style:{borderColor:p?"rgba(48,54,61,0.6)":"rgba(208,215,222,0.6)"},children:[w.jsx("div",{className:"font-semibold text-foreground mb-1",children:"Edges"}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("svg",{width:"24",height:"8",children:w.jsx("line",{x1:"0",y1:"4",x2:"24",y2:"4",stroke:J,strokeWidth:"1.5"})}),w.jsx("span",{className:"text-muted-foreground",children:"blocks"})]}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("svg",{width:"24",height:"8",children:w.jsx("line",{x1:"0",y1:"4",x2:"24",y2:"4",stroke:J,strokeWidth:"1.5",strokeDasharray:"4 2"})}),w.jsx("span",{className:"text-muted-foreground",children:"parent-child"})]})]}),w.jsx("div",{className:"border-t pt-1.5 mt-1.5",style:{borderColor:p?"rgba(48,54,61,0.6)":"rgba(208,215,222,0.6)"},children:w.jsx("span",{className:"text-muted-foreground",children:"Click node to highlight deps"})})]}),w.jsx("div",{className:"absolute bottom-4 right-4 rounded-lg border px-3 py-2 text-xs text-muted-foreground",style:{background:p?"rgba(13,17,23,0.9)":"rgba(255,255,255,0.9)",borderColor:p?"rgba(48,54,61,0.8)":"rgba(208,215,222,0.8)",backdropFilter:"blur(8px)"},children:"Scroll to zoom · Drag to pan"})]})}const tW=[{value:"all",label:"All Priorities"},{value:"0",label:"P0"},{value:"1",label:"P1"},{value:"2",label:"P2"},{value:"3",label:"P3"},{value:"4",label:"P4"}],nW=[{value:"all",label:"All Types"},{value:"task",label:"Task"},{value:"bug",label:"Bug"},{value:"feature",label:"Feature"},{value:"epic",label:"Epic"},{value:"chore",label:"Chore"}];function iW({filters:e,onFiltersChange:t,issues:n,searchInput:i,onSearchChange:s}){const a=x.useMemo(()=>{const u=new Set;for(const h of n)h.assignee&&u.add(h.assignee);return Array.from(u).sort()},[n]),l=e.priority!=="all"||e.type!=="all"||e.assignee!=="all"||e.search?.length>0;return w.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-border shrink-0",children:[w.jsxs("div",{className:"relative",children:[w.jsx(FI,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground pointer-events-none"}),w.jsx("input",{type:"text",value:i,onChange:u=>s(u.target.value),placeholder:"Search beads...",className:"h-8 w-48 rounded-md border border-border bg-muted/50 pl-8 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring focus:border-ring transition-colors"})]}),w.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Filters"}),w.jsxs(Lh,{value:e.priority,onValueChange:u=>t({...e,priority:u}),children:[w.jsx(Bh,{size:"sm",className:"w-[130px]",children:w.jsx(Ph,{})}),w.jsx(Ih,{children:tW.map(u=>w.jsx(Xl,{value:u.value,children:u.label},u.value))})]}),w.jsxs(Lh,{value:e.type,onValueChange:u=>t({...e,type:u}),children:[w.jsx(Bh,{size:"sm",className:"w-[130px]",children:w.jsx(Ph,{})}),w.jsx(Ih,{children:nW.map(u=>w.jsx(Xl,{value:u.value,children:u.label},u.value))})]}),w.jsxs(Lh,{value:e.assignee,onValueChange:u=>t({...e,assignee:u}),children:[w.jsx(Bh,{size:"sm",className:"w-[150px]",children:w.jsx(Ph,{})}),w.jsxs(Ih,{children:[w.jsx(Xl,{value:"all",children:"All Assignees"}),a.map(u=>w.jsx(Xl,{value:u,children:u},u))]})]}),l&&w.jsx("button",{onClick:()=>t({priority:"all",type:"all",assignee:"all",search:""}),className:"text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:"Clear"})]})}function Og(e,t){const n=t.search?.toLowerCase().trim()||"";return e.filter(i=>!(t.priority!=="all"&&String(i.priority)!==t.priority||t.type!=="all"&&i.type!==t.type||t.assignee!=="all"&&i.assignee!==t.assignee||n&&!`${i.id} ${i.title} ${i.description||""}`.toLowerCase().includes(n)))}var QM=Object.defineProperty,rW=Object.getOwnPropertyDescriptor,sW=(e,t)=>{for(var n in t)QM(e,n,{get:t[n],enumerable:!0})},xt=(e,t,n,i)=>{for(var s=i>1?void 0:i?rW(t,n):t,a=e.length-1,l;a>=0;a--)(l=e[a])&&(s=(i?l(t,n,s):l(s))||s);return i&&s&&QM(t,n,s),s},_e=(e,t)=>(n,i)=>t(n,i,e),mE="Terminal input",Z_={get:()=>mE,set:e=>mE=e},gE="Too much output to announce, navigate to rows manually to read",Q_={get:()=>gE,set:e=>gE=e};function oW(e){return e.replace(/\r?\n/g,"\r")}function aW(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function lW(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function cW(e,t,n,i){if(e.stopPropagation(),e.clipboardData){let s=e.clipboardData.getData("text/plain");JM(s,t,n,i)}}function JM(e,t,n,i){e=oW(e),e=aW(e,n.decPrivateModes.bracketedPasteMode&&i.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function eD(e,t,n){let i=n.getBoundingClientRect(),s=e.clientX-i.left-10,a=e.clientY-i.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${s}px`,t.style.top=`${a}px`,t.style.zIndex="1000",t.focus()}function _E(e,t,n,i,s){eD(e,t,n),s&&i.rightClickSelect(e),t.value=i.selectionText,t.select()}function us(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function pf(e,t=0,n=e.length){let i="";for(let s=t;s<n;++s){let a=e[s];a>65535?(a-=65536,i+=String.fromCharCode((a>>10)+55296)+String.fromCharCode(a%1024+56320)):i+=String.fromCharCode(a)}return i}var uW=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let i=0,s=0;if(this._interim){let a=e.charCodeAt(s++);56320<=a&&a<=57343?t[i++]=(this._interim-55296)*1024+a-56320+65536:(t[i++]=this._interim,t[i++]=a),this._interim=0}for(let a=s;a<n;++a){let l=e.charCodeAt(a);if(55296<=l&&l<=56319){if(++a>=n)return this._interim=l,i;let u=e.charCodeAt(a);56320<=u&&u<=57343?t[i++]=(l-55296)*1024+u-56320+65536:(t[i++]=l,t[i++]=u);continue}l!==65279&&(t[i++]=l)}return i}},hW=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let i=0,s,a,l,u,h=0,d=0;if(this.interim[0]){let _=!1,y=this.interim[0];y&=(y&224)===192?31:(y&240)===224?15:7;let b=0,S;for(;(S=this.interim[++b]&63)&&b<4;)y<<=6,y|=S;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,k=C-b;for(;d<k;){if(d>=n)return 0;if(S=e[d++],(S&192)!==128){d--,_=!0;break}else this.interim[b++]=S,y<<=6,y|=S&63}_||(C===2?y<128?d--:t[i++]=y:C===3?y<2048||y>=55296&&y<=57343||y===65279||(t[i++]=y):y<65536||y>1114111||(t[i++]=y)),this.interim.fill(0)}let p=n-4,m=d;for(;m<n;){for(;m<p&&!((s=e[m])&128)&&!((a=e[m+1])&128)&&!((l=e[m+2])&128)&&!((u=e[m+3])&128);)t[i++]=s,t[i++]=a,t[i++]=l,t[i++]=u,m+=4;if(s=e[m++],s<128)t[i++]=s;else if((s&224)===192){if(m>=n)return this.interim[0]=s,i;if(a=e[m++],(a&192)!==128){m--;continue}if(h=(s&31)<<6|a&63,h<128){m--;continue}t[i++]=h}else if((s&240)===224){if(m>=n)return this.interim[0]=s,i;if(a=e[m++],(a&192)!==128){m--;continue}if(m>=n)return this.interim[0]=s,this.interim[1]=a,i;if(l=e[m++],(l&192)!==128){m--;continue}if(h=(s&15)<<12|(a&63)<<6|l&63,h<2048||h>=55296&&h<=57343||h===65279)continue;t[i++]=h}else if((s&248)===240){if(m>=n)return this.interim[0]=s,i;if(a=e[m++],(a&192)!==128){m--;continue}if(m>=n)return this.interim[0]=s,this.interim[1]=a,i;if(l=e[m++],(l&192)!==128){m--;continue}if(m>=n)return this.interim[0]=s,this.interim[1]=a,this.interim[2]=l,i;if(u=e[m++],(u&192)!==128){m--;continue}if(h=(s&7)<<18|(a&63)<<12|(l&63)<<6|u&63,h<65536||h>1114111)continue;t[i++]=h}}return i}},tD="",ds=" ",Bc=class nD{constructor(){this.fg=0,this.bg=0,this.extended=new Dd}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new nD;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Dd=class iD{constructor(t=0,n=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new iD(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},hi=class rD extends Bc{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Dd,this.combinedData=""}static fromCharData(t){let n=new rD;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?us(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let n=!1;if(t[1].length>2)n=!0;else if(t[1].length===2){let i=t[1].charCodeAt(0);if(55296<=i&&i<=56319){let s=t[1].charCodeAt(1);56320<=s&&s<=57343?this.content=(i-55296)*1024+s-56320+65536|t[2]<<22:n=!0}else n=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;n&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},vE="di$target",J_="di$dependencies",Lg=new Map;function dW(e){return e[J_]||[]}function Qt(e){if(Lg.has(e))return Lg.get(e);let t=function(n,i,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");fW(t,n,s)};return t._id=e,Lg.set(e,t),t}function fW(e,t,n){t[vE]===t?t[J_].push({id:e,index:n}):(t[J_]=[{id:e,index:n}],t[vE]=t)}var bn=Qt("BufferService"),sD=Qt("CoreMouseService"),vo=Qt("CoreService"),pW=Qt("CharsetService"),Zy=Qt("InstantiationService"),oD=Qt("LogService"),Sn=Qt("OptionsService"),aD=Qt("OscLinkService"),mW=Qt("UnicodeService"),Ic=Qt("DecorationService"),ev=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let i=[],s=this._optionsService.rawOptions.linkHandler,a=new hi,l=n.getTrimmedLength(),u=-1,h=-1,d=!1;for(let p=0;p<l;p++)if(!(h===-1&&!n.hasContent(p))){if(n.loadCell(p,a),a.hasExtendedAttrs()&&a.extended.urlId)if(h===-1){h=p,u=a.extended.urlId;continue}else d=a.extended.urlId!==u;else h!==-1&&(d=!0);if(d||h!==-1&&p===l-1){let m=this._oscLinkService.getLinkData(u)?.uri;if(m){let _={start:{x:h+1,y:e},end:{x:p+(!d&&p===l-1?1:0),y:e}},y=!1;if(!s?.allowNonHttpProtocols)try{let b=new URL(m);["http:","https:"].includes(b.protocol)||(y=!0)}catch{y=!0}y||i.push({text:m,range:_,activate:(b,S)=>s?s.activate(b,S,_):gW(b,S),hover:(b,S)=>s?.hover?.(b,S,_),leave:(b,S)=>s?.leave?.(b,S,_)})}d=!1,a.hasExtendedAttrs()&&a.extended.urlId?(h=p,u=a.extended.urlId):(h=-1,u=-1)}}t(i)}};ev=xt([_e(0,bn),_e(1,Sn),_e(2,aD)],ev);function gW(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
215
|
+
|
|
216
|
+
WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var mf=Qt("CharSizeService"),Er=Qt("CoreBrowserService"),Qy=Qt("MouseService"),kr=Qt("RenderService"),_W=Qt("SelectionService"),lD=Qt("CharacterJoinerService"),$a=Qt("ThemeService"),cD=Qt("LinkProviderService"),vW=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?yE.isErrorNoTelemetry(e)?new yE(e.message+`
|
|
217
|
+
|
|
218
|
+
`+e.stack):new Error(e.message+`
|
|
219
|
+
|
|
220
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},yW=new vW;function Yh(e){bW(e)||yW.onUnexpectedError(e)}var tv="Canceled";function bW(e){return e instanceof SW?!0:e instanceof Error&&e.name===tv&&e.message===tv}var SW=class extends Error{constructor(){super(tv),this.name=this.message}};function wW(e){return new Error(`Illegal argument: ${e}`)}var yE=class nv extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof nv)return t;let n=new nv;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},iv=class uD extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,uD.prototype)}};function Hn(e,t=0){return e[e.length-(1+t)]}var xW;(e=>{function t(a){return a<0}e.isLessThan=t;function n(a){return a<=0}e.isLessThanOrEqual=n;function i(a){return a>0}e.isGreaterThan=i;function s(a){return a===0}e.isNeitherLessOrGreaterThan=s,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(xW||={});function CW(e,t){let n=this,i=!1,s;return function(){return i||(i=!0,t||(s=e.apply(n,arguments))),s}}var hD;(e=>{function t(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function i(){return n}e.empty=i;function*s(A){yield A}e.single=s;function a(A){return t(A)?A:s(A)}e.wrap=a;function l(A){return A||n}e.from=l;function*u(A){for(let N=A.length-1;N>=0;N--)yield A[N]}e.reverse=u;function h(A){return!A||A[Symbol.iterator]().next().done===!0}e.isEmpty=h;function d(A){return A[Symbol.iterator]().next().value}e.first=d;function p(A,N){let V=0;for(let H of A)if(N(H,V++))return!0;return!1}e.some=p;function m(A,N){for(let V of A)if(N(V))return V}e.find=m;function*_(A,N){for(let V of A)N(V)&&(yield V)}e.filter=_;function*y(A,N){let V=0;for(let H of A)yield N(H,V++)}e.map=y;function*b(A,N){let V=0;for(let H of A)yield*N(H,V++)}e.flatMap=b;function*S(...A){for(let N of A)yield*N}e.concat=S;function C(A,N,V){let H=V;for(let z of A)H=N(H,z);return H}e.reduce=C;function*k(A,N,V=A.length){for(N<0&&(N+=A.length),V<0?V+=A.length:V>A.length&&(V=A.length);N<V;N++)yield A[N]}e.slice=k;function T(A,N=Number.POSITIVE_INFINITY){let V=[];if(N===0)return[V,A];let H=A[Symbol.iterator]();for(let z=0;z<N;z++){let J=H.next();if(J.done)return[V,e.empty()];V.push(J.value)}return[V,{[Symbol.iterator](){return H}}]}e.consume=T;async function R(A){let N=[];for await(let V of A)N.push(V);return Promise.resolve(N)}e.asyncToArray=R})(hD||={});function po(e){if(hD.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(i){t.push(i)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function EW(...e){return pt(()=>po(e))}function pt(e){return{dispose:CW(()=>{e()})}}var dD=class fD{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{po(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?fD.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};dD.DISABLE_DISPOSED_WARNING=!1;var ps=dD,Ve=class{constructor(){this._store=new ps,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Ve.None=Object.freeze({dispose(){}});var La=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},_r=typeof window=="object"?window:globalThis,rv=class sv{constructor(t){this.element=t,this.next=sv.Undefined,this.prev=sv.Undefined}};rv.Undefined=new rv(void 0);var mt=rv,bE=class{constructor(){this._first=mt.Undefined,this._last=mt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===mt.Undefined}clear(){let e=this._first;for(;e!==mt.Undefined;){let t=e.next;e.prev=mt.Undefined,e.next=mt.Undefined,e=t}this._first=mt.Undefined,this._last=mt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new mt(e);if(this._first===mt.Undefined)this._first=n,this._last=n;else if(t){let s=this._last;this._last=n,n.prev=s,s.next=n}else{let s=this._first;this._first=n,n.next=s,s.prev=n}this._size+=1;let i=!1;return()=>{i||(i=!0,this._remove(n))}}shift(){if(this._first!==mt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==mt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==mt.Undefined&&e.next!==mt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===mt.Undefined&&e.next===mt.Undefined?(this._first=mt.Undefined,this._last=mt.Undefined):e.next===mt.Undefined?(this._last=this._last.prev,this._last.next=mt.Undefined):e.prev===mt.Undefined&&(this._first=this._first.next,this._first.prev=mt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==mt.Undefined;)yield e.element,e=e.next}},kW=globalThis.performance&&typeof globalThis.performance.now=="function",TW=class pD{static create(t){return new pD(t)}constructor(t){this._now=kW&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},an;(e=>{e.None=()=>Ve.None;function t(I,P){return m(I,()=>{},0,void 0,!0,void 0,P)}e.defer=t;function n(I){return(P,B=null,W)=>{let M=!1,U;return U=I(j=>{if(!M)return U?U.dispose():M=!0,P.call(B,j)},null,W),M&&U.dispose(),U}}e.once=n;function i(I,P,B){return d((W,M=null,U)=>I(j=>W.call(M,P(j)),null,U),B)}e.map=i;function s(I,P,B){return d((W,M=null,U)=>I(j=>{P(j),W.call(M,j)},null,U),B)}e.forEach=s;function a(I,P,B){return d((W,M=null,U)=>I(j=>P(j)&&W.call(M,j),null,U),B)}e.filter=a;function l(I){return I}e.signal=l;function u(...I){return(P,B=null,W)=>{let M=EW(...I.map(U=>U(j=>P.call(B,j))));return p(M,W)}}e.any=u;function h(I,P,B,W){let M=B;return i(I,U=>(M=P(M,U),M),W)}e.reduce=h;function d(I,P){let B,W={onWillAddFirstListener(){B=I(M.fire,M)},onDidRemoveLastListener(){B?.dispose()}},M=new ge(W);return P?.add(M),M.event}function p(I,P){return P instanceof Array?P.push(I):P&&P.add(I),I}function m(I,P,B=100,W=!1,M=!1,U,j){let ee,X,L,Z=0,ie,F={leakWarningThreshold:U,onWillAddFirstListener(){ee=I(G=>{Z++,X=P(X,G),W&&!L&&(O.fire(X),X=void 0),ie=()=>{let q=X;X=void 0,L=void 0,(!W||Z>1)&&O.fire(q),Z=0},typeof B=="number"?(clearTimeout(L),L=setTimeout(ie,B)):L===void 0&&(L=0,queueMicrotask(ie))})},onWillRemoveListener(){M&&Z>0&&ie?.()},onDidRemoveLastListener(){ie=void 0,ee.dispose()}},O=new ge(F);return j?.add(O),O.event}e.debounce=m;function _(I,P=0,B){return e.debounce(I,(W,M)=>W?(W.push(M),W):[M],P,void 0,!0,void 0,B)}e.accumulate=_;function y(I,P=(W,M)=>W===M,B){let W=!0,M;return a(I,U=>{let j=W||!P(U,M);return W=!1,M=U,j},B)}e.latch=y;function b(I,P,B){return[e.filter(I,P,B),e.filter(I,W=>!P(W),B)]}e.split=b;function S(I,P=!1,B=[],W){let M=B.slice(),U=I(X=>{M?M.push(X):ee.fire(X)});W&&W.add(U);let j=()=>{M?.forEach(X=>ee.fire(X)),M=null},ee=new ge({onWillAddFirstListener(){U||(U=I(X=>ee.fire(X)),W&&W.add(U))},onDidAddFirstListener(){M&&(P?setTimeout(j):j())},onDidRemoveLastListener(){U&&U.dispose(),U=null}});return W&&W.add(ee),ee.event}e.buffer=S;function C(I,P){return(B,W,M)=>{let U=P(new T);return I(function(j){let ee=U.evaluate(j);ee!==k&&B.call(W,ee)},void 0,M)}}e.chain=C;let k=Symbol("HaltChainable");class T{constructor(){this.steps=[]}map(P){return this.steps.push(P),this}forEach(P){return this.steps.push(B=>(P(B),B)),this}filter(P){return this.steps.push(B=>P(B)?B:k),this}reduce(P,B){let W=B;return this.steps.push(M=>(W=P(W,M),W)),this}latch(P=(B,W)=>B===W){let B=!0,W;return this.steps.push(M=>{let U=B||!P(M,W);return B=!1,W=M,U?M:k}),this}evaluate(P){for(let B of this.steps)if(P=B(P),P===k)break;return P}}function R(I,P,B=W=>W){let W=(...ee)=>j.fire(B(...ee)),M=()=>I.on(P,W),U=()=>I.removeListener(P,W),j=new ge({onWillAddFirstListener:M,onDidRemoveLastListener:U});return j.event}e.fromNodeEventEmitter=R;function A(I,P,B=W=>W){let W=(...ee)=>j.fire(B(...ee)),M=()=>I.addEventListener(P,W),U=()=>I.removeEventListener(P,W),j=new ge({onWillAddFirstListener:M,onDidRemoveLastListener:U});return j.event}e.fromDOMEventEmitter=A;function N(I){return new Promise(P=>n(I)(P))}e.toPromise=N;function V(I){let P=new ge;return I.then(B=>{P.fire(B)},()=>{P.fire(void 0)}).finally(()=>{P.dispose()}),P.event}e.fromPromise=V;function H(I,P){return I(B=>P.fire(B))}e.forward=H;function z(I,P,B){return P(B),I(W=>P(W))}e.runAndSubscribe=z;class J{constructor(P,B){this._observable=P,this._counter=0,this._hasChanged=!1;let W={onWillAddFirstListener:()=>{P.addObserver(this)},onDidRemoveLastListener:()=>{P.removeObserver(this)}};this.emitter=new ge(W),B&&B.add(this.emitter)}beginUpdate(P){this._counter++}handlePossibleChange(P){}handleChange(P,B){this._hasChanged=!0}endUpdate(P){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function $(I,P){return new J(I,P).emitter.event}e.fromObservable=$;function K(I){return(P,B,W)=>{let M=0,U=!1,j={beginUpdate(){M++},endUpdate(){M--,M===0&&(I.reportChanges(),U&&(U=!1,P.call(B)))},handlePossibleChange(){},handleChange(){U=!0}};I.addObserver(j),I.reportChanges();let ee={dispose(){I.removeObserver(j)}};return W instanceof ps?W.add(ee):Array.isArray(W)&&W.push(ee),ee}}e.fromObservableLight=K})(an||={});var ov=class av{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${av._idPool++}`,av.all.add(this)}start(t){this._stopWatch=new TW,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};ov.all=new Set,ov._idPool=0;var AW=ov,RW=-1,mD=class gD{constructor(t,n,i=(gD._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=i,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,n){let i=this.threshold;if(i<=0||n<i)return;this._stacks||(this._stacks=new Map);let s=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i*.5;let[a,l]=this.getMostFrequentStack(),u=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${l}):`;console.warn(u),console.warn(a);let h=new NW(u,a);this._errorHandler(h)}return()=>{let a=this._stacks.get(t.value)||0;this._stacks.set(t.value,a-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,n=0;for(let[i,s]of this._stacks)(!t||n<s)&&(t=[i,s],n=s);return t}};mD._idPool=1;var MW=mD,DW=class _D{constructor(t){this.value=t}static create(){let t=new Error;return new _D(t.stack??"")}print(){console.warn(this.value.split(`
|
|
221
|
+
`).slice(2).join(`
|
|
222
|
+
`))}},NW=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},OW=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},LW=0,Pg=class{constructor(e){this.value=e,this.id=LW++}},PW=2,BW,ge=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new MW(e?.onListenerError??Yh,this._options?.leakWarningThreshold??RW):void 0,this._perfMon=this._options?._profName?new AW(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);let u=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],h=new OW(`${l}. HINT: Stack shows most frequent listener (${u[1]}-times)`,u[0]);return(this._options?.onListenerError||Yh)(h),Ve.None}if(this._disposed)return Ve.None;t&&(e=e.bind(t));let i=new Pg(e),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=DW.create(),s=this._leakageMon.check(i.stack,this._size+1)),this._listeners?this._listeners instanceof Pg?(this._deliveryQueue??=new IW,this._listeners=[this._listeners,i]):this._listeners.push(i):(this._options?.onWillAddFirstListener?.(this),this._listeners=i,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=pt(()=>{s?.(),this._removeListener(i)});return n instanceof ps?n.add(a):Array.isArray(n)&&n.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[n]=void 0;let i=this._deliveryQueue.current===this;if(this._size*PW<=t.length){let s=0;for(let a=0;a<t.length;a++)t[a]?t[s++]=t[a]:i&&(this._deliveryQueue.end--,s<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=s}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||Yh;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Pg)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},IW=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},lv=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new ge,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new ge,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,n){if(this.getZoomLevel(n)===t)return;let i=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(i,t),this._onDidChangeZoomLevel.fire(i)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),t)}setFullscreen(t,n){if(this.isFullscreen(n)===t)return;let i=this.getWindowId(n);this.mapWindowIdToFullScreen.set(i,t),this._onDidChangeFullscreen.fire(i)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};lv.INSTANCE=new lv;var Jy=lv;function jW(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}Jy.INSTANCE.onDidChangeZoomLevel;function zW(e){return Jy.INSTANCE.getZoomFactor(e)}Jy.INSTANCE.onDidChangeFullscreen;var Wa=typeof navigator=="object"?navigator.userAgent:"",cv=Wa.indexOf("Firefox")>=0,HW=Wa.indexOf("AppleWebKit")>=0,e0=Wa.indexOf("Chrome")>=0,VW=!e0&&Wa.indexOf("Safari")>=0;Wa.indexOf("Electron/")>=0;Wa.indexOf("Android")>=0;var Bg=!1;if(typeof _r.matchMedia=="function"){let e=_r.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=_r.matchMedia("(display-mode: fullscreen)");Bg=e.matches,jW(_r,e,({matches:n})=>{Bg&&t.matches||(Bg=n)})}var ya="en",uv=!1,hv=!1,Xh=!1,vD=!1,Eh,Zh=ya,SE=ya,UW,mr,oo=globalThis,Fn;typeof oo.vscode<"u"&&typeof oo.vscode.process<"u"?Fn=oo.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Fn=process);var FW=typeof Fn?.versions?.electron=="string",$W=FW&&Fn?.type==="renderer";if(typeof Fn=="object"){uv=Fn.platform==="win32",hv=Fn.platform==="darwin",Xh=Fn.platform==="linux",Xh&&Fn.env.SNAP&&Fn.env.SNAP_REVISION,Fn.env.CI||Fn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Eh=ya,Zh=ya;let e=Fn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Eh=t.userLocale,SE=t.osLocale,Zh=t.resolvedLanguage||ya,UW=t.languagePack?.translationsConfigFile}catch{}vD=!0}else typeof navigator=="object"&&!$W?(mr=navigator.userAgent,uv=mr.indexOf("Windows")>=0,hv=mr.indexOf("Macintosh")>=0,(mr.indexOf("Macintosh")>=0||mr.indexOf("iPad")>=0||mr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Xh=mr.indexOf("Linux")>=0,mr?.indexOf("Mobi")>=0,Zh=globalThis._VSCODE_NLS_LANGUAGE||ya,Eh=navigator.language.toLowerCase(),SE=Eh):console.error("Unable to resolve platform.");var yD=uv,Vi=hv,WW=Xh,wE=vD,Fi=mr,ns=Zh,GW;(e=>{function t(){return ns}e.value=t;function n(){return ns.length===2?ns==="en":ns.length>=3?ns[0]==="e"&&ns[1]==="n"&&ns[2]==="-":!1}e.isDefaultVariant=n;function i(){return ns==="en"}e.isDefault=i})(GW||={});var qW=typeof oo.postMessage=="function"&&!oo.importScripts;(()=>{if(qW){let e=[];oo.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let i=0,s=e.length;i<s;i++){let a=e[i];if(a.id===n.data.vscodeScheduleAsyncWork){e.splice(i,1),a.callback();return}}});let t=0;return n=>{let i=++t;e.push({id:i,callback:n}),oo.postMessage({vscodeScheduleAsyncWork:i},"*")}}return e=>setTimeout(e)})();var KW=!!(Fi&&Fi.indexOf("Chrome")>=0);Fi&&Fi.indexOf("Firefox")>=0;!KW&&Fi&&Fi.indexOf("Safari")>=0;Fi&&Fi.indexOf("Edg/")>=0;Fi&&Fi.indexOf("Android")>=0;var la=typeof navigator=="object"?navigator:{};wE||document.queryCommandSupported&&document.queryCommandSupported("copy")||la&&la.clipboard&&la.clipboard.writeText,wE||la&&la.clipboard&&la.clipboard.readText;var t0=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Ig=new t0,xE=new t0,CE=new t0,YW=new Array(230),bD;(e=>{function t(u){return Ig.keyCodeToStr(u)}e.toString=t;function n(u){return Ig.strToKeyCode(u)}e.fromString=n;function i(u){return xE.keyCodeToStr(u)}e.toUserSettingsUS=i;function s(u){return CE.keyCodeToStr(u)}e.toUserSettingsGeneral=s;function a(u){return xE.strToKeyCode(u)||CE.strToKeyCode(u)}e.fromUserSettings=a;function l(u){if(u>=98&&u<=113)return null;switch(u){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Ig.keyCodeToStr(u)}e.toElectronAccelerator=l})(bD||={});var XW=class SD{constructor(t,n,i,s,a){this.ctrlKey=t,this.shiftKey=n,this.altKey=i,this.metaKey=s,this.keyCode=a}equals(t){return t instanceof SD&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",n=this.shiftKey?"1":"0",i=this.altKey?"1":"0",s=this.metaKey?"1":"0";return`K${t}${n}${i}${s}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new ZW([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},ZW=class{constructor(e){if(e.length===0)throw wW("chords");this.chords=e}getHashCode(){let e="";for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function QW(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return bD.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(cv)switch(t){case 59:return 85;case 60:if(WW)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Vi)return 57;break}else if(HW&&(Vi&&t===93||!Vi&&t===92))return 57;return YW[t]||0}var JW=Vi?256:2048,eG=512,tG=1024,nG=Vi?2048:256,EE=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.("AltGraph"),this.keyCode=QW(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=JW),this.altKey&&(t|=eG),this.shiftKey&&(t|=tG),this.metaKey&&(t|=nG),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new XW(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},kE=new WeakMap;function iG(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!=="null"&&n.origin!=="null"&&t.origin!==n.origin)return null}catch{return null}return e.parent}var rG=class{static getSameOriginWindowChain(e){let t=kE.get(e);if(!t){t=[],kE.set(e,t);let n=e,i;do i=iG(n),i?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=i;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,i=0,s=this.getSameOriginWindowChain(e);for(let a of s){let l=a.window.deref();if(n+=l?.scrollY??0,i+=l?.scrollX??0,l===t||!a.iframeElement)break;let u=a.iframeElement.getBoundingClientRect();n+=u.top,i+=u.left}return{top:n,left:i}}},kh=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=rG.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},TE=class{constructor(e,t=0,n=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let i=!1;if(e0){let s=navigator.userAgent.match(/Chrome\/(\d+)/);i=(s?parseInt(s[1]):123)<=122}if(e){let s=e,a=e,l=e.view?.devicePixelRatio||1;if(typeof s.wheelDeltaY<"u")i?this.deltaY=s.wheelDeltaY/(120*l):this.deltaY=s.wheelDeltaY/120;else if(typeof a.VERTICAL_AXIS<"u"&&a.axis===a.VERTICAL_AXIS)this.deltaY=-a.detail/3;else if(e.type==="wheel"){let u=e;u.deltaMode===u.DOM_DELTA_LINE?cv&&!Vi?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof s.wheelDeltaX<"u")VW&&yD?this.deltaX=-(s.wheelDeltaX/120):i?this.deltaX=s.wheelDeltaX/(120*l):this.deltaX=s.wheelDeltaX/120;else if(typeof a.HORIZONTAL_AXIS<"u"&&a.axis===a.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let u=e;u.deltaMode===u.DOM_DELTA_LINE?cv&&!Vi?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(i?this.deltaY=e.wheelDelta/(120*l):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},wD=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),sG;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof oG?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:an.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:wD})})(sG||={});var oG=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?wD:(this._emitter||(this._emitter=new ge),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},n0=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new iv("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new iv("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},aG=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new iv("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let i=n.setInterval(()=>{e()},t);this.disposable=pt(()=>{n.clearInterval(i),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},lG;(e=>{async function t(i){let s,a=await Promise.all(i.map(l=>l.then(u=>u,u=>{s||(s=u)})));if(typeof s<"u")throw s;return a}e.settled=t;function n(i){return new Promise(async(s,a)=>{try{await i(s,a)}catch(l){a(l)}})}e.withAsyncBody=n})(lG||={});var AE=class si{static fromArray(t){return new si(n=>{n.emitMany(t)})}static fromPromise(t){return new si(async n=>{n.emitMany(await t)})}static fromPromises(t){return new si(async n=>{await Promise.all(t.map(async i=>n.emitOne(await i)))})}static merge(t){return new si(async n=>{await Promise.all(t.map(async i=>{for await(let s of i)n.emitOne(s)}))})}constructor(t,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new ge,queueMicrotask(async()=>{let i={emitOne:s=>this.emitOne(s),emitMany:s=>this.emitMany(s),reject:s=>this.reject(s)};try{await Promise.resolve(t(i)),this.resolve()}catch(s){this.reject(s)}finally{i.emitOne=void 0,i.emitMany=void 0,i.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await an.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new si(async i=>{for await(let s of t)i.emitOne(n(s))})}map(t){return si.map(this,t)}static filter(t,n){return new si(async i=>{for await(let s of t)n(s)&&i.emitOne(s)})}filter(t){return si.filter(this,t)}static coalesce(t){return si.filter(t,n=>!!n)}coalesce(){return si.coalesce(this)}static async toPromise(t){let n=[];for await(let i of t)n.push(i);return n}toPromise(){return si.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};AE.EMPTY=AE.fromArray([]);var{getWindow:ji,getWindowId:cG,onDidRegisterWindow:uG}=(function(){let e=new Map,t={window:_r,disposables:new ps};e.set(_r.vscodeWindowId,t);let n=new ge,i=new ge,s=new ge;function a(l,u){return(typeof l=="number"?e.get(l):void 0)??(u?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:i.event,registerWindow(l){if(e.has(l.vscodeWindowId))return Ve.None;let u=new ps,h={window:l,disposables:u.add(new ps)};return e.set(l.vscodeWindowId,h),u.add(pt(()=>{e.delete(l.vscodeWindowId),i.fire(l)})),u.add(Ae(l,qt.BEFORE_UNLOAD,()=>{s.fire(l)})),n.fire(h),u},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(l){return l.vscodeWindowId},hasWindow(l){return e.has(l)},getWindowById:a,getWindow(l){let u=l;if(u?.ownerDocument?.defaultView)return u.ownerDocument.defaultView.window;let h=l;return h?.view?h.view.window:_r},getDocument(l){return ji(l).document}}})(),hG=class{constructor(e,t,n,i){this._node=e,this._type=t,this._handler=n,this._options=i||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Ae(e,t,n,i){return new hG(e,t,n,i)}var RE=function(e,t,n,i){return Ae(e,t,n,i)},i0,dG=class extends aG{constructor(e){super(),this.defaultTarget=e&&ji(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},ME=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Yh(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,i=new Map,s=a=>{n.set(a,!1);let l=e.get(a)??[];for(t.set(a,l),e.set(a,[]),i.set(a,!0);l.length>0;)l.sort(ME.sort),l.shift().execute();i.set(a,!1)};i0=(a,l,u=0)=>{let h=cG(a),d=new ME(l,u),p=e.get(h);return p||(p=[],e.set(h,p)),p.push(d),n.get(h)||(n.set(h,!0),a.requestAnimationFrame(()=>s(h))),d}})();function fG(e){let t=e.getBoundingClientRect(),n=ji(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var qt={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},pG=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=Rn(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Rn(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Rn(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Rn(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Rn(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Rn(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Rn(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Rn(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Rn(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Rn(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Rn(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Rn(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Rn(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Rn(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Rn(e){return typeof e=="number"?`${e}px`:e}function uc(e){return new pG(e)}var xD=class{constructor(){this._hooks=new ps,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,i,s){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=i,this._onStopCallback=s;let a=e;try{e.setPointerCapture(t),this._hooks.add(pt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=ji(e)}this._hooks.add(Ae(a,qt.POINTER_MOVE,l=>{if(l.buttons!==n){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(Ae(a,qt.POINTER_UP,l=>this.stopMonitoring(!0)))}};function mG(e,t,n){let i=null,s=null;if(typeof n.value=="function"?(i="value",s=n.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(i="get",s=n.get),!s)throw new Error("not supported");let a=`$memoize$${t}`;n[i]=function(...l){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,l)}),this[a]}}var Li;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Li||={});var Jl=class dn extends Ve{constructor(){super(),this.dispatched=!1,this.targets=new bE,this.ignoreTargets=new bE,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(an.runAndSubscribe(uG,({window:t,disposables:n})=>{n.add(Ae(t.document,"touchstart",i=>this.onTouchStart(i),{passive:!1})),n.add(Ae(t.document,"touchend",i=>this.onTouchEnd(t,i))),n.add(Ae(t.document,"touchmove",i=>this.onTouchMove(i),{passive:!1}))},{window:_r,disposables:this._store}))}static addTarget(t){if(!dn.isTouchDevice())return Ve.None;dn.INSTANCE||(dn.INSTANCE=new dn);let n=dn.INSTANCE.targets.push(t);return pt(n)}static ignoreTarget(t){if(!dn.isTouchDevice())return Ve.None;dn.INSTANCE||(dn.INSTANCE=new dn);let n=dn.INSTANCE.ignoreTargets.push(t);return pt(n)}static isTouchDevice(){return"ontouchstart"in _r||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,s=t.targetTouches.length;i<s;i++){let a=t.targetTouches.item(i);this.activeTouches[a.identifier]={id:a.identifier,initialTarget:a.target,initialTimeStamp:n,initialPageX:a.pageX,initialPageY:a.pageY,rollingTimestamps:[n],rollingPageX:[a.pageX],rollingPageY:[a.pageY]};let l=this.newGestureEvent(Li.Start,a.target);l.pageX=a.pageX,l.pageY=a.pageY,this.dispatchEvent(l)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,n){let i=Date.now(),s=Object.keys(this.activeTouches).length;for(let a=0,l=n.changedTouches.length;a<l;a++){let u=n.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(u.identifier))){console.warn("move of an UNKNOWN touch",u);continue}let h=this.activeTouches[u.identifier],d=Date.now()-h.initialTimeStamp;if(d<dn.HOLD_DELAY&&Math.abs(h.initialPageX-Hn(h.rollingPageX))<30&&Math.abs(h.initialPageY-Hn(h.rollingPageY))<30){let p=this.newGestureEvent(Li.Tap,h.initialTarget);p.pageX=Hn(h.rollingPageX),p.pageY=Hn(h.rollingPageY),this.dispatchEvent(p)}else if(d>=dn.HOLD_DELAY&&Math.abs(h.initialPageX-Hn(h.rollingPageX))<30&&Math.abs(h.initialPageY-Hn(h.rollingPageY))<30){let p=this.newGestureEvent(Li.Contextmenu,h.initialTarget);p.pageX=Hn(h.rollingPageX),p.pageY=Hn(h.rollingPageY),this.dispatchEvent(p)}else if(s===1){let p=Hn(h.rollingPageX),m=Hn(h.rollingPageY),_=Hn(h.rollingTimestamps)-h.rollingTimestamps[0],y=p-h.rollingPageX[0],b=m-h.rollingPageY[0],S=[...this.targets].filter(C=>h.initialTarget instanceof Node&&C.contains(h.initialTarget));this.inertia(t,S,i,Math.abs(y)/_,y>0?1:-1,p,Math.abs(b)/_,b>0?1:-1,m)}this.dispatchEvent(this.newGestureEvent(Li.End,h.initialTarget)),delete this.activeTouches[u.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,n){let i=document.createEvent("CustomEvent");return i.initEvent(t,!1,!0),i.initialTarget=n,i.tapCount=0,i}dispatchEvent(t){if(t.type===Li.Tap){let n=new Date().getTime(),i=0;n-this._lastSetTapCountTime>dn.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=n,t.tapCount=i}else(t.type===Li.Change||t.type===Li.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let i of this.ignoreTargets)if(i.contains(t.initialTarget))return;let n=[];for(let i of this.targets)if(i.contains(t.initialTarget)){let s=0,a=t.initialTarget;for(;a&&a!==i;)s++,a=a.parentElement;n.push([s,i])}n.sort((i,s)=>i[0]-s[0]);for(let[i,s]of n)s.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,i,s,a,l,u,h,d){this.handle=i0(t,()=>{let p=Date.now(),m=p-i,_=0,y=0,b=!0;s+=dn.SCROLL_FRICTION*m,u+=dn.SCROLL_FRICTION*m,s>0&&(b=!1,_=a*s*m),u>0&&(b=!1,y=h*u*m);let S=this.newGestureEvent(Li.Change);S.translationX=_,S.translationY=y,n.forEach(C=>C.dispatchEvent(S)),b||this.inertia(t,n,p,s,a,l+_,u,h,d+y)})}onTouchMove(t){let n=Date.now();for(let i=0,s=t.changedTouches.length;i<s;i++){let a=t.changedTouches.item(i);if(!this.activeTouches.hasOwnProperty(String(a.identifier))){console.warn("end of an UNKNOWN touch",a);continue}let l=this.activeTouches[a.identifier],u=this.newGestureEvent(Li.Change,l.initialTarget);u.translationX=a.pageX-Hn(l.rollingPageX),u.translationY=a.pageY-Hn(l.rollingPageY),u.pageX=a.pageX,u.pageY=a.pageY,this.dispatchEvent(u),l.rollingPageX.length>3&&(l.rollingPageX.shift(),l.rollingPageY.shift(),l.rollingTimestamps.shift()),l.rollingPageX.push(a.pageX),l.rollingPageY.push(a.pageY),l.rollingTimestamps.push(n)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Jl.SCROLL_FRICTION=-.005,Jl.HOLD_DELAY=700,Jl.CLEAR_TAP_COUNT_TIME=400,xt([mG],Jl,"isTouchDevice",1);var gG=Jl,r0=class extends Ve{onclick(e,t){this._register(Ae(e,qt.CLICK,n=>t(new kh(ji(e),n))))}onmousedown(e,t){this._register(Ae(e,qt.MOUSE_DOWN,n=>t(new kh(ji(e),n))))}onmouseover(e,t){this._register(Ae(e,qt.MOUSE_OVER,n=>t(new kh(ji(e),n))))}onmouseleave(e,t){this._register(Ae(e,qt.MOUSE_LEAVE,n=>t(new kh(ji(e),n))))}onkeydown(e,t){this._register(Ae(e,qt.KEY_DOWN,n=>t(new EE(n))))}onkeyup(e,t){this._register(Ae(e,qt.KEY_UP,n=>t(new EE(n))))}oninput(e,t){this._register(Ae(e,qt.INPUT,t))}onblur(e,t){this._register(Ae(e,qt.BLUR,t))}onfocus(e,t){this._register(Ae(e,qt.FOCUS,t))}onchange(e,t){this._register(Ae(e,qt.CHANGE,t))}ignoreGesture(e){return gG.ignoreTarget(e)}},DE=11,_G=class extends r0{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=DE+"px",this.domNode.style.height=DE+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new xD),this._register(RE(this.bgDomNode,qt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(RE(this.domNode,qt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new dG),this._pointerdownScheduleRepeatTimer=this._register(new n0)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,ji(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},vG=class dv{constructor(t,n,i,s,a,l,u){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,i=i|0,s=s|0,a=a|0,l=l|0,u=u|0),this.rawScrollLeft=s,this.rawScrollTop=u,n<0&&(n=0),s+n>i&&(s=i-n),s<0&&(s=0),a<0&&(a=0),u+a>l&&(u=l-a),u<0&&(u=0),this.width=n,this.scrollWidth=i,this.scrollLeft=s,this.height=a,this.scrollHeight=l,this.scrollTop=u}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,n){return new dv(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new dv(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,n){let i=this.width!==t.width,s=this.scrollWidth!==t.scrollWidth,a=this.scrollLeft!==t.scrollLeft,l=this.height!==t.height,u=this.scrollHeight!==t.scrollHeight,h=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:n,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:s,scrollLeftChanged:a,heightChanged:l,scrollHeightChanged:u,scrollTopChanged:h}}},yG=class extends Ve{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new vG(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let i;t?i=new OE(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):i=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=i}else{let n=this._state.withScrollPosition(e);this._smoothScrolling=OE.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},NE=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function jg(e,t){let n=t-e;return function(i){return e+n*wG(i)}}function bG(e,t,n){return function(i){return i<n?e(i/n):t((i-n)/(1-n))}}var OE=class fv{constructor(t,n,i,s){this.from=t,this.to=n,this.duration=s,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,n,i){if(Math.abs(t-n)>2.5*i){let s,a;return t<n?(s=t+.75*i,a=n-.75*i):(s=t-.75*i,a=n+.75*i),bG(jg(t,s),jg(a,n),.33)}return jg(t,n)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let n=(t-this.startTime)/this.duration;if(n<1){let i=this.scrollLeft(n),s=this.scrollTop(n);return new NE(i,s,!1)}return new NE(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,i){return fv.start(t,n,i)}static start(t,n,i){i=i+10;let s=Date.now()-10;return new fv(t,n,s,i)}};function SG(e){return Math.pow(e,3)}function wG(e){return 1-SG(1-e)}var xG=class extends Ve{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new n0)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},CG=140,CD=class extends r0{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new xG(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new xD),this._shouldRender=!0,this.domNode=uc(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Ae(this.domNode.domNode,qt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new _G(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,i){this.slider=uc(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof i=="number"&&this.slider.setHeight(i),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ae(this.slider.domNode,qt.POINTER_DOWN,s=>{s.button===0&&(s.preventDefault(),this._sliderPointerDown(s))})),this.onclick(this.slider.domNode,s=>{s.leftButton&&s.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),i=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),s=this._sliderPointerPosition(e);n<=s&&s<=i?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{let s=fG(this.domNode.domNode);t=e.pageX-s.left,n=e.pageY-s.top}let i=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(i):this._scrollbarState.getDesiredScrollPositionFromOffset(i)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),i=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{let a=this._sliderOrthogonalPointerPosition(s),l=Math.abs(a-n);if(yD&&l>CG){this._setDesiredScrollPositionNow(i.getScrollPosition());return}let u=this._sliderPointerPosition(s)-t;this._setDesiredScrollPositionNow(i.getDesiredScrollPositionFromDelta(u))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},ED=class pv{constructor(t,n,i,s,a,l){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(t),this._visibleSize=s,this._scrollSize=a,this._scrollPosition=l,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new pv(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let n=Math.round(t);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(t){let n=Math.round(t);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let n=Math.round(t);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,n,i,s,a){let l=Math.max(0,i-t),u=Math.max(0,l-2*n),h=s>0&&s>i;if(!h)return{computedAvailableSize:Math.round(l),computedIsNeeded:h,computedSliderSize:Math.round(u),computedSliderRatio:0,computedSliderPosition:0};let d=Math.round(Math.max(20,Math.floor(i*u/s))),p=(u-d)/(s-i),m=a*p;return{computedAvailableSize:Math.round(l),computedIsNeeded:h,computedSliderSize:Math.round(d),computedSliderRatio:p,computedSliderPosition:Math.round(m)}}_refreshComputedValues(){let t=pv._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize,i=this._scrollPosition;return n<this._computedSliderPosition?i-=this._visibleSize:i+=this._visibleSize,i}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+t;return Math.round(n/this._computedSliderRatio)}},EG=class extends CD{constructor(e,t,n){let i=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new ED(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,i.width,i.scrollWidth,s.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},kG=class extends CD{constructor(e,t,n){let i=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new ED(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,i.height,i.scrollHeight,s.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},TG=500,LE=50,AG=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},mv=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,n=0,i=1,s=this._rear;do{let a=s===this._front?t:Math.pow(2,-i);if(t-=a,n+=this._memory[s].score*a,s===this._front)break;s=(this._capacity+s-1)%this._capacity,i++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(e0){let n=ji(t.browserEvent),i=zW(n);this.accept(Date.now(),t.deltaX*i,t.deltaY*i)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,n,i){let s=null,a=new AG(t,n,i);this._front===-1&&this._rear===-1?(this._memory[0]=a,this._front=0,this._rear=0):(s=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=a),a.score=this._computeScore(a,s)}_computeScore(t,n){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let i=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(i+=.25),n){let s=Math.abs(t.deltaX),a=Math.abs(t.deltaY),l=Math.abs(n.deltaX),u=Math.abs(n.deltaY),h=Math.max(Math.min(s,l),1),d=Math.max(Math.min(a,u),1),p=Math.max(s,l),m=Math.max(a,u);p%h===0&&m%d===0&&(i-=.5)}return Math.min(Math.max(i,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};mv.INSTANCE=new mv;var RG=mv,MG=class extends r0{constructor(e,t,n){super(),this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new ge),this.onWillScroll=this._onWillScroll.event,this._options=NG(t),this._scrollable=n,this._register(this._scrollable.onScroll(s=>{this._onWillScroll.fire(s),this._onDidScroll(s),this._onScroll.fire(s)}));let i={onMouseWheel:s=>this._onMouseWheel(s),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new kG(this._scrollable,this._options,i)),this._horizontalScrollbar=this._register(new EG(this._scrollable,this._options,i)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=uc(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=uc(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=uc(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,s=>this._onMouseOver(s)),this.onmouseleave(this._listenOnDomNode,s=>this._onMouseLeave(s)),this._hideTimeout=this._register(new n0),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=po(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Vi&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new TE(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=po(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new TE(n))};this._mouseWheelToDispose.push(Ae(this._listenOnDomNode,qt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=RG.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let s=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+s===0?a=s=0:Math.abs(s)>=Math.abs(a)?a=0:s=0),this._options.flipAxes&&([s,a]=[a,s]);let l=!Vi&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=s,s=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,s=s*this._options.fastScrollSensitivity);let u=this._scrollable.getFutureScrollPosition(),h={};if(s){let d=LE*s,p=u.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(h,p)}if(a){let d=LE*a,p=u.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(h,p)}h=this._scrollable.validateScrollPosition(h),(u.scrollLeft!==h.scrollLeft||u.scrollTop!==h.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(h):this._scrollable.setScrollPositionNow(h),n=!0)}let i=n;!i&&this._options.alwaysConsumeMouseWheel&&(i=!0),!i&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(i=!0),i&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,i=n?" left":"",s=t?" top":"",a=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${i}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${s}${i}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),TG)}},DG=class extends MG{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function NG(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Vi&&(t.className+=" mac"),t}var gv=class extends Ve{constructor(e,t,n,i,s,a,l,u){super(),this._bufferService=n,this._optionsService=l,this._renderService=u,this._onRequestScrollLines=this._register(new ge),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let h=this._register(new yG({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>i0(i.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{h.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new DG(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},h)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(s.onProtocolChange(d=>{this._scrollableElement.updateOptions({handleMouseWheel:!(d&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(an.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(pt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=i.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(pt(()=>this._styleElement.remove())),this._register(an.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${a.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${a.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${a.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
223
|
+
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(d=>this._handleScroll(d)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};gv=xt([_e(2,bn),_e(3,Er),_e(4,sD),_e(5,$a),_e(6,Sn),_e(7,kr)],gv);var _v=class extends Ve{constructor(e,t,n,i,s){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=i,this._renderService=s,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(a=>this._removeDecoration(a))),this._register(pt(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};_v=xt([_e(1,bn),_e(2,Er),_e(3,Ic),_e(4,kr)],_v);var OG=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(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||"full"]&&t<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Di={full:0,left:0,center:0,right:0},is={full:0,left:0,center:0,right:0},Fl={full:0,left:0,center:0,right:0},Nd=class extends Ve{constructor(e,t,n,i,s,a,l,u){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=i,this._renderService=s,this._optionsService=a,this._themeService=l,this._coreBrowserService=u,this._colorZoneStore=new OG,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(pt(()=>this._canvas?.remove()));let h=this._canvas.getContext("2d");if(h)this._ctx=h;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),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())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);is.full=this._canvas.width,is.left=e,is.center=t,is.right=e,this._refreshDrawHeightConstants(),Fl.full=1,Fl.left=1,Fl.center=1+is.left,Fl.right=1+is.left+is.center}_refreshDrawHeightConstants(){Di.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Di.left=t,Di.center=t,Di.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Di.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Di.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Di.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Di.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(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Fl[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Di[e.position||"full"]/2),is[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Di[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Nd=xt([_e(2,bn),_e(3,Ic),_e(4,kr),_e(5,Sn),_e(6,$a),_e(7,Er)],Nd);var de;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
224
|
+
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(de||={});var Qh;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(Qh||={});var kD;(e=>e.ST=`${de.ESC}\\`)(kD||={});var vv=class{constructor(e,t,n,i,s,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=i,this._coreService=s,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;t.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(t.start,this._compositionPosition.start):n=this._textarea.value.substring(t.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,"");this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${de.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,i=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let a=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(a.width,1)+"px",this._textarea.style.height=Math.max(a.height,1)+"px",this._textarea.style.lineHeight=a.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};vv=xt([_e(2,bn),_e(3,Sn),_e(4,vo),_e(5,kr)],vv);var Kt=0,Yt=0,Xt=0,wt=0,PE={css:"#00000000",rgba:0},Pt;(e=>{function t(s,a,l,u){return u!==void 0?`#${qs(s)}${qs(a)}${qs(l)}${qs(u)}`:`#${qs(s)}${qs(a)}${qs(l)}`}e.toCss=t;function n(s,a,l,u=255){return(s<<24|a<<16|l<<8|u)>>>0}e.toRgba=n;function i(s,a,l,u){return{css:e.toCss(s,a,l,u),rgba:e.toRgba(s,a,l,u)}}e.toColor=i})(Pt||={});var ht;(e=>{function t(h,d){if(wt=(d.rgba&255)/255,wt===1)return{css:d.css,rgba:d.rgba};let p=d.rgba>>24&255,m=d.rgba>>16&255,_=d.rgba>>8&255,y=h.rgba>>24&255,b=h.rgba>>16&255,S=h.rgba>>8&255;Kt=y+Math.round((p-y)*wt),Yt=b+Math.round((m-b)*wt),Xt=S+Math.round((_-S)*wt);let C=Pt.toCss(Kt,Yt,Xt),k=Pt.toRgba(Kt,Yt,Xt);return{css:C,rgba:k}}e.blend=t;function n(h){return(h.rgba&255)===255}e.isOpaque=n;function i(h,d,p){let m=Jh.ensureContrastRatio(h.rgba,d.rgba,p);if(m)return Pt.toColor(m>>24&255,m>>16&255,m>>8&255)}e.ensureContrastRatio=i;function s(h){let d=(h.rgba|255)>>>0;return[Kt,Yt,Xt]=Jh.toChannels(d),{css:Pt.toCss(Kt,Yt,Xt),rgba:d}}e.opaque=s;function a(h,d){return wt=Math.round(d*255),[Kt,Yt,Xt]=Jh.toChannels(h.rgba),{css:Pt.toCss(Kt,Yt,Xt,wt),rgba:Pt.toRgba(Kt,Yt,Xt,wt)}}e.opacity=a;function l(h,d){return wt=h.rgba&255,a(h,wt*d/255)}e.multiplyOpacity=l;function u(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=u})(ht||={});var gt;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let a=s.getContext("2d",{willReadFrequently:!0});a&&(t=a,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function i(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return Kt=parseInt(s.slice(1,2).repeat(2),16),Yt=parseInt(s.slice(2,3).repeat(2),16),Xt=parseInt(s.slice(3,4).repeat(2),16),Pt.toColor(Kt,Yt,Xt);case 5:return Kt=parseInt(s.slice(1,2).repeat(2),16),Yt=parseInt(s.slice(2,3).repeat(2),16),Xt=parseInt(s.slice(3,4).repeat(2),16),wt=parseInt(s.slice(4,5).repeat(2),16),Pt.toColor(Kt,Yt,Xt,wt);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let a=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(a)return Kt=parseInt(a[1]),Yt=parseInt(a[2]),Xt=parseInt(a[3]),wt=Math.round((a[5]===void 0?1:parseFloat(a[5]))*255),Pt.toColor(Kt,Yt,Xt,wt);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=s,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Kt,Yt,Xt,wt]=t.getImageData(0,0,1,1).data,wt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Pt.toRgba(Kt,Yt,Xt,wt),css:s}}e.toColor=i})(gt||={});var gn;(e=>{function t(i){return n(i>>16&255,i>>8&255,i&255)}e.relativeLuminance=t;function n(i,s,a){let l=i/255,u=s/255,h=a/255,d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),p=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),m=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return d*.2126+p*.7152+m*.0722}e.relativeLuminance2=n})(gn||={});var Jh;(e=>{function t(l,u){if(wt=(u&255)/255,wt===1)return u;let h=u>>24&255,d=u>>16&255,p=u>>8&255,m=l>>24&255,_=l>>16&255,y=l>>8&255;return Kt=m+Math.round((h-m)*wt),Yt=_+Math.round((d-_)*wt),Xt=y+Math.round((p-y)*wt),Pt.toRgba(Kt,Yt,Xt)}e.blend=t;function n(l,u,h){let d=gn.relativeLuminance(l>>8),p=gn.relativeLuminance(u>>8);if(pr(d,p)<h){if(p<d){let y=i(l,u,h),b=pr(d,gn.relativeLuminance(y>>8));if(b<h){let S=s(l,u,h),C=pr(d,gn.relativeLuminance(S>>8));return b>C?y:S}return y}let m=s(l,u,h),_=pr(d,gn.relativeLuminance(m>>8));if(_<h){let y=i(l,u,h),b=pr(d,gn.relativeLuminance(y>>8));return _>b?m:y}return m}}e.ensureContrastRatio=n;function i(l,u,h){let d=l>>24&255,p=l>>16&255,m=l>>8&255,_=u>>24&255,y=u>>16&255,b=u>>8&255,S=pr(gn.relativeLuminance2(_,y,b),gn.relativeLuminance2(d,p,m));for(;S<h&&(_>0||y>0||b>0);)_-=Math.max(0,Math.ceil(_*.1)),y-=Math.max(0,Math.ceil(y*.1)),b-=Math.max(0,Math.ceil(b*.1)),S=pr(gn.relativeLuminance2(_,y,b),gn.relativeLuminance2(d,p,m));return(_<<24|y<<16|b<<8|255)>>>0}e.reduceLuminance=i;function s(l,u,h){let d=l>>24&255,p=l>>16&255,m=l>>8&255,_=u>>24&255,y=u>>16&255,b=u>>8&255,S=pr(gn.relativeLuminance2(_,y,b),gn.relativeLuminance2(d,p,m));for(;S<h&&(_<255||y<255||b<255);)_=Math.min(255,_+Math.ceil((255-_)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),S=pr(gn.relativeLuminance2(_,y,b),gn.relativeLuminance2(d,p,m));return(_<<24|y<<16|b<<8|255)>>>0}e.increaseLuminance=s;function a(l){return[l>>24&255,l>>16&255,l>>8&255,l&255]}e.toChannels=a})(Jh||={});function qs(e){let t=e.toString(16);return t.length<2?"0"+t:t}function pr(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var LG=class extends Bc{constructor(e,t,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Od=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new hi}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],i=t.translateToString(!0),s=0,a=0,l=0,u=t.getFg(0),h=t.getBg(0);for(let d=0;d<t.getTrimmedLength();d++)if(t.loadCell(d,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==u||this._workCell.bg!==h){if(d-s>1){let p=this._getJoinedRanges(i,l,a,t,s);for(let m=0;m<p.length;m++)n.push(p[m])}s=d,l=a,u=this._workCell.fg,h=this._workCell.bg}a+=this._workCell.getChars().length||ds.length}if(this._bufferService.cols-s>1){let d=this._getJoinedRanges(i,l,a,t,s);for(let p=0;p<d.length;p++)n.push(d[p])}return n}_getJoinedRanges(e,t,n,i,s){let a=e.substring(t,n),l=[];try{l=this._characterJoiners[0].handler(a)}catch(u){console.error(u)}for(let u=1;u<this._characterJoiners.length;u++)try{let h=this._characterJoiners[u].handler(a);for(let d=0;d<h.length;d++)Od._mergeRanges(l,h[d])}catch(h){console.error(h)}return this._stringRangesToCellRanges(l,i,s),l}_stringRangesToCellRanges(e,t,n){let i=0,s=!1,a=0,l=e[i];if(l){for(let u=n;u<this._bufferService.cols;u++){let h=t.getWidth(u),d=t.getString(u).length||ds.length;if(h!==0){if(!s&&l[0]<=a&&(l[0]=u,s=!0),l[1]<=a){if(l[1]=u,l=e[++i],!l)break;l[0]<=a?(l[0]=u,s=!0):s=!1}a+=d}}l&&(l[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(n){if(t[1]<=s[0])return e[i-1][1]=t[1],e;if(t[1]<=s[1])return e[i-1][1]=Math.max(t[1],s[1]),e.splice(i,1),e;e.splice(i,1),i--}else{if(t[1]<=s[0])return e.splice(i,0,t),e;if(t[1]<=s[1])return s[0]=Math.min(t[0],s[0]),e;t[0]<s[1]&&(s[0]=Math.min(t[0],s[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};Od=xt([_e(0,bn)],Od);function PG(e){return 57508<=e&&e<=57558}function BG(e){return 9472<=e&&e<=9631}function IG(e){return PG(e)||BG(e)}function jG(){return{css:{canvas:Th(),cell:Th()},device:{canvas:Th(),cell:Th(),char:{width:0,height:0,left:0,top:0}}}}function Th(){return{width:0,height:0}}var yv=class{constructor(e,t,n,i,s,a,l){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=i,this._coreService=s,this._decorationService=a,this._themeService=l,this._workCell=new hi,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,i,s,a,l,u,h,d,p){let m=[],_=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,b=e.getNoBgTrimmedLength();n&&b<a+1&&(b=a+1);let S,C=0,k="",T=0,R=0,A=0,N=0,V=!1,H=0,z=!1,J=0,$=0,K=[],I=d!==-1&&p!==-1;for(let P=0;P<b;P++){e.loadCell(P,this._workCell);let B=this._workCell.getWidth();if(B===0)continue;let W=!1,M=P>=$,U=P,j=this._workCell;if(_.length>0&&P===_[0][0]&&M){let Ee=_.shift(),Pe=this._isCellInSelection(Ee[0],t);for(T=Ee[0]+1;T<Ee[1];T++)M&&=Pe===this._isCellInSelection(T,t);M&&=!n||a<Ee[0]||a>=Ee[1],M?(W=!0,j=new LG(this._workCell,e.translateToString(!0,Ee[0],Ee[1]),Ee[1]-Ee[0]),U=Ee[1]-1,B=j.getWidth()):$=Ee[1]}let ee=this._isCellInSelection(P,t),X=n&&P===a,L=I&&P>=d&&P<=p,Z=!1;this._decorationService.forEachDecorationAtCell(P,t,void 0,Ee=>{Z=!0});let ie=j.getChars()||ds;if(ie===" "&&(j.isUnderline()||j.isOverline())&&(ie=" "),J=B*u-h.get(ie,j.isBold(),j.isItalic()),!S)S=this._document.createElement("span");else if(C&&(ee&&z||!ee&&!z&&j.bg===R)&&(ee&&z&&y.selectionForeground||j.fg===A)&&j.extended.ext===N&&L===V&&J===H&&!X&&!W&&!Z&&M){j.isInvisible()?k+=ds:k+=ie,C++;continue}else C&&(S.textContent=k),S=this._document.createElement("span"),C=0,k="";if(R=j.bg,A=j.fg,N=j.extended.ext,V=L,H=J,z=ee,W&&a>=P&&a<=U&&(a=P),!this._coreService.isCursorHidden&&X&&this._coreService.isCursorInitialized){if(K.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&K.push("xterm-cursor-blink"),K.push(i==="bar"?"xterm-cursor-bar":i==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(s)switch(s){case"outline":K.push("xterm-cursor-outline");break;case"block":K.push("xterm-cursor-block");break;case"bar":K.push("xterm-cursor-bar");break;case"underline":K.push("xterm-cursor-underline");break}}if(j.isBold()&&K.push("xterm-bold"),j.isItalic()&&K.push("xterm-italic"),j.isDim()&&K.push("xterm-dim"),j.isInvisible()?k=ds:k=j.getChars()||ds,j.isUnderline()&&(K.push(`xterm-underline-${j.extended.underlineStyle}`),k===" "&&(k=" "),!j.isUnderlineColorDefault()))if(j.isUnderlineColorRGB())S.style.textDecorationColor=`rgb(${Bc.toColorRGB(j.getUnderlineColor()).join(",")})`;else{let Ee=j.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&j.isBold()&&Ee<8&&(Ee+=8),S.style.textDecorationColor=y.ansi[Ee].css}j.isOverline()&&(K.push("xterm-overline"),k===" "&&(k=" ")),j.isStrikethrough()&&K.push("xterm-strikethrough"),L&&(S.style.textDecoration="underline");let F=j.getFgColor(),O=j.getFgColorMode(),G=j.getBgColor(),q=j.getBgColorMode(),ne=!!j.isInverse();if(ne){let Ee=F;F=G,G=Ee;let Pe=O;O=q,q=Pe}let re,fe,pe=!1;this._decorationService.forEachDecorationAtCell(P,t,void 0,Ee=>{Ee.options.layer!=="top"&&pe||(Ee.backgroundColorRGB&&(q=50331648,G=Ee.backgroundColorRGB.rgba>>8&16777215,re=Ee.backgroundColorRGB),Ee.foregroundColorRGB&&(O=50331648,F=Ee.foregroundColorRGB.rgba>>8&16777215,fe=Ee.foregroundColorRGB),pe=Ee.options.layer==="top")}),!pe&&ee&&(re=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,G=re.rgba>>8&16777215,q=50331648,pe=!0,y.selectionForeground&&(O=50331648,F=y.selectionForeground.rgba>>8&16777215,fe=y.selectionForeground)),pe&&K.push("xterm-decoration-top");let xe;switch(q){case 16777216:case 33554432:xe=y.ansi[G],K.push(`xterm-bg-${G}`);break;case 50331648:xe=Pt.toColor(G>>16,G>>8&255,G&255),this._addStyle(S,`background-color:#${BE((G>>>0).toString(16),"0",6)}`);break;default:ne?(xe=y.foreground,K.push("xterm-bg-257")):xe=y.background}switch(re||j.isDim()&&(re=ht.multiplyOpacity(xe,.5)),O){case 16777216:case 33554432:j.isBold()&&F<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(F+=8),this._applyMinimumContrast(S,xe,y.ansi[F],j,re,void 0)||K.push(`xterm-fg-${F}`);break;case 50331648:let Ee=Pt.toColor(F>>16&255,F>>8&255,F&255);this._applyMinimumContrast(S,xe,Ee,j,re,fe)||this._addStyle(S,`color:#${BE(F.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(S,xe,y.foreground,j,re,fe)||ne&&K.push("xterm-fg-257")}K.length&&(S.className=K.join(" "),K.length=0),!X&&!W&&!Z&&M?C++:S.textContent=k,J!==this.defaultSpacing&&(S.style.letterSpacing=`${J}px`),m.push(S),P=U}return S&&C&&(S.textContent=k),m}_applyMinimumContrast(e,t,n,i,s,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||IG(i.getCode()))return!1;let l=this._getContrastCache(i),u;if(!s&&!a&&(u=l.getColor(t.rgba,n.rgba)),u===void 0){let h=this._optionsService.rawOptions.minimumContrastRatio/(i.isDim()?2:1);u=ht.ensureContrastRatio(s||t,a||n,h),l.setColor((s||t).rgba,(a||n).rgba,u??null)}return u?(this._addStyle(e,`color:${u.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,i=this._selectionEnd;return!n||!i?!1:this._columnSelectMode?n[0]<=i[0]?e>=n[0]&&t>=n[1]&&e<i[0]&&t<=i[1]:e<n[0]&&t>=n[1]&&e>=i[0]&&t<=i[1]:t>n[1]&&t<i[1]||n[1]===i[1]&&t===n[1]&&e>=n[0]&&e<i[0]||n[1]<i[1]&&t===i[1]&&e<i[0]||n[1]<i[1]&&t===n[1]&&e>=n[0]}};yv=xt([_e(1,lD),_e(2,Sn),_e(3,Er),_e(4,vo),_e(5,Ic),_e(6,$a)],yv);function BE(e,t,n){for(;e.length<n;)e=t+e;return e}var zG=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.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";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let i=e.createElement("span");i.classList.add("xterm-char-measure-element"),i.style.fontWeight="bold";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontStyle="italic";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold",a.style.fontStyle="italic",this._measureElements=[n,i,s,a],this._container.appendChild(n),this._container.appendChild(i),this._container.appendChild(s),this._container.appendChild(a),t.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(e,t,n,i){e===this._font&&t===this._fontSize&&n===this._weight&&i===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=i,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${i}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${i}`,this.clear())}get(e,t,n){let i=0;if(!t&&!n&&e.length===1&&(i=e.charCodeAt(0))<256){if(this._flat[i]!==-9999)return this._flat[i];let l=this._measure(e,0);return l>0&&(this._flat[i]=l),l}let s=e;t&&(s+="B"),n&&(s+="I");let a=this._holey.get(s);if(a===void 0){let l=0;t&&(l|=1),n&&(l|=2),a=this._measure(e,l),a>0&&this._holey.set(s,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},HG=class{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(e,t,n,i=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let s=e.buffers.active.ydisp,a=t[1]-s,l=n[1]-s,u=Math.max(a,0),h=Math.min(l,e.rows-1);if(u>=e.rows||h<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=i,this.viewportStartRow=a,this.viewportEndRow=l,this.viewportCappedStartRow=u,this.viewportCappedEndRow=h,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function VG(){return new HG}var zg="xterm-dom-renderer-owner-",ii="xterm-rows",Ah="xterm-fg-",IE="xterm-bg-",$l="xterm-focus",Rh="xterm-selection",UG=1,bv=class extends Ve{constructor(e,t,n,i,s,a,l,u,h,d,p,m,_,y){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=i,this._viewportElement=s,this._helperContainer=a,this._linkifier2=l,this._charSizeService=h,this._optionsService=d,this._bufferService=p,this._coreService=m,this._coreBrowserService=_,this._themeService=y,this._terminalClass=UG++,this._rowElements=[],this._selectionRenderModel=VG(),this.onRequestRedraw=this._register(new ge).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(ii),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(Rh),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=jG(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(b=>this._injectCss(b))),this._injectCss(this._themeService.colors),this._rowFactory=u.createInstance(yv,document),this._element.classList.add(zg+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(b=>this._handleLinkHover(b))),this._register(this._linkifier2.onHideLinkUnderline(b=>this._handleLinkLeave(b))),this._register(pt(()=>{this._element.classList.remove(zg+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new zG(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(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),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/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),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(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${ii} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${ii} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${ii} .xterm-dim { color: ${ht.multiplyOpacity(e.foreground,.5).css};}`,t+=`${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;}`;let n=`blink_underline_${this._terminalClass}`,i=`blink_bar_${this._terminalClass}`,s=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${i} { 50% { box-shadow: none; }}`,t+=`@keyframes ${s} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${ii}.${$l} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${ii}.${$l} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${ii}.${$l} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${ii} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${ii} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${ii} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${ii} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${ii} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Rh} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Rh} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Rh} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[a,l]of e.ansi.entries())t+=`${this._terminalSelector} .${Ah}${a} { color: ${l.css}; }${this._terminalSelector} .${Ah}${a}.xterm-dim { color: ${ht.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${IE}${a} { background-color: ${l.css}; }`;t+=`${this._terminalSelector} .${Ah}257 { color: ${ht.opaque(e.background).css}; }${this._terminalSelector} .${Ah}257.xterm-dim { color: ${ht.multiplyOpacity(ht.opaque(e.background),.5).css}; }${this._terminalSelector} .${IE}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let n=this._rowElements.length;n<=t;n++){let i=this._document.createElement("div");this._rowContainer.appendChild(i),this._rowElements.push(i)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),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($l),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add($l),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let i=this._selectionRenderModel.viewportStartRow,s=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,l=this._selectionRenderModel.viewportCappedEndRow,u=this._document.createDocumentFragment();if(n){let h=e[0]>t[0];u.appendChild(this._createSelectionElement(a,h?t[0]:e[0],h?e[0]:t[0],l-a+1))}else{let h=i===a?e[0]:0,d=a===s?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(a,h,d));let p=l-a-1;if(u.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,p)),a!==l){let m=s===l?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(l,0,m))}}this._selectionContainer.appendChild(u)}_createSelectionElement(e,t,n,i=1){let s=this._document.createElement("div"),a=t*this.dimensions.css.cell.width,l=this.dimensions.css.cell.width*(n-t);return a+l>this.dimensions.css.canvas.width&&(l=this.dimensions.css.canvas.width-a),s.style.height=`${i*this.dimensions.css.cell.height}px`,s.style.top=`${e*this.dimensions.css.cell.height}px`,s.style.left=`${a}px`,s.style.width=`${l}px`,s}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(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,i=n.ybase+n.y,s=Math.min(n.x,this._bufferService.cols-1),a=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,l=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;for(let h=e;h<=t;h++){let d=h+n.ydisp,p=this._rowElements[h],m=n.lines.get(d);if(!p||!m)break;p.replaceChildren(...this._rowFactory.createRow(m,d,d===i,l,u,s,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${zg}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,i,s,a){n<0&&(e=0),i<0&&(t=0);let l=this._bufferService.rows-1;n=Math.max(Math.min(n,l),0),i=Math.max(Math.min(i,l),0),s=Math.min(s,this._bufferService.cols);let u=this._bufferService.buffer,h=u.ybase+u.y,d=Math.min(u.x,s-1),p=this._optionsService.rawOptions.cursorBlink,m=this._optionsService.rawOptions.cursorStyle,_=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=n;y<=i;++y){let b=y+u.ydisp,S=this._rowElements[y],C=u.lines.get(b);if(!S||!C)break;S.replaceChildren(...this._rowFactory.createRow(C,b,b===h,m,_,d,p,this.dimensions.css.cell.width,this._widthCache,a?y===n?e:0:-1,a?(y===i?t:s)-1:-1))}}};bv=xt([_e(7,Zy),_e(8,mf),_e(9,Sn),_e(10,bn),_e(11,vo),_e(12,Er),_e(13,$a)],bv);var Sv=class extends Ve{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new ge),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new $G(this._optionsService))}catch{this._measureStrategy=this._register(new FG(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Sv=xt([_e(2,Sn)],Sv);var TD=class extends Ve{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},FG=class extends TD{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,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}},$G=class extends TD{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},WG=class extends Ve{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new GG(this._window)),this._onDprChange=this._register(new ge),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new ge),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(i=>this._screenDprMonitor.setWindow(i))),this._register(an.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ae(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ae(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,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}},GG=class extends Ve{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new La),this._onDprChange=this._register(new ge),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(pt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ae(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},qG=class extends Ve{constructor(){super(),this.linkProviders=[],this._register(pt(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function s0(e,t,n){let i=n.getBoundingClientRect(),s=e.getComputedStyle(n),a=parseInt(s.getPropertyValue("padding-left")),l=parseInt(s.getPropertyValue("padding-top"));return[t.clientX-i.left-a,t.clientY-i.top-l]}function KG(e,t,n,i,s,a,l,u,h){if(!a)return;let d=s0(e,t,n);if(d)return d[0]=Math.ceil((d[0]+(h?l/2:0))/l),d[1]=Math.ceil(d[1]/u),d[0]=Math.min(Math.max(d[0],1),i+(h?1:0)),d[1]=Math.min(Math.max(d[1],1),s),d}var wv=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,i,s){return KG(window,e,t,n,i,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(e,t){let n=s0(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};wv=xt([_e(0,kr),_e(1,mf)],wv);var YG=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!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){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},AD={};sW(AD,{getSafariVersion:()=>ZG,isChromeOS:()=>ND,isFirefox:()=>RD,isIpad:()=>QG,isIphone:()=>JG,isLegacyEdge:()=>XG,isLinux:()=>o0,isMac:()=>Ld,isNode:()=>gf,isSafari:()=>MD,isWindows:()=>DD});var gf=typeof process<"u"&&"title"in process,jc=gf?"node":navigator.userAgent,zc=gf?"node":navigator.platform,RD=jc.includes("Firefox"),XG=jc.includes("Edge"),MD=/^((?!chrome|android).)*safari/i.test(jc);function ZG(){if(!MD)return 0;let e=jc.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Ld=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(zc),QG=zc==="iPad",JG=zc==="iPhone",DD=["Windows","Win16","Win32","WinCE"].includes(zc),o0=zc.indexOf("Linux")>=0,ND=/\bCrOS\b/.test(jc),OD=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),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(e){this._idleCallback=void 0;let t=0,n=0,i=e.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),s=e.timeRemaining(),n*1.5>s){i-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(i-t))}ms`),this._start();return}i=s}this.clear()}},eq=class extends OD{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},tq=class extends OD{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Pd=!gf&&"requestIdleCallback"in window?tq:eq,nq=class{constructor(){this._queue=new Pd}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},xv=class extends Ve{constructor(e,t,n,i,s,a,l,u,h){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=i,this._coreService=s,this._coreBrowserService=u,this._renderer=this._register(new La),this._pausedResizeTask=new nq,this._observerDisposable=this._register(new La),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 ge),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new ge),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new ge),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new ge),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new YG((d,p)=>this._renderRows(d,p),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new iq(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(pt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(l.onResize(()=>this._fullRefresh())),this._register(l.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(a.onDecorationRegistered(()=>this._fullRefresh())),this._register(a.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(l.cols,l.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(l.buffer.y,l.buffer.y,!0))),this._register(h.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(d=>this._registerIntersectionObserver(d,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(i=>this._handleIntersectionChange(i[i.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=pt(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let i=this._syncOutputHandler.flush();i&&(e=Math.min(e,i.start),t=Math.max(t,i.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,n){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,t,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};xv=xt([_e(2,Sn),_e(3,mf),_e(4,vo),_e(5,Ic),_e(6,bn),_e(7,Er),_e(8,$a)],xv);var iq=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function rq(e,t,n,i){let s=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return aq(s,a,e,t,n,i)+_f(a,t,n,i)+lq(s,a,e,t,n,i);let l;if(a===t)return l=s>e?"D":"C",xc(Math.abs(s-e),wc(l,i));l=a>t?"D":"C";let u=Math.abs(a-t),h=oq(a>t?e:s,n)+(u-1)*n.cols+1+sq(a>t?s:e);return xc(h,wc(l,i))}function sq(e,t){return e-1}function oq(e,t){return t.cols-e}function aq(e,t,n,i,s,a){return _f(t,i,s,a).length===0?"":xc(PD(e,t,e,t-mo(t,s),!1,s).length,wc("D",a))}function _f(e,t,n,i){let s=e-mo(e,n),a=t-mo(t,n),l=Math.abs(s-a)-cq(e,t,n);return xc(l,wc(LD(e,t),i))}function lq(e,t,n,i,s,a){let l;_f(t,i,s,a).length>0?l=i-mo(i,s):l=t;let u=i,h=uq(e,t,n,i,s,a);return xc(PD(e,l,n,u,h==="C",s).length,wc(h,a))}function cq(e,t,n){let i=0,s=e-mo(e,n),a=t-mo(t,n);for(let l=0;l<Math.abs(s-a);l++){let u=LD(e,t)==="A"?-1:1;n.buffer.lines.get(s+u*l)?.isWrapped&&i++}return i}function mo(e,t){let n=0,i=t.buffer.lines.get(e),s=i?.isWrapped;for(;s&&e>=0&&e<t.rows;)n++,i=t.buffer.lines.get(--e),s=i?.isWrapped;return n}function uq(e,t,n,i,s,a){let l;return _f(n,i,s,a).length>0?l=i-mo(i,s):l=t,e<n&&l<=i||e>=n&&l<i?"C":"D"}function LD(e,t){return e>t?"A":"B"}function PD(e,t,n,i,s,a){let l=e,u=t,h="";for(;(l!==n||u!==i)&&u>=0&&u<a.buffer.lines.length;)l+=s?1:-1,s&&l>a.cols-1?(h+=a.buffer.translateBufferLineToString(u,!1,e,l),l=0,e=0,u++):!s&&l<0&&(h+=a.buffer.translateBufferLineToString(u,!1,0,e+1),l=a.cols-1,e=l,u--);return h+a.buffer.translateBufferLineToString(u,!1,e,l)}function wc(e,t){let n=t?"O":"[";return de.ESC+n+e}function xc(e,t){e=Math.floor(e);let n="";for(let i=0;i<e;i++)n+=t;return n}var hq=class{constructor(e){this._bufferService=e,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.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()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function jE(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Hg=50,dq=15,fq=50,pq=500,mq=" ",gq=new RegExp(mq,"g"),Cv=class extends Ve{constructor(e,t,n,i,s,a,l,u,h){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=i,this._coreService=s,this._mouseService=a,this._optionsService=l,this._renderService=u,this._coreBrowserService=h,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new hi,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new ge),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new ge),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new ge),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new ge),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=d=>this._handleMouseMove(d),this._mouseUpListener=d=>this._handleMouseUp(d),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(d=>this._handleTrim(d)),this._register(this._bufferService.buffers.onBufferActivate(d=>this._handleBufferActivate(d))),this.enable(),this._model=new hq(this._bufferService),this._activeSelectionMode=0,this._register(pt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(d=>{d.rowsChanged&&this.clearSelection()}))}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(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let n=this._bufferService.buffer,i=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let s=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let l=e[1];l<=t[1];l++){let u=n.translateBufferLineToString(l,!0,s,a);i.push(u)}}else{let s=e[1]===t[1]?t[0]:void 0;i.push(n.translateBufferLineToString(e[1],!0,e[0],s));for(let a=e[1]+1;a<=t[1]-1;a++){let l=n.lines.get(a),u=n.translateBufferLineToString(a,!0);l?.isWrapped?i[i.length-1]+=u:i.push(u)}if(e[1]!==t[1]){let a=n.lines.get(t[1]),l=n.translateBufferLineToString(t[1],!0,0,t[0]);a&&a.isWrapped?i[i.length-1]+=l:i.push(l)}}return i.map(s=>s.replace(gq," ")).join(DD?`\r
|
|
225
|
+
`:`
|
|
226
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),o0&&e&&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(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!n||!i||!t?!1:this._areCoordsInSelection(t,n,i)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!n||!i?!1:this._areCoordsInSelection([e,t],n,i)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=jE(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let i=this._getMouseBufferCoords(e);return i?(this._selectWordAt(i,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=s0(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-Hg),Hg),t/=Hg,t/Math.abs(t)+Math.round(t*(dq-1)))}shouldForceSelection(e){return Ld?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),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(),fq)}_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(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Ld&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}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(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let i=n.lines.get(this._model.selectionEnd[1]);i&&i.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[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});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<pq&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let i=rq(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(i,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,t,n);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let i=0;t>=i;i++){let s=e.loadCell(i,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:s>1&&t!==i&&(n+=s-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,i=!0){if(e[0]>=this._bufferService.cols)return;let s=this._bufferService.buffer,a=s.lines.get(e[1]);if(!a)return;let l=s.translateBufferLineToString(e[1],!1),u=this._convertViewportColToCharacterIndex(a,e[0]),h=u,d=e[0]-u,p=0,m=0,_=0,y=0;if(l.charAt(u)===" "){for(;u>0&&l.charAt(u-1)===" ";)u--;for(;h<l.length&&l.charAt(h+1)===" ";)h++}else{let C=e[0],k=e[0];a.getWidth(C)===0&&(p++,C--),a.getWidth(k)===2&&(m++,k++);let T=a.getString(k).length;for(T>1&&(y+=T-1,h+=T-1);C>0&&u>0&&!this._isCharWordSeparator(a.loadCell(C-1,this._workCell));){a.loadCell(C-1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===0?(p++,C--):R>1&&(_+=R-1,u-=R-1),u--,C--}for(;k<a.length&&h+1<l.length&&!this._isCharWordSeparator(a.loadCell(k+1,this._workCell));){a.loadCell(k+1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===2?(m++,k++):R>1&&(y+=R-1,h+=R-1),h++,k++}}h++;let b=u+d-p+_,S=Math.min(this._bufferService.cols,h-u+p+m-_-y);if(!(!t&&l.slice(u,h).trim()==="")){if(n&&b===0&&a.getCodePoint(0)!==32){let C=s.lines.get(e[1]-1);if(C&&a.isWrapped&&C.getCodePoint(this._bufferService.cols-1)!==32){let k=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(k){let T=this._bufferService.cols-k.start;b-=T,S+=T}}}if(i&&b+S===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let C=s.lines.get(e[1]+1);if(C?.isWrapped&&C.getCodePoint(0)!==32){let k=this._getWordAt([0,e[1]+1],!1,!1,!0);k&&(S+=k.length)}}return{start:b,length:S}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=jE(n,this._bufferService.cols)}};Cv=xt([_e(3,bn),_e(4,vo),_e(5,Qy),_e(6,Sn),_e(7,kr),_e(8,Er)],Cv);var zE=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},HE=class{constructor(){this._color=new zE,this._css=new zE}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},zt=Object.freeze((()=>{let e=[gt.toColor("#2e3436"),gt.toColor("#cc0000"),gt.toColor("#4e9a06"),gt.toColor("#c4a000"),gt.toColor("#3465a4"),gt.toColor("#75507b"),gt.toColor("#06989a"),gt.toColor("#d3d7cf"),gt.toColor("#555753"),gt.toColor("#ef2929"),gt.toColor("#8ae234"),gt.toColor("#fce94f"),gt.toColor("#729fcf"),gt.toColor("#ad7fa8"),gt.toColor("#34e2e2"),gt.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let i=t[n/36%6|0],s=t[n/6%6|0],a=t[n%6];e.push({css:Pt.toCss(i,s,a),rgba:Pt.toRgba(i,s,a)})}for(let n=0;n<24;n++){let i=8+n*10;e.push({css:Pt.toCss(i,i,i),rgba:Pt.toRgba(i,i,i)})}return e})()),Zs=gt.toColor("#ffffff"),ec=gt.toColor("#000000"),VE=gt.toColor("#ffffff"),UE=ec,Wl={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},_q=Zs,Ev=class extends Ve{constructor(e){super(),this._optionsService=e,this._contrastCache=new HE,this._halfContrastCache=new HE,this._onChangeColors=this._register(new ge),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Zs,background:ec,cursor:VE,cursorAccent:UE,selectionForeground:void 0,selectionBackgroundTransparent:Wl,selectionBackgroundOpaque:ht.blend(ec,Wl),selectionInactiveBackgroundTransparent:Wl,selectionInactiveBackgroundOpaque:ht.blend(ec,Wl),scrollbarSliderBackground:ht.opacity(Zs,.2),scrollbarSliderHoverBackground:ht.opacity(Zs,.4),scrollbarSliderActiveBackground:ht.opacity(Zs,.5),overviewRulerBorder:Zs,ansi:zt.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)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=rt(e.foreground,Zs),t.background=rt(e.background,ec),t.cursor=ht.blend(t.background,rt(e.cursor,VE)),t.cursorAccent=ht.blend(t.background,rt(e.cursorAccent,UE)),t.selectionBackgroundTransparent=rt(e.selectionBackground,Wl),t.selectionBackgroundOpaque=ht.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=rt(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=ht.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?rt(e.selectionForeground,PE):void 0,t.selectionForeground===PE&&(t.selectionForeground=void 0),ht.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=ht.opacity(t.selectionBackgroundTransparent,.3)),ht.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=ht.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=rt(e.scrollbarSliderBackground,ht.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=rt(e.scrollbarSliderHoverBackground,ht.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=rt(e.scrollbarSliderActiveBackground,ht.opacity(t.foreground,.5)),t.overviewRulerBorder=rt(e.overviewRulerBorder,_q),t.ansi=zt.slice(),t.ansi[0]=rt(e.black,zt[0]),t.ansi[1]=rt(e.red,zt[1]),t.ansi[2]=rt(e.green,zt[2]),t.ansi[3]=rt(e.yellow,zt[3]),t.ansi[4]=rt(e.blue,zt[4]),t.ansi[5]=rt(e.magenta,zt[5]),t.ansi[6]=rt(e.cyan,zt[6]),t.ansi[7]=rt(e.white,zt[7]),t.ansi[8]=rt(e.brightBlack,zt[8]),t.ansi[9]=rt(e.brightRed,zt[9]),t.ansi[10]=rt(e.brightGreen,zt[10]),t.ansi[11]=rt(e.brightYellow,zt[11]),t.ansi[12]=rt(e.brightBlue,zt[12]),t.ansi[13]=rt(e.brightMagenta,zt[13]),t.ansi[14]=rt(e.brightCyan,zt[14]),t.ansi[15]=rt(e.brightWhite,zt[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let i=0;i<n;i++)t.ansi[i+16]=rt(e.extendedAnsi[i],zt[i+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){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[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(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()}}};Ev=xt([_e(0,Sn)],Ev);function rt(e,t){if(e!==void 0)try{return gt.toColor(e)}catch{}return t}var vq=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},yq=class{constructor(){this._services=new vq,this._services.set(Zy,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=dW(e).sort((a,l)=>a.index-l.index),i=[];for(let a of n){let l=this._services.get(a.id);if(!l)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id._id}.`);i.push(l)}let s=n.length>0?n[0].index:t.length;if(t.length!==s)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);return new e(...t,...i)}},bq={trace:0,debug:1,info:2,warn:3,error:4,off:5},Sq="xterm.js: ",kv=class extends Ve{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=bq[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":Sq)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};kv=xt([_e(0,Sn)],kv);var FE=class extends Ve{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new ge),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new ge),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new ge),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,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(e,t,...n){if(t){for(let i=e;i<this._length-t;i++)this._array[this._getCyclicIndex(i)]=this._array[this._getCyclicIndex(i+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let i=this._length-1;i>=e;i--)this._array[this._getCyclicIndex(i+n.length)]=this._array[this._getCyclicIndex(i)];for(let i=0;i<n.length;i++)this._array[this._getCyclicIndex(e+i)]=n[i];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let i=this._length+n.length-this._maxLength;this._startIndex+=i,this._length=this._maxLength,this.onTrimEmitter.fire(i)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let s=t-1;s>=0;s--)this.set(e+s+n,this.get(e+s));let i=e+t+n-this._length;if(i>0)for(this._length+=i;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let i=0;i<t;i++)this.set(e+i+n,this.get(e+i))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},ze=3,Ot=Object.freeze(new Bc),Mh=0,Vg=2,tc=class BD{constructor(t,n,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*ze);let s=n||hi.fromCharData([0,tD,1,0]);for(let a=0;a<t;++a)this.setCell(a,s);this.length=t}get(t){let n=this._data[t*ze+0],i=n&2097151;return[this._data[t*ze+1],n&2097152?this._combined[t]:i?us(i):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i]}set(t,n){this._data[t*ze+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*ze+0]=t|2097152|n[2]<<22):this._data[t*ze+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*ze+0]>>22}hasWidth(t){return this._data[t*ze+0]&12582912}getFg(t){return this._data[t*ze+1]}getBg(t){return this._data[t*ze+2]}hasContent(t){return this._data[t*ze+0]&4194303}getCodePoint(t){let n=this._data[t*ze+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*ze+0]&2097152}getString(t){let n=this._data[t*ze+0];return n&2097152?this._combined[t]:n&2097151?us(n&2097151):""}isProtected(t){return this._data[t*ze+2]&536870912}loadCell(t,n){return Mh=t*ze,n.content=this._data[Mh+0],n.fg=this._data[Mh+1],n.bg=this._data[Mh+2],n.content&2097152&&(n.combinedData=this._combined[t]),n.bg&268435456&&(n.extended=this._extendedAttrs[t]),n}setCell(t,n){n.content&2097152&&(this._combined[t]=n.combinedData),n.bg&268435456&&(this._extendedAttrs[t]=n.extended),this._data[t*ze+0]=n.content,this._data[t*ze+1]=n.fg,this._data[t*ze+2]=n.bg}setCellFromCodepoint(t,n,i,s){s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*ze+0]=n|i<<22,this._data[t*ze+1]=s.fg,this._data[t*ze+2]=s.bg}addCodepointToCell(t,n,i){let s=this._data[t*ze+0];s&2097152?this._combined[t]+=us(n):s&2097151?(this._combined[t]=us(s&2097151)+us(n),s&=-2097152,s|=2097152):s=n|1<<22,i&&(s&=-12582913,s|=i<<22),this._data[t*ze+0]=s}insertCells(t,n,i){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),n<this.length-t){let s=new hi;for(let a=this.length-t-n-1;a>=0;--a)this.setCell(t+n+a,this.loadCell(t+a,s));for(let a=0;a<n;++a)this.setCell(t+a,i)}else for(let s=t;s<this.length;++s)this.setCell(s,i);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,i)}deleteCells(t,n,i){if(t%=this.length,n<this.length-t){let s=new hi;for(let a=0;a<this.length-t-n;++a)this.setCell(t+a,this.loadCell(t+n+a,s));for(let a=this.length-n;a<this.length;++a)this.setCell(a,i)}else for(let s=t;s<this.length;++s)this.setCell(s,i);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,i)}replaceCells(t,n,i,s=!1){if(s){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,i),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,i);t<n&&t<this.length;)this.isProtected(t)||this.setCell(t,i),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,i),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,i);t<n&&t<this.length;)this.setCell(t++,i)}resize(t,n){if(t===this.length)return this._data.length*4*Vg<this._data.buffer.byteLength;let i=t*ze;if(t>this.length){if(this._data.buffer.byteLength>=i*4)this._data=new Uint32Array(this._data.buffer,0,i);else{let s=new Uint32Array(i);s.set(this._data),this._data=s}for(let s=this.length;s<t;++s)this.setCell(s,n)}else{this._data=this._data.subarray(0,i);let s=Object.keys(this._combined);for(let l=0;l<s.length;l++){let u=parseInt(s[l],10);u>=t&&delete this._combined[u]}let a=Object.keys(this._extendedAttrs);for(let l=0;l<a.length;l++){let u=parseInt(a[l],10);u>=t&&delete this._extendedAttrs[u]}}return this.length=t,i*4*Vg<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Vg<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,n=!1){if(n){for(let i=0;i<this.length;++i)this.isProtected(i)||this.setCell(i,t);return}this._combined={},this._extendedAttrs={};for(let i=0;i<this.length;++i)this.setCell(i,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let n in t._combined)this._combined[n]=t._combined[n];this._extendedAttrs={};for(let n in t._extendedAttrs)this._extendedAttrs[n]=t._extendedAttrs[n];this.isWrapped=t.isWrapped}clone(){let t=new BD(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let n in this._combined)t._combined[n]=this._combined[n];for(let n in this._extendedAttrs)t._extendedAttrs[n]=this._extendedAttrs[n];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*ze+0]&4194303)return t+(this._data[t*ze+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*ze+0]&4194303||this._data[t*ze+2]&50331648)return t+(this._data[t*ze+0]>>22);return 0}copyCellsFrom(t,n,i,s,a){let l=t._data;if(a)for(let h=s-1;h>=0;h--){for(let d=0;d<ze;d++)this._data[(i+h)*ze+d]=l[(n+h)*ze+d];l[(n+h)*ze+2]&268435456&&(this._extendedAttrs[i+h]=t._extendedAttrs[n+h])}else for(let h=0;h<s;h++){for(let d=0;d<ze;d++)this._data[(i+h)*ze+d]=l[(n+h)*ze+d];l[(n+h)*ze+2]&268435456&&(this._extendedAttrs[i+h]=t._extendedAttrs[n+h])}let u=Object.keys(t._combined);for(let h=0;h<u.length;h++){let d=parseInt(u[h],10);d>=n&&(this._combined[d-n+i]=t._combined[d])}}translateToString(t,n,i,s){n=n??0,i=i??this.length,t&&(i=Math.min(i,this.getTrimmedLength())),s&&(s.length=0);let a="";for(;n<i;){let l=this._data[n*ze+0],u=l&2097151,h=l&2097152?this._combined[n]:u?us(u):ds;if(a+=h,s)for(let d=0;d<h.length;++d)s.push(n);n+=l>>22||1}return s&&s.push(n),a}};function wq(e,t,n,i,s,a){let l=[];for(let u=0;u<e.length-1;u++){let h=u,d=e.get(++h);if(!d.isWrapped)continue;let p=[e.get(u)];for(;h<e.length&&d.isWrapped;)p.push(d),d=e.get(++h);if(!a&&i>=u&&i<h){u+=p.length-1;continue}let m=0,_=Cc(p,m,t),y=1,b=0;for(;y<p.length;){let C=Cc(p,y,t),k=C-b,T=n-_,R=Math.min(k,T);p[m].copyCellsFrom(p[y],b,_,R,!1),_+=R,_===n&&(m++,_=0),b+=R,b===C&&(y++,b=0),_===0&&m!==0&&p[m-1].getWidth(n-1)===2&&(p[m].copyCellsFrom(p[m-1],n-1,_++,1,!1),p[m-1].setCell(n-1,s))}p[m].replaceCells(_,n,s);let S=0;for(let C=p.length-1;C>0&&(C>m||p[C].getTrimmedLength()===0);C--)S++;S>0&&(l.push(u+p.length-S),l.push(S)),u+=p.length-1}return l}function xq(e,t){let n=[],i=0,s=t[i],a=0;for(let l=0;l<e.length;l++)if(s===l){let u=t[++i];e.onDeleteEmitter.fire({index:l-a,amount:u}),l+=u-1,a+=u,s=t[++i]}else n.push(l);return{layout:n,countRemoved:a}}function Cq(e,t){let n=[];for(let i=0;i<t.length;i++)n.push(e.get(t[i]));for(let i=0;i<n.length;i++)e.set(i,n[i]);e.length=t.length}function Eq(e,t,n){let i=[],s=e.map((h,d)=>Cc(e,d,t)).reduce((h,d)=>h+d),a=0,l=0,u=0;for(;u<s;){if(s-u<n){i.push(s-u);break}a+=n;let h=Cc(e,l,t);a>h&&(a-=h,l++);let d=e[l].getWidth(a-1)===2;d&&a--;let p=d?n-1:n;i.push(p),u+=p}return i}function Cc(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let i=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,s=e[t+1].getWidth(0)===2;return i&&s?n-1:n}var ID=class jD{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=jD._nextId++,this._onDispose=this.register(new ge),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),po(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};ID._nextId=1;var kq=ID,Ft={},Qs=Ft.B;Ft[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:"≥","{":"π","|":"≠","}":"£","~":"·"};Ft.A={"#":"£"};Ft.B=void 0;Ft[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Ft.C=Ft[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Ft.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Ft.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Ft.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Ft.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Ft.E=Ft[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Ft.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Ft.H=Ft[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Ft["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var $E=4294967295,WE=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Ot.clone(),this.savedCharset=Qs,this.markers=[],this._nullCell=hi.fromCharData([0,tD,1,0]),this._whitespaceCell=hi.fromCharData([0,ds,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Pd,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new FE(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Dd),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Dd),this._whitespaceCell}getBlankLine(e,t){return new tc(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>$E?$E:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Ot);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new FE(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(Ot),i=0,s=this._getCorrectBufferLength(t);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols<e)for(let l=0;l<this.lines.length;l++)i+=+this.lines.get(l).resize(e,n);let a=0;if(this._rows<t)for(let l=this._rows;l<t;l++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new tc(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new tc(e,n)));else for(let l=this._rows;l>t;l--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s<this.lines.maxLength){let l=this.lines.length-s;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let a=0;a<this.lines.length;a++)i+=+this.lines.get(a).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),i>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,i=wq(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Ot),n);if(i.length>0){let s=xq(this.lines,i);Cq(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let i=this.getNullCell(Ot),s=n;for(;s-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new tc(e,i))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,i=this.getNullCell(Ot),s=[],a=0;for(let l=this.lines.length-1;l>=0;l--){let u=this.lines.get(l);if(!u||!u.isWrapped&&u.getTrimmedLength()<=e)continue;let h=[u];for(;u.isWrapped&&l>0;)u=this.lines.get(--l),h.unshift(u);if(!n){let R=this.ybase+this.y;if(R>=l&&R<l+h.length)continue}let d=h[h.length-1].getTrimmedLength(),p=Eq(h,this._cols,e),m=p.length-h.length,_;this.ybase===0&&this.y!==this.lines.length-1?_=Math.max(0,this.y-this.lines.maxLength+m):_=Math.max(0,this.lines.length-this.lines.maxLength+m);let y=[];for(let R=0;R<m;R++){let A=this.getBlankLine(Ot,!0);y.push(A)}y.length>0&&(s.push({start:l+h.length+a,newLines:y}),a+=y.length),h.push(...y);let b=p.length-1,S=p[b];S===0&&(b--,S=p[b]);let C=h.length-m-1,k=d;for(;C>=0;){let R=Math.min(k,S);if(h[b]===void 0)break;if(h[b].copyCellsFrom(h[C],k-R,S-R,R,!0),S-=R,S===0&&(b--,S=p[b]),k-=R,k===0){C--;let A=Math.max(C,0);k=Cc(h,A,this._cols)}}for(let R=0;R<h.length;R++)p[R]<e&&h[R].setCell(p[R],i);let T=m-_;for(;T-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+a)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+m,this.ybase+t-1)}if(s.length>0){let l=[],u=[];for(let S=0;S<this.lines.length;S++)u.push(this.lines.get(S));let h=this.lines.length,d=h-1,p=0,m=s[p];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+a);let _=0;for(let S=Math.min(this.lines.maxLength-1,h+a-1);S>=0;S--)if(m&&m.start>d+_){for(let C=m.newLines.length-1;C>=0;C--)this.lines.set(S--,m.newLines[C]);S++,l.push({index:d+1,amount:m.newLines.length}),_+=m.newLines.length,m=s[++p]}else this.lines.set(S,u[d--]);let y=0;for(let S=l.length-1;S>=0;S--)l[S].index+=y,this.lines.onInsertEmitter.fire(l[S]),y+=l[S].amount;let b=Math.max(0,h+a-this.lines.maxLength);b>0&&this.lines.onTrimEmitter.fire(b)}}translateBufferLineToString(e,t,n=0,i){let s=this.lines.get(e);return s?s.translateToString(t,n,i):""}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new kq(e);return this.markers.push(t),t.register(this.lines.onTrim(n=>{t.line-=n,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(n=>{t.line>=n.index&&(t.line+=n.amount)})),t.register(this.lines.onDelete(n=>{t.line>=n.index&&t.line<n.index+n.amount&&t.dispose(),t.line>n.index&&(t.line-=n.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},Tq=class extends Ve{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new ge),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 WE(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new WE(!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(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),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(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},zD=2,HD=1,Tv=class extends Ve{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new ge),this.onResize=this._onResize.event,this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,zD),this.rows=Math.max(e.rawOptions.rows||0,HD),this.buffers=this._register(new Tq(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,i=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:i})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,i;i=this._cachedBlankLine,(!i||i.length!==this.cols||i.getFg(0)!==e.fg||i.getBg(0)!==e.bg)&&(i=n.getBlankLine(e,t),this._cachedBlankLine=i),i.isWrapped=t;let s=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let l=n.lines.isFull;a===n.lines.length-1?l?n.lines.recycle().copyFrom(i):n.lines.push(i.clone()):n.lines.splice(a+1,0,i.clone()),l?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let l=a-s+1;n.lines.shiftElements(s+1,l-1,-1),n.lines.set(a,i.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let i=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),i!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};Tv=xt([_e(0,Sn)],Tv);var ca={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:Ld,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},Aq=["normal","bold","100","200","300","400","500","600","700","800","900"],Rq=class extends Ve{constructor(e){super(),this._onOptionChange=this._register(new ge),this.onOptionChange=this._onOptionChange.event;let t={...ca};for(let n in e)if(n in t)try{let i=e[n];t[n]=this._sanitizeAndValidateOption(n,i)}catch(i){console.error(i)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(pt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=n=>{if(!(n in ca))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,i)=>{if(!(n in ca))throw new Error(`No option with key "${n}"`);i=this._sanitizeAndValidateOption(n,i),this.rawOptions[n]!==i&&(this.rawOptions[n]=i,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let i={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,i)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=ca[e]),!Mq(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=ca[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=Aq.includes(t)?t:ca[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function Mq(e){return e==="block"||e==="underline"||e==="bar"}function nc(e,t=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let i in e)n[i]=t<=1?e[i]:e[i]&&nc(e[i],t-1);return n}var GE=Object.freeze({insertMode:!1}),qE=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Av=class extends Ve{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new ge),this.onData=this._onData.event,this._onUserInput=this._register(new ge),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new ge),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new ge),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=nc(GE),this.decPrivateModes=nc(qE)}reset(){this.modes=nc(GE),this.decPrivateModes=nc(qE)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(i=>i.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};Av=xt([_e(0,bn),_e(1,oD),_e(2,Sn)],Av);var KE={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Ug(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var Fg=String.fromCharCode,YE={DEFAULT:e=>{let t=[Ug(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Fg(t[0])}${Fg(t[1])}${Fg(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Ug(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Ug(e,!0)};${e.x};${e.y}${t}`}},Rv=class extends Ve{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new ge),this.onProtocolChange=this._onProtocolChange.event;for(let i of Object.keys(KE))this.addProtocol(i,KE[i]);for(let i of Object.keys(YE))this.addEncoding(i,YE[i]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let i=t/n,s=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=i+0,Math.abs(e.deltaY)<50&&(s*=.3),this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};Rv=xt([_e(0,bn),_e(1,vo),_e(2,Sn)],Rv);var $g=[[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]],Dq=[[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]],Ht;function Nq(e,t){let n=0,i=t.length-1,s;if(e<t[0][0]||e>t[i][1])return!1;for(;i>=n;)if(s=n+i>>1,e>t[s][1])n=s+1;else if(e<t[s][0])i=s-1;else return!0;return!1}var Oq=class{constructor(){if(this.version="6",!Ht){Ht=new Uint8Array(65536),Ht.fill(1),Ht[0]=0,Ht.fill(0,1,32),Ht.fill(0,127,160),Ht.fill(2,4352,4448),Ht[9001]=2,Ht[9002]=2,Ht.fill(2,11904,42192),Ht[12351]=1,Ht.fill(2,44032,55204),Ht.fill(2,63744,64256),Ht.fill(2,65040,65050),Ht.fill(2,65072,65136),Ht.fill(2,65280,65377),Ht.fill(2,65504,65511);for(let e=0;e<$g.length;++e)Ht.fill(0,$g[e][0],$g[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Ht[e]:Nq(e,Dq)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),i=n===0&&t!==0;if(i){let s=ro.extractWidth(t);s===0?i=!1:s>n&&(n=s)}return ro.createPropertyValue(0,n,i)}},ro=class ed{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new ge,this.onChange=this._onChange.event;let t=new Oq;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,n,i=!1){return(t&16777215)<<3|(n&3)<<1|(i?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let n=0,i=0,s=t.length;for(let a=0;a<s;++a){let l=t.charCodeAt(a);if(55296<=l&&l<=56319){if(++a>=s)return n+this.wcwidth(l);let d=t.charCodeAt(a);56320<=d&&d<=57343?l=(l-55296)*1024+d-56320+65536:n+=this.wcwidth(d)}let u=this.charProperties(l,i),h=ed.extractWidth(u);ed.extractShouldJoin(u)&&(h-=ed.extractWidth(i)),n+=h,i=u}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},Lq=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function XE(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var Gl=2147483647,Pq=256,VD=class Mv{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>Pq)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(n),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new Mv;if(!t.length)return n;for(let i=Array.isArray(t[0])?1:0;i<t.length;++i){let s=t[i];if(Array.isArray(s))for(let a=0;a<s.length;++a)n.addSubParam(s[a]);else n.addParam(s)}return n}clone(){let t=new Mv(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let n=0;n<this.length;++n){t.push(this.params[n]);let i=this._subParamsIdx[n]>>8,s=this._subParamsIdx[n]&255;s-i>0&&t.push(Array.prototype.slice.call(this._subParams,i,s))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Gl?Gl:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Gl?Gl:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let n=this._subParamsIdx[t]>>8,i=this._subParamsIdx[t]&255;return i-n>0?this._subParams.subarray(n,i):null}getSubParamsAll(){let t={};for(let n=0;n<this.length;++n){let i=this._subParamsIdx[n]>>8,s=this._subParamsIdx[n]&255;s-i>0&&(t[n]=this._subParams.slice(i,s))}return t}addDigit(t){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let i=this._digitIsSub?this._subParams:this.params,s=i[n-1];i[n-1]=~s?Math.min(s*10+t,Gl):t}},ql=[],Bq=class{constructor(){this._state=0,this._active=ql,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let i=n.indexOf(t);i!==-1&&n.splice(i,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=ql}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=ql,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||ql,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,"PUT",pf(e,t,n));else for(let i=this._active.length-1;i>=0;i--)this._active[i].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let i=e[t++];if(i===59){this._state=2,this._start();break}if(i<48||57<i){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+i-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,i=this._active.length-1,s=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,n=t,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;i>=0&&(n=this._active[i].end(e),n!==!0);i--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,n;i--}for(;i>=0;i--)if(n=this._active[i].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,n}this._active=ql,this._id=-1,this._state=0}}},Vn=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=pf(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,t}},Kl=[],Iq=class{constructor(){this._handlers=Object.create(null),this._active=Kl,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Kl}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let i=n.indexOf(t);i!==-1&&n.splice(i,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=Kl,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Kl,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",pf(e,t,n));else for(let i=this._active.length-1;i>=0;i--)this._active[i].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,i=this._active.length-1,s=!1;if(this._stack.paused&&(i=this._stack.loopPosition-1,n=t,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;i>=0&&(n=this._active[i].unhook(e),n!==!0);i--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!1,n;i--}for(;i>=0;i--)if(n=this._active[i].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=i,this._stack.fallThrough=!0,n}this._active=Kl,this._ident=0}},ic=new VD;ic.addParam(0);var ZE=class{constructor(e){this._handler=e,this._data="",this._params=ic,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():ic,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=pf(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(n=>(this._params=ic,this._data="",this._hitLimit=!1,n));return this._params=ic,this._data="",this._hitLimit=!1,t}},jq=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,i){this.table[t<<8|e]=n<<4|i}addMany(e,t,n,i){for(let s=0;s<e.length;s++)this.table[t<<8|e[s]]=n<<4|i}},oi=160,zq=(function(){let e=new jq(4095),t=Array.apply(null,Array(256)).map((u,h)=>h),n=(u,h)=>t.slice(u,h),i=n(32,127),s=n(0,24);s.push(25),s.push.apply(s,n(28,32));let a=n(0,14),l;e.setDefault(1,0),e.addMany(i,0,2,0);for(l in a)e.addMany([24,26,153,154],l,3,0),e.addMany(n(128,144),l,3,0),e.addMany(n(144,152),l,3,0),e.add(156,l,0,0),e.add(27,l,11,1),e.add(157,l,4,8),e.addMany([152,158,159],l,0,7),e.add(155,l,11,3),e.add(144,l,11,9);return e.addMany(s,0,3,0),e.addMany(s,1,3,1),e.add(127,1,0,1),e.addMany(s,8,0,8),e.addMany(s,3,3,3),e.add(127,3,0,3),e.addMany(s,4,3,4),e.add(127,4,0,4),e.addMany(s,6,3,6),e.addMany(s,5,3,5),e.add(127,5,0,5),e.addMany(s,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(i,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(i,7,0,7),e.addMany(s,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(s,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(s,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(s,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(s,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(s,13,13,13),e.addMany(i,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(oi,0,2,0),e.add(oi,8,5,8),e.add(oi,6,0,6),e.add(oi,11,0,11),e.add(oi,13,13,13),e})(),Hq=class extends Ve{constructor(e=zq){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new VD,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,n,i)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,n)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(pt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new Bq),this._dcsParser=this._register(new Iq),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let s=0;s<e.intermediates.length;++s){let a=e.intermediates.charCodeAt(s);if(32>a||a>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=a}}if(e.final.length!==1)throw new Error("final must be a single byte");let i=e.final.charCodeAt(0);if(t[0]>i||i>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=i,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let i=this._escHandlers[n];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let i=this._csiHandlers[n];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}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(e,t,n,i,s){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=i,this._parseStack.chunkPos=s}parse(e,t,n){let i=0,s=0,a=0,l;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,a=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let u=this._parseStack.handlers,h=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&h>-1){for(;h>=0&&(l=u[h](this._params),l!==!0);h--)if(l instanceof Promise)return this._parseStack.handlerPos=h,l}this._parseStack.handlers=[];break;case 4:if(n===!1&&h>-1){for(;h>=0&&(l=u[h](),l!==!0);h--)if(l instanceof Promise)return this._parseStack.handlerPos=h,l}this._parseStack.handlers=[];break;case 6:if(i=e[this._parseStack.chunkPos],l=this._dcsParser.unhook(i!==24&&i!==26,n),l)return l;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(i=e[this._parseStack.chunkPos],l=this._oscParser.end(i!==24&&i!==26,n),l)return l;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let u=a;u<t;++u){switch(i=e[u],s=this._transitions.table[this.currentState<<8|(i<160?i:oi)],s>>4){case 2:for(let _=u+1;;++_){if(_>=t||(i=e[_])<32||i>126&&i<oi){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(i=e[_])<32||i>126&&i<oi){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(i=e[_])<32||i>126&&i<oi){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(i=e[_])<32||i>126&&i<oi){this._printHandler(e,u,_),u=_-1;break}}break;case 3:this._executeHandlers[i]?this._executeHandlers[i]():this._executeHandlerFb(i),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:u,code:i,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let h=this._csiHandlers[this._collect<<8|i],d=h?h.length-1:-1;for(;d>=0&&(l=h[d](this._params),l!==!0);d--)if(l instanceof Promise)return this._preserveStack(3,h,d,s,u),l;d<0&&this._csiHandlerFb(this._collect<<8|i,this._params),this.precedingJoinState=0;break;case 8:do switch(i){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(i-48)}while(++u<t&&(i=e[u])>47&&i<60);u--;break;case 9:this._collect<<=8,this._collect|=i;break;case 10:let p=this._escHandlers[this._collect<<8|i],m=p?p.length-1:-1;for(;m>=0&&(l=p[m](),l!==!0);m--)if(l instanceof Promise)return this._preserveStack(4,p,m,s,u),l;m<0&&this._escHandlerFb(this._collect<<8|i),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|i,this._params);break;case 13:for(let _=u+1;;++_)if(_>=t||(i=e[_])===24||i===26||i===27||i>127&&i<oi){this._dcsParser.put(e,u,_),u=_-1;break}break;case 14:if(l=this._dcsParser.unhook(i!==24&&i!==26),l)return this._preserveStack(6,[],0,s,u),l;i===27&&(s|=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 _=u+1;;_++)if(_>=t||(i=e[_])<32||i>127&&i<oi){this._oscParser.put(e,u,_),u=_-1;break}break;case 6:if(l=this._oscParser.end(i!==24&&i!==26),l)return this._preserveStack(5,[],0,s,u),l;i===27&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=s&15}}},Vq=/^([\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})$/,Uq=/^[\da-f]+$/;function QE(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=Vq.exec(t);if(n){let i=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/i*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/i*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/i*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),Uq.exec(t)&&[3,6,9,12].includes(t.length))){let n=t.length/3,i=[0,0,0];for(let s=0;s<3;++s){let a=parseInt(t.slice(n*s,n*s+n),16);i[s]=n===1?a<<4:n===2?a:n===3?a>>4:a>>8}return i}}function Wg(e,t){let n=e.toString(16),i=n.length<2?"0"+n:n;switch(t){case 4:return n[0];case 8:return i;case 12:return(i+i).slice(0,3);default:return i+i}}function Fq(e,t=16){let[n,i,s]=e;return`rgb:${Wg(n,t)}/${Wg(i,t)}/${Wg(s,t)}`}var $q={"(":0,")":1,"*":2,"+":3,"-":1,".":2},rs=131072,JE=10;function e2(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var t2=5e3,n2=0,Wq=class extends Ve{constructor(e,t,n,i,s,a,l,u,h=new Hq){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=i,this._optionsService=s,this._oscLinkService=a,this._coreMouseService=l,this._unicodeService=u,this._parser=h,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new uW,this._utf8Decoder=new hW,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Ot.clone(),this._eraseAttrDataInternal=Ot.clone(),this._onRequestBell=this._register(new ge),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new ge),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new ge),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new ge),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new ge),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new ge),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new ge),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new ge),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new ge),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new ge),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new ge),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new ge),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 Dv(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(d=>this._activeBuffer=d.activeBuffer)),this._parser.setCsiHandlerFallback((d,p)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(d),params:p.toArray()})}),this._parser.setEscHandlerFallback(d=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(d)})}),this._parser.setExecuteHandlerFallback(d=>{this._logService.debug("Unknown EXECUTE code: ",{code:d})}),this._parser.setOscHandlerFallback((d,p,m)=>{this._logService.debug("Unknown OSC code: ",{identifier:d,action:p,data:m})}),this._parser.setDcsHandlerFallback((d,p,m)=>{p==="HOOK"&&(m=m.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(d),action:p,payload:m})}),this._parser.setPrintHandler((d,p,m)=>this.print(d,p,m)),this._parser.registerCsiHandler({final:"@"},d=>this.insertChars(d)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},d=>this.scrollLeft(d)),this._parser.registerCsiHandler({final:"A"},d=>this.cursorUp(d)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},d=>this.scrollRight(d)),this._parser.registerCsiHandler({final:"B"},d=>this.cursorDown(d)),this._parser.registerCsiHandler({final:"C"},d=>this.cursorForward(d)),this._parser.registerCsiHandler({final:"D"},d=>this.cursorBackward(d)),this._parser.registerCsiHandler({final:"E"},d=>this.cursorNextLine(d)),this._parser.registerCsiHandler({final:"F"},d=>this.cursorPrecedingLine(d)),this._parser.registerCsiHandler({final:"G"},d=>this.cursorCharAbsolute(d)),this._parser.registerCsiHandler({final:"H"},d=>this.cursorPosition(d)),this._parser.registerCsiHandler({final:"I"},d=>this.cursorForwardTab(d)),this._parser.registerCsiHandler({final:"J"},d=>this.eraseInDisplay(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},d=>this.eraseInDisplay(d,!0)),this._parser.registerCsiHandler({final:"K"},d=>this.eraseInLine(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},d=>this.eraseInLine(d,!0)),this._parser.registerCsiHandler({final:"L"},d=>this.insertLines(d)),this._parser.registerCsiHandler({final:"M"},d=>this.deleteLines(d)),this._parser.registerCsiHandler({final:"P"},d=>this.deleteChars(d)),this._parser.registerCsiHandler({final:"S"},d=>this.scrollUp(d)),this._parser.registerCsiHandler({final:"T"},d=>this.scrollDown(d)),this._parser.registerCsiHandler({final:"X"},d=>this.eraseChars(d)),this._parser.registerCsiHandler({final:"Z"},d=>this.cursorBackwardTab(d)),this._parser.registerCsiHandler({final:"`"},d=>this.charPosAbsolute(d)),this._parser.registerCsiHandler({final:"a"},d=>this.hPositionRelative(d)),this._parser.registerCsiHandler({final:"b"},d=>this.repeatPrecedingCharacter(d)),this._parser.registerCsiHandler({final:"c"},d=>this.sendDeviceAttributesPrimary(d)),this._parser.registerCsiHandler({prefix:">",final:"c"},d=>this.sendDeviceAttributesSecondary(d)),this._parser.registerCsiHandler({final:"d"},d=>this.linePosAbsolute(d)),this._parser.registerCsiHandler({final:"e"},d=>this.vPositionRelative(d)),this._parser.registerCsiHandler({final:"f"},d=>this.hVPosition(d)),this._parser.registerCsiHandler({final:"g"},d=>this.tabClear(d)),this._parser.registerCsiHandler({final:"h"},d=>this.setMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"h"},d=>this.setModePrivate(d)),this._parser.registerCsiHandler({final:"l"},d=>this.resetMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"l"},d=>this.resetModePrivate(d)),this._parser.registerCsiHandler({final:"m"},d=>this.charAttributes(d)),this._parser.registerCsiHandler({final:"n"},d=>this.deviceStatus(d)),this._parser.registerCsiHandler({prefix:"?",final:"n"},d=>this.deviceStatusPrivate(d)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},d=>this.softReset(d)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},d=>this.setCursorStyle(d)),this._parser.registerCsiHandler({final:"r"},d=>this.setScrollRegion(d)),this._parser.registerCsiHandler({final:"s"},d=>this.saveCursor(d)),this._parser.registerCsiHandler({final:"t"},d=>this.windowOptions(d)),this._parser.registerCsiHandler({final:"u"},d=>this.restoreCursor(d)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},d=>this.insertColumns(d)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},d=>this.deleteColumns(d)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},d=>this.selectProtected(d)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},d=>this.requestMode(d,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},d=>this.requestMode(d,!1)),this._parser.setExecuteHandler(de.BEL,()=>this.bell()),this._parser.setExecuteHandler(de.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(de.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(de.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(de.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(de.BS,()=>this.backspace()),this._parser.setExecuteHandler(de.HT,()=>this.tab()),this._parser.setExecuteHandler(de.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(de.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Qh.IND,()=>this.index()),this._parser.setExecuteHandler(Qh.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Qh.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Vn(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new Vn(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new Vn(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new Vn(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new Vn(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new Vn(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new Vn(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new Vn(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new Vn(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new Vn(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new Vn(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new Vn(d=>this.restoreCursorColor(d))),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(let d in Ft)this._parser.registerEscHandler({intermediates:"(",final:d},()=>this.selectCharset("("+d)),this._parser.registerEscHandler({intermediates:")",final:d},()=>this.selectCharset(")"+d)),this._parser.registerEscHandler({intermediates:"*",final:d},()=>this.selectCharset("*"+d)),this._parser.registerEscHandler({intermediates:"+",final:d},()=>this.selectCharset("+"+d)),this._parser.registerEscHandler({intermediates:"-",final:d},()=>this.selectCharset("-"+d)),this._parser.registerEscHandler({intermediates:".",final:d},()=>this.selectCharset("."+d)),this._parser.registerEscHandler({intermediates:"/",final:d},()=>this.selectCharset("/"+d));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(d=>(this._logService.error("Parsing error: ",d),d)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new ZE((d,p)=>this.requestStatusString(d,p)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,i){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=i}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),t2))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${t2} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,i=this._activeBuffer.x,s=this._activeBuffer.y,a=0,l=this._parseStack.paused;if(l){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;i=this._parseStack.cursorStartX,s=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>rs&&(a=this._parseStack.position+rs)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,d=>String.fromCharCode(d)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(d=>d.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<rs&&(this._parseBuffer=new Uint32Array(Math.min(e.length,rs))),l||this._dirtyRowTracker.clearRange(),e.length>rs)for(let d=a;d<e.length;d+=rs){let p=d+rs<e.length?d+rs:e.length,m=typeof e=="string"?this._stringDecoder.decode(e.substring(d,p),this._parseBuffer):this._utf8Decoder.decode(e.subarray(d,p),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,m))return this._preserveStack(i,s,m,d),this._logSlowResolvingAsync(n),n}else if(!l){let d=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,d))return this._preserveStack(i,s,d,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==i||this._activeBuffer.y!==s)&&this._onCursorMove.fire();let u=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),h=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);h<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(h,this._bufferService.rows-1),end:Math.min(u,this._bufferService.rows-1)})}print(e,t,n){let i,s,a=this._charsetService.charset,l=this._optionsService.rawOptions.screenReaderMode,u=this._bufferService.cols,h=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,p=this._curAttrData,m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&m.getWidth(this._activeBuffer.x-1)===2&&m.setCellFromCodepoint(this._activeBuffer.x-1,0,1,p);let _=this._parser.precedingJoinState;for(let y=t;y<n;++y){if(i=e[y],i<127&&a){let k=a[String.fromCharCode(i)];k&&(i=k.charCodeAt(0))}let b=this._unicodeService.charProperties(i,_);s=ro.extractWidth(b);let S=ro.extractShouldJoin(b),C=S?ro.extractWidth(_):0;if(_=b,l&&this._onA11yChar.fire(us(i)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+s-C>u){if(h){let k=m,T=this._activeBuffer.x-C;for(this._activeBuffer.x=C,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),m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&m instanceof tc&&m.copyCellsFrom(k,T,0,C,!1);T<u;)k.setCellFromCodepoint(T++,0,1,p)}else if(this._activeBuffer.x=u-1,s===2)continue}if(S&&this._activeBuffer.x){let k=m.getWidth(this._activeBuffer.x-1)?1:2;m.addCodepointToCell(this._activeBuffer.x-k,i,s);for(let T=s-C;--T>=0;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,p);continue}if(d&&(m.insertCells(this._activeBuffer.x,s-C,this._activeBuffer.getNullCell(p)),m.getWidth(u-1)===2&&m.setCellFromCodepoint(u-1,0,1,p)),m.setCellFromCodepoint(this._activeBuffer.x++,i,s,p),s>0)for(;--s;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,p)}this._parser.precedingJoinState=_,this._activeBuffer.x<u&&n-t>0&&m.getWidth(this._activeBuffer.x)===0&&!m.hasContent(this._activeBuffer.x)&&m.setCellFromCodepoint(this._activeBuffer.x,0,1,p),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>e2(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new ZE(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Vn(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,i=!1,s=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),s),i&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+n)?.getTrimmedLength(););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let i=this._activeBuffer.lines.length-this._bufferService.rows;i>0&&(this._activeBuffer.lines.trimStart(i),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-i,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-i,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,i=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-i+1;for(;t--;)this._activeBuffer.lines.splice(s-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,i;for(i=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-i;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)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(e){let t=e.params[0]||1;for(;t--;)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(Ot));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);i.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);i.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);i.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);i.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),i.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,i=ro.extractWidth(t),s=this._activeBuffer.x-i,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(s),l=new Uint32Array(a.length*n),u=0;for(let d=0;d<a.length;){let p=a.codePointAt(d)||0;l[u++]=p,d+=p>65535?2:1}let h=u;for(let d=1;d<n;++d)l.copyWithin(h,0,u),h+=u;return this.print(l,0,h),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(de.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(de.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(de.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(de.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(de.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Qs),this._charsetService.setgCharset(1,Qs),this._charsetService.setgCharset(2,Qs),this._charsetService.setgCharset(3,Qs);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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){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:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){let n;(S=>(S[S.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",S[S.SET=1]="SET",S[S.RESET=2]="RESET",S[S.PERMANENTLY_SET=3]="PERMANENTLY_SET",S[S.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(n||={});let i=this._coreService.decPrivateModes,{activeProtocol:s,activeEncoding:a}=this._coreMouseService,l=this._coreService,{buffers:u,cols:h}=this._bufferService,{active:d,alt:p}=u,m=this._optionsService.rawOptions,_=(S,C)=>(l.triggerDataEvent(`${de.ESC}[${t?"":"?"}${S};${C}$y`),!0),y=S=>S?1:2,b=e.params[0];return t?b===2?_(b,4):b===4?_(b,y(l.modes.insertMode)):b===12?_(b,3):b===20?_(b,y(m.convertEol)):_(b,0):b===1?_(b,y(i.applicationCursorKeys)):b===3?_(b,m.windowOptions.setWinLines?h===80?2:h===132?1:0:0):b===6?_(b,y(i.origin)):b===7?_(b,y(i.wraparound)):b===8?_(b,3):b===9?_(b,y(s==="X10")):b===12?_(b,y(m.cursorBlink)):b===25?_(b,y(!l.isCursorHidden)):b===45?_(b,y(i.reverseWraparound)):b===66?_(b,y(i.applicationKeypad)):b===67?_(b,4):b===1e3?_(b,y(s==="VT200")):b===1002?_(b,y(s==="DRAG")):b===1003?_(b,y(s==="ANY")):b===1004?_(b,y(i.sendFocus)):b===1005?_(b,4):b===1006?_(b,y(a==="SGR")):b===1015?_(b,4):b===1016?_(b,y(a==="SGR_PIXELS")):b===1048?_(b,1):b===47||b===1047||b===1049?_(b,y(d===p)):b===2004?_(b,y(i.bracketedPasteMode)):b===2026?_(b,y(i.synchronizedOutput)):_(b,0)}_updateAttrColor(e,t,n,i,s){return t===2?(e|=50331648,e&=-16777216,e|=Bc.fromColorRGB([n,i,s])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let i=[0,0,-1,0,0,0],s=0,a=0;do{if(i[a+s]=e.params[t+a],e.hasSubParams(t+a)){let l=e.getSubParams(t+a),u=0;do i[1]===5&&(s=1),i[a+u+1+s]=l[u];while(++u<l.length&&u+a+1+s<i.length);break}if(i[1]===5&&a+s>=2||i[1]===2&&a+s>=5)break;i[1]&&(s=1)}while(++a+t<e.length&&a+s<i.length);for(let l=2;l<i.length;++l)i[l]===-1&&(i[l]=0);switch(i[0]){case 38:n.fg=this._updateAttrColor(n.fg,i[1],i[3],i[4],i[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,i[1],i[3],i[4],i[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,i[1],i[3],i[4],i[5])}return a}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=Ot.fg,e.bg=Ot.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,i=this._curAttrData;for(let s=0;s<t;s++)n=e.params[s],n>=30&&n<=37?(i.fg&=-50331904,i.fg|=16777216|n-30):n>=40&&n<=47?(i.bg&=-50331904,i.bg|=16777216|n-40):n>=90&&n<=97?(i.fg&=-50331904,i.fg|=16777216|n-90|8):n>=100&&n<=107?(i.bg&=-50331904,i.bg|=16777216|n-100|8):n===0?this._processSGR0(i):n===1?i.fg|=134217728:n===3?i.bg|=67108864:n===4?(i.fg|=268435456,this._processUnderline(e.hasSubParams(s)?e.getSubParams(s)[0]:1,i)):n===5?i.fg|=536870912:n===7?i.fg|=67108864:n===8?i.fg|=1073741824:n===9?i.fg|=2147483648:n===2?i.bg|=134217728:n===21?this._processUnderline(2,i):n===22?(i.fg&=-134217729,i.bg&=-134217729):n===23?i.bg&=-67108865:n===24?(i.fg&=-268435457,this._processUnderline(0,i)):n===25?i.fg&=-536870913:n===27?i.fg&=-67108865:n===28?i.fg&=-1073741825:n===29?i.fg&=2147483647:n===39?(i.fg&=-67108864,i.fg|=Ot.fg&16777215):n===49?(i.bg&=-67108864,i.bg|=Ot.bg&16777215):n===38||n===48||n===58?s+=this._extractColor(e,s,i):n===53?i.bg|=1073741824:n===55?i.bg&=-1073741825:n===59?(i.extended=i.extended.clone(),i.extended.underlineColor=-1,i.updateExtended()):n===100?(i.fg&=-67108864,i.fg|=Ot.fg&16777215,i.bg&=-67108864,i.bg|=Ot.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${de.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${de.ESC}[${t};${n}R`);break}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${de.ESC}[?${t};${n}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=Ot.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(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let n=t%2===1;this._coreService.decPrivateModes.cursorBlink=n}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!e2(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${de.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>JE&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>JE&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(";");for(;n.length>1;){let i=n.shift(),s=n.shift();if(/^\d+$/.exec(i)){let a=parseInt(i);if(i2(a))if(s==="?")t.push({type:0,index:a});else{let l=QE(s);l&&t.push({type:1,index:a,color:l})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let n=e.slice(0,t).trim(),i=e.slice(t+1);return i?this._createHyperlink(n,i):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),i,s=n.findIndex(a=>a.startsWith("id="));return s!==-1&&(i=n[s].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:i,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(";");for(let i=0;i<n.length&&!(t>=this._specialColors.length);++i,++t)if(n[i]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let s=QE(n[i]);s&&this._onColor.fire([{type:1,index:this._specialColors[t],color:s}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(";");for(let i=0;i<n.length;++i)if(/^\d+$/.exec(n[i])){let s=parseInt(n[i]);i2(s)&&t.push({type:2,index:s})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){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,Qs),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset($q[e[0]],Ft[e[1]]||Qs),!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){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=Ot.clone(),this._eraseAttrDataInternal=Ot.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new hi;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,i=this._activeBuffer.lines.get(n);i&&(i.fill(e),i.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=l=>(this._coreService.triggerDataEvent(`${de.ESC}${l}${de.ESC}\\`),!0),i=this._bufferService.buffer,s=this._optionsService.rawOptions;return n(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${i.scrollTop+1};${i.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[s.cursorStyle]-(s.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Dv=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(n2=e,e=t,t=n2),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Dv=xt([_e(0,bn)],Dv);function i2(e){return 0<=e&&e<256}var Gq=5e7,r2=12,qq=50,Kq=class extends Ve{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new ge),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let i=this._callbacks.shift();i&&i()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>Gq)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let i=this._writeBuffer[this._bufferOffset],s=this._action(i,t);if(s){let l=u=>performance.now()-n>=r2?setTimeout(()=>this._innerWrite(0,u)):this._innerWrite(n,u);s.catch(u=>(queueMicrotask(()=>{throw u}),Promise.resolve(!1))).then(l);return}let a=this._callbacks[this._bufferOffset];if(a&&a(),this._bufferOffset++,this._pendingData-=i.length,performance.now()-n>=r2)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>qq&&(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()}},Nv=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let u=t.addMarker(t.ybase+t.y),h={data:e,id:this._nextId++,lines:[u]};return u.onDispose(()=>this._removeMarkerFromLink(h,u)),this._dataByLinkId.set(h.id,h),h.id}let n=e,i=this._getEntryIdKey(n),s=this._entriesWithId.get(i);if(s)return this.addLineToLink(s.id,t.ybase+t.y),s.id;let a=t.addMarker(t.ybase+t.y),l={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(l,a)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(i=>i.line!==t)){let i=this._bufferService.buffer.addMarker(t);n.lines.push(i),i.onDispose(()=>this._removeMarkerFromLink(n,i))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Nv=xt([_e(0,bn)],Nv);var s2=!1,Yq=class extends Ve{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new La),this._onBinary=this._register(new ge),this.onBinary=this._onBinary.event,this._onData=this._register(new ge),this.onData=this._onData.event,this._onLineFeed=this._register(new ge),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new ge),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new ge),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new ge),this._instantiationService=new yq,this.optionsService=this._register(new Rq(e)),this._instantiationService.setService(Sn,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Tv)),this._instantiationService.setService(bn,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(kv)),this._instantiationService.setService(oD,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Av)),this._instantiationService.setService(vo,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Rv)),this._instantiationService.setService(sD,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(ro)),this._instantiationService.setService(mW,this.unicodeService),this._charsetService=this._instantiationService.createInstance(Lq),this._instantiationService.setService(pW,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Nv),this._instantiationService.setService(aD,this._oscLinkService),this._inputHandler=this._register(new Wq(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(an.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(an.forward(this._bufferService.onResize,this._onResize)),this._register(an.forward(this.coreService.onData,this._onData)),this._register(an.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new Kq((t,n)=>this._inputHandler.parse(t,n))),this._register(an.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new ge),this._onScroll.event(e=>{this._onScrollApi?.fire(e.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(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!s2&&(this._logService.warn("writeSync is unreliable and will be removed soon."),s2=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,zD),t=Math.max(t,HD),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(XE.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(XE(this._bufferService),!1))),this._windowsWrappingHeuristics.value=pt(()=>{for(let t of e)t.dispose()})}}},Xq={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:["'",'"']};function Zq(e,t,n,i){let s={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?s.key=de.ESC+"OA":s.key=de.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?s.key=de.ESC+"OD":s.key=de.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?s.key=de.ESC+"OC":s.key=de.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?s.key=de.ESC+"OB":s.key=de.ESC+"[B");break;case 8:s.key=e.ctrlKey?"\b":de.DEL,e.altKey&&(s.key=de.ESC+s.key);break;case 9:if(e.shiftKey){s.key=de.ESC+"[Z";break}s.key=de.HT,s.cancel=!0;break;case 13:s.key=e.altKey?de.ESC+de.CR:de.CR,s.cancel=!0;break;case 27:s.key=de.ESC,e.altKey&&(s.key=de.ESC+de.ESC),s.cancel=!0;break;case 37:if(e.metaKey)break;a?s.key=de.ESC+"[1;"+(a+1)+"D":t?s.key=de.ESC+"OD":s.key=de.ESC+"[D";break;case 39:if(e.metaKey)break;a?s.key=de.ESC+"[1;"+(a+1)+"C":t?s.key=de.ESC+"OC":s.key=de.ESC+"[C";break;case 38:if(e.metaKey)break;a?s.key=de.ESC+"[1;"+(a+1)+"A":t?s.key=de.ESC+"OA":s.key=de.ESC+"[A";break;case 40:if(e.metaKey)break;a?s.key=de.ESC+"[1;"+(a+1)+"B":t?s.key=de.ESC+"OB":s.key=de.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(s.key=de.ESC+"[2~");break;case 46:a?s.key=de.ESC+"[3;"+(a+1)+"~":s.key=de.ESC+"[3~";break;case 36:a?s.key=de.ESC+"[1;"+(a+1)+"H":t?s.key=de.ESC+"OH":s.key=de.ESC+"[H";break;case 35:a?s.key=de.ESC+"[1;"+(a+1)+"F":t?s.key=de.ESC+"OF":s.key=de.ESC+"[F";break;case 33:e.shiftKey?s.type=2:e.ctrlKey?s.key=de.ESC+"[5;"+(a+1)+"~":s.key=de.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:e.ctrlKey?s.key=de.ESC+"[6;"+(a+1)+"~":s.key=de.ESC+"[6~";break;case 112:a?s.key=de.ESC+"[1;"+(a+1)+"P":s.key=de.ESC+"OP";break;case 113:a?s.key=de.ESC+"[1;"+(a+1)+"Q":s.key=de.ESC+"OQ";break;case 114:a?s.key=de.ESC+"[1;"+(a+1)+"R":s.key=de.ESC+"OR";break;case 115:a?s.key=de.ESC+"[1;"+(a+1)+"S":s.key=de.ESC+"OS";break;case 116:a?s.key=de.ESC+"[15;"+(a+1)+"~":s.key=de.ESC+"[15~";break;case 117:a?s.key=de.ESC+"[17;"+(a+1)+"~":s.key=de.ESC+"[17~";break;case 118:a?s.key=de.ESC+"[18;"+(a+1)+"~":s.key=de.ESC+"[18~";break;case 119:a?s.key=de.ESC+"[19;"+(a+1)+"~":s.key=de.ESC+"[19~";break;case 120:a?s.key=de.ESC+"[20;"+(a+1)+"~":s.key=de.ESC+"[20~";break;case 121:a?s.key=de.ESC+"[21;"+(a+1)+"~":s.key=de.ESC+"[21~";break;case 122:a?s.key=de.ESC+"[23;"+(a+1)+"~":s.key=de.ESC+"[23~";break;case 123:a?s.key=de.ESC+"[24;"+(a+1)+"~":s.key=de.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?s.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?s.key=de.NUL:e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?s.key=de.DEL:e.keyCode===219?s.key=de.ESC:e.keyCode===220?s.key=de.FS:e.keyCode===221&&(s.key=de.GS);else if((!n||i)&&e.altKey&&!e.metaKey){let l=Xq[e.keyCode]?.[e.shiftKey?1:0];if(l)s.key=de.ESC+l;else if(e.keyCode>=65&&e.keyCode<=90){let u=e.ctrlKey?e.keyCode-64:e.keyCode+32,h=String.fromCharCode(u);e.shiftKey&&(h=h.toUpperCase()),s.key=de.ESC+h}else if(e.keyCode===32)s.key=de.ESC+(e.ctrlKey?de.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let u=e.code.slice(3,4);e.shiftKey||(u=u.toLowerCase()),s.key=de.ESC+u,s.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(s.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?s.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(s.key=de.US),e.key==="@"&&(s.key=de.NUL));break}return s}var kt=0,Qq=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Pd,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Pd,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((s,a)=>this._getKey(s)-this._getKey(a)),t=0,n=0,i=new Array(this._array.length+this._insertedValues.length);for(let s=0;s<i.length;s++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(i[s]=e[t],t++):i[s]=this._array[n++];this._array=i,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(kt=this._search(t),kt===-1)||this._getKey(this._array[kt])!==t)return!1;do if(this._array[kt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(kt),!0;while(++kt<this._array.length&&this._getKey(this._array[kt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((s,a)=>s-a),t=0,n=new Array(this._array.length-e.length),i=0;for(let s=0;s<this._array.length;s++)e[t]===s?t++:n[i++]=this._array[s];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(kt=this._search(e),!(kt<0||kt>=this._array.length)&&this._getKey(this._array[kt])===e))do yield this._array[kt];while(++kt<this._array.length&&this._getKey(this._array[kt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(kt=this._search(e),!(kt<0||kt>=this._array.length)&&this._getKey(this._array[kt])===e))do t(this._array[kt]);while(++kt<this._array.length&&this._getKey(this._array[kt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let i=t+n>>1,s=this._getKey(this._array[i]);if(s>e)n=i-1;else if(s<e)t=i+1;else{for(;i>0&&this._getKey(this._array[i-1])===e;)i--;return i}}return t}},Gg=0,o2=0,Jq=class extends Ve{constructor(){super(),this._decorations=new Qq(e=>e?.marker.line),this._onDecorationRegistered=this._register(new ge),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new ge),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(pt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new eK(e);if(t){let n=t.marker.onDispose(()=>t.dispose()),i=t.onDispose(()=>{i.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),n.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let i=0,s=0;for(let a of this._decorations.getKeyIterator(t))i=a.options.x??0,s=i+(a.options.width??1),e>=i&&e<s&&(!n||(a.options.layer??"bottom")===n)&&(yield a)}forEachDecorationAtCell(e,t,n,i){this._decorations.forEachByKey(t,s=>{Gg=s.options.x??0,o2=Gg+(s.options.width??1),e>=Gg&&e<o2&&(!n||(s.options.layer??"bottom")===n)&&i(s)})}},eK=class extends ps{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new ge),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new ge),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=gt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=gt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},tK=1e3,nK=class{constructor(e,t=tK){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let i=performance.now();if(i-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=i,this._innerRefresh();else if(!this._additionalRefreshRequested){let s=i-this._lastRefreshMs,a=this._debounceThresholdMS-s;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},a)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},a2=20,Bd=class extends Ve{constructor(e,t,n,i){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=i,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let s=this._coreBrowserService.mainDocument;this._accessibilityContainer=s.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=s.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let a=0;a<this._terminal.rows;a++)this._rowElements[a]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[a]);if(this._topBoundaryFocusListener=a=>this._handleBoundaryFocus(a,0),this._bottomBoundaryFocusListener=a=>this._handleBoundaryFocus(a,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=s.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new nK(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(a=>this._handleResize(a.rows))),this._register(this._terminal.onRender(a=>this._refreshRows(a.start,a.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(a=>this._handleChar(a))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
227
|
+
`))),this._register(this._terminal.onA11yTab(a=>this._handleTab(a))),this._register(this._terminal.onKey(a=>this._handleKey(a.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Ae(s,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(pt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<a2+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
228
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===a2+1&&(this._liveRegion.textContent+=Q_.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,i=n.lines.length.toString();for(let s=e;s<=t;s++){let a=n.lines.get(n.ydisp+s),l=[],u=a?.translateToString(!0,void 0,void 0,l)||"",h=(n.ydisp+s+1).toString(),d=this._rowElements[s];d&&(u.length===0?(d.textContent=" ",this._rowColumns.set(d,[0,1])):(d.textContent=u,this._rowColumns.set(d,l)),d.setAttribute("aria-posinset",h),d.setAttribute("aria-setsize",i),this._alignRowWidth(d))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let n=e.target,i=this._rowElements[t===0?1:this._rowElements.length-2],s=n.getAttribute("aria-posinset"),a=t===0?"1":`${this._terminal.buffer.lines.length}`;if(s===a||e.relatedTarget!==i)return;let l,u;if(t===0?(l=n,u=this._rowElements.pop(),this._rowContainer.removeChild(u)):(l=this._rowElements.shift(),u=n,this._rowContainer.removeChild(l)),l.removeEventListener("focus",this._topBoundaryFocusListener),u.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let h=this._createAccessibilityTreeNode();this._rowElements.unshift(h),this._rowContainer.insertAdjacentElement("afterbegin",h)}else{let h=this._createAccessibilityTreeNode();this._rowElements.push(h),this._rowContainer.appendChild(h)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let i=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(i)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:i,offset:i.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let s=({node:u,offset:h})=>{let d=u instanceof Text?u.parentNode:u,p=parseInt(d?.getAttribute("aria-posinset"),10)-1;if(isNaN(p))return console.warn("row is invalid. Race condition?"),null;let m=this._rowColumns.get(d);if(!m)return console.warn("columns is null. Race condition?"),null;let _=h<m.length?m[h]:m.slice(-1)[0]+1;return _>=this._terminal.cols&&(++p,_=0),{row:p,column:_}},a=s(t),l=s(n);if(!(!a||!l)){if(a.row>l.row||a.row===l.row&&a.column>=l.column)throw new Error("invalid range");this._terminal.select(a.column,a.row,(l.row-a.row)*this._terminal.cols-a.column+l.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let i=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${i/t})`}};Bd=xt([_e(1,Zy),_e(2,Er),_e(3,kr)],Bd);var Ov=class extends Ve{constructor(e,t,n,i,s){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=i,this._linkProviderService=s,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new ge),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new ge),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(pt(()=>{po(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Ae(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ae(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ae(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ae(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let i=0;i<n.length;i++){let s=n[i];if(s.classList.contains("xterm"))break;if(s.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(i=>{i?.forEach(s=>{s.link.dispose&&s.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[i,s]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(i)&&(n=this._checkLinkProviderResult(i,e,n)):s.provideLinks(e.y,a=>{if(this._isMouseOut)return;let l=a?.map(u=>({link:u}));this._activeProviderReplies?.set(i,l),n=this._checkLinkProviderResult(i,e,n),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let i=0;i<t.size;i++){let s=t.get(i);if(s)for(let a=0;a<s.length;a++){let l=s[a],u=l.link.range.start.y<e?0:l.link.range.start.x,h=l.link.range.end.y>e?this._bufferService.cols:l.link.range.end.x;for(let d=u;d<=h;d++){if(n.has(d)){s.splice(a--,1);break}n.add(d)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let i=this._activeProviderReplies.get(e),s=!1;for(let a=0;a<e;a++)(!this._activeProviderReplies.has(a)||this._activeProviderReplies.get(a))&&(s=!0);if(!s&&i){let a=i.find(l=>this._linkAtPosition(l.link,t));a&&(n=!0,this._handleNewLink(a))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let a=0;a<this._activeProviderReplies.size;a++){let l=this._activeProviderReplies.get(a)?.find(u=>this._linkAtPosition(u.link,t));if(l){n=!0,this._handleNewLink(l);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&iK(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,po(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:n=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:n=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;let i=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,s=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=s&&(this._clearCurrentLink(i,s),this._lastMouseEvent)){let a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._askForLink(a,!1)}})))}_linkHover(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,i=this._bufferService.buffer.ydisp,s=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-i-1,n.end.x,n.end.y-i-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(s)}_linkLeave(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,i=e.range.end.y*this._bufferService.cols+e.range.end.x,s=t.y*this._bufferService.cols+t.x;return n<=s&&s<=i}_positionFromMouseEvent(e,t,n){let i=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,i,s){return{x1:e,y1:t,x2:n,y2:i,cols:this._bufferService.cols,fg:s}}};Ov=xt([_e(1,Qy),_e(2,kr),_e(3,bn),_e(4,cD)],Ov);function iK(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var rK=class extends Yq{constructor(e={}){super(e),this._linkifier=this._register(new La),this.browser=AD,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new La),this._onCursorMove=this._register(new ge),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new ge),this.onKey=this._onKey.event,this._onRender=this._register(new ge),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new ge),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new ge),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new ge),this.onBell=this._onBell.event,this._onFocus=this._register(new ge),this._onBlur=this._register(new ge),this._onA11yCharEmitter=this._register(new ge),this._onA11yTabEmitter=this._register(new ge),this._onWillOpen=this._register(new ge),this._setup(),this._decorationService=this._instantiationService.createInstance(Jq),this._instantiationService.setService(Ic,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(qG),this._instantiationService.setService(cD,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(ev)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??0,t?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(an.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(an.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(an.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(an.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(pt(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}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}_handleColorEvent(e){if(this._themeService)for(let t of e){let n,i="";switch(t.index){case 256:n="foreground",i="10";break;case 257:n="background",i="11";break;case 258:n="cursor",i="12";break;default:n="ansi",i="4;"+t.index}switch(t.type){case 0:let s=ht.toColorRGB(n==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${de.ESC}]${i};${Fq(s)}${kD.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(a=>a.ansi[t.index]=Pt.toColor(...t.color));else{let a=n;this._themeService.modifyColors(l=>l[a]=Pt.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Bd,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(de.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(de.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),i=this._renderService.dimensions.css.cell.height,s=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*s,l=this.buffer.y*this._renderService.dimensions.css.cell.height,u=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=u+"px",this.textarea.style.top=l+"px",this.textarea.style.width=a+"px",this.textarea.style.height=i+"px",this.textarea.style.lineHeight=i+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ae(this.element,"copy",t=>{this.hasSelection()&&lW(t,this._selectionService)}));let e=t=>cW(t,this.textarea,this.coreService,this.optionsService);this._register(Ae(this.textarea,"paste",e)),this._register(Ae(this.element,"paste",e)),RD?this._register(Ae(this.element,"mousedown",t=>{t.button===2&&_E(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ae(this.element,"contextmenu",t=>{_E(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),o0&&this._register(Ae(this.element,"auxclick",t=>{t.button===1&&eD(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ae(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ae(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ae(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ae(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ae(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ae(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ae(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.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"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Ae(this.screenElement,"mousemove",s=>this.updateCursorStyle(s))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Z_.get()),ND||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._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(WG,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Er,this._coreBrowserService),this._register(Ae(this.textarea,"focus",s=>this._handleTextAreaFocus(s))),this._register(Ae(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Sv,this._document,this._helperContainer),this._instantiationService.setService(mf,this._charSizeService),this._themeService=this._instantiationService.createInstance(Ev),this._instantiationService.setService($a,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Od),this._instantiationService.setService(lD,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(xv,this.rows,this.screenElement)),this._instantiationService.setService(kr,this._renderService),this._register(this._renderService.onRenderedViewportChange(s=>this._onRender.fire(s))),this.onResize(s=>this._renderService.resize(s.cols,s.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(vv,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(wv),this._instantiationService.setService(Qy,this._mouseService);let i=this._linkifier.value=this._register(this._instantiationService.createInstance(Ov,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance(gv,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(s=>{super.scrollLines(s,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Cv,this.element,this.screenElement,i)),this._instantiationService.setService(_W,this._selectionService),this._register(this._selectionService.onRequestScrollLines(s=>this.scrollLines(s.amount,s.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(s=>this._renderService.handleSelectionChanged(s.start,s.end,s.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(s=>{this.textarea.value=s,this.textarea.focus(),this.textarea.select()})),this._register(an.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(_v,this.screenElement)),this._register(Ae(this.element,"mousedown",s=>this._selectionService.handleMouseDown(s))),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(Bd,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",s=>this._handleScreenReaderModeOptionChange(s))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Nd,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",s=>{!this._overviewRulerRenderer&&s&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Nd,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(bv,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(a){let l=e._mouseService.getMouseReportCoords(a,e.screenElement);if(!l)return!1;let u,h;switch(a.overrideType||a.type){case"mousemove":h=32,a.buttons===void 0?(u=3,a.button!==void 0&&(u=a.button<3?a.button:3)):u=a.buttons&1?0:a.buttons&4?1:a.buttons&2?2:3;break;case"mouseup":h=0,u=a.button<3?a.button:3;break;case"mousedown":h=1,u=a.button<3?a.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(a)===!1)return!1;let d=a.deltaY;if(d===0||e.coreMouseService.consumeWheelEvent(a,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;h=d<0?0:1,u=4;break;default:return!1}return h===void 0||u===void 0||u>4?!1:e.coreMouseService.triggerMouseEvent({col:l.col,row:l.row,x:l.x,y:l.y,button:u,action:h,ctrl:a.ctrlKey,alt:a.altKey,shift:a.shiftKey})}let i={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s={mouseup:a=>(n(a),a.buttons||(this._document.removeEventListener("mouseup",i.mouseup),i.mousedrag&&this._document.removeEventListener("mousemove",i.mousedrag)),this.cancel(a)),wheel:a=>(n(a),this.cancel(a,!0)),mousedrag:a=>{a.buttons&&n(a)},mousemove:a=>{a.buttons||n(a)}};this._register(this.coreMouseService.onProtocolChange(a=>{a?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(a)),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()),a&8?i.mousemove||(t.addEventListener("mousemove",s.mousemove),i.mousemove=s.mousemove):(t.removeEventListener("mousemove",i.mousemove),i.mousemove=null),a&16?i.wheel||(t.addEventListener("wheel",s.wheel,{passive:!1}),i.wheel=s.wheel):(t.removeEventListener("wheel",i.wheel),i.wheel=null),a&2?i.mouseup||(i.mouseup=s.mouseup):(this._document.removeEventListener("mouseup",i.mouseup),i.mouseup=null),a&4?i.mousedrag||(i.mousedrag=s.mousedrag):(this._document.removeEventListener("mousemove",i.mousedrag),i.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ae(t,"mousedown",a=>{if(a.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(a)))return n(a),i.mouseup&&this._document.addEventListener("mouseup",i.mouseup),i.mousedrag&&this._document.addEventListener("mousemove",i.mousedrag),this.cancel(a)})),this._register(Ae(t,"wheel",a=>{if(!i.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(a)===!1)return!1;if(!this.buffer.hasScrollback){if(a.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(a,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(a,!0);let l=de.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(a.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(l,!0),this.cancel(a,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?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(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){JM(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=Zq(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let i=this.rows-1;return this.scrollLines(n.type===2?-i:i),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===de.ETX||n.key===de.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(sK(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(Ot));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(de.ESC+"[I"):this.coreService.triggerDataEvent(de.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${de.ESC}[4;${n};${t}t`);break;case 1:let i=this._renderService.dimensions.css.cell.width.toFixed(0),s=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${de.ESC}[6;${s};${i}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function sK(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var oK=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},aK=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new hi)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},l2=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,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(e){let t=this._buffer.lines.get(e);if(t)return new aK(t)}getNullCell(){return new hi}},lK=class extends Ve{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new ge),this.onBufferChange=this._onBufferChange.event,this._normal=new l2(this._core.buffers.normal,"normal"),this._alternate=new l2(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)}},cK=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,n=>t(n.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(n,i)=>t(n,i.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},uK=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},hK=["cols","rows"],Ni=0,dK=class extends Ve{constructor(e){super(),this._core=this._register(new rK(e)),this._addonManager=this._register(new oK),this._publicOptions={...this._core.options};let t=i=>this._core.options[i],n=(i,s)=>{this._checkReadonlyOptions(i),this._core.options[i]=s};for(let i in this._core.options){let s={get:t.bind(this,i),set:n.bind(this,i)};Object.defineProperty(this._publicOptions,i,s)}}_checkReadonlyOptions(e){if(hK.includes(e))throw new Error(`Option "${e}" 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 cK(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new uK(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 lK(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
229
|
+
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Z_.get()},set promptLabel(e){Z_.set(e)},get tooMuchOutput(){return Q_.get()},set tooMuchOutput(e){Q_.set(e)}}}_verifyIntegers(...e){for(Ni of e)if(Ni===1/0||isNaN(Ni)||Ni%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(Ni of e)if(Ni&&(Ni===1/0||isNaN(Ni)||Ni%1!==0||Ni<0))throw new Error("This API only accepts positive integers")}};var fK=2,pK=1,mK=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(n.getPropertyValue("height")),s=Math.max(0,parseInt(n.getPropertyValue("width"))),a=window.getComputedStyle(this._terminal.element),l={top:parseInt(a.getPropertyValue("padding-top")),bottom:parseInt(a.getPropertyValue("padding-bottom")),right:parseInt(a.getPropertyValue("padding-right")),left:parseInt(a.getPropertyValue("padding-left"))},u=l.top+l.bottom,h=l.right+l.left,d=i-u,p=s-h-t;return{cols:Math.max(fK,Math.floor(p/e.css.cell.width)),rows:Math.max(pK,Math.floor(d/e.css.cell.height))}}};const gK=x.forwardRef(function({visible:t},n){const i=x.useRef(null),s=x.useRef(null),a=x.useRef(null),l=x.useRef(null),u=x.useRef(!1),h=x.useRef(!1),d=x.useCallback(()=>{const _=window.location.protocol==="https:"?"wss:":"ws:",y=new WebSocket(`${_}//${window.location.host}/ws/terminal`);l.current=y,h.current=!1,y.onopen=()=>{const b=s.current,S=a.current;b&&S&&(S.fit(),y.send(JSON.stringify({type:"resize",cols:b.cols,rows:b.rows})))},y.onmessage=b=>{const S=b.data;try{const C=JSON.parse(S);if(C.type==="exit"){h.current=!0,s.current?.writeln(`\r
|
|
230
|
+
\x1B[90mProcess exited (code ${C.code}). Press any key to restart.\x1B[0m`);return}}catch{}s.current?.write(S)},y.onclose=()=>{h.current||(s.current?.writeln(`\r
|
|
231
|
+
\x1B[90mDisconnected. Reconnecting...\x1B[0m`),setTimeout(d,2e3))},y.onerror=()=>{y.close()}},[]),p=x.useCallback(()=>{h.current=!0,l.current?.close(),l.current=null;const _=s.current;_&&(_.clear(),_.reset()),setTimeout(()=>d(),0)},[d]),m=x.useCallback(_=>{const y=s.current,b=a.current;y&&(y.options.fontFamily=_||'Menlo, Monaco, "Courier New", monospace',b&&b.fit())},[]);return x.useImperativeHandle(n,()=>({resetSession:p,setFontFamily:m}),[p,m]),x.useEffect(()=>{if(u.current||!i.current)return;u.current=!0;const _=localStorage.getItem("beads-board-terminal-font-family"),y=new dK({cursorBlink:!0,fontSize:13,fontFamily:_||'Menlo, Monaco, "Courier New", monospace',theme:{background:"#0d1117",foreground:"#e6edf3",cursor:"#e6edf3",selectionBackground:"#264f78",black:"#484f58",red:"#ff7b72",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#bc8cff",cyan:"#39d353",white:"#b1bac4",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#79c0ff",brightMagenta:"#d2a8ff",brightCyan:"#56d364",brightWhite:"#f0f6fc"}}),b=new mK;return y.loadAddon(b),y.open(i.current),b.fit(),s.current=y,a.current=b,y.onData(S=>{if(h.current){h.current=!1,y.clear(),l.current?.close(),d();return}const C=l.current;C&&C.readyState===WebSocket.OPEN&&C.send(S)}),d(),()=>{l.current?.close(),y.dispose()}},[d]),x.useEffect(()=>{if(!t||!i.current)return;const _=a.current;if(!_)return;const y=setTimeout(()=>{_.fit();const S=s.current,C=l.current;S&&C&&C.readyState===WebSocket.OPEN&&C.send(JSON.stringify({type:"resize",cols:S.cols,rows:S.rows}))},50),b=new ResizeObserver(()=>{_.fit();const S=s.current,C=l.current;S&&C&&C.readyState===WebSocket.OPEN&&C.send(JSON.stringify({type:"resize",cols:S.cols,rows:S.rows}))});return b.observe(i.current),()=>{clearTimeout(y),b.disconnect()}},[t]),w.jsx("div",{ref:i,className:"h-full w-full",style:{display:t?"block":"none"}})});function _K({...e}){return w.jsx(X3,{"data-slot":"dialog",...e})}function vK({...e}){return w.jsx(Z3,{"data-slot":"dialog-portal",...e})}function yK({className:e,...t}){return w.jsx(Q3,{"data-slot":"dialog-overlay",className:lt("fixed inset-0 z-50 bg-black/60 backdrop-blur-[2px] data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function bK({className:e,children:t,showCloseButton:n=!0,...i}){return w.jsxs(vK,{"data-slot":"dialog-portal",children:[w.jsx(yK,{}),w.jsxs(J3,{"data-slot":"dialog-content",className:lt("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border border-border bg-card text-card-foreground p-6 shadow-2xl duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...i,children:[t,n&&w.jsxs(Y2,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[w.jsx(sy,{}),w.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function SK({className:e,...t}){return w.jsx("div",{"data-slot":"dialog-header",className:lt("flex flex-col gap-2 text-center sm:text-left",e),...t})}function wK({className:e,showCloseButton:t=!1,children:n,...i}){return w.jsxs("div",{"data-slot":"dialog-footer",className:lt("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...i,children:[n,t&&w.jsx(Y2,{asChild:!0,children:w.jsx("button",{className:"inline-flex items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground",children:"Close"})})]})}function xK({className:e,...t}){return w.jsx(e5,{"data-slot":"dialog-title",className:lt("text-lg leading-none font-semibold",e),...t})}function CK({className:e,...t}){return w.jsx(t5,{"data-slot":"dialog-description",className:lt("text-sm text-muted-foreground",e),...t})}const EK=oy("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function c2({className:e,variant:t="default",size:n="default",asChild:i=!1,...s}){const a=i?g2:"button";return w.jsx(a,{"data-slot":"button","data-variant":t,"data-size":n,className:lt(EK({variant:t,size:n,className:e})),...s})}function kK({className:e,type:t,...n}){return w.jsx("input",{type:t,"data-slot":"input",className:lt("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...n})}function TK({className:e,...t}){return w.jsx(RP,{"data-slot":"label",className:lt("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const u2="beads-board-terminal-font-family",AK='Menlo, Monaco, "Courier New", monospace';function RK({open:e,onClose:t,onSave:n}){const[i,s]=x.useState("");x.useEffect(()=>{e&&s(localStorage.getItem(u2)||"")},[e]);const a=()=>{localStorage.setItem(u2,i),n({fontFamily:i}),t()},l=()=>{t()};return w.jsx(_K,{open:e,onOpenChange:u=>{u||t()},children:w.jsxs(bK,{className:"sm:max-w-[480px]",children:[w.jsxs(SK,{children:[w.jsx(xK,{children:"Settings"}),w.jsx(CK,{className:"sr-only",children:"Configure application settings"})]}),w.jsx("div",{className:"space-y-4 py-2",children:w.jsxs("div",{children:[w.jsx("h3",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Terminal"}),w.jsxs("div",{className:"space-y-2",children:[w.jsx(TK,{htmlFor:"font-family",children:"Font Family"}),w.jsx(kK,{id:"font-family",value:i,onChange:u=>s(u.target.value),placeholder:AK})]})]})}),w.jsxs(wK,{children:[w.jsx(c2,{variant:"outline",onClick:l,children:"Cancel"}),w.jsx(c2,{className:"bg-primary/80 text-primary-foreground hover:bg-primary",onClick:a,children:"Save"})]})]})})}const h2=40;function MK(){const{data:e,loading:t,lastUpdated:n,error:i}=_6(),{data:s,loading:a}=v6(),{data:l,loading:u}=y6(),{data:h}=C6(),d=h?.name||"beads-board",p=t||a||u,m=!p&&i?i:null,[_,y]=x.useState(null),[b,S]=x.useState(null),[C,k]=x.useState(!1),[T,R]=x.useState({priority:"all",type:"all",assignee:"all",search:""}),[A,N]=x.useState(null),V=x.useRef(null),H=x.useRef(null),[z,J]=x.useState(()=>localStorage.getItem("beads-board-terminal-open")==="true"),[$,K]=x.useState(()=>{const Ce=localStorage.getItem("beads-board-terminal-height");return Ce?Number(Ce):300}),[I,P]=x.useState(!1),[B,W]=x.useState(""),M=x.useRef(null),U=Og(e||[],T),j=Og(s||[],T),ee=Og(l||[],T),X=x.useCallback((Ce,De)=>{S(De||null),y(Ce),N(Ce),V.current&&clearTimeout(V.current),V.current=setTimeout(()=>N(null),4e3),requestAnimationFrame(()=>{const vt=document.querySelector(`[data-commit-beads~="${Ce}"]`);vt&&vt.scrollIntoView({behavior:"smooth",block:"center"})})},[]),L=x.useCallback(Ce=>{N(null),V.current&&clearTimeout(V.current);const De=document.querySelector(`[data-bead-id="${Ce}"]`);De&&(De.scrollIntoView({behavior:"smooth",block:"center"}),De.classList.remove("animate-bead-highlight"),De.offsetWidth,De.classList.add("animate-bead-highlight"),setTimeout(()=>De.classList.remove("animate-bead-highlight"),1200)),S(null),y(Ce)},[]),Z=x.useRef(null),[ie,F]=x.useState(()=>{const Ce=localStorage.getItem("beads-board-split");return Ce?Number(Ce):65}),[O,G]=x.useState(()=>localStorage.getItem("beads-board-git-collapsed")==="true"),q=x.useRef(null),ne=x.useRef(null),re=x.useRef(0),fe=x.useCallback(()=>{G(Ce=>{const De=!Ce;return localStorage.setItem("beads-board-git-collapsed",String(De)),De})},[]),pe=x.useCallback(Ce=>{Ce.preventDefault();const De=Z.current,vt=q.current,cn=ne.current;if(!De||!vt||!cn)return;O&&(G(!1),localStorage.setItem("beads-board-git-collapsed","false")),vt.style.transition="none",cn.style.transition="none";const Gi=ki=>{cancelAnimationFrame(re.current),re.current=requestAnimationFrame(()=>{const Cs=De.getBoundingClientRect(),vf=(ki.clientX-Cs.left)/Cs.width*100,Jt=Math.min(85,Math.max(30,vf));vt.style.width=`${Jt}%`,cn.style.width=`${100-Jt}%`,Pe.current=Jt})},Tr=()=>{cancelAnimationFrame(re.current),document.removeEventListener("mousemove",Gi),document.removeEventListener("mouseup",Tr),vt.style.transition="",cn.style.transition="",document.body.style.cursor="",document.body.style.userSelect="";const ki=Pe.current;F(ki),localStorage.setItem("beads-board-split",String(ki))};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",Gi),document.addEventListener("mouseup",Tr)},[O]),xe=x.useCallback(Ce=>{W(Ce),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{R(De=>({...De,search:Ce}))},200)},[]),Ee=x.useCallback(Ce=>{H.current?.setFontFamily(Ce.fontFamily)},[]),Pe=x.useRef(ie);return Pe.current=ie,x.useEffect(()=>{document.title=d},[d]),x.useEffect(()=>{const Ce=De=>{De.key==="`"&&(De.ctrlKey||De.metaKey)&&(De.preventDefault(),J(vt=>{const cn=!vt;return localStorage.setItem("beads-board-terminal-open",String(cn)),cn})),De.key===","&&(De.ctrlKey||De.metaKey)&&(De.preventDefault(),P(vt=>!vt))};return window.addEventListener("keydown",Ce),()=>window.removeEventListener("keydown",Ce)},[]),w.jsxs("div",{className:"h-screen flex flex-col bg-background text-foreground overflow-hidden",children:[w.jsxs("header",{className:"flex items-center justify-between px-4 py-2 border-b border-border shrink-0",children:[w.jsx("h1",{className:"text-lg font-bold tracking-tight",children:d}),w.jsxs("div",{className:"flex items-center gap-3",children:[n&&w.jsxs("span",{className:"text-xs text-muted-foreground",children:["Updated ",n.toLocaleTimeString()]}),p&&w.jsx("span",{className:"text-xs text-muted-foreground animate-pulse",children:"refreshing..."}),w.jsx("button",{onClick:()=>k(Ce=>!Ce),className:`rounded-md p-2 transition-colors ${C?"bg-primary/15 text-primary hover:bg-primary/25":"hover:bg-muted text-muted-foreground hover:text-foreground"}`,title:C?"Show kanban board":"Show dependency graph",children:w.jsx(OI,{className:"h-4 w-4"})}),w.jsx("button",{onClick:()=>J(Ce=>{const De=!Ce;return localStorage.setItem("beads-board-terminal-open",String(De)),De}),className:`rounded-md p-2 transition-colors ${z?"bg-primary/15 text-primary hover:bg-primary/25":"hover:bg-muted text-muted-foreground hover:text-foreground"}`,title:z?"Hide terminal (Ctrl+`)":"Show terminal (Ctrl+`)",children:w.jsx(qI,{className:"h-4 w-4"})}),w.jsx("button",{onClick:()=>P(!0),className:`rounded-md p-2 transition-colors ${I?"bg-primary/15 text-primary hover:bg-primary/25":"hover:bg-muted text-muted-foreground hover:text-foreground"}`,title:"Settings (Ctrl+,)",children:w.jsx(WI,{className:"h-4 w-4"})}),w.jsx(vV,{})]})]}),m&&w.jsxs("div",{className:"bg-destructive/10 text-destructive px-4 py-2 text-sm border-b border-destructive/20",children:[m," — showing last known data"]}),!C&&w.jsx(iW,{filters:T,onFiltersChange:Ce=>{R(Ce),W(Ce.search)},issues:e||[],searchInput:B,onSearchChange:xe}),C?w.jsx("main",{className:"flex-1 min-h-0",children:w.jsx(eW,{issues:e||[],onNodeClick:Ce=>{S(null),y(Ce)}})}):w.jsx("main",{className:"flex flex-1 min-h-0",children:w.jsxs("div",{ref:Z,className:"flex flex-1 min-w-0",children:[w.jsxs("div",{ref:q,style:O?{width:`calc(100% - ${h2}px - 4px)`}:{width:`${ie}%`},className:"flex flex-col overflow-hidden transition-[width] duration-200",children:[w.jsx("div",{className:"flex-1 min-h-0 pl-3 pt-3 pb-3 pr-0 overflow-hidden",children:w.jsx(o6,{issues:U,allIssues:e||[],ready:j,blocked:ee,loading:p,onIssueClick:X})}),z&&w.jsx("div",{className:"h-1 cursor-row-resize hover:bg-border active:bg-primary/50 shrink-0 transition-colors border-t border-border",onMouseDown:Ce=>{Ce.preventDefault();const De=Ce.clientY,vt=$,cn=Tr=>{const ki=De-Tr.clientY,Cs=Math.max(100,Math.min(vt+ki,window.innerHeight*.7));K(Cs),localStorage.setItem("beads-board-terminal-height",String(Cs))},Gi=()=>{document.removeEventListener("mousemove",cn),document.removeEventListener("mouseup",Gi),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",cn),document.addEventListener("mouseup",Gi)}}),w.jsxs("div",{style:{height:z?`${$}px`:"0px"},className:"shrink-0 overflow-hidden flex flex-col",children:[z&&w.jsxs("div",{className:"flex items-center justify-end gap-1 px-2 py-0.5 bg-[#0d1117] border-b border-border/30 shrink-0",children:[w.jsx("button",{onClick:()=>H.current?.resetSession(),className:"rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",title:"Clear session",children:w.jsx(ZI,{className:"h-3.5 w-3.5"})}),w.jsx("button",{onClick:()=>{J(!1),localStorage.setItem("beads-board-terminal-open","false")},className:"rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",title:"Hide terminal (Ctrl+`)",children:w.jsx(sy,{className:"h-3.5 w-3.5"})})]}),w.jsx(gK,{ref:H,visible:z})]})]}),w.jsx("div",{className:"w-1 cursor-col-resize hover:bg-border active:bg-primary/50 shrink-0 transition-colors",onMouseDown:pe}),O?w.jsx("div",{style:{width:`${h2}px`},className:"flex flex-col items-center border-l border-border shrink-0 transition-[width] duration-200",children:w.jsx("button",{onClick:fe,className:"mt-3 p-1.5 rounded-md hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:"Expand git log",children:w.jsx(zI,{className:"h-4 w-4"})})}):w.jsx("div",{ref:ne,style:{width:`${100-ie}%`},className:"overflow-hidden transition-[width] duration-200",children:w.jsx(gV,{onCollapse:fe,onBeadClick:L,highlightedBeadId:A})})]})}),w.jsx(S$,{issueId:_,open:_!==null,onClose:()=>y(null),sourceRect:b,issues:e??void 0}),w.jsx(RK,{open:I,onClose:()=>P(!1),onSave:Ee})]})}_L.createRoot(document.getElementById("root")).render(w.jsx(x.StrictMode,{children:w.jsx(MK,{})}));
|