@openspecui/web 6.1.0 → 6.2.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/dist/assets/{App-DgFcpbVG.js → App-Ci0AVCw9.js} +5 -5
- package/dist/assets/{main-CFXXYHes.js → main-D2kHBxKP.js} +2 -2
- package/dist/assets/{trpc-0wHaJTCK.js → trpc-DgNoDkR5.js} +1 -1
- package/dist/index.html +1 -1
- package/dist-ssg/client/.vite/ssr-manifest.json +15 -15
- package/dist-ssg/client/assets/CanvasRenderer-CN4gd84j.js +1 -0
- package/dist-ssg/client/assets/WebGLRenderer-0RXUn_3n.js +1 -0
- package/dist-ssg/client/assets/WebGPURenderer-BVW06Qmg.js +1 -0
- package/dist-ssg/client/assets/browserAll-mOF-1Ny9.js +1 -0
- package/dist-ssg/client/assets/{dist-Dyl58tLg.js → dist-B7f6-Rol.js} +1 -1
- package/dist-ssg/client/assets/{dist-B6WxVE_Z.js → dist-BSsvxVRW.js} +1 -1
- package/dist-ssg/client/assets/dist-BxCzTig0.js +1 -0
- package/dist-ssg/client/assets/{dist-KYxOPc4X.js → dist-C3LiPOZ6.js} +1 -1
- package/dist-ssg/client/assets/{dist-DsddpbvF.js → dist-CwLFI0Re.js} +1 -1
- package/dist-ssg/client/assets/{dist-DBsXFR6z.js → dist-CwWFgrFC.js} +1 -1
- package/dist-ssg/client/assets/dist-DLdOez3N.js +1 -0
- package/dist-ssg/client/assets/{dist-TtbuqJoQ.js → dist-DQj654xi.js} +1 -1
- package/dist-ssg/client/assets/{dist-DTl3ne_V.js → dist-DZnzvpQO.js} +1 -1
- package/dist-ssg/client/assets/dist-QjGApPV9.js +1 -0
- package/dist-ssg/client/assets/{dist-_Yb14_mI.js → dist-cBcoxlQq.js} +1 -1
- package/dist-ssg/client/assets/{dist-Cds6OuG6.js → dist-z-6jKlNI.js} +1 -1
- package/dist-ssg/client/assets/{ghostty-web-BfmUhCW_.js → ghostty-web-BjGejWSg.js} +1 -1
- package/dist-ssg/client/assets/{index.ssg-NSWx2O2p.js → index.ssg-BKj5Rqjz.js} +7 -7
- package/dist-ssg/client/assets/{init-caHUJd5Y.js → init-BfXgK1-S.js} +1 -1
- package/dist-ssg/client/assets/trpc-uCyU9d2M.js +1 -0
- package/dist-ssg/client/assets/webworkerAll-DbX2l3iV.js +1 -0
- package/dist-ssg/client/index.ssg.html +1 -1
- package/dist-ssg/server/assets/CanvasRenderer-OcQyQ-ep.js +3 -0
- package/dist-ssg/server/assets/WebGLRenderer-OQIfOG5N.js +3 -0
- package/dist-ssg/server/assets/WebGPURenderer-DBovqNow.js +3 -0
- package/dist-ssg/server/assets/{browserAll-DRJ0cckK.js → browserAll-CDCkfnuc.js} +2 -2
- package/dist-ssg/server/assets/{dist-DX_tjvPv.js → dist-B3woUaqA.js} +1 -1
- package/dist-ssg/server/assets/{dist-3e8sPnvQ.js → dist-BS03unsn.js} +1 -1
- package/dist-ssg/server/assets/{dist-lpSVfRCs.js → dist-BlAVuZ7B.js} +1 -1
- package/dist-ssg/server/assets/dist-C1gegR20.js +3 -0
- package/dist-ssg/server/assets/dist-CV9JFyOc.js +3 -0
- package/dist-ssg/server/assets/{dist-OAroTHXE.js → dist-CbuXRM3V.js} +1 -1
- package/dist-ssg/server/assets/{dist-DHFgyzlF.js → dist-DOoMAwRU.js} +1 -1
- package/dist-ssg/server/assets/{dist-cPmtJaYH.js → dist-Dl8ExaoX.js} +1 -1
- package/dist-ssg/server/assets/{dist-CoG4YOfq.js → dist-Dml8ZIPf.js} +1 -1
- package/dist-ssg/server/assets/dist-NDR4tLYd.js +3 -0
- package/dist-ssg/server/assets/{dist-sy4PcAmj.js → dist-TigCulvd.js} +1 -1
- package/dist-ssg/server/assets/{dist-BPyPgkP0.js → dist-hoQ5krAI.js} +1 -1
- package/dist-ssg/server/assets/{entry-server-BhaKwjkQ.js → entry-server-BElJF_5L.js} +24 -23
- package/dist-ssg/server/assets/{init-BD4e64QK.js → init-DuK_9mfL.js} +1 -1
- package/dist-ssg/server/assets/trpc-DiTz0tl3.js +2 -0
- package/dist-ssg/server/assets/webworkerAll-CVFpliDI.js +4 -0
- package/dist-ssg/server/ssr-entry-manifest.json +23 -23
- package/package.json +3 -3
- package/dist-ssg/client/assets/CanvasRenderer-CstrsgRa.js +0 -1
- package/dist-ssg/client/assets/WebGLRenderer-B4R50RRJ.js +0 -1
- package/dist-ssg/client/assets/WebGPURenderer-CMNhwXcf.js +0 -1
- package/dist-ssg/client/assets/browserAll-DLZU-jU8.js +0 -1
- package/dist-ssg/client/assets/dist-06Jx3YRK.js +0 -1
- package/dist-ssg/client/assets/dist-Cq2Yz-N9.js +0 -1
- package/dist-ssg/client/assets/dist-ypom5mPo.js +0 -1
- package/dist-ssg/client/assets/trpc-Df-EFc1Z.js +0 -1
- package/dist-ssg/client/assets/webworkerAll-CR-7gMME.js +0 -1
- package/dist-ssg/server/assets/CanvasRenderer-CJGKtT2V.js +0 -3
- package/dist-ssg/server/assets/WebGLRenderer-BHnv4CAX.js +0 -3
- package/dist-ssg/server/assets/WebGPURenderer-B4CVxRvW.js +0 -3
- package/dist-ssg/server/assets/dist-BoNNSQ04.js +0 -3
- package/dist-ssg/server/assets/dist-C1g7n1nE.js +0 -3
- package/dist-ssg/server/assets/dist-DB0zxcp6.js +0 -3
- package/dist-ssg/server/assets/trpc-BnLoImus.js +0 -2
- package/dist-ssg/server/assets/webworkerAll-C4Yu5zg7.js +0 -4
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/trpc-
|
|
2
|
-
import{a as e,i as t,n,r,t as i}from"./chunk-VBW0iQ51.js";import{t as a}from"./react-w0ynVMNy.js";import{t as o}from"./react-dom-DGmpTSTt.js";import{t as s}from"./jsx-runtime-B5X0rzej.js";import{t as c}from"./preload-helper-qlgyTAkD.js";import{A as l,B as u,C as d,D as f,E as p,F as m,I as h,L as g,M as _,N as v,O as y,P as b,R as x,S,T as C,V as w,_ as T,b as E,c as D,f as O,g as k,h as A,i as j,j as M,k as N,l as P,m as F,n as I,o as L,p as R,r as z,s as B,t as V,v as ee,w as H,x as te,y as ne,z as re}from"./main-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/trpc-DgNoDkR5.js","assets/chunk-VBW0iQ51.js","assets/jsx-runtime-B5X0rzej.js","assets/react-w0ynVMNy.js","assets/main-D2kHBxKP.js","assets/modulepreload-polyfill-CXK8biUa.js","assets/preload-helper-qlgyTAkD.js","assets/client-pO1cwWkl.js","assets/react-dom-DGmpTSTt.js","assets/browserAll-DpnGZcZ6.js","assets/Geometry-DnX4RiLB.js","assets/FederatedEventTarget-DH40GasF.js","assets/FilterSystem-DGEzd4r7.js","assets/ImageSource-D9b88hVS.js","assets/init-C9T4bNS4.js","assets/webworkerAll-DVvhywpc.js","assets/WebGPURenderer-PzUtbZe0.js","assets/WebGPURenderer-rPgcvLqV.js","assets/RenderTargetSystem-DNBcF83q.js","assets/getTextureBatchBindGroup-BBz5dgEf.js","assets/BufferResource-TFXpqlS4.js","assets/WebGLRenderer-DujEkC4U.js","assets/WebGLRenderer-C7NKu4lr.js","assets/CanvasRenderer-Cquv08SX.js","assets/CanvasRenderer-frZG-e8U.js","assets/ghostty-web-BSS9uGcc.js","assets/dist-DBANUHCV.js","assets/dist-BM1p13VL.js","assets/dist-BjgzTMjG.js","assets/dist-ut4rUQ9T.js","assets/dist-DOslja1j.js","assets/dist-BqFNCcID.js","assets/dist-BElax2Cc.js","assets/dist-B_gB7iV-.js","assets/dist-ChBF8Kxw.js","assets/dist-CdyeiNbL.js","assets/dist-BTEspn1S.js","assets/dist-BTDPzESP.js","assets/dist-DiDQaVUl.js","assets/dist-BPqKJ2jd.js","assets/dist-Cds2ol7_.js","assets/dist-DcxAxgyr.js","assets/dist-DKJ1Q90V.js","assets/dist-H4lUSqHM.js","assets/dist-CUBTZf4H.js","assets/dist-CcJiXGmU.js","assets/dist-B_cOSPGy.js","assets/dockerfile-h2epc4Vl.js","assets/simple-mode-Bhi1lZLR.js","assets/factor-CeOkG9eA.js","assets/nsis-CquHxL-A.js","assets/pug-HlPEUn3L.js","assets/javascript-WdgH9bdJ.js","assets/dist-BfbneuyF.js","assets/dist-CuICAqXS.js","assets/angular-html-EaGg67w-.js","assets/html-B_1hK_C6.js","assets/css-Dc1gxuHE.js","assets/javascript-42uzW-9k.js","assets/angular-ts-Ch5ujYDJ.js","assets/scss-DErQ-q9n.js","assets/apl-BsTI1MgL.js","assets/json-Df6kz_tW.js","assets/xml-CsmvQp5K.js","assets/java-BamxhkWV.js","assets/astro-CW4aHsV1.js","assets/postcss-DFeAuPDm.js","assets/tsx-_a4URhNn.js","assets/typescript-CTlxejIu.js","assets/blade-BMTVXNVa.js","assets/html-derivative-C3wRn33_.js","assets/sql-D3nyyGFw.js","assets/bsl-CT0at82N.js","assets/sdbl-CDtsReAe.js","assets/c-CvFp8_vh.js","assets/cairo-BQK3vvkd.js","assets/python-Bd-SyRCh.js","assets/cobol-DDP5O6At.js","assets/coffee-w-vvbmfR.js","assets/cpp-maXEOUbR.js","assets/glsl-BQ7oP25Y.js","assets/regexp-C_mdE5qh.js","assets/crystal-Daje1etl.js","assets/shellscript-BhoDNWc8.js","assets/edge-Cmw3ms6c.js","assets/elixir-DLLfdAdU.js","assets/elm-qbm_nDoA.js","assets/erb-CXyBVBSU.js","assets/ruby-BwDRzt3-.js","assets/graphql-Cuz3FvD1.js","assets/jsx-DJfNmqFM.js","assets/haml-BYAqN9e2.js","assets/lua-BytP-pXa.js","assets/yaml-CwNn_bUe.js","assets/erlang-C3LeQBYv.js","assets/markdown-C2NdQa1s.js","assets/fortran-fixed-form-CBbbILOk.js","assets/fortran-free-form-CfPabVBP.js","assets/fsharp-D7bpsmxw.js","assets/gdresource-CU-bVyXe.js","assets/gdscript-DlddF44s.js","assets/gdshader-C4SuMVnW.js","assets/git-commit-DDMCszZL.js","assets/diff-Dn6kkMQ8.js","assets/git-rebase-DnBV-Jdd.js","assets/glimmer-js-DZZIz70U.js","assets/glimmer-ts-zjTMyvYA.js","assets/hack-5xlu6a1S.js","assets/handlebars-cvC52nlX.js","assets/http-DEQkV8Xu.js","assets/hurl-C5zNmiJJ.js","assets/csv-DQDSHfxj.js","assets/hxml-k61G-s6T.js","assets/haxe-BX7dHJPc.js","assets/jinja-D77dsJfB.js","assets/jison-frIvnqi7.js","assets/julia-DCwaLw0v.js","assets/r-MgF_uWk3.js","assets/latex-CeNSbJ93.js","assets/tex-B2f-6bPZ.js","assets/liquid-Ds7VUwoG.js","assets/marko-CDjsybka.js","assets/less-B6Q5XzxU.js","assets/mdc-Cp-0xBuf.js","assets/nginx-Zcb-2rM7.js","assets/nim-DX42fVnZ.js","assets/perl-CHTUiVBF.js","assets/php-B4nCmnla.js","assets/pug-Cylx6tZj.js","assets/qml-CyU3AYb_.js","assets/razor-BdKyDmxf.js","assets/csharp-v1IT52Cm.js","assets/rst-B_SeciJo.js","assets/cmake-D9cyu7xI.js","assets/sas-cAgjjTQx.js","assets/shaderlab-Eg2Qf8Qn.js","assets/hlsl-CKs72768.js","assets/shellsession-C6PDany4.js","assets/soy-CnhkrzGt.js","assets/sparql-dvHNG6KX.js","assets/turtle-fIOA9o79.js","assets/stata-BHafLeHQ.js","assets/svelte-Cp1Qqeow.js","assets/templ-DeTZ2yGp.js","assets/go-Dur0j3Bv.js","assets/ts-tags-CiUE0AfB.js","assets/twig-D-r6oRPN.js","assets/vue-BEXq_rm2.js","assets/vue-html-C6ZnjGeH.js","assets/vue-vine-BOrA9MgZ.js","assets/stylus-BPUlgj0k.js","assets/xsl-CpppY2rp.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as e,i as t,n,r,t as i}from"./chunk-VBW0iQ51.js";import{t as a}from"./react-w0ynVMNy.js";import{t as o}from"./react-dom-DGmpTSTt.js";import{t as s}from"./jsx-runtime-B5X0rzej.js";import{t as c}from"./preload-helper-qlgyTAkD.js";import{A as l,B as u,C as d,D as f,E as p,F as m,I as h,L as g,M as _,N as v,O as y,P as b,R as x,S,T as C,V as w,_ as T,b as E,c as D,f as O,g as k,h as A,i as j,j as M,k as N,l as P,m as F,n as I,o as L,p as R,r as z,s as B,t as V,v as ee,w as H,x as te,y as ne,z as re}from"./main-D2kHBxKP.js";import{$ as ie,A as ae,B as oe,Ct as se,Dt as ce,E as le,Et as ue,F as de,G as fe,H as pe,K as me,M as he,O as ge,Ot as _e,P as ve,Q as ye,R as U,S as be,St as xe,T as Se,Tt as Ce,U as we,V as Te,W as Ee,X as De,Y as Oe,Z as ke,a as Ae,at as je,b as Me,bt as Ne,ct as Pe,dt as Fe,et as Ie,f as Le,ft as Re,g as ze,gt as Be,it as Ve,jt as He,k as Ue,kt as We,l as W,lt as Ge,mt as Ke,nt as qe,o as Je,p as Ye,pt as Xe,q as Ze,rt as Qe,st as $e,u as et,ut as tt,vt as nt,wt as rt,xt as it,z as at}from"./dist-BjgzTMjG.js";import"./dist-BElax2Cc.js";import"./dist-DOslja1j.js";import{n as ot}from"./dist-B_gB7iV-.js";import{i as st,n as ct,o as lt,r as ut}from"./dist-BM1p13VL.js";import{n as dt}from"./dist-BTEspn1S.js";import{n as ft,r as pt}from"./dist-BPqKJ2jd.js";import{n as mt}from"./dist-B_cOSPGy.js";import{$ as ht,A as gt,H as _t,J as vt,M as yt,Q as bt,S as xt,T as St,V as Ct,Y as wt,Z as Tt,_ as Et,b as Dt,it as Ot,nt as kt,q as At,rt as jt,tt as Mt,v as Nt,w as Pt,x as Ft,y as It}from"./Geometry-DnX4RiLB.js";import"./FilterSystem-DGEzd4r7.js";import{a as Lt,i as Rt,n as zt,o as Bt,r as Vt,s as Ht}from"./CanvasRenderer-frZG-e8U.js";import{a as Ut,i as Wt,k as Gt,u as Kt}from"./RenderTargetSystem-DNBcF83q.js";import{n as qt}from"./WebGPURenderer-rPgcvLqV.js";import{WS_RETRY_DELAY_MS as Jt,_ as Yt,a as Xt,b as Zt,c as Qt,d as $t,f as en,g as tn,getOrCreateWsClientInstance as nn,h as rn,i as an,l as on,m as sn,n as cn,o as ln,p as un,queryClient as dn,r as eee,s as fn,t as tee,trpc as pn,trpcClient as G,u as mn,v as hn,x as gn,y as nee}from"./trpc-DgNoDkR5.js";var K=s(),_n=e(o(),1),q=e(a(),1),ree=class{constructor(e=0,t=0,n=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=e,this.resetTtl=n,this.size=0,this.ttl=t}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(e){if(this.has(e)){let t=this.items[e];delete this.items[e],this.size--,t.prev!==null&&(t.prev.next=t.next),t.next!==null&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),this.last===t&&(this.last=t.prev)}return this}entries(e=this.keys()){let t=Array(e.length);for(let n=0;n<e.length;n++){let r=e[n];t[n]=[r,this.get(r)]}return t}evict(e=!1){if(e||this.size>0){let e=this.first;delete this.items[e.key],--this.size===0?(this.first=null,this.last=null):(this.first=e.next,this.first.prev=null)}return this}expiresAt(e){let t;return this.has(e)&&(t=this.items[e].expiry),t}get(e){let t=this.items[e];if(t!==void 0){if(this.ttl>0&&t.expiry<=Date.now()){this.delete(e);return}return this.moveToEnd(t),t.value}}has(e){return e in this.items}moveToEnd(e){this.last!==e&&(e.prev!==null&&(e.prev.next=e.next),e.next!==null&&(e.next.prev=e.prev),this.first===e&&(this.first=e.next),e.prev=this.last,e.next=null,this.last!==null&&(this.last.next=e),this.last=e,this.first===null&&(this.first=e))}keys(){let e=Array(this.size),t=this.first,n=0;for(;t!==null;)e[n++]=t.key,t=t.next;return e}setWithEvicted(e,t,n=this.resetTtl){let r=null;if(this.has(e))this.set(e,t,!0,n);else{this.max>0&&this.size===this.max&&(r={...this.first},this.evict(!0));let n=this.items[e]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:t};++this.size===1?this.first=n:this.last.next=n,this.last=n}return r}set(e,t,n=!1,r=this.resetTtl){let i=this.items[e];return n||i!==void 0?(i.value=t,n===!1&&r&&(i.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(i)):(this.max>0&&this.size===this.max&&this.evict(!0),i=this.items[e]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:e,prev:this.last,next:null,value:t},++this.size===1?this.first=i:this.last.next=i,this.last=i),this}values(e=this.keys()){let t=Array(e.length);for(let n=0;n<e.length;n++)t[n]=this.get(e[n]);return t}};function iee(e=1e3,t=0,n=!1){if(isNaN(e)||e<0)throw TypeError(`Invalid max value`);if(isNaN(t)||t<0)throw TypeError(`Invalid ttl value`);if(typeof n!=`boolean`)throw TypeError(`Invalid resetTtl value`);return new ree(e,t,n)}function vn(e){return!!e.tagStyles&&Object.keys(e.tagStyles).length>0}function yn(e){return e.includes(`<`)}function aee(e,t){return e.clone().assign(t)}function oee(e,t){let n=[],r=t.tagStyles;if(!vn(t)||!yn(e))return n.push({text:e,style:t}),n;let i=[t],a=[],o=``,s=0;for(;s<e.length;){let t=e[s];if(t===`<`){let c=e.indexOf(`>`,s);if(c===-1){o+=t,s++;continue}let l=e.slice(s+1,c);if(l.startsWith(`/`)){let t=l.slice(1).trim();if(a.length>0&&a[a.length-1]===t){o.length>0&&(n.push({text:o,style:i[i.length-1]}),o=``),i.pop(),a.pop(),s=c+1;continue}else{o+=e.slice(s,c+1),s=c+1;continue}}else{let t=l.trim();if(r[t]){o.length>0&&(n.push({text:o,style:i[i.length-1]}),o=``);let e=i[i.length-1],l=aee(e,r[t]);i.push(l),a.push(t),s=c+1;continue}else{o+=e.slice(s,c+1),s=c+1;continue}}}else o+=t,s++}return o.length>0&&n.push({text:o,style:i[i.length-1]}),n}var see=new Set([10,13]),cee=new Set([9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]),lee=/(\r\n|\r|\n)/,uee=/(?:\r\n|\r|\n)/;function bn(e){return typeof e==`string`?see.has(e.charCodeAt(0)):!1}function xn(e,t){return typeof e==`string`?cee.has(e.charCodeAt(0)):!1}function Sn(e){return e===`normal`||e===`pre-line`}function Cn(e){return e===`normal`}function wn(e){if(typeof e!=`string`)return``;let t=e.length-1;for(;t>=0&&xn(e[t]);)t--;return t<e.length-1?e.slice(0,t+1):e}function Tn(e){let t=[],n=[];if(typeof e!=`string`)return t;for(let r=0;r<e.length;r++){let i=e[r],a=e[r+1];if(xn(i,a)||bn(i)){n.length>0&&(t.push(n.join(``)),n.length=0),i===`\r`&&a===`
|
|
3
3
|
`?(t.push(`\r
|
|
4
4
|
`),r++):t.push(i);continue}n.push(i)}return n.length>0&&t.push(n.join(``)),t}function En(e,t,n,r){let i=n(e),a=[];for(let n=0;n<i.length;n++){let o=i[n],s=o,c=1;for(;i[n+c];){let a=i[n+c];if(!r(s,a,e,n,t))o+=a,s=a,c++;else break}n+=c-1,a.push(o)}return a}var dee=/\r\n|\r|\n/g;function fee(e,t,n,r,i,a,o,s){let c=oee(e,t);if(Cn(t.whiteSpace))for(let e=0;e<c.length;e++){let t=c[e];c[e]={text:t.text.replace(dee,` `),style:t.style}}let l=[],u=[];for(let e of c){let t=e.text.split(lee);for(let n=0;n<t.length;n++){let r=t[n];r===`\r
|
|
5
5
|
`||r===`\r`||r===`
|
|
6
6
|
`?(l.push(u),u=[]):r.length>0&&u.push({text:r,style:e.style})}}(u.length>0||l.length===0)&&l.push(u);let d=n?pee(l,t,r,i,o,s):l,f=[],p=[],m=[],h=[],g=[],_=0,v=t._fontString,y=a(v);y.fontSize===0&&(y.fontSize=t.fontSize,y.ascent=t.fontSize);let b=``,x=!!t.dropShadow;for(let e of d){let n=0,o=y.ascent,s=y.descent,c=``;for(let t of e){let e=t.style._fontString,l=a(e);e!==b&&(r.font=e,b=e);let u=i(t.text,t.style.letterSpacing,r);n+=u,o=Math.max(o,l.ascent),s=Math.max(s,l.descent),c+=t.text,!x&&t.style.dropShadow&&(x=!0)}e.length===0&&(o=y.ascent,s=y.descent),f.push(n),p.push(o),m.push(s),g.push(c);let l=t.lineHeight||o+s;h.push(l+t.leading),_=Math.max(_,n)}let S=t._stroke?.width||0,C=(n&&t.align!==`left`&&t.align!==`justify`?Math.max(_,t.wordWrapWidth):_)+S+(t.dropShadow?t.dropShadow.distance:0),w=0;for(let e=0;e<h.length;e++)w+=h[e];return w=Math.max(w,h[0]+S),{width:C,height:w+(t.dropShadow?t.dropShadow.distance:0),lines:g,lineWidths:f,lineHeight:(t.lineHeight||y.fontSize)+t.leading,maxLineWidth:_,fontProperties:y,runsByLine:d,lineAscents:p,lineDescents:m,lineHeights:h,hasDropShadow:x}}function pee(e,t,n,r,i,a){let{letterSpacing:o,whiteSpace:s,wordWrapWidth:c,breakWords:l}=t,u=Sn(s),d=c+o,f={},p=``,m=(e,t)=>{let i=`${e}|${t.styleKey}`,a=f[i];if(a===void 0){let o=t._fontString;o!==p&&(n.font=o,p=o),a=r(e,t.letterSpacing,n)+t.letterSpacing,f[i]=a}return a},h=[];for(let t of e){let e=mee(t),n=h.length,r=t=>{let n=0,r=t;do{let{token:t,style:i}=e[r];n+=m(t,i),r++}while(r<e.length&&e[r].continuesFromPrevious);return n},o=t=>{let n=[],r=t;do n.push({token:e[r].token,style:e[r].style}),r++;while(r<e.length&&e[r].continuesFromPrevious);return n},s=[],c=0,f=!u,p=null,g=()=>{p&&p.text.length>0&&s.push(p),p=null},_=()=>{if(g(),s.length>0){let e=s[s.length-1];e.text=wn(e.text),e.text.length===0&&s.pop()}h.push(s),s=[],c=0,f=!1};for(let t=0;t<e.length;t++){let{token:n,style:v,continuesFromPrevious:y}=e[t],b=m(n,v);if(u){let e=xn(n),t=p?.text[p.text.length-1]??s[s.length-1]?.text.slice(-1)??``,r=t?xn(t):!1;if(e&&r)continue}let x=!y,S=x?r(t):b;if(S>d&&x)if(c>0&&_(),l){let e=o(t);for(let t=0;t<e.length;t++){let n=e[t].token,r=e[t].style,o=En(n,l,a,i);for(let e of o){let t=m(e,r);t+c>d&&_(),!p||p.style!==r?(g(),p={text:e,style:r}):p.text+=e,c+=t}}t+=e.length-1}else{let e=o(t);g(),h.push(e.map(e=>({text:e.token,style:e.style}))),f=!1,t+=e.length-1}else if(S+c>d&&x){if(xn(n)){f=!1;continue}_(),p={text:n,style:v},c=b}else if(y&&!l)!p||p.style!==v?(g(),p={text:n,style:v}):p.text+=n,c+=b;else{let e=xn(n);if(c===0&&e&&!f)continue;!p||p.style!==v?(g(),p={text:n,style:v}):p.text+=n,c+=b}}if(g(),s.length>0){let e=s[s.length-1];e.text=wn(e.text),e.text.length===0&&s.pop()}(s.length>0||h.length===n)&&h.push(s)}return h}function mee(e){let t=[],n=!1;for(let r of e){let e=Tn(r.text),i=!0;for(let a of e){let e=xn(a)||bn(a),o=i&&n&&!e;t.push({token:a,style:r.style,continuesFromPrevious:o}),n=!e,i=!1}}return t}var hee={willReadFrequently:!0};function Dn(e,t,n,r,i){let a=n[e];return typeof a!=`number`&&(a=i(e,t,r)+t,n[e]=a),a}function gee(e,t,n,r,i,a,o){let s=n.getContext(`2d`,hee);s.font=t._fontString;let c=0,l=``,u=[],d=Object.create(null),{letterSpacing:f,whiteSpace:p}=t,m=Sn(p),h=Cn(p),g=!m,_=t.wordWrapWidth+f,v=Tn(e);for(let e=0;e<v.length;e++){let n=v[e];if(bn(n)){if(!h){u.push(wn(l)),g=!m,l=``,c=0;continue}n=` `}if(m){let e=xn(n),t=xn(l[l.length-1]);if(e&&t)continue}let p=Dn(n,f,d,s,r);if(p>_)if(l!==``&&(u.push(wn(l)),l=``,c=0),i(n,t.breakWords)){let e=En(n,t.breakWords,o,a);for(let t of e){let e=Dn(t,f,d,s,r);e+c>_&&(u.push(wn(l)),g=!1,l=``,c=0),l+=t,c+=e}}else l.length>0&&(u.push(wn(l)),l=``,c=0),u.push(wn(n)),g=!1,l=``,c=0;else p+c>_&&(g=!1,u.push(wn(l)),l=``,c=0),(l.length>0||!xn(n)||g)&&(l+=n,c+=p)}let y=wn(l);return y.length>0&&u.push(y),u.join(`
|
|
7
|
-
`)}var _ee={willReadFrequently:!0},On=class e{static get experimentalLetterSpacingSupported(){let t=e._experimentalLetterSpacingSupported;if(t===void 0){let n=It.get().getCanvasRenderingContext2D().prototype;t=e._experimentalLetterSpacingSupported=`letterSpacing`in n||`textLetterSpacing`in n}return t}constructor(e,t,n,r,i,a,o,s,c,l){this.text=e,this.style=t,this.width=n,this.height=r,this.lines=i,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=s,this.fontProperties=c,l&&(this.runsByLine=l.runsByLine,this.lineAscents=l.lineAscents,this.lineDescents=l.lineDescents,this.lineHeights=l.lineHeights,this.hasDropShadow=l.hasDropShadow)}static measureText(t=` `,n,r=e._canvas,i=n.wordWrap){let a=`${t}-${n.styleKey}-wordWrap-${i}`;if(e._measurementCache.has(a))return e._measurementCache.get(a);if(vn(n)&&yn(t)){let r=fee(t,n,i,e._context,e._measureText,e.measureFont,e.canBreakChars,e.wordWrapSplit),o=new e(t,n,r.width,r.height,r.lines,r.lineWidths,r.lineHeight,r.maxLineWidth,r.fontProperties,{runsByLine:r.runsByLine,lineAscents:r.lineAscents,lineDescents:r.lineDescents,lineHeights:r.lineHeights,hasDropShadow:r.hasDropShadow});return e._measurementCache.set(a,o),o}let o=n._fontString,s=e.measureFont(o);s.fontSize===0&&(s.fontSize=n.fontSize,s.ascent=n.fontSize,s.descent=0);let c=e._context;c.font=o;let l=(i?e._wordWrap(t,n,r):t).split(uee),u=Array(l.length),d=0;for(let t=0;t<l.length;t++){let r=e._measureText(l[t],n.letterSpacing,c);u[t]=r,d=Math.max(d,r)}let f=n._stroke?.width??0,p=n.lineHeight||s.fontSize,m=e._getAlignWidth(d,n,i),h=e._adjustWidthForStyle(m,n),g=Math.max(p,s.fontSize+f)+(l.length-1)*(p+n.leading),_=new e(t,n,h,e._adjustHeightForStyle(g,n),l,u,p+n.leading,d,s);return e._measurementCache.set(a,_),_}static _adjustWidthForStyle(e,t){let n=e+(t._stroke?.width||0);return t.dropShadow&&(n+=t.dropShadow.distance),n}static _adjustHeightForStyle(e,t){let n=e;return t.dropShadow&&(n+=t.dropShadow.distance),n}static _getAlignWidth(e,t,n){return n&&t.align!==`left`&&t.align!==`justify`?Math.max(e,t.wordWrapWidth):e}static _measureText(t,n,r){let i=!1;e.experimentalLetterSpacingSupported&&(e.experimentalLetterSpacing?(r.letterSpacing=`${n}px`,r.textLetterSpacing=`${n}px`,i=!0):(r.letterSpacing=`0px`,r.textLetterSpacing=`0px`));let a=r.measureText(t),o=a.width,s=-(a.actualBoundingBoxLeft??0),c=(a.actualBoundingBoxRight??0)-s;if(o>0)if(i)o-=n,c-=n;else{let r=(e.graphemeSegmenter(t).length-1)*n;o+=r,c+=r}return Math.max(o,c)}static _wordWrap(t,n,r=e._canvas){return gee(t,n,r,e._measureText,e.canBreakWords,e.canBreakChars,e.wordWrapSplit)}static isBreakingSpace(e,t){return xn(e,t)}static canBreakWords(e,t){return t}static canBreakChars(e,t,n,r,i){return!0}static wordWrapSplit(t){return e.graphemeSegmenter(t)}static measureFont(t){if(e._fonts[t])return e._fonts[t];let n=e._context;n.font=t;let r=n.measureText(e.METRICS_STRING+e.BASELINE_SYMBOL),i=r.actualBoundingBoxAscent??0,a=r.actualBoundingBoxDescent??0,o={ascent:i,descent:a,fontSize:i+a};return e._fonts[t]=o,o}static clearMetrics(t=``){t?delete e._fonts[t]:e._fonts={}}static get _canvas(){if(!e.__canvas){let t;try{let n=new OffscreenCanvas(0,0);if(n.getContext(`2d`,_ee)?.measureText)return e.__canvas=n,n;t=It.get().createCanvas()}catch{t=It.get().createCanvas()}t.width=t.height=10,e.__canvas=t}return e.__canvas}static get _context(){return e.__context||=e._canvas.getContext(`2d`,_ee),e.__context}};On.METRICS_STRING=`|ÉqÅ`,On.BASELINE_SYMBOL=`M`,On.BASELINE_MULTIPLIER=1.4,On.HEIGHT_MULTIPLIER=2,On.graphemeSegmenter=(()=>{if(typeof Intl?.Segmenter==`function`){let e=new Intl.Segmenter;return t=>{let n=e.segment(t),r=[],i=0;for(let e of n)r[i++]=e.segment;return r}}return e=>[...e]})(),On.experimentalLetterSpacing=!1,On._fonts={},On._measurementCache=iee(1e3);var kn=On,vee=[`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`,`system-ui`];function An(e){let t=typeof e.fontSize==`number`?`${e.fontSize}px`:e.fontSize,n=e.fontFamily;Array.isArray(e.fontFamily)||(n=e.fontFamily.split(`,`));for(let e=n.length-1;e>=0;e--){let t=n[e].trim();!/([\"\'])[^\'\"]+\1/.test(t)&&!vee.includes(t)&&(t=`"${t}"`),n[e]=t}return`${e.fontStyle} ${e.fontVariant} ${e.fontWeight} ${t} ${n.join(`,`)}`}var jn=class e extends kt{constructor(t={}){super(),this.uid=Tt(`textStyle`),this._tick=0,this._cachedFontString=null,yee(t),t instanceof e&&(t=t._toObject());let n={...e.defaultTextStyle,...t};for(let e in n){let t=e;this[t]=n[e]}this._tagStyles=t.tagStyles??void 0,this.update(),this._tick=0}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.update())}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.update())}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(typeof t==`object`&&t?this._dropShadow=this._createProxy({...e.defaultDropShadow,...t}):this._dropShadow=t?this._createProxy({...e.defaultDropShadow}):null,this.update())}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.update())}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(typeof e==`string`?this._fontSize=parseInt(e,10):this._fontSize=e,this.update())}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e.toLowerCase(),this.update())}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.update())}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.update())}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.update())}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.update())}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.update())}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.update())}get filters(){return this._filters}set filters(e){this._filters!==e&&(this._filters=Object.freeze(e),this.update())}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.update())}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.update())}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.update())}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.update())}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.update())}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._isFillStyle(e)&&(this._originalFill=this._createProxy({...Vt.defaultFillStyle,...e},()=>{this._fill=Rt({...this._originalFill},Vt.defaultFillStyle)})),this._fill=Rt(e===0?`black`:e,Vt.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...Vt.defaultStrokeStyle,...e},()=>{this._stroke=Lt({...this._originalStroke},Vt.defaultStrokeStyle)})),this._stroke=Lt(e,Vt.defaultStrokeStyle),this.update())}get tagStyles(){return this._tagStyles}set tagStyles(e){this._tagStyles!==e&&(this._tagStyles=e??void 0,this.update())}update(){this._tick++,this._cachedFontString=null,this.emit(`update`,this)}reset(){let t=e.defaultTextStyle;for(let e in t)this[e]=t[e]}assign(e){for(let t in e){let n=t;this[n]=e[t]}return this}get styleKey(){return`${this.uid}-${this._tick}`}get _fontString(){return this._cachedFontString===null&&(this._cachedFontString=An(this)),this._cachedFontString}_toObject(){return{align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill?{...this._fill}:void 0,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke?{...this._stroke}:void 0,textBaseline:this.textBaseline,trim:this.trim,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0,tagStyles:this._tagStyles?{...this._tagStyles}:void 0}}clone(){return new e(this._toObject())}_getFinalPadding(){let e=0;if(this._filters)for(let t=0;t<this._filters.length;t++)e+=this._filters[t].padding;return Math.max(this._padding,e)}destroy(e=!1){if(this.removeAllListeners(),typeof e==`boolean`?e:e?.texture){let t=typeof e==`boolean`?e:e?.textureSource;this._fill?.texture&&this._fill.texture.destroy(t),this._originalFill?.texture&&this._originalFill.texture.destroy(t),this._stroke?.texture&&this._stroke.texture.destroy(t),this._originalStroke?.texture&&this._originalStroke.texture.destroy(t)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(e,t){return new Proxy(e,{set:(e,n,r)=>e[n]===r?!0:(e[n]=r,t?.(n,r),this.update(),!0)})}_isFillStyle(e){return(e??null)!==null&&!(Mt.isColorLike(e)||e instanceof Ht||e instanceof Bt)}};jn.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:`black`,distance:5},jn.defaultTextStyle={align:`left`,breakWords:!1,dropShadow:null,fill:`black`,fontFamily:`Arial`,fontSize:26,fontStyle:`normal`,fontVariant:`normal`,fontWeight:`normal`,leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:`alphabetic`,trim:!1,whiteSpace:`pre`,wordWrap:!1,wordWrapWidth:100};var Mn=jn;function yee(e){let t=e;if(typeof t.dropShadow==`boolean`&&t.dropShadow){let n=Mn.defaultDropShadow;e.dropShadow={alpha:t.dropShadowAlpha??n.alpha,angle:t.dropShadowAngle??n.angle,blur:t.dropShadowBlur??n.blur,color:t.dropShadowColor??n.color,distance:t.dropShadowDistance??n.distance}}if(t.strokeThickness!==void 0){vt(wt,`strokeThickness is now a part of stroke`);let n=t.stroke,r={};if(Mt.isColorLike(n))r.color=n;else if(n instanceof Ht||n instanceof Bt)r.fill=n;else if(Object.hasOwnProperty.call(n,`color`)||Object.hasOwnProperty.call(n,`fill`))r=n;else throw Error(`Invalid stroke value.`);e.stroke={...r,width:t.strokeThickness}}if(Array.isArray(t.fillGradientStops)){if(vt(wt,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(t.fill)||t.fill.length===0)throw Error(`Invalid fill value. Expected an array of colors for gradient fill.`);t.fill.length!==t.fillGradientStops.length&&At(`The number of fill colors must match the number of fill gradient stops.`);let n=new Ht({start:{x:0,y:0},end:{x:0,y:1},textureSpace:`local`}),r=t.fillGradientStops.slice(),i=t.fill.map(e=>Mt.shared.setValue(e).toNumber());r.forEach((e,t)=>{n.addColorStop(e,i[t])}),e.fill={fill:n}}}var Nn=1e5;function Pn(e,t,n,r=0,i=0,a=0){if(e.texture===St.WHITE&&!e.fill)return Mt.shared.setValue(e.color).setAlpha(e.alpha??1).toHexa();if(!e.fill){let n=t.createPattern(e.texture.source.resource,`repeat`),r=e.matrix.copyTo(ht.shared);return r.scale(e.texture.source.pixelWidth,e.texture.source.pixelHeight),n.setTransform(r),n}else if(e.fill instanceof Bt){let n=e.fill,r=t.createPattern(n.texture.source.resource,`repeat`),i=n.transform.copyTo(ht.shared);return i.scale(n.texture.source.pixelWidth,n.texture.source.pixelHeight),r.setTransform(i),r}else if(e.fill instanceof Ht){let o=e.fill,s=o.type===`linear`,c=o.textureSpace===`local`,l=1,u=1;c&&n&&(l=n.width+r,u=n.height+r);let d,f=!1;if(s){let{start:e,end:n}=o;d=t.createLinearGradient(e.x*l+i,e.y*u+a,n.x*l+i,n.y*u+a),f=Math.abs(n.x-e.x)<Math.abs((n.y-e.y)*.1)}else{let{center:e,innerRadius:n,outerCenter:r,outerRadius:s}=o;d=t.createRadialGradient(e.x*l+i,e.y*u+a,n*l,r.x*l+i,r.y*u+a,s*l)}if(f&&c&&n){let e=n.lineHeight/u;for(let t=0;t<n.lines.length;t++){let i=(t*n.lineHeight+r/2)/u;o.colorStops.forEach(t=>{let n=i+t.offset*e;n=Math.max(0,Math.min(1,n)),d.addColorStop(Math.floor(n*Nn)/Nn,Mt.shared.setValue(t.color).toHex())})}}else o.colorStops.forEach(e=>{d.addColorStop(e.offset,Mt.shared.setValue(e.color).toHex())});return d}return At(`FillStyle not recognised`,e),`red`}var Fn=class extends gn{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=fn(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),In(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ln(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ln(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof rn(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Yt(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Rn(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||rn(this.options.enabled,this.#t)!==rn(t.enabled,this.#t)||tn(this.options.staleTime,this.#t)!==tn(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||rn(this.options.enabled,this.#t)!==rn(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return xee(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(en)),t}#g(){this.#b();let e=tn(this.options.staleTime,this.#t);if(mn||this.#r.isStale||!$t(e))return;let t=nee(this.#r.dataUpdatedAt,e)+1;this.#d=Zt.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(mn||rn(this.options.enabled,this.#t)===!1||!$t(this.#p)||this.#p===0)&&(this.#f=Zt.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(Zt.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(Zt.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&In(e,t),o=i&&Rn(e,n,t,r);(a||o)&&(l={...l,...Xt(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=un(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=un(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:zn(e,t),refetch:this.refetch,promise:this.#o,isEnabled:rn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=e=>{x.status===`error`?e.reject(x.error):x.data!==void 0&&e.resolve(x.data)},r=()=>{t(this.#o=x.promise=fn())},i=this.#o;switch(i.status){case`pending`:e.queryHash===n.queryHash&&t(i);break;case`fulfilled`:(x.status===`error`||x.data!==i.value)&&r();break;case`rejected`:(x.status!==`error`||x.error!==i.reason)&&r();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!Yt(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){ln.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function bee(e,t){return rn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function In(e,t){return bee(e,t)||e.state.data!==void 0&&Ln(e,t,t.refetchOnMount)}function Ln(e,t,n){if(rn(t.enabled,e)!==!1&&tn(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&zn(e,t)}return!1}function Rn(e,t,n,r){return(e!==t||rn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&zn(e,n)}function zn(e,t){return rn(t.enabled,e)!==!1&&e.isStaleByTime(tn(t.staleTime,e))}function xee(e,t){return!Yt(e.getCurrentResult(),t)}var See=class extends Fn{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:an()})}getOptimisticResult(e){return e.behavior=an(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:cn(t,n.data),hasPreviousPage:eee(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Cee=class extends gn{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Yt(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&on(t.mutationKey)!==on(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??tee();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ln.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type===`success`?(this.#r.onSuccess?.(e.data,t,n,r),this.#r.onSettled?.(e.data,null,t,n,r)):e?.type===`error`&&(this.#r.onError?.(e.error,t,n,r),this.#r.onSettled?.(void 0,e.error,t,n,r))}this.listeners.forEach(e=>{e(this.#t)})})}};function Bn(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function wee(e,t,n){let r=e.slice(0);return r[t]=n,r}var Tee=class extends gn{#e;#t;#n;#r;#i;#a;#o;#s;#c=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#f(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,ln.batch(()=>{let e=this.#i,t=this.#d(this.#n);this.#c=t,t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!Yt(e,n)});!o&&!s||(o&&(this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Bn(e,n).forEach(e=>{e.destroy()}),Bn(n,e).forEach(e=>{e.subscribe(t=>{this.#f(e,t)})})),this.#p()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#d(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions));return[r,e=>this.#u(e??r,t),()=>this.#l(r,n)]}#l(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#u(e,t){return t?((!this.#a||this.#t!==this.#s||t!==this.#o)&&(this.#o=t,this.#s=this.#t,this.#a=sn(this.#a,t(e))),this.#a):e}#d(e){let t=new Map(this.#i.map(e=>[e.options.queryHash,e])),n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash);i?n.push({defaultedQueryOptions:r,observer:i}):n.push({defaultedQueryOptions:r,observer:new Fn(this.#e,r)})}),n}#f(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=wee(this.#t,n,t),this.#p())}#p(){if(this.hasListeners()){let e=this.#a,t=this.#l(this.#t,this.#c);e!==this.#u(t,this.#r?.combine)&&ln.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Vn=q.createContext(void 0),Hn=e=>{let t=q.useContext(Vn);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Eee=({client:e,children:t})=>(q.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,K.jsx)(Vn.Provider,{value:e,children:t})),Un=q.createContext(!1),Wn=()=>q.useContext(Un);Un.Provider;function Dee(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Oee=q.createContext(Dee()),Gn=()=>q.useContext(Oee),Kn=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},qn=e=>{q.useEffect(()=>{e.clearReset()},[e])},Jn=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||hn(n,[e.error,r])),Yn=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Xn=(e,t)=>e.isLoading&&e.isFetching&&!t,Zn=(e,t)=>e?.suspense&&t.isPending,Qn=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function kee({queries:e,...t},n){let r=Hn(n),i=Wn(),a=Gn(),o=q.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{Yn(e),Kn(e,a)}),qn(a);let[s]=q.useState(()=>new Tee(r,o,t)),[c,l,u]=s.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;q.useSyncExternalStore(q.useCallback(e=>d?s.subscribe(ln.batchCalls(e)):en,[s,d]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),q.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let f=c.some((e,t)=>Zn(o[t],e))?c.flatMap((e,t)=>{let n=o[t];if(n){let t=new Fn(r,n);if(Zn(n,e))return Qn(n,t,a);Xn(e,i)&&Qn(n,t,a)}return[]}):[];if(f.length>0)throw Promise.all(f);let p=c.find((e,t)=>{let n=o[t];return n&&Jn({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(p?.error)throw p.error;return l(u())}function $n(e,t,n){let r=Wn(),i=Gn(),a=Hn(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=r?`isRestoring`:`optimistic`,Yn(o),Kn(o,i),qn(i);let s=!a.getQueryCache().get(o.queryHash),[c]=q.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if(q.useSyncExternalStore(q.useCallback(e=>{let t=u?c.subscribe(ln.batchCalls(e)):en;return c.updateResult(),t},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),q.useEffect(()=>{c.setOptions(o)},[o,c]),Zn(o,l))throw Qn(o,c,i);if(Jn({result:l,errorResetBoundary:i,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,l),o.experimental_prefetchInRender&&!mn&&Xn(l,r)&&(s?Qn(o,c,i):a.getQueryCache().get(o.queryHash)?.promise)?.catch(en).finally(()=>{c.updateResult()}),o.notifyOnChangeProps?l:c.trackResult(l)}function er(e,t){return $n(e,Fn,t)}function tr(e,t){let n=Hn(t),[r]=q.useState(()=>new Cee(n,e));q.useEffect(()=>{r.setOptions(e)},[r,e]);let i=q.useSyncExternalStore(q.useCallback(e=>r.subscribe(ln.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=q.useCallback((e,t)=>{r.mutate(e,t).catch(en)},[r]);if(i.error&&hn(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function Aee(e,t){return $n(e,See,t)}var nr=new WeakMap,jee=new WeakMap,rr={current:[]},ir=!1,ar=0,or=new Set,sr=new Map;function cr(e){for(let t of e){if(rr.current.includes(t))continue;rr.current.push(t),t.recompute();let e=jee.get(t);if(e)for(let t of e){let e=nr.get(t);e?.length&&cr(e)}}}function Mee(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function Nee(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function lr(e){if(ar>0&&!sr.has(e)&&sr.set(e,e.prevState),or.add(e),!(ar>0)&&!ir)try{for(ir=!0;or.size>0;){let e=Array.from(or);or.clear();for(let t of e)t.prevState=sr.get(t)??t.prevState,Mee(t);for(let t of e){let e=nr.get(t);e&&(rr.current.push(t),cr(e))}for(let t of e){let e=nr.get(t);if(e)for(let t of e)Nee(t)}}}finally{ir=!1,rr.current=[],sr.clear()}}function ur(e){ar++;try{e()}finally{if(ar--,ar===0){let e=or.values().next().value;e&&lr(e)}}}function Pee(e){return typeof e==`function`}var Fee=class{constructor(e,t){this.listeners=new Set,this.subscribe=e=>{var t;this.listeners.add(e);let n=((t=this.options)?.onSubscribe)?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.prevState=e,this.state=e,this.options=t}setState(e){var t,n;this.prevState=this.state,this.options?.updateFn?this.state=this.options.updateFn(this.prevState)(e):Pee(e)?this.state=e(this.prevState):this.state=e,(n=(t=this.options)?.onUpdate)==null||n.call(t),lr(this)}},dr=`__TSR_index`,fr=`popstate`,pr=`beforeunload`;function mr(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=gr(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[dr];i=hr(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[dr];i=hr(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[dr]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function hr(e,t){t||={};let n=_r();return{...t,key:n,__TSR_key:n,[dr]:e}}function Iee(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>gr(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=_r();t.history.replaceState({[dr]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=gr(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[dr]-l.state[dr],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=mr({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(pr,S,{capture:!0}),t.removeEventListener(fr,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(pr,S,{capture:!0}),t.addEventListener(fr,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function gr(e,t){let n=e.indexOf(`#`),r=e.indexOf(`?`),i=_r();return{href:e,pathname:e.substring(0,n>0?r>0?Math.min(n,r):n:r>0?r:e.length),hash:n>-1?e.substring(n):``,search:r>-1?e.slice(r,n===-1?void 0:n):``,state:t||{[dr]:0,key:i,__TSR_key:i}}}function _r(){return(Math.random()+1).toString(36).substring(7)}function vr(e){return e[e.length-1]}function Lee(e){return typeof e==`function`}function yr(e,t){return Lee(e)?e(t):e}var Ree=Object.prototype.hasOwnProperty;function br(e,t){if(e===t)return e;let n=t,r=wr(e)&&wr(n);if(!r&&!(Sr(e)&&Sr(n)))return n;let i=r?e:xr(e);if(!i)return n;let a=r?n:xr(n);if(!a)return n;let o=i.length,s=a.length,c=r?Array(s):{},l=0;for(let t=0;t<s;t++){let i=r?t:a[t],s=e[i],u=n[i];if(s===u){c[i]=s,(r?t<o:Ree.call(e,i))&&l++;continue}if(s===null||u===null||typeof s!=`object`||typeof u!=`object`){c[i]=u;continue}let d=br(s,u);c[i]=d,d===s&&l++}return o===s&&l===o?e:c}function xr(e){let t=[],n=Object.getOwnPropertyNames(e);for(let r of n){if(!Object.prototype.propertyIsEnumerable.call(e,r))return!1;t.push(r)}let r=Object.getOwnPropertySymbols(e);for(let n of r){if(!Object.prototype.propertyIsEnumerable.call(e,n))return!1;t.push(n)}return t}function Sr(e){if(!Cr(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Cr(n)||!n.hasOwnProperty(`isPrototypeOf`))}function Cr(e){return Object.prototype.toString.call(e)===`[object Object]`}function wr(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Tr(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!Tr(e[r],t[r],n))return!1;return!0}if(Sr(e)&&Sr(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!Tr(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!Tr(e[o],t[o],n)))return!1;return i===a}return!1}function Er(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function Dr(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function Or(e){try{return decodeURI(e)}catch{return e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}}function kr(e,t){if(!e)return e;let n=t?RegExp(`${t.join(`|`)}`,`gi`):/%25|%5C/gi,r=0,i=``,a;for(;(a=n.exec(e))!==null;)i+=Or(e.slice(r,a.index))+a[0],r=n.lastIndex;return i+Or(r?e.slice(r):e)}var zee=!0,Ar=`Invariant failed`;function jr(e,t){if(!e){if(zee)throw Error(Ar);var n=typeof t==`function`?t():t,r=n?`${Ar}: ${n}`:Ar;throw Error(r)}}function Mr(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var Bee=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,Vee=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,Hee=/^([^{]*)\{\$\}([^}]*)$/;function Nr(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=a.match(Hee);if(o){let r=o[1].length;return n[0]=2,n[1]=t+r,n[2]=t+r+1,n[3]=t+r+2,n[4]=t+r+3,n[5]=e.length,n}let s=a.match(Vee);if(s){let e=s[1],r=s[2],a=s[3],o=e.length;return n[0]=3,n[1]=t+o,n[2]=t+o+3,n[3]=t+o+3+r.length,n[4]=i-a.length,n[5]=i,n}let c=a.match(Bee);if(c){let e=c[1],r=c[2],a=c[3],o=e.length;return n[0]=1,n[1]=t+o,n[2]=t+o+2,n[3]=t+o+2+r.length,n[4]=i-a.length,n[5]=i,n}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Pr(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e;for(;s<o;){let e=Nr(r,s,t),o,l=s,u=e[5];switch(s=u+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=Lr(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=Lr(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(l,e[1]),s=r.substring(e[4],u),d=c&&!!(t||s),f=t?d?t:t.toLowerCase():void 0,p=s?d?s:s.toLowerCase():void 0,m=i.dynamic?.find(e=>e.caseSensitive===d&&e.prefix===f&&e.suffix===p);if(m)o=m;else{let e=Rr(1,n.fullPath??n.from,d,f,p);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(l,e[1]),s=r.substring(e[4],u),d=c&&!!(t||s),f=t?d?t:t.toLowerCase():void 0,p=s?d?s:s.toLowerCase():void 0,m=i.optional?.find(e=>e.caseSensitive===d&&e.prefix===f&&e.suffix===p);if(m)o=m;else{let e=Rr(3,n.fullPath??n.from,d,f,p);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(l,e[1]),s=r.substring(e[4],u),d=c&&!!(t||s),f=t?d?t:t.toLowerCase():void 0,p=s?d?s:s.toLowerCase():void 0,m=Rr(2,n.fullPath??n.from,d,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if((n.path||!n.children)&&!n.isRoot){let e=r.endsWith(`/`);e||(i.notFound=n),(!i.route||!i.isIndex&&e)&&(i.route=n),i.isIndex||=e}}if(n.children)for(let r of n.children)Pr(e,t,r,s,i,a,o)}function Fr(e,t){if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Ir(e){if(e.static)for(let t of e.static.values())Ir(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())Ir(t);if(e.dynamic?.length){e.dynamic.sort(Fr);for(let t of e.dynamic)Ir(t)}if(e.optional?.length){e.optional.sort(Fr);for(let t of e.optional)Ir(t)}if(e.wildcard?.length){e.wildcard.sort(Fr);for(let t of e.wildcard)Ir(t)}}function Lr(e){return{kind:0,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,isIndex:!1,notFound:null}}function Rr(e,t,n,r,i){return{kind:e,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,isIndex:!1,notFound:null,caseSensitive:n,prefix:r,suffix:i}}function Uee(e,t){let n=Lr(`/`),r=new Uint16Array(6);for(let t of e)Pr(!1,r,t,1,n,0);Ir(n),t.masksTree=n,t.flatCache=Mr(1e3)}function Wee(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=zr(e,t.masksTree);return t.flatCache.set(e,r),r}function Gee(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Lr(`/`),Pr(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),zr(r,o,n)}function Kee(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a=zr(e,t.segmentTree,n);return a&&(a.branch=Xee(a.route)),t.matchCache.set(r,a),a}function qee(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Jee(e,t=!1,n){let r=Lr(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return Pr(t,i,e,1,r,0,e=>{if(n?.(e,s),jr(!(e.id in a),`Duplicate routes found with id: ${String(e.id)}`),a[e.id]=e,s!==0&&e.path){let t=qee(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),Ir(r),{processedTree:{segmentTree:r,singleCache:Mr(1e3),matchCache:Mr(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function zr(e,t,n=!1){let r=e.split(`/`),i=Qee(e,r,t,n);if(!i)return null;let a=Yee(e,r,i),o=`**`in i;return o&&(a[`**`]=i[`**`]),{route:o?i.node.notFound??i.node.route:i.node.route,params:a}}function Yee(e,t,n){let r=Zee(n.node),i=null,a={};for(let o=0,s=0,c=0;s<r.length;o++,s++,c++){let l=r[s],u=t[o],d=c;if(u&&(c+=u.length),l.kind===1){i??=n.node.fullPath.split(`/`);let e=i[s],t=l.prefix?.length??0;if(e.charCodeAt(t)===123){let n=l.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=u.substring(t,u.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(u)}}else if(l.kind===3){if(n.skipped&1<<s){o--;continue}i??=n.node.fullPath.split(`/`);let e=i[s],t=l.prefix?.length??0,r=l.suffix?.length??0,c=e.substring(t+3,e.length-r-1),d=l.suffix||l.prefix?u.substring(t,u.length-r):u;d&&(a[c]=decodeURIComponent(d))}else if(l.kind===2){let t=l,n=e.substring(d+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return a}function Xee(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Zee(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Qee(e,t,n,r){let i=!vr(t),a=i&&e!==`/`,o=t.length-(i?1:0),s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let e=s.pop(),{node:n,index:i,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=e;r&&n.notFound&&Br(l,e)&&(l=e);let g=i===o;if(g){if(n.route&&(!a||n.isIndex)&&(Br(u,e)&&(u=e),p===o&&n.isIndex))return u;if(!n.optional&&!n.wildcard)continue}let _=g?void 0:t[i],v;if(n.wildcard&&Br(c,e))for(let e of n.wildcard){let{prefix:n,suffix:r}=e;if(!(n&&(g||!(e.caseSensitive?_:v??=_.toLowerCase()).startsWith(n)))){if(r){if(g)continue;let n=t.slice(i).join(`/`).slice(-r.length);if((e.caseSensitive?n:n.toLowerCase())!==r)continue}c={node:e,index:i,skipped:d,depth:f,statics:p,dynamics:m,optionals:h};break}}if(n.optional){let e=d|1<<f,t=f+1;for(let r=n.optional.length-1;r>=0;r--){let a=n.optional[r];s.push({node:a,index:i,skipped:e,depth:t,statics:p,dynamics:m,optionals:h})}if(!g)for(let e=n.optional.length-1;e>=0;e--){let r=n.optional[e],{prefix:a,suffix:o}=r;if(a||o){let e=r.caseSensitive?_:v??=_.toLowerCase();if(a&&!e.startsWith(a)||o&&!e.endsWith(o))continue}s.push({node:r,index:i+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+1})}}if(!g&&n.dynamic&&_)for(let e=n.dynamic.length-1;e>=0;e--){let t=n.dynamic[e],{prefix:r,suffix:a}=t;if(r||a){let e=t.caseSensitive?_:v??=_.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:t,index:i+1,skipped:d,depth:f+1,statics:p,dynamics:m+1,optionals:h})}if(!g&&n.staticInsensitive){let e=n.staticInsensitive.get(v??=_.toLowerCase());e&&s.push({node:e,index:i+1,skipped:d,depth:f+1,statics:p+1,dynamics:m,optionals:h})}if(!g&&n.static){let e=n.static.get(_);e&&s.push({node:e,index:i+1,skipped:d,depth:f+1,statics:p+1,dynamics:m,optionals:h})}}if(u)return u;if(c)return c;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return{node:l.node,skipped:l.skipped,"**":decodeURIComponent(r)}}return null}function Br(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&(t.node.isIndex>e.node.isIndex||t.node.isIndex===e.node.isIndex&&t.depth>e.depth))):!0}function Vr(e){return Hr(e.filter(e=>e!==void 0).join(`/`))}function Hr(e){return e.replace(/\/{2,}/g,`/`)}function Ur(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Wr(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Gr(e){return Wr(Ur(e))}function Kr(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function $ee(e,t,n){return Kr(e,n)===Kr(t,n)}function ete({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&vr(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(vr(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=Nr(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=Hr(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function qr(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?encodeURI(r):tte(r,n):r}function Jr({path:e,params:t,decodeCharMap:n}){let r=!1,i={};if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:i,isMissingParams:r};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:i,isMissingParams:r};let a=e.length,o=0,s,c=``;for(;o<a;){let a=o;s=Nr(e,a,s);let l=s[5];if(o=l+1,a===l)continue;let u=s[0];if(u===0){c+=`/`+e.substring(a,l);continue}if(u===2){let o=t._splat;i._splat=o,i[`*`]=o;let u=e.substring(a,s[1]),d=e.substring(s[4],l);if(!o){r=!0,(u||d)&&(c+=`/`+u+d);continue}let f=qr(`_splat`,t,n);c+=`/`+u+f+d;continue}if(u===1){let o=e.substring(s[2],s[3]);!r&&!(o in t)&&(r=!0),i[o]=t[o];let u=e.substring(a,s[1]),d=e.substring(s[4],l),f=qr(o,t,n)??`undefined`;c+=`/`+u+f+d;continue}if(u===3){let r=e.substring(s[2],s[3]),o=t[r];if(o==null)continue;i[r]=o;let u=e.substring(a,s[1]),d=e.substring(s[4],l),f=qr(r,t,n)??``;c+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(c+=`/`),{usedParams:i,interpolatedPath:c||`/`,isMissingParams:r}}function tte(e,t){let n=encodeURIComponent(e);if(t)for(let[e,r]of t)n=n.replaceAll(e,r);return n}function Yr(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function Xr(e){return!!e?.isNotFound}function nte(){try{if(typeof window<`u`&&typeof window.sessionStorage==`object`)return window.sessionStorage}catch{}}var Zr=`tsr-scroll-restoration-v1_3`,rte=(e,t)=>{let n;return(...r)=>{n||=setTimeout(()=>{e(...r),n=null},t)}};function ite(){let e=nte();if(!e)return null;let t=e.getItem(Zr),n=t?JSON.parse(t):{};return{state:n,set:t=>(n=yr(t,n)||n,e.setItem(Zr,JSON.stringify(n)))}}var Qr=ite(),$r=e=>e.state.__TSR_key||e.href;function ate(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var ei=!1;function ote({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||`{}`)}catch(e){console.error(e);return}let s=t||window.history.state?.__TSR_key,c=o[s];ei=!0;scroll:{if(r&&c&&Object.keys(c).length>0){for(let e in c){let t=c[e];if(e===`window`)window.scrollTo({top:t.scrollY,left:t.scrollX,behavior:n});else if(e){let n=document.querySelector(e);n&&(n.scrollLeft=t.scrollX,n.scrollTop=t.scrollY)}}break scroll}let e=(a??window.location).hash.split(`#`,2)[1];if(e){let t=window.history.state?.__hashScrollIntoViewOptions??!0;if(t){let n=document.getElementById(e);n&&n.scrollIntoView(t)}break scroll}let t={top:0,left:0,behavior:n};if(window.scrollTo(t),i)for(let e of i){if(e===`window`)continue;let n=typeof e==`function`?e():document.querySelector(e);n&&n.scrollTo(t)}}ei=!1}function ste(e,t){if(!Qr&&!e.isServer||((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!Qr))return;e.isScrollRestorationSetup=!0,ei=!1;let n=e.options.getScrollRestorationKey||$r;window.history.scrollRestoration=`manual`,typeof document<`u`&&document.addEventListener(`scroll`,rte(t=>{if(ei||!e.isScrollRestoring)return;let r=``;if(t.target===document||t.target===window)r=`window`;else{let e=t.target.getAttribute(`data-scroll-restoration-id`);r=e?`[data-scroll-restoration-id="${e}"]`:ate(t.target)}let i=n(e.state.location);Qr.set(e=>{let t=e[i]||={},n=t[r]||={};if(r===`window`)n.scrollX=window.scrollX||0,n.scrollY=window.scrollY||0;else if(r){let e=document.querySelector(r);e&&(n.scrollX=e.scrollLeft||0,n.scrollY=e.scrollTop||0)}return e})},100),!0),e.subscribe(`onRendered`,t=>{let r=n(t.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation})||(ote({storageKey:Zr,key:r,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Qr.set(e=>(e[r]||={},e)))})}function cte(e){if(typeof document<`u`&&document.querySelector){let t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==``){let n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function lte(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function ti(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function ute(e){let t=new URLSearchParams(e),n={};for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=ti(r):Array.isArray(t)?t.push(ti(r)):n[e]=[t,ti(r)]}return n}var dte=pte(JSON.parse),fte=mte(JSON.stringify,JSON.parse);function pte(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=ute(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function mte(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=lte(e,r);return t?`?${t}`:``}}var ni=`__root__`;function hte(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function ri(e){return e instanceof Response&&!!e.options}var ii=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},ai=(e,t)=>!!(e.preload&&!e.router.state.matches.some(e=>e.id===t)),oi=(e,t)=>{let n=e.router.routesById[t.routeId??``]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),jr(n.options.notFoundComponent,`No notFoundComponent found. Please set a notFoundComponent on your route or provide a defaultNotFoundComponent to the router.`);let r=e.matches.find(e=>e.routeId===n.id);jr(r,`Could not find match for route: `+n.id),e.updateMatch(r.id,e=>({...e,status:`notFound`,error:t,isFetching:!1})),t.routerCode===`BEFORE_LOAD`&&n.parentRoute&&(t.routeId=n.parentRoute.id,oi(e,t))},si=(e,t,n)=>{if(!(!ri(n)&&!Xr(n))){if(ri(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;let r=ri(n)?`redirected`:`notFound`;t._nonReactive.error=n,e.updateMatch(t.id,e=>({...e,status:r,isFetching:!1,error:n})),Xr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw ri(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(oi(e,n),n)}},ci=(e,t)=>{let n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},li=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,si(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,si(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},gte=(e,t,n,r)=>{let i=e.router.getMatch(t),a=e.matches[n-1]?.id,o=a?e.router.getMatch(a):void 0;if(e.router.isShell()){i.ssr=r.id===ni;return}if(o?.ssr===!1){i.ssr=!1;return}let s=e=>e===!0&&o?.ssr===`data-only`?`data-only`:e,c=e.router.options.defaultSsr??!0;if(r.options.ssr===void 0){i.ssr=s(c);return}if(typeof r.options.ssr!=`function`){i.ssr=s(r.options.ssr);return}let{search:l,params:u}=i,d={search:gi(l,i.searchError),params:gi(u,i.paramsError),location:e.location,matches:e.matches.map(e=>({index:e.index,pathname:e.pathname,fullPath:e.fullPath,staticData:e.staticData,id:e.id,routeId:e.routeId,search:gi(e.search,e.searchError),params:gi(e.params,e.paramsError),ssr:e.ssr}))},f=r.options.ssr(d);if(Dr(f))return f.then(e=>{i.ssr=s(e??c)});i.ssr=s(f??c)},ui=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!e.router.isServer&&!ai(e,t)&&(n.options.loader||n.options.beforeLoad||_i(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{ii(e)},i);r._nonReactive.pendingTimeout=t}},_te=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;ui(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&si(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},vte=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Er(()=>{a?.resolve()});let{paramsError:o,searchError:s}=i;o&&li(e,n,o,`PARSE_PARAMS`),s&&li(e,n,s,`VALIDATE_SEARCH`),ui(e,t,r,i);let c=new AbortController,l=e.matches[n-1]?.id,u={...(l?e.router.getMatch(l):void 0)?.context??e.router.options.context??void 0,...i.__routeContext},d=!1,f=()=>{d||(d=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c,context:u})))},p=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){ur(()=>{f(),p()});return}i._nonReactive.beforeLoadPromise=Er();let{search:m,params:h,cause:g}=i,_=ai(e,t),v={search:m,abortController:c,params:h,preload:_,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:_?`preload`:g,matches:e.matches,...e.router.options.additionalContext},y=r=>{if(r===void 0){ur(()=>{f(),p()});return}(ri(r)||Xr(r))&&(f(),li(e,n,r,`BEFORE_LOAD`)),ur(()=>{f(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r,context:{...e.context,...r}})),p()})},b;try{if(b=r.options.beforeLoad(v),Dr(b))return f(),b.catch(t=>{li(e,n,t,`BEFORE_LOAD`)}).then(y)}catch(t){f(),li(e,n,t,`BEFORE_LOAD`)}y(b)},yte=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>{if(e.router.isServer){let r=gte(e,n,t,i);if(Dr(r))return r.then(s)}return s()},o=()=>vte(e,n,t,i),s=()=>{if(ci(e,n))return;let t=_te(e,n,i);return Dr(t)?t.then(o):o()};return a()},di=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},fi=(e,t,n,r)=>{let i=e.matchPromises[n-1],{params:a,loaderDeps:o,abortController:s,cause:c}=e.router.getMatch(t),l=e.router.options.context??{};for(let t=0;t<=n;t++){let n=e.matches[t];if(!n)continue;let r=e.router.getMatch(n.id);r&&(l={...l,...r.__routeContext??{},...r.__beforeLoadContext??{}})}let u=ai(e,t);return{params:a,deps:o,preload:!!u,parentMatchPromise:i,abortController:s,context:l,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:u?`preload`:c,route:r,...e.router.options.additionalContext}},pi=async(e,t,n,r)=>{try{let i=e.router.getMatch(t);try{(!e.router.isServer||i.ssr===!0)&&hi(r);let a=r.options.loader?.(fi(e,t,n,r)),o=r.options.loader&&Dr(a);if((o||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,e=>({...e,isFetching:`loader`})),r.options.loader){let n=o?await a:a;si(e,e.router.getMatch(t),n),n!==void 0&&e.updateMatch(t,e=>({...e,loaderData:n}))}r._lazyPromise&&await r._lazyPromise;let s=di(e,t,r),c=s?await s:void 0,l=i._nonReactive.minPendingPromise;l&&await l,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,e=>({...e,error:void 0,status:`success`,isFetching:!1,updatedAt:Date.now(),...c}))}catch(n){let a=n,o=i._nonReactive.minPendingPromise;o&&await o,Xr(n)&&await r.options.notFoundComponent?.preload?.(),si(e,e.router.getMatch(t),n);try{r.options.onError?.(n)}catch(n){a=n,si(e,e.router.getMatch(t),n)}let s=di(e,t,r),c=s?await s:void 0;e.updateMatch(t,e=>({...e,error:a,status:`error`,isFetching:!1,...c}))}}catch(n){let i=e.router.getMatch(t);if(i){let n=di(e,t,r);if(n){let r=await n;e.updateMatch(t,e=>({...e,...r}))}i._nonReactive.loaderPromise=void 0}si(e,i,n)}},bte=async(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=!1,a=!1,o=e.router.looseRoutesById[r];if(ci(e,n)){if(e.router.isServer){let t=di(e,n,o);if(t){let r=await t;e.updateMatch(n,e=>({...e,...r}))}return e.router.getMatch(n)}}else{let r=e.router.getMatch(n);if(r._nonReactive.loaderPromise){if(r.status===`success`&&!e.sync&&!r.preload)return r;await r._nonReactive.loaderPromise;let t=e.router.getMatch(n),i=t._nonReactive.error||t.error;i&&si(e,t,i)}else{let s=Date.now()-r.updatedAt,c=ai(e,n),l=c?o.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:o.options.staleTime??e.router.options.defaultStaleTime??0,u=o.options.shouldReload,d=typeof u==`function`?u(fi(e,n,t,o)):u,f=!!c&&!e.router.state.matches.some(e=>e.id===n),p=e.router.getMatch(n);p._nonReactive.loaderPromise=Er(),f!==p.preload&&e.updateMatch(n,e=>({...e,preload:f}));let{status:m,invalid:h}=p;if(i=m===`success`&&(h||(d??s>l)),!(c&&o.options.preload===!1))if(i&&!e.sync)a=!0,(async()=>{try{await pi(e,n,t,o);let r=e.router.getMatch(n);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0}catch(t){ri(t)&&await e.router.navigate(t.options)}})();else if(m!==`success`||i&&e.sync)await pi(e,n,t,o);else{let t=di(e,n,o);if(t){let r=await t;e.updateMatch(n,e=>({...e,...r}))}}}}let s=e.router.getMatch(n);a||(s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loadPromise?.resolve()),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0,a||(s._nonReactive.loaderPromise=void 0),s._nonReactive.dehydrated=void 0;let c=a?s.isFetching:!1;return c!==s.isFetching||s.invalid!==!1?(e.updateMatch(n,e=>({...e,isFetching:c,invalid:!1})),e.router.getMatch(n)):s};async function mi(e){let t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(e=>e._forcePending)&&ii(t);try{for(let e=0;e<t.matches.length;e++){let n=yte(t,e);Dr(n)&&await n}let e=t.firstBadMatchIndex??t.matches.length;for(let n=0;n<e;n++)t.matchPromises.push(bte(t,n));await Promise.all(t.matchPromises);let n=ii(t);Dr(n)&&await n}catch(e){if(Xr(e)&&!t.preload){let n=ii(t);throw Dr(n)&&await n,e}if(ri(e))throw e}return t.matches}async function hi(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){let t=()=>{let t=[];for(let n of vi){let r=e.options[n]?.preload;r&&t.push(r())}if(t.length)return Promise.all(t).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function gi(e,t){return t?{status:`error`,error:t}:{status:`success`,value:e}}function _i(e){for(let t of vi)if(e.options[t]?.preload)return!0;return!1}var vi=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function xte(e){return{input:({url:t})=>{for(let n of e)t=yi(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=bi(e[n],t);return t}}}function Ste(e){let t=Gr(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Vr([`/`,t,e.pathname]),e)}}function yi(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function bi(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function xi(e){let t=e.resolvedLocation,n=e.location;return{fromLocation:t,toLocation:n,pathChanged:t?.pathname!==n.pathname,hrefChanged:t?.href!==n.href,hashChanged:t?.hash!==n.hash}}var Cte=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{e.notFoundRoute&&console.warn(`The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.`);let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(e=>[encodeURIComponent(e),e])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=Iee())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new Fee(Tte(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(e=>![`redirected`].includes(e.status))}}}),ste(this));let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[];Gr(o)!==``&&e.push(Ste({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:xte(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let{routesById:e,routesByPath:t,processedTree:n}=Jee(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});this.options.routeMasks&&Uee(this.options.routeMasks,n),this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({href:e,state:n})=>{let r=new URL(e,this.origin),i=yi(this.rewrite,r),a=this.options.parseSearch(i.search),o=this.options.stringifySearch(a);i.search=o;let s=i.href.replace(i.origin,``),{pathname:c,hash:l}=i;return{href:s,publicHref:e,url:i.href,pathname:kr(c),searchStr:o,search:br(t?.search,a),hash:l.split(`#`).reverse()[0]??``,state:br(t?.state,n)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathCache=Mr(1e3),this.resolvePathWithBase=(e,t)=>ete({base:e,to:Hr(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Ete({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{let e=this.state.matches.filter(e=>e.status===`pending`),t=this.state.matches.filter(e=>e.isFetching===`loader`);new Set([...this.state.pendingMatches??[],...e,...t]).forEach(e=>{this.cancelMatch(e.id)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=vr(this.matchRoutes(n,{_buildLocation:!0}));t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=this.resolvePathWithBase(i,`.`),o=r.search,s={...r.params},c=t.to?this.resolvePathWithBase(a,`${t.to}`):this.resolvePathWithBase(a,`.`),l=t.params===!1||t.params===null?{}:(t.params??!0)===!0?s:Object.assign(s,yr(t.params,s)),u=Jr({path:c,params:l}).interpolatedPath,d=this.matchRoutes(u,void 0,{_buildLocation:!0}).map(e=>this.looseRoutesById[e.routeId]);if(Object.keys(l).length>0)for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;t&&Object.assign(l,t(l))}let f=e.leaveParams?c:kr(Jr({path:c,params:l,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath),p=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Ci(t.options.validateSearch,{...e,...p}))}catch{}}),p=e}p=Dte({search:p,dest:t,destRoutes:d,_includeValidateSearch:e._includeValidateSearch}),p=br(o,p);let m=this.options.stringifySearch(p),h=t.hash===!0?n.hash:t.hash?yr(t.hash,n.hash):void 0,g=h?`#${h}`:``,_=t.state===!0?n.state:t.state?yr(t.state,n.state):{};_=br(n.state,_);let v=`${f}${m}${g}`,y=new URL(v,this.origin),b=bi(this.rewrite,y);return{publicHref:b.pathname+b.search+b.hash,href:v,url:b.href,pathname:f,search:p,searchStr:m,state:_,hash:h??``,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n={};if(this.options.routeMasks){let o=Wee(i.pathname,this.processedTree);if(o){Object.assign(n,o.params);let{from:i,...s}=o.route;r={from:e.from,...s,params:n},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=Tr(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=Wr(this.latestLocation.href)===Wr(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=Er(()=>{a?.resolve()}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=gr(a,{__TSR_index:e?t:t+1});o.to=n.pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,...r})=>{if(!t&&n)try{new URL(`${n}`),t=!0}catch{}if(t){if(n||=this.buildLocation({to:e,...r}).url,!r.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return r.replace?window.location.replace(n):window.location.href=n,Promise.resolve()}return this.buildAndCommitLocation({...r,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){let e=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),t=e=>{try{return encodeURI(decodeURI(e))}catch{return e}};if(Gr(t(this.latestLocation.href))!==Gr(t(e.href))){let t=e.url;throw this.origin&&t.startsWith(this.origin)&&(t=t.replace(this.origin,``)||`/`),hte({href:t})}}let e=this.matchRoutes(this.latestLocation);this.__store.setState(t=>({...t,status:`pending`,statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:t.cachedMatches.filter(t=>!e.some(e=>e.id===t.id))}))},this.load=async e=>{let t,n,r;for(r=new Promise(i=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=this.state.resolvedLocation;this.state.redirect||this.emit({type:`onBeforeNavigate`,...xi({resolvedLocation:n,location:t})}),this.emit({type:`onBeforeLoad`,...xi({resolvedLocation:n,location:t})}),await mi({router:this,sync:e?.sync,matches:this.state.pendingMatches,location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=[],t=[],n=[];ur(()=>{this.__store.setState(r=>{let i=r.matches,a=r.pendingMatches||r.matches;return e=i.filter(e=>!a.some(t=>t.id===e.id)),t=a.filter(e=>!i.some(t=>t.id===e.id)),n=a.filter(e=>i.some(t=>t.id===e.id)),{...r,isLoading:!1,loadedAt:Date.now(),matches:a,pendingMatches:void 0,cachedMatches:[...r.cachedMatches,...e.filter(e=>e.status!==`error`&&e.status!==`notFound`)]}}),this.clearExpiredCache()}),[[e,`onLeave`],[t,`onEnter`],[n,`onStay`]].forEach(([e,t])=>{e.forEach(e=>{this.looseRoutesById[e.routeId].options[t]?.(e)})})})})}})}catch(e){ri(e)?(t=e,this.isServer||this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):Xr(e)&&(n=e),this.__store.setState(e=>({...e,statusCode:t?t.status:n?404:e.matches.some(e=>e.status===`error`)?500:200,redirect:t}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(e=>e.status===`error`)&&(i=500),i!==void 0&&this.__store.setState(e=>({...e,statusCode:i}))},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.state.resolvedLocation,a=typeof t.types==`function`?t.types(xi({resolvedLocation:i,location:r})):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.state.pendingMatches?.some(t=>t.id===e)?`pendingMatches`:this.state.matches.some(t=>t.id===e)?`matches`:this.state.cachedMatches.some(t=>t.id===e)?`cachedMatches`:``;n&&this.__store.setState(r=>({...r,[n]:r[n]?.map(n=>n.id===e?t(n):n)}))})},this.getMatch=e=>{let t=t=>t.id===e;return this.state.cachedMatches.find(t)??this.state.pendingMatches?.find(t)??this.state.matches.find(t)},this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.__store.setState(e=>({...e,matches:e.matches.map(t),cachedMatches:e.cachedMatches.map(t),pendingMatches:e.pendingMatches?.map(t)})),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{if(!e.options.href){let t=this.buildLocation(e.options),n=t.url;this.origin&&n.startsWith(this.origin)&&(n=n.replace(this.origin,``)||`/`),e.options.href=t.href,e.headers.set(`Location`,n)}return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.__store.setState(e=>({...e,cachedMatches:[]})):this.__store.setState(e=>({...e,cachedMatches:e.cachedMatches.filter(e=>!t(e))}))},this.clearExpiredCache=()=>{this.clearCache({filter:e=>{let t=this.looseRoutesById[e.routeId];if(!t.options.loader)return!0;let n=(e.preload?t.options.preloadGcTime??this.options.defaultPreloadGcTime:t.options.gcTime??this.options.defaultGcTime)??300*1e3;return e.status===`error`?!0:Date.now()-e.updatedAt>=n}})},this.loadRouteChunk=hi,this.preloadRoute=async e=>{let t=this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(e=>e.id)),i=new Set([...r,...this.state.cachedMatches.map(e=>e.id)]);ur(()=>{n.forEach(e=>{i.has(e.id)||this.__store.setState(t=>({...t,cachedMatches:[...t.cachedMatches,e]}))})});try{return n=await mi({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(ri(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});Xr(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.state.status!==`pending`)return!1;let i=(t?.pending===void 0?!this.state.isLoading:t.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,a=Gee(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!Tr(a.params,e.params,{partial:!0})?!1:t?.includeSearch??!0?Tr(i.search,r.search,{partial:!0})?a.params:!1:a.params},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status===`notFound`||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??fte,parseSearch:e.parseSearch??dte}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:Wr(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=(()=>{if(o){if(this.options.notFoundMode!==`root`)for(let e=a.length-1;e>=0;e--){let t=a[e];if(t.children)return t.id}return ni}})(),c=[],l=e=>e?.id?e.context??this.options.context??void 0:this.options.context??void 0;return a.forEach((n,r)=>{let a=c[r-1],[o,u,d]=(()=>{let r=a?.search??e.search,i=a?._strictSearch??void 0;try{let e=Ci(n.options.validateSearch,{...r})??void 0;return[{...r,...e},{...i,...e},void 0]}catch(e){let n=e;if(e instanceof Si||(n=new Si(e.message,{cause:e})),t?.throwOnError)throw n;return[r,{},n]}})(),f=n.options.loaderDeps?.({search:o})??``,p=f?JSON.stringify(f):``,{interpolatedPath:m,usedParams:h}=Jr({path:n.fullPath,params:i,decodeCharMap:this.pathParamsDecodeCharMap}),g=n.id+m+p,_=this.getMatch(g),v=this.state.matches.find(e=>e.routeId===n.id),y=_?._strictParams??h,b;if(!_){let e=n.options.params?.parse??n.options.parseParams;if(e)try{Object.assign(y,e(y))}catch(e){if(b=Xr(e)||ri(e)?e:new wte(e.message,{cause:e}),t?.throwOnError)throw b}}Object.assign(i,y);let x=v?`stay`:`enter`,S;if(_)S={..._,cause:x,params:v?br(v.params,i):i,_strictParams:y,search:br(v?v.search:_.search,o),_strictSearch:u};else{let e=n.options.loader||n.options.beforeLoad||n.lazyFn||_i(n)?`pending`:`success`;S={id:g,index:r,routeId:n.id,params:v?br(v.params,i):i,_strictParams:y,pathname:m,updatedAt:Date.now(),search:v?br(v.search,o):o,_strictSearch:u,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:b,__routeContext:void 0,_nonReactive:{loadPromise:Er()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:x,loaderDeps:v?br(v.loaderDeps,f):f,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:n.options.staticData||{},fullPath:n.fullPath}}t?.preload||(S.globalNotFound=s===n.id),S.searchError=d;let C=l(a);S.context={...C,...S.__routeContext,...S.__beforeLoadContext},c.push(S)}),c.forEach((n,r)=>{let i=this.looseRoutesById[n.routeId];if(!this.getMatch(n.id)&&t?._buildLocation!==!0){let t=c[r-1],a=l(t);if(i.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c};n.__routeContext=i.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}),c}},Si=class extends Error{},wte=class extends Error{};function Tte(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Ci(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Si(`Async validation not supported`);if(n.issues)throw new Si(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Ete({pathname:e,routesById:t,processedTree:n}){let r={},i=Wr(e),a,o=Kee(i,n,!0);return o&&(a=o.route,Object.assign(r,o.params)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function Dte({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){let i=n.reduce((e,t)=>{let n=[];return`search`in t.options?t.options.search?.middlewares&&n.push(...t.options.search.middlewares):(t.options.preSearchFilters||t.options.postSearchFilters)&&n.push(({search:e,next:n})=>{let r=e;`preSearchFilters`in t.options&&t.options.preSearchFilters&&(r=t.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=n(r);return`postSearchFilters`in t.options&&t.options.postSearchFilters?t.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),r&&t.options.validateSearch&&n.push(({search:e,next:n})=>{let r=n(e);try{return{...r,...Ci(t.options.validateSearch,r)??void 0}}catch{return r}}),e.concat(n)},[])??[];i.push(({search:e})=>t.search?t.search===!0?e:yr(t.search,e):{});let a=(e,t)=>{if(e>=i.length)return t;let n=i[e];return n({search:t,next:t=>a(e+1,t)})};return a(0,e)}var Ote=`Error preloading route! ☝️`,wi=class{constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=ni:this.parentRoute||jr(!1,`Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`);let r=n?ni:t?.path;r&&r!==`/`&&(r=Ur(r));let i=t?.id||r,a=n?ni:Vr([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Vr([`/`,a]));let o=a===`__root__`?`/`:Vr([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=o},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}},kte=class{constructor({id:e}){this.notFound=e=>Yr({routeId:this.id,...e}),this.id=e}},Ate=class extends wi{constructor(e){super(e)}};function Ti(e){let t=e.errorComponent??Ei;return(0,K.jsx)(jte,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?q.createElement(t,{error:n,reset:r}):e.children})}var jte=class extends q.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey===this.props.getResetKey()?this.state.error:null,reset:()=>{this.reset()}})}};function Ei({error:e}){let[t,n]=q.useState(!1);return(0,K.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,K.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,K.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,K.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,K.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,K.jsx)(`div`,{children:(0,K.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,K.jsx)(`code`,{children:e.message}):null})}):null]})}function Mte({children:e,fallback:t=null}){return Nte()?(0,K.jsx)(q.Fragment,{children:e}):(0,K.jsx)(q.Fragment,{children:t})}function Nte(){return q.useSyncExternalStore(Pte,()=>!0,()=>!1)}function Pte(){return()=>{}}var Fte=!0;function Di(e,t){if(!Fte){if(e)return;var n=`Warning: `+t;typeof console<`u`&&console.warn(n);try{throw Error(n)}catch{}}}var Ite=i((e=>{var t=a();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),a=r[0].inst,l=r[1];return s(function(){a.value=n,a.getSnapshot=t,u(a)&&l({inst:a})},[e,n,t]),o(function(){return u(a)&&l({inst:a}),e(function(){u(a)&&l({inst:a})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Oi=i(((e,t)=>{t.exports=Ite()})),Lte=i((e=>{var t=a(),n=Oi();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,a){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),a!==void 0&&f.hasValue){var t=f.value;if(a(t,e))return c=t}return c=e}if(t=c,i(s,e))return t;var n=r(e);return a!==void 0&&a(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,a]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),ki=i(((e,t)=>{t.exports=Lte()}))();function Rte(e,t=e=>e,n={}){let r=n.equal??zte;return(0,ki.useSyncExternalStoreWithSelector)(e.subscribe,()=>e.state,()=>e.state,t,r)}function zte(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=Ai(e);if(n.length!==Ai(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function Ai(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}var ji=q.createContext(null);function Mi(){return typeof document>`u`?ji:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=ji,ji)}function Ni(e){let t=q.useContext(Mi());return Di(!((e?.warn??!0)&&!t),`useRouter must be used inside a <RouterProvider> component!`),t}function Pi(e){let t=Ni({warn:e?.router===void 0}),n=e?.router||t,r=(0,q.useRef)(void 0);return Rte(n.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=br(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}var Fi=q.createContext(void 0),Bte=q.createContext(void 0);function Ii(e){let t=q.useContext(e.from?Bte:Fi);return Pi({select:n=>{let r=n.matches.find(n=>e.from?e.from===n.routeId:n.id===t);if(jr(!((e.shouldThrow??!0)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:`a nearest match!`}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function Li(e){return Ii({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Ri(e){let{select:t,...n}=e;return Ii({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function zi(e){return Ii({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Bi(e){return Ii({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}var Vi=typeof window<`u`?q.useLayoutEffect:q.useEffect;function Hi(e){let t=q.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Vte(e,t,n={},r={}){q.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function Hte(e){let t=q.useRef(null);return q.useImperativeHandle(e,()=>t.current,[]),t}function Ui(e){let t=Ni();return q.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Ute(e,t){let n=Ni(),[r,i]=q.useState(!1),a=q.useRef(!1),o=Hte(t),{activeProps:s,inactiveProps:c,activeOptions:l,to:u,preload:d,preloadDelay:f,hashScrollIntoView:p,replace:m,startTransition:h,resetScroll:g,viewTransition:_,children:v,target:y,disabled:b,style:x,className:S,onClick:C,onFocus:w,onMouseEnter:T,onMouseLeave:E,onTouchStart:D,ignoreBlocker:O,params:k,search:A,hash:j,state:M,mask:N,reloadDocument:P,unsafeRelative:F,from:I,_fromLocation:L,...R}=e,z=Pi({select:e=>e.location.search,structuralSharing:!0}),B=e.from,V=q.useMemo(()=>({...e,from:B}),[n,z,B,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ee=q.useMemo(()=>n.buildLocation({...V}),[n,V]),H=q.useMemo(()=>{if(b)return;let e=ee.maskedLocation?ee.maskedLocation.url:ee.url,t=!1;return n.origin&&(e.startsWith(n.origin)?e=n.history.createHref(e.replace(n.origin,``))||`/`:t=!0),{href:e,external:t}},[b,ee.maskedLocation,ee.url,n.origin,n.history]),te=q.useMemo(()=>{if(H?.external)return H.href;try{return new URL(u),u}catch{}},[u,H]),ne=e.reloadDocument||te?!1:d??n.options.defaultPreload,re=f??n.options.defaultPreloadDelay??0,ie=Pi({select:e=>{if(te)return!1;if(l?.exact){if(!$ee(e.location.pathname,ee.pathname,n.basepath))return!1}else{let t=Kr(e.location.pathname,n.basepath),r=Kr(ee.pathname,n.basepath);if(!(t.startsWith(r)&&(t.length===r.length||t[r.length]===`/`)))return!1}return(l?.includeSearch??!0)&&!Tr(e.location.search,ee.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?e.location.hash===ee.hash:!0}}),ae=q.useCallback(()=>{n.preloadRoute({...V}).catch(e=>{console.warn(e),console.warn(Ote)})},[n,V]);Vte(o,q.useCallback(e=>{e?.isIntersecting&&ae()},[ae]),Jte,{disabled:!!b||ne!==`viewport`}),q.useEffect(()=>{a.current||!b&&ne===`render`&&(ae(),a.current=!0)},[b,ae,ne]);let oe=e=>{let t=e.currentTarget.getAttribute(`target`),r=y===void 0?t:y;if(!b&&!Yte(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,_n.flushSync)(()=>{i(!0)});let t=n.subscribe(`onResolved`,()=>{t(),i(!1)});n.navigate({...V,replace:m,resetScroll:g,hashScrollIntoView:p,startTransition:h,viewTransition:_,ignoreBlocker:O})}};if(te)return{...R,ref:o,href:te,...v&&{children:v},...y&&{target:y},...b&&{disabled:b},...x&&{style:x},...S&&{className:S},...C&&{onClick:C},...w&&{onFocus:w},...T&&{onMouseEnter:T},...E&&{onMouseLeave:E},...D&&{onTouchStart:D}};let se=e=>{b||ne&&ae()},ce=se,le=e=>{if(!(b||!ne))if(!re)ae();else{let t=e.target;if(Gi.has(t))return;let n=setTimeout(()=>{Gi.delete(t),ae()},re);Gi.set(t,n)}},ue=e=>{if(b||!ne||!re)return;let t=e.target,n=Gi.get(t);n&&(clearTimeout(n),Gi.delete(t))},de=ie?yr(s,{})??Wte:Wi,fe=ie?Wi:yr(c,{})??Wi,pe=[S,de.className,fe.className].filter(Boolean).join(` `),me=(x||de.style||fe.style)&&{...x,...de.style,...fe.style};return{...R,...de,...fe,href:H?.href,ref:o,onClick:Ki([C,oe]),onFocus:Ki([w,se]),onMouseEnter:Ki([T,le]),onMouseLeave:Ki([E,ue]),onTouchStart:Ki([D,ce]),disabled:!!b,target:y,...me&&{style:me},...pe&&{className:pe},...b&&Gte,...ie&&Kte,...r&&qte}}var Wi={},Wte={className:`active`},Gte={role:`link`,"aria-disabled":!0},Kte={"data-status":`active`,"aria-current":`page`},qte={"data-transitioning":`transitioning`},Gi=new WeakMap,Jte={rootMargin:`100px`},Ki=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}},qi=q.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,ref:a,...o}=Ute(r,t),s=typeof r.children==`function`?r.children({isActive:o[`data-status`]===`active`}):r.children;return n===void 0&&delete o.disabled,q.createElement(n||`a`,{...o,ref:a},s)});function Yte(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Xte(e){return new Zte({id:e})}var Zte=class extends kte{constructor({id:e}){super({id:e}),this.useMatch=e=>Ii({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ii({from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>Bi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>zi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Ri({...e,from:this.id,strict:!1}),this.useLoaderData=e=>Li({...e,from:this.id,strict:!1}),this.useNavigate=()=>Ui({from:Ni().routesById[this.id].fullPath}),this.notFound=e=>Yr({routeId:this.id,...e}),this.Link=q.forwardRef((e,t)=>{let n=Ni().routesById[this.id].fullPath;return(0,K.jsx)(qi,{ref:t,from:n,...e})})}},Qte=class extends wi{constructor(e){super(e),this.useMatch=e=>Ii({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ii({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>Bi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>zi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Ri({...e,from:this.id}),this.useLoaderData=e=>Li({...e,from:this.id}),this.useNavigate=()=>Ui({from:this.fullPath}),this.Link=q.forwardRef((e,t)=>(0,K.jsx)(qi,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function Ji(e){return new Qte(e)}var $te=class extends Ate{constructor(e){super(e),this.useMatch=e=>Ii({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ii({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>Bi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>zi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Ri({...e,from:this.id}),this.useLoaderData=e=>Li({...e,from:this.id}),this.useNavigate=()=>Ui({from:this.fullPath}),this.Link=q.forwardRef((e,t)=>(0,K.jsx)(qi,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function Yi(e){return new $te(e)}function Xi(e){return typeof e==`object`?new Zi(e,{silent:!0}).createRoute(e):new Zi(e,{silent:!0}).createRoute}var Zi=class{constructor(e,t){this.path=e,this.createRoute=e=>{Di(this.silent,`FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.`);let t=Ji(e);return t.isRoot=!1,t},this.silent=t?.silent}},Qi=class{constructor(e){this.useMatch=e=>Ii({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ii({from:this.options.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>Bi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>zi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>Ri({...e,from:this.options.id}),this.useLoaderData=e=>Li({...e,from:this.options.id}),this.useNavigate=()=>Ui({from:Ni().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for(`react.memo`)}};function $i(e){return typeof e==`object`?new Qi(e):t=>new Qi({id:e,...t})}function ene(){let e=Ni(),t=q.useRef({router:e,mounted:!1}),[n,r]=q.useState(!1),{hasPendingMatches:i,isLoading:a}=Pi({select:e=>({isLoading:e.isLoading,hasPendingMatches:e.matches.some(e=>e.status===`pending`)}),structuralSharing:!0}),o=Hi(a),s=a||n||i,c=Hi(s),l=a||i,u=Hi(l);return e.startTransition=e=>{r(!0),q.startTransition(()=>{e(),r(!1)})},q.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Wr(e.latestLocation.href)!==Wr(n.href)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),Vi(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),Vi(()=>{o&&!a&&e.emit({type:`onLoad`,...xi(e.state)})},[o,e,a]),Vi(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...xi(e.state)})},[l,u,e]),Vi(()=>{if(c&&!s){let t=xi(e.state);e.emit({type:`onResolved`,...t}),e.__store.setState(e=>({...e,status:`idle`,resolvedLocation:e.location})),t.hrefChanged&&cte(e)}},[s,c,e]),null}function tne(e){let t=Pi({select:e=>`not-found-${e.location.pathname}-${e.status}`});return(0,K.jsx)(Ti,{getResetKey:()=>t,onCatch:(t,n)=>{if(Xr(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Xr(t))return e.fallback?.(t);throw t},children:e.children})}function nne(){return(0,K.jsx)(`p`,{children:`Not Found`})}function ea(e){return(0,K.jsx)(K.Fragment,{children:e.children})}function ta(e,t,n){return t.options.notFoundComponent?(0,K.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,K.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,K.jsx)(nne,{})}function rne({children:e}){let t=Ni();return t.isServer?(0,K.jsx)(`script`,{nonce:t.options.ssr?.nonce,className:`$tsr`,dangerouslySetInnerHTML:{__html:e+`;typeof $_TSR !== "undefined" && $_TSR.c()`}}):null}function ine(){let e=Ni();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return null;let t=(e.options.getScrollRestorationKey||$r)(e.latestLocation),n=t===$r(e.latestLocation)?void 0:t,r={storageKey:Zr,shouldScrollRestoration:!0};return n&&(r.key=n),(0,K.jsx)(rne,{children:`(${ote.toString()})(${JSON.stringify(r)})`})}var na=q.memo(function({matchId:e}){let t=Ni(),n=Pi({select:t=>{let n=t.matches.find(t=>t.id===e);return jr(n,`Could not find match for matchId "${e}". Please file an issue!`),{routeId:n.routeId,ssr:n.ssr,_displayPending:n._displayPending}},structuralSharing:!0}),r=t.routesById[n.routeId],i=r.options.pendingComponent??t.options.defaultPendingComponent,a=i?(0,K.jsx)(i,{}):null,o=r.options.errorComponent??t.options.defaultErrorComponent,s=r.options.onCatch??t.options.defaultOnCatch,c=r.isRoot?r.options.notFoundComponent??t.options.notFoundRoute?.options.component:r.options.notFoundComponent,l=n.ssr===!1||n.ssr===`data-only`,u=(!r.isRoot||r.options.wrapInSuspense||l)&&(r.options.wrapInSuspense??i??(r.options.errorComponent?.preload||l))?q.Suspense:ea,d=o?Ti:ea,f=c?tne:ea,p=Pi({select:e=>e.loadedAt}),m=Pi({select:t=>{let n=t.matches.findIndex(t=>t.id===e);return t.matches[n-1]?.routeId}});return(0,K.jsxs)(r.isRoot?r.options.shellComponent??ea:ea,{children:[(0,K.jsx)(Fi.Provider,{value:e,children:(0,K.jsx)(u,{fallback:a,children:(0,K.jsx)(d,{getResetKey:()=>p,errorComponent:o||Ei,onCatch:(t,n)=>{if(Xr(t))throw t;Di(!1,`Error in route match: ${e}`),s?.(t,n)},children:(0,K.jsx)(f,{fallback:e=>{if(!c||e.routeId&&e.routeId!==n.routeId||!e.routeId&&!r.isRoot)throw e;return q.createElement(c,e)},children:l||n._displayPending?(0,K.jsx)(Mte,{fallback:a,children:(0,K.jsx)(ra,{matchId:e})}):(0,K.jsx)(ra,{matchId:e})})})})}),m===`__root__`&&t.options.scrollRestoration?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(ane,{}),(0,K.jsx)(ine,{})]}):null]})});function ane(){let e=Ni(),t=q.useRef(void 0);return(0,K.jsx)(`script`,{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:`onRendered`,...xi(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var ra=q.memo(function({matchId:e}){let t=Ni(),{match:n,key:r,routeId:i}=Pi({select:n=>{let r=n.matches.find(t=>t.id===e),i=r.routeId,a=(t.routesById[i].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:i,loaderDeps:r.loaderDeps,params:r._strictParams,search:r._strictSearch});return{key:a?JSON.stringify(a):void 0,routeId:i,match:{id:r.id,status:r.status,error:r.error,_forcePending:r._forcePending,_displayPending:r._displayPending}}},structuralSharing:!0}),a=t.routesById[i],o=q.useMemo(()=>{let e=a.options.component??t.options.defaultComponent;return e?(0,K.jsx)(e,{},r):(0,K.jsx)(ia,{})},[r,a.options.component,t.options.defaultComponent]);if(n._displayPending)throw t.getMatch(n.id)?._nonReactive.displayPendingPromise;if(n._forcePending)throw t.getMatch(n.id)?._nonReactive.minPendingPromise;if(n.status===`pending`){let e=a.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let r=t.getMatch(n.id);if(r&&!r._nonReactive.minPendingPromise&&!t.isServer){let t=Er();r._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),r._nonReactive.minPendingPromise=void 0},e)}}throw t.getMatch(n.id)?._nonReactive.loadPromise}if(n.status===`notFound`)return jr(Xr(n.error),`Expected a notFound error`),ta(t,a,n.error);if(n.status===`redirected`)throw jr(ri(n.error),`Expected a redirect error`),t.getMatch(n.id)?._nonReactive.loadPromise;if(n.status===`error`){if(t.isServer)return(0,K.jsx)((a.options.errorComponent??t.options.defaultErrorComponent)||Ei,{error:n.error,reset:void 0,info:{componentStack:``}});throw n.error}return o}),ia=q.memo(function(){let e=Ni(),t=q.useContext(Fi),n=Pi({select:e=>e.matches.find(e=>e.id===t)?.routeId}),r=e.routesById[n],i=Pi({select:e=>{let n=e.matches.find(e=>e.id===t);return jr(n,`Could not find parent match for matchId "${t}"`),n.globalNotFound}}),a=Pi({select:e=>{let n=e.matches;return n[n.findIndex(e=>e.id===t)+1]?.id}}),o=e.options.defaultPendingComponent?(0,K.jsx)(e.options.defaultPendingComponent,{}):null;if(i)return ta(e,r,void 0);if(!a)return null;let s=(0,K.jsx)(na,{matchId:a});return n===`__root__`?(0,K.jsx)(q.Suspense,{fallback:o,children:s}):s});function one(){let e=Ni(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,K.jsx)(t,{}):null,r=(0,K.jsxs)(e.isServer||typeof document<`u`&&e.ssr?ea:q.Suspense,{fallback:n,children:[!e.isServer&&(0,K.jsx)(ene,{}),(0,K.jsx)(sne,{})]});return e.options.InnerWrap?(0,K.jsx)(e.options.InnerWrap,{children:r}):r}function sne(){let e=Ni(),t=Pi({select:e=>e.matches[0]?.id}),n=Pi({select:e=>e.loadedAt}),r=t?(0,K.jsx)(na,{matchId:t}):null;return(0,K.jsx)(Fi.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,K.jsx)(Ti,{getResetKey:()=>n,errorComponent:Ei,onCatch:e=>{Di(!1,`The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`),Di(!1,e.message||e.toString())},children:r})})}var aa=e=>new cne(e),cne=class extends Cte{constructor(e){super(e)}};typeof globalThis<`u`?(globalThis.createFileRoute=Xi,globalThis.createLazyFileRoute=$i):typeof window<`u`&&(window.createFileRoute=Xi,window.createLazyFileRoute=$i);function lne({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,K.jsx)(Mi().Provider,{value:e,children:t});return e.options.Wrap?(0,K.jsx)(e.options.Wrap,{children:r}):r}function oa({router:e,...t}){return(0,K.jsx)(lne,{router:e,...t,children:(0,K.jsx)(one,{})})}function sa(e){return Pi({select:t=>e?.select?e.select(t.location):t.location})}function une(e){let t=new MutationObserver(t=>{for(let n of t)n.attributeName===`class`&&e()});return t.observe(document.documentElement,{attributes:!0}),()=>t.disconnect()}function dne(){return document.documentElement.classList.contains(`dark`)}function fne(){return!1}function ca(){return(0,q.useSyncExternalStore)(une,dne,fne)}var la=[`/dashboard`,`/config`,`/git`,`/specs`,`/changes`,`/board`,`/archive`,`/settings`,`/terminal`],pne=[`/dashboard`,`/config`,`/specs`,`/changes`,`/board`,`/archive`,`/settings`],ua=z()?[]:[`/git`,`/terminal`],mne=[`/search`,`/notifications`,`/opsx-new`,`/opsx-propose`,`/opsx-verify`,`/opsx-compose`];function da(){return R(`nav-layout`,window.location)}function hne(e){return R(`nav-layout:${encodeURIComponent(e)}`,window.location)}var gne=300;function _ne(e){return la.includes(e)}function fa(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&_ne(e)):[]}function pa(e){if(typeof e!=`object`||!e)return null;let t=e;return!Array.isArray(t.mainTabs)||!Array.isArray(t.bottomTabs)?null:{mainTabs:fa(t.mainTabs),bottomTabs:fa(t.bottomTabs),updatedAt:typeof t.updatedAt==`number`?t.updatedAt:0}}function vne(e,t){if(typeof e!=`object`||!e)return{__TSR_index:0,key:t,__TSR_key:t};let n=e,r=typeof n.key==`string`?n.key:t,i=typeof n.__TSR_key==`string`?n.__TSR_key:r,a=typeof n.__TSR_index==`number`?n.__TSR_index:0;return{...n,key:r,__TSR_key:i,__TSR_index:a}}function ma(e,t){let n=new URL(e,`http://nav.local`),r=`${n.pathname}${n.search}${n.hash}`,i=Math.random().toString(36).slice(2);return{href:r,pathname:n.pathname||`/`,search:n.search,hash:n.hash,state:vne(t,i)}}function ha(e){let t=e.trim();if(!t||t===`./`||t===`.`)return`/`;let n=t.startsWith(`/`)?t:`/${t}`;return(n.endsWith(`/`)?n:`${n}/`).replace(/\/+/g,`/`)}function ga(e,t){return t===`/`?e||`/`:e===t.slice(0,-1)?`/`:e.startsWith(t)?e.slice(t.length-1)||`/`:e||`/`}function yne(e,t){if(t===`/`)return e||`/`;let n=e.startsWith(`/`)?e:`/${e}`;return n===`/`?t.slice(0,-1)||`/`:`${t.slice(0,-1)}${n}`}function _a(e){if(typeof window>`u`)return e;let t=new URL(e,window.location.origin),n=ha(V());return t.pathname=ga(t.pathname,n),`${t.pathname}${t.search}${t.hash}`}function bne(e,t){for(let n of[`api`,`session`]){let r=t.searchParams.get(n);r&&!e.searchParams.has(n)&&e.searchParams.set(n,r)}}function va(e){for(let t of la)if(e===t||e.startsWith(t+`/`))return t;return null}function ya(e,t){if(t===`pop`)return null;let n=t===`main`?e.mainLocation:e.bottomLocation,r=t===`main`?e.mainTabs:e.bottomTabs,i=va(n.pathname);return i&&r.includes(i)?i:null}function ba(e){return mne.some(t=>e===t||e.startsWith(t+`/`))}function xa(e,t){if(ba(t))return`pop`;let n=va(t);return n&&e.bottomTabs.includes(n)?`bottom`:`main`}function Sa(e){let t=new Set,n=[],r=[];for(let r of e.mainTabs)t.has(r)||(n.push(r),t.add(r));for(let n of e.bottomTabs)t.has(n)||(r.push(n),t.add(n));for(let e of la)t.has(e)||(ua.includes(e)?r.push(e):n.push(e));return{mainTabs:n,bottomTabs:r}}function Ca(e,t){if(t.length===0)return ma(`/`);let n=va(e.pathname);return n&&!t.includes(n)?ma(`/`):e}function wa(e,t){if(t.length===0)return ma(`/`);if(e.pathname===`/`)return ma(`/`,e.state);let n=va(e.pathname);return!n||!t.includes(n)?ma(`/`):e}function Ta(e){return e.pathname===`/`?ma(`/`,e.state):ba(e.pathname)?e:ma(`/`)}function Ea(e){let t=Sa({mainTabs:e.mainTabs,bottomTabs:e.bottomTabs});return{...e,mainTabs:t.mainTabs,bottomTabs:t.bottomTabs,mainLocation:Ca(e.mainLocation,t.mainTabs),bottomLocation:wa(e.bottomLocation,t.bottomTabs),popLocation:Ta(e.popLocation)}}function Da(e,t){let n=new URL(e.href),r=ha(V());n.pathname=ga(n.pathname,r);let i=n.searchParams.get(`_b`),a=n.searchParams.get(`_p`);n.searchParams.delete(`_b`),n.searchParams.delete(`_p`);let o=window.history.state,s=ma(`${n.pathname}${n.search}${n.hash}`,o?.main),c=ma(i??`/`,o?.bottom),l=ma(a??`/`,o?.pop);if(!i&&!a){let e=xa(t,s.pathname);e===`bottom`?(c=s,s=ma(`/`,o?.main)):e===`pop`&&(l=s,s=ma(`/`,o?.main))}return{main:Ca(s,t.mainTabs),bottom:wa(c,t.bottomTabs),pop:Ta(l)}}function Oa(e){let t=new URL(window.location.href),n=new URL(e.mainLocation.href,window.location.origin),r=ha(V());return n.pathname=yne(n.pathname,r),bne(n,t),n.searchParams.delete(`_b`),n.searchParams.delete(`_p`),e.bottomTabs.length>0&&n.searchParams.set(`_b`,e.bottomLocation.href),e.popLocation.pathname!==`/`&&n.searchParams.set(`_p`,e.popLocation.href),`${n.pathname}${n.search}${n.hash}`}function ka(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}function xne(){return{mainTabs:[...pne],bottomTabs:[...ua],updatedAt:0,mainLocation:ma(`/dashboard`),bottomLocation:ma(`/`),popLocation:ma(`/`)}}function Sne(){try{let e=localStorage.getItem(da());return e?pa(JSON.parse(e)):null}catch{return null}}function Cne(e){try{let t=localStorage.getItem(e);return t?pa(JSON.parse(t)):null}catch{return null}}function Aa(e,t=da()){try{localStorage.setItem(t,JSON.stringify(e))}catch{}}var wne=[({prevState:e,nextState:t,event:n})=>{if(n.type!==`MOVE_TAB`)return t;let r=e.bottomTabs.includes(n.tabId)?`bottom`:`main`;if(ya(e,r)!==n.tabId)return t;let i=r===`main`?e.mainLocation:e.bottomLocation,a=ma(i.href,i.state);return n.targetArea===`main`?{...t,mainLocation:a}:{...t,bottomLocation:a}},({nextState:e})=>e.mainTabs.length===0||ya(e,`main`)!=null?e:{...e,mainLocation:ma(e.mainTabs[0])}];function ja(e,t,n){let r=t;for(let t of wne)r=t({prevState:e,nextState:r,event:n});return r}function Ma(e,t){switch(t.type){case`NAVIGATE`:{let n=t.sourceArea===`pop`?`pop`:xa(e,t.location.pathname);return{nextState:n===`main`?{...e,mainLocation:t.location}:n===`bottom`?{...e,bottomLocation:t.location}:{...e,popLocation:t.location},changed:!0,urlAction:t.action,notify:n===t.sourceArea?[]:[{area:n,type:t.action}],persist:`none`}}case`POPSTATE`:return{nextState:{...e,mainLocation:t.mainLocation,bottomLocation:t.bottomLocation,popLocation:t.popLocation},changed:!0,notify:[{area:`main`,type:`BACK`},{area:`bottom`,type:`BACK`},{area:`pop`,type:`BACK`}],persist:`none`};case`MOVE_TAB`:{let n=e.bottomTabs.includes(t.tabId)?`bottom`:`main`;if(n===t.targetArea)return{nextState:e,changed:!1,notify:[],persist:`none`};let r=e.mainTabs.filter(e=>e!==t.tabId),i=e.bottomTabs.filter(e=>e!==t.tabId),a=t.targetArea===`main`?[...r,t.tabId]:r,o=t.targetArea===`bottom`?[...i,t.tabId]:i,s=e.mainLocation,c=e.bottomLocation;return va((n===`main`?e.mainLocation:e.bottomLocation).pathname)===t.tabId&&(n===`main`?s=ma(`/`):c=ma(`/`)),{nextState:{...e,mainTabs:a,bottomTabs:o,mainLocation:s,bottomLocation:c},changed:!0,urlAction:`REPLACE`,notify:[{area:`main`,type:`REPLACE`},{area:`bottom`,type:`REPLACE`}],persist:`local_and_remote`}}case`REORDER`:{let n=t.area===`main`?e.mainTabs:e.bottomTabs,r=new Set(n),i=t.tabIds.filter(e=>r.has(e));for(let e of n)i.includes(e)||i.push(e);return ka(n,i)?{nextState:e,changed:!1,notify:[],persist:`none`}:{nextState:t.area===`main`?{...e,mainTabs:i}:{...e,bottomTabs:i},changed:!0,notify:[],persist:`local_and_remote`}}case`CLOSE_TAB`:{let n=e.bottomTabs.includes(t.tabId),r=e.mainTabs.includes(t.tabId);return!n&&!r?{nextState:e,changed:!1,notify:[],persist:`none`}:n?va(e.bottomLocation.pathname)===t.tabId?{nextState:{...e,bottomLocation:ma(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`}:va(e.mainLocation.pathname)===t.tabId?{nextState:{...e,mainLocation:ma(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`}}case`ACTIVATE_BOTTOM`:return xa(e,t.location.pathname)===`bottom`?{nextState:{...e,bottomLocation:t.location},changed:!0,urlAction:`PUSH`,notify:[{area:`bottom`,type:`PUSH`}],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`};case`DEACTIVATE_BOTTOM`:return e.bottomLocation.pathname===`/`?{nextState:e,changed:!1,notify:[],persist:`none`}:{nextState:{...e,bottomLocation:ma(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`};case`ACTIVATE_POP`:return xa(e,t.location.pathname)===`pop`?{nextState:{...e,popLocation:t.location},changed:!0,urlAction:`PUSH`,notify:[{area:`pop`,type:`PUSH`}],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`};case`DEACTIVATE_POP`:return e.popLocation.pathname===`/`?{nextState:e,changed:!1,notify:[],persist:`none`}:{nextState:{...e,popLocation:ma(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`};case`APPLY_LAYOUT`:{let n=Sa(t.layout);return!(t.layout.updatedAt!==e.updatedAt||!ka(e.mainTabs,n.mainTabs)||!ka(e.bottomTabs,n.bottomTabs))||!t.force&&t.layout.updatedAt<=e.updatedAt?{nextState:e,changed:!1,notify:[],persist:`none`}:{nextState:{...e,mainTabs:n.mainTabs,bottomTabs:n.bottomTabs,updatedAt:t.layout.updatedAt},changed:!0,urlAction:`REPLACE`,notify:[{area:`main`,type:`REPLACE`},{area:`bottom`,type:`REPLACE`}],persist:`local_only`}}}}function Na(e,t,n){return n===`main`?e.mainLocation.href!==t.mainLocation.href:n===`bottom`?e.bottomLocation.href!==t.bottomLocation.href:e.popLocation.href!==t.popLocation.href}function Tne(e,t,n){let r=[...e];for(let e of[`main`,`bottom`,`pop`])Na(t,n,e)&&(r.some(t=>t.area===e)||r.push({area:e,type:`REPLACE`}));return r}var Pa=new class{mainHistory=null;bottomHistory=null;popHistory=null;state=xne();listeners=new Set;snapshotCache=null;persistTimer=null;kvUnsubscribe=null;initialized=!1;storageKey=typeof window>`u`?`nav-layout`:R(`nav-layout`,window.location);constructor(){if(typeof window>`u`)return;let e=z()?null:Sne();if(e!=null){let t=Sa(e);this.state={...this.state,mainTabs:t.mainTabs,bottomTabs:t.bottomTabs,updatedAt:e.updatedAt}}let t=Da(window.location,this.state),n=Ea({...this.state,mainLocation:t.main,bottomLocation:t.bottom,popLocation:t.pop});n=Ea(ja(n,n,{type:`BOOTSTRAP`})),this.state=n,this.normalizeUrl(),window.addEventListener(`popstate`,this.handlePopState)}setHistoryRef(e,t){e===`main`?this.mainHistory=t:e===`bottom`?this.bottomHistory=t:this.popHistory=t}getLocation(e){return e===`main`?this.state.mainLocation:e===`bottom`?this.state.bottomLocation:this.state.popLocation}push(e,t,n){this.dispatch({type:`NAVIGATE`,sourceArea:e,action:`PUSH`,location:ma(_a(t),n)})}replace(e,t,n){this.dispatch({type:`NAVIGATE`,sourceArea:e,action:`REPLACE`,location:ma(_a(t),n)})}createHref(e,t,n){if(typeof window>`u`)return t;let{nextState:r}=this.computeTransition({type:`NAVIGATE`,sourceArea:e,action:`PUSH`,location:ma(_a(t),n)});return Oa(r)}get mainTabs(){return this.state.mainTabs}get bottomTabs(){return this.state.bottomTabs}getAreaForPath(e){return xa(this.state,e)}moveTab(e,t){this.dispatch({type:`MOVE_TAB`,tabId:e,targetArea:t})}reorder(e,t){this.dispatch({type:`REORDER`,area:e,tabIds:t})}closeTab(e){this.dispatch({type:`CLOSE_TAB`,tabId:e})}activateBottom(e){this.dispatch({type:`ACTIVATE_BOTTOM`,location:ma(e)})}deactivateBottom(){this.dispatch({type:`DEACTIVATE_BOTTOM`})}activatePop(e){this.dispatch({type:`ACTIVATE_POP`,location:ma(e)})}deactivatePop(){this.dispatch({type:`DEACTIVATE_POP`})}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getSnapshot(){if(this.snapshotCache)return this.snapshotCache;let e=va(this.state.bottomLocation.pathname);return this.snapshotCache={mainTabs:[...this.state.mainTabs],bottomTabs:[...this.state.bottomTabs],mainLocation:this.state.mainLocation,bottomLocation:this.state.bottomLocation,popLocation:this.state.popLocation,bottomActive:e!=null&&this.state.bottomTabs.includes(e),popActive:this.state.popLocation.pathname!==`/`},this.snapshotCache}async init(){if(!(this.initialized||z())){this.initialized=!0;try{let e=await this.resolveProjectScopedStorageKey();e&&e!==this.storageKey&&(this.storageKey=e,this.rebindProjectScopedLayout(e));let{trpcClient:t}=await c(async()=>{let{trpcClient:e}=await import(`./trpc-0wHaJTCK.js`);return{trpcClient:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8])),n=pa(await t.kv.get.query({key:this.storageKey}));n?n.updatedAt>this.state.updatedAt?this.dispatch({type:`APPLY_LAYOUT`,layout:n}):this.state.updatedAt>n.updatedAt&&t.kv.set.mutate({key:this.storageKey,value:{mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:this.state.updatedAt}}).catch(()=>{}):this.state.updatedAt>0&&t.kv.set.mutate({key:this.storageKey,value:{mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:this.state.updatedAt}}).catch(()=>{});let r=t.kv.subscribe.subscribe({key:this.storageKey},{onData:e=>{let t=pa(e);t&&this.dispatch({type:`APPLY_LAYOUT`,layout:t})}});this.kvUnsubscribe=()=>r.unsubscribe()}catch{}}}destroy(){typeof window<`u`&&window.removeEventListener(`popstate`,this.handlePopState),this.cancelPersistTimer(),this.kvUnsubscribe&&=(this.kvUnsubscribe(),null)}handlePopState=()=>{let e=Da(window.location,this.state);this.dispatch({type:`POPSTATE`,mainLocation:e.main,bottomLocation:e.bottom,popLocation:e.pop})};computeTransition(e){let t=Ma(this.state,e);if(!t.changed)return{transition:t,nextState:this.state};let n=ja(this.state,t.nextState,e);return n=Ea(n),{transition:t,nextState:n}}dispatch(e){if(typeof window<`u`&&e.type!==`POPSTATE`&&this.mainHistory==null){let e=Da(window.location,this.state);this.state=Ea({...this.state,mainLocation:e.main,bottomLocation:e.bottom,popLocation:e.pop})}let t=Ma(this.state,e);if(!t.changed)return;let n=this.state,r=ja(n,t.nextState,e);r=Ea(r),this.state=r,t.persist===`local_and_remote`?this.persistLayout():t.persist===`local_only`&&(this.cancelPersistTimer(),Aa({mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:this.state.updatedAt},this.storageKey));let i=t.urlAction??(Na(n,this.state,`main`)||Na(n,this.state,`bottom`)||Na(n,this.state,`pop`)?`REPLACE`:void 0);i&&this.syncToUrl(i);let a=Tne(t.notify,n,this.state);this.notifyRouters(a),this.notifyListeners()}notifyRouters(e){for(let t of e)(t.area===`main`?this.mainHistory:t.area===`bottom`?this.bottomHistory:this.popHistory)?.notify({type:t.type})}notifyListeners(){this.snapshotCache=null;for(let e of this.listeners)e()}syncToUrl(e){let t=Oa(this.state),n=`${window.location.pathname}${window.location.search}${window.location.hash}`;if(e===`REPLACE`&&t===n)return;let r={main:this.state.mainLocation.state,bottom:this.state.bottomLocation.state,pop:this.state.popLocation.state};e===`PUSH`?window.history.pushState(r,``,t):window.history.replaceState(r,``,t)}normalizeUrl(){let e=Oa(this.state);if(e===`${window.location.pathname}${window.location.search}${window.location.hash}`)return;let t={main:this.state.mainLocation.state,bottom:this.state.bottomLocation.state,pop:this.state.popLocation.state};window.history.replaceState(t,``,e)}cancelPersistTimer(){this.persistTimer&&=(clearTimeout(this.persistTimer),null)}persistLayout(){let e=Date.now();this.state={...this.state,updatedAt:e},Aa({mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:e},this.storageKey),this.cancelPersistTimer(),this.persistTimer=setTimeout(()=>{this.persistTimer=null,c(async()=>{let{trpcClient:e}=await import(`./trpc-0wHaJTCK.js`);return{trpcClient:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(({trpcClient:t})=>t.kv.set.mutate({key:this.storageKey,value:{mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:e}})).catch(()=>{})},gne)}async resolveProjectScopedStorageKey(){try{let e=await j(D());if(!e.ok)return null;let t=await e.json();return typeof t.projectDir!=`string`||t.projectDir.length===0?null:hne(t.projectDir)}catch{return null}}rebindProjectScopedLayout(e){let t=Cne(e);if(t){this.dispatch({type:`APPLY_LAYOUT`,layout:t,force:!0});return}this.state=Ea({...this.state,updatedAt:0}),this.normalizeUrl(),this.notifyListeners()}};typeof window<`u`&&!z()&&Pa.init();function Fa(){return(0,q.useSyncExternalStore)(e=>Pa.subscribe(e),()=>Pa.getSnapshot(),()=>Pa.getSnapshot())}function Ia(e){let t=L();if(!t)return;let n=new URLSearchParams(e.hash.slice(1));n.set(F,t),e.hash=n.toString()}function Ene(e){let{handoff:t,location:n}=e,r=new URL(n.href),i=new URL(t.serverUrl);return O({search:n.search}).hosted?(i.pathname=r.pathname,i.search=r.search,i.hash=r.hash,i.searchParams.set(`api`,t.serverUrl),Ia(i),i.toString()):(i.pathname=r.pathname,i.search=r.search,i.hash=r.hash,Ia(i),i.toString())}function La(e){window.location.assign(Ene(e))}var Ra=`gitScope`;function Dne(e){return new URLSearchParams(e).get(`gitScope`)===`planning`?`planning`:`code`}function za(e){return e.type===`commit`?e.hash:`uncommitted`}function Ba(e,t,n=``){let r=new URLSearchParams(n);t===`planning`?r.set(Ra,t):r.delete(Ra);let i=r.toString();return`${e}${i?`?${i}`:``}`}function One(e,t,n){return n.type===`commit`?[`git`,e,t,`meta`,`commit`,n.hash]:[`git`,e,t,`meta`,`uncommitted`]}function kne(e,t,n){return n.type===`commit`?[`git`,e,t,`files`,`commit`,n.hash]:[`git`,e,t,`files`,`uncommitted`]}function Ane(e,t,n,r){return[`git`,e,t,`patch`,n.type===`commit`?`commit:${n.hash}`:`uncommitted`,r]}function jne(e){return e.type===`commit`?{type:`commit`,hash:e.hash}:{type:`uncommitted`}}function Mne(e,t=`code`,n=``){return Ba(e.type===`commit`?`/git/commit/${e.hash}`:`/git/uncommitted`,t,n)}function Nne(e,t=`code`,n=``){return Mne(jne(e),t,n)}var Pne={"7d":7,"30d":30,"90d":90,all:null},Fne=/^(\d{4})-(\d{2})-(\d{2})(?:-|$)/;function Ine(e){let t=Fne.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),a=Date.UTC(n,r-1,i),o=new Date(a);return!Number.isFinite(a)||o.getUTCFullYear()!==n||o.getUTCMonth()!==r-1||o.getUTCDate()!==i?null:a}function Va(e){return Ine(e.id)??e.updatedAt}function Lne(e,t,n=Date.now()){let r=Pne[t];return r===null?!0:Va(e)>=n-r*24*60*60*1e3}function Rne(e,t){return t.updatedAt-e.updatedAt||e.id.localeCompare(t.id)}function zne(e){return[...e].sort(Rne)}function Bne(e,t=10){return zne(e).slice(0,Math.max(0,Math.trunc(t)))}function Vne(e,t=10){return[...e].sort((e,t)=>Va(t)-Va(e)||e.id.localeCompare(t.id)).slice(0,Math.max(0,Math.trunc(t)))}var Ha=[`timeout`,`memory-limit`,`runtime`,`abort`];async function Hne(e,t={}){let n=new AbortController,r=[],i=t.signal,a=Une(t.timeoutMs);if(i)if(i.aborted)n.abort(i.reason);else{let e=()=>n.abort(i.reason);i.addEventListener(`abort`,e,{once:!0}),r.push(()=>i.removeEventListener(`abort`,e))}if(n.signal.aborted)return r.forEach(e=>e()),{ok:!1,error:Ua(n.signal.reason,i)};let o,s,c=Promise.resolve().then(()=>e(n.signal));c.catch(()=>void 0);let l=[c];n.signal.aborted||l.push(new Promise((e,t)=>{let i=()=>t(new DOMException(`Translation cancelled.`,`AbortError`));n.signal.addEventListener(`abort`,i,{once:!0}),r.push(()=>n.signal.removeEventListener(`abort`,i))})),a!==void 0&&l.push(new Promise((e,t)=>{o=setTimeout(()=>{s=Error(`Translation task timed out after ${a}ms.`),n.abort(s),t(s)},a)}));try{return{ok:!0,value:await Promise.race(l)}}catch(e){return n.abort(e),s&&n.signal.reason===s?{ok:!1,error:{kind:`timeout`,message:s.message}}:{ok:!1,error:Ua(e,i)}}finally{o&&clearTimeout(o),r.forEach(e=>e())}}function Ua(e,t){if(qne(e))return e;if(t?.aborted)return{kind:`abort`,message:Wa(t.reason)??`Translation cancelled.`};if(e instanceof DOMException&&e.name===`AbortError`)return{kind:`abort`,message:Wa(e)??`Translation cancelled.`};let n=Wne(e);return Gne(n)?{kind:`timeout`,message:n}:Kne(n)?{kind:`memory-limit`,message:n}:{kind:`runtime`,message:n}}function Une(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.floor(e):void 0}function Wne(e){return e instanceof Error&&e.message.trim().length>0?e.message:typeof e==`string`&&e.trim().length>0?e:`Translation failed.`}function Wa(e){if(e instanceof Error&&e.message.trim().length>0)return e.message;if(typeof e==`string`&&e.trim().length>0)return e}function Gne(e){return/\btime(?:d)?\s*out\b/i.test(e)}function Kne(e){return/out of memory/i.test(e)||/memory limit/i.test(e)||/insufficient memory/i.test(e)||/ERR_WORKER_OUT_OF_MEMORY/i.test(e)}function qne(e){if(typeof e!=`object`||!e)return!1;let t=Reflect.get(e,`kind`),n=Reflect.get(e,`message`);return typeof t==`string`&&Ha.includes(t)&&typeof n==`string`&&n.length>0}var Ga=[`browser`,`local`,`local-ct2`,`local-llama`,`openai`],Ka=l(Ga),qa=`browser`;function Ja(e){return e===`local`||e===`local-ct2`||e===`local-llama`}function Ya(e){return e===`local`||e===`local-ct2`}l([`local`,`local-ct2`,`local-llama`,`openai`]);var Xa=15e3,Za=l([`not-downloaded`,`queued`,`downloading`,`paused`,`downloaded`,`error`,`deleting`]),Qa=m({path:x().min(1),sizeBytes:b().int().nonnegative().optional(),required:f(),etag:x().min(1).optional(),revision:x().min(1).optional(),sourceUrl:x().min(1).optional(),raw:w().optional()}),Jne=m({id:x().min(1),label:x().min(1),description:x().optional(),profile:x().min(1).optional(),dtype:x().min(1).optional(),estimatedTotalBytes:b().int().nonnegative().optional(),baseGroupId:x().min(1).optional(),commitHash:x().min(1).optional(),shortCommitHash:x().min(1).optional(),rootDir:x().min(1).optional(),status:Za.optional(),progress:b().min(0).max(1).optional(),bytesDownloaded:b().int().nonnegative().optional(),totalBytes:b().int().nonnegative().optional(),resumable:f().optional(),error:x().optional(),selectable:f(),selected:f(),files:p(Qa)}),Yne=l([`idle`,`loading`,`ready`,`error`]),Xne=m({path:x().min(1),sizeBytes:b().int().nonnegative().optional(),required:f(),etag:x().min(1).optional(),revision:x().min(1).optional(),sourceUrl:x().min(1).optional(),raw:w().optional()}),Zne=m({id:x().min(1),baseGroupId:x().min(1),label:x().min(1),displayLabel:x().min(1),description:x().optional(),profile:x().min(1).optional(),dtype:x().min(1).optional(),commitHash:x().min(1),shortCommitHash:x().min(1),rootDir:x().min(1),estimatedTotalBytes:b().int().nonnegative().optional(),selectable:f(),files:p(Xne)}),Qne=m({modelId:x().min(1),source:_(`huggingface`),endpoint:x().default(``),revision:x().min(1),commitHash:x().min(1),shortCommitHash:x().min(1),fetchedAt:b().int().nonnegative(),updatedAt:b().int().nonnegative(),raw:w().optional(),groups:g(x(),Zne).default({}),groupOrder:p(x().min(1)).default([])}),$ne=m({path:x().min(1),sizeBytes:b().int().nonnegative().optional(),downloadedBytes:b().int().nonnegative().optional(),required:f().default(!0),status:Za.default(`not-downloaded`),updatedAt:b().int().nonnegative().optional(),error:x().optional()}),ere=m({groupId:x().min(1),baseGroupId:x().min(1).optional(),status:Za.default(`not-downloaded`),rootDir:x().min(1).optional(),bytesDownloaded:b().int().nonnegative().optional(),totalBytes:b().int().nonnegative().optional(),progress:b().min(0).max(1).optional(),resumable:f().default(!1),error:x().optional(),installedAt:b().int().nonnegative().optional(),updatedAt:b().int().nonnegative().optional(),files:p($ne).default([])}),$a=m({status:Yne.default(`idle`),message:x().optional(),error:x().optional(),updatedAt:b().int().nonnegative().optional()});m({engineId:l([`local`,`local-ct2`,`local-llama`]),modelId:x().min(1),selectedGroupId:x().min(1).optional(),groupId:x().min(1).optional(),status:Za,message:x(),progress:b().min(0).max(1).optional(),bytesDownloaded:b().int().nonnegative().optional(),totalBytes:b().int().nonnegative().optional(),sessionId:x().optional(),resumable:f().optional(),files:p(m({path:x().min(1),sizeBytes:b().int().nonnegative().optional(),downloadedBytes:b().int().nonnegative().optional()})).optional(),updatedAt:b().int().nonnegative()});var tre=m({modelId:x().min(1),estimatedTotalBytes:b().int().nonnegative().optional(),files:p(Qa),profile:x().min(1).optional(),selectedGroupId:x().min(1).optional(),groups:p(Jne).optional()});m({modelId:x().min(1),version:_(2).default(2),status:Za.default(`not-downloaded`),selected:f().default(!1),selectedGroupId:x().min(1).optional(),installedAt:b().int().nonnegative().optional(),updatedAt:b().int().nonnegative().optional(),bytesDownloaded:b().int().nonnegative().optional(),totalBytes:b().int().nonnegative().optional(),progress:b().min(0).max(1).optional(),resumable:f().default(!1),error:x().optional(),profileLoad:$a.default($a.parse({})),profileManifest:Qne.optional(),groupsState:g(x(),ere).default({}),plan:tre.optional(),files:p(m({path:x().min(1),sizeBytes:b().int().nonnegative().optional(),downloadedBytes:b().int().nonnegative().optional()})).default([])}),l([`local`,`network`,`recommended`]);var nre=l([`installed`,`installing`,`missing`,`error`,`not-applicable`]),rre=l([`ready`,`probing`,`failed`,`error`,`not-applicable`]),ire=l([`ready`,`missing`,`downloading`,`error`,`not-applicable`]),eo=m({message:x().optional(),progress:b().min(0).max(1).optional(),error:x().optional()}),to=m({dependency:eo.extend({state:nre}),runtime:eo.extend({state:rre}),assets:eo.extend({state:ire}),summary:x().optional()});function no(e={}){return{dependency:{state:`not-applicable`,...e.dependency},runtime:{state:`not-applicable`,...e.runtime},assets:{state:`not-applicable`,...e.assets},...e.summary?{summary:e.summary}:{}}}function are(e){return e.dependency.state===`installed`||e.dependency.state===`not-applicable`}function ore(e){return e.runtime.state===`ready`||e.runtime.state===`not-applicable`}function ro(e){return e?!are(e)||!ore(e):!1}function io(e){if(e)return e.summary??e.runtime.error??e.runtime.message??e.dependency.error??e.dependency.message??e.assets.error??e.assets.message}var ao=l([`stdout`,`stderr`]);m({stream:ao,text:x()}),N(`type`,[m({type:_(`status`),lifecycle:to}),m({type:_(`log`),stream:ao,text:x()}),m({type:_(`exit`),lifecycle:to})]);var sre=[{id:`browser`,label:`Browser`,description:`Uses the browser Translator API and future browser-side providers.`,technicalSummary:`Browser-native Web Translator adapter. Package payload is about 5 KB; browser language packs are managed by the browser.`,runtime:`browser`,kind:`browser`,installDescription:`Browser translation support is built into the browser runtime.`,moduleName:`@openspecui/browser-translator`,factoryExport:`createBrowserTranslatorFactory`},{id:`local`,label:`Local-Transformers`,description:`Runs an ONNX Runtime-backed local translation adapter through Transformers.js with managed ONNX model files.`,technicalSummary:`Server-side ONNX Runtime adapter via Transformers.js. Runtime package is installed on demand; selected ONNX model groups are downloaded separately and can range from tens to hundreds of MB.`,runtime:`server`,kind:`managed-local`,settingsKey:`local`,defaultModel:`Xenova/nllb-200-distilled-600M`,runtimePackageName:`@huggingface/transformers`,installDescription:`Install the Local-Transformers runtime package to enable server-side translation.`,modelLabel:`Local Model`,downloadGroupsLabel:`Local download profiles`,refreshTooltip:`Refresh local model profiles`,moduleName:`@openspecui/local-translator`,factoryExport:`createLocalTranslatorFactory`},{id:`local-ct2`,label:`Local-CT2`,description:`Runs a bundled local CTranslate2 translation runtime with managed model files.`,technicalSummary:`Server-side native CTranslate2 adapter. Runtime package is installed on demand; selected model artifacts are downloaded separately and can range from tens to hundreds of MB.`,runtime:`server`,kind:`managed-local`,settingsKey:`localCt2`,defaultModel:`ooeoeo/opus-mt-en-zh-ct2-float16`,runtimePackageName:`ctranslate2`,installDescription:`Install the Local-CT2 runtime package to enable server-side translation.`,modelLabel:`CT2 Model`,downloadGroupsLabel:`Local CT2 download groups`,refreshTooltip:`Refresh local model artifacts`,moduleName:`@openspecui/local-ct2-translator`,factoryExport:`createLocalCt2TranslatorFactory`},{id:`local-llama`,label:`Local-Llama`,description:`Runs a local GGUF translation-capable LLM through node-llama-cpp with managed GGUF model files.`,technicalSummary:`Server-side llama.cpp adapter via node-llama-cpp. Runtime package is installed on demand; selected GGUF model files are downloaded separately and can range from hundreds of MB to multiple GB.`,runtime:`server`,kind:`managed-local`,settingsKey:`localLlama`,defaultModel:`bartowski/Qwen2.5-0.5B-Instruct-GGUF`,runtimePackageName:`node-llama-cpp`,installDescription:`Install the Local-Llama runtime package to enable server-side GGUF translation.`,modelLabel:`Llama Model`,downloadGroupsLabel:`Local GGUF files`,refreshTooltip:`Refresh local GGUF artifacts`,moduleName:`@openspecui/local-llama-translator`,factoryExport:`createLocalLlamaTranslatorFactory`},{id:`openai`,label:`OpenAI-Completion`,description:`Uses an OpenAI-compatible TanStack AI completion provider for context-aware translation.`,technicalSummary:`Server-side TanStack AI adapter for OpenAI-compatible APIs. Package payload is about 5 KB; model size stays with the remote provider.`,runtime:`server`,kind:`remote-provider`,settingsKey:`openai`,defaultModel:`gpt-4.1-mini`,installDescription:`OpenAI completion translation is bundled with the server runtime.`,moduleName:`@openspecui/openai-completion-translator`,factoryExport:`createOpenAICompletionTranslatorFactory`}];function oo(e){let t=sre.find(t=>t.id===e);if(!t)throw Error(`Unknown translation engine: ${e}`);return t}function cre(e){let t=oo(e);if(t.kind!==`managed-local`)throw Error(`Translation engine ${e} is not a managed-local engine.`);return t}var lre=m({baseUrl:x().default(``),token:x().default(``),model:x().default(`gpt-4.1-mini`)}),ure=m({baseUrl:x().optional(),token:x().optional(),model:x().optional()}),so=m({model:x().default(`Xenova/nllb-200-distilled-600M`),selectedGroupId:x().optional(),hfEndpoint:x().default(``),memoryBudgetPercent:b().min(0).max(100).default(25)}),dre=m({model:x().min(1).optional(),selectedGroupId:x().min(1).nullable().optional(),hfEndpoint:x().optional(),memoryBudgetPercent:b().min(0).max(100).optional()}),co=m({model:x().default(`ooeoeo/opus-mt-en-zh-ct2-float16`),selectedGroupId:x().optional(),hfEndpoint:x().default(``),memoryBudgetPercent:b().min(0).max(100).default(25)}),fre=m({model:x().min(1).optional(),selectedGroupId:x().min(1).nullable().optional(),hfEndpoint:x().optional(),memoryBudgetPercent:b().min(0).max(100).optional()}),lo=m({model:x().default(`bartowski/Qwen2.5-0.5B-Instruct-GGUF`),selectedGroupId:x().optional(),hfEndpoint:x().default(``),memoryBudgetPercent:b().min(0).max(100).default(25)}),pre=m({model:x().min(1).optional(),selectedGroupId:x().min(1).nullable().optional(),hfEndpoint:x().optional(),memoryBudgetPercent:b().min(0).max(100).optional()});m({engineId:Ka.default(qa),openai:lre.default(lre.parse({})),local:so.default(so.parse({})),localCt2:co.default(co.parse({})),localLlama:lo.default(lo.parse({}))}),m({engineId:Ka.optional(),openai:ure.optional(),local:dre.optional(),localCt2:fre.optional(),localLlama:pre.optional()}),m({engineId:Ka,sourceLanguage:x().min(1),targetLanguage:x().min(1),model:x().min(1).optional(),selectedGroupId:x().min(1).optional(),inputs:p(x()).min(1),instructions:x().optional(),context:x().optional(),timeoutMs:b().int().positive().default(Xa)}),m({index:b().int().nonnegative(),output:x().optional(),error:m({kind:l(Ha),message:x().min(1)}).optional()});var uo=l([`direct`,`bilingual`]),mre=m({local:m({model:x().min(1).optional(),selectedGroupId:x().min(1).optional()}).default({}),localCt2:m({model:x().min(1).optional(),selectedGroupId:x().min(1).optional()}).default({}),localLlama:m({model:x().min(1).optional(),selectedGroupId:x().min(1).optional()}).default({}),openai:m({model:x().min(1).optional()}).default({})}).default({}),hre=m({local:m({model:x().min(1).optional(),selectedGroupId:x().min(1).nullable().optional()}).optional(),localCt2:m({model:x().min(1).optional(),selectedGroupId:x().min(1).nullable().optional()}).optional(),localLlama:m({model:x().min(1).optional(),selectedGroupId:x().min(1).nullable().optional()}).optional(),openai:m({model:x().min(1).optional()}).optional()}),fo=m({enabled:f().default(!1),targetLanguage:x().min(1).default(`zh`),displayMode:uo.default(`direct`),cacheEnabled:f().default(!1),engineId:Ka.default(qa),engines:mre});m({enabled:f().optional(),targetLanguage:x().min(1).optional(),displayMode:uo.optional(),cacheEnabled:f().optional(),engineId:Ka.optional(),engines:hre.optional()});var po=1e4,mo=2e5;m({entryLimit:b().int().min(100).max(mo).default(po)}),m({entryLimit:b().int().min(100).max(mo).optional()}),m({key:x().min(1),keyHash:x().min(1),sourceText:x(),translatedText:x(),targetNodesJson:x().optional(),sourceLanguage:x().min(1),targetLanguage:x().min(1),placeholderTopologyHash:x().min(1),attributeTopologyHash:x().min(1),displayPolicyVersion:b().int().positive(),engineId:Ka.default(qa),engineVersion:x().optional(),model:x().optional(),translatorContractVersion:b().int().positive().default(1),createdAt:b().int().nonnegative(),lastAccessedAt:b().int().nonnegative()}).omit({createdAt:!0,lastAccessedAt:!0}),m({keyHash:x().min(1)}),m({enabled:f(),entryLimit:b().int().positive(),entries:b().int().nonnegative(),databasePath:x().optional()});var gre=`project`,_re=/^[A-Za-z]:\//;function ho(e){return e.replace(/\\/g,`/`).replace(/\/+$/g,``)}function vre(e){return e.startsWith(`/`)||_re.test(e)}function yre(e){return e.replace(/^\.?\//,``)}function go(e){return ho(e).split(`/`).filter(Boolean)}function bre(e){let t=ho(e),n=/(?:^|\/)node_modules\/(?:\.pnpm\/[^/]+\/node_modules\/)?(@[^/]+\/[^/]+|[^/]+)(\/.*)?/.exec(t),r=n?.[1];return r?`npm:${r}${n[2]??``}`:null}function _o(e){return`${gre}:${yre(e)}`}function xre(e,t){let n=ho(e),r=ho(t),i=n.toLowerCase(),a=r.toLowerCase();return a===i||a.startsWith(`${i}/`)}function Sre(e,t){let n=go(e),r=go(t),i=0;for(;i<n.length&&i<r.length&&n[i]?.toLowerCase()===r[i]?.toLowerCase();)i+=1;return r.slice(i).join(`/`)}function Cre(e){let t=go(e),n=t.lastIndexOf(`openspec`);return n<0?null:t.slice(n).join(`/`)}function vo(e,t){let n=ho(e),r=bre(n);return(t?.source===`package`||r)&&r?r:vre(n)?t?.projectDir&&xre(t.projectDir,n)?_o(Sre(t.projectDir,n)):_o(Cre(n)||go(n).slice(-4).join(`/`)):_o(n)}var yo=Symbol.for(`yaml.alias`),bo=Symbol.for(`yaml.document`),xo=Symbol.for(`yaml.map`),So=Symbol.for(`yaml.pair`),Co=Symbol.for(`yaml.scalar`),wo=Symbol.for(`yaml.seq`),To=Symbol.for(`yaml.node.type`),Eo=e=>!!e&&typeof e==`object`&&e[To]===yo,Do=e=>!!e&&typeof e==`object`&&e[To]===bo,Oo=e=>!!e&&typeof e==`object`&&e[To]===xo,ko=e=>!!e&&typeof e==`object`&&e[To]===So,Ao=e=>!!e&&typeof e==`object`&&e[To]===Co,jo=e=>!!e&&typeof e==`object`&&e[To]===wo;function Mo(e){if(e&&typeof e==`object`)switch(e[To]){case xo:case wo:return!0}return!1}function No(e){if(e&&typeof e==`object`)switch(e[To]){case yo:case xo:case Co:case wo:return!0}return!1}var Po=e=>(Ao(e)||Mo(e))&&!!e.anchor,Fo=Symbol(`break visit`),Io=Symbol(`skip children`),Lo=Symbol(`remove node`);function Ro(e,t){let n=Ho(t);Do(e)?zo(null,e.contents,n,Object.freeze([e]))===Lo&&(e.contents=null):zo(null,e,n,Object.freeze([]))}Ro.BREAK=Fo,Ro.SKIP=Io,Ro.REMOVE=Lo;function zo(e,t,n,r){let i=wre(e,t,n,r);if(No(i)||ko(i))return Tre(e,r,i),zo(e,i,n,r);if(typeof i!=`symbol`){if(Mo(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=zo(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Fo)return Fo;else i===Lo&&(t.items.splice(e,1),--e)}}else if(ko(t)){r=Object.freeze(r.concat(t));let e=zo(`key`,t.key,n,r);if(e===Fo)return Fo;e===Lo&&(t.key=null);let i=zo(`value`,t.value,n,r);if(i===Fo)return Fo;i===Lo&&(t.value=null)}}return i}async function Bo(e,t){let n=Ho(t);Do(e)?await Vo(null,e.contents,n,Object.freeze([e]))===Lo&&(e.contents=null):await Vo(null,e,n,Object.freeze([]))}Bo.BREAK=Fo,Bo.SKIP=Io,Bo.REMOVE=Lo;async function Vo(e,t,n,r){let i=await wre(e,t,n,r);if(No(i)||ko(i))return Tre(e,r,i),Vo(e,i,n,r);if(typeof i!=`symbol`){if(Mo(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await Vo(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Fo)return Fo;else i===Lo&&(t.items.splice(e,1),--e)}}else if(ko(t)){r=Object.freeze(r.concat(t));let e=await Vo(`key`,t.key,n,r);if(e===Fo)return Fo;e===Lo&&(t.key=null);let i=await Vo(`value`,t.value,n,r);if(i===Fo)return Fo;i===Lo&&(t.value=null)}}return i}function Ho(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function wre(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(Oo(t))return n.Map?.(e,t,r);if(jo(t))return n.Seq?.(e,t,r);if(ko(t))return n.Pair?.(e,t,r);if(Ao(t))return n.Scalar?.(e,t,r);if(Eo(t))return n.Alias?.(e,t,r)}function Tre(e,t,n){let r=t[t.length-1];if(Mo(r))r.items[e]=n;else if(ko(r))e===`key`?r.key=n:r.value=n;else if(Do(r))r.contents=n;else{let e=Eo(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var Ere={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},Dre=e=>e.replace(/[!,[\]{}]/g,e=>Ere[e]),Uo=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Dre(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&No(e.contents)){let t={};Ro(e.contents,(e,n)=>{No(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
7
|
+
`)}var _ee={willReadFrequently:!0},On=class e{static get experimentalLetterSpacingSupported(){let t=e._experimentalLetterSpacingSupported;if(t===void 0){let n=It.get().getCanvasRenderingContext2D().prototype;t=e._experimentalLetterSpacingSupported=`letterSpacing`in n||`textLetterSpacing`in n}return t}constructor(e,t,n,r,i,a,o,s,c,l){this.text=e,this.style=t,this.width=n,this.height=r,this.lines=i,this.lineWidths=a,this.lineHeight=o,this.maxLineWidth=s,this.fontProperties=c,l&&(this.runsByLine=l.runsByLine,this.lineAscents=l.lineAscents,this.lineDescents=l.lineDescents,this.lineHeights=l.lineHeights,this.hasDropShadow=l.hasDropShadow)}static measureText(t=` `,n,r=e._canvas,i=n.wordWrap){let a=`${t}-${n.styleKey}-wordWrap-${i}`;if(e._measurementCache.has(a))return e._measurementCache.get(a);if(vn(n)&&yn(t)){let r=fee(t,n,i,e._context,e._measureText,e.measureFont,e.canBreakChars,e.wordWrapSplit),o=new e(t,n,r.width,r.height,r.lines,r.lineWidths,r.lineHeight,r.maxLineWidth,r.fontProperties,{runsByLine:r.runsByLine,lineAscents:r.lineAscents,lineDescents:r.lineDescents,lineHeights:r.lineHeights,hasDropShadow:r.hasDropShadow});return e._measurementCache.set(a,o),o}let o=n._fontString,s=e.measureFont(o);s.fontSize===0&&(s.fontSize=n.fontSize,s.ascent=n.fontSize,s.descent=0);let c=e._context;c.font=o;let l=(i?e._wordWrap(t,n,r):t).split(uee),u=Array(l.length),d=0;for(let t=0;t<l.length;t++){let r=e._measureText(l[t],n.letterSpacing,c);u[t]=r,d=Math.max(d,r)}let f=n._stroke?.width??0,p=n.lineHeight||s.fontSize,m=e._getAlignWidth(d,n,i),h=e._adjustWidthForStyle(m,n),g=Math.max(p,s.fontSize+f)+(l.length-1)*(p+n.leading),_=new e(t,n,h,e._adjustHeightForStyle(g,n),l,u,p+n.leading,d,s);return e._measurementCache.set(a,_),_}static _adjustWidthForStyle(e,t){let n=e+(t._stroke?.width||0);return t.dropShadow&&(n+=t.dropShadow.distance),n}static _adjustHeightForStyle(e,t){let n=e;return t.dropShadow&&(n+=t.dropShadow.distance),n}static _getAlignWidth(e,t,n){return n&&t.align!==`left`&&t.align!==`justify`?Math.max(e,t.wordWrapWidth):e}static _measureText(t,n,r){let i=!1;e.experimentalLetterSpacingSupported&&(e.experimentalLetterSpacing?(r.letterSpacing=`${n}px`,r.textLetterSpacing=`${n}px`,i=!0):(r.letterSpacing=`0px`,r.textLetterSpacing=`0px`));let a=r.measureText(t),o=a.width,s=-(a.actualBoundingBoxLeft??0),c=(a.actualBoundingBoxRight??0)-s;if(o>0)if(i)o-=n,c-=n;else{let r=(e.graphemeSegmenter(t).length-1)*n;o+=r,c+=r}return Math.max(o,c)}static _wordWrap(t,n,r=e._canvas){return gee(t,n,r,e._measureText,e.canBreakWords,e.canBreakChars,e.wordWrapSplit)}static isBreakingSpace(e,t){return xn(e,t)}static canBreakWords(e,t){return t}static canBreakChars(e,t,n,r,i){return!0}static wordWrapSplit(t){return e.graphemeSegmenter(t)}static measureFont(t){if(e._fonts[t])return e._fonts[t];let n=e._context;n.font=t;let r=n.measureText(e.METRICS_STRING+e.BASELINE_SYMBOL),i=r.actualBoundingBoxAscent??0,a=r.actualBoundingBoxDescent??0,o={ascent:i,descent:a,fontSize:i+a};return e._fonts[t]=o,o}static clearMetrics(t=``){t?delete e._fonts[t]:e._fonts={}}static get _canvas(){if(!e.__canvas){let t;try{let n=new OffscreenCanvas(0,0);if(n.getContext(`2d`,_ee)?.measureText)return e.__canvas=n,n;t=It.get().createCanvas()}catch{t=It.get().createCanvas()}t.width=t.height=10,e.__canvas=t}return e.__canvas}static get _context(){return e.__context||=e._canvas.getContext(`2d`,_ee),e.__context}};On.METRICS_STRING=`|ÉqÅ`,On.BASELINE_SYMBOL=`M`,On.BASELINE_MULTIPLIER=1.4,On.HEIGHT_MULTIPLIER=2,On.graphemeSegmenter=(()=>{if(typeof Intl?.Segmenter==`function`){let e=new Intl.Segmenter;return t=>{let n=e.segment(t),r=[],i=0;for(let e of n)r[i++]=e.segment;return r}}return e=>[...e]})(),On.experimentalLetterSpacing=!1,On._fonts={},On._measurementCache=iee(1e3);var kn=On,vee=[`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`,`system-ui`];function An(e){let t=typeof e.fontSize==`number`?`${e.fontSize}px`:e.fontSize,n=e.fontFamily;Array.isArray(e.fontFamily)||(n=e.fontFamily.split(`,`));for(let e=n.length-1;e>=0;e--){let t=n[e].trim();!/([\"\'])[^\'\"]+\1/.test(t)&&!vee.includes(t)&&(t=`"${t}"`),n[e]=t}return`${e.fontStyle} ${e.fontVariant} ${e.fontWeight} ${t} ${n.join(`,`)}`}var jn=class e extends kt{constructor(t={}){super(),this.uid=Tt(`textStyle`),this._tick=0,this._cachedFontString=null,yee(t),t instanceof e&&(t=t._toObject());let n={...e.defaultTextStyle,...t};for(let e in n){let t=e;this[t]=n[e]}this._tagStyles=t.tagStyles??void 0,this.update(),this._tick=0}get align(){return this._align}set align(e){this._align!==e&&(this._align=e,this.update())}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords!==e&&(this._breakWords=e,this.update())}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(typeof t==`object`&&t?this._dropShadow=this._createProxy({...e.defaultDropShadow,...t}):this._dropShadow=t?this._createProxy({...e.defaultDropShadow}):null,this.update())}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.update())}get fontSize(){return this._fontSize}set fontSize(e){this._fontSize!==e&&(typeof e==`string`?this._fontSize=parseInt(e,10):this._fontSize=e,this.update())}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle!==e&&(this._fontStyle=e.toLowerCase(),this.update())}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant!==e&&(this._fontVariant=e,this.update())}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.update())}get leading(){return this._leading}set leading(e){this._leading!==e&&(this._leading=e,this.update())}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing!==e&&(this._letterSpacing=e,this.update())}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight!==e&&(this._lineHeight=e,this.update())}get padding(){return this._padding}set padding(e){this._padding!==e&&(this._padding=e,this.update())}get filters(){return this._filters}set filters(e){this._filters!==e&&(this._filters=Object.freeze(e),this.update())}get trim(){return this._trim}set trim(e){this._trim!==e&&(this._trim=e,this.update())}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline!==e&&(this._textBaseline=e,this.update())}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace!==e&&(this._whiteSpace=e,this.update())}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap!==e&&(this._wordWrap=e,this.update())}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth!==e&&(this._wordWrapWidth=e,this.update())}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._isFillStyle(e)&&(this._originalFill=this._createProxy({...Vt.defaultFillStyle,...e},()=>{this._fill=Rt({...this._originalFill},Vt.defaultFillStyle)})),this._fill=Rt(e===0?`black`:e,Vt.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...Vt.defaultStrokeStyle,...e},()=>{this._stroke=Lt({...this._originalStroke},Vt.defaultStrokeStyle)})),this._stroke=Lt(e,Vt.defaultStrokeStyle),this.update())}get tagStyles(){return this._tagStyles}set tagStyles(e){this._tagStyles!==e&&(this._tagStyles=e??void 0,this.update())}update(){this._tick++,this._cachedFontString=null,this.emit(`update`,this)}reset(){let t=e.defaultTextStyle;for(let e in t)this[e]=t[e]}assign(e){for(let t in e){let n=t;this[n]=e[t]}return this}get styleKey(){return`${this.uid}-${this._tick}`}get _fontString(){return this._cachedFontString===null&&(this._cachedFontString=An(this)),this._cachedFontString}_toObject(){return{align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill?{...this._fill}:void 0,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke?{...this._stroke}:void 0,textBaseline:this.textBaseline,trim:this.trim,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0,tagStyles:this._tagStyles?{...this._tagStyles}:void 0}}clone(){return new e(this._toObject())}_getFinalPadding(){let e=0;if(this._filters)for(let t=0;t<this._filters.length;t++)e+=this._filters[t].padding;return Math.max(this._padding,e)}destroy(e=!1){if(this.removeAllListeners(),typeof e==`boolean`?e:e?.texture){let t=typeof e==`boolean`?e:e?.textureSource;this._fill?.texture&&this._fill.texture.destroy(t),this._originalFill?.texture&&this._originalFill.texture.destroy(t),this._stroke?.texture&&this._stroke.texture.destroy(t),this._originalStroke?.texture&&this._originalStroke.texture.destroy(t)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(e,t){return new Proxy(e,{set:(e,n,r)=>e[n]===r?!0:(e[n]=r,t?.(n,r),this.update(),!0)})}_isFillStyle(e){return(e??null)!==null&&!(Mt.isColorLike(e)||e instanceof Ht||e instanceof Bt)}};jn.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:`black`,distance:5},jn.defaultTextStyle={align:`left`,breakWords:!1,dropShadow:null,fill:`black`,fontFamily:`Arial`,fontSize:26,fontStyle:`normal`,fontVariant:`normal`,fontWeight:`normal`,leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:`alphabetic`,trim:!1,whiteSpace:`pre`,wordWrap:!1,wordWrapWidth:100};var Mn=jn;function yee(e){let t=e;if(typeof t.dropShadow==`boolean`&&t.dropShadow){let n=Mn.defaultDropShadow;e.dropShadow={alpha:t.dropShadowAlpha??n.alpha,angle:t.dropShadowAngle??n.angle,blur:t.dropShadowBlur??n.blur,color:t.dropShadowColor??n.color,distance:t.dropShadowDistance??n.distance}}if(t.strokeThickness!==void 0){vt(wt,`strokeThickness is now a part of stroke`);let n=t.stroke,r={};if(Mt.isColorLike(n))r.color=n;else if(n instanceof Ht||n instanceof Bt)r.fill=n;else if(Object.hasOwnProperty.call(n,`color`)||Object.hasOwnProperty.call(n,`fill`))r=n;else throw Error(`Invalid stroke value.`);e.stroke={...r,width:t.strokeThickness}}if(Array.isArray(t.fillGradientStops)){if(vt(wt,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(t.fill)||t.fill.length===0)throw Error(`Invalid fill value. Expected an array of colors for gradient fill.`);t.fill.length!==t.fillGradientStops.length&&At(`The number of fill colors must match the number of fill gradient stops.`);let n=new Ht({start:{x:0,y:0},end:{x:0,y:1},textureSpace:`local`}),r=t.fillGradientStops.slice(),i=t.fill.map(e=>Mt.shared.setValue(e).toNumber());r.forEach((e,t)=>{n.addColorStop(e,i[t])}),e.fill={fill:n}}}var Nn=1e5;function Pn(e,t,n,r=0,i=0,a=0){if(e.texture===St.WHITE&&!e.fill)return Mt.shared.setValue(e.color).setAlpha(e.alpha??1).toHexa();if(!e.fill){let n=t.createPattern(e.texture.source.resource,`repeat`),r=e.matrix.copyTo(ht.shared);return r.scale(e.texture.source.pixelWidth,e.texture.source.pixelHeight),n.setTransform(r),n}else if(e.fill instanceof Bt){let n=e.fill,r=t.createPattern(n.texture.source.resource,`repeat`),i=n.transform.copyTo(ht.shared);return i.scale(n.texture.source.pixelWidth,n.texture.source.pixelHeight),r.setTransform(i),r}else if(e.fill instanceof Ht){let o=e.fill,s=o.type===`linear`,c=o.textureSpace===`local`,l=1,u=1;c&&n&&(l=n.width+r,u=n.height+r);let d,f=!1;if(s){let{start:e,end:n}=o;d=t.createLinearGradient(e.x*l+i,e.y*u+a,n.x*l+i,n.y*u+a),f=Math.abs(n.x-e.x)<Math.abs((n.y-e.y)*.1)}else{let{center:e,innerRadius:n,outerCenter:r,outerRadius:s}=o;d=t.createRadialGradient(e.x*l+i,e.y*u+a,n*l,r.x*l+i,r.y*u+a,s*l)}if(f&&c&&n){let e=n.lineHeight/u;for(let t=0;t<n.lines.length;t++){let i=(t*n.lineHeight+r/2)/u;o.colorStops.forEach(t=>{let n=i+t.offset*e;n=Math.max(0,Math.min(1,n)),d.addColorStop(Math.floor(n*Nn)/Nn,Mt.shared.setValue(t.color).toHex())})}}else o.colorStops.forEach(e=>{d.addColorStop(e.offset,Mt.shared.setValue(e.color).toHex())});return d}return At(`FillStyle not recognised`,e),`red`}var Fn=class extends gn{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=fn(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),In(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ln(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ln(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof rn(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Yt(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Rn(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||rn(this.options.enabled,this.#t)!==rn(t.enabled,this.#t)||tn(this.options.staleTime,this.#t)!==tn(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||rn(this.options.enabled,this.#t)!==rn(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return xee(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(en)),t}#g(){this.#b();let e=tn(this.options.staleTime,this.#t);if(mn||this.#r.isStale||!$t(e))return;let t=nee(this.#r.dataUpdatedAt,e)+1;this.#d=Zt.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(mn||rn(this.options.enabled,this.#t)===!1||!$t(this.#p)||this.#p===0)&&(this.#f=Zt.setInterval(()=>{(this.options.refetchIntervalInBackground||Qt.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(Zt.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(Zt.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&In(e,t),o=i&&Rn(e,n,t,r);(a||o)&&(l={...l,...Xt(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=un(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=un(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:l.dataUpdateCount>0||l.errorUpdateCount>0,isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:zn(e,t),refetch:this.refetch,promise:this.#o,isEnabled:rn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=e=>{x.status===`error`?e.reject(x.error):x.data!==void 0&&e.resolve(x.data)},r=()=>{t(this.#o=x.promise=fn())},i=this.#o;switch(i.status){case`pending`:e.queryHash===n.queryHash&&t(i);break;case`fulfilled`:(x.status===`error`||x.data!==i.value)&&r();break;case`rejected`:(x.status!==`error`||x.error!==i.reason)&&r();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!Yt(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){ln.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function bee(e,t){return rn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function In(e,t){return bee(e,t)||e.state.data!==void 0&&Ln(e,t,t.refetchOnMount)}function Ln(e,t,n){if(rn(t.enabled,e)!==!1&&tn(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&zn(e,t)}return!1}function Rn(e,t,n,r){return(e!==t||rn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&zn(e,n)}function zn(e,t){return rn(t.enabled,e)!==!1&&e.isStaleByTime(tn(t.staleTime,e))}function xee(e,t){return!Yt(e.getCurrentResult(),t)}var See=class extends Fn{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){super.setOptions({...e,behavior:an()})}getOptimisticResult(e){return e.behavior=an(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:cn(t,n.data),hasPreviousPage:eee(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},Cee=class extends gn{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Yt(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&on(t.mutationKey)!==on(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??tee();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){ln.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};e?.type===`success`?(this.#r.onSuccess?.(e.data,t,n,r),this.#r.onSettled?.(e.data,null,t,n,r)):e?.type===`error`&&(this.#r.onError?.(e.error,t,n,r),this.#r.onSettled?.(void 0,e.error,t,n,r))}this.listeners.forEach(e=>{e(this.#t)})})}};function Bn(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function wee(e,t,n){let r=e.slice(0);return r[t]=n,r}var Tee=class extends gn{#e;#t;#n;#r;#i;#a;#o;#s;#c=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#f(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,ln.batch(()=>{let e=this.#i,t=this.#d(this.#n);this.#c=t,t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!Yt(e,n)});!o&&!s||(o&&(this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Bn(e,n).forEach(e=>{e.destroy()}),Bn(n,e).forEach(e=>{e.subscribe(t=>{this.#f(e,t)})})),this.#p()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#d(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions));return[r,e=>this.#u(e??r,t),()=>this.#l(r,n)]}#l(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#u(e,t){return t?((!this.#a||this.#t!==this.#s||t!==this.#o)&&(this.#o=t,this.#s=this.#t,this.#a=sn(this.#a,t(e))),this.#a):e}#d(e){let t=new Map(this.#i.map(e=>[e.options.queryHash,e])),n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash);i?n.push({defaultedQueryOptions:r,observer:i}):n.push({defaultedQueryOptions:r,observer:new Fn(this.#e,r)})}),n}#f(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=wee(this.#t,n,t),this.#p())}#p(){if(this.hasListeners()){let e=this.#a,t=this.#l(this.#t,this.#c);e!==this.#u(t,this.#r?.combine)&&ln.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},Vn=q.createContext(void 0),Hn=e=>{let t=q.useContext(Vn);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Eee=({client:e,children:t})=>(q.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,K.jsx)(Vn.Provider,{value:e,children:t})),Un=q.createContext(!1),Wn=()=>q.useContext(Un);Un.Provider;function Dee(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Oee=q.createContext(Dee()),Gn=()=>q.useContext(Oee),Kn=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},qn=e=>{q.useEffect(()=>{e.clearReset()},[e])},Jn=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||hn(n,[e.error,r])),Yn=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Xn=(e,t)=>e.isLoading&&e.isFetching&&!t,Zn=(e,t)=>e?.suspense&&t.isPending,Qn=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function kee({queries:e,...t},n){let r=Hn(n),i=Wn(),a=Gn(),o=q.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{Yn(e),Kn(e,a)}),qn(a);let[s]=q.useState(()=>new Tee(r,o,t)),[c,l,u]=s.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;q.useSyncExternalStore(q.useCallback(e=>d?s.subscribe(ln.batchCalls(e)):en,[s,d]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),q.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let f=c.some((e,t)=>Zn(o[t],e))?c.flatMap((e,t)=>{let n=o[t];if(n){let t=new Fn(r,n);if(Zn(n,e))return Qn(n,t,a);Xn(e,i)&&Qn(n,t,a)}return[]}):[];if(f.length>0)throw Promise.all(f);let p=c.find((e,t)=>{let n=o[t];return n&&Jn({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(p?.error)throw p.error;return l(u())}function $n(e,t,n){let r=Wn(),i=Gn(),a=Hn(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=r?`isRestoring`:`optimistic`,Yn(o),Kn(o,i),qn(i);let s=!a.getQueryCache().get(o.queryHash),[c]=q.useState(()=>new t(a,o)),l=c.getOptimisticResult(o),u=!r&&e.subscribed!==!1;if(q.useSyncExternalStore(q.useCallback(e=>{let t=u?c.subscribe(ln.batchCalls(e)):en;return c.updateResult(),t},[c,u]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),q.useEffect(()=>{c.setOptions(o)},[o,c]),Zn(o,l))throw Qn(o,c,i);if(Jn({result:l,errorResetBoundary:i,throwOnError:o.throwOnError,query:a.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw l.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,l),o.experimental_prefetchInRender&&!mn&&Xn(l,r)&&(s?Qn(o,c,i):a.getQueryCache().get(o.queryHash)?.promise)?.catch(en).finally(()=>{c.updateResult()}),o.notifyOnChangeProps?l:c.trackResult(l)}function er(e,t){return $n(e,Fn,t)}function tr(e,t){let n=Hn(t),[r]=q.useState(()=>new Cee(n,e));q.useEffect(()=>{r.setOptions(e)},[r,e]);let i=q.useSyncExternalStore(q.useCallback(e=>r.subscribe(ln.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=q.useCallback((e,t)=>{r.mutate(e,t).catch(en)},[r]);if(i.error&&hn(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function Aee(e,t){return $n(e,See,t)}var nr=new WeakMap,jee=new WeakMap,rr={current:[]},ir=!1,ar=0,or=new Set,sr=new Map;function cr(e){for(let t of e){if(rr.current.includes(t))continue;rr.current.push(t),t.recompute();let e=jee.get(t);if(e)for(let t of e){let e=nr.get(t);e?.length&&cr(e)}}}function Mee(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function Nee(e){let t={prevVal:e.prevState,currentVal:e.state};for(let n of e.listeners)n(t)}function lr(e){if(ar>0&&!sr.has(e)&&sr.set(e,e.prevState),or.add(e),!(ar>0)&&!ir)try{for(ir=!0;or.size>0;){let e=Array.from(or);or.clear();for(let t of e)t.prevState=sr.get(t)??t.prevState,Mee(t);for(let t of e){let e=nr.get(t);e&&(rr.current.push(t),cr(e))}for(let t of e){let e=nr.get(t);if(e)for(let t of e)Nee(t)}}}finally{ir=!1,rr.current=[],sr.clear()}}function ur(e){ar++;try{e()}finally{if(ar--,ar===0){let e=or.values().next().value;e&&lr(e)}}}function Pee(e){return typeof e==`function`}var Fee=class{constructor(e,t){this.listeners=new Set,this.subscribe=e=>{var t;this.listeners.add(e);let n=((t=this.options)?.onSubscribe)?.call(t,e,this);return()=>{this.listeners.delete(e),n?.()}},this.prevState=e,this.state=e,this.options=t}setState(e){var t,n;this.prevState=this.state,this.options?.updateFn?this.state=this.options.updateFn(this.prevState)(e):Pee(e)?this.state=e(this.prevState):this.state=e,(n=(t=this.options)?.onUpdate)==null||n.call(t),lr(this)}},dr=`__TSR_index`,fr=`popstate`,pr=`beforeunload`;function mr(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=gr(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[dr];i=hr(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[dr];i=hr(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[dr]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function hr(e,t){t||={};let n=_r();return{...t,key:n,__TSR_key:n,[dr]:e}}function Iee(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>gr(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=_r();t.history.replaceState({[dr]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=gr(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[dr]-l.state[dr],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=mr({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(pr,S,{capture:!0}),t.removeEventListener(fr,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(pr,S,{capture:!0}),t.addEventListener(fr,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function gr(e,t){let n=e.indexOf(`#`),r=e.indexOf(`?`),i=_r();return{href:e,pathname:e.substring(0,n>0?r>0?Math.min(n,r):n:r>0?r:e.length),hash:n>-1?e.substring(n):``,search:r>-1?e.slice(r,n===-1?void 0:n):``,state:t||{[dr]:0,key:i,__TSR_key:i}}}function _r(){return(Math.random()+1).toString(36).substring(7)}function vr(e){return e[e.length-1]}function Lee(e){return typeof e==`function`}function yr(e,t){return Lee(e)?e(t):e}var Ree=Object.prototype.hasOwnProperty;function br(e,t){if(e===t)return e;let n=t,r=wr(e)&&wr(n);if(!r&&!(Sr(e)&&Sr(n)))return n;let i=r?e:xr(e);if(!i)return n;let a=r?n:xr(n);if(!a)return n;let o=i.length,s=a.length,c=r?Array(s):{},l=0;for(let t=0;t<s;t++){let i=r?t:a[t],s=e[i],u=n[i];if(s===u){c[i]=s,(r?t<o:Ree.call(e,i))&&l++;continue}if(s===null||u===null||typeof s!=`object`||typeof u!=`object`){c[i]=u;continue}let d=br(s,u);c[i]=d,d===s&&l++}return o===s&&l===o?e:c}function xr(e){let t=[],n=Object.getOwnPropertyNames(e);for(let r of n){if(!Object.prototype.propertyIsEnumerable.call(e,r))return!1;t.push(r)}let r=Object.getOwnPropertySymbols(e);for(let n of r){if(!Object.prototype.propertyIsEnumerable.call(e,n))return!1;t.push(n)}return t}function Sr(e){if(!Cr(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Cr(n)||!n.hasOwnProperty(`isPrototypeOf`))}function Cr(e){return Object.prototype.toString.call(e)===`[object Object]`}function wr(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Tr(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!Tr(e[r],t[r],n))return!1;return!0}if(Sr(e)&&Sr(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!Tr(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!Tr(e[o],t[o],n)))return!1;return i===a}return!1}function Er(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function Dr(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function Or(e){try{return decodeURI(e)}catch{return e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}}function kr(e,t){if(!e)return e;let n=t?RegExp(`${t.join(`|`)}`,`gi`):/%25|%5C/gi,r=0,i=``,a;for(;(a=n.exec(e))!==null;)i+=Or(e.slice(r,a.index))+a[0],r=n.lastIndex;return i+Or(r?e.slice(r):e)}var zee=!0,Ar=`Invariant failed`;function jr(e,t){if(!e){if(zee)throw Error(Ar);var n=typeof t==`function`?t():t,r=n?`${Ar}: ${n}`:Ar;throw Error(r)}}function Mr(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var Bee=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,Vee=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,Hee=/^([^{]*)\{\$\}([^}]*)$/;function Nr(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=a.match(Hee);if(o){let r=o[1].length;return n[0]=2,n[1]=t+r,n[2]=t+r+1,n[3]=t+r+2,n[4]=t+r+3,n[5]=e.length,n}let s=a.match(Vee);if(s){let e=s[1],r=s[2],a=s[3],o=e.length;return n[0]=3,n[1]=t+o,n[2]=t+o+3,n[3]=t+o+3+r.length,n[4]=i-a.length,n[5]=i,n}let c=a.match(Bee);if(c){let e=c[1],r=c[2],a=c[3],o=e.length;return n[0]=1,n[1]=t+o,n[2]=t+o+2,n[3]=t+o+2+r.length,n[4]=i-a.length,n[5]=i,n}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Pr(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e;for(;s<o;){let e=Nr(r,s,t),o,l=s,u=e[5];switch(s=u+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=Lr(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=Lr(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(l,e[1]),s=r.substring(e[4],u),d=c&&!!(t||s),f=t?d?t:t.toLowerCase():void 0,p=s?d?s:s.toLowerCase():void 0,m=i.dynamic?.find(e=>e.caseSensitive===d&&e.prefix===f&&e.suffix===p);if(m)o=m;else{let e=Rr(1,n.fullPath??n.from,d,f,p);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(l,e[1]),s=r.substring(e[4],u),d=c&&!!(t||s),f=t?d?t:t.toLowerCase():void 0,p=s?d?s:s.toLowerCase():void 0,m=i.optional?.find(e=>e.caseSensitive===d&&e.prefix===f&&e.suffix===p);if(m)o=m;else{let e=Rr(3,n.fullPath??n.from,d,f,p);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(l,e[1]),s=r.substring(e[4],u),d=c&&!!(t||s),f=t?d?t:t.toLowerCase():void 0,p=s?d?s:s.toLowerCase():void 0,m=Rr(2,n.fullPath??n.from,d,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if((n.path||!n.children)&&!n.isRoot){let e=r.endsWith(`/`);e||(i.notFound=n),(!i.route||!i.isIndex&&e)&&(i.route=n),i.isIndex||=e}}if(n.children)for(let r of n.children)Pr(e,t,r,s,i,a,o)}function Fr(e,t){if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Ir(e){if(e.static)for(let t of e.static.values())Ir(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())Ir(t);if(e.dynamic?.length){e.dynamic.sort(Fr);for(let t of e.dynamic)Ir(t)}if(e.optional?.length){e.optional.sort(Fr);for(let t of e.optional)Ir(t)}if(e.wildcard?.length){e.wildcard.sort(Fr);for(let t of e.wildcard)Ir(t)}}function Lr(e){return{kind:0,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,isIndex:!1,notFound:null}}function Rr(e,t,n,r,i){return{kind:e,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,isIndex:!1,notFound:null,caseSensitive:n,prefix:r,suffix:i}}function Uee(e,t){let n=Lr(`/`),r=new Uint16Array(6);for(let t of e)Pr(!1,r,t,1,n,0);Ir(n),t.masksTree=n,t.flatCache=Mr(1e3)}function Wee(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=zr(e,t.masksTree);return t.flatCache.set(e,r),r}function Gee(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Lr(`/`),Pr(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),zr(r,o,n)}function Kee(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a=zr(e,t.segmentTree,n);return a&&(a.branch=Xee(a.route)),t.matchCache.set(r,a),a}function qee(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Jee(e,t=!1,n){let r=Lr(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return Pr(t,i,e,1,r,0,e=>{if(n?.(e,s),jr(!(e.id in a),`Duplicate routes found with id: ${String(e.id)}`),a[e.id]=e,s!==0&&e.path){let t=qee(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),Ir(r),{processedTree:{segmentTree:r,singleCache:Mr(1e3),matchCache:Mr(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function zr(e,t,n=!1){let r=e.split(`/`),i=Qee(e,r,t,n);if(!i)return null;let a=Yee(e,r,i),o=`**`in i;return o&&(a[`**`]=i[`**`]),{route:o?i.node.notFound??i.node.route:i.node.route,params:a}}function Yee(e,t,n){let r=Zee(n.node),i=null,a={};for(let o=0,s=0,c=0;s<r.length;o++,s++,c++){let l=r[s],u=t[o],d=c;if(u&&(c+=u.length),l.kind===1){i??=n.node.fullPath.split(`/`);let e=i[s],t=l.prefix?.length??0;if(e.charCodeAt(t)===123){let n=l.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=u.substring(t,u.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(u)}}else if(l.kind===3){if(n.skipped&1<<s){o--;continue}i??=n.node.fullPath.split(`/`);let e=i[s],t=l.prefix?.length??0,r=l.suffix?.length??0,c=e.substring(t+3,e.length-r-1),d=l.suffix||l.prefix?u.substring(t,u.length-r):u;d&&(a[c]=decodeURIComponent(d))}else if(l.kind===2){let t=l,n=e.substring(d+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return a}function Xee(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Zee(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Qee(e,t,n,r){let i=!vr(t),a=i&&e!==`/`,o=t.length-(i?1:0),s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let e=s.pop(),{node:n,index:i,skipped:d,depth:f,statics:p,dynamics:m,optionals:h}=e;r&&n.notFound&&Br(l,e)&&(l=e);let g=i===o;if(g){if(n.route&&(!a||n.isIndex)&&(Br(u,e)&&(u=e),p===o&&n.isIndex))return u;if(!n.optional&&!n.wildcard)continue}let _=g?void 0:t[i],v;if(n.wildcard&&Br(c,e))for(let e of n.wildcard){let{prefix:n,suffix:r}=e;if(!(n&&(g||!(e.caseSensitive?_:v??=_.toLowerCase()).startsWith(n)))){if(r){if(g)continue;let n=t.slice(i).join(`/`).slice(-r.length);if((e.caseSensitive?n:n.toLowerCase())!==r)continue}c={node:e,index:i,skipped:d,depth:f,statics:p,dynamics:m,optionals:h};break}}if(n.optional){let e=d|1<<f,t=f+1;for(let r=n.optional.length-1;r>=0;r--){let a=n.optional[r];s.push({node:a,index:i,skipped:e,depth:t,statics:p,dynamics:m,optionals:h})}if(!g)for(let e=n.optional.length-1;e>=0;e--){let r=n.optional[e],{prefix:a,suffix:o}=r;if(a||o){let e=r.caseSensitive?_:v??=_.toLowerCase();if(a&&!e.startsWith(a)||o&&!e.endsWith(o))continue}s.push({node:r,index:i+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+1})}}if(!g&&n.dynamic&&_)for(let e=n.dynamic.length-1;e>=0;e--){let t=n.dynamic[e],{prefix:r,suffix:a}=t;if(r||a){let e=t.caseSensitive?_:v??=_.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:t,index:i+1,skipped:d,depth:f+1,statics:p,dynamics:m+1,optionals:h})}if(!g&&n.staticInsensitive){let e=n.staticInsensitive.get(v??=_.toLowerCase());e&&s.push({node:e,index:i+1,skipped:d,depth:f+1,statics:p+1,dynamics:m,optionals:h})}if(!g&&n.static){let e=n.static.get(_);e&&s.push({node:e,index:i+1,skipped:d,depth:f+1,statics:p+1,dynamics:m,optionals:h})}}if(u)return u;if(c)return c;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return{node:l.node,skipped:l.skipped,"**":decodeURIComponent(r)}}return null}function Br(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&(t.node.isIndex>e.node.isIndex||t.node.isIndex===e.node.isIndex&&t.depth>e.depth))):!0}function Vr(e){return Hr(e.filter(e=>e!==void 0).join(`/`))}function Hr(e){return e.replace(/\/{2,}/g,`/`)}function Ur(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Wr(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Gr(e){return Wr(Ur(e))}function Kr(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function $ee(e,t,n){return Kr(e,n)===Kr(t,n)}function ete({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&vr(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(vr(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=Nr(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=Hr(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function qr(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?encodeURI(r):tte(r,n):r}function Jr({path:e,params:t,decodeCharMap:n}){let r=!1,i={};if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:i,isMissingParams:r};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:i,isMissingParams:r};let a=e.length,o=0,s,c=``;for(;o<a;){let a=o;s=Nr(e,a,s);let l=s[5];if(o=l+1,a===l)continue;let u=s[0];if(u===0){c+=`/`+e.substring(a,l);continue}if(u===2){let o=t._splat;i._splat=o,i[`*`]=o;let u=e.substring(a,s[1]),d=e.substring(s[4],l);if(!o){r=!0,(u||d)&&(c+=`/`+u+d);continue}let f=qr(`_splat`,t,n);c+=`/`+u+f+d;continue}if(u===1){let o=e.substring(s[2],s[3]);!r&&!(o in t)&&(r=!0),i[o]=t[o];let u=e.substring(a,s[1]),d=e.substring(s[4],l),f=qr(o,t,n)??`undefined`;c+=`/`+u+f+d;continue}if(u===3){let r=e.substring(s[2],s[3]),o=t[r];if(o==null)continue;i[r]=o;let u=e.substring(a,s[1]),d=e.substring(s[4],l),f=qr(r,t,n)??``;c+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(c+=`/`),{usedParams:i,interpolatedPath:c||`/`,isMissingParams:r}}function tte(e,t){let n=encodeURIComponent(e);if(t)for(let[e,r]of t)n=n.replaceAll(e,r);return n}function Yr(e={}){if(e.isNotFound=!0,e.throw)throw e;return e}function Xr(e){return!!e?.isNotFound}function nte(){try{if(typeof window<`u`&&typeof window.sessionStorage==`object`)return window.sessionStorage}catch{}}var Zr=`tsr-scroll-restoration-v1_3`,rte=(e,t)=>{let n;return(...r)=>{n||=setTimeout(()=>{e(...r),n=null},t)}};function ite(){let e=nte();if(!e)return null;let t=e.getItem(Zr),n=t?JSON.parse(t):{};return{state:n,set:t=>(n=yr(t,n)||n,e.setItem(Zr,JSON.stringify(n)))}}var Qr=ite(),$r=e=>e.state.__TSR_key||e.href;function ate(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var ei=!1;function ote({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||`{}`)}catch(e){console.error(e);return}let s=t||window.history.state?.__TSR_key,c=o[s];ei=!0;scroll:{if(r&&c&&Object.keys(c).length>0){for(let e in c){let t=c[e];if(e===`window`)window.scrollTo({top:t.scrollY,left:t.scrollX,behavior:n});else if(e){let n=document.querySelector(e);n&&(n.scrollLeft=t.scrollX,n.scrollTop=t.scrollY)}}break scroll}let e=(a??window.location).hash.split(`#`,2)[1];if(e){let t=window.history.state?.__hashScrollIntoViewOptions??!0;if(t){let n=document.getElementById(e);n&&n.scrollIntoView(t)}break scroll}let t={top:0,left:0,behavior:n};if(window.scrollTo(t),i)for(let e of i){if(e===`window`)continue;let n=typeof e==`function`?e():document.querySelector(e);n&&n.scrollTo(t)}}ei=!1}function ste(e,t){if(!Qr&&!e.isServer||((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!Qr))return;e.isScrollRestorationSetup=!0,ei=!1;let n=e.options.getScrollRestorationKey||$r;window.history.scrollRestoration=`manual`,typeof document<`u`&&document.addEventListener(`scroll`,rte(t=>{if(ei||!e.isScrollRestoring)return;let r=``;if(t.target===document||t.target===window)r=`window`;else{let e=t.target.getAttribute(`data-scroll-restoration-id`);r=e?`[data-scroll-restoration-id="${e}"]`:ate(t.target)}let i=n(e.state.location);Qr.set(e=>{let t=e[i]||={},n=t[r]||={};if(r===`window`)n.scrollX=window.scrollX||0,n.scrollY=window.scrollY||0;else if(r){let e=document.querySelector(r);e&&(n.scrollX=e.scrollLeft||0,n.scrollY=e.scrollTop||0)}return e})},100),!0),e.subscribe(`onRendered`,t=>{let r=n(t.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation})||(ote({storageKey:Zr,key:r,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Qr.set(e=>(e[r]||={},e)))})}function cte(e){if(typeof document<`u`&&document.querySelector){let t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==``){let n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function lte(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function ti(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function ute(e){let t=new URLSearchParams(e),n={};for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=ti(r):Array.isArray(t)?t.push(ti(r)):n[e]=[t,ti(r)]}return n}var dte=pte(JSON.parse),fte=mte(JSON.stringify,JSON.parse);function pte(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=ute(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function mte(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=lte(e,r);return t?`?${t}`:``}}var ni=`__root__`;function hte(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function ri(e){return e instanceof Response&&!!e.options}var ii=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},ai=(e,t)=>!!(e.preload&&!e.router.state.matches.some(e=>e.id===t)),oi=(e,t)=>{let n=e.router.routesById[t.routeId??``]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),jr(n.options.notFoundComponent,`No notFoundComponent found. Please set a notFoundComponent on your route or provide a defaultNotFoundComponent to the router.`);let r=e.matches.find(e=>e.routeId===n.id);jr(r,`Could not find match for route: `+n.id),e.updateMatch(r.id,e=>({...e,status:`notFound`,error:t,isFetching:!1})),t.routerCode===`BEFORE_LOAD`&&n.parentRoute&&(t.routeId=n.parentRoute.id,oi(e,t))},si=(e,t,n)=>{if(!(!ri(n)&&!Xr(n))){if(ri(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;let r=ri(n)?`redirected`:`notFound`;t._nonReactive.error=n,e.updateMatch(t.id,e=>({...e,status:r,isFetching:!1,error:n})),Xr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw ri(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(oi(e,n),n)}},ci=(e,t)=>{let n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},li=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,si(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,si(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},gte=(e,t,n,r)=>{let i=e.router.getMatch(t),a=e.matches[n-1]?.id,o=a?e.router.getMatch(a):void 0;if(e.router.isShell()){i.ssr=r.id===ni;return}if(o?.ssr===!1){i.ssr=!1;return}let s=e=>e===!0&&o?.ssr===`data-only`?`data-only`:e,c=e.router.options.defaultSsr??!0;if(r.options.ssr===void 0){i.ssr=s(c);return}if(typeof r.options.ssr!=`function`){i.ssr=s(r.options.ssr);return}let{search:l,params:u}=i,d={search:gi(l,i.searchError),params:gi(u,i.paramsError),location:e.location,matches:e.matches.map(e=>({index:e.index,pathname:e.pathname,fullPath:e.fullPath,staticData:e.staticData,id:e.id,routeId:e.routeId,search:gi(e.search,e.searchError),params:gi(e.params,e.paramsError),ssr:e.ssr}))},f=r.options.ssr(d);if(Dr(f))return f.then(e=>{i.ssr=s(e??c)});i.ssr=s(f??c)},ui=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!e.router.isServer&&!ai(e,t)&&(n.options.loader||n.options.beforeLoad||_i(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{ii(e)},i);r._nonReactive.pendingTimeout=t}},_te=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;ui(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&si(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},vte=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Er(()=>{a?.resolve()});let{paramsError:o,searchError:s}=i;o&&li(e,n,o,`PARSE_PARAMS`),s&&li(e,n,s,`VALIDATE_SEARCH`),ui(e,t,r,i);let c=new AbortController,l=e.matches[n-1]?.id,u={...(l?e.router.getMatch(l):void 0)?.context??e.router.options.context??void 0,...i.__routeContext},d=!1,f=()=>{d||(d=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c,context:u})))},p=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){ur(()=>{f(),p()});return}i._nonReactive.beforeLoadPromise=Er();let{search:m,params:h,cause:g}=i,_=ai(e,t),v={search:m,abortController:c,params:h,preload:_,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:_?`preload`:g,matches:e.matches,...e.router.options.additionalContext},y=r=>{if(r===void 0){ur(()=>{f(),p()});return}(ri(r)||Xr(r))&&(f(),li(e,n,r,`BEFORE_LOAD`)),ur(()=>{f(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r,context:{...e.context,...r}})),p()})},b;try{if(b=r.options.beforeLoad(v),Dr(b))return f(),b.catch(t=>{li(e,n,t,`BEFORE_LOAD`)}).then(y)}catch(t){f(),li(e,n,t,`BEFORE_LOAD`)}y(b)},yte=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>{if(e.router.isServer){let r=gte(e,n,t,i);if(Dr(r))return r.then(s)}return s()},o=()=>vte(e,n,t,i),s=()=>{if(ci(e,n))return;let t=_te(e,n,i);return Dr(t)?t.then(o):o()};return a()},di=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},fi=(e,t,n,r)=>{let i=e.matchPromises[n-1],{params:a,loaderDeps:o,abortController:s,cause:c}=e.router.getMatch(t),l=e.router.options.context??{};for(let t=0;t<=n;t++){let n=e.matches[t];if(!n)continue;let r=e.router.getMatch(n.id);r&&(l={...l,...r.__routeContext??{},...r.__beforeLoadContext??{}})}let u=ai(e,t);return{params:a,deps:o,preload:!!u,parentMatchPromise:i,abortController:s,context:l,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:u?`preload`:c,route:r,...e.router.options.additionalContext}},pi=async(e,t,n,r)=>{try{let i=e.router.getMatch(t);try{(!e.router.isServer||i.ssr===!0)&&hi(r);let a=r.options.loader?.(fi(e,t,n,r)),o=r.options.loader&&Dr(a);if((o||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,e=>({...e,isFetching:`loader`})),r.options.loader){let n=o?await a:a;si(e,e.router.getMatch(t),n),n!==void 0&&e.updateMatch(t,e=>({...e,loaderData:n}))}r._lazyPromise&&await r._lazyPromise;let s=di(e,t,r),c=s?await s:void 0,l=i._nonReactive.minPendingPromise;l&&await l,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,e=>({...e,error:void 0,status:`success`,isFetching:!1,updatedAt:Date.now(),...c}))}catch(n){let a=n,o=i._nonReactive.minPendingPromise;o&&await o,Xr(n)&&await r.options.notFoundComponent?.preload?.(),si(e,e.router.getMatch(t),n);try{r.options.onError?.(n)}catch(n){a=n,si(e,e.router.getMatch(t),n)}let s=di(e,t,r),c=s?await s:void 0;e.updateMatch(t,e=>({...e,error:a,status:`error`,isFetching:!1,...c}))}}catch(n){let i=e.router.getMatch(t);if(i){let n=di(e,t,r);if(n){let r=await n;e.updateMatch(t,e=>({...e,...r}))}i._nonReactive.loaderPromise=void 0}si(e,i,n)}},bte=async(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=!1,a=!1,o=e.router.looseRoutesById[r];if(ci(e,n)){if(e.router.isServer){let t=di(e,n,o);if(t){let r=await t;e.updateMatch(n,e=>({...e,...r}))}return e.router.getMatch(n)}}else{let r=e.router.getMatch(n);if(r._nonReactive.loaderPromise){if(r.status===`success`&&!e.sync&&!r.preload)return r;await r._nonReactive.loaderPromise;let t=e.router.getMatch(n),i=t._nonReactive.error||t.error;i&&si(e,t,i)}else{let s=Date.now()-r.updatedAt,c=ai(e,n),l=c?o.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:o.options.staleTime??e.router.options.defaultStaleTime??0,u=o.options.shouldReload,d=typeof u==`function`?u(fi(e,n,t,o)):u,f=!!c&&!e.router.state.matches.some(e=>e.id===n),p=e.router.getMatch(n);p._nonReactive.loaderPromise=Er(),f!==p.preload&&e.updateMatch(n,e=>({...e,preload:f}));let{status:m,invalid:h}=p;if(i=m===`success`&&(h||(d??s>l)),!(c&&o.options.preload===!1))if(i&&!e.sync)a=!0,(async()=>{try{await pi(e,n,t,o);let r=e.router.getMatch(n);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0}catch(t){ri(t)&&await e.router.navigate(t.options)}})();else if(m!==`success`||i&&e.sync)await pi(e,n,t,o);else{let t=di(e,n,o);if(t){let r=await t;e.updateMatch(n,e=>({...e,...r}))}}}}let s=e.router.getMatch(n);a||(s._nonReactive.loaderPromise?.resolve(),s._nonReactive.loadPromise?.resolve()),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0,a||(s._nonReactive.loaderPromise=void 0),s._nonReactive.dehydrated=void 0;let c=a?s.isFetching:!1;return c!==s.isFetching||s.invalid!==!1?(e.updateMatch(n,e=>({...e,isFetching:c,invalid:!1})),e.router.getMatch(n)):s};async function mi(e){let t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(e=>e._forcePending)&&ii(t);try{for(let e=0;e<t.matches.length;e++){let n=yte(t,e);Dr(n)&&await n}let e=t.firstBadMatchIndex??t.matches.length;for(let n=0;n<e;n++)t.matchPromises.push(bte(t,n));await Promise.all(t.matchPromises);let n=ii(t);Dr(n)&&await n}catch(e){if(Xr(e)&&!t.preload){let n=ii(t);throw Dr(n)&&await n,e}if(ri(e))throw e}return t.matches}async function hi(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){let t=()=>{let t=[];for(let n of vi){let r=e.options[n]?.preload;r&&t.push(r())}if(t.length)return Promise.all(t).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function gi(e,t){return t?{status:`error`,error:t}:{status:`success`,value:e}}function _i(e){for(let t of vi)if(e.options[t]?.preload)return!0;return!1}var vi=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function xte(e){return{input:({url:t})=>{for(let n of e)t=yi(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=bi(e[n],t);return t}}}function Ste(e){let t=Gr(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Vr([`/`,t,e.pathname]),e)}}function yi(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function bi(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function xi(e){let t=e.resolvedLocation,n=e.location;return{fromLocation:t,toLocation:n,pathChanged:t?.pathname!==n.pathname,hrefChanged:t?.href!==n.href,hashChanged:t?.hash!==n.hash}}var Cte=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{e.notFoundRoute&&console.warn(`The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.`);let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(e=>[encodeURIComponent(e),e])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=Iee())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new Fee(Tte(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(e=>![`redirected`].includes(e.status))}}}),ste(this));let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[];Gr(o)!==``&&e.push(Ste({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:xte(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let{routesById:e,routesByPath:t,processedTree:n}=Jee(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});this.options.routeMasks&&Uee(this.options.routeMasks,n),this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({href:e,state:n})=>{let r=new URL(e,this.origin),i=yi(this.rewrite,r),a=this.options.parseSearch(i.search),o=this.options.stringifySearch(a);i.search=o;let s=i.href.replace(i.origin,``),{pathname:c,hash:l}=i;return{href:s,publicHref:e,url:i.href,pathname:kr(c),searchStr:o,search:br(t?.search,a),hash:l.split(`#`).reverse()[0]??``,state:br(t?.state,n)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathCache=Mr(1e3),this.resolvePathWithBase=(e,t)=>ete({base:e,to:Hr(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Ete({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{let e=this.state.matches.filter(e=>e.status===`pending`),t=this.state.matches.filter(e=>e.isFetching===`loader`);new Set([...this.state.pendingMatches??[],...e,...t]).forEach(e=>{this.cancelMatch(e.id)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=vr(this.matchRoutes(n,{_buildLocation:!0}));t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=this.resolvePathWithBase(i,`.`),o=r.search,s={...r.params},c=t.to?this.resolvePathWithBase(a,`${t.to}`):this.resolvePathWithBase(a,`.`),l=t.params===!1||t.params===null?{}:(t.params??!0)===!0?s:Object.assign(s,yr(t.params,s)),u=Jr({path:c,params:l}).interpolatedPath,d=this.matchRoutes(u,void 0,{_buildLocation:!0}).map(e=>this.looseRoutesById[e.routeId]);if(Object.keys(l).length>0)for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;t&&Object.assign(l,t(l))}let f=e.leaveParams?c:kr(Jr({path:c,params:l,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath),p=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Ci(t.options.validateSearch,{...e,...p}))}catch{}}),p=e}p=Dte({search:p,dest:t,destRoutes:d,_includeValidateSearch:e._includeValidateSearch}),p=br(o,p);let m=this.options.stringifySearch(p),h=t.hash===!0?n.hash:t.hash?yr(t.hash,n.hash):void 0,g=h?`#${h}`:``,_=t.state===!0?n.state:t.state?yr(t.state,n.state):{};_=br(n.state,_);let v=`${f}${m}${g}`,y=new URL(v,this.origin),b=bi(this.rewrite,y);return{publicHref:b.pathname+b.search+b.hash,href:v,url:b.href,pathname:f,search:p,searchStr:m,state:_,hash:h??``,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n={};if(this.options.routeMasks){let o=Wee(i.pathname,this.processedTree);if(o){Object.assign(n,o.params);let{from:i,...s}=o.route;r={from:e.from,...s,params:n},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=Tr(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=Wr(this.latestLocation.href)===Wr(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=Er(()=>{a?.resolve()}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=gr(a,{__TSR_index:e?t:t+1});o.to=n.pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,...r})=>{if(!t&&n)try{new URL(`${n}`),t=!0}catch{}if(t){if(n||=this.buildLocation({to:e,...r}).url,!r.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return r.replace?window.location.replace(n):window.location.href=n,Promise.resolve()}return this.buildAndCommitLocation({...r,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){let e=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),t=e=>{try{return encodeURI(decodeURI(e))}catch{return e}};if(Gr(t(this.latestLocation.href))!==Gr(t(e.href))){let t=e.url;throw this.origin&&t.startsWith(this.origin)&&(t=t.replace(this.origin,``)||`/`),hte({href:t})}}let e=this.matchRoutes(this.latestLocation);this.__store.setState(t=>({...t,status:`pending`,statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:t.cachedMatches.filter(t=>!e.some(e=>e.id===t.id))}))},this.load=async e=>{let t,n,r;for(r=new Promise(i=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=this.state.resolvedLocation;this.state.redirect||this.emit({type:`onBeforeNavigate`,...xi({resolvedLocation:n,location:t})}),this.emit({type:`onBeforeLoad`,...xi({resolvedLocation:n,location:t})}),await mi({router:this,sync:e?.sync,matches:this.state.pendingMatches,location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=[],t=[],n=[];ur(()=>{this.__store.setState(r=>{let i=r.matches,a=r.pendingMatches||r.matches;return e=i.filter(e=>!a.some(t=>t.id===e.id)),t=a.filter(e=>!i.some(t=>t.id===e.id)),n=a.filter(e=>i.some(t=>t.id===e.id)),{...r,isLoading:!1,loadedAt:Date.now(),matches:a,pendingMatches:void 0,cachedMatches:[...r.cachedMatches,...e.filter(e=>e.status!==`error`&&e.status!==`notFound`)]}}),this.clearExpiredCache()}),[[e,`onLeave`],[t,`onEnter`],[n,`onStay`]].forEach(([e,t])=>{e.forEach(e=>{this.looseRoutesById[e.routeId].options[t]?.(e)})})})})}})}catch(e){ri(e)?(t=e,this.isServer||this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):Xr(e)&&(n=e),this.__store.setState(e=>({...e,statusCode:t?t.status:n?404:e.matches.some(e=>e.status===`error`)?500:200,redirect:t}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(e=>e.status===`error`)&&(i=500),i!==void 0&&this.__store.setState(e=>({...e,statusCode:i}))},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.state.resolvedLocation,a=typeof t.types==`function`?t.types(xi({resolvedLocation:i,location:r})):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.state.pendingMatches?.some(t=>t.id===e)?`pendingMatches`:this.state.matches.some(t=>t.id===e)?`matches`:this.state.cachedMatches.some(t=>t.id===e)?`cachedMatches`:``;n&&this.__store.setState(r=>({...r,[n]:r[n]?.map(n=>n.id===e?t(n):n)}))})},this.getMatch=e=>{let t=t=>t.id===e;return this.state.cachedMatches.find(t)??this.state.pendingMatches?.find(t)??this.state.matches.find(t)},this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.__store.setState(e=>({...e,matches:e.matches.map(t),cachedMatches:e.cachedMatches.map(t),pendingMatches:e.pendingMatches?.map(t)})),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{if(!e.options.href){let t=this.buildLocation(e.options),n=t.url;this.origin&&n.startsWith(this.origin)&&(n=n.replace(this.origin,``)||`/`),e.options.href=t.href,e.headers.set(`Location`,n)}return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.__store.setState(e=>({...e,cachedMatches:[]})):this.__store.setState(e=>({...e,cachedMatches:e.cachedMatches.filter(e=>!t(e))}))},this.clearExpiredCache=()=>{this.clearCache({filter:e=>{let t=this.looseRoutesById[e.routeId];if(!t.options.loader)return!0;let n=(e.preload?t.options.preloadGcTime??this.options.defaultPreloadGcTime:t.options.gcTime??this.options.defaultGcTime)??300*1e3;return e.status===`error`?!0:Date.now()-e.updatedAt>=n}})},this.loadRouteChunk=hi,this.preloadRoute=async e=>{let t=this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(e=>e.id)),i=new Set([...r,...this.state.cachedMatches.map(e=>e.id)]);ur(()=>{n.forEach(e=>{i.has(e.id)||this.__store.setState(t=>({...t,cachedMatches:[...t.cachedMatches,e]}))})});try{return n=await mi({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(ri(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});Xr(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.state.status!==`pending`)return!1;let i=(t?.pending===void 0?!this.state.isLoading:t.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,a=Gee(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!Tr(a.params,e.params,{partial:!0})?!1:t?.includeSearch??!0?Tr(i.search,r.search,{partial:!0})?a.params:!1:a.params},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status===`notFound`||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??fte,parseSearch:e.parseSearch??dte}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:Wr(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=(()=>{if(o){if(this.options.notFoundMode!==`root`)for(let e=a.length-1;e>=0;e--){let t=a[e];if(t.children)return t.id}return ni}})(),c=[],l=e=>e?.id?e.context??this.options.context??void 0:this.options.context??void 0;return a.forEach((n,r)=>{let a=c[r-1],[o,u,d]=(()=>{let r=a?.search??e.search,i=a?._strictSearch??void 0;try{let e=Ci(n.options.validateSearch,{...r})??void 0;return[{...r,...e},{...i,...e},void 0]}catch(e){let n=e;if(e instanceof Si||(n=new Si(e.message,{cause:e})),t?.throwOnError)throw n;return[r,{},n]}})(),f=n.options.loaderDeps?.({search:o})??``,p=f?JSON.stringify(f):``,{interpolatedPath:m,usedParams:h}=Jr({path:n.fullPath,params:i,decodeCharMap:this.pathParamsDecodeCharMap}),g=n.id+m+p,_=this.getMatch(g),v=this.state.matches.find(e=>e.routeId===n.id),y=_?._strictParams??h,b;if(!_){let e=n.options.params?.parse??n.options.parseParams;if(e)try{Object.assign(y,e(y))}catch(e){if(b=Xr(e)||ri(e)?e:new wte(e.message,{cause:e}),t?.throwOnError)throw b}}Object.assign(i,y);let x=v?`stay`:`enter`,S;if(_)S={..._,cause:x,params:v?br(v.params,i):i,_strictParams:y,search:br(v?v.search:_.search,o),_strictSearch:u};else{let e=n.options.loader||n.options.beforeLoad||n.lazyFn||_i(n)?`pending`:`success`;S={id:g,index:r,routeId:n.id,params:v?br(v.params,i):i,_strictParams:y,pathname:m,updatedAt:Date.now(),search:v?br(v.search,o):o,_strictSearch:u,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:b,__routeContext:void 0,_nonReactive:{loadPromise:Er()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:x,loaderDeps:v?br(v.loaderDeps,f):f,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:n.options.staticData||{},fullPath:n.fullPath}}t?.preload||(S.globalNotFound=s===n.id),S.searchError=d;let C=l(a);S.context={...C,...S.__routeContext,...S.__beforeLoadContext},c.push(S)}),c.forEach((n,r)=>{let i=this.looseRoutesById[n.routeId];if(!this.getMatch(n.id)&&t?._buildLocation!==!0){let t=c[r-1],a=l(t);if(i.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c};n.__routeContext=i.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}),c}},Si=class extends Error{},wte=class extends Error{};function Tte(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Ci(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Si(`Async validation not supported`);if(n.issues)throw new Si(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Ete({pathname:e,routesById:t,processedTree:n}){let r={},i=Wr(e),a,o=Kee(i,n,!0);return o&&(a=o.route,Object.assign(r,o.params)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function Dte({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){let i=n.reduce((e,t)=>{let n=[];return`search`in t.options?t.options.search?.middlewares&&n.push(...t.options.search.middlewares):(t.options.preSearchFilters||t.options.postSearchFilters)&&n.push(({search:e,next:n})=>{let r=e;`preSearchFilters`in t.options&&t.options.preSearchFilters&&(r=t.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=n(r);return`postSearchFilters`in t.options&&t.options.postSearchFilters?t.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),r&&t.options.validateSearch&&n.push(({search:e,next:n})=>{let r=n(e);try{return{...r,...Ci(t.options.validateSearch,r)??void 0}}catch{return r}}),e.concat(n)},[])??[];i.push(({search:e})=>t.search?t.search===!0?e:yr(t.search,e):{});let a=(e,t)=>{if(e>=i.length)return t;let n=i[e];return n({search:t,next:t=>a(e+1,t)})};return a(0,e)}var Ote=`Error preloading route! ☝️`,wi=class{constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=ni:this.parentRoute||jr(!1,`Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`);let r=n?ni:t?.path;r&&r!==`/`&&(r=Ur(r));let i=t?.id||r,a=n?ni:Vr([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Vr([`/`,a]));let o=a===`__root__`?`/`:Vr([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=o},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}},kte=class{constructor({id:e}){this.notFound=e=>Yr({routeId:this.id,...e}),this.id=e}},Ate=class extends wi{constructor(e){super(e)}};function Ti(e){let t=e.errorComponent??Ei;return(0,K.jsx)(jte,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?q.createElement(t,{error:n,reset:r}):e.children})}var jte=class extends q.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey===this.props.getResetKey()?this.state.error:null,reset:()=>{this.reset()}})}};function Ei({error:e}){let[t,n]=q.useState(!1);return(0,K.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,K.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,K.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,K.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,K.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,K.jsx)(`div`,{children:(0,K.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,K.jsx)(`code`,{children:e.message}):null})}):null]})}function Mte({children:e,fallback:t=null}){return Nte()?(0,K.jsx)(q.Fragment,{children:e}):(0,K.jsx)(q.Fragment,{children:t})}function Nte(){return q.useSyncExternalStore(Pte,()=>!0,()=>!1)}function Pte(){return()=>{}}var Fte=!0;function Di(e,t){if(!Fte){if(e)return;var n=`Warning: `+t;typeof console<`u`&&console.warn(n);try{throw Error(n)}catch{}}}var Ite=i((e=>{var t=a();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),a=r[0].inst,l=r[1];return s(function(){a.value=n,a.getSnapshot=t,u(a)&&l({inst:a})},[e,n,t]),o(function(){return u(a)&&l({inst:a}),e(function(){u(a)&&l({inst:a})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Oi=i(((e,t)=>{t.exports=Ite()})),Lte=i((e=>{var t=a(),n=Oi();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,a){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),a!==void 0&&f.hasValue){var t=f.value;if(a(t,e))return c=t}return c=e}if(t=c,i(s,e))return t;var n=r(e);return a!==void 0&&a(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,a]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),ki=i(((e,t)=>{t.exports=Lte()}))();function Rte(e,t=e=>e,n={}){let r=n.equal??zte;return(0,ki.useSyncExternalStoreWithSelector)(e.subscribe,()=>e.state,()=>e.state,t,r)}function zte(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=Ai(e);if(n.length!==Ai(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function Ai(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}var ji=q.createContext(null);function Mi(){return typeof document>`u`?ji:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=ji,ji)}function Ni(e){let t=q.useContext(Mi());return Di(!((e?.warn??!0)&&!t),`useRouter must be used inside a <RouterProvider> component!`),t}function Pi(e){let t=Ni({warn:e?.router===void 0}),n=e?.router||t,r=(0,q.useRef)(void 0);return Rte(n.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=br(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}var Fi=q.createContext(void 0),Bte=q.createContext(void 0);function Ii(e){let t=q.useContext(e.from?Bte:Fi);return Pi({select:n=>{let r=n.matches.find(n=>e.from?e.from===n.routeId:n.id===t);if(jr(!((e.shouldThrow??!0)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:`a nearest match!`}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function Li(e){return Ii({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Ri(e){let{select:t,...n}=e;return Ii({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function zi(e){return Ii({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Bi(e){return Ii({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}var Vi=typeof window<`u`?q.useLayoutEffect:q.useEffect;function Hi(e){let t=q.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Vte(e,t,n={},r={}){q.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function Hte(e){let t=q.useRef(null);return q.useImperativeHandle(e,()=>t.current,[]),t}function Ui(e){let t=Ni();return q.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Ute(e,t){let n=Ni(),[r,i]=q.useState(!1),a=q.useRef(!1),o=Hte(t),{activeProps:s,inactiveProps:c,activeOptions:l,to:u,preload:d,preloadDelay:f,hashScrollIntoView:p,replace:m,startTransition:h,resetScroll:g,viewTransition:_,children:v,target:y,disabled:b,style:x,className:S,onClick:C,onFocus:w,onMouseEnter:T,onMouseLeave:E,onTouchStart:D,ignoreBlocker:O,params:k,search:A,hash:j,state:M,mask:N,reloadDocument:P,unsafeRelative:F,from:I,_fromLocation:L,...R}=e,z=Pi({select:e=>e.location.search,structuralSharing:!0}),B=e.from,V=q.useMemo(()=>({...e,from:B}),[n,z,B,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),ee=q.useMemo(()=>n.buildLocation({...V}),[n,V]),H=q.useMemo(()=>{if(b)return;let e=ee.maskedLocation?ee.maskedLocation.url:ee.url,t=!1;return n.origin&&(e.startsWith(n.origin)?e=n.history.createHref(e.replace(n.origin,``))||`/`:t=!0),{href:e,external:t}},[b,ee.maskedLocation,ee.url,n.origin,n.history]),te=q.useMemo(()=>{if(H?.external)return H.href;try{return new URL(u),u}catch{}},[u,H]),ne=e.reloadDocument||te?!1:d??n.options.defaultPreload,re=f??n.options.defaultPreloadDelay??0,ie=Pi({select:e=>{if(te)return!1;if(l?.exact){if(!$ee(e.location.pathname,ee.pathname,n.basepath))return!1}else{let t=Kr(e.location.pathname,n.basepath),r=Kr(ee.pathname,n.basepath);if(!(t.startsWith(r)&&(t.length===r.length||t[r.length]===`/`)))return!1}return(l?.includeSearch??!0)&&!Tr(e.location.search,ee.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?e.location.hash===ee.hash:!0}}),ae=q.useCallback(()=>{n.preloadRoute({...V}).catch(e=>{console.warn(e),console.warn(Ote)})},[n,V]);Vte(o,q.useCallback(e=>{e?.isIntersecting&&ae()},[ae]),Jte,{disabled:!!b||ne!==`viewport`}),q.useEffect(()=>{a.current||!b&&ne===`render`&&(ae(),a.current=!0)},[b,ae,ne]);let oe=e=>{let t=e.currentTarget.getAttribute(`target`),r=y===void 0?t:y;if(!b&&!Yte(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,_n.flushSync)(()=>{i(!0)});let t=n.subscribe(`onResolved`,()=>{t(),i(!1)});n.navigate({...V,replace:m,resetScroll:g,hashScrollIntoView:p,startTransition:h,viewTransition:_,ignoreBlocker:O})}};if(te)return{...R,ref:o,href:te,...v&&{children:v},...y&&{target:y},...b&&{disabled:b},...x&&{style:x},...S&&{className:S},...C&&{onClick:C},...w&&{onFocus:w},...T&&{onMouseEnter:T},...E&&{onMouseLeave:E},...D&&{onTouchStart:D}};let se=e=>{b||ne&&ae()},ce=se,le=e=>{if(!(b||!ne))if(!re)ae();else{let t=e.target;if(Gi.has(t))return;let n=setTimeout(()=>{Gi.delete(t),ae()},re);Gi.set(t,n)}},ue=e=>{if(b||!ne||!re)return;let t=e.target,n=Gi.get(t);n&&(clearTimeout(n),Gi.delete(t))},de=ie?yr(s,{})??Wte:Wi,fe=ie?Wi:yr(c,{})??Wi,pe=[S,de.className,fe.className].filter(Boolean).join(` `),me=(x||de.style||fe.style)&&{...x,...de.style,...fe.style};return{...R,...de,...fe,href:H?.href,ref:o,onClick:Ki([C,oe]),onFocus:Ki([w,se]),onMouseEnter:Ki([T,le]),onMouseLeave:Ki([E,ue]),onTouchStart:Ki([D,ce]),disabled:!!b,target:y,...me&&{style:me},...pe&&{className:pe},...b&&Gte,...ie&&Kte,...r&&qte}}var Wi={},Wte={className:`active`},Gte={role:`link`,"aria-disabled":!0},Kte={"data-status":`active`,"aria-current":`page`},qte={"data-transitioning":`transitioning`},Gi=new WeakMap,Jte={rootMargin:`100px`},Ki=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}},qi=q.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,ref:a,...o}=Ute(r,t),s=typeof r.children==`function`?r.children({isActive:o[`data-status`]===`active`}):r.children;return n===void 0&&delete o.disabled,q.createElement(n||`a`,{...o,ref:a},s)});function Yte(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Xte(e){return new Zte({id:e})}var Zte=class extends kte{constructor({id:e}){super({id:e}),this.useMatch=e=>Ii({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ii({from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>Bi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>zi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Ri({...e,from:this.id,strict:!1}),this.useLoaderData=e=>Li({...e,from:this.id,strict:!1}),this.useNavigate=()=>Ui({from:Ni().routesById[this.id].fullPath}),this.notFound=e=>Yr({routeId:this.id,...e}),this.Link=q.forwardRef((e,t)=>{let n=Ni().routesById[this.id].fullPath;return(0,K.jsx)(qi,{ref:t,from:n,...e})})}},Qte=class extends wi{constructor(e){super(e),this.useMatch=e=>Ii({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ii({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>Bi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>zi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Ri({...e,from:this.id}),this.useLoaderData=e=>Li({...e,from:this.id}),this.useNavigate=()=>Ui({from:this.fullPath}),this.Link=q.forwardRef((e,t)=>(0,K.jsx)(qi,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function Ji(e){return new Qte(e)}var $te=class extends Ate{constructor(e){super(e),this.useMatch=e=>Ii({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ii({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>Bi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>zi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Ri({...e,from:this.id}),this.useLoaderData=e=>Li({...e,from:this.id}),this.useNavigate=()=>Ui({from:this.fullPath}),this.Link=q.forwardRef((e,t)=>(0,K.jsx)(qi,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function Yi(e){return new $te(e)}function Xi(e){return typeof e==`object`?new Zi(e,{silent:!0}).createRoute(e):new Zi(e,{silent:!0}).createRoute}var Zi=class{constructor(e,t){this.path=e,this.createRoute=e=>{Di(this.silent,`FileRoute is deprecated and will be removed in the next major version. Use the createFileRoute(path)(options) function instead.`);let t=Ji(e);return t.isRoot=!1,t},this.silent=t?.silent}},Qi=class{constructor(e){this.useMatch=e=>Ii({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ii({from:this.options.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>Bi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>zi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>Ri({...e,from:this.options.id}),this.useLoaderData=e=>Li({...e,from:this.options.id}),this.useNavigate=()=>Ui({from:Ni().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for(`react.memo`)}};function $i(e){return typeof e==`object`?new Qi(e):t=>new Qi({id:e,...t})}function ene(){let e=Ni(),t=q.useRef({router:e,mounted:!1}),[n,r]=q.useState(!1),{hasPendingMatches:i,isLoading:a}=Pi({select:e=>({isLoading:e.isLoading,hasPendingMatches:e.matches.some(e=>e.status===`pending`)}),structuralSharing:!0}),o=Hi(a),s=a||n||i,c=Hi(s),l=a||i,u=Hi(l);return e.startTransition=e=>{r(!0),q.startTransition(()=>{e(),r(!1)})},q.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Wr(e.latestLocation.href)!==Wr(n.href)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),Vi(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),Vi(()=>{o&&!a&&e.emit({type:`onLoad`,...xi(e.state)})},[o,e,a]),Vi(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...xi(e.state)})},[l,u,e]),Vi(()=>{if(c&&!s){let t=xi(e.state);e.emit({type:`onResolved`,...t}),e.__store.setState(e=>({...e,status:`idle`,resolvedLocation:e.location})),t.hrefChanged&&cte(e)}},[s,c,e]),null}function tne(e){let t=Pi({select:e=>`not-found-${e.location.pathname}-${e.status}`});return(0,K.jsx)(Ti,{getResetKey:()=>t,onCatch:(t,n)=>{if(Xr(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Xr(t))return e.fallback?.(t);throw t},children:e.children})}function nne(){return(0,K.jsx)(`p`,{children:`Not Found`})}function ea(e){return(0,K.jsx)(K.Fragment,{children:e.children})}function ta(e,t,n){return t.options.notFoundComponent?(0,K.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,K.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,K.jsx)(nne,{})}function rne({children:e}){let t=Ni();return t.isServer?(0,K.jsx)(`script`,{nonce:t.options.ssr?.nonce,className:`$tsr`,dangerouslySetInnerHTML:{__html:e+`;typeof $_TSR !== "undefined" && $_TSR.c()`}}):null}function ine(){let e=Ni();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return null;let t=(e.options.getScrollRestorationKey||$r)(e.latestLocation),n=t===$r(e.latestLocation)?void 0:t,r={storageKey:Zr,shouldScrollRestoration:!0};return n&&(r.key=n),(0,K.jsx)(rne,{children:`(${ote.toString()})(${JSON.stringify(r)})`})}var na=q.memo(function({matchId:e}){let t=Ni(),n=Pi({select:t=>{let n=t.matches.find(t=>t.id===e);return jr(n,`Could not find match for matchId "${e}". Please file an issue!`),{routeId:n.routeId,ssr:n.ssr,_displayPending:n._displayPending}},structuralSharing:!0}),r=t.routesById[n.routeId],i=r.options.pendingComponent??t.options.defaultPendingComponent,a=i?(0,K.jsx)(i,{}):null,o=r.options.errorComponent??t.options.defaultErrorComponent,s=r.options.onCatch??t.options.defaultOnCatch,c=r.isRoot?r.options.notFoundComponent??t.options.notFoundRoute?.options.component:r.options.notFoundComponent,l=n.ssr===!1||n.ssr===`data-only`,u=(!r.isRoot||r.options.wrapInSuspense||l)&&(r.options.wrapInSuspense??i??(r.options.errorComponent?.preload||l))?q.Suspense:ea,d=o?Ti:ea,f=c?tne:ea,p=Pi({select:e=>e.loadedAt}),m=Pi({select:t=>{let n=t.matches.findIndex(t=>t.id===e);return t.matches[n-1]?.routeId}});return(0,K.jsxs)(r.isRoot?r.options.shellComponent??ea:ea,{children:[(0,K.jsx)(Fi.Provider,{value:e,children:(0,K.jsx)(u,{fallback:a,children:(0,K.jsx)(d,{getResetKey:()=>p,errorComponent:o||Ei,onCatch:(t,n)=>{if(Xr(t))throw t;Di(!1,`Error in route match: ${e}`),s?.(t,n)},children:(0,K.jsx)(f,{fallback:e=>{if(!c||e.routeId&&e.routeId!==n.routeId||!e.routeId&&!r.isRoot)throw e;return q.createElement(c,e)},children:l||n._displayPending?(0,K.jsx)(Mte,{fallback:a,children:(0,K.jsx)(ra,{matchId:e})}):(0,K.jsx)(ra,{matchId:e})})})})}),m===`__root__`&&t.options.scrollRestoration?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(ane,{}),(0,K.jsx)(ine,{})]}):null]})});function ane(){let e=Ni(),t=q.useRef(void 0);return(0,K.jsx)(`script`,{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:`onRendered`,...xi(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var ra=q.memo(function({matchId:e}){let t=Ni(),{match:n,key:r,routeId:i}=Pi({select:n=>{let r=n.matches.find(t=>t.id===e),i=r.routeId,a=(t.routesById[i].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:i,loaderDeps:r.loaderDeps,params:r._strictParams,search:r._strictSearch});return{key:a?JSON.stringify(a):void 0,routeId:i,match:{id:r.id,status:r.status,error:r.error,_forcePending:r._forcePending,_displayPending:r._displayPending}}},structuralSharing:!0}),a=t.routesById[i],o=q.useMemo(()=>{let e=a.options.component??t.options.defaultComponent;return e?(0,K.jsx)(e,{},r):(0,K.jsx)(ia,{})},[r,a.options.component,t.options.defaultComponent]);if(n._displayPending)throw t.getMatch(n.id)?._nonReactive.displayPendingPromise;if(n._forcePending)throw t.getMatch(n.id)?._nonReactive.minPendingPromise;if(n.status===`pending`){let e=a.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let r=t.getMatch(n.id);if(r&&!r._nonReactive.minPendingPromise&&!t.isServer){let t=Er();r._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),r._nonReactive.minPendingPromise=void 0},e)}}throw t.getMatch(n.id)?._nonReactive.loadPromise}if(n.status===`notFound`)return jr(Xr(n.error),`Expected a notFound error`),ta(t,a,n.error);if(n.status===`redirected`)throw jr(ri(n.error),`Expected a redirect error`),t.getMatch(n.id)?._nonReactive.loadPromise;if(n.status===`error`){if(t.isServer)return(0,K.jsx)((a.options.errorComponent??t.options.defaultErrorComponent)||Ei,{error:n.error,reset:void 0,info:{componentStack:``}});throw n.error}return o}),ia=q.memo(function(){let e=Ni(),t=q.useContext(Fi),n=Pi({select:e=>e.matches.find(e=>e.id===t)?.routeId}),r=e.routesById[n],i=Pi({select:e=>{let n=e.matches.find(e=>e.id===t);return jr(n,`Could not find parent match for matchId "${t}"`),n.globalNotFound}}),a=Pi({select:e=>{let n=e.matches;return n[n.findIndex(e=>e.id===t)+1]?.id}}),o=e.options.defaultPendingComponent?(0,K.jsx)(e.options.defaultPendingComponent,{}):null;if(i)return ta(e,r,void 0);if(!a)return null;let s=(0,K.jsx)(na,{matchId:a});return n===`__root__`?(0,K.jsx)(q.Suspense,{fallback:o,children:s}):s});function one(){let e=Ni(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,K.jsx)(t,{}):null,r=(0,K.jsxs)(e.isServer||typeof document<`u`&&e.ssr?ea:q.Suspense,{fallback:n,children:[!e.isServer&&(0,K.jsx)(ene,{}),(0,K.jsx)(sne,{})]});return e.options.InnerWrap?(0,K.jsx)(e.options.InnerWrap,{children:r}):r}function sne(){let e=Ni(),t=Pi({select:e=>e.matches[0]?.id}),n=Pi({select:e=>e.loadedAt}),r=t?(0,K.jsx)(na,{matchId:t}):null;return(0,K.jsx)(Fi.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,K.jsx)(Ti,{getResetKey:()=>n,errorComponent:Ei,onCatch:e=>{Di(!1,`The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!`),Di(!1,e.message||e.toString())},children:r})})}var aa=e=>new cne(e),cne=class extends Cte{constructor(e){super(e)}};typeof globalThis<`u`?(globalThis.createFileRoute=Xi,globalThis.createLazyFileRoute=$i):typeof window<`u`&&(window.createFileRoute=Xi,window.createLazyFileRoute=$i);function lne({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,K.jsx)(Mi().Provider,{value:e,children:t});return e.options.Wrap?(0,K.jsx)(e.options.Wrap,{children:r}):r}function oa({router:e,...t}){return(0,K.jsx)(lne,{router:e,...t,children:(0,K.jsx)(one,{})})}function sa(e){return Pi({select:t=>e?.select?e.select(t.location):t.location})}function une(e){let t=new MutationObserver(t=>{for(let n of t)n.attributeName===`class`&&e()});return t.observe(document.documentElement,{attributes:!0}),()=>t.disconnect()}function dne(){return document.documentElement.classList.contains(`dark`)}function fne(){return!1}function ca(){return(0,q.useSyncExternalStore)(une,dne,fne)}var la=[`/dashboard`,`/config`,`/git`,`/specs`,`/changes`,`/board`,`/archive`,`/settings`,`/terminal`],pne=[`/dashboard`,`/config`,`/specs`,`/changes`,`/board`,`/archive`,`/settings`],ua=z()?[]:[`/git`,`/terminal`],mne=[`/search`,`/notifications`,`/opsx-new`,`/opsx-propose`,`/opsx-verify`,`/opsx-compose`];function da(){return R(`nav-layout`,window.location)}function hne(e){return R(`nav-layout:${encodeURIComponent(e)}`,window.location)}var gne=300;function _ne(e){return la.includes(e)}function fa(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&_ne(e)):[]}function pa(e){if(typeof e!=`object`||!e)return null;let t=e;return!Array.isArray(t.mainTabs)||!Array.isArray(t.bottomTabs)?null:{mainTabs:fa(t.mainTabs),bottomTabs:fa(t.bottomTabs),updatedAt:typeof t.updatedAt==`number`?t.updatedAt:0}}function vne(e,t){if(typeof e!=`object`||!e)return{__TSR_index:0,key:t,__TSR_key:t};let n=e,r=typeof n.key==`string`?n.key:t,i=typeof n.__TSR_key==`string`?n.__TSR_key:r,a=typeof n.__TSR_index==`number`?n.__TSR_index:0;return{...n,key:r,__TSR_key:i,__TSR_index:a}}function ma(e,t){let n=new URL(e,`http://nav.local`),r=`${n.pathname}${n.search}${n.hash}`,i=Math.random().toString(36).slice(2);return{href:r,pathname:n.pathname||`/`,search:n.search,hash:n.hash,state:vne(t,i)}}function ha(e){let t=e.trim();if(!t||t===`./`||t===`.`)return`/`;let n=t.startsWith(`/`)?t:`/${t}`;return(n.endsWith(`/`)?n:`${n}/`).replace(/\/+/g,`/`)}function ga(e,t){return t===`/`?e||`/`:e===t.slice(0,-1)?`/`:e.startsWith(t)?e.slice(t.length-1)||`/`:e||`/`}function yne(e,t){if(t===`/`)return e||`/`;let n=e.startsWith(`/`)?e:`/${e}`;return n===`/`?t.slice(0,-1)||`/`:`${t.slice(0,-1)}${n}`}function _a(e){if(typeof window>`u`)return e;let t=new URL(e,window.location.origin),n=ha(V());return t.pathname=ga(t.pathname,n),`${t.pathname}${t.search}${t.hash}`}function bne(e,t){for(let n of[`api`,`session`]){let r=t.searchParams.get(n);r&&!e.searchParams.has(n)&&e.searchParams.set(n,r)}}function va(e){for(let t of la)if(e===t||e.startsWith(t+`/`))return t;return null}function ya(e,t){if(t===`pop`)return null;let n=t===`main`?e.mainLocation:e.bottomLocation,r=t===`main`?e.mainTabs:e.bottomTabs,i=va(n.pathname);return i&&r.includes(i)?i:null}function ba(e){return mne.some(t=>e===t||e.startsWith(t+`/`))}function xa(e,t){if(ba(t))return`pop`;let n=va(t);return n&&e.bottomTabs.includes(n)?`bottom`:`main`}function Sa(e){let t=new Set,n=[],r=[];for(let r of e.mainTabs)t.has(r)||(n.push(r),t.add(r));for(let n of e.bottomTabs)t.has(n)||(r.push(n),t.add(n));for(let e of la)t.has(e)||(ua.includes(e)?r.push(e):n.push(e));return{mainTabs:n,bottomTabs:r}}function Ca(e,t){if(t.length===0)return ma(`/`);let n=va(e.pathname);return n&&!t.includes(n)?ma(`/`):e}function wa(e,t){if(t.length===0)return ma(`/`);if(e.pathname===`/`)return ma(`/`,e.state);let n=va(e.pathname);return!n||!t.includes(n)?ma(`/`):e}function Ta(e){return e.pathname===`/`?ma(`/`,e.state):ba(e.pathname)?e:ma(`/`)}function Ea(e){let t=Sa({mainTabs:e.mainTabs,bottomTabs:e.bottomTabs});return{...e,mainTabs:t.mainTabs,bottomTabs:t.bottomTabs,mainLocation:Ca(e.mainLocation,t.mainTabs),bottomLocation:wa(e.bottomLocation,t.bottomTabs),popLocation:Ta(e.popLocation)}}function Da(e,t){let n=new URL(e.href),r=ha(V());n.pathname=ga(n.pathname,r);let i=n.searchParams.get(`_b`),a=n.searchParams.get(`_p`);n.searchParams.delete(`_b`),n.searchParams.delete(`_p`);let o=window.history.state,s=ma(`${n.pathname}${n.search}${n.hash}`,o?.main),c=ma(i??`/`,o?.bottom),l=ma(a??`/`,o?.pop);if(!i&&!a){let e=xa(t,s.pathname);e===`bottom`?(c=s,s=ma(`/`,o?.main)):e===`pop`&&(l=s,s=ma(`/`,o?.main))}return{main:Ca(s,t.mainTabs),bottom:wa(c,t.bottomTabs),pop:Ta(l)}}function Oa(e){let t=new URL(window.location.href),n=new URL(e.mainLocation.href,window.location.origin),r=ha(V());return n.pathname=yne(n.pathname,r),bne(n,t),n.searchParams.delete(`_b`),n.searchParams.delete(`_p`),e.bottomTabs.length>0&&n.searchParams.set(`_b`,e.bottomLocation.href),e.popLocation.pathname!==`/`&&n.searchParams.set(`_p`,e.popLocation.href),`${n.pathname}${n.search}${n.hash}`}function ka(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}function xne(){return{mainTabs:[...pne],bottomTabs:[...ua],updatedAt:0,mainLocation:ma(`/dashboard`),bottomLocation:ma(`/`),popLocation:ma(`/`)}}function Sne(){try{let e=localStorage.getItem(da());return e?pa(JSON.parse(e)):null}catch{return null}}function Cne(e){try{let t=localStorage.getItem(e);return t?pa(JSON.parse(t)):null}catch{return null}}function Aa(e,t=da()){try{localStorage.setItem(t,JSON.stringify(e))}catch{}}var wne=[({prevState:e,nextState:t,event:n})=>{if(n.type!==`MOVE_TAB`)return t;let r=e.bottomTabs.includes(n.tabId)?`bottom`:`main`;if(ya(e,r)!==n.tabId)return t;let i=r===`main`?e.mainLocation:e.bottomLocation,a=ma(i.href,i.state);return n.targetArea===`main`?{...t,mainLocation:a}:{...t,bottomLocation:a}},({nextState:e})=>e.mainTabs.length===0||ya(e,`main`)!=null?e:{...e,mainLocation:ma(e.mainTabs[0])}];function ja(e,t,n){let r=t;for(let t of wne)r=t({prevState:e,nextState:r,event:n});return r}function Ma(e,t){switch(t.type){case`NAVIGATE`:{let n=t.sourceArea===`pop`?`pop`:xa(e,t.location.pathname);return{nextState:n===`main`?{...e,mainLocation:t.location}:n===`bottom`?{...e,bottomLocation:t.location}:{...e,popLocation:t.location},changed:!0,urlAction:t.action,notify:n===t.sourceArea?[]:[{area:n,type:t.action}],persist:`none`}}case`POPSTATE`:return{nextState:{...e,mainLocation:t.mainLocation,bottomLocation:t.bottomLocation,popLocation:t.popLocation},changed:!0,notify:[{area:`main`,type:`BACK`},{area:`bottom`,type:`BACK`},{area:`pop`,type:`BACK`}],persist:`none`};case`MOVE_TAB`:{let n=e.bottomTabs.includes(t.tabId)?`bottom`:`main`;if(n===t.targetArea)return{nextState:e,changed:!1,notify:[],persist:`none`};let r=e.mainTabs.filter(e=>e!==t.tabId),i=e.bottomTabs.filter(e=>e!==t.tabId),a=t.targetArea===`main`?[...r,t.tabId]:r,o=t.targetArea===`bottom`?[...i,t.tabId]:i,s=e.mainLocation,c=e.bottomLocation;return va((n===`main`?e.mainLocation:e.bottomLocation).pathname)===t.tabId&&(n===`main`?s=ma(`/`):c=ma(`/`)),{nextState:{...e,mainTabs:a,bottomTabs:o,mainLocation:s,bottomLocation:c},changed:!0,urlAction:`REPLACE`,notify:[{area:`main`,type:`REPLACE`},{area:`bottom`,type:`REPLACE`}],persist:`local_and_remote`}}case`REORDER`:{let n=t.area===`main`?e.mainTabs:e.bottomTabs,r=new Set(n),i=t.tabIds.filter(e=>r.has(e));for(let e of n)i.includes(e)||i.push(e);return ka(n,i)?{nextState:e,changed:!1,notify:[],persist:`none`}:{nextState:t.area===`main`?{...e,mainTabs:i}:{...e,bottomTabs:i},changed:!0,notify:[],persist:`local_and_remote`}}case`CLOSE_TAB`:{let n=e.bottomTabs.includes(t.tabId),r=e.mainTabs.includes(t.tabId);return!n&&!r?{nextState:e,changed:!1,notify:[],persist:`none`}:n?va(e.bottomLocation.pathname)===t.tabId?{nextState:{...e,bottomLocation:ma(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`}:va(e.mainLocation.pathname)===t.tabId?{nextState:{...e,mainLocation:ma(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`}}case`ACTIVATE_BOTTOM`:return xa(e,t.location.pathname)===`bottom`?{nextState:{...e,bottomLocation:t.location},changed:!0,urlAction:`PUSH`,notify:[{area:`bottom`,type:`PUSH`}],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`};case`DEACTIVATE_BOTTOM`:return e.bottomLocation.pathname===`/`?{nextState:e,changed:!1,notify:[],persist:`none`}:{nextState:{...e,bottomLocation:ma(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`};case`ACTIVATE_POP`:return xa(e,t.location.pathname)===`pop`?{nextState:{...e,popLocation:t.location},changed:!0,urlAction:`PUSH`,notify:[{area:`pop`,type:`PUSH`}],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`};case`DEACTIVATE_POP`:return e.popLocation.pathname===`/`?{nextState:e,changed:!1,notify:[],persist:`none`}:{nextState:{...e,popLocation:ma(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`};case`APPLY_LAYOUT`:{let n=Sa(t.layout);return!(t.layout.updatedAt!==e.updatedAt||!ka(e.mainTabs,n.mainTabs)||!ka(e.bottomTabs,n.bottomTabs))||!t.force&&t.layout.updatedAt<=e.updatedAt?{nextState:e,changed:!1,notify:[],persist:`none`}:{nextState:{...e,mainTabs:n.mainTabs,bottomTabs:n.bottomTabs,updatedAt:t.layout.updatedAt},changed:!0,urlAction:`REPLACE`,notify:[{area:`main`,type:`REPLACE`},{area:`bottom`,type:`REPLACE`}],persist:`local_only`}}}}function Na(e,t,n){return n===`main`?e.mainLocation.href!==t.mainLocation.href:n===`bottom`?e.bottomLocation.href!==t.bottomLocation.href:e.popLocation.href!==t.popLocation.href}function Tne(e,t,n){let r=[...e];for(let e of[`main`,`bottom`,`pop`])Na(t,n,e)&&(r.some(t=>t.area===e)||r.push({area:e,type:`REPLACE`}));return r}var Pa=new class{mainHistory=null;bottomHistory=null;popHistory=null;state=xne();listeners=new Set;snapshotCache=null;persistTimer=null;kvUnsubscribe=null;initialized=!1;storageKey=typeof window>`u`?`nav-layout`:R(`nav-layout`,window.location);constructor(){if(typeof window>`u`)return;let e=z()?null:Sne();if(e!=null){let t=Sa(e);this.state={...this.state,mainTabs:t.mainTabs,bottomTabs:t.bottomTabs,updatedAt:e.updatedAt}}let t=Da(window.location,this.state),n=Ea({...this.state,mainLocation:t.main,bottomLocation:t.bottom,popLocation:t.pop});n=Ea(ja(n,n,{type:`BOOTSTRAP`})),this.state=n,this.normalizeUrl(),window.addEventListener(`popstate`,this.handlePopState)}setHistoryRef(e,t){e===`main`?this.mainHistory=t:e===`bottom`?this.bottomHistory=t:this.popHistory=t}getLocation(e){return e===`main`?this.state.mainLocation:e===`bottom`?this.state.bottomLocation:this.state.popLocation}push(e,t,n){this.dispatch({type:`NAVIGATE`,sourceArea:e,action:`PUSH`,location:ma(_a(t),n)})}replace(e,t,n){this.dispatch({type:`NAVIGATE`,sourceArea:e,action:`REPLACE`,location:ma(_a(t),n)})}createHref(e,t,n){if(typeof window>`u`)return t;let{nextState:r}=this.computeTransition({type:`NAVIGATE`,sourceArea:e,action:`PUSH`,location:ma(_a(t),n)});return Oa(r)}get mainTabs(){return this.state.mainTabs}get bottomTabs(){return this.state.bottomTabs}getAreaForPath(e){return xa(this.state,e)}moveTab(e,t){this.dispatch({type:`MOVE_TAB`,tabId:e,targetArea:t})}reorder(e,t){this.dispatch({type:`REORDER`,area:e,tabIds:t})}closeTab(e){this.dispatch({type:`CLOSE_TAB`,tabId:e})}activateBottom(e){this.dispatch({type:`ACTIVATE_BOTTOM`,location:ma(e)})}deactivateBottom(){this.dispatch({type:`DEACTIVATE_BOTTOM`})}activatePop(e){this.dispatch({type:`ACTIVATE_POP`,location:ma(e)})}deactivatePop(){this.dispatch({type:`DEACTIVATE_POP`})}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getSnapshot(){if(this.snapshotCache)return this.snapshotCache;let e=va(this.state.bottomLocation.pathname);return this.snapshotCache={mainTabs:[...this.state.mainTabs],bottomTabs:[...this.state.bottomTabs],mainLocation:this.state.mainLocation,bottomLocation:this.state.bottomLocation,popLocation:this.state.popLocation,bottomActive:e!=null&&this.state.bottomTabs.includes(e),popActive:this.state.popLocation.pathname!==`/`},this.snapshotCache}async init(){if(!(this.initialized||z())){this.initialized=!0;try{let e=await this.resolveProjectScopedStorageKey();e&&e!==this.storageKey&&(this.storageKey=e,this.rebindProjectScopedLayout(e));let{trpcClient:t}=await c(async()=>{let{trpcClient:e}=await import(`./trpc-DgNoDkR5.js`);return{trpcClient:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8])),n=pa(await t.kv.get.query({key:this.storageKey}));n?n.updatedAt>this.state.updatedAt?this.dispatch({type:`APPLY_LAYOUT`,layout:n}):this.state.updatedAt>n.updatedAt&&t.kv.set.mutate({key:this.storageKey,value:{mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:this.state.updatedAt}}).catch(()=>{}):this.state.updatedAt>0&&t.kv.set.mutate({key:this.storageKey,value:{mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:this.state.updatedAt}}).catch(()=>{});let r=t.kv.subscribe.subscribe({key:this.storageKey},{onData:e=>{let t=pa(e);t&&this.dispatch({type:`APPLY_LAYOUT`,layout:t})}});this.kvUnsubscribe=()=>r.unsubscribe()}catch{}}}destroy(){typeof window<`u`&&window.removeEventListener(`popstate`,this.handlePopState),this.cancelPersistTimer(),this.kvUnsubscribe&&=(this.kvUnsubscribe(),null)}handlePopState=()=>{let e=Da(window.location,this.state);this.dispatch({type:`POPSTATE`,mainLocation:e.main,bottomLocation:e.bottom,popLocation:e.pop})};computeTransition(e){let t=Ma(this.state,e);if(!t.changed)return{transition:t,nextState:this.state};let n=ja(this.state,t.nextState,e);return n=Ea(n),{transition:t,nextState:n}}dispatch(e){if(typeof window<`u`&&e.type!==`POPSTATE`&&this.mainHistory==null){let e=Da(window.location,this.state);this.state=Ea({...this.state,mainLocation:e.main,bottomLocation:e.bottom,popLocation:e.pop})}let t=Ma(this.state,e);if(!t.changed)return;let n=this.state,r=ja(n,t.nextState,e);r=Ea(r),this.state=r,t.persist===`local_and_remote`?this.persistLayout():t.persist===`local_only`&&(this.cancelPersistTimer(),Aa({mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:this.state.updatedAt},this.storageKey));let i=t.urlAction??(Na(n,this.state,`main`)||Na(n,this.state,`bottom`)||Na(n,this.state,`pop`)?`REPLACE`:void 0);i&&this.syncToUrl(i);let a=Tne(t.notify,n,this.state);this.notifyRouters(a),this.notifyListeners()}notifyRouters(e){for(let t of e)(t.area===`main`?this.mainHistory:t.area===`bottom`?this.bottomHistory:this.popHistory)?.notify({type:t.type})}notifyListeners(){this.snapshotCache=null;for(let e of this.listeners)e()}syncToUrl(e){let t=Oa(this.state),n=`${window.location.pathname}${window.location.search}${window.location.hash}`;if(e===`REPLACE`&&t===n)return;let r={main:this.state.mainLocation.state,bottom:this.state.bottomLocation.state,pop:this.state.popLocation.state};e===`PUSH`?window.history.pushState(r,``,t):window.history.replaceState(r,``,t)}normalizeUrl(){let e=Oa(this.state);if(e===`${window.location.pathname}${window.location.search}${window.location.hash}`)return;let t={main:this.state.mainLocation.state,bottom:this.state.bottomLocation.state,pop:this.state.popLocation.state};window.history.replaceState(t,``,e)}cancelPersistTimer(){this.persistTimer&&=(clearTimeout(this.persistTimer),null)}persistLayout(){let e=Date.now();this.state={...this.state,updatedAt:e},Aa({mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:e},this.storageKey),this.cancelPersistTimer(),this.persistTimer=setTimeout(()=>{this.persistTimer=null,c(async()=>{let{trpcClient:e}=await import(`./trpc-DgNoDkR5.js`);return{trpcClient:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(({trpcClient:t})=>t.kv.set.mutate({key:this.storageKey,value:{mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:e}})).catch(()=>{})},gne)}async resolveProjectScopedStorageKey(){try{let e=await j(D());if(!e.ok)return null;let t=await e.json();return typeof t.projectDir!=`string`||t.projectDir.length===0?null:hne(t.projectDir)}catch{return null}}rebindProjectScopedLayout(e){let t=Cne(e);if(t){this.dispatch({type:`APPLY_LAYOUT`,layout:t,force:!0});return}this.state=Ea({...this.state,updatedAt:0}),this.normalizeUrl(),this.notifyListeners()}};typeof window<`u`&&!z()&&Pa.init();function Fa(){return(0,q.useSyncExternalStore)(e=>Pa.subscribe(e),()=>Pa.getSnapshot(),()=>Pa.getSnapshot())}function Ia(e){let t=L();if(!t)return;let n=new URLSearchParams(e.hash.slice(1));n.set(F,t),e.hash=n.toString()}function Ene(e){let{handoff:t,location:n}=e,r=new URL(n.href),i=new URL(t.serverUrl);return O({search:n.search}).hosted?(i.pathname=r.pathname,i.search=r.search,i.hash=r.hash,i.searchParams.set(`api`,t.serverUrl),Ia(i),i.toString()):(i.pathname=r.pathname,i.search=r.search,i.hash=r.hash,Ia(i),i.toString())}function La(e){window.location.assign(Ene(e))}var Ra=`gitScope`;function Dne(e){return new URLSearchParams(e).get(`gitScope`)===`planning`?`planning`:`code`}function za(e){return e.type===`commit`?e.hash:`uncommitted`}function Ba(e,t,n=``){let r=new URLSearchParams(n);t===`planning`?r.set(Ra,t):r.delete(Ra);let i=r.toString();return`${e}${i?`?${i}`:``}`}function One(e,t,n){return n.type===`commit`?[`git`,e,t,`meta`,`commit`,n.hash]:[`git`,e,t,`meta`,`uncommitted`]}function kne(e,t,n){return n.type===`commit`?[`git`,e,t,`files`,`commit`,n.hash]:[`git`,e,t,`files`,`uncommitted`]}function Ane(e,t,n,r){return[`git`,e,t,`patch`,n.type===`commit`?`commit:${n.hash}`:`uncommitted`,r]}function jne(e){return e.type===`commit`?{type:`commit`,hash:e.hash}:{type:`uncommitted`}}function Mne(e,t=`code`,n=``){return Ba(e.type===`commit`?`/git/commit/${e.hash}`:`/git/uncommitted`,t,n)}function Nne(e,t=`code`,n=``){return Mne(jne(e),t,n)}var Pne={"7d":7,"30d":30,"90d":90,all:null},Fne=/^(\d{4})-(\d{2})-(\d{2})(?:-|$)/;function Ine(e){let t=Fne.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]),a=Date.UTC(n,r-1,i),o=new Date(a);return!Number.isFinite(a)||o.getUTCFullYear()!==n||o.getUTCMonth()!==r-1||o.getUTCDate()!==i?null:a}function Va(e){return Ine(e.id)??e.updatedAt}function Lne(e,t,n=Date.now()){let r=Pne[t];return r===null?!0:Va(e)>=n-r*24*60*60*1e3}function Rne(e,t){return t.updatedAt-e.updatedAt||e.id.localeCompare(t.id)}function zne(e){return[...e].sort(Rne)}function Bne(e,t=10){return zne(e).slice(0,Math.max(0,Math.trunc(t)))}function Vne(e,t=10){return[...e].sort((e,t)=>Va(t)-Va(e)||e.id.localeCompare(t.id)).slice(0,Math.max(0,Math.trunc(t)))}var Ha=[`timeout`,`memory-limit`,`runtime`,`abort`];async function Hne(e,t={}){let n=new AbortController,r=[],i=t.signal,a=Une(t.timeoutMs);if(i)if(i.aborted)n.abort(i.reason);else{let e=()=>n.abort(i.reason);i.addEventListener(`abort`,e,{once:!0}),r.push(()=>i.removeEventListener(`abort`,e))}if(n.signal.aborted)return r.forEach(e=>e()),{ok:!1,error:Ua(n.signal.reason,i)};let o,s,c=Promise.resolve().then(()=>e(n.signal));c.catch(()=>void 0);let l=[c];n.signal.aborted||l.push(new Promise((e,t)=>{let i=()=>t(new DOMException(`Translation cancelled.`,`AbortError`));n.signal.addEventListener(`abort`,i,{once:!0}),r.push(()=>n.signal.removeEventListener(`abort`,i))})),a!==void 0&&l.push(new Promise((e,t)=>{o=setTimeout(()=>{s=Error(`Translation task timed out after ${a}ms.`),n.abort(s),t(s)},a)}));try{return{ok:!0,value:await Promise.race(l)}}catch(e){return n.abort(e),s&&n.signal.reason===s?{ok:!1,error:{kind:`timeout`,message:s.message}}:{ok:!1,error:Ua(e,i)}}finally{o&&clearTimeout(o),r.forEach(e=>e())}}function Ua(e,t){if(qne(e))return e;if(t?.aborted)return{kind:`abort`,message:Wa(t.reason)??`Translation cancelled.`};if(e instanceof DOMException&&e.name===`AbortError`)return{kind:`abort`,message:Wa(e)??`Translation cancelled.`};let n=Wne(e);return Gne(n)?{kind:`timeout`,message:n}:Kne(n)?{kind:`memory-limit`,message:n}:{kind:`runtime`,message:n}}function Une(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.floor(e):void 0}function Wne(e){return e instanceof Error&&e.message.trim().length>0?e.message:typeof e==`string`&&e.trim().length>0?e:`Translation failed.`}function Wa(e){if(e instanceof Error&&e.message.trim().length>0)return e.message;if(typeof e==`string`&&e.trim().length>0)return e}function Gne(e){return/\btime(?:d)?\s*out\b/i.test(e)}function Kne(e){return/out of memory/i.test(e)||/memory limit/i.test(e)||/insufficient memory/i.test(e)||/ERR_WORKER_OUT_OF_MEMORY/i.test(e)}function qne(e){if(typeof e!=`object`||!e)return!1;let t=Reflect.get(e,`kind`),n=Reflect.get(e,`message`);return typeof t==`string`&&Ha.includes(t)&&typeof n==`string`&&n.length>0}var Ga=[`browser`,`local`,`local-ct2`,`local-llama`,`openai`],Ka=l(Ga),qa=`browser`;function Ja(e){return e===`local`||e===`local-ct2`||e===`local-llama`}function Ya(e){return e===`local`||e===`local-ct2`}l([`local`,`local-ct2`,`local-llama`,`openai`]);var Xa=15e3,Za=l([`not-downloaded`,`queued`,`downloading`,`paused`,`downloaded`,`error`,`deleting`]),Qa=m({path:x().min(1),sizeBytes:b().int().nonnegative().optional(),required:f(),etag:x().min(1).optional(),revision:x().min(1).optional(),sourceUrl:x().min(1).optional(),raw:w().optional()}),Jne=m({id:x().min(1),label:x().min(1),description:x().optional(),profile:x().min(1).optional(),dtype:x().min(1).optional(),estimatedTotalBytes:b().int().nonnegative().optional(),baseGroupId:x().min(1).optional(),commitHash:x().min(1).optional(),shortCommitHash:x().min(1).optional(),rootDir:x().min(1).optional(),status:Za.optional(),progress:b().min(0).max(1).optional(),bytesDownloaded:b().int().nonnegative().optional(),totalBytes:b().int().nonnegative().optional(),resumable:f().optional(),error:x().optional(),selectable:f(),selected:f(),files:p(Qa)}),Yne=l([`idle`,`loading`,`ready`,`error`]),Xne=m({path:x().min(1),sizeBytes:b().int().nonnegative().optional(),required:f(),etag:x().min(1).optional(),revision:x().min(1).optional(),sourceUrl:x().min(1).optional(),raw:w().optional()}),Zne=m({id:x().min(1),baseGroupId:x().min(1),label:x().min(1),displayLabel:x().min(1),description:x().optional(),profile:x().min(1).optional(),dtype:x().min(1).optional(),commitHash:x().min(1),shortCommitHash:x().min(1),rootDir:x().min(1),estimatedTotalBytes:b().int().nonnegative().optional(),selectable:f(),files:p(Xne)}),Qne=m({modelId:x().min(1),source:_(`huggingface`),endpoint:x().default(``),revision:x().min(1),commitHash:x().min(1),shortCommitHash:x().min(1),fetchedAt:b().int().nonnegative(),updatedAt:b().int().nonnegative(),raw:w().optional(),groups:g(x(),Zne).default({}),groupOrder:p(x().min(1)).default([])}),$ne=m({path:x().min(1),sizeBytes:b().int().nonnegative().optional(),downloadedBytes:b().int().nonnegative().optional(),required:f().default(!0),status:Za.default(`not-downloaded`),updatedAt:b().int().nonnegative().optional(),error:x().optional()}),ere=m({groupId:x().min(1),baseGroupId:x().min(1).optional(),status:Za.default(`not-downloaded`),rootDir:x().min(1).optional(),bytesDownloaded:b().int().nonnegative().optional(),totalBytes:b().int().nonnegative().optional(),progress:b().min(0).max(1).optional(),resumable:f().default(!1),error:x().optional(),installedAt:b().int().nonnegative().optional(),updatedAt:b().int().nonnegative().optional(),files:p($ne).default([])}),$a=m({status:Yne.default(`idle`),message:x().optional(),error:x().optional(),updatedAt:b().int().nonnegative().optional()});m({engineId:l([`local`,`local-ct2`,`local-llama`]),modelId:x().min(1),selectedGroupId:x().min(1).optional(),groupId:x().min(1).optional(),status:Za,message:x(),progress:b().min(0).max(1).optional(),bytesDownloaded:b().int().nonnegative().optional(),totalBytes:b().int().nonnegative().optional(),sessionId:x().optional(),resumable:f().optional(),files:p(m({path:x().min(1),sizeBytes:b().int().nonnegative().optional(),downloadedBytes:b().int().nonnegative().optional()})).optional(),updatedAt:b().int().nonnegative()});var tre=m({modelId:x().min(1),estimatedTotalBytes:b().int().nonnegative().optional(),files:p(Qa),profile:x().min(1).optional(),selectedGroupId:x().min(1).optional(),groups:p(Jne).optional()});m({modelId:x().min(1),version:_(2).default(2),status:Za.default(`not-downloaded`),selected:f().default(!1),selectedGroupId:x().min(1).optional(),installedAt:b().int().nonnegative().optional(),updatedAt:b().int().nonnegative().optional(),bytesDownloaded:b().int().nonnegative().optional(),totalBytes:b().int().nonnegative().optional(),progress:b().min(0).max(1).optional(),resumable:f().default(!1),error:x().optional(),profileLoad:$a.default($a.parse({})),profileManifest:Qne.optional(),groupsState:g(x(),ere).default({}),plan:tre.optional(),files:p(m({path:x().min(1),sizeBytes:b().int().nonnegative().optional(),downloadedBytes:b().int().nonnegative().optional()})).default([])}),l([`local`,`network`,`recommended`]);var nre=l([`installed`,`installing`,`missing`,`error`,`not-applicable`]),rre=l([`ready`,`probing`,`failed`,`error`,`not-applicable`]),ire=l([`ready`,`missing`,`downloading`,`error`,`not-applicable`]),eo=m({message:x().optional(),progress:b().min(0).max(1).optional(),error:x().optional()}),to=m({dependency:eo.extend({state:nre}),runtime:eo.extend({state:rre}),assets:eo.extend({state:ire}),summary:x().optional()});function no(e={}){return{dependency:{state:`not-applicable`,...e.dependency},runtime:{state:`not-applicable`,...e.runtime},assets:{state:`not-applicable`,...e.assets},...e.summary?{summary:e.summary}:{}}}function are(e){return e.dependency.state===`installed`||e.dependency.state===`not-applicable`}function ore(e){return e.runtime.state===`ready`||e.runtime.state===`not-applicable`}function ro(e){return e?!are(e)||!ore(e):!1}function io(e){if(e)return e.summary??e.runtime.error??e.runtime.message??e.dependency.error??e.dependency.message??e.assets.error??e.assets.message}var ao=l([`stdout`,`stderr`]);m({stream:ao,text:x()}),N(`type`,[m({type:_(`status`),lifecycle:to}),m({type:_(`log`),stream:ao,text:x()}),m({type:_(`exit`),lifecycle:to})]);var sre=[{id:`browser`,label:`Browser`,description:`Uses the browser Translator API and future browser-side providers.`,technicalSummary:`Browser-native Web Translator adapter. Package payload is about 5 KB; browser language packs are managed by the browser.`,runtime:`browser`,kind:`browser`,installDescription:`Browser translation support is built into the browser runtime.`,moduleName:`@openspecui/browser-translator`,factoryExport:`createBrowserTranslatorFactory`},{id:`local`,label:`Local-Transformers`,description:`Runs an ONNX Runtime-backed local translation adapter through Transformers.js with managed ONNX model files.`,technicalSummary:`Server-side ONNX Runtime adapter via Transformers.js. Runtime package is installed on demand; selected ONNX model groups are downloaded separately and can range from tens to hundreds of MB.`,runtime:`server`,kind:`managed-local`,settingsKey:`local`,defaultModel:`Xenova/nllb-200-distilled-600M`,runtimePackageName:`@huggingface/transformers`,installDescription:`Install the Local-Transformers runtime package to enable server-side translation.`,modelLabel:`Local Model`,downloadGroupsLabel:`Local download profiles`,refreshTooltip:`Refresh local model profiles`,moduleName:`@openspecui/local-translator`,factoryExport:`createLocalTranslatorFactory`},{id:`local-ct2`,label:`Local-CT2`,description:`Runs a bundled local CTranslate2 translation runtime with managed model files.`,technicalSummary:`Server-side native CTranslate2 adapter. Runtime package is installed on demand; selected model artifacts are downloaded separately and can range from tens to hundreds of MB.`,runtime:`server`,kind:`managed-local`,settingsKey:`localCt2`,defaultModel:`ooeoeo/opus-mt-en-zh-ct2-float16`,runtimePackageName:`ctranslate2`,installDescription:`Install the Local-CT2 runtime package to enable server-side translation.`,modelLabel:`CT2 Model`,downloadGroupsLabel:`Local CT2 download groups`,refreshTooltip:`Refresh local model artifacts`,moduleName:`@openspecui/local-ct2-translator`,factoryExport:`createLocalCt2TranslatorFactory`},{id:`local-llama`,label:`Local-Llama`,description:`Runs a local GGUF translation-capable LLM through node-llama-cpp with managed GGUF model files.`,technicalSummary:`Server-side llama.cpp adapter via node-llama-cpp. Runtime package is installed on demand; selected GGUF model files are downloaded separately and can range from hundreds of MB to multiple GB.`,runtime:`server`,kind:`managed-local`,settingsKey:`localLlama`,defaultModel:`bartowski/Qwen2.5-0.5B-Instruct-GGUF`,runtimePackageName:`node-llama-cpp`,installDescription:`Install the Local-Llama runtime package to enable server-side GGUF translation.`,modelLabel:`Llama Model`,downloadGroupsLabel:`Local GGUF files`,refreshTooltip:`Refresh local GGUF artifacts`,moduleName:`@openspecui/local-llama-translator`,factoryExport:`createLocalLlamaTranslatorFactory`},{id:`openai`,label:`OpenAI-Completion`,description:`Uses an OpenAI-compatible TanStack AI completion provider for context-aware translation.`,technicalSummary:`Server-side TanStack AI adapter for OpenAI-compatible APIs. Package payload is about 5 KB; model size stays with the remote provider.`,runtime:`server`,kind:`remote-provider`,settingsKey:`openai`,defaultModel:`gpt-4.1-mini`,installDescription:`OpenAI completion translation is bundled with the server runtime.`,moduleName:`@openspecui/openai-completion-translator`,factoryExport:`createOpenAICompletionTranslatorFactory`}];function oo(e){let t=sre.find(t=>t.id===e);if(!t)throw Error(`Unknown translation engine: ${e}`);return t}function cre(e){let t=oo(e);if(t.kind!==`managed-local`)throw Error(`Translation engine ${e} is not a managed-local engine.`);return t}var lre=m({baseUrl:x().default(``),token:x().default(``),model:x().default(`gpt-4.1-mini`)}),ure=m({baseUrl:x().optional(),token:x().optional(),model:x().optional()}),so=m({model:x().default(`Xenova/nllb-200-distilled-600M`),selectedGroupId:x().optional(),hfEndpoint:x().default(``),memoryBudgetPercent:b().min(0).max(100).default(25)}),dre=m({model:x().min(1).optional(),selectedGroupId:x().min(1).nullable().optional(),hfEndpoint:x().optional(),memoryBudgetPercent:b().min(0).max(100).optional()}),co=m({model:x().default(`ooeoeo/opus-mt-en-zh-ct2-float16`),selectedGroupId:x().optional(),hfEndpoint:x().default(``),memoryBudgetPercent:b().min(0).max(100).default(25)}),fre=m({model:x().min(1).optional(),selectedGroupId:x().min(1).nullable().optional(),hfEndpoint:x().optional(),memoryBudgetPercent:b().min(0).max(100).optional()}),lo=m({model:x().default(`bartowski/Qwen2.5-0.5B-Instruct-GGUF`),selectedGroupId:x().optional(),hfEndpoint:x().default(``),memoryBudgetPercent:b().min(0).max(100).default(25)}),pre=m({model:x().min(1).optional(),selectedGroupId:x().min(1).nullable().optional(),hfEndpoint:x().optional(),memoryBudgetPercent:b().min(0).max(100).optional()});m({engineId:Ka.default(qa),openai:lre.default(lre.parse({})),local:so.default(so.parse({})),localCt2:co.default(co.parse({})),localLlama:lo.default(lo.parse({}))}),m({engineId:Ka.optional(),openai:ure.optional(),local:dre.optional(),localCt2:fre.optional(),localLlama:pre.optional()}),m({engineId:Ka,sourceLanguage:x().min(1),targetLanguage:x().min(1),model:x().min(1).optional(),selectedGroupId:x().min(1).optional(),inputs:p(x()).min(1),instructions:x().optional(),context:x().optional(),timeoutMs:b().int().positive().default(Xa)}),m({index:b().int().nonnegative(),output:x().optional(),error:m({kind:l(Ha),message:x().min(1)}).optional()});var uo=l([`direct`,`bilingual`]),mre=m({local:m({model:x().min(1).optional(),selectedGroupId:x().min(1).optional()}).default({}),localCt2:m({model:x().min(1).optional(),selectedGroupId:x().min(1).optional()}).default({}),localLlama:m({model:x().min(1).optional(),selectedGroupId:x().min(1).optional()}).default({}),openai:m({model:x().min(1).optional()}).default({})}).default({}),hre=m({local:m({model:x().min(1).optional(),selectedGroupId:x().min(1).nullable().optional()}).optional(),localCt2:m({model:x().min(1).optional(),selectedGroupId:x().min(1).nullable().optional()}).optional(),localLlama:m({model:x().min(1).optional(),selectedGroupId:x().min(1).nullable().optional()}).optional(),openai:m({model:x().min(1).optional()}).optional()}),fo=m({enabled:f().default(!1),targetLanguage:x().min(1).default(`zh`),displayMode:uo.default(`direct`),cacheEnabled:f().default(!1),engineId:Ka.default(qa),engines:mre});m({enabled:f().optional(),targetLanguage:x().min(1).optional(),displayMode:uo.optional(),cacheEnabled:f().optional(),engineId:Ka.optional(),engines:hre.optional()});var po=1e4,mo=2e5;m({entryLimit:b().int().min(100).max(mo).default(po)}),m({entryLimit:b().int().min(100).max(mo).optional()}),m({key:x().min(1),keyHash:x().min(1),sourceText:x(),translatedText:x(),targetNodesJson:x().optional(),sourceLanguage:x().min(1),targetLanguage:x().min(1),placeholderTopologyHash:x().min(1),attributeTopologyHash:x().min(1),displayPolicyVersion:b().int().positive(),engineId:Ka.default(qa),engineVersion:x().optional(),model:x().optional(),translatorContractVersion:b().int().positive().default(1),createdAt:b().int().nonnegative(),lastAccessedAt:b().int().nonnegative()}).omit({createdAt:!0,lastAccessedAt:!0}),m({keyHash:x().min(1)}),m({enabled:f(),entryLimit:b().int().positive(),entries:b().int().nonnegative(),databasePath:x().optional()});var gre=`project`,_re=/^[A-Za-z]:\//;function ho(e){return e.replace(/\\/g,`/`).replace(/\/+$/g,``)}function vre(e){return e.startsWith(`/`)||_re.test(e)}function yre(e){return e.replace(/^\.?\//,``)}function go(e){return ho(e).split(`/`).filter(Boolean)}function bre(e){let t=ho(e),n=/(?:^|\/)node_modules\/(?:\.pnpm\/[^/]+\/node_modules\/)?(@[^/]+\/[^/]+|[^/]+)(\/.*)?/.exec(t),r=n?.[1];return r?`npm:${r}${n[2]??``}`:null}function _o(e){return`${gre}:${yre(e)}`}function xre(e,t){let n=ho(e),r=ho(t),i=n.toLowerCase(),a=r.toLowerCase();return a===i||a.startsWith(`${i}/`)}function Sre(e,t){let n=go(e),r=go(t),i=0;for(;i<n.length&&i<r.length&&n[i]?.toLowerCase()===r[i]?.toLowerCase();)i+=1;return r.slice(i).join(`/`)}function Cre(e){let t=go(e),n=t.lastIndexOf(`openspec`);return n<0?null:t.slice(n).join(`/`)}function vo(e,t){let n=ho(e),r=bre(n);return(t?.source===`package`||r)&&r?r:vre(n)?t?.projectDir&&xre(t.projectDir,n)?_o(Sre(t.projectDir,n)):_o(Cre(n)||go(n).slice(-4).join(`/`)):_o(n)}var yo=Symbol.for(`yaml.alias`),bo=Symbol.for(`yaml.document`),xo=Symbol.for(`yaml.map`),So=Symbol.for(`yaml.pair`),Co=Symbol.for(`yaml.scalar`),wo=Symbol.for(`yaml.seq`),To=Symbol.for(`yaml.node.type`),Eo=e=>!!e&&typeof e==`object`&&e[To]===yo,Do=e=>!!e&&typeof e==`object`&&e[To]===bo,Oo=e=>!!e&&typeof e==`object`&&e[To]===xo,ko=e=>!!e&&typeof e==`object`&&e[To]===So,Ao=e=>!!e&&typeof e==`object`&&e[To]===Co,jo=e=>!!e&&typeof e==`object`&&e[To]===wo;function Mo(e){if(e&&typeof e==`object`)switch(e[To]){case xo:case wo:return!0}return!1}function No(e){if(e&&typeof e==`object`)switch(e[To]){case yo:case xo:case Co:case wo:return!0}return!1}var Po=e=>(Ao(e)||Mo(e))&&!!e.anchor,Fo=Symbol(`break visit`),Io=Symbol(`skip children`),Lo=Symbol(`remove node`);function Ro(e,t){let n=Ho(t);Do(e)?zo(null,e.contents,n,Object.freeze([e]))===Lo&&(e.contents=null):zo(null,e,n,Object.freeze([]))}Ro.BREAK=Fo,Ro.SKIP=Io,Ro.REMOVE=Lo;function zo(e,t,n,r){let i=wre(e,t,n,r);if(No(i)||ko(i))return Tre(e,r,i),zo(e,i,n,r);if(typeof i!=`symbol`){if(Mo(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=zo(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Fo)return Fo;else i===Lo&&(t.items.splice(e,1),--e)}}else if(ko(t)){r=Object.freeze(r.concat(t));let e=zo(`key`,t.key,n,r);if(e===Fo)return Fo;e===Lo&&(t.key=null);let i=zo(`value`,t.value,n,r);if(i===Fo)return Fo;i===Lo&&(t.value=null)}}return i}async function Bo(e,t){let n=Ho(t);Do(e)?await Vo(null,e.contents,n,Object.freeze([e]))===Lo&&(e.contents=null):await Vo(null,e,n,Object.freeze([]))}Bo.BREAK=Fo,Bo.SKIP=Io,Bo.REMOVE=Lo;async function Vo(e,t,n,r){let i=await wre(e,t,n,r);if(No(i)||ko(i))return Tre(e,r,i),Vo(e,i,n,r);if(typeof i!=`symbol`){if(Mo(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await Vo(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===Fo)return Fo;else i===Lo&&(t.items.splice(e,1),--e)}}else if(ko(t)){r=Object.freeze(r.concat(t));let e=await Vo(`key`,t.key,n,r);if(e===Fo)return Fo;e===Lo&&(t.key=null);let i=await Vo(`value`,t.value,n,r);if(i===Fo)return Fo;i===Lo&&(t.value=null)}}return i}function Ho(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function wre(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(Oo(t))return n.Map?.(e,t,r);if(jo(t))return n.Seq?.(e,t,r);if(ko(t))return n.Pair?.(e,t,r);if(Ao(t))return n.Scalar?.(e,t,r);if(Eo(t))return n.Alias?.(e,t,r)}function Tre(e,t,n){let r=t[t.length-1];if(Mo(r))r.items[e]=n;else if(ko(r))e===`key`?r.key=n:r.value=n;else if(Do(r))r.contents=n;else{let e=Eo(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var Ere={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},Dre=e=>e.replace(/[!,[\]{}]/g,e=>Ere[e]),Uo=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+Dre(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&No(e.contents)){let t={};Ro(e.contents,(e,n)=>{No(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
8
8
|
`)}};Uo.defaultYaml={explicit:!1,version:`1.2`},Uo.defaultTags={"!!":`tag:yaml.org,2002:`};function Wo(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function Go(e){let t=new Set;return Ro(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Ko(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function Ore(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=Go(e);let a=Ko(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(Ao(t.node)||Mo(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function qo(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=qo(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=qo(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=qo(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=qo(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function Jo(e,t,n){if(Array.isArray(e))return e.map((e,t)=>Jo(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Po(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var Yo=class{constructor(e){Object.defineProperty(this,To,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Do(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=Jo(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?qo(i,{"":o},``,o):o}},Xo=class extends Yo{constructor(e){super(yo),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],Ro(e,{Node:(e,t)=>{(Eo(t)||Po(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(Jo(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=Zo(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(Wo(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function Zo(e,t,n){if(Eo(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Mo(t)){let r=0;for(let i of t.items){let t=Zo(e,i,n);t>r&&(r=t)}return r}else if(ko(t)){let r=Zo(e,t.key,n),i=Zo(e,t.value,n);return Math.max(r,i)}return 1}var Qo=e=>!e||typeof e!=`function`&&typeof e!=`object`,$o=class extends Yo{constructor(e){super(Co),this.value=e}toJSON(e,t){return t?.keep?this.value:Jo(this.value,e,t)}toString(){return String(this.value)}};$o.BLOCK_FOLDED=`BLOCK_FOLDED`,$o.BLOCK_LITERAL=`BLOCK_LITERAL`,$o.PLAIN=`PLAIN`,$o.QUOTE_DOUBLE=`QUOTE_DOUBLE`,$o.QUOTE_SINGLE=`QUOTE_SINGLE`;var kre=`tag:yaml.org,2002:`;function Are(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function es(e,t,n){if(Do(e)&&(e=e.contents),No(e))return e;if(ko(e)){let t=n.schema[xo].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??=i(e),new Xo(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=kre+t.slice(2));let l=Are(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new $o(e);return c&&(c.node=t),t}l=e instanceof Map?o[xo]:Symbol.iterator in Object(e)?o[wo]:o[xo]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new $o(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function ts(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return es(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var ns=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,rs=class extends Yo{constructor(e,t){super(e),Object.defineProperty(this,`schema`,{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>No(t)||ko(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(ns(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(Mo(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,ts(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(Mo(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&Ao(i)?i.value:i:Mo(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!ko(t))return!1;let n=t.value;return n==null||e&&Ao(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return Mo(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(Mo(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,ts(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},jre=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function is(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var as=(e,t,n)=>e.endsWith(`
|
|
9
9
|
`)?is(n,t):n.includes(`
|
|
10
10
|
`)?`
|
|
@@ -879,7 +879,7 @@ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){t
|
|
|
879
879
|
<div class="pixi-host">
|
|
880
880
|
<div class="edge-glow"></div>
|
|
881
881
|
</div>
|
|
882
|
-
`}};customElements.define(`virtual-trackpad-tab`,pve);function mve(e){return new URLSearchParams(e.search).get(`session`)?.trim()||null}function hve(e,t=window.location){let n=mve(t);return n?`hosted-session:${n}:${e}`:e}var gve=1.5,xw=30,_ve=50,vve=15;function Sw(){return`ontouchstart`in window||navigator.maxTouchPoints>0}function yve(e){return e instanceof HTMLElement&&e.classList.contains(`terminal-touch-mouse-overlay`)}function bve(e,t,n){let r=document.elementFromPoint(t,n);if(r&&yve(r)){let e=r,i=e.style.pointerEvents;e.style.pointerEvents=`none`,r=document.elementFromPoint(t,n),e.style.pointerEvents=i}return r&&e.contains(r)&&!yve(r)?r:e.querySelector(`.xterm-screen`)??e}function Cw(e){return e===`input`||e===`keys`||e===`shortcuts`||e===`trackpad`||e===`settings`}function xve(e){return e===`copy`||e===`paste`||e===`select-all`}function ww(e){return typeof e==`object`&&!!e}function Tw(){try{let e=localStorage.getItem(hve(`xtermInputPanelState`));if(!e)return{};let t=JSON.parse(e);return ww(t)?t:{}}catch{return{}}}function Sve(e){try{localStorage.setItem(hve(`xtermInputPanelState`),JSON.stringify(e))}catch{}}function Cve(e){let t=Tw().sessions;if(!t)return null;let n=t[e];if(!ww(n))return null;let r={activeTab:`input`,inputDraft:``};return Cw(n.activeTab)&&(r.activeTab=n.activeTab),typeof n.inputDraft==`string`&&(r.inputDraft=n.inputDraft),r}function wve(){let e=Tw();return Cw(e.lastActiveTab)?e.lastActiveTab:`input`}var Tve=class e{static _lastActiveTab=`input`;static _active=null;static _lastFocused=null;static _instances=new Set;static _onActiveChangeFn=null;static _mountTarget=null;static get activeInstance(){return e._active}static set onActiveChange(t){e._onActiveChangeFn=t}static set mountTarget(t){e._mountTarget=t,e._fabEl&&t&&t.appendChild(e._fabEl)}static get mountTarget(){return e._mountTarget}static _fabEl=null;static _fabSubscriberCount=0;static _ensureFab(t){if(e._fabEl){e._fabEl.parentElement!==t&&t.appendChild(e._fabEl);return}let n=document.createElement(`button`);n.type=`button`,n.title=`Open InputPanel`,n.replaceChildren(wC(24)),Object.assign(n.style,{position:`fixed`,zIndex:`50`,width:`56px`,height:`56px`,borderRadius:`50%`,border:`2px solid currentColor`,display:`flex`,alignItems:`center`,justifyContent:`center`,touchAction:`none`,userSelect:`none`,webkitUserSelect:`none`,webkitTouchCallout:`none`,cursor:`pointer`,boxShadow:`0 4px 12px rgba(0,0,0,0.3)`,background:`var(--primary, #e04a2f)`,color:`var(--primary-foreground, #fff)`,padding:`0`,margin:`0`,outline:`none`});let r=window.innerWidth-72,i=window.innerHeight-140;try{let e=localStorage.getItem(`input-panel-fab-pos`);if(e){let t=JSON.parse(e);r=t.x??r,i=t.y??i}}catch{}r=Math.max(0,Math.min(window.innerWidth-56,r)),i=Math.max(0,Math.min(window.innerHeight-56,i)),n.style.left=`${r}px`,n.style.top=`${i}px`;let a=!1,o=!1,s=0,c=0,l=0,u=0,d=()=>{let t=e._lastFocused,n=(t&&e._instances.has(t)?t:null)??[...e._instances].find(e=>e._terminal!=null)??null;n&&(e._lastFocused=n,n.open())};n.addEventListener(`pointerdown`,e=>{a=!0,o=!1,s=e.clientX,c=e.clientY,l=parseInt(n.style.left)||0,u=parseInt(n.style.top)||0,n.setPointerCapture(e.pointerId),e.preventDefault()}),n.addEventListener(`pointermove`,e=>{if(!a)return;let t=e.clientX-s,r=e.clientY-c;(Math.abs(t)>4||Math.abs(r)>4)&&(o=!0);let i=Math.max(0,Math.min(window.innerWidth-56,l+t)),d=Math.max(0,Math.min(window.innerHeight-56,u+r));n.style.left=`${i}px`,n.style.top=`${d}px`}),n.addEventListener(`pointerup`,()=>{if(a){a=!1;try{localStorage.setItem(`input-panel-fab-pos`,JSON.stringify({x:parseInt(n.style.left),y:parseInt(n.style.top)}))}catch{}o||d()}}),n.addEventListener(`pointercancel`,()=>{a=!1});let f=!1;n.addEventListener(`pointerdown`,()=>{f=!0},{capture:!0}),n.addEventListener(`click`,()=>{if(f){f=!1;return}d()}),n.addEventListener(`contextmenu`,e=>{e.preventDefault(),e.stopPropagation()}),n.addEventListener(`dragstart`,e=>{e.preventDefault()}),window.addEventListener(`resize`,()=>{let e=Math.min(parseInt(n.style.left)||0,window.innerWidth-56),t=Math.min(parseInt(n.style.top)||0,window.innerHeight-56);n.style.left=`${Math.max(0,e)}px`,n.style.top=`${Math.max(0,t)}px`}),t.appendChild(n),e._fabEl=n}static _setFabVisible(t){e._fabEl&&(e._fabEl.style.display=t&&e._fabSubscriberCount>0?`flex`:`none`)}_terminal=null;_panel=null;_cursorEl=null;_cursorPos={x:0,y:0};_isDragging=!1;_isOpen=!1;_edgeScrollTimer=null;_cleanups=[];_persistentCleanups=[];_listenersAttached=!1;_onInput;_onCommand;_onOpenCb;_onCloseCb;_getHistory;_addHistory;_subscribeHistory;_onSettingsChange;_platform;_defaultLayout;_showFab;_fabSubscribed;_panelSessionState;_stateKey;_hasOwnPersistedState;constructor(t){this._onInput=t?.onInput??(()=>{}),this._onCommand=t?.onCommand??null,this._onOpenCb=t?.onOpen??null,this._onCloseCb=t?.onClose??null,this._getHistory=t?.getHistory??null,this._addHistory=t?.addHistory??null,this._subscribeHistory=t?.subscribeHistory??null,this._onSettingsChange=t?.onSettingsChange??null,this._platform=t?.platform??`common`,this._defaultLayout=t?.defaultLayout??`floating`,this._showFab=t?.showFab??!0,this._fabSubscribed=!1,this._stateKey=t?.stateKey?.trim()?t.stateKey:`default`,this._hasOwnPersistedState=!1,this._panelSessionState={activeTab:`input`,inputDraft:``};let n=Cve(this._stateKey);n?(this._panelSessionState=n,this._hasOwnPersistedState=!0):this._panelSessionState.activeTab=e._lastActiveTab||wve()}get isOpen(){return this._isOpen}set onOpen(e){this._onOpenCb=e}set onClose(e){this._onCloseCb=e}set onInput(e){this._onInput=e}set onCommand(e){this._onCommand=e}setPlatform(e){this._platform=e,this._applyPlatformToPanel()}setDefaultLayout(e){this._defaultLayout=e}_persistPanelState(){e._lastActiveTab=this._panelSessionState.activeTab;let t=Tw(),n={...t.sessions,[this._stateKey]:{activeTab:this._panelSessionState.activeTab,inputDraft:this._panelSessionState.inputDraft}};Sve({...t,lastActiveTab:this._panelSessionState.activeTab,sessions:n})}_getMountTarget(){return e._mountTarget??this._getTerminalHostElement()??document.body}_getTerminalHostElement(){let e=this._terminal?.element;return e instanceof HTMLElement?e.classList.contains(`xterm`)&&e.parentElement instanceof HTMLElement?e.parentElement:e:null}_detectTerminalEngine(){let e=this._terminal?.element;return e instanceof HTMLElement&&e.classList.contains(`xterm`)?`xterm`:`non-xterm`}activate(t){this._terminal=t,e._instances.add(this)}dispose(){this.close();for(let e of this._persistentCleanups)e();this._persistentCleanups=[],this._listenersAttached=!1,this._fabSubscribed&&(e._fabSubscriberCount=Math.max(0,e._fabSubscriberCount-1),this._fabSubscribed=!1,e._setFabVisible(e._active===null)),e._instances.delete(this),e._lastFocused===this&&(e._lastFocused=null),this._terminal=null}attachListeners(){if(this._listenersAttached||!this._terminal)return;let t=this._terminal.textarea;if(!t)return;this._listenersAttached=!0,this._showFab?(e._ensureFab(this._getMountTarget()),this._fabSubscribed||=(e._fabSubscriberCount+=1,!0),e._setFabVisible(!0)):e._fabSubscriberCount===0&&e._setFabVisible(!1),e._lastFocused||=this;let n=()=>{e._lastFocused=this,Sw()&&!this._isOpen&&this.open()};t.addEventListener(`focus`,n),this._persistentCleanups.push(()=>t.removeEventListener(`focus`,n)),Sw()&&t.setAttribute(`inputmode`,`none`)}open(){if(!this._terminal)return;if(this._isOpen){if(this._panel?.isConnected)return;this.close()}if(e._active&&e._active!==this&&e._active.close(),this._isOpen=!0,e._active=this,e._lastFocused=this,this._showFab&&e._setFabVisible(!1),this._suppressKeyboard(),!this._hasOwnPersistedState){let t=wve();this._panelSessionState.activeTab=t,e._lastActiveTab=t}let t=document.createElement(`input-panel`);t.setAttribute(`layout`,this._defaultLayout),this._applyPanelThemeBindings(t),t.activeTab=this._panelSessionState.activeTab;let n=document.createElement(`input-method-tab`);n.setAttribute(`slot`,`input`),n.value=this._panelSessionState.inputDraft,t.appendChild(n);let r=document.createElement(`virtual-keyboard-tab`);r.setAttribute(`slot`,`keys`),r.setAttribute(`floating`,``),r.setAttribute(`platform`,this._platform),t.appendChild(r);let i=document.createElement(`shortcut-tab`);i.setAttribute(`slot`,`shortcuts`),i.setAttribute(`platform`,this._platform),t.appendChild(i);let a=document.createElement(`virtual-trackpad-tab`);a.setAttribute(`slot`,`trackpad`),a.setAttribute(`floating`,``),t.appendChild(a),this._panel=t;let o=e=>{this._renderHistory(n,e)};if(this._getHistory&&this._getHistory().then(e=>o(e)).catch(()=>{}),this._subscribeHistory)try{let e=this._subscribeHistory(e=>{o(e)});this._cleanups.push(e)}catch{}this._on(t,`input-panel:close`,()=>this.close()),this._on(t,`input-panel:send`,e=>{let t=e.detail?.data;if(t&&this._onInput(t),e.composedPath()[0]===n&&this._addHistory&&t){let e=this._normalizeHistoryText(t);e&&Promise.resolve(this._addHistory(e)).then(()=>this._getHistory?.()).then(e=>{e&&o(e)}).catch(()=>{})}}),this._on(t,`input-panel:command`,e=>{let t=e.detail;if(!ww(t))return;let n=t.command;if(!xve(n))return;let r=typeof t.fallbackData==`string`?t.fallbackData:void 0;Promise.resolve(this._onCommand?.(n,{fallbackData:r})??!1).then(e=>{!e&&r&&this._onInput(r)}).catch(()=>{r&&this._onInput(r)})}),this._on(n,`input-panel:input-change`,e=>{let t=e.detail?.value;typeof t==`string`&&(this._panelSessionState.inputDraft=t,this._hasOwnPersistedState=!0,this._persistPanelState())}),this._on(t,`input-panel:tab-change`,e=>{let t=e.detail?.tab;Cw(t)&&(this._panelSessionState.activeTab=t,this._hasOwnPersistedState=!0,this._persistPanelState()),t===`trackpad`?this._showCursor():this._hideCursor()}),this._on(t,`input-panel:settings-change`,e=>{if(!this._onSettingsChange)return;let t=e.detail;if(typeof t!=`object`||!t)return;let n=t;typeof n.fixedHeight!=`number`||typeof n.floatingWidth!=`number`||typeof n.floatingHeight!=`number`||typeof n.vibrationIntensity!=`number`||typeof n.historyLimit!=`number`||this._onSettingsChange({fixedHeight:n.fixedHeight,floatingWidth:n.floatingWidth,floatingHeight:n.floatingHeight,vibrationIntensity:n.vibrationIntensity,historyLimit:n.historyLimit})}),this._on(t,`trackpad:move`,e=>{let{dx:t,dy:n}=e.detail;this._moveCursor(t,n)}),this._on(t,`trackpad:tap`,()=>this._dispatchClick(1)),this._on(t,`trackpad:double-tap`,()=>this._dispatchDblClick()),this._on(t,`trackpad:long-press`,()=>this._dispatchRightClick()),this._on(t,`trackpad:two-finger-tap`,()=>this._dispatchRightClick()),this._on(t,`trackpad:drag-start`,()=>{this._isDragging=!0,this._dispatchMouse(`mousedown`,{detail:1})}),this._on(t,`trackpad:drag-move`,e=>{let{dx:t,dy:n}=e.detail;this._moveCursor(t,n),this._dispatchMouse(`mousemove`,{buttons:1}),this._updateEdgeScroll()}),this._on(t,`trackpad:drag-end`,()=>{this._isDragging=!1,this._stopEdgeScroll(),this._dispatchMouse(`mouseup`,{detail:1})}),this._on(t,`trackpad:scroll`,e=>{let{deltaY:t}=e.detail;this._dispatchWheel(t)}),this._getMountTarget().appendChild(t),this._createCursor(),this._focusTerminal(),this._onOpenCb?.(),e._onActiveChangeFn?.(this)}_applyPlatformToPanel(){if(!this._panel)return;let e=this._panel.querySelector(`virtual-keyboard-tab`),t=this._panel.querySelector(`shortcut-tab`);e?.setAttribute(`platform`,this._platform),t?.setAttribute(`platform`,this._platform)}_readThemeVar(e,t,n){for(let n of t){let t=e.getPropertyValue(n).trim();if(t)return t}return n}_applyPanelThemeBindings(e){let t=this._getTerminalHostElement()??this._getMountTarget(),n=getComputedStyle(t),r=this._readThemeVar(n,[`--input-panel-background`,`--terminal`,`--background`],`#1a1a1a`),i=this._readThemeVar(n,[`--input-panel-foreground`,`--terminal-foreground`,`--foreground`],`#ffffff`),a=this._readThemeVar(n,[`--input-panel-primary`,`--primary`],`#e04a2f`),o=this._readThemeVar(n,[`--input-panel-primary-foreground`,`--primary-foreground`],`#ffffff`),s=this._readThemeVar(n,[`--input-panel-border`,`--border`],`color-mix(in srgb, ${i} 24%, transparent)`),c=this._readThemeVar(n,[`--input-panel-muted`,`--muted`],`color-mix(in srgb, ${r} 86%, ${i} 14%)`),l=this._readThemeVar(n,[`--input-panel-muted-foreground`,`--muted-foreground`],`color-mix(in srgb, ${i} 62%, transparent)`);e.style.setProperty(`--input-panel-background`,r),e.style.setProperty(`--input-panel-foreground`,i),e.style.setProperty(`--input-panel-primary`,a),e.style.setProperty(`--input-panel-primary-foreground`,o),e.style.setProperty(`--input-panel-border`,s),e.style.setProperty(`--input-panel-muted`,c),e.style.setProperty(`--input-panel-muted-foreground`,l)}close(){if(this._isOpen){this._isOpen=!1,e._active===this&&(e._active=null),this._stopEdgeScroll();for(let e of this._cleanups)e();this._cleanups=[],this._panel?.remove(),this._panel=null,this._cursorEl?.remove(),this._cursorEl=null,Sw()||this._restoreKeyboard(),this._showFab&&e._setFabVisible(!0),this._onCloseCb?.(),e._onActiveChangeFn?.(null)}}toggle(){if(this._isOpen){this.close();return}this.open()}syncFocusLifecycle(){if(e._lastFocused=this,this._isOpen&&!this._panel?.isConnected){this.open();return}if(e._active&&e._active!==this){this.open();return}this._isOpen&&this._focusTerminal()}_focusTerminal(){let e=this._terminal?.textarea;e&&(Sw()&&e.setAttribute(`inputmode`,`none`),e.focus())}_createCursor(){let e=this._getTerminalHostElement();if(!e)return;let t=document.createElement(`div`);t.setAttribute(`data-input-panel-cursor`,`virtual-mouse`),t.setAttribute(`data-terminal-engine`,this._detectTerminalEngine()),t.setAttribute(`aria-hidden`,`true`),t.style.cssText=`position:absolute;z-index:10;pointer-events:none;opacity:0;transition:opacity 0.15s;color:#fff;`;let n=Qge(20);n.style.filter=`drop-shadow(0 0 1px rgba(0,0,0,0.9))`,t.replaceChildren(n),e.appendChild(t),this._cursorEl=t;let r=e.getBoundingClientRect();this._cursorPos={x:r.width/2,y:r.height/2},this._positionCursor()}_positionCursor(){this._cursorEl&&(this._cursorEl.style.left=`${this._cursorPos.x-4}px`,this._cursorEl.style.top=`${this._cursorPos.y-2}px`)}_showCursor(){if(this._cursorEl||this._createCursor(),this._cursorEl){let e=this._getTerminalHostElement();if(e){let t=e.getBoundingClientRect();this._cursorPos={x:t.width/2,y:t.height/2},this._positionCursor()}this._cursorEl.style.opacity=`1`}}_hideCursor(){this._cursorEl&&(this._cursorEl.style.opacity=`0.3`)}_moveCursor(e,t){let n=this._getTerminalHostElement();if(!n)return;let r=n.getBoundingClientRect();this._cursorPos.x=Math.max(0,Math.min(r.width,this._cursorPos.x+e*gve)),this._cursorPos.y=Math.max(0,Math.min(r.height,this._cursorPos.y+t*gve)),this._positionCursor()}_getClientCoords(){let e=this._getTerminalHostElement();if(!e)return null;let t=e.getBoundingClientRect();return{clientX:t.left+this._cursorPos.x,clientY:t.top+this._cursorPos.y}}_resolveTarget(e,t){let n=this._getTerminalHostElement();return n?bve(n,e,t):document.body}_dispatchMouse(e,t={}){let n=this._getClientCoords();if(!n)return;let r=t.button??0,i=t.detail??1,a=t.buttons??(e===`mousedown`?r===0?1:r===2?2:4:0);this._resolveTarget(n.clientX,n.clientY).dispatchEvent(new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,detail:i,clientX:n.clientX,clientY:n.clientY,button:r,buttons:a}))}_dispatchClick(e){this._dispatchMouse(`mousedown`,{detail:e}),this._dispatchMouse(`mouseup`,{detail:e}),this._dispatchMouse(`click`,{detail:e})}_dispatchDblClick(){this._dispatchMouse(`mousedown`,{detail:2}),this._dispatchMouse(`mouseup`,{detail:2}),this._dispatchMouse(`click`,{detail:2}),this._dispatchMouse(`dblclick`,{detail:2})}_dispatchRightClick(){this._dispatchMouse(`mousedown`,{button:2}),this._dispatchMouse(`mouseup`,{button:2}),this._dispatchMouse(`contextmenu`,{button:2})}_dispatchWheel(e){let t=this._getClientCoords();t&&this._resolveTarget(t.clientX,t.clientY).dispatchEvent(new WheelEvent(`wheel`,{bubbles:!0,cancelable:!0,view:window,clientX:t.clientX,clientY:t.clientY,deltaY:e,deltaMode:WheelEvent.DOM_DELTA_PIXEL}))}_updateEdgeScroll(){let e=this._getTerminalHostElement();if(!e||!this._isDragging){this._stopEdgeScroll();return}let t=e.getBoundingClientRect(),n=this._cursorPos.y<xw,r=this._cursorPos.y>t.height-xw;if(!n&&!r){this._stopEdgeScroll();return}this._stopEdgeScroll(),this._edgeScrollTimer=setInterval(()=>{let e=this._getTerminalHostElement();if(!e||!this._isDragging){this._stopEdgeScroll();return}let t=e.getBoundingClientRect(),n=t.left+this._cursorPos.x,r=this._cursorPos.y<xw?t.top-vve:t.bottom+vve;this._resolveTarget(t.left+this._cursorPos.x,t.top+this._cursorPos.y).dispatchEvent(new MouseEvent(`mousemove`,{bubbles:!0,cancelable:!0,view:window,clientX:n,clientY:r,button:0,buttons:1}))},_ve)}_stopEdgeScroll(){this._edgeScrollTimer&&=(clearInterval(this._edgeScrollTimer),null)}_suppressKeyboard(){if(!Sw())return;let e=this._terminal?.textarea;e&&e.setAttribute(`inputmode`,`none`)}_restoreKeyboard(){let e=this._terminal?.textarea;e&&e.removeAttribute(`inputmode`)}_on(e,t,n){e.addEventListener(t,n),this._cleanups.push(()=>e.removeEventListener(t,n))}_normalizeHistoryText(e){return e.replace(/[\r\n]+$/u,``).trim()||null}_renderHistory(e,t){if(e.querySelectorAll(`[data-input-history-root="true"]`).forEach(e=>e.remove()),t.length===0)return;let n=document.createElement(`div`);n.dataset.inputHistoryRoot=`true`,n.setAttribute(`slot`,`history`),n.style.display=`flex`,n.style.flexDirection=`column`,n.style.gap=`4px`,n.style.padding=`4px 0`;for(let e of t){let t=document.createElement(`button`);t.type=`button`,t.title=e.text,t.style.display=`flex`,t.style.alignItems=`center`,t.style.gap=`8px`,t.style.width=`100%`,t.style.padding=`4px 6px`,t.style.border=`1px solid transparent`,t.style.borderRadius=`4px`,t.style.background=`transparent`,t.style.color=`var(--foreground, #fff)`,t.style.fontFamily=`inherit`,t.style.fontSize=`12px`,t.style.textAlign=`left`;let r=document.createElement(`span`);r.textContent=new Date(e.time).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),r.style.opacity=`0.65`,r.style.fontSize=`10px`,r.style.flexShrink=`0`;let i=document.createElement(`span`);i.textContent=e.text,i.style.overflow=`hidden`,i.style.textOverflow=`ellipsis`,i.style.whiteSpace=`nowrap`,t.appendChild(r),t.appendChild(i),t.addEventListener(`click`,()=>{this._onInput(`${e.text}\n`)}),n.appendChild(t)}e.appendChild(n)}};function Eve(e){let t=/^zh\b/i.test(e);return{apiHost:t?`https://fonts.googleapis.cn`:`https://fonts.googleapis.com`,staticHost:t?`https://fonts.gstatic.cn`:`https://fonts.gstatic.com`}}function Dve(e){return e.trim().replace(/ /g,`+`)}function Ove(e){let t=e.families.map(Dve).filter(Boolean),{apiHost:n}=Eve(e.lang??``),r=t.map(e=>`family=${e}`),i=`display=${e.display??`swap`}`;return`${n}/css2?${[...r,i].join(`&`)}`}function kve(e){let t=e.documentRef??(typeof document>`u`?null:document);if(!t||e.families.length===0)return null;let n=e.lang??(typeof navigator>`u`?``:navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage||``),r=Eve(n),i=Ove({...e,lang:n});if(t.head.querySelector(`link[href="${i}"]`))return null;let a=t.createElement(`link`);a.rel=`preconnect`,a.href=r.apiHost,a.dataset.openspecGoogleFonts=`preconnect-api`;let o=t.createElement(`link`);o.rel=`preconnect`,o.href=r.staticHost,o.crossOrigin=`anonymous`,o.dataset.openspecGoogleFonts=`preconnect-static`;let s=t.createElement(`link`);return s.rel=`stylesheet`,s.href=i,s.dataset.openspecGoogleFonts=`stylesheet`,t.head.append(a,o,s),s}var Ew=null,Dw=null,Ow=null,kw=null,Ave=!1,Aw=!1;function jve(){return typeof window>`u`?null:window.AudioContext??window.webkitAudioContext??null}function Mve(){return Ave?!0:typeof navigator>`u`?!1:navigator.userActivation?.hasBeenActive===!0||navigator.userActivation?.isActive===!0}function Nve(){typeof window>`u`||!Aw||(window.removeEventListener(`pointerdown`,jw,!0),window.removeEventListener(`keydown`,jw,!0),Aw=!1)}function jw(){Ave=!0,Nve(),kw?.(),kw=null,Ow=null}function Mw(){typeof window>`u`||Aw||Mve()||(window.addEventListener(`pointerdown`,jw,{capture:!0,once:!0,passive:!0}),window.addEventListener(`keydown`,jw,{capture:!0,once:!0}),Aw=!0)}function Pve(){Mw()}function Fve(){return typeof window>`u`||Mve()?Promise.resolve():Ow||(Ow=new Promise(e=>{kw=e,Mw()}),Ow)}async function Ive(){return Ew||Dw||(jve()?(Dw=Fve().then(async()=>{let e=jve();if(!e)return null;let t=Ew??new e;return Ew=t,t.state===`suspended`&&await t.resume(),t}).finally(()=>{Dw=null}),Dw):null)}var Nw=class{fallbackSound;unlocked=!1;unlockPromise=null;silentAudio=null;activeAudios=new Set;constructor(e){this.fallbackSound=e===`bell`?$c:el}init(){Pve()}async unlock(){if(!this.unlocked)return this.unlockPromise||=this.unlockAudioContext().finally(()=>{this.unlockPromise=null}),this.unlockPromise}async play(e,t=1){e!==`silent`&&(await this.unlock().catch(()=>{}),await this.playAudio(e,t))}async unlockAudioContext(){if(!await Ive()){this.unlocked=!0;return}this.silentAudio??=new Audio(`data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=`),this.silentAudio.volume=0,await this.silentAudio.play().catch(()=>{}),this.unlocked=!0}async playAudio(e,t){let n=this.getSoundUrl(e)??this.getSoundUrl(this.fallbackSound);n&&await this.createManagedAudio(n,t).play().catch(async r=>{if(e!==this.fallbackSound){if(await this.isMissingSound(n)){let e=this.getSoundUrl(this.fallbackSound);e&&await this.createManagedAudio(e,t).play().catch(()=>{});return}throw r}})}getSoundUrl(e){let t=qie(e);if(t)return t;let n=ol(e);if(!n)return null;let r=B(),i=`/api/sounds/custom/${n}`;return r?`${r}${i}`:i}async isMissingSound(e){try{return(await j(e,{method:`HEAD`})).status===404}catch{return!1}}createManagedAudio(e,t){let n=new Audio(e);n.volume=Lve(t),this.activeAudios.add(n);let r=()=>{n.removeEventListener(`ended`,r),n.removeEventListener(`error`,r),this.activeAudios.delete(n)};return n.addEventListener(`ended`,r,{once:!0}),n.addEventListener(`error`,r,{once:!0}),n}};function Lve(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):1}var Pw=class extends Nw{constructor(){super(`bell`)}},Fw=`xtermInputPanelSettings`,Rve=50,zve=1e3,Bve=1,Vve=1,Iw=`terminal-meta`;function Lw(){return R(`terminal-input-history`,window.location)}function Hve(){return R(`openspecui-terminal`,window.location)}function Rw(){return R(`input-history`,window.location)}function zw(){return R(`terminal-input-history-fallback`,window.location)}function Bw(e){return Math.max(Bve,Math.min(zve,Math.round(e)))}function Vw(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`object`||!n)continue;let e=n;if(typeof e.text!=`string`||typeof e.time!=`number`||!Number.isFinite(e.time))continue;let r=e.text.trim();r&&t.push({text:r,time:e.time})}return t}function Hw(e,t){let n=new Map;for(let t of e){let e=`${t.time}::${t.text}`;n.has(e)||n.set(e,t)}return[...n.values()].sort((e,t)=>t.time-e.time).slice(0,Bw(t))}function Uw(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]?.text!==t[n]?.text||e[n]?.time!==t[n]?.time)return!1;return!0}function Ww(){try{let e=localStorage.getItem(Fw);if(!e)return{};let t=JSON.parse(e);return typeof t!=`object`||!t?{}:t}catch{return{}}}function Uve(e){let t=Ww();try{localStorage.setItem(Fw,JSON.stringify({...t,...e}))}catch{}}async function Gw(){return typeof window>`u`||!(`indexedDB`in window)?null:await new Promise(e=>{let t=window.indexedDB.open(Hve(),Vve);t.onupgradeneeded=()=>{let e=t.result;e.objectStoreNames.contains(Iw)||e.createObjectStore(Iw)},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null)})}async function Wve(){let e=await Gw();return e?await new Promise(t=>{let n=e.transaction(Iw,`readonly`),r=n.objectStore(Iw).get(Rw());r.onsuccess=()=>{t(Vw(r.result))},r.onerror=()=>t([]),n.oncomplete=()=>e.close(),n.onerror=()=>e.close(),n.onabort=()=>e.close()}):null}async function Gve(e){let t=await Gw();return t?await new Promise(n=>{let r=t.transaction(Iw,`readwrite`);r.objectStore(Iw).put(e,Rw()),r.oncomplete=()=>{t.close(),n(!0)},r.onerror=()=>{t.close(),n(!1)},r.onabort=()=>{t.close(),n(!1)}}):!1}function Kve(){try{let e=localStorage.getItem(zw());return e?Vw(JSON.parse(e)):[]}catch{return[]}}function qve(e){try{localStorage.setItem(zw(),JSON.stringify(e))}catch{}}async function Jve(){return await Wve()||Kve()}async function Kw(e){await Gve(e)||qve(e)}var Yve=class{records=[];listeners=new Set;kvUnsubscribe=null;initPromise=null;subscribe(e){return this.listeners.add(e),this.ensureInitialized(),e(this.records),()=>{this.listeners.delete(e)}}async list(){return await this.ensureInitialized(),[...this.records]}getLimit(){let e=Ww().historyLimit;return typeof e==`number`&&Number.isFinite(e)?Bw(e):Rve}async setLimit(e){let t=Bw(e);Uve({historyLimit:t}),await this.ensureInitialized();let n=Hw(this.records,t);await this.commit(n,{persistRemote:!0})}async add(e){let t=e.trim();if(!t)return;await this.ensureInitialized();let n=Hw([{text:t,time:Date.now()},...this.records],this.getLimit());await this.commit(n,{persistRemote:!0})}destroy(){this.kvUnsubscribe&&=(this.kvUnsubscribe(),null)}async ensureInitialized(){if(this.initPromise){await this.initPromise;return}this.initPromise=this.initialize(),await this.initPromise}async initialize(){if(this.records=Hw(await Jve(),this.getLimit()),this.emit(),!z())try{let e=Vw(await G.kv.get.query({key:Lw()})),t=Hw([...this.records,...e],this.getLimit());Uw(this.records,t)||(this.records=t,await Kw(this.records),this.emit()),Uw(e,this.records)||this.persistRemote(this.records);let n=G.kv.subscribe.subscribe({key:Lw()},{onData:e=>{this.onRemoteData(e)}});this.kvUnsubscribe=()=>n.unsubscribe()}catch{}}async onRemoteData(e){let t=Vw(e),n=Hw([...this.records,...t],this.getLimit());await this.commit(n,{persistRemote:!1})}async commit(e,t){Uw(this.records,e)||(this.records=e,await Kw(this.records),this.emit(),t.persistRemote&&!z()&&this.persistRemote(this.records))}async persistRemote(e){try{await G.kv.set.mutate({key:Lw(),value:e})}catch{}}emit(){for(let e of this.listeners)e(this.records)}};function qw(e){return e.type===`keydown`}function Jw(e,t){return e.key.toLowerCase()===t}function Yw(e){return e.metaKey||e.ctrlKey}function Xw(e){return Yw(e)&&!e.altKey}function Zw(e){return e.clipboard?e.clipboard:typeof navigator>`u`?null:navigator.clipboard??null}function Qw(e,t){e.catch(e=>{t.onAsyncError?.(e)})}async function Xve(e,t){let n=Zw(e);n?.writeText&&await n.writeText(t)}async function Zve(e){let t=Zw(e);if(!t?.readText)return;let n=await t.readText();if(n){try{if(e.terminal.paste?.(n),e.terminal.paste)return}catch{}e.writeInput(n)}}var Qve=[{id:`terminal.copy-selection`,handle:(e,t)=>!qw(e)||!Xw(e)||!Jw(e,`c`)?null:t.terminal.hasSelection?.()?$w(t):`allow`},{id:`terminal.paste-clipboard`,handle:(e,t)=>!qw(e)||!Xw(e)||!Jw(e,`v`)?null:eT(t)},{id:`terminal.select-all`,handle:(e,t)=>!qw(e)||!e.metaKey||e.ctrlKey||e.altKey||!Jw(e,`a`)?null:tT(t)},{id:`terminal.zoom-in`,handle:(e,t)=>!qw(e)||!Yw(e)||e.key!==`=`&&e.key!==`+`?null:(t.zoomFont(1),`block`)},{id:`terminal.zoom-out`,handle:(e,t)=>!qw(e)||!Yw(e)||e.key!==`-`?null:(t.zoomFont(-1),`block`)},{id:`terminal.zoom-reset`,handle:(e,t)=>!qw(e)||!Yw(e)||e.key!==`0`?null:(t.resetFontSize(),`block`)}];function $w(e){if(!e.terminal.hasSelection?.())return`allow`;let t=e.terminal.getSelection?.()??``;return t?(Qw(Xve(e,t),e),`block`):`allow`}function eT(e){return Zw(e)?.readText?(Qw(Zve(e),e),`block`):`allow`}function tT(e){return e.terminal.selectAll?(e.terminal.selectAll(),`block`):`allow`}var $ve=[{id:`terminal.command.copy-selection`,command:`copy`,run:$w},{id:`terminal.command.paste-clipboard`,command:`paste`,run:eT},{id:`terminal.command.select-all`,command:`select-all`,run:tT}],eye=class{constructor(e=Qve,t=$ve){this.bindings=e,this.commandBindings=t}handleKeyEvent(e,t){for(let n of this.bindings){let r=n.handle(e,t);if(r)return r}return`allow`}runCommand(e,t){return this.commandBindings.find(t=>t.command===e)?.run(t)??`allow`}},tye=[`app`,`light`,`dark`,`system`],nye=[{value:`default-light`,label:`Default Light`},{value:`default-dark`,label:`Default Dark`},{value:`monokai`,label:`Monokai`},{value:`nord`,label:`Nord`},{value:`solarized-light`,label:`Solarized Light`},{value:`solarized-dark`,label:`Solarized Dark`}],rye={"default-light":{id:`default-light`,label:`Default Light`,modeHint:`light`,palette:{background:`#f6f5f2`,foreground:`#1b1b1b`,cursor:`#ea580c`,cursorAccent:`#f6f5f2`,selectionBackground:`rgba(234, 88, 12, 0.22)`,black:`#111111`,red:`#b91c1c`,green:`#15803d`,yellow:`#a16207`,blue:`#1d4ed8`,magenta:`#a21caf`,cyan:`#0f766e`,white:`#f6f5f2`,brightBlack:`#4b5563`,brightRed:`#dc2626`,brightGreen:`#16a34a`,brightYellow:`#ca8a04`,brightBlue:`#2563eb`,brightMagenta:`#c026d3`,brightCyan:`#0891b2`,brightWhite:`#ffffff`}},"default-dark":{id:`default-dark`,label:`Default Dark`,modeHint:`dark`,palette:{background:`#141414`,foreground:`#e5dfd2`,cursor:`#f97316`,cursorAccent:`#141414`,selectionBackground:`rgba(249, 115, 22, 0.28)`,black:`#151515`,red:`#f87171`,green:`#4ade80`,yellow:`#facc15`,blue:`#60a5fa`,magenta:`#e879f9`,cyan:`#67e8f9`,white:`#f4f1ea`,brightBlack:`#6b7280`,brightRed:`#fca5a5`,brightGreen:`#86efac`,brightYellow:`#fde047`,brightBlue:`#93c5fd`,brightMagenta:`#f0abfc`,brightCyan:`#a5f3fc`,brightWhite:`#fffdf8`}},monokai:{id:`monokai`,label:`Monokai`,modeHint:`either`,palette:{background:`#272822`,foreground:`#f8f8f2`,cursor:`#f8f8f0`,cursorAccent:`#272822`,selectionBackground:`rgba(73, 72, 62, 0.9)`,black:`#272822`,red:`#f92672`,green:`#a6e22e`,yellow:`#f4bf75`,blue:`#66d9ef`,magenta:`#ae81ff`,cyan:`#a1efe4`,white:`#f8f8f2`,brightBlack:`#75715e`,brightRed:`#f92672`,brightGreen:`#a6e22e`,brightYellow:`#f4bf75`,brightBlue:`#66d9ef`,brightMagenta:`#ae81ff`,brightCyan:`#a1efe4`,brightWhite:`#f9f8f5`}},nord:{id:`nord`,label:`Nord`,modeHint:`either`,palette:{background:`#2e3440`,foreground:`#d8dee9`,cursor:`#88c0d0`,cursorAccent:`#2e3440`,selectionBackground:`rgba(94, 129, 172, 0.38)`,black:`#3b4252`,red:`#bf616a`,green:`#a3be8c`,yellow:`#ebcb8b`,blue:`#81a1c1`,magenta:`#b48ead`,cyan:`#88c0d0`,white:`#e5e9f0`,brightBlack:`#4c566a`,brightRed:`#d08770`,brightGreen:`#8fbcbb`,brightYellow:`#eceff4`,brightBlue:`#5e81ac`,brightMagenta:`#b48ead`,brightCyan:`#8fbcbb`,brightWhite:`#eceff4`}},"solarized-light":{id:`solarized-light`,label:`Solarized Light`,modeHint:`light`,palette:{background:`#fdf6e3`,foreground:`#586e75`,cursor:`#cb4b16`,cursorAccent:`#fdf6e3`,selectionBackground:`rgba(147, 161, 161, 0.32)`,black:`#073642`,red:`#dc322f`,green:`#859900`,yellow:`#b58900`,blue:`#268bd2`,magenta:`#d33682`,cyan:`#2aa198`,white:`#eee8d5`,brightBlack:`#657b83`,brightRed:`#cb4b16`,brightGreen:`#93a1a1`,brightYellow:`#839496`,brightBlue:`#6c71c4`,brightMagenta:`#d33682`,brightCyan:`#2aa198`,brightWhite:`#fdf6e3`}},"solarized-dark":{id:`solarized-dark`,label:`Solarized Dark`,modeHint:`dark`,palette:{background:`#002b36`,foreground:`#93a1a1`,cursor:`#cb4b16`,cursorAccent:`#002b36`,selectionBackground:`rgba(88, 110, 117, 0.5)`,black:`#073642`,red:`#dc322f`,green:`#859900`,yellow:`#b58900`,blue:`#268bd2`,magenta:`#d33682`,cyan:`#2aa198`,white:`#eee8d5`,brightBlack:`#657b83`,brightRed:`#cb4b16`,brightGreen:`#586e75`,brightYellow:`#657b83`,brightBlue:`#839496`,brightMagenta:`#6c71c4`,brightCyan:`#93a1a1`,brightWhite:`#fdf6e3`}}};function iye(e){let t=e.useTheme??`app`;return t===`light`?`light`:t===`dark`?`dark`:t===`system`?e.systemDarkMode?`dark`:`light`:e.appDarkMode?`dark`:`light`}function nT(e){let t=iye(e),n=t===`dark`?e.darkTheme??`default-dark`:e.lightTheme??`default-light`;return{id:n,mode:t,definition:rye[n]}}var rT=[`xterm`,`ghostty`];function iT(e){return rT.includes(e)}var aT=`"JetBrains Mono Variable", "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`,oT={fontSize:13,fontFamily:``,cursorBlink:!0,cursorStyle:`block`,scrollback:1e3,useTheme:`app`,lightTheme:`default-light`,darkTheme:`default-dark`,rendererEngine:`xterm`,bellSound:$c,bellVolume:1},sT=1500,cT=1e3,aye=1e4,lT=`common`,oye=512*1024,sye=8,cye=32,uT=13,lye=800,uye={ArrowUp:`\x1B[A`,ArrowDown:`\x1B[B`},dye={ArrowLeft:`\x1Bb`,ArrowRight:`\x1Bf`,ArrowUp:`\x1B[1;3A`,ArrowDown:`\x1B[1;3B`},fye={ArrowLeft:``,ArrowUp:``,ArrowRight:``,ArrowDown:``},pye=[`JetBrains Mono`,`Fira Code`,`Source Code Pro`,`IBM Plex Mono`,`Inconsolata`,`Roboto Mono`,`Ubuntu Mono`,`Space Mono`],mye={"JetBrains Mono":`"JetBrains Mono Variable"`,"Share Tech Mono":`"Share Tech Mono"`},dT=new Set;function fT(e){try{return(new URL(e).pathname.split(`/`).pop()??``).replace(/\.[^.]+$/,``).replace(/[-_]/g,` `)||`CustomFont`}catch{return`CustomFont`}}async function hye(e){let t=e.trim();if(!t)return``;if(!/^https?:\/\//i.test(t))return t;if(dT.has(t))return fT(t);try{let e=(await j(t,{method:`HEAD`})).headers.get(`content-type`)??``;if(e.includes(`text/css`)){let e=document.createElement(`link`);return e.rel=`stylesheet`,e.href=t,e.dataset.fontSrc=t,document.head.appendChild(e),dT.add(t),``}if(e.startsWith(`font/`)){let e=fT(t),n=document.createElement(`style`);return n.dataset.fontSrc=t,n.textContent=`@font-face { font-family: '${e}'; src: url('${t}'); }`,document.head.appendChild(n),dT.add(t),e}}catch{}return t}function gye(e){let t=`google:${e}`;if(dT.has(t))return;let n=kve({families:[e]});n&&(n.dataset.fontSrc=t),dT.add(t)}var _ye=class{instances=new Map;listeners=new Set;activationListeners=new Set;idCounter=0;config={...oT};snapshotCache=null;inputHistoryStore=new Yve;bellSoundEngine=new Pw;keybindings=new eye;ghosttyModule=null;ghosttyInitPromise=null;appDarkMode=!1;systemDarkMode=!1;resolvedTheme=nT({useTheme:oT.useTheme,lightTheme:oT.lightTheme,darkTheme:oT.darkTheme,appDarkMode:!1,systemDarkMode:!1});ws=null;wsConnected=!1;reconnectTimer=null;reconnectDelay=cT;pendingCreates=[];pendingCloseSessionIds=new Set;pendingWorkflowInputs=new Map;workflowInputRequestCounter=0;serverToLocalSessionId=new Map;hasDiscoveredSessions=!1;inputPanelDefaultLayout=`floating`;activeSessionId=null;constructor(){this.bellSoundEngine.init()}createSession(e){let t=`term-${++this.idCounter}`,n=e.label??`Shell ${this.idCounter}`,r=this.createTerminalInstance(t,{label:n,command:e.command,args:e.args,isDedicated:e.isDedicated??!1,closeTip:e.closeTip,closeCallbackUrl:e.closeCallbackUrl,initialInput:e.initialInput,customTitle:e.customTitle??null,restored:!1,serverSessionId:null,platform:lT,cwdTarget:e.cwdTarget,initialCwd:null,rootGeneration:null});return this.instances.set(t,r),this._applyFonts(),this.bindTerminalInput(r),this.wsConnected&&this.ws?this.wsSend({type:`create`,requestId:t,cwdTarget:e.cwdTarget,expectedRootGeneration:e.expectedRootGeneration,cols:r.terminal.cols||80,rows:r.terminal.rows||24,command:e.command,args:e.args,closeTip:e.closeTip,closeCallbackUrl:e.closeCallbackUrl}):(this.pendingCreates.push({requestId:t,cwdTarget:e.cwdTarget,expectedRootGeneration:e.expectedRootGeneration,command:e.command,args:e.args,closeTip:e.closeTip,closeCallbackUrl:e.closeCallbackUrl,cols:r.terminal.cols||80,rows:r.terminal.rows||24}),this.ensureWsConnected()),e.initialInput&&this.scheduleInitialInput(t,e.initialInput),this.notify(),t}scheduleInitialInput(e,t){let n=0,r=()=>{this.writeToSession(e,t)||(n+=1,!(n>75)&&globalThis.setTimeout(r,80))};globalThis.setTimeout(r,80)}createTerminalInstance(e,t){let{terminal:n,fitAddon:r,afterOpenHook:i,engine:a}=this.createRendererTerminal(),o=this.createInputPanelAddon(e,t.platform);return n.loadAddon(o),this.attachTerminalShortcuts(n,a,t=>this.writeToSession(e,t)),{id:e,serverSessionId:t.serverSessionId,terminal:n,fitAddon:r,inputPanelAddon:o,isConnected:!1,label:t.label,customTitle:t.customTitle,processTitle:null,oscTitle:null,cwd:null,cwdTarget:t.cwdTarget,initialCwd:t.initialCwd,rootGeneration:t.rootGeneration,progress:null,promptState:null,isDedicated:t.isDedicated,isExited:!1,exitCode:null,command:t.command,args:t.args,closeTip:t.closeTip,closeCallbackUrl:t.closeCallbackUrl,mountedContainer:null,resizeObserver:null,hasOpened:!1,afterOpenHook:i,pendingOutput:[],pendingOutputBytes:0,lastOutputTime:0,lastBellAt:null,outputIdleTimer:null,restored:t.restored,platform:t.platform,rendererEngine:a}}getTerminalOptions(){let e=nT({useTheme:this.config.useTheme,lightTheme:this.config.lightTheme,darkTheme:this.config.darkTheme,appDarkMode:this.appDarkMode,systemDarkMode:this.systemDarkMode});return{cursorBlink:this.config.cursorBlink,cursorStyle:this.config.cursorStyle,fontSize:this.config.fontSize,fontFamily:aT,theme:e.definition.palette,allowTransparency:!1,convertEol:!0,macOptionIsMeta:!0,macOptionClickForcesSelection:!0,scrollback:this.config.scrollback}}createRendererTerminal(){let e=this.getTerminalOptions();if(this.config.rendererEngine===`xterm`){let t=new mge(e),n=new Hpe;return t.loadAddon(n),t.loadAddon(new Jpe),{terminal:t,fitAddon:n,afterOpenHook:null,engine:`xterm`}}let t=this.ghosttyModule;if(!t)throw Error(`ghostty-web is not initialized. Open Settings and switch engine again.`);let n=new t.Terminal(e),r=new t.FitAddon;return n.loadAddon(r),{terminal:n,fitAddon:r,afterOpenHook:()=>{let e=n;e.registerLinkProvider&&e.registerLinkProvider(new t.UrlRegexProvider(n))},engine:`ghostty`}}createInputPanelAddon(e,t){return new Tve({onInput:t=>this.writeToSession(e,t),onCommand:t=>this.runInputPanelCommand(e,t),getHistory:async()=>this.inputHistoryStore.list(),addHistory:async e=>this.inputHistoryStore.add(e),subscribeHistory:e=>this.inputHistoryStore.subscribe(e),platform:t,defaultLayout:this.inputPanelDefaultLayout,showFab:!1,stateKey:e,onSettingsChange:async e=>{await this.inputHistoryStore.setLimit(e.historyLimit)}})}runInputPanelCommand(e,t){let n=this.instances.get(e);return n?this.keybindings.runCommand(t,{terminal:n.terminal,writeInput:t=>this.writeToSession(e,t),zoomFont:e=>this.zoomFont(e),resetFontSize:()=>this.resetFontSize(),onAsyncError:e=>console.error(`[terminal] input panel command failed:`,e)})===`block`:!1}applyGhosttyBackground(e,t){if(e.rendererEngine!==`ghostty`)return;let n=e.terminal.options.theme??{},r=typeof n.background==`string`&&n.background.trim().length>0?n.background:this.resolveNearestOpaqueBackground(t);e.terminal.options.allowTransparency=!1,e.terminal.options.theme={...n,background:r}}isTransparentColor(e){let t=e.trim().toLowerCase();return t.length===0||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0,0,0,0)`}resolveNearestOpaqueBackground(e){let t=e;for(;t;){let e=window.getComputedStyle(t).backgroundColor;if(!this.isTransparentColor(e))return e;t=t.parentElement}return`rgb(26, 26, 26)`}resolveTerminalKeyInput(e){return e.type===`keydown`?e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey?dye[e.key]??null:e.metaKey&&!e.altKey&&!e.ctrlKey&&!e.shiftKey?fye[e.key]??null:!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey?uye[e.key]??null:null:null}getKeyEventResult(e,t){return e===`xterm`?t===`allow`:t===`block`}attachTerminalShortcuts(e,t,n){e.attachCustomKeyEventHandler(r=>{let i=this.resolveTerminalKeyInput(r);if(i&&n(i))return r.preventDefault(),r.stopPropagation(),this.getKeyEventResult(t,`block`);let a=r.metaKey||r.ctrlKey;if(r.type!==`keydown`||!a)return this.getKeyEventResult(t,`allow`);let o=this.keybindings.handleKeyEvent(r,{terminal:e,writeInput:n,zoomFont:e=>this.zoomFont(e),resetFontSize:()=>this.resetFontSize(),onAsyncError:e=>console.error(`[terminal] keybinding failed:`,e)});return o===`block`&&(r.preventDefault(),r.stopPropagation()),this.getKeyEventResult(t,o)})}bindTerminalInput(e){e.terminal.onData(t=>{if(e.isExited){this.closeSession(e.id);return}let n=this.resolveServerSessionId(e.id);n&&this.wsSend({type:`input`,sessionId:n,data:t})})}isTerminalNotOpenedError(e){if(!(e instanceof Error))return!1;let t=e.message;return t.includes(`Terminal must be opened before use`)||t.includes(`Call terminal.open(parent) first`)}enqueuePendingOutput(e,t){if(t)for(e.pendingOutput.push(t),e.pendingOutputBytes+=t.length;e.pendingOutputBytes>oye&&e.pendingOutput.length;){let t=e.pendingOutput.shift();if(!t)break;e.pendingOutputBytes-=t.length}}writeTerminalOutput(e,t){if(t){if(!e.hasOpened){this.enqueuePendingOutput(e,t);return}try{e.terminal.write(t)}catch(n){if(this.isTerminalNotOpenedError(n)){this.enqueuePendingOutput(e,t);return}console.error(`[terminal] failed to write output:`,n)}}}flushPendingOutput(e){if(!e.hasOpened||e.pendingOutput.length===0)return;let t=e.pendingOutput.join(``);e.pendingOutput=[],e.pendingOutputBytes=0,this.writeTerminalOutput(e,t)}replaceInstanceRenderer(e){let t=e.mountedContainer,n=e.serverSessionId;e.mountedContainer&&this.unmount(e.id),e.terminal.dispose();let{terminal:r,fitAddon:i,afterOpenHook:a,engine:o}=this.createRendererTerminal(),s=this.createInputPanelAddon(e.id,e.platform);r.loadAddon(s),this.attachTerminalShortcuts(r,o,t=>this.writeToSession(e.id,t)),e.terminal=r,e.fitAddon=i,e.inputPanelAddon=s,e.hasOpened=!1,e.afterOpenHook=a,e.mountedContainer=null,e.resizeObserver=null,e.rendererEngine=o,this.bindTerminalInput(e),t&&this.mount(e.id,t),n&&this.wsSend({type:`attach`,sessionId:n,cols:e.terminal.cols||80,rows:e.terminal.rows||24})}async ensureGhosttyModule(){return this.ghosttyModule?this.ghosttyModule:(this.ghosttyInitPromise||=c(()=>import(`./ghostty-web-BSS9uGcc.js`).then(async e=>(await e.init(),this.ghosttyModule=e,e)),__vite__mapDeps([25,6])).finally(()=>{this.ghosttyInitPromise=null}),this.ghosttyInitPromise)}async setRendererEngine(e){if(e!==this.config.rendererEngine){e===`ghostty`&&await this.ensureGhosttyModule(),this.config.rendererEngine=e;for(let e of this.instances.values())this.replaceInstanceRenderer(e);this._applyFonts(),this.notify()}}closeSession(e,t){let n=this.instances.get(e);if(!n)return;let r=t?.triggerCloseCallback!==!1;if(n.mountedContainer&&this.unmount(e),n.outputIdleTimer&&=(clearTimeout(n.outputIdleTimer),null),this.pendingCreates=this.pendingCreates.filter(t=>t.requestId!==e),n.serverSessionId){let e=n.serverSessionId;this.serverToLocalSessionId.delete(e),this.wsConnected&&this.ws?.readyState===WebSocket.OPEN?this.wsSend({type:`close`,sessionId:e}):this.pendingCloseSessionIds.add(e)}n.terminal.dispose(),r&&this.runCloseCallback(n),this.instances.delete(e),this.activeSessionId===e&&(this.activeSessionId=null),this.notify()}closeAll(){for(let e of this.instances.keys())this.closeSession(e,{triggerCloseCallback:!1});this.activeSessionId=null}mount(e,t){let n=this.instances.get(e);if(!n)return;if(n.mountedContainer===t){requestAnimationFrame(()=>{try{n.fitAddon.fit()}catch{}});return}if(n.mountedContainer&&this.unmount(e),!n.hasOpened)this.applyGhosttyBackground(n,t),n.terminal.open(t),n.hasOpened=!0,n.afterOpenHook?.(),n.afterOpenHook=null,this.flushPendingOutput(n),n.inputPanelAddon.attachListeners();else{let e=n.terminal.element;e&&!e.contains(t)&&e.parentNode!==t&&t.appendChild(e),this.flushPendingOutput(n),this.applyGhosttyBackground(n,t),n.inputPanelAddon.attachListeners()}n.mountedContainer=t,requestAnimationFrame(()=>{try{n.fitAddon.fit()}catch{}});let r=new ResizeObserver(()=>{try{if(n.fitAddon.fit(),n.terminal.cols&&n.terminal.rows){let t=this.resolveServerSessionId(e);if(!t)return;this.wsSend({type:`resize`,sessionId:t,cols:n.terminal.cols,rows:n.terminal.rows})}}catch{}});r.observe(t),n.resizeObserver=r,requestAnimationFrame(()=>{this.focusSession(e)})}unmount(e){let t=this.instances.get(e);!t||!t.mountedContainer||(t.resizeObserver&&=(t.resizeObserver.disconnect(),null),t.mountedContainer=null)}focusSession(e){let t=this.instances.get(e);if(!t||!t.hasOpened)return;let n=!1;try{t.terminal.focus?.(),n=!0}catch{}if(!n){let e=t.terminal.element;if(e instanceof HTMLElement)try{e.focus()}catch{}}t.inputPanelAddon.syncFocusLifecycle()}setActiveSessionId(e){e&&!this.instances.has(e)||(this.activeSessionId=e)}setCustomTitle(e,t){let n=this.instances.get(e);n&&(n.customTitle=t,this.notify())}getDisplayTitle(e){let t=this.instances.get(e);return t?t.customTitle??t.oscTitle??t.processTitle??t.label:``}getConfig(){return{...this.config}}getResolvedTheme(){return this.resolvedTheme}setThemeContext(e){(this.appDarkMode!==e.appDarkMode||this.systemDarkMode!==e.systemDarkMode)&&(this.appDarkMode=e.appDarkMode,this.systemDarkMode=e.systemDarkMode,this.refreshResolvedTheme())}applyConfig(e){let{rendererEngine:t,...n}=e;Object.assign(this.config,n);for(let e of this.instances.values()){let t=e.terminal;t.options.fontSize=this.config.fontSize,t.options.cursorBlink=this.config.cursorBlink,t.options.cursorStyle=this.config.cursorStyle,t.options.scrollback=this.config.scrollback}this.refreshResolvedTheme(),this._applyFonts(),t&&t!==this.config.rendererEngine&&this.setRendererEngine(t).catch(e=>{console.error(`[terminal] failed to switch renderer engine:`,e)}),this.notify()}refreshResolvedTheme(){let e=nT({useTheme:this.config.useTheme,lightTheme:this.config.lightTheme,darkTheme:this.config.darkTheme,appDarkMode:this.appDarkMode,systemDarkMode:this.systemDarkMode});this.resolvedTheme=e;for(let t of this.instances.values())t.terminal.options.theme=e.definition.palette,t.terminal.options.allowTransparency=!1,t.mountedContainer&&this.applyGhosttyBackground(t,t.mountedContainer)}async _applyFonts(){let e=this.config.fontFamily;if(!e){this._setFontFamily(aT);return}let t=e.split(/[,]+/).map(e=>e.trim()).filter(Boolean),n=[];for(let e of t){let t=mye[e];if(t)n.push(t);else if(pye.includes(e))gye(e),n.push(e);else{let t=await hye(e);t&&n.push(t)}}n.push(aT),this._setFontFamily(n.join(`, `))}_setFontFamily(e){for(let t of this.instances.values())if(t.terminal.options.fontFamily=e,t.mountedContainer)try{t.fitAddon.fit()}catch{}}configPersistTimer=null;persistFontSize(){this.configPersistTimer&&clearTimeout(this.configPersistTimer),this.configPersistTimer=setTimeout(()=>{this.configPersistTimer=null,c(async()=>{let{trpcClient:e}=await import(`./trpc-0wHaJTCK.js`);return{trpcClient:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(({trpcClient:e})=>{e.config.update.mutate({terminal:{fontSize:this.config.fontSize}})}).catch(()=>{})},lye)}zoomFont(e){let t=Math.min(cye,Math.max(sye,this.config.fontSize+e));t!==this.config.fontSize&&(this.applyConfig({fontSize:t}),this.persistFontSize())}resetFontSize(){this.config.fontSize!==uT&&(this.applyConfig({fontSize:uT}),this.persistFontSize())}writeToSession(e,t){let n=this.resolveServerSessionId(e);return n?this.wsSend({type:`input`,sessionId:n,data:t}):!1}writeWorkflowToSession(e,t,n){let r=this.resolveServerSessionId(e);if(!r)return Promise.reject(Error(`Terminal session is not ready.`));let i=`workflow-input-${++this.workflowInputRequestCounter}`;return new Promise((e,a)=>{this.pendingWorkflowInputs.set(i,{resolve:e,reject:a}),this.wsSend({type:`workflow-input`,requestId:i,sessionId:r,expectedRootGeneration:n,data:t})||(this.pendingWorkflowInputs.delete(i),a(Error(`Terminal connection is unavailable.`)))})}openInputPanel(e){let t=[e?this.instances.get(e):void 0,...this.instances.values()],n=t.find(e=>e&&e.mountedContainer)?.id??t.find(e=>e)?.id;if(!n)return!1;this.focusSession(n);let r=this.instances.get(n);return r?(r.inputPanelAddon.open(),!0):!1}hasServerSession(e){let t=this.getInstanceByServerSessionId(e);return!!t&&!t.isExited}focusServerSession(e){let t=this.getInstanceByServerSessionId(e);return!t||t.isExited?!1:(this.focusSession(t.id),!0)}subscribeActivation(e){return this.activationListeners.add(e),()=>{this.activationListeners.delete(e)}}requestActivateSession(e){let t=this.instances.get(e);return!t||t.isExited?!1:(this.emitActivationRequest(t.id),!0)}requestActivateServerSession(e){let t=this.getInstanceByServerSessionId(e);return!t||t.isExited?!1:(this.emitActivationRequest(t.id),!0)}getLocalSessionIdForServerSession(e){return this.getInstanceByServerSessionId(e)?.id??null}isSessionActive(e){return this.activeSessionId===e}async addInputHistory(e){await this.inputHistoryStore.add(e)}resolveServerSessionId(e){let t=this.instances.get(e);return t?t.serverSessionId:null}getInstanceByServerSessionId(e){let t=this.serverToLocalSessionId.get(e)??e;return this.instances.get(t)}getLocalSessionIdByServerSessionId(e){return this.serverToLocalSessionId.get(e)??e}handleCreatedResponse(e){let t=this.instances.get(e.requestId);if(!t){this.wsSend({type:`close`,sessionId:e.sessionId});return}t.serverSessionId=e.sessionId,t.platform=e.platform,t.cwdTarget=e.cwdTarget,t.initialCwd=e.initialCwd,t.rootGeneration=e.rootGeneration,t.inputPanelAddon.setPlatform(e.platform),t.isConnected=!0,this.serverToLocalSessionId.set(e.sessionId,e.requestId),this.notify()}handleOutputResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);if(!t)return;this.writeTerminalOutput(t,e.data);let n=t.lastOutputTime>0&&Date.now()-t.lastOutputTime<sT;t.lastOutputTime=Date.now(),n||this.notify(),t.outputIdleTimer&&clearTimeout(t.outputIdleTimer),t.outputIdleTimer=setTimeout(()=>{t.outputIdleTimer=null,this.notify()},sT)}handleExitResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);if(t){if(t.isExited=!0,t.exitCode=e.exitCode,t.closeTip||t.isDedicated){let n=t.closeTip??`Press any key to close (equivalent to close action).`;this.writeTerminalOutput(t,`\r\n\x1b[90m[Process exited with code ${e.exitCode}. ${n}]\x1b[0m`)}this.notify()}}handleTitleResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);t&&(t.oscTitle=e.title,this.notify())}handleProcessTitleResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);t&&(t.processTitle=e.title,this.notify())}handleCwdResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);t&&(t.cwd=e.cwd,this.notify())}handleProgressResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);t&&(t.progress=e.state===`clear`?null:{state:e.state,value:e.value},this.notify())}handlePromptStateResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);t&&(t.promptState=e.state,this.notify())}handleBellResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);!t||t.isExited||(t.lastBellAt=e.createdAt??Date.now(),this.bellSoundEngine.play(this.config.bellSound,this.config.bellVolume).catch(()=>{}),this.notify())}handleBufferResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);!t||!e.data||this.writeTerminalOutput(t,e.data)}handleErrorResponse(e){if(e.code===`PTY_CREATE_FAILED`&&e.sessionId){let t=this.instances.get(e.sessionId);t&&!t.serverSessionId&&(t.isExited=!0,t.exitCode=-1,this.writeTerminalOutput(t,`\r\n\x1b[31m[Failed to start PTY: ${e.message}]\x1b[0m`),this.notify())}console.warn(`[pty] ${e.code}: ${e.message}`,e)}setInputPanelMountTarget(e){Tve.mountTarget=e}setInputPanelDefaultLayout(e){this.inputPanelDefaultLayout=e;for(let t of this.instances.values())t.inputPanelAddon.setDefaultLayout(e)}getTerminalDimensions(e){let t=this.instances.get(e);return t?{cols:t.terminal.cols||80,rows:t.terminal.rows||24}:null}subscribe(e){return this.listeners.add(e),this.ensureWsConnected(),()=>{this.listeners.delete(e)}}getSnapshot(){if(this.snapshotCache)return this.snapshotCache;let e=[];for(let t of this.instances.values())e.push({id:t.id,serverSessionId:t.serverSessionId,label:t.label,customTitle:t.customTitle,processTitle:t.processTitle,oscTitle:t.oscTitle,cwd:t.cwd,cwdTarget:t.cwdTarget,initialCwd:t.initialCwd,rootGeneration:t.rootGeneration,progress:t.progress,promptState:t.promptState,displayTitle:t.customTitle??t.oscTitle??t.processTitle??t.label,isDedicated:t.isDedicated,isExited:t.isExited,exitCode:t.exitCode,outputActive:t.lastOutputTime>0&&Date.now()-t.lastOutputTime<sT,lastBellAt:t.lastBellAt,command:t.command,args:t.args,closeTip:t.closeTip,closeCallbackUrl:t.closeCallbackUrl,platform:t.platform});return this.snapshotCache={sessions:e},this.snapshotCache}notify(){this.snapshotCache=null;for(let e of this.listeners)e()}emitActivationRequest(e){this.setActiveSessionId(e);for(let t of this.activationListeners)t(e);this.scheduleSessionFocus(e)}scheduleSessionFocus(e){(typeof globalThis.requestAnimationFrame==`function`?globalThis.requestAnimationFrame.bind(globalThis):e=>globalThis.setTimeout(()=>e(Date.now()),0))(()=>{this.focusSession(e)})}ensureWsConnected(){this.ws&&(this.ws.readyState===WebSocket.CONNECTING||this.ws.readyState===WebSocket.OPEN)||this.connectSharedWebSocket()}connectSharedWebSocket(){this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null);let e=new WebSocket(P());this.ws=e,e.onopen=()=>{this.wsConnected=!0,this.reconnectDelay=cT;let t=L();t&&e.send(JSON.stringify({type:`auth`,credential:t}));for(let e of this.pendingCloseSessionIds)this.wsSend({type:`close`,sessionId:e});this.pendingCloseSessionIds.clear(),this.wsSend({type:`list`});for(let e of this.pendingCreates)this.wsSend({type:`create`,requestId:e.requestId,cwdTarget:e.cwdTarget,expectedRootGeneration:e.expectedRootGeneration,cols:e.cols,rows:e.rows,command:e.command,args:e.args,closeTip:e.closeTip,closeCallbackUrl:e.closeCallbackUrl});this.pendingCreates=[];for(let e of this.instances.values())if(!e.restored)continue;this.notify()},e.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}let n=Rpe.safeParse(t);n.success&&this.handleServerMessage(n.data)},e.onclose=()=>{this.wsConnected=!1,this.ws=null;for(let e of this.pendingWorkflowInputs.values())e.reject(Error(`Terminal connection closed before workflow input was accepted.`));this.pendingWorkflowInputs.clear(),this.notify(),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,(this.listeners.size>0||this.instances.size>0)&&this.connectSharedWebSocket()},this.reconnectDelay),this.reconnectDelay=Math.min(this.reconnectDelay*1.5,aye)},e.onerror=()=>{}}handleServerMessage(e){switch(e.type){case`list`:this.handleListResponse(e);break;case`created`:this.handleCreatedResponse(e);break;case`workflow-input-accepted`:{let t=this.pendingWorkflowInputs.get(e.requestId);if(!t)break;this.pendingWorkflowInputs.delete(e.requestId),t.resolve();break}case`workflow-input-rejected`:{let t=this.pendingWorkflowInputs.get(e.requestId);if(!t)break;this.pendingWorkflowInputs.delete(e.requestId),t.reject(Error(e.message));break}case`buffer`:this.handleBufferResponse(e);break;case`output`:this.handleOutputResponse(e);break;case`exit`:this.handleExitResponse(e);break;case`title`:this.handleTitleResponse(e);break;case`process-title`:this.handleProcessTitleResponse(e);break;case`cwd`:this.handleCwdResponse(e);break;case`progress`:this.handleProgressResponse(e);break;case`prompt-state`:this.handlePromptStateResponse(e);break;case`bell`:this.handleBellResponse(e);break;case`error`:this.handleErrorResponse(e);break}}handleListResponse(e){let t=new Set(e.sessions.map(e=>e.id));for(let t of e.sessions){let e=this.getLocalSessionIdByServerSessionId(t.id),n=this.instances.get(e);if(n)n.serverSessionId||=t.id;else{let e=t.title||`${t.command} ${t.args.join(` `)}`.trim();n=this.createTerminalInstance(t.id,{label:e.length>40?`${e.slice(0,37)}...`:e,command:t.command,args:t.args,isDedicated:!1,closeTip:t.closeTip,closeCallbackUrl:t.closeCallbackUrl,initialInput:void 0,customTitle:null,restored:!0,serverSessionId:t.id,platform:t.platform??lT,cwdTarget:t.cwdTarget,initialCwd:t.initialCwd,rootGeneration:t.rootGeneration}),t.isExited&&(n.isExited=!0,n.exitCode=t.exitCode),this.bindTerminalInput(n),this.instances.set(n.id,n),this._applyFonts()}n.closeTip=t.closeTip,n.closeCallbackUrl=t.closeCallbackUrl,n.cwdTarget=t.cwdTarget,n.initialCwd=t.initialCwd,n.rootGeneration=t.rootGeneration,n.platform=t.platform??lT,n.inputPanelAddon.setPlatform(n.platform),this.serverToLocalSessionId.set(t.id,n.id),this.wsSend({type:`attach`,sessionId:t.id,cols:n.terminal.cols||80,rows:n.terminal.rows||24})}for(let e of this.instances.values())e.restored&&e.serverSessionId&&!t.has(e.serverSessionId)&&!e.isExited&&(e.isExited=!0,e.exitCode=-1);this.hasDiscoveredSessions=!0,this.notify()}get discoveredSessions(){return this.hasDiscoveredSessions}runCloseCallback(e){if(!e.isExited)return;let t=vye(e.closeCallbackUrl,e.exitCode);t&&yye(t)}wsSend(e){return this.ws?.readyState===WebSocket.OPEN?(this.ws.send(JSON.stringify(e)),!0):!1}};function vye(e,t){if(!e)return null;if(typeof e==`string`){let t=e.trim();return t.length>0?t:null}let n=e[t==null?`null`:String(t)];if(typeof n==`string`&&n.trim().length>0)return n.trim();let r=e[`*`];return typeof r==`string`&&r.trim().length>0?r.trim():null}function yye(e){let t;try{t=new URL(e,window.location.origin)}catch{return}if(t.origin===window.location.origin){let e=`${t.pathname}${t.search}${t.hash}`,n=Pa.getAreaForPath(t.pathname);Pa.push(n,e,null);return}window.open(t.toString(),`_blank`,`noopener,noreferrer`)}var pT=new _ye,mT=Gie;m({sound:mT.default(el),volume:Kie,systemNotificationsEnabled:f().default(!1)});var bye=N(`type`,[m({type:_(`terminal`),sessionId:x().min(1),title:x().optional()}),m({type:_(`openspec-change`),changeId:x().min(1),title:x().optional()}),m({type:_(`hooks-plugin`),pluginId:x().min(1),title:x().optional()}),m({type:_(`root-context`)}),m({type:_(`custom`),groupId:x().min(1),title:x().optional()})]),xye=N(`type`,[m({type:_(`terminal.focus`),label:x().default(`Focus terminal`),target:m({sessionId:x().min(1)})}),m({type:_(`href.open`),label:x().default(`Open`),target:m({href:x().min(1)})})]),Sye=x().min(1);m({title:x().min(1).max(160),body:x().max(2e3).default(``),source:bye,actions:p(xye).default([]),level:l([`info`,`success`,`warning`,`error`]).default(`info`),createdAt:b().int().positive().optional()}).extend({id:x().min(1),createdAt:b().int().positive(),groupKey:Sye});function Cye(e){return e.type===`terminal`?e.title?.trim()||`Terminal ${e.sessionId}`:e.type===`openspec-change`?e.title?.trim()||`Change ${e.changeId}`:e.type===`hooks-plugin`?e.title?.trim()||`Plugin ${e.pluginId}`:e.type===`root-context`?`Root Context`:e.title?.trim()||e.groupId}function hT(e){return Array.isArray(e)?`[${e.map(e=>hT(e)).join(`,`)}]`:e&&typeof e==`object`?`{${Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${JSON.stringify(e)}:${hT(t)}`).join(`,`)}}`:JSON.stringify(e)}function wye(e){return hT({groupKey:e.groupKey,title:e.title,body:e.body,source:e.source,actions:e.actions,level:e.level})}function Tye(e){let t=new Map;for(let n of e){let e=wye(n),r=t.get(e);r?r.push(n):t.set(e,[n])}return[...t.entries()].map(([e,t])=>{let n=[...t].sort((e,t)=>t.createdAt-e.createdAt);return{key:e,notifications:n,latest:n[0],count:n.length}}).sort((e,t)=>t.latest.createdAt-e.latest.createdAt)}function Eye(e){let t=new Map;for(let n of e){let e=t.get(n.groupKey);e?e.push(n):t.set(n.groupKey,[n])}return[...t.entries()].map(([e,t])=>{let n=[...t].sort((e,t)=>t.createdAt-e.createdAt),r=n[0];return{key:e,label:Cye(r.source),source:r.source,notifications:n,aggregates:Tye(n),latest:r,unreadCount:n.length}}).sort((e,t)=>t.latest.createdAt-e.latest.createdAt)}function gT(){if(typeof window>`u`)return;let e=V(),t=e.endsWith(`/`)?e:`${e}/`;return new URL(`${t}icon.rounded.svg`,window.location.href).href}var Dye=class extends Nw{constructor(){super(`notification`)}},_T=(0,q.createContext)(null);function Oye({value:e,children:t}){return(0,K.jsx)(_T,{value:e,children:t})}var kye={notifications:[],latestNotification:null,groups:[],unreadCount:0,highlightedId:null,browserSupported:!1,browserPermission:`unsupported`,panelOpen:!1,openPanel:()=>void 0,requestBrowserPermission:async()=>`unsupported`,previewSound:async()=>void 0,resolveAction:(e,t)=>({action:t,disabled:!0,reason:`Notifications are not available in this render tree.`,run:async()=>void 0}),markRead:async()=>void 0,markManyRead:async()=>void 0,clearGroup:async()=>void 0,clearAll:async()=>void 0,clearTerminalSession:async()=>void 0};function vT(){return typeof window<`u`&&`Notification`in window}function Aye(){return vT()?Notification.permission:`unsupported`}function jye(e){if(!e)return`/notifications`;let t=new URLSearchParams;return t.set(`highlight`,e),`/notifications?${t.toString()}`}function Mye(e){return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}function Nye(e){return e.body.trim()||e.title}function Pye(e){let t=e[0];if(!t)return``;let n=Mye(t.createdAt);return e.length<=1?`${n} - 1 unread`:`${n} - ${e.length} unread notifications`}async function Fye(){if(Pa.getAreaForPath(`/terminal`)===`bottom`){await Vd.activateBottom(`/terminal`);return}await Vd.push(`main`,`/terminal`,null)}function Iye({children:e}){let{data:t}=Hoe(),{data:n}=nd(),r=Fa(),i=t??[],a=(0,q.useMemo)(()=>Eye(i),[i]),o=i[0]??null,[s,c]=(0,q.useState)(()=>Aye()),[l,u]=(0,q.useState)(null),d=(0,q.useRef)(null),f=(0,q.useRef)(null),p=(0,q.useRef)(null),m=r.popActive&&r.popLocation.pathname===`/notifications`,h=n?.notifications?.systemNotificationsEnabled??!1,g=n?.notifications?.sound??`builtin:Blow`,_=n?.notifications?.volume??1;(0,q.useEffect)(()=>{let e=new Dye;e.init(),d.current=e},[]);let v=(0,q.useCallback)(e=>{typeof window<`u`&&window.focus(),u(e??null),Vd.activatePop(jye(e))},[]),y=(0,q.useCallback)(async e=>{await G.notifications.markRead.mutate({id:e})},[]),b=(0,q.useCallback)(async e=>{await G.notifications.markManyRead.mutate({ids:[...e]})},[]),x=(0,q.useCallback)(async e=>{await G.notifications.clearGroup.mutate({groupKey:e})},[]),S=(0,q.useCallback)(async()=>{await G.notifications.clearAll.mutate()},[]),C=(0,q.useCallback)(async e=>{await G.notifications.clearTerminalSession.mutate({sessionId:e})},[]),w=(0,q.useCallback)(async()=>{if(!vT())return c(`unsupported`),`unsupported`;let e=await Notification.requestPermission();return c(e),e===`granted`&&await G.config.update.mutate({notifications:{systemNotificationsEnabled:!0}}),e},[]),T=(0,q.useCallback)(async(e,t)=>{await d.current?.play(e??g,t??_)},[g,_]),E=(0,q.useCallback)((e,t,n)=>{let r=n?.markReadOnRun??!0;if(t.type===`terminal.focus`){let n=pT.hasServerSession(t.target.sessionId);return{action:t,disabled:!n,reason:n?void 0:`Target terminal is no longer available.`,run:async()=>{pT.hasServerSession(t.target.sessionId)&&(await Vd.deactivatePop(),await Fye(),pT.requestActivateServerSession(t.target.sessionId)&&r&&await y(e.id))}}}return{action:t,disabled:!1,run:async()=>{let n=Pa.getAreaForPath(t.target.href);m&&await Vd.deactivatePop(),await Vd.push(n,t.target.href,null),r&&await y(e.id)}}},[y,m]);return(0,q.useEffect)(()=>{let e=o?.id??null;if(!e||f.current===e){f.current=e;return}if(f.current=e,d.current?.play(g,_).catch(()=>{}),!h||m||!vT()||Notification.permission!==`granted`)return;p.current?.close();let t=new Notification(Nye(o),{body:Pye(i),icon:gT(),tag:`openspecui-notifications`});t.onclick=()=>{v(o.id),t.close()},p.current=t},[o,i,v,m,g,h,_]),(0,q.useEffect)(()=>{m&&(p.current?.close(),p.current=null)},[m]),(0,q.useEffect)(()=>{r.popLocation.pathname===`/notifications`&&u(new URLSearchParams(r.popLocation.search).get(`highlight`))},[r.popLocation.pathname,r.popLocation.search]),(0,K.jsx)(Oye,{value:(0,q.useMemo)(()=>({notifications:i,latestNotification:o,groups:a,unreadCount:i.length,highlightedId:l,browserSupported:vT(),browserPermission:s,panelOpen:m,openPanel:v,requestBrowserPermission:w,previewSound:T,resolveAction:E,markRead:y,markManyRead:b,clearGroup:x,clearAll:S,clearTerminalSession:C}),[s,S,x,C,a,l,o,b,y,i,v,m,T,w,E]),children:e})}function yT(){return(0,q.useContext)(_T)||kye}function bT({className:e,badgeClassName:t,iconClassName:n,size:r=`mobile`}){let{unreadCount:i,openPanel:a}=yT();return(0,K.jsx)(Sv,{label:i>0?`Open notifications, ${i} unread`:`Open notifications`,icon:(0,K.jsx)(qd,{className:dv(`h-4 w-4`,n)}),badge:i>0?(0,K.jsx)(mv,{count:i,className:dv(`ring-background absolute -right-1.5 -top-1.5 ring-2`,t),"aria-hidden":`true`}):void 0,size:r,className:e,onClick:()=>a(),"data-notification-entry-button":`true`})}function xT({children:e,maxWidth:t=300,duration:n=10,gap:r=20,className:i=``}){let[a,o]=(0,q.useState)(!1),[s,c]=(0,q.useState)(!1),l=(0,q.useRef)(null),u=(0,q.useRef)(null);(0,q.useEffect)(()=>{let e=()=>{if(l.current&&u.current){let e=l.current.offsetWidth,t=u.current.scrollWidth;c(t>e)}};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[e]);let d=(0,q.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}catch(e){console.error(`Failed to copy path:`,e)}},[e]),f=typeof t==`number`?`${t}px`:t;return(0,K.jsxs)(`button`,{onClick:d,className:`hover:bg-muted/50 group flex cursor-pointer items-center gap-1.5 rounded transition-colors ${i}`,title:`${e}\n\nClick to copy`,children:[(0,K.jsx)(`div`,{ref:l,className:`relative overflow-hidden whitespace-nowrap`,style:{maxWidth:f},children:(0,K.jsx)(`div`,{ref:u,"data-content":e,className:`relative inline-block ${s?`animate-marquee group-hover:[animation-play-state:paused]!`:``}`,style:s?{"--marquee-duration":`${n}s`,"--marquee-gap":`${r}px`}:void 0,children:e})}),(0,K.jsx)(`span`,{className:`text-muted-foreground group-hover:text-foreground shrink-0 transition-colors`,children:a?(0,K.jsx)(Jd,{className:`h-3.5 w-3.5 text-green-500`}):(0,K.jsx)(ef,{className:`h-3.5 w-3.5`})})]})}function ST({compact:e=!1}){if(z())return(0,K.jsxs)(`div`,{className:`status-indicator flex items-center gap-1.5 text-xs`,title:`Live features disabled (no file watching, task toggling, or AI integration)`,children:[(0,K.jsx)(zse,{className:`h-3.5 w-3.5 text-blue-500`}),!e&&(0,K.jsx)(`span`,{className:`status-text text-blue-600`,children:`Static`})]});let t=Tv(),n=Spe();if(t.connected){let n=t.watcherEnabled?`Watching for changes`:`File watcher disabled`;return(0,K.jsxs)(`div`,{className:`status-indicator flex items-center gap-1.5 text-xs`,children:[(0,K.jsx)(wf,{className:`h-3.5 w-3.5 text-green-500`}),!e&&(0,K.jsx)(fv,{content:n,children:(0,K.jsx)(`span`,{className:`status-text cursor-default text-green-600`,children:`Live`})})]})}return(0,K.jsxs)(`div`,{className:`status-indicator flex items-center gap-1.5 text-xs`,children:[(0,K.jsx)(qf,{className:`h-3.5 w-3.5 text-red-500`}),!e&&(0,K.jsx)(`span`,{className:`status-text text-red-600`,children:`Offline`}),t.reconnectCountdown!==null&&(0,K.jsxs)(`button`,{onClick:n,className:`text-muted-foreground hover:text-foreground flex cursor-pointer items-center gap-1 transition-colors`,title:`Click to reconnect now`,children:[(0,K.jsxs)(`span`,{className:`text-xs`,children:[`(`,t.reconnectCountdown,`s)`]}),(0,K.jsx)(Nf,{className:`h-3 w-3`})]})]})}function Lye(){let e=z(),[t,n]=(0,q.useState)(`Unknown`),[r,i]=(0,q.useState)(null);if((0,q.useEffect)(()=>{e&&Su().then(e=>{e?.meta?.timestamp?n(new Date(e.meta.timestamp).toLocaleString()):n(`Unknown`),i(e?.git?.repositoryUrl??null)}).catch(()=>{n(`Unknown`),i(null)})},[e]),e)return(0,K.jsx)(`div`,{className:`desktop-status border-border bg-muted/30 text-muted-foreground flex h-8 items-center justify-between gap-4 border-t px-2 text-xs`,children:(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,K.jsx)(ST,{}),(0,K.jsxs)(`span`,{className:`truncate`,children:[`Generated: `,t]}),r&&(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,K.jsx)(tce,{className:`h-3.5 w-3.5 shrink-0`}),(0,K.jsx)(xT,{children:r,maxWidth:280,duration:12,className:`text-xs`})]})]})});let a=Tv();return(0,K.jsxs)(`div`,{className:`desktop-status border-border bg-muted/30 text-muted-foreground flex h-8 items-center justify-between gap-4 border-t px-2 text-xs`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsx)(ST,{}),a.projectDir&&(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(mf,{className:`h-3.5 w-3.5 shrink-0`}),(0,K.jsx)(xT,{children:a.projectDir,maxWidth:300,duration:12,className:`text-xs`})]})]}),(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,K.jsx)(bT,{})})]})}function Rye(){let[e,t]=(0,q.useState)(!1),n=ca(),r=Tv(),i=Fa(),a=r.dirName??`OpenSpec`,o=V(),s=z(),c=()=>t(!1);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`header`,{className:`mobile-header border-border bg-background flex h-12 items-center justify-between border-b px-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`button`,{onClick:()=>t(!0),className:`hover:bg-muted -ml-1.5 rounded-md p-1.5`,"aria-label":`Open menu`,children:(0,K.jsx)(ice,{className:`h-5 w-5`})}),(0,K.jsx)(`span`,{className:`font-nav max-w-[min(52vw,18rem)] truncate text-[12px] tracking-[0.04em]`,children:a})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Sv,{label:`Open search`,icon:(0,K.jsx)(Lf,{className:`h-4 w-4`}),onClick:()=>Vd.activatePop(`/search`)}),!s&&(0,K.jsx)(bT,{}),(0,K.jsx)(ST,{compact:!0})]})]}),e&&(0,K.jsxs)(`div`,{className:`fixed inset-0 z-50 flex`,children:[(0,K.jsx)(`div`,{className:`animate-in fade-in absolute inset-0 bg-black/50 duration-200`,onClick:c}),(0,K.jsxs)(`nav`,{className:`bg-background border-border animate-in slide-in-from-left relative flex h-full w-64 max-w-[80vw] flex-col border-r p-4 duration-200`,children:[(0,K.jsxs)(`div`,{className:`mb-6 flex items-center justify-between`,children:[(0,K.jsx)(`img`,{src:n?`${o}openspec_pixel_dark.svg`:`${o}openspec_pixel_light.svg`,alt:`OpenSpec`,className:`h-5`}),(0,K.jsx)(`button`,{onClick:c,className:`hover:bg-muted rounded-md p-1.5`,"aria-label":`Close menu`,children:(0,K.jsx)(Yf,{className:`h-5 w-5`})})]}),s?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`ul`,{className:`flex-1 space-y-1`,children:vv.map(e=>(0,K.jsx)(`li`,{children:(0,K.jsxs)(Rd,{to:e.to,onClick:c,className:`hover:bg-muted [&.active]:bg-primary [&.active]:text-primary-foreground flex items-center gap-2 rounded-md px-3 py-2`,children:[(0,K.jsx)(e.icon,{className:`h-4 w-4 shrink-0`}),(0,K.jsx)(`span`,{className:`font-nav text-base tracking-[0.04em]`,children:e.label})]})},e.to))}),(0,K.jsx)(`div`,{className:`border-border space-y-1 border-t pt-4`,children:(0,K.jsxs)(Rd,{to:yv.to,onClick:c,className:`hover:bg-muted [&.active]:bg-primary [&.active]:text-primary-foreground flex items-center gap-2 rounded-md px-3 py-2`,children:[(0,K.jsx)(yv.icon,{className:`h-4 w-4 shrink-0`}),(0,K.jsx)(`span`,{className:`font-nav text-base tracking-[0.04em]`,children:yv.label})]})})]}):(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2`,children:[(0,K.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,K.jsx)(xv,{area:`main`,tabs:i.mainTabs,className:`scrollbar-thin scrollbar-track-transparent h-full overflow-auto`,useLinks:!0,onNavigate:c})}),(0,K.jsx)(`div`,{className:`text-muted-foreground text-[10px] font-medium uppercase tracking-wider`,children:`Bottom`}),(0,K.jsx)(`div`,{className:`border-border border-t pt-2`,children:(0,K.jsx)(xv,{area:`bottom`,tabs:i.bottomTabs,onNavigate:c})})]})]})]})]})}function zye(){let e=Fa();return(0,K.jsx)(`nav`,{className:`mobile-tabbar border-border bg-background flex h-14 items-stretch border-t`,children:(z()?vpe:e.mainTabs.map(e=>_v.find(t=>t.to===e)).filter(e=>e!=null)).map(e=>(0,K.jsxs)(Rd,{to:e.to,className:`text-muted-foreground hover:text-foreground [&.active]:text-primary flex flex-1 flex-col items-center justify-center gap-0.5`,children:[(0,K.jsxs)(`span`,{className:`relative`,children:[(0,K.jsx)(e.icon,{className:`h-5 w-5 shrink-0`}),e.beta?(0,K.jsx)(gv,{}):null]}),(0,K.jsx)(`span`,{className:`font-nav text-[10px] tracking-[0.03em]`,children:e.label})]},e.to))})}function CT(e,t){(0,q.useInsertionEffect)(()=>{if(typeof document>`u`)return;let n=[...document.head.querySelectorAll(`style[data-head-style]`)].find(t=>t.dataset.headStyle===e);if(n){let e=Number(n.dataset.refCount??`1`);return n.dataset.refCount=String(e+1),n.textContent!==t&&(n.textContent=t),()=>{let e=Number(n.dataset.refCount??`1`)-1;if(e<=0){n.remove();return}n.dataset.refCount=String(e)}}let r=document.createElement(`style`);return r.setAttribute(`data-head-style`,e),r.dataset.refCount=`1`,r.textContent=t,document.head.appendChild(r),()=>{let e=Number(r.dataset.refCount??`1`)-1;if(e>0){r.dataset.refCount=String(e);return}r.remove()}},[t,e])}function wT({open:e,title:t,headerActions:n,onClose:r,onDismissRequest:i,onClosed:a,children:o,footer:s,dialogClassName:c=``,contentClassName:l=``,contentShellClassName:u=``,className:d=``,bodyClassName:f=``,maxHeight:p=`86vh`,borderVariant:m=`default`}){let h=(0,q.useRef)(null),g=(0,q.useRef)(null),_=(0,q.useId)(),v=i===void 0?r:i;(0,q.useEffect)(()=>{let e=h.current;if(!e||!a)return;let t=()=>{a()};return e.addEventListener(`close`,t),()=>{e.removeEventListener(`close`,t)}},[a]),(0,q.useLayoutEffect)(()=>{let t=h.current;t&&(e&&!t.open?typeof t.showModal==`function`?t.showModal():t.setAttribute(`open`,``):!e&&t.open&&(typeof t.close==`function`?t.close():t.removeAttribute(`open`)))},[e]),(0,q.useEffect)(()=>{let e=h.current;if(!e)return;let t=e=>{e.preventDefault(),v?.()},n=e=>{let t=g.current;if(!t||e.target instanceof Node&&t.contains(e.target))return;let n=t.getBoundingClientRect();e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom||v?.()};return e.addEventListener(`cancel`,t),e.addEventListener(`click`,n),()=>{e.removeEventListener(`cancel`,t),e.removeEventListener(`click`,n)}},[v]);let y=m===`error`?`border-red-500/60`:m===`success`?`border-green-500/50`:`border-border`;return CT(`dialog:openspec-dialog`,(0,q.useMemo)(()=>String.raw`
|
|
882
|
+
`}};customElements.define(`virtual-trackpad-tab`,pve);function mve(e){return new URLSearchParams(e.search).get(`session`)?.trim()||null}function hve(e,t=window.location){let n=mve(t);return n?`hosted-session:${n}:${e}`:e}var gve=1.5,xw=30,_ve=50,vve=15;function Sw(){return`ontouchstart`in window||navigator.maxTouchPoints>0}function yve(e){return e instanceof HTMLElement&&e.classList.contains(`terminal-touch-mouse-overlay`)}function bve(e,t,n){let r=document.elementFromPoint(t,n);if(r&&yve(r)){let e=r,i=e.style.pointerEvents;e.style.pointerEvents=`none`,r=document.elementFromPoint(t,n),e.style.pointerEvents=i}return r&&e.contains(r)&&!yve(r)?r:e.querySelector(`.xterm-screen`)??e}function Cw(e){return e===`input`||e===`keys`||e===`shortcuts`||e===`trackpad`||e===`settings`}function xve(e){return e===`copy`||e===`paste`||e===`select-all`}function ww(e){return typeof e==`object`&&!!e}function Tw(){try{let e=localStorage.getItem(hve(`xtermInputPanelState`));if(!e)return{};let t=JSON.parse(e);return ww(t)?t:{}}catch{return{}}}function Sve(e){try{localStorage.setItem(hve(`xtermInputPanelState`),JSON.stringify(e))}catch{}}function Cve(e){let t=Tw().sessions;if(!t)return null;let n=t[e];if(!ww(n))return null;let r={activeTab:`input`,inputDraft:``};return Cw(n.activeTab)&&(r.activeTab=n.activeTab),typeof n.inputDraft==`string`&&(r.inputDraft=n.inputDraft),r}function wve(){let e=Tw();return Cw(e.lastActiveTab)?e.lastActiveTab:`input`}var Tve=class e{static _lastActiveTab=`input`;static _active=null;static _lastFocused=null;static _instances=new Set;static _onActiveChangeFn=null;static _mountTarget=null;static get activeInstance(){return e._active}static set onActiveChange(t){e._onActiveChangeFn=t}static set mountTarget(t){e._mountTarget=t,e._fabEl&&t&&t.appendChild(e._fabEl)}static get mountTarget(){return e._mountTarget}static _fabEl=null;static _fabSubscriberCount=0;static _ensureFab(t){if(e._fabEl){e._fabEl.parentElement!==t&&t.appendChild(e._fabEl);return}let n=document.createElement(`button`);n.type=`button`,n.title=`Open InputPanel`,n.replaceChildren(wC(24)),Object.assign(n.style,{position:`fixed`,zIndex:`50`,width:`56px`,height:`56px`,borderRadius:`50%`,border:`2px solid currentColor`,display:`flex`,alignItems:`center`,justifyContent:`center`,touchAction:`none`,userSelect:`none`,webkitUserSelect:`none`,webkitTouchCallout:`none`,cursor:`pointer`,boxShadow:`0 4px 12px rgba(0,0,0,0.3)`,background:`var(--primary, #e04a2f)`,color:`var(--primary-foreground, #fff)`,padding:`0`,margin:`0`,outline:`none`});let r=window.innerWidth-72,i=window.innerHeight-140;try{let e=localStorage.getItem(`input-panel-fab-pos`);if(e){let t=JSON.parse(e);r=t.x??r,i=t.y??i}}catch{}r=Math.max(0,Math.min(window.innerWidth-56,r)),i=Math.max(0,Math.min(window.innerHeight-56,i)),n.style.left=`${r}px`,n.style.top=`${i}px`;let a=!1,o=!1,s=0,c=0,l=0,u=0,d=()=>{let t=e._lastFocused,n=(t&&e._instances.has(t)?t:null)??[...e._instances].find(e=>e._terminal!=null)??null;n&&(e._lastFocused=n,n.open())};n.addEventListener(`pointerdown`,e=>{a=!0,o=!1,s=e.clientX,c=e.clientY,l=parseInt(n.style.left)||0,u=parseInt(n.style.top)||0,n.setPointerCapture(e.pointerId),e.preventDefault()}),n.addEventListener(`pointermove`,e=>{if(!a)return;let t=e.clientX-s,r=e.clientY-c;(Math.abs(t)>4||Math.abs(r)>4)&&(o=!0);let i=Math.max(0,Math.min(window.innerWidth-56,l+t)),d=Math.max(0,Math.min(window.innerHeight-56,u+r));n.style.left=`${i}px`,n.style.top=`${d}px`}),n.addEventListener(`pointerup`,()=>{if(a){a=!1;try{localStorage.setItem(`input-panel-fab-pos`,JSON.stringify({x:parseInt(n.style.left),y:parseInt(n.style.top)}))}catch{}o||d()}}),n.addEventListener(`pointercancel`,()=>{a=!1});let f=!1;n.addEventListener(`pointerdown`,()=>{f=!0},{capture:!0}),n.addEventListener(`click`,()=>{if(f){f=!1;return}d()}),n.addEventListener(`contextmenu`,e=>{e.preventDefault(),e.stopPropagation()}),n.addEventListener(`dragstart`,e=>{e.preventDefault()}),window.addEventListener(`resize`,()=>{let e=Math.min(parseInt(n.style.left)||0,window.innerWidth-56),t=Math.min(parseInt(n.style.top)||0,window.innerHeight-56);n.style.left=`${Math.max(0,e)}px`,n.style.top=`${Math.max(0,t)}px`}),t.appendChild(n),e._fabEl=n}static _setFabVisible(t){e._fabEl&&(e._fabEl.style.display=t&&e._fabSubscriberCount>0?`flex`:`none`)}_terminal=null;_panel=null;_cursorEl=null;_cursorPos={x:0,y:0};_isDragging=!1;_isOpen=!1;_edgeScrollTimer=null;_cleanups=[];_persistentCleanups=[];_listenersAttached=!1;_onInput;_onCommand;_onOpenCb;_onCloseCb;_getHistory;_addHistory;_subscribeHistory;_onSettingsChange;_platform;_defaultLayout;_showFab;_fabSubscribed;_panelSessionState;_stateKey;_hasOwnPersistedState;constructor(t){this._onInput=t?.onInput??(()=>{}),this._onCommand=t?.onCommand??null,this._onOpenCb=t?.onOpen??null,this._onCloseCb=t?.onClose??null,this._getHistory=t?.getHistory??null,this._addHistory=t?.addHistory??null,this._subscribeHistory=t?.subscribeHistory??null,this._onSettingsChange=t?.onSettingsChange??null,this._platform=t?.platform??`common`,this._defaultLayout=t?.defaultLayout??`floating`,this._showFab=t?.showFab??!0,this._fabSubscribed=!1,this._stateKey=t?.stateKey?.trim()?t.stateKey:`default`,this._hasOwnPersistedState=!1,this._panelSessionState={activeTab:`input`,inputDraft:``};let n=Cve(this._stateKey);n?(this._panelSessionState=n,this._hasOwnPersistedState=!0):this._panelSessionState.activeTab=e._lastActiveTab||wve()}get isOpen(){return this._isOpen}set onOpen(e){this._onOpenCb=e}set onClose(e){this._onCloseCb=e}set onInput(e){this._onInput=e}set onCommand(e){this._onCommand=e}setPlatform(e){this._platform=e,this._applyPlatformToPanel()}setDefaultLayout(e){this._defaultLayout=e}_persistPanelState(){e._lastActiveTab=this._panelSessionState.activeTab;let t=Tw(),n={...t.sessions,[this._stateKey]:{activeTab:this._panelSessionState.activeTab,inputDraft:this._panelSessionState.inputDraft}};Sve({...t,lastActiveTab:this._panelSessionState.activeTab,sessions:n})}_getMountTarget(){return e._mountTarget??this._getTerminalHostElement()??document.body}_getTerminalHostElement(){let e=this._terminal?.element;return e instanceof HTMLElement?e.classList.contains(`xterm`)&&e.parentElement instanceof HTMLElement?e.parentElement:e:null}_detectTerminalEngine(){let e=this._terminal?.element;return e instanceof HTMLElement&&e.classList.contains(`xterm`)?`xterm`:`non-xterm`}activate(t){this._terminal=t,e._instances.add(this)}dispose(){this.close();for(let e of this._persistentCleanups)e();this._persistentCleanups=[],this._listenersAttached=!1,this._fabSubscribed&&(e._fabSubscriberCount=Math.max(0,e._fabSubscriberCount-1),this._fabSubscribed=!1,e._setFabVisible(e._active===null)),e._instances.delete(this),e._lastFocused===this&&(e._lastFocused=null),this._terminal=null}attachListeners(){if(this._listenersAttached||!this._terminal)return;let t=this._terminal.textarea;if(!t)return;this._listenersAttached=!0,this._showFab?(e._ensureFab(this._getMountTarget()),this._fabSubscribed||=(e._fabSubscriberCount+=1,!0),e._setFabVisible(!0)):e._fabSubscriberCount===0&&e._setFabVisible(!1),e._lastFocused||=this;let n=()=>{e._lastFocused=this,Sw()&&!this._isOpen&&this.open()};t.addEventListener(`focus`,n),this._persistentCleanups.push(()=>t.removeEventListener(`focus`,n)),Sw()&&t.setAttribute(`inputmode`,`none`)}open(){if(!this._terminal)return;if(this._isOpen){if(this._panel?.isConnected)return;this.close()}if(e._active&&e._active!==this&&e._active.close(),this._isOpen=!0,e._active=this,e._lastFocused=this,this._showFab&&e._setFabVisible(!1),this._suppressKeyboard(),!this._hasOwnPersistedState){let t=wve();this._panelSessionState.activeTab=t,e._lastActiveTab=t}let t=document.createElement(`input-panel`);t.setAttribute(`layout`,this._defaultLayout),this._applyPanelThemeBindings(t),t.activeTab=this._panelSessionState.activeTab;let n=document.createElement(`input-method-tab`);n.setAttribute(`slot`,`input`),n.value=this._panelSessionState.inputDraft,t.appendChild(n);let r=document.createElement(`virtual-keyboard-tab`);r.setAttribute(`slot`,`keys`),r.setAttribute(`floating`,``),r.setAttribute(`platform`,this._platform),t.appendChild(r);let i=document.createElement(`shortcut-tab`);i.setAttribute(`slot`,`shortcuts`),i.setAttribute(`platform`,this._platform),t.appendChild(i);let a=document.createElement(`virtual-trackpad-tab`);a.setAttribute(`slot`,`trackpad`),a.setAttribute(`floating`,``),t.appendChild(a),this._panel=t;let o=e=>{this._renderHistory(n,e)};if(this._getHistory&&this._getHistory().then(e=>o(e)).catch(()=>{}),this._subscribeHistory)try{let e=this._subscribeHistory(e=>{o(e)});this._cleanups.push(e)}catch{}this._on(t,`input-panel:close`,()=>this.close()),this._on(t,`input-panel:send`,e=>{let t=e.detail?.data;if(t&&this._onInput(t),e.composedPath()[0]===n&&this._addHistory&&t){let e=this._normalizeHistoryText(t);e&&Promise.resolve(this._addHistory(e)).then(()=>this._getHistory?.()).then(e=>{e&&o(e)}).catch(()=>{})}}),this._on(t,`input-panel:command`,e=>{let t=e.detail;if(!ww(t))return;let n=t.command;if(!xve(n))return;let r=typeof t.fallbackData==`string`?t.fallbackData:void 0;Promise.resolve(this._onCommand?.(n,{fallbackData:r})??!1).then(e=>{!e&&r&&this._onInput(r)}).catch(()=>{r&&this._onInput(r)})}),this._on(n,`input-panel:input-change`,e=>{let t=e.detail?.value;typeof t==`string`&&(this._panelSessionState.inputDraft=t,this._hasOwnPersistedState=!0,this._persistPanelState())}),this._on(t,`input-panel:tab-change`,e=>{let t=e.detail?.tab;Cw(t)&&(this._panelSessionState.activeTab=t,this._hasOwnPersistedState=!0,this._persistPanelState()),t===`trackpad`?this._showCursor():this._hideCursor()}),this._on(t,`input-panel:settings-change`,e=>{if(!this._onSettingsChange)return;let t=e.detail;if(typeof t!=`object`||!t)return;let n=t;typeof n.fixedHeight!=`number`||typeof n.floatingWidth!=`number`||typeof n.floatingHeight!=`number`||typeof n.vibrationIntensity!=`number`||typeof n.historyLimit!=`number`||this._onSettingsChange({fixedHeight:n.fixedHeight,floatingWidth:n.floatingWidth,floatingHeight:n.floatingHeight,vibrationIntensity:n.vibrationIntensity,historyLimit:n.historyLimit})}),this._on(t,`trackpad:move`,e=>{let{dx:t,dy:n}=e.detail;this._moveCursor(t,n)}),this._on(t,`trackpad:tap`,()=>this._dispatchClick(1)),this._on(t,`trackpad:double-tap`,()=>this._dispatchDblClick()),this._on(t,`trackpad:long-press`,()=>this._dispatchRightClick()),this._on(t,`trackpad:two-finger-tap`,()=>this._dispatchRightClick()),this._on(t,`trackpad:drag-start`,()=>{this._isDragging=!0,this._dispatchMouse(`mousedown`,{detail:1})}),this._on(t,`trackpad:drag-move`,e=>{let{dx:t,dy:n}=e.detail;this._moveCursor(t,n),this._dispatchMouse(`mousemove`,{buttons:1}),this._updateEdgeScroll()}),this._on(t,`trackpad:drag-end`,()=>{this._isDragging=!1,this._stopEdgeScroll(),this._dispatchMouse(`mouseup`,{detail:1})}),this._on(t,`trackpad:scroll`,e=>{let{deltaY:t}=e.detail;this._dispatchWheel(t)}),this._getMountTarget().appendChild(t),this._createCursor(),this._focusTerminal(),this._onOpenCb?.(),e._onActiveChangeFn?.(this)}_applyPlatformToPanel(){if(!this._panel)return;let e=this._panel.querySelector(`virtual-keyboard-tab`),t=this._panel.querySelector(`shortcut-tab`);e?.setAttribute(`platform`,this._platform),t?.setAttribute(`platform`,this._platform)}_readThemeVar(e,t,n){for(let n of t){let t=e.getPropertyValue(n).trim();if(t)return t}return n}_applyPanelThemeBindings(e){let t=this._getTerminalHostElement()??this._getMountTarget(),n=getComputedStyle(t),r=this._readThemeVar(n,[`--input-panel-background`,`--terminal`,`--background`],`#1a1a1a`),i=this._readThemeVar(n,[`--input-panel-foreground`,`--terminal-foreground`,`--foreground`],`#ffffff`),a=this._readThemeVar(n,[`--input-panel-primary`,`--primary`],`#e04a2f`),o=this._readThemeVar(n,[`--input-panel-primary-foreground`,`--primary-foreground`],`#ffffff`),s=this._readThemeVar(n,[`--input-panel-border`,`--border`],`color-mix(in srgb, ${i} 24%, transparent)`),c=this._readThemeVar(n,[`--input-panel-muted`,`--muted`],`color-mix(in srgb, ${r} 86%, ${i} 14%)`),l=this._readThemeVar(n,[`--input-panel-muted-foreground`,`--muted-foreground`],`color-mix(in srgb, ${i} 62%, transparent)`);e.style.setProperty(`--input-panel-background`,r),e.style.setProperty(`--input-panel-foreground`,i),e.style.setProperty(`--input-panel-primary`,a),e.style.setProperty(`--input-panel-primary-foreground`,o),e.style.setProperty(`--input-panel-border`,s),e.style.setProperty(`--input-panel-muted`,c),e.style.setProperty(`--input-panel-muted-foreground`,l)}close(){if(this._isOpen){this._isOpen=!1,e._active===this&&(e._active=null),this._stopEdgeScroll();for(let e of this._cleanups)e();this._cleanups=[],this._panel?.remove(),this._panel=null,this._cursorEl?.remove(),this._cursorEl=null,Sw()||this._restoreKeyboard(),this._showFab&&e._setFabVisible(!0),this._onCloseCb?.(),e._onActiveChangeFn?.(null)}}toggle(){if(this._isOpen){this.close();return}this.open()}syncFocusLifecycle(){if(e._lastFocused=this,this._isOpen&&!this._panel?.isConnected){this.open();return}if(e._active&&e._active!==this){this.open();return}this._isOpen&&this._focusTerminal()}_focusTerminal(){let e=this._terminal?.textarea;e&&(Sw()&&e.setAttribute(`inputmode`,`none`),e.focus())}_createCursor(){let e=this._getTerminalHostElement();if(!e)return;let t=document.createElement(`div`);t.setAttribute(`data-input-panel-cursor`,`virtual-mouse`),t.setAttribute(`data-terminal-engine`,this._detectTerminalEngine()),t.setAttribute(`aria-hidden`,`true`),t.style.cssText=`position:absolute;z-index:10;pointer-events:none;opacity:0;transition:opacity 0.15s;color:#fff;`;let n=Qge(20);n.style.filter=`drop-shadow(0 0 1px rgba(0,0,0,0.9))`,t.replaceChildren(n),e.appendChild(t),this._cursorEl=t;let r=e.getBoundingClientRect();this._cursorPos={x:r.width/2,y:r.height/2},this._positionCursor()}_positionCursor(){this._cursorEl&&(this._cursorEl.style.left=`${this._cursorPos.x-4}px`,this._cursorEl.style.top=`${this._cursorPos.y-2}px`)}_showCursor(){if(this._cursorEl||this._createCursor(),this._cursorEl){let e=this._getTerminalHostElement();if(e){let t=e.getBoundingClientRect();this._cursorPos={x:t.width/2,y:t.height/2},this._positionCursor()}this._cursorEl.style.opacity=`1`}}_hideCursor(){this._cursorEl&&(this._cursorEl.style.opacity=`0.3`)}_moveCursor(e,t){let n=this._getTerminalHostElement();if(!n)return;let r=n.getBoundingClientRect();this._cursorPos.x=Math.max(0,Math.min(r.width,this._cursorPos.x+e*gve)),this._cursorPos.y=Math.max(0,Math.min(r.height,this._cursorPos.y+t*gve)),this._positionCursor()}_getClientCoords(){let e=this._getTerminalHostElement();if(!e)return null;let t=e.getBoundingClientRect();return{clientX:t.left+this._cursorPos.x,clientY:t.top+this._cursorPos.y}}_resolveTarget(e,t){let n=this._getTerminalHostElement();return n?bve(n,e,t):document.body}_dispatchMouse(e,t={}){let n=this._getClientCoords();if(!n)return;let r=t.button??0,i=t.detail??1,a=t.buttons??(e===`mousedown`?r===0?1:r===2?2:4:0);this._resolveTarget(n.clientX,n.clientY).dispatchEvent(new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,detail:i,clientX:n.clientX,clientY:n.clientY,button:r,buttons:a}))}_dispatchClick(e){this._dispatchMouse(`mousedown`,{detail:e}),this._dispatchMouse(`mouseup`,{detail:e}),this._dispatchMouse(`click`,{detail:e})}_dispatchDblClick(){this._dispatchMouse(`mousedown`,{detail:2}),this._dispatchMouse(`mouseup`,{detail:2}),this._dispatchMouse(`click`,{detail:2}),this._dispatchMouse(`dblclick`,{detail:2})}_dispatchRightClick(){this._dispatchMouse(`mousedown`,{button:2}),this._dispatchMouse(`mouseup`,{button:2}),this._dispatchMouse(`contextmenu`,{button:2})}_dispatchWheel(e){let t=this._getClientCoords();t&&this._resolveTarget(t.clientX,t.clientY).dispatchEvent(new WheelEvent(`wheel`,{bubbles:!0,cancelable:!0,view:window,clientX:t.clientX,clientY:t.clientY,deltaY:e,deltaMode:WheelEvent.DOM_DELTA_PIXEL}))}_updateEdgeScroll(){let e=this._getTerminalHostElement();if(!e||!this._isDragging){this._stopEdgeScroll();return}let t=e.getBoundingClientRect(),n=this._cursorPos.y<xw,r=this._cursorPos.y>t.height-xw;if(!n&&!r){this._stopEdgeScroll();return}this._stopEdgeScroll(),this._edgeScrollTimer=setInterval(()=>{let e=this._getTerminalHostElement();if(!e||!this._isDragging){this._stopEdgeScroll();return}let t=e.getBoundingClientRect(),n=t.left+this._cursorPos.x,r=this._cursorPos.y<xw?t.top-vve:t.bottom+vve;this._resolveTarget(t.left+this._cursorPos.x,t.top+this._cursorPos.y).dispatchEvent(new MouseEvent(`mousemove`,{bubbles:!0,cancelable:!0,view:window,clientX:n,clientY:r,button:0,buttons:1}))},_ve)}_stopEdgeScroll(){this._edgeScrollTimer&&=(clearInterval(this._edgeScrollTimer),null)}_suppressKeyboard(){if(!Sw())return;let e=this._terminal?.textarea;e&&e.setAttribute(`inputmode`,`none`)}_restoreKeyboard(){let e=this._terminal?.textarea;e&&e.removeAttribute(`inputmode`)}_on(e,t,n){e.addEventListener(t,n),this._cleanups.push(()=>e.removeEventListener(t,n))}_normalizeHistoryText(e){return e.replace(/[\r\n]+$/u,``).trim()||null}_renderHistory(e,t){if(e.querySelectorAll(`[data-input-history-root="true"]`).forEach(e=>e.remove()),t.length===0)return;let n=document.createElement(`div`);n.dataset.inputHistoryRoot=`true`,n.setAttribute(`slot`,`history`),n.style.display=`flex`,n.style.flexDirection=`column`,n.style.gap=`4px`,n.style.padding=`4px 0`;for(let e of t){let t=document.createElement(`button`);t.type=`button`,t.title=e.text,t.style.display=`flex`,t.style.alignItems=`center`,t.style.gap=`8px`,t.style.width=`100%`,t.style.padding=`4px 6px`,t.style.border=`1px solid transparent`,t.style.borderRadius=`4px`,t.style.background=`transparent`,t.style.color=`var(--foreground, #fff)`,t.style.fontFamily=`inherit`,t.style.fontSize=`12px`,t.style.textAlign=`left`;let r=document.createElement(`span`);r.textContent=new Date(e.time).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),r.style.opacity=`0.65`,r.style.fontSize=`10px`,r.style.flexShrink=`0`;let i=document.createElement(`span`);i.textContent=e.text,i.style.overflow=`hidden`,i.style.textOverflow=`ellipsis`,i.style.whiteSpace=`nowrap`,t.appendChild(r),t.appendChild(i),t.addEventListener(`click`,()=>{this._onInput(`${e.text}\n`)}),n.appendChild(t)}e.appendChild(n)}};function Eve(e){let t=/^zh\b/i.test(e);return{apiHost:t?`https://fonts.googleapis.cn`:`https://fonts.googleapis.com`,staticHost:t?`https://fonts.gstatic.cn`:`https://fonts.gstatic.com`}}function Dve(e){return e.trim().replace(/ /g,`+`)}function Ove(e){let t=e.families.map(Dve).filter(Boolean),{apiHost:n}=Eve(e.lang??``),r=t.map(e=>`family=${e}`),i=`display=${e.display??`swap`}`;return`${n}/css2?${[...r,i].join(`&`)}`}function kve(e){let t=e.documentRef??(typeof document>`u`?null:document);if(!t||e.families.length===0)return null;let n=e.lang??(typeof navigator>`u`?``:navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage||``),r=Eve(n),i=Ove({...e,lang:n});if(t.head.querySelector(`link[href="${i}"]`))return null;let a=t.createElement(`link`);a.rel=`preconnect`,a.href=r.apiHost,a.dataset.openspecGoogleFonts=`preconnect-api`;let o=t.createElement(`link`);o.rel=`preconnect`,o.href=r.staticHost,o.crossOrigin=`anonymous`,o.dataset.openspecGoogleFonts=`preconnect-static`;let s=t.createElement(`link`);return s.rel=`stylesheet`,s.href=i,s.dataset.openspecGoogleFonts=`stylesheet`,t.head.append(a,o,s),s}var Ew=null,Dw=null,Ow=null,kw=null,Ave=!1,Aw=!1;function jve(){return typeof window>`u`?null:window.AudioContext??window.webkitAudioContext??null}function Mve(){return Ave?!0:typeof navigator>`u`?!1:navigator.userActivation?.hasBeenActive===!0||navigator.userActivation?.isActive===!0}function Nve(){typeof window>`u`||!Aw||(window.removeEventListener(`pointerdown`,jw,!0),window.removeEventListener(`keydown`,jw,!0),Aw=!1)}function jw(){Ave=!0,Nve(),kw?.(),kw=null,Ow=null}function Mw(){typeof window>`u`||Aw||Mve()||(window.addEventListener(`pointerdown`,jw,{capture:!0,once:!0,passive:!0}),window.addEventListener(`keydown`,jw,{capture:!0,once:!0}),Aw=!0)}function Pve(){Mw()}function Fve(){return typeof window>`u`||Mve()?Promise.resolve():Ow||(Ow=new Promise(e=>{kw=e,Mw()}),Ow)}async function Ive(){return Ew||Dw||(jve()?(Dw=Fve().then(async()=>{let e=jve();if(!e)return null;let t=Ew??new e;return Ew=t,t.state===`suspended`&&await t.resume(),t}).finally(()=>{Dw=null}),Dw):null)}var Nw=class{fallbackSound;unlocked=!1;unlockPromise=null;silentAudio=null;activeAudios=new Set;constructor(e){this.fallbackSound=e===`bell`?$c:el}init(){Pve()}async unlock(){if(!this.unlocked)return this.unlockPromise||=this.unlockAudioContext().finally(()=>{this.unlockPromise=null}),this.unlockPromise}async play(e,t=1){e!==`silent`&&(await this.unlock().catch(()=>{}),await this.playAudio(e,t))}async unlockAudioContext(){if(!await Ive()){this.unlocked=!0;return}this.silentAudio??=new Audio(`data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=`),this.silentAudio.volume=0,await this.silentAudio.play().catch(()=>{}),this.unlocked=!0}async playAudio(e,t){let n=this.getSoundUrl(e)??this.getSoundUrl(this.fallbackSound);n&&await this.createManagedAudio(n,t).play().catch(async r=>{if(e!==this.fallbackSound){if(await this.isMissingSound(n)){let e=this.getSoundUrl(this.fallbackSound);e&&await this.createManagedAudio(e,t).play().catch(()=>{});return}throw r}})}getSoundUrl(e){let t=qie(e);if(t)return t;let n=ol(e);if(!n)return null;let r=B(),i=`/api/sounds/custom/${n}`;return r?`${r}${i}`:i}async isMissingSound(e){try{return(await j(e,{method:`HEAD`})).status===404}catch{return!1}}createManagedAudio(e,t){let n=new Audio(e);n.volume=Lve(t),this.activeAudios.add(n);let r=()=>{n.removeEventListener(`ended`,r),n.removeEventListener(`error`,r),this.activeAudios.delete(n)};return n.addEventListener(`ended`,r,{once:!0}),n.addEventListener(`error`,r,{once:!0}),n}};function Lve(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):1}var Pw=class extends Nw{constructor(){super(`bell`)}},Fw=`xtermInputPanelSettings`,Rve=50,zve=1e3,Bve=1,Vve=1,Iw=`terminal-meta`;function Lw(){return R(`terminal-input-history`,window.location)}function Hve(){return R(`openspecui-terminal`,window.location)}function Rw(){return R(`input-history`,window.location)}function zw(){return R(`terminal-input-history-fallback`,window.location)}function Bw(e){return Math.max(Bve,Math.min(zve,Math.round(e)))}function Vw(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`object`||!n)continue;let e=n;if(typeof e.text!=`string`||typeof e.time!=`number`||!Number.isFinite(e.time))continue;let r=e.text.trim();r&&t.push({text:r,time:e.time})}return t}function Hw(e,t){let n=new Map;for(let t of e){let e=`${t.time}::${t.text}`;n.has(e)||n.set(e,t)}return[...n.values()].sort((e,t)=>t.time-e.time).slice(0,Bw(t))}function Uw(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]?.text!==t[n]?.text||e[n]?.time!==t[n]?.time)return!1;return!0}function Ww(){try{let e=localStorage.getItem(Fw);if(!e)return{};let t=JSON.parse(e);return typeof t!=`object`||!t?{}:t}catch{return{}}}function Uve(e){let t=Ww();try{localStorage.setItem(Fw,JSON.stringify({...t,...e}))}catch{}}async function Gw(){return typeof window>`u`||!(`indexedDB`in window)?null:await new Promise(e=>{let t=window.indexedDB.open(Hve(),Vve);t.onupgradeneeded=()=>{let e=t.result;e.objectStoreNames.contains(Iw)||e.createObjectStore(Iw)},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null)})}async function Wve(){let e=await Gw();return e?await new Promise(t=>{let n=e.transaction(Iw,`readonly`),r=n.objectStore(Iw).get(Rw());r.onsuccess=()=>{t(Vw(r.result))},r.onerror=()=>t([]),n.oncomplete=()=>e.close(),n.onerror=()=>e.close(),n.onabort=()=>e.close()}):null}async function Gve(e){let t=await Gw();return t?await new Promise(n=>{let r=t.transaction(Iw,`readwrite`);r.objectStore(Iw).put(e,Rw()),r.oncomplete=()=>{t.close(),n(!0)},r.onerror=()=>{t.close(),n(!1)},r.onabort=()=>{t.close(),n(!1)}}):!1}function Kve(){try{let e=localStorage.getItem(zw());return e?Vw(JSON.parse(e)):[]}catch{return[]}}function qve(e){try{localStorage.setItem(zw(),JSON.stringify(e))}catch{}}async function Jve(){return await Wve()||Kve()}async function Kw(e){await Gve(e)||qve(e)}var Yve=class{records=[];listeners=new Set;kvUnsubscribe=null;initPromise=null;subscribe(e){return this.listeners.add(e),this.ensureInitialized(),e(this.records),()=>{this.listeners.delete(e)}}async list(){return await this.ensureInitialized(),[...this.records]}getLimit(){let e=Ww().historyLimit;return typeof e==`number`&&Number.isFinite(e)?Bw(e):Rve}async setLimit(e){let t=Bw(e);Uve({historyLimit:t}),await this.ensureInitialized();let n=Hw(this.records,t);await this.commit(n,{persistRemote:!0})}async add(e){let t=e.trim();if(!t)return;await this.ensureInitialized();let n=Hw([{text:t,time:Date.now()},...this.records],this.getLimit());await this.commit(n,{persistRemote:!0})}destroy(){this.kvUnsubscribe&&=(this.kvUnsubscribe(),null)}async ensureInitialized(){if(this.initPromise){await this.initPromise;return}this.initPromise=this.initialize(),await this.initPromise}async initialize(){if(this.records=Hw(await Jve(),this.getLimit()),this.emit(),!z())try{let e=Vw(await G.kv.get.query({key:Lw()})),t=Hw([...this.records,...e],this.getLimit());Uw(this.records,t)||(this.records=t,await Kw(this.records),this.emit()),Uw(e,this.records)||this.persistRemote(this.records);let n=G.kv.subscribe.subscribe({key:Lw()},{onData:e=>{this.onRemoteData(e)}});this.kvUnsubscribe=()=>n.unsubscribe()}catch{}}async onRemoteData(e){let t=Vw(e),n=Hw([...this.records,...t],this.getLimit());await this.commit(n,{persistRemote:!1})}async commit(e,t){Uw(this.records,e)||(this.records=e,await Kw(this.records),this.emit(),t.persistRemote&&!z()&&this.persistRemote(this.records))}async persistRemote(e){try{await G.kv.set.mutate({key:Lw(),value:e})}catch{}}emit(){for(let e of this.listeners)e(this.records)}};function qw(e){return e.type===`keydown`}function Jw(e,t){return e.key.toLowerCase()===t}function Yw(e){return e.metaKey||e.ctrlKey}function Xw(e){return Yw(e)&&!e.altKey}function Zw(e){return e.clipboard?e.clipboard:typeof navigator>`u`?null:navigator.clipboard??null}function Qw(e,t){e.catch(e=>{t.onAsyncError?.(e)})}async function Xve(e,t){let n=Zw(e);n?.writeText&&await n.writeText(t)}async function Zve(e){let t=Zw(e);if(!t?.readText)return;let n=await t.readText();if(n){try{if(e.terminal.paste?.(n),e.terminal.paste)return}catch{}e.writeInput(n)}}var Qve=[{id:`terminal.copy-selection`,handle:(e,t)=>!qw(e)||!Xw(e)||!Jw(e,`c`)?null:t.terminal.hasSelection?.()?$w(t):`allow`},{id:`terminal.paste-clipboard`,handle:(e,t)=>!qw(e)||!Xw(e)||!Jw(e,`v`)?null:eT(t)},{id:`terminal.select-all`,handle:(e,t)=>!qw(e)||!e.metaKey||e.ctrlKey||e.altKey||!Jw(e,`a`)?null:tT(t)},{id:`terminal.zoom-in`,handle:(e,t)=>!qw(e)||!Yw(e)||e.key!==`=`&&e.key!==`+`?null:(t.zoomFont(1),`block`)},{id:`terminal.zoom-out`,handle:(e,t)=>!qw(e)||!Yw(e)||e.key!==`-`?null:(t.zoomFont(-1),`block`)},{id:`terminal.zoom-reset`,handle:(e,t)=>!qw(e)||!Yw(e)||e.key!==`0`?null:(t.resetFontSize(),`block`)}];function $w(e){if(!e.terminal.hasSelection?.())return`allow`;let t=e.terminal.getSelection?.()??``;return t?(Qw(Xve(e,t),e),`block`):`allow`}function eT(e){return Zw(e)?.readText?(Qw(Zve(e),e),`block`):`allow`}function tT(e){return e.terminal.selectAll?(e.terminal.selectAll(),`block`):`allow`}var $ve=[{id:`terminal.command.copy-selection`,command:`copy`,run:$w},{id:`terminal.command.paste-clipboard`,command:`paste`,run:eT},{id:`terminal.command.select-all`,command:`select-all`,run:tT}],eye=class{constructor(e=Qve,t=$ve){this.bindings=e,this.commandBindings=t}handleKeyEvent(e,t){for(let n of this.bindings){let r=n.handle(e,t);if(r)return r}return`allow`}runCommand(e,t){return this.commandBindings.find(t=>t.command===e)?.run(t)??`allow`}},tye=[`app`,`light`,`dark`,`system`],nye=[{value:`default-light`,label:`Default Light`},{value:`default-dark`,label:`Default Dark`},{value:`monokai`,label:`Monokai`},{value:`nord`,label:`Nord`},{value:`solarized-light`,label:`Solarized Light`},{value:`solarized-dark`,label:`Solarized Dark`}],rye={"default-light":{id:`default-light`,label:`Default Light`,modeHint:`light`,palette:{background:`#f6f5f2`,foreground:`#1b1b1b`,cursor:`#ea580c`,cursorAccent:`#f6f5f2`,selectionBackground:`rgba(234, 88, 12, 0.22)`,black:`#111111`,red:`#b91c1c`,green:`#15803d`,yellow:`#a16207`,blue:`#1d4ed8`,magenta:`#a21caf`,cyan:`#0f766e`,white:`#f6f5f2`,brightBlack:`#4b5563`,brightRed:`#dc2626`,brightGreen:`#16a34a`,brightYellow:`#ca8a04`,brightBlue:`#2563eb`,brightMagenta:`#c026d3`,brightCyan:`#0891b2`,brightWhite:`#ffffff`}},"default-dark":{id:`default-dark`,label:`Default Dark`,modeHint:`dark`,palette:{background:`#141414`,foreground:`#e5dfd2`,cursor:`#f97316`,cursorAccent:`#141414`,selectionBackground:`rgba(249, 115, 22, 0.28)`,black:`#151515`,red:`#f87171`,green:`#4ade80`,yellow:`#facc15`,blue:`#60a5fa`,magenta:`#e879f9`,cyan:`#67e8f9`,white:`#f4f1ea`,brightBlack:`#6b7280`,brightRed:`#fca5a5`,brightGreen:`#86efac`,brightYellow:`#fde047`,brightBlue:`#93c5fd`,brightMagenta:`#f0abfc`,brightCyan:`#a5f3fc`,brightWhite:`#fffdf8`}},monokai:{id:`monokai`,label:`Monokai`,modeHint:`either`,palette:{background:`#272822`,foreground:`#f8f8f2`,cursor:`#f8f8f0`,cursorAccent:`#272822`,selectionBackground:`rgba(73, 72, 62, 0.9)`,black:`#272822`,red:`#f92672`,green:`#a6e22e`,yellow:`#f4bf75`,blue:`#66d9ef`,magenta:`#ae81ff`,cyan:`#a1efe4`,white:`#f8f8f2`,brightBlack:`#75715e`,brightRed:`#f92672`,brightGreen:`#a6e22e`,brightYellow:`#f4bf75`,brightBlue:`#66d9ef`,brightMagenta:`#ae81ff`,brightCyan:`#a1efe4`,brightWhite:`#f9f8f5`}},nord:{id:`nord`,label:`Nord`,modeHint:`either`,palette:{background:`#2e3440`,foreground:`#d8dee9`,cursor:`#88c0d0`,cursorAccent:`#2e3440`,selectionBackground:`rgba(94, 129, 172, 0.38)`,black:`#3b4252`,red:`#bf616a`,green:`#a3be8c`,yellow:`#ebcb8b`,blue:`#81a1c1`,magenta:`#b48ead`,cyan:`#88c0d0`,white:`#e5e9f0`,brightBlack:`#4c566a`,brightRed:`#d08770`,brightGreen:`#8fbcbb`,brightYellow:`#eceff4`,brightBlue:`#5e81ac`,brightMagenta:`#b48ead`,brightCyan:`#8fbcbb`,brightWhite:`#eceff4`}},"solarized-light":{id:`solarized-light`,label:`Solarized Light`,modeHint:`light`,palette:{background:`#fdf6e3`,foreground:`#586e75`,cursor:`#cb4b16`,cursorAccent:`#fdf6e3`,selectionBackground:`rgba(147, 161, 161, 0.32)`,black:`#073642`,red:`#dc322f`,green:`#859900`,yellow:`#b58900`,blue:`#268bd2`,magenta:`#d33682`,cyan:`#2aa198`,white:`#eee8d5`,brightBlack:`#657b83`,brightRed:`#cb4b16`,brightGreen:`#93a1a1`,brightYellow:`#839496`,brightBlue:`#6c71c4`,brightMagenta:`#d33682`,brightCyan:`#2aa198`,brightWhite:`#fdf6e3`}},"solarized-dark":{id:`solarized-dark`,label:`Solarized Dark`,modeHint:`dark`,palette:{background:`#002b36`,foreground:`#93a1a1`,cursor:`#cb4b16`,cursorAccent:`#002b36`,selectionBackground:`rgba(88, 110, 117, 0.5)`,black:`#073642`,red:`#dc322f`,green:`#859900`,yellow:`#b58900`,blue:`#268bd2`,magenta:`#d33682`,cyan:`#2aa198`,white:`#eee8d5`,brightBlack:`#657b83`,brightRed:`#cb4b16`,brightGreen:`#586e75`,brightYellow:`#657b83`,brightBlue:`#839496`,brightMagenta:`#6c71c4`,brightCyan:`#93a1a1`,brightWhite:`#fdf6e3`}}};function iye(e){let t=e.useTheme??`app`;return t===`light`?`light`:t===`dark`?`dark`:t===`system`?e.systemDarkMode?`dark`:`light`:e.appDarkMode?`dark`:`light`}function nT(e){let t=iye(e),n=t===`dark`?e.darkTheme??`default-dark`:e.lightTheme??`default-light`;return{id:n,mode:t,definition:rye[n]}}var rT=[`xterm`,`ghostty`];function iT(e){return rT.includes(e)}var aT=`"JetBrains Mono Variable", "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`,oT={fontSize:13,fontFamily:``,cursorBlink:!0,cursorStyle:`block`,scrollback:1e3,useTheme:`app`,lightTheme:`default-light`,darkTheme:`default-dark`,rendererEngine:`xterm`,bellSound:$c,bellVolume:1},sT=1500,cT=1e3,aye=1e4,lT=`common`,oye=512*1024,sye=8,cye=32,uT=13,lye=800,uye={ArrowUp:`\x1B[A`,ArrowDown:`\x1B[B`},dye={ArrowLeft:`\x1Bb`,ArrowRight:`\x1Bf`,ArrowUp:`\x1B[1;3A`,ArrowDown:`\x1B[1;3B`},fye={ArrowLeft:``,ArrowUp:``,ArrowRight:``,ArrowDown:``},pye=[`JetBrains Mono`,`Fira Code`,`Source Code Pro`,`IBM Plex Mono`,`Inconsolata`,`Roboto Mono`,`Ubuntu Mono`,`Space Mono`],mye={"JetBrains Mono":`"JetBrains Mono Variable"`,"Share Tech Mono":`"Share Tech Mono"`},dT=new Set;function fT(e){try{return(new URL(e).pathname.split(`/`).pop()??``).replace(/\.[^.]+$/,``).replace(/[-_]/g,` `)||`CustomFont`}catch{return`CustomFont`}}async function hye(e){let t=e.trim();if(!t)return``;if(!/^https?:\/\//i.test(t))return t;if(dT.has(t))return fT(t);try{let e=(await j(t,{method:`HEAD`})).headers.get(`content-type`)??``;if(e.includes(`text/css`)){let e=document.createElement(`link`);return e.rel=`stylesheet`,e.href=t,e.dataset.fontSrc=t,document.head.appendChild(e),dT.add(t),``}if(e.startsWith(`font/`)){let e=fT(t),n=document.createElement(`style`);return n.dataset.fontSrc=t,n.textContent=`@font-face { font-family: '${e}'; src: url('${t}'); }`,document.head.appendChild(n),dT.add(t),e}}catch{}return t}function gye(e){let t=`google:${e}`;if(dT.has(t))return;let n=kve({families:[e]});n&&(n.dataset.fontSrc=t),dT.add(t)}var _ye=class{instances=new Map;listeners=new Set;activationListeners=new Set;idCounter=0;config={...oT};snapshotCache=null;inputHistoryStore=new Yve;bellSoundEngine=new Pw;keybindings=new eye;ghosttyModule=null;ghosttyInitPromise=null;appDarkMode=!1;systemDarkMode=!1;resolvedTheme=nT({useTheme:oT.useTheme,lightTheme:oT.lightTheme,darkTheme:oT.darkTheme,appDarkMode:!1,systemDarkMode:!1});ws=null;wsConnected=!1;reconnectTimer=null;reconnectDelay=cT;pendingCreates=[];pendingCloseSessionIds=new Set;pendingWorkflowInputs=new Map;workflowInputRequestCounter=0;serverToLocalSessionId=new Map;hasDiscoveredSessions=!1;inputPanelDefaultLayout=`floating`;activeSessionId=null;constructor(){this.bellSoundEngine.init()}createSession(e){let t=`term-${++this.idCounter}`,n=e.label??`Shell ${this.idCounter}`,r=this.createTerminalInstance(t,{label:n,command:e.command,args:e.args,isDedicated:e.isDedicated??!1,closeTip:e.closeTip,closeCallbackUrl:e.closeCallbackUrl,initialInput:e.initialInput,customTitle:e.customTitle??null,restored:!1,serverSessionId:null,platform:lT,cwdTarget:e.cwdTarget,initialCwd:null,rootGeneration:null});return this.instances.set(t,r),this._applyFonts(),this.bindTerminalInput(r),this.wsConnected&&this.ws?this.wsSend({type:`create`,requestId:t,cwdTarget:e.cwdTarget,expectedRootGeneration:e.expectedRootGeneration,cols:r.terminal.cols||80,rows:r.terminal.rows||24,command:e.command,args:e.args,closeTip:e.closeTip,closeCallbackUrl:e.closeCallbackUrl}):(this.pendingCreates.push({requestId:t,cwdTarget:e.cwdTarget,expectedRootGeneration:e.expectedRootGeneration,command:e.command,args:e.args,closeTip:e.closeTip,closeCallbackUrl:e.closeCallbackUrl,cols:r.terminal.cols||80,rows:r.terminal.rows||24}),this.ensureWsConnected()),e.initialInput&&this.scheduleInitialInput(t,e.initialInput),this.notify(),t}scheduleInitialInput(e,t){let n=0,r=()=>{this.writeToSession(e,t)||(n+=1,!(n>75)&&globalThis.setTimeout(r,80))};globalThis.setTimeout(r,80)}createTerminalInstance(e,t){let{terminal:n,fitAddon:r,afterOpenHook:i,engine:a}=this.createRendererTerminal(),o=this.createInputPanelAddon(e,t.platform);return n.loadAddon(o),this.attachTerminalShortcuts(n,a,t=>this.writeToSession(e,t)),{id:e,serverSessionId:t.serverSessionId,terminal:n,fitAddon:r,inputPanelAddon:o,isConnected:!1,label:t.label,customTitle:t.customTitle,processTitle:null,oscTitle:null,cwd:null,cwdTarget:t.cwdTarget,initialCwd:t.initialCwd,rootGeneration:t.rootGeneration,progress:null,promptState:null,isDedicated:t.isDedicated,isExited:!1,exitCode:null,command:t.command,args:t.args,closeTip:t.closeTip,closeCallbackUrl:t.closeCallbackUrl,mountedContainer:null,resizeObserver:null,hasOpened:!1,afterOpenHook:i,pendingOutput:[],pendingOutputBytes:0,lastOutputTime:0,lastBellAt:null,outputIdleTimer:null,restored:t.restored,platform:t.platform,rendererEngine:a}}getTerminalOptions(){let e=nT({useTheme:this.config.useTheme,lightTheme:this.config.lightTheme,darkTheme:this.config.darkTheme,appDarkMode:this.appDarkMode,systemDarkMode:this.systemDarkMode});return{cursorBlink:this.config.cursorBlink,cursorStyle:this.config.cursorStyle,fontSize:this.config.fontSize,fontFamily:aT,theme:e.definition.palette,allowTransparency:!1,convertEol:!0,macOptionIsMeta:!0,macOptionClickForcesSelection:!0,scrollback:this.config.scrollback}}createRendererTerminal(){let e=this.getTerminalOptions();if(this.config.rendererEngine===`xterm`){let t=new mge(e),n=new Hpe;return t.loadAddon(n),t.loadAddon(new Jpe),{terminal:t,fitAddon:n,afterOpenHook:null,engine:`xterm`}}let t=this.ghosttyModule;if(!t)throw Error(`ghostty-web is not initialized. Open Settings and switch engine again.`);let n=new t.Terminal(e),r=new t.FitAddon;return n.loadAddon(r),{terminal:n,fitAddon:r,afterOpenHook:()=>{let e=n;e.registerLinkProvider&&e.registerLinkProvider(new t.UrlRegexProvider(n))},engine:`ghostty`}}createInputPanelAddon(e,t){return new Tve({onInput:t=>this.writeToSession(e,t),onCommand:t=>this.runInputPanelCommand(e,t),getHistory:async()=>this.inputHistoryStore.list(),addHistory:async e=>this.inputHistoryStore.add(e),subscribeHistory:e=>this.inputHistoryStore.subscribe(e),platform:t,defaultLayout:this.inputPanelDefaultLayout,showFab:!1,stateKey:e,onSettingsChange:async e=>{await this.inputHistoryStore.setLimit(e.historyLimit)}})}runInputPanelCommand(e,t){let n=this.instances.get(e);return n?this.keybindings.runCommand(t,{terminal:n.terminal,writeInput:t=>this.writeToSession(e,t),zoomFont:e=>this.zoomFont(e),resetFontSize:()=>this.resetFontSize(),onAsyncError:e=>console.error(`[terminal] input panel command failed:`,e)})===`block`:!1}applyGhosttyBackground(e,t){if(e.rendererEngine!==`ghostty`)return;let n=e.terminal.options.theme??{},r=typeof n.background==`string`&&n.background.trim().length>0?n.background:this.resolveNearestOpaqueBackground(t);e.terminal.options.allowTransparency=!1,e.terminal.options.theme={...n,background:r}}isTransparentColor(e){let t=e.trim().toLowerCase();return t.length===0||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0,0,0,0)`}resolveNearestOpaqueBackground(e){let t=e;for(;t;){let e=window.getComputedStyle(t).backgroundColor;if(!this.isTransparentColor(e))return e;t=t.parentElement}return`rgb(26, 26, 26)`}resolveTerminalKeyInput(e){return e.type===`keydown`?e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey?dye[e.key]??null:e.metaKey&&!e.altKey&&!e.ctrlKey&&!e.shiftKey?fye[e.key]??null:!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey?uye[e.key]??null:null:null}getKeyEventResult(e,t){return e===`xterm`?t===`allow`:t===`block`}attachTerminalShortcuts(e,t,n){e.attachCustomKeyEventHandler(r=>{let i=this.resolveTerminalKeyInput(r);if(i&&n(i))return r.preventDefault(),r.stopPropagation(),this.getKeyEventResult(t,`block`);let a=r.metaKey||r.ctrlKey;if(r.type!==`keydown`||!a)return this.getKeyEventResult(t,`allow`);let o=this.keybindings.handleKeyEvent(r,{terminal:e,writeInput:n,zoomFont:e=>this.zoomFont(e),resetFontSize:()=>this.resetFontSize(),onAsyncError:e=>console.error(`[terminal] keybinding failed:`,e)});return o===`block`&&(r.preventDefault(),r.stopPropagation()),this.getKeyEventResult(t,o)})}bindTerminalInput(e){e.terminal.onData(t=>{if(e.isExited){this.closeSession(e.id);return}let n=this.resolveServerSessionId(e.id);n&&this.wsSend({type:`input`,sessionId:n,data:t})})}isTerminalNotOpenedError(e){if(!(e instanceof Error))return!1;let t=e.message;return t.includes(`Terminal must be opened before use`)||t.includes(`Call terminal.open(parent) first`)}enqueuePendingOutput(e,t){if(t)for(e.pendingOutput.push(t),e.pendingOutputBytes+=t.length;e.pendingOutputBytes>oye&&e.pendingOutput.length;){let t=e.pendingOutput.shift();if(!t)break;e.pendingOutputBytes-=t.length}}writeTerminalOutput(e,t){if(t){if(!e.hasOpened){this.enqueuePendingOutput(e,t);return}try{e.terminal.write(t)}catch(n){if(this.isTerminalNotOpenedError(n)){this.enqueuePendingOutput(e,t);return}console.error(`[terminal] failed to write output:`,n)}}}flushPendingOutput(e){if(!e.hasOpened||e.pendingOutput.length===0)return;let t=e.pendingOutput.join(``);e.pendingOutput=[],e.pendingOutputBytes=0,this.writeTerminalOutput(e,t)}replaceInstanceRenderer(e){let t=e.mountedContainer,n=e.serverSessionId;e.mountedContainer&&this.unmount(e.id),e.terminal.dispose();let{terminal:r,fitAddon:i,afterOpenHook:a,engine:o}=this.createRendererTerminal(),s=this.createInputPanelAddon(e.id,e.platform);r.loadAddon(s),this.attachTerminalShortcuts(r,o,t=>this.writeToSession(e.id,t)),e.terminal=r,e.fitAddon=i,e.inputPanelAddon=s,e.hasOpened=!1,e.afterOpenHook=a,e.mountedContainer=null,e.resizeObserver=null,e.rendererEngine=o,this.bindTerminalInput(e),t&&this.mount(e.id,t),n&&this.wsSend({type:`attach`,sessionId:n,cols:e.terminal.cols||80,rows:e.terminal.rows||24})}async ensureGhosttyModule(){return this.ghosttyModule?this.ghosttyModule:(this.ghosttyInitPromise||=c(()=>import(`./ghostty-web-BSS9uGcc.js`).then(async e=>(await e.init(),this.ghosttyModule=e,e)),__vite__mapDeps([25,6])).finally(()=>{this.ghosttyInitPromise=null}),this.ghosttyInitPromise)}async setRendererEngine(e){if(e!==this.config.rendererEngine){e===`ghostty`&&await this.ensureGhosttyModule(),this.config.rendererEngine=e;for(let e of this.instances.values())this.replaceInstanceRenderer(e);this._applyFonts(),this.notify()}}closeSession(e,t){let n=this.instances.get(e);if(!n)return;let r=t?.triggerCloseCallback!==!1;if(n.mountedContainer&&this.unmount(e),n.outputIdleTimer&&=(clearTimeout(n.outputIdleTimer),null),this.pendingCreates=this.pendingCreates.filter(t=>t.requestId!==e),n.serverSessionId){let e=n.serverSessionId;this.serverToLocalSessionId.delete(e),this.wsConnected&&this.ws?.readyState===WebSocket.OPEN?this.wsSend({type:`close`,sessionId:e}):this.pendingCloseSessionIds.add(e)}n.terminal.dispose(),r&&this.runCloseCallback(n),this.instances.delete(e),this.activeSessionId===e&&(this.activeSessionId=null),this.notify()}closeAll(){for(let e of this.instances.keys())this.closeSession(e,{triggerCloseCallback:!1});this.activeSessionId=null}mount(e,t){let n=this.instances.get(e);if(!n)return;if(n.mountedContainer===t){requestAnimationFrame(()=>{try{n.fitAddon.fit()}catch{}});return}if(n.mountedContainer&&this.unmount(e),!n.hasOpened)this.applyGhosttyBackground(n,t),n.terminal.open(t),n.hasOpened=!0,n.afterOpenHook?.(),n.afterOpenHook=null,this.flushPendingOutput(n),n.inputPanelAddon.attachListeners();else{let e=n.terminal.element;e&&!e.contains(t)&&e.parentNode!==t&&t.appendChild(e),this.flushPendingOutput(n),this.applyGhosttyBackground(n,t),n.inputPanelAddon.attachListeners()}n.mountedContainer=t,requestAnimationFrame(()=>{try{n.fitAddon.fit()}catch{}});let r=new ResizeObserver(()=>{try{if(n.fitAddon.fit(),n.terminal.cols&&n.terminal.rows){let t=this.resolveServerSessionId(e);if(!t)return;this.wsSend({type:`resize`,sessionId:t,cols:n.terminal.cols,rows:n.terminal.rows})}}catch{}});r.observe(t),n.resizeObserver=r,requestAnimationFrame(()=>{this.focusSession(e)})}unmount(e){let t=this.instances.get(e);!t||!t.mountedContainer||(t.resizeObserver&&=(t.resizeObserver.disconnect(),null),t.mountedContainer=null)}focusSession(e){let t=this.instances.get(e);if(!t||!t.hasOpened)return;let n=!1;try{t.terminal.focus?.(),n=!0}catch{}if(!n){let e=t.terminal.element;if(e instanceof HTMLElement)try{e.focus()}catch{}}t.inputPanelAddon.syncFocusLifecycle()}setActiveSessionId(e){e&&!this.instances.has(e)||(this.activeSessionId=e)}setCustomTitle(e,t){let n=this.instances.get(e);n&&(n.customTitle=t,this.notify())}getDisplayTitle(e){let t=this.instances.get(e);return t?t.customTitle??t.oscTitle??t.processTitle??t.label:``}getConfig(){return{...this.config}}getResolvedTheme(){return this.resolvedTheme}setThemeContext(e){(this.appDarkMode!==e.appDarkMode||this.systemDarkMode!==e.systemDarkMode)&&(this.appDarkMode=e.appDarkMode,this.systemDarkMode=e.systemDarkMode,this.refreshResolvedTheme())}applyConfig(e){let{rendererEngine:t,...n}=e;Object.assign(this.config,n);for(let e of this.instances.values()){let t=e.terminal;t.options.fontSize=this.config.fontSize,t.options.cursorBlink=this.config.cursorBlink,t.options.cursorStyle=this.config.cursorStyle,t.options.scrollback=this.config.scrollback}this.refreshResolvedTheme(),this._applyFonts(),t&&t!==this.config.rendererEngine&&this.setRendererEngine(t).catch(e=>{console.error(`[terminal] failed to switch renderer engine:`,e)}),this.notify()}refreshResolvedTheme(){let e=nT({useTheme:this.config.useTheme,lightTheme:this.config.lightTheme,darkTheme:this.config.darkTheme,appDarkMode:this.appDarkMode,systemDarkMode:this.systemDarkMode});this.resolvedTheme=e;for(let t of this.instances.values())t.terminal.options.theme=e.definition.palette,t.terminal.options.allowTransparency=!1,t.mountedContainer&&this.applyGhosttyBackground(t,t.mountedContainer)}async _applyFonts(){let e=this.config.fontFamily;if(!e){this._setFontFamily(aT);return}let t=e.split(/[,]+/).map(e=>e.trim()).filter(Boolean),n=[];for(let e of t){let t=mye[e];if(t)n.push(t);else if(pye.includes(e))gye(e),n.push(e);else{let t=await hye(e);t&&n.push(t)}}n.push(aT),this._setFontFamily(n.join(`, `))}_setFontFamily(e){for(let t of this.instances.values())if(t.terminal.options.fontFamily=e,t.mountedContainer)try{t.fitAddon.fit()}catch{}}configPersistTimer=null;persistFontSize(){this.configPersistTimer&&clearTimeout(this.configPersistTimer),this.configPersistTimer=setTimeout(()=>{this.configPersistTimer=null,c(async()=>{let{trpcClient:e}=await import(`./trpc-DgNoDkR5.js`);return{trpcClient:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(({trpcClient:e})=>{e.config.update.mutate({terminal:{fontSize:this.config.fontSize}})}).catch(()=>{})},lye)}zoomFont(e){let t=Math.min(cye,Math.max(sye,this.config.fontSize+e));t!==this.config.fontSize&&(this.applyConfig({fontSize:t}),this.persistFontSize())}resetFontSize(){this.config.fontSize!==uT&&(this.applyConfig({fontSize:uT}),this.persistFontSize())}writeToSession(e,t){let n=this.resolveServerSessionId(e);return n?this.wsSend({type:`input`,sessionId:n,data:t}):!1}writeWorkflowToSession(e,t,n){let r=this.resolveServerSessionId(e);if(!r)return Promise.reject(Error(`Terminal session is not ready.`));let i=`workflow-input-${++this.workflowInputRequestCounter}`;return new Promise((e,a)=>{this.pendingWorkflowInputs.set(i,{resolve:e,reject:a}),this.wsSend({type:`workflow-input`,requestId:i,sessionId:r,expectedRootGeneration:n,data:t})||(this.pendingWorkflowInputs.delete(i),a(Error(`Terminal connection is unavailable.`)))})}openInputPanel(e){let t=[e?this.instances.get(e):void 0,...this.instances.values()],n=t.find(e=>e&&e.mountedContainer)?.id??t.find(e=>e)?.id;if(!n)return!1;this.focusSession(n);let r=this.instances.get(n);return r?(r.inputPanelAddon.open(),!0):!1}hasServerSession(e){let t=this.getInstanceByServerSessionId(e);return!!t&&!t.isExited}focusServerSession(e){let t=this.getInstanceByServerSessionId(e);return!t||t.isExited?!1:(this.focusSession(t.id),!0)}subscribeActivation(e){return this.activationListeners.add(e),()=>{this.activationListeners.delete(e)}}requestActivateSession(e){let t=this.instances.get(e);return!t||t.isExited?!1:(this.emitActivationRequest(t.id),!0)}requestActivateServerSession(e){let t=this.getInstanceByServerSessionId(e);return!t||t.isExited?!1:(this.emitActivationRequest(t.id),!0)}getLocalSessionIdForServerSession(e){return this.getInstanceByServerSessionId(e)?.id??null}isSessionActive(e){return this.activeSessionId===e}async addInputHistory(e){await this.inputHistoryStore.add(e)}resolveServerSessionId(e){let t=this.instances.get(e);return t?t.serverSessionId:null}getInstanceByServerSessionId(e){let t=this.serverToLocalSessionId.get(e)??e;return this.instances.get(t)}getLocalSessionIdByServerSessionId(e){return this.serverToLocalSessionId.get(e)??e}handleCreatedResponse(e){let t=this.instances.get(e.requestId);if(!t){this.wsSend({type:`close`,sessionId:e.sessionId});return}t.serverSessionId=e.sessionId,t.platform=e.platform,t.cwdTarget=e.cwdTarget,t.initialCwd=e.initialCwd,t.rootGeneration=e.rootGeneration,t.inputPanelAddon.setPlatform(e.platform),t.isConnected=!0,this.serverToLocalSessionId.set(e.sessionId,e.requestId),this.notify()}handleOutputResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);if(!t)return;this.writeTerminalOutput(t,e.data);let n=t.lastOutputTime>0&&Date.now()-t.lastOutputTime<sT;t.lastOutputTime=Date.now(),n||this.notify(),t.outputIdleTimer&&clearTimeout(t.outputIdleTimer),t.outputIdleTimer=setTimeout(()=>{t.outputIdleTimer=null,this.notify()},sT)}handleExitResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);if(t){if(t.isExited=!0,t.exitCode=e.exitCode,t.closeTip||t.isDedicated){let n=t.closeTip??`Press any key to close (equivalent to close action).`;this.writeTerminalOutput(t,`\r\n\x1b[90m[Process exited with code ${e.exitCode}. ${n}]\x1b[0m`)}this.notify()}}handleTitleResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);t&&(t.oscTitle=e.title,this.notify())}handleProcessTitleResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);t&&(t.processTitle=e.title,this.notify())}handleCwdResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);t&&(t.cwd=e.cwd,this.notify())}handleProgressResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);t&&(t.progress=e.state===`clear`?null:{state:e.state,value:e.value},this.notify())}handlePromptStateResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);t&&(t.promptState=e.state,this.notify())}handleBellResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);!t||t.isExited||(t.lastBellAt=e.createdAt??Date.now(),this.bellSoundEngine.play(this.config.bellSound,this.config.bellVolume).catch(()=>{}),this.notify())}handleBufferResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);!t||!e.data||this.writeTerminalOutput(t,e.data)}handleErrorResponse(e){if(e.code===`PTY_CREATE_FAILED`&&e.sessionId){let t=this.instances.get(e.sessionId);t&&!t.serverSessionId&&(t.isExited=!0,t.exitCode=-1,this.writeTerminalOutput(t,`\r\n\x1b[31m[Failed to start PTY: ${e.message}]\x1b[0m`),this.notify())}console.warn(`[pty] ${e.code}: ${e.message}`,e)}setInputPanelMountTarget(e){Tve.mountTarget=e}setInputPanelDefaultLayout(e){this.inputPanelDefaultLayout=e;for(let t of this.instances.values())t.inputPanelAddon.setDefaultLayout(e)}getTerminalDimensions(e){let t=this.instances.get(e);return t?{cols:t.terminal.cols||80,rows:t.terminal.rows||24}:null}subscribe(e){return this.listeners.add(e),this.ensureWsConnected(),()=>{this.listeners.delete(e)}}getSnapshot(){if(this.snapshotCache)return this.snapshotCache;let e=[];for(let t of this.instances.values())e.push({id:t.id,serverSessionId:t.serverSessionId,label:t.label,customTitle:t.customTitle,processTitle:t.processTitle,oscTitle:t.oscTitle,cwd:t.cwd,cwdTarget:t.cwdTarget,initialCwd:t.initialCwd,rootGeneration:t.rootGeneration,progress:t.progress,promptState:t.promptState,displayTitle:t.customTitle??t.oscTitle??t.processTitle??t.label,isDedicated:t.isDedicated,isExited:t.isExited,exitCode:t.exitCode,outputActive:t.lastOutputTime>0&&Date.now()-t.lastOutputTime<sT,lastBellAt:t.lastBellAt,command:t.command,args:t.args,closeTip:t.closeTip,closeCallbackUrl:t.closeCallbackUrl,platform:t.platform});return this.snapshotCache={sessions:e},this.snapshotCache}notify(){this.snapshotCache=null;for(let e of this.listeners)e()}emitActivationRequest(e){this.setActiveSessionId(e);for(let t of this.activationListeners)t(e);this.scheduleSessionFocus(e)}scheduleSessionFocus(e){(typeof globalThis.requestAnimationFrame==`function`?globalThis.requestAnimationFrame.bind(globalThis):e=>globalThis.setTimeout(()=>e(Date.now()),0))(()=>{this.focusSession(e)})}ensureWsConnected(){this.ws&&(this.ws.readyState===WebSocket.CONNECTING||this.ws.readyState===WebSocket.OPEN)||this.connectSharedWebSocket()}connectSharedWebSocket(){this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null);let e=new WebSocket(P());this.ws=e,e.onopen=()=>{this.wsConnected=!0,this.reconnectDelay=cT;let t=L();t&&e.send(JSON.stringify({type:`auth`,credential:t}));for(let e of this.pendingCloseSessionIds)this.wsSend({type:`close`,sessionId:e});this.pendingCloseSessionIds.clear(),this.wsSend({type:`list`});for(let e of this.pendingCreates)this.wsSend({type:`create`,requestId:e.requestId,cwdTarget:e.cwdTarget,expectedRootGeneration:e.expectedRootGeneration,cols:e.cols,rows:e.rows,command:e.command,args:e.args,closeTip:e.closeTip,closeCallbackUrl:e.closeCallbackUrl});this.pendingCreates=[];for(let e of this.instances.values())if(!e.restored)continue;this.notify()},e.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}let n=Rpe.safeParse(t);n.success&&this.handleServerMessage(n.data)},e.onclose=()=>{this.wsConnected=!1,this.ws=null;for(let e of this.pendingWorkflowInputs.values())e.reject(Error(`Terminal connection closed before workflow input was accepted.`));this.pendingWorkflowInputs.clear(),this.notify(),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,(this.listeners.size>0||this.instances.size>0)&&this.connectSharedWebSocket()},this.reconnectDelay),this.reconnectDelay=Math.min(this.reconnectDelay*1.5,aye)},e.onerror=()=>{}}handleServerMessage(e){switch(e.type){case`list`:this.handleListResponse(e);break;case`created`:this.handleCreatedResponse(e);break;case`workflow-input-accepted`:{let t=this.pendingWorkflowInputs.get(e.requestId);if(!t)break;this.pendingWorkflowInputs.delete(e.requestId),t.resolve();break}case`workflow-input-rejected`:{let t=this.pendingWorkflowInputs.get(e.requestId);if(!t)break;this.pendingWorkflowInputs.delete(e.requestId),t.reject(Error(e.message));break}case`buffer`:this.handleBufferResponse(e);break;case`output`:this.handleOutputResponse(e);break;case`exit`:this.handleExitResponse(e);break;case`title`:this.handleTitleResponse(e);break;case`process-title`:this.handleProcessTitleResponse(e);break;case`cwd`:this.handleCwdResponse(e);break;case`progress`:this.handleProgressResponse(e);break;case`prompt-state`:this.handlePromptStateResponse(e);break;case`bell`:this.handleBellResponse(e);break;case`error`:this.handleErrorResponse(e);break}}handleListResponse(e){let t=new Set(e.sessions.map(e=>e.id));for(let t of e.sessions){let e=this.getLocalSessionIdByServerSessionId(t.id),n=this.instances.get(e);if(n)n.serverSessionId||=t.id;else{let e=t.title||`${t.command} ${t.args.join(` `)}`.trim();n=this.createTerminalInstance(t.id,{label:e.length>40?`${e.slice(0,37)}...`:e,command:t.command,args:t.args,isDedicated:!1,closeTip:t.closeTip,closeCallbackUrl:t.closeCallbackUrl,initialInput:void 0,customTitle:null,restored:!0,serverSessionId:t.id,platform:t.platform??lT,cwdTarget:t.cwdTarget,initialCwd:t.initialCwd,rootGeneration:t.rootGeneration}),t.isExited&&(n.isExited=!0,n.exitCode=t.exitCode),this.bindTerminalInput(n),this.instances.set(n.id,n),this._applyFonts()}n.closeTip=t.closeTip,n.closeCallbackUrl=t.closeCallbackUrl,n.cwdTarget=t.cwdTarget,n.initialCwd=t.initialCwd,n.rootGeneration=t.rootGeneration,n.platform=t.platform??lT,n.inputPanelAddon.setPlatform(n.platform),this.serverToLocalSessionId.set(t.id,n.id),this.wsSend({type:`attach`,sessionId:t.id,cols:n.terminal.cols||80,rows:n.terminal.rows||24})}for(let e of this.instances.values())e.restored&&e.serverSessionId&&!t.has(e.serverSessionId)&&!e.isExited&&(e.isExited=!0,e.exitCode=-1);this.hasDiscoveredSessions=!0,this.notify()}get discoveredSessions(){return this.hasDiscoveredSessions}runCloseCallback(e){if(!e.isExited)return;let t=vye(e.closeCallbackUrl,e.exitCode);t&&yye(t)}wsSend(e){return this.ws?.readyState===WebSocket.OPEN?(this.ws.send(JSON.stringify(e)),!0):!1}};function vye(e,t){if(!e)return null;if(typeof e==`string`){let t=e.trim();return t.length>0?t:null}let n=e[t==null?`null`:String(t)];if(typeof n==`string`&&n.trim().length>0)return n.trim();let r=e[`*`];return typeof r==`string`&&r.trim().length>0?r.trim():null}function yye(e){let t;try{t=new URL(e,window.location.origin)}catch{return}if(t.origin===window.location.origin){let e=`${t.pathname}${t.search}${t.hash}`,n=Pa.getAreaForPath(t.pathname);Pa.push(n,e,null);return}window.open(t.toString(),`_blank`,`noopener,noreferrer`)}var pT=new _ye,mT=Gie;m({sound:mT.default(el),volume:Kie,systemNotificationsEnabled:f().default(!1)});var bye=N(`type`,[m({type:_(`terminal`),sessionId:x().min(1),title:x().optional()}),m({type:_(`openspec-change`),changeId:x().min(1),title:x().optional()}),m({type:_(`hooks-plugin`),pluginId:x().min(1),title:x().optional()}),m({type:_(`root-context`)}),m({type:_(`custom`),groupId:x().min(1),title:x().optional()})]),xye=N(`type`,[m({type:_(`terminal.focus`),label:x().default(`Focus terminal`),target:m({sessionId:x().min(1)})}),m({type:_(`href.open`),label:x().default(`Open`),target:m({href:x().min(1)})})]),Sye=x().min(1);m({title:x().min(1).max(160),body:x().max(2e3).default(``),source:bye,actions:p(xye).default([]),level:l([`info`,`success`,`warning`,`error`]).default(`info`),createdAt:b().int().positive().optional()}).extend({id:x().min(1),createdAt:b().int().positive(),groupKey:Sye});function Cye(e){return e.type===`terminal`?e.title?.trim()||`Terminal ${e.sessionId}`:e.type===`openspec-change`?e.title?.trim()||`Change ${e.changeId}`:e.type===`hooks-plugin`?e.title?.trim()||`Plugin ${e.pluginId}`:e.type===`root-context`?`Root Context`:e.title?.trim()||e.groupId}function hT(e){return Array.isArray(e)?`[${e.map(e=>hT(e)).join(`,`)}]`:e&&typeof e==`object`?`{${Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${JSON.stringify(e)}:${hT(t)}`).join(`,`)}}`:JSON.stringify(e)}function wye(e){return hT({groupKey:e.groupKey,title:e.title,body:e.body,source:e.source,actions:e.actions,level:e.level})}function Tye(e){let t=new Map;for(let n of e){let e=wye(n),r=t.get(e);r?r.push(n):t.set(e,[n])}return[...t.entries()].map(([e,t])=>{let n=[...t].sort((e,t)=>t.createdAt-e.createdAt);return{key:e,notifications:n,latest:n[0],count:n.length}}).sort((e,t)=>t.latest.createdAt-e.latest.createdAt)}function Eye(e){let t=new Map;for(let n of e){let e=t.get(n.groupKey);e?e.push(n):t.set(n.groupKey,[n])}return[...t.entries()].map(([e,t])=>{let n=[...t].sort((e,t)=>t.createdAt-e.createdAt),r=n[0];return{key:e,label:Cye(r.source),source:r.source,notifications:n,aggregates:Tye(n),latest:r,unreadCount:n.length}}).sort((e,t)=>t.latest.createdAt-e.latest.createdAt)}function gT(){if(typeof window>`u`)return;let e=V(),t=e.endsWith(`/`)?e:`${e}/`;return new URL(`${t}icon.rounded.svg`,window.location.href).href}var Dye=class extends Nw{constructor(){super(`notification`)}},_T=(0,q.createContext)(null);function Oye({value:e,children:t}){return(0,K.jsx)(_T,{value:e,children:t})}var kye={notifications:[],latestNotification:null,groups:[],unreadCount:0,highlightedId:null,browserSupported:!1,browserPermission:`unsupported`,panelOpen:!1,openPanel:()=>void 0,requestBrowserPermission:async()=>`unsupported`,previewSound:async()=>void 0,resolveAction:(e,t)=>({action:t,disabled:!0,reason:`Notifications are not available in this render tree.`,run:async()=>void 0}),markRead:async()=>void 0,markManyRead:async()=>void 0,clearGroup:async()=>void 0,clearAll:async()=>void 0,clearTerminalSession:async()=>void 0};function vT(){return typeof window<`u`&&`Notification`in window}function Aye(){return vT()?Notification.permission:`unsupported`}function jye(e){if(!e)return`/notifications`;let t=new URLSearchParams;return t.set(`highlight`,e),`/notifications?${t.toString()}`}function Mye(e){return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}function Nye(e){return e.body.trim()||e.title}function Pye(e){let t=e[0];if(!t)return``;let n=Mye(t.createdAt);return e.length<=1?`${n} - 1 unread`:`${n} - ${e.length} unread notifications`}async function Fye(){if(Pa.getAreaForPath(`/terminal`)===`bottom`){await Vd.activateBottom(`/terminal`);return}await Vd.push(`main`,`/terminal`,null)}function Iye({children:e}){let{data:t}=Hoe(),{data:n}=nd(),r=Fa(),i=t??[],a=(0,q.useMemo)(()=>Eye(i),[i]),o=i[0]??null,[s,c]=(0,q.useState)(()=>Aye()),[l,u]=(0,q.useState)(null),d=(0,q.useRef)(null),f=(0,q.useRef)(null),p=(0,q.useRef)(null),m=r.popActive&&r.popLocation.pathname===`/notifications`,h=n?.notifications?.systemNotificationsEnabled??!1,g=n?.notifications?.sound??`builtin:Blow`,_=n?.notifications?.volume??1;(0,q.useEffect)(()=>{let e=new Dye;e.init(),d.current=e},[]);let v=(0,q.useCallback)(e=>{typeof window<`u`&&window.focus(),u(e??null),Vd.activatePop(jye(e))},[]),y=(0,q.useCallback)(async e=>{await G.notifications.markRead.mutate({id:e})},[]),b=(0,q.useCallback)(async e=>{await G.notifications.markManyRead.mutate({ids:[...e]})},[]),x=(0,q.useCallback)(async e=>{await G.notifications.clearGroup.mutate({groupKey:e})},[]),S=(0,q.useCallback)(async()=>{await G.notifications.clearAll.mutate()},[]),C=(0,q.useCallback)(async e=>{await G.notifications.clearTerminalSession.mutate({sessionId:e})},[]),w=(0,q.useCallback)(async()=>{if(!vT())return c(`unsupported`),`unsupported`;let e=await Notification.requestPermission();return c(e),e===`granted`&&await G.config.update.mutate({notifications:{systemNotificationsEnabled:!0}}),e},[]),T=(0,q.useCallback)(async(e,t)=>{await d.current?.play(e??g,t??_)},[g,_]),E=(0,q.useCallback)((e,t,n)=>{let r=n?.markReadOnRun??!0;if(t.type===`terminal.focus`){let n=pT.hasServerSession(t.target.sessionId);return{action:t,disabled:!n,reason:n?void 0:`Target terminal is no longer available.`,run:async()=>{pT.hasServerSession(t.target.sessionId)&&(await Vd.deactivatePop(),await Fye(),pT.requestActivateServerSession(t.target.sessionId)&&r&&await y(e.id))}}}return{action:t,disabled:!1,run:async()=>{let n=Pa.getAreaForPath(t.target.href);m&&await Vd.deactivatePop(),await Vd.push(n,t.target.href,null),r&&await y(e.id)}}},[y,m]);return(0,q.useEffect)(()=>{let e=o?.id??null;if(!e||f.current===e){f.current=e;return}if(f.current=e,d.current?.play(g,_).catch(()=>{}),!h||m||!vT()||Notification.permission!==`granted`)return;p.current?.close();let t=new Notification(Nye(o),{body:Pye(i),icon:gT(),tag:`openspecui-notifications`});t.onclick=()=>{v(o.id),t.close()},p.current=t},[o,i,v,m,g,h,_]),(0,q.useEffect)(()=>{m&&(p.current?.close(),p.current=null)},[m]),(0,q.useEffect)(()=>{r.popLocation.pathname===`/notifications`&&u(new URLSearchParams(r.popLocation.search).get(`highlight`))},[r.popLocation.pathname,r.popLocation.search]),(0,K.jsx)(Oye,{value:(0,q.useMemo)(()=>({notifications:i,latestNotification:o,groups:a,unreadCount:i.length,highlightedId:l,browserSupported:vT(),browserPermission:s,panelOpen:m,openPanel:v,requestBrowserPermission:w,previewSound:T,resolveAction:E,markRead:y,markManyRead:b,clearGroup:x,clearAll:S,clearTerminalSession:C}),[s,S,x,C,a,l,o,b,y,i,v,m,T,w,E]),children:e})}function yT(){return(0,q.useContext)(_T)||kye}function bT({className:e,badgeClassName:t,iconClassName:n,size:r=`mobile`}){let{unreadCount:i,openPanel:a}=yT();return(0,K.jsx)(Sv,{label:i>0?`Open notifications, ${i} unread`:`Open notifications`,icon:(0,K.jsx)(qd,{className:dv(`h-4 w-4`,n)}),badge:i>0?(0,K.jsx)(mv,{count:i,className:dv(`ring-background absolute -right-1.5 -top-1.5 ring-2`,t),"aria-hidden":`true`}):void 0,size:r,className:e,onClick:()=>a(),"data-notification-entry-button":`true`})}function xT({children:e,maxWidth:t=300,duration:n=10,gap:r=20,className:i=``}){let[a,o]=(0,q.useState)(!1),[s,c]=(0,q.useState)(!1),l=(0,q.useRef)(null),u=(0,q.useRef)(null);(0,q.useEffect)(()=>{let e=()=>{if(l.current&&u.current){let e=l.current.offsetWidth,t=u.current.scrollWidth;c(t>e)}};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[e]);let d=(0,q.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}catch(e){console.error(`Failed to copy path:`,e)}},[e]),f=typeof t==`number`?`${t}px`:t;return(0,K.jsxs)(`button`,{onClick:d,className:`hover:bg-muted/50 group flex cursor-pointer items-center gap-1.5 rounded transition-colors ${i}`,title:`${e}\n\nClick to copy`,children:[(0,K.jsx)(`div`,{ref:l,className:`relative overflow-hidden whitespace-nowrap`,style:{maxWidth:f},children:(0,K.jsx)(`div`,{ref:u,"data-content":e,className:`relative inline-block ${s?`animate-marquee group-hover:[animation-play-state:paused]!`:``}`,style:s?{"--marquee-duration":`${n}s`,"--marquee-gap":`${r}px`}:void 0,children:e})}),(0,K.jsx)(`span`,{className:`text-muted-foreground group-hover:text-foreground shrink-0 transition-colors`,children:a?(0,K.jsx)(Jd,{className:`h-3.5 w-3.5 text-green-500`}):(0,K.jsx)(ef,{className:`h-3.5 w-3.5`})})]})}function ST({compact:e=!1}){if(z())return(0,K.jsxs)(`div`,{className:`status-indicator flex items-center gap-1.5 text-xs`,title:`Live features disabled (no file watching, task toggling, or AI integration)`,children:[(0,K.jsx)(zse,{className:`h-3.5 w-3.5 text-blue-500`}),!e&&(0,K.jsx)(`span`,{className:`status-text text-blue-600`,children:`Static`})]});let t=Tv(),n=Spe();if(t.connected){let n=t.watcherEnabled?`Watching for changes`:`File watcher disabled`;return(0,K.jsxs)(`div`,{className:`status-indicator flex items-center gap-1.5 text-xs`,children:[(0,K.jsx)(wf,{className:`h-3.5 w-3.5 text-green-500`}),!e&&(0,K.jsx)(fv,{content:n,children:(0,K.jsx)(`span`,{className:`status-text cursor-default text-green-600`,children:`Live`})})]})}return(0,K.jsxs)(`div`,{className:`status-indicator flex items-center gap-1.5 text-xs`,children:[(0,K.jsx)(qf,{className:`h-3.5 w-3.5 text-red-500`}),!e&&(0,K.jsx)(`span`,{className:`status-text text-red-600`,children:`Offline`}),t.reconnectCountdown!==null&&(0,K.jsxs)(`button`,{onClick:n,className:`text-muted-foreground hover:text-foreground flex cursor-pointer items-center gap-1 transition-colors`,title:`Click to reconnect now`,children:[(0,K.jsxs)(`span`,{className:`text-xs`,children:[`(`,t.reconnectCountdown,`s)`]}),(0,K.jsx)(Nf,{className:`h-3 w-3`})]})]})}function Lye(){let e=z(),[t,n]=(0,q.useState)(`Unknown`),[r,i]=(0,q.useState)(null);if((0,q.useEffect)(()=>{e&&Su().then(e=>{e?.meta?.timestamp?n(new Date(e.meta.timestamp).toLocaleString()):n(`Unknown`),i(e?.git?.repositoryUrl??null)}).catch(()=>{n(`Unknown`),i(null)})},[e]),e)return(0,K.jsx)(`div`,{className:`desktop-status border-border bg-muted/30 text-muted-foreground flex h-8 items-center justify-between gap-4 border-t px-2 text-xs`,children:(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,K.jsx)(ST,{}),(0,K.jsxs)(`span`,{className:`truncate`,children:[`Generated: `,t]}),r&&(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,K.jsx)(tce,{className:`h-3.5 w-3.5 shrink-0`}),(0,K.jsx)(xT,{children:r,maxWidth:280,duration:12,className:`text-xs`})]})]})});let a=Tv();return(0,K.jsxs)(`div`,{className:`desktop-status border-border bg-muted/30 text-muted-foreground flex h-8 items-center justify-between gap-4 border-t px-2 text-xs`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsx)(ST,{}),a.projectDir&&(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(mf,{className:`h-3.5 w-3.5 shrink-0`}),(0,K.jsx)(xT,{children:a.projectDir,maxWidth:300,duration:12,className:`text-xs`})]})]}),(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,K.jsx)(bT,{})})]})}function Rye(){let[e,t]=(0,q.useState)(!1),n=ca(),r=Tv(),i=Fa(),a=r.dirName??`OpenSpec`,o=V(),s=z(),c=()=>t(!1);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`header`,{className:`mobile-header border-border bg-background flex h-12 items-center justify-between border-b px-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`button`,{onClick:()=>t(!0),className:`hover:bg-muted -ml-1.5 rounded-md p-1.5`,"aria-label":`Open menu`,children:(0,K.jsx)(ice,{className:`h-5 w-5`})}),(0,K.jsx)(`span`,{className:`font-nav max-w-[min(52vw,18rem)] truncate text-[12px] tracking-[0.04em]`,children:a})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Sv,{label:`Open search`,icon:(0,K.jsx)(Lf,{className:`h-4 w-4`}),onClick:()=>Vd.activatePop(`/search`)}),!s&&(0,K.jsx)(bT,{}),(0,K.jsx)(ST,{compact:!0})]})]}),e&&(0,K.jsxs)(`div`,{className:`fixed inset-0 z-50 flex`,children:[(0,K.jsx)(`div`,{className:`animate-in fade-in absolute inset-0 bg-black/50 duration-200`,onClick:c}),(0,K.jsxs)(`nav`,{className:`bg-background border-border animate-in slide-in-from-left relative flex h-full w-64 max-w-[80vw] flex-col border-r p-4 duration-200`,children:[(0,K.jsxs)(`div`,{className:`mb-6 flex items-center justify-between`,children:[(0,K.jsx)(`img`,{src:n?`${o}openspec_pixel_dark.svg`:`${o}openspec_pixel_light.svg`,alt:`OpenSpec`,className:`h-5`}),(0,K.jsx)(`button`,{onClick:c,className:`hover:bg-muted rounded-md p-1.5`,"aria-label":`Close menu`,children:(0,K.jsx)(Yf,{className:`h-5 w-5`})})]}),s?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`ul`,{className:`flex-1 space-y-1`,children:vv.map(e=>(0,K.jsx)(`li`,{children:(0,K.jsxs)(Rd,{to:e.to,onClick:c,className:`hover:bg-muted [&.active]:bg-primary [&.active]:text-primary-foreground flex items-center gap-2 rounded-md px-3 py-2`,children:[(0,K.jsx)(e.icon,{className:`h-4 w-4 shrink-0`}),(0,K.jsx)(`span`,{className:`font-nav text-base tracking-[0.04em]`,children:e.label})]})},e.to))}),(0,K.jsx)(`div`,{className:`border-border space-y-1 border-t pt-4`,children:(0,K.jsxs)(Rd,{to:yv.to,onClick:c,className:`hover:bg-muted [&.active]:bg-primary [&.active]:text-primary-foreground flex items-center gap-2 rounded-md px-3 py-2`,children:[(0,K.jsx)(yv.icon,{className:`h-4 w-4 shrink-0`}),(0,K.jsx)(`span`,{className:`font-nav text-base tracking-[0.04em]`,children:yv.label})]})})]}):(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2`,children:[(0,K.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,K.jsx)(xv,{area:`main`,tabs:i.mainTabs,className:`scrollbar-thin scrollbar-track-transparent h-full overflow-auto`,useLinks:!0,onNavigate:c})}),(0,K.jsx)(`div`,{className:`text-muted-foreground text-[10px] font-medium uppercase tracking-wider`,children:`Bottom`}),(0,K.jsx)(`div`,{className:`border-border border-t pt-2`,children:(0,K.jsx)(xv,{area:`bottom`,tabs:i.bottomTabs,onNavigate:c})})]})]})]})]})}function zye(){let e=Fa();return(0,K.jsx)(`nav`,{className:`mobile-tabbar border-border bg-background flex h-14 items-stretch border-t`,children:(z()?vpe:e.mainTabs.map(e=>_v.find(t=>t.to===e)).filter(e=>e!=null)).map(e=>(0,K.jsxs)(Rd,{to:e.to,className:`text-muted-foreground hover:text-foreground [&.active]:text-primary flex flex-1 flex-col items-center justify-center gap-0.5`,children:[(0,K.jsxs)(`span`,{className:`relative`,children:[(0,K.jsx)(e.icon,{className:`h-5 w-5 shrink-0`}),e.beta?(0,K.jsx)(gv,{}):null]}),(0,K.jsx)(`span`,{className:`font-nav text-[10px] tracking-[0.03em]`,children:e.label})]},e.to))})}function CT(e,t){(0,q.useInsertionEffect)(()=>{if(typeof document>`u`)return;let n=[...document.head.querySelectorAll(`style[data-head-style]`)].find(t=>t.dataset.headStyle===e);if(n){let e=Number(n.dataset.refCount??`1`);return n.dataset.refCount=String(e+1),n.textContent!==t&&(n.textContent=t),()=>{let e=Number(n.dataset.refCount??`1`)-1;if(e<=0){n.remove();return}n.dataset.refCount=String(e)}}let r=document.createElement(`style`);return r.setAttribute(`data-head-style`,e),r.dataset.refCount=`1`,r.textContent=t,document.head.appendChild(r),()=>{let e=Number(r.dataset.refCount??`1`)-1;if(e>0){r.dataset.refCount=String(e);return}r.remove()}},[t,e])}function wT({open:e,title:t,headerActions:n,onClose:r,onDismissRequest:i,onClosed:a,children:o,footer:s,dialogClassName:c=``,contentClassName:l=``,contentShellClassName:u=``,className:d=``,bodyClassName:f=``,maxHeight:p=`86vh`,borderVariant:m=`default`}){let h=(0,q.useRef)(null),g=(0,q.useRef)(null),_=(0,q.useId)(),v=i===void 0?r:i;(0,q.useEffect)(()=>{let e=h.current;if(!e||!a)return;let t=()=>{a()};return e.addEventListener(`close`,t),()=>{e.removeEventListener(`close`,t)}},[a]),(0,q.useLayoutEffect)(()=>{let t=h.current;t&&(e&&!t.open?typeof t.showModal==`function`?t.showModal():t.setAttribute(`open`,``):!e&&t.open&&(typeof t.close==`function`?t.close():t.removeAttribute(`open`)))},[e]),(0,q.useEffect)(()=>{let e=h.current;if(!e)return;let t=e=>{e.preventDefault(),v?.()},n=e=>{let t=g.current;if(!t||e.target instanceof Node&&t.contains(e.target))return;let n=t.getBoundingClientRect();e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom||v?.()};return e.addEventListener(`cancel`,t),e.addEventListener(`click`,n),()=>{e.removeEventListener(`cancel`,t),e.removeEventListener(`click`,n)}},[v]);let y=m===`error`?`border-red-500/60`:m===`success`?`border-green-500/50`:`border-border`;return CT(`dialog:openspec-dialog`,(0,q.useMemo)(()=>String.raw`
|
|
883
883
|
dialog.openspec-dialog {
|
|
884
884
|
opacity: 0;
|
|
885
885
|
transform: translateY(8px);
|
|
@@ -956,7 +956,7 @@ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){t
|
|
|
956
956
|
transform: scaleX(0.5);
|
|
957
957
|
}
|
|
958
958
|
|
|
959
|
-
`};function Wxe(e,t,n,r){if(t===n)return[...e];let i=e.filter(e=>e!==t),a=i.indexOf(n);if(a<0)return[...e];let o=r===`before`?a:a+1;return i.splice(o,0,t),i}function Gxe(e,t){let n=new Set(t),r=e.filter(e=>n.has(e)),i=t.filter(e=>!r.includes(e));return[...r,...i]}function Kxe({tabs:e,selectedTab:t,onTabChange:n,onTabClose:r,onTabOrderChange:i,actions:a,onTabBarDoubleClick:o,className:s=``,classNames:c,showHeaderShell:l=!0,showSelectionIndicator:u=!0,decorateStrip:d=!0,selectionIndicatorLayout:f=`underline`},p){let[m,h]=(0,q.useState)(e[0]?.id??``),[g,_]=(0,q.useState)(null),v=(0,q.useRef)(null),y=(0,q.useRef)(e.map(e=>e.id)),b=(0,q.useRef)(null),x=(0,q.useRef)(null),S=(0,q.useRef)(null),C=(0,q.useRef)(null),w=(0,q.useRef)(null),T=(0,q.useRef)(null),E=(0,q.useRef)(null),D=(0,q.useRef)(null),O=(0,q.useRef)(new Map),k=(0,q.useRef)(new Map),A=t??m,j=typeof i==`function`&&e.length>1,M=e.map(e=>e.id),N=M.join(`|`),P=(0,q.useMemo)(()=>new Map(e.map(e=>[e.id,e])),[e]),F=(0,q.useMemo)(()=>{let e=Gxe(y.current,M);return y.current=e,e},[M]).map(e=>P.get(e)).filter(e=>e!==void 0),I=(0,q.useId)().replace(/:/g,`_`),L=(0,q.useMemo)(()=>Uxe(I),[I]);CT(`tabs:${I}`,L),(0,q.useImperativeHandle)(p,()=>({get root(){return b.current},getTrigger(e){return O.current.get(e)??null},getPanel(e){return k.current.get(e)??null},getHeaderShell(){return S.current??T.current},getHeaderForeground(){return C.current},getSelectionIndicator(){return E.current},getActiveTabId(){return A||null}}),[A]);let R=(0,q.useCallback)(()=>{let e=E.current,t=T.current??w.current,n=A?O.current.get(A):null,r=n?.closest(`[data-tab-item="true"]`)??n;if(!e)return;if(!u||!t||!r){e.style.opacity=`0`,e.style.width=`0px`,e.style.height=f===`overlay`?`0px`:``,e.style.transform=f===`overlay`?`translate(0px, 0px)`:`translateX(0px)`;return}let i=t.getBoundingClientRect(),a=r.getBoundingClientRect();if(f===`underline`){let t=getComputedStyle(e),n=parseFloat(t.getPropertyValue(`--tabs-selection-inline-inset`))||10,r=parseFloat(t.getPropertyValue(`--tabs-selection-min-width`))||40,o=Math.max(r,a.width-n*2),s=a.left-i.left+(a.width-o)/2;e.style.opacity=`1`,e.style.width=`${o}px`,e.style.height=``,e.style.transform=`translateX(${s}px)`;return}e.style.opacity=`1`,e.style.width=`${a.width}px`,e.style.height=`${a.height+1}px`,e.style.transform=`translate(${a.left-i.left}px, ${a.top-i.top}px)`},[A,f,u]);(0,q.useLayoutEffect)(()=>{R()},[R,e]),(0,q.useLayoutEffect)(()=>{if(!u)return;let e=D.current;if(!e)return;let t=()=>{R()};if(e.addEventListener(`scroll`,t,{passive:!0}),typeof ResizeObserver>`u`)return()=>{e.removeEventListener(`scroll`,t)};let n=new ResizeObserver(()=>{R()});n.observe(e),x.current&&n.observe(x.current),T.current&&n.observe(T.current),w.current&&n.observe(w.current);let r=A?O.current.get(A):null,i=r?.closest(`[data-tab-item="true"]`)??r;return i&&n.observe(i),()=>{e.removeEventListener(`scroll`,t),n.disconnect()}},[A,u,R,N]);let z=e=>{t||h(e),n?.(e)},B=(0,q.useCallback)(e=>{v.current=e,_(e)},[]),V=(0,q.useCallback)(()=>{uD=null,B(null)},[B]),ee=(0,q.useCallback)((e,t)=>{if(!j||!uD)return;let n=Wxe(M,uD,e,t);n.some((e,t)=>e!==M[t])&&i?.(n)},[i,j,M]),H=(0,q.useCallback)((e,t)=>{!j||!e.dataTransfer||(uD=t,e.dataTransfer.setData(`text/plain`,t),e.dataTransfer.effectAllowed=`move`)},[j]),te=(0,q.useCallback)(()=>{V()},[V]),ne=(0,q.useCallback)((e,t)=>{if(!j||!uD)return;if(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`move`,t===uD){B(null);return}let n=e.currentTarget.getBoundingClientRect(),r=n.left+n.width/2;B({tabId:t,position:e.clientX<r?`before`:`after`})},[j,B]),re=(0,q.useCallback)((e,t)=>{if(!j)return;e.preventDefault(),e.stopPropagation();let n=v.current;ee(t,n?.tabId===t?n.position:`after`),V()},[ee,j,V]),ie=(0,q.useCallback)(e=>{if(j){if(e.preventDefault(),uD&&v.current===null){let e=M.filter(e=>e!==uD);e.push(uD),e.some((e,t)=>e!==M[t])&&i?.(e)}V()}},[i,j,V,M]),ae=(0,q.useCallback)(e=>{!j||!uD||(e.preventDefault(),e.dataTransfer.dropEffect=`move`)},[j]);if(e.length===0)return null;let oe=dv(`tabs-header relative sticky top-0 z-20 flex min-w-0 items-stretch`,c?.header),se=dv(f===`underline`?`tabs-header-shell bg-card/95 pointer-events-none absolute inset-0 z-0 rounded-t-md rounded-b-none border border-b-0 border-zinc-500/15 backdrop-blur-sm`:`tabs-header-shell bg-card/95 pointer-events-none absolute inset-0 z-0 rounded-md border border-zinc-500/15 shadow-[inset_0_-1px_0_color-mix(in_srgb,var(--border)_85%,transparent)] backdrop-blur-sm`,c?.headerShell),ce=dv(`tabs-header-foreground relative z-20 flex min-w-0 flex-1`,c?.headerForeground),le=dv(`tabs-header-frame relative flex min-w-0 flex-1 items-stretch`,c?.headerFrame),ue=dv(`tabs-strip relative flex min-w-0 flex-1 items-stretch px-4`,c?.strip),de=dv(`tabs-button scrollbar-none flex min-w-0 flex-1 gap-1 overflow-x-auto`,c?.list),fe=dv(`group relative z-10 flex h-full shrink-0 items-stretch`,c?.item),pe=dv(c?.activeItem),me=dv(c?.inactiveItem),he=dv(`relative m-0 flex h-full min-w-0 flex-1 px-2 py-2 text-center text-sm font-medium transition-colors`,c?.buttonBase),ge=dv(`inline-flex h-full items-center gap-2 relative`,c?.buttonInner),_e=dv(`tab-selected text-foreground`,c?.activeButton),ve=dv(`text-muted-foreground hover:text-foreground`,c?.inactiveButton),ye=dv(c?.activeButtonInner),U=dv(c?.inactiveButtonInner),be=dv(`relative z-20 flex shrink-0 items-center`,c?.tabActions),xe=dv(`tabs-actions relative flex shrink-0 items-center px-1`,c?.actions),Se=dv(`tabs-actions-divider bg-border/60 absolute inset-y-0 left-0 w-px`,c?.actionsDivider),Ce=dv(`tabs-selection-track bg-border/85 pointer-events-none absolute inset-x-0 bottom-0 h-px`,c?.selectionTrack),we=dv(f===`underline`?`pointer-events-none absolute inset-x-0 top-0 bottom-[-1px] z-10 overflow-hidden`:`pointer-events-none absolute inset-0 z-10 overflow-hidden`,c?.selectionIndicatorViewport),Te=dv(f===`underline`?`tabs-selection-indicator absolute bottom-0 left-0 h-[3px] rounded-full bg-primary opacity-0 transition-[transform,width,opacity] duration-280 ease-[cubic-bezier(0.22,1,0.36,1)] [--tabs-selection-inline-inset:10px] [--tabs-selection-min-width:40px]`:`tabs-selection-indicator border-primary bg-background/70 duration-280 absolute left-0 top-0 border-b opacity-0 transition-[transform,width,height,opacity] ease-[cubic-bezier(0.22,1,0.36,1)]`,c?.selectionIndicator),Ee=e=>{o&&(e.target.closest(`[data-tab-item="true"]`)||o())},De=e.map(e=>{let t=g?.tabId===e.id?{boxShadow:g.position===`before`?`inset 2px 0 0 var(--border)`:`inset -2px 0 0 var(--border)`}:void 0;return(0,K.jsxs)(`div`,{"data-tab-item":`true`,"data-tab-id":e.id,className:dv(fe,A===e.id?pe:me),style:t,children:[(0,K.jsxs)(`button`,{ref:t=>{O.current.set(e.id,t)},"data-tab-trigger":`true`,"data-tab-id":e.id,draggable:j,onClick:()=>z(e.id),onDragStart:t=>H(t,e.id),onDragEnd:te,onDragOver:t=>ne(t,e.id),onDrop:t=>re(t,e.id),className:`${he} ${A===e.id?_e:ve} ${j?`cursor-grab active:cursor-grabbing`:``}`,title:e.title,children:[(0,K.jsxs)(`span`,{"data-tabs-button-inner":`true`,className:`${ge} ${A===e.id?ye:U}`,children:[e.icon,e.label]}),e.badge&&(0,K.jsx)(`span`,{"data-tabs-badge":`true`,className:`pointer-events-none absolute right-0 top-0 z-30`,children:e.badge})]}),(e.action||e.closable&&r)&&(0,K.jsxs)(`span`,{"data-tabs-tab-actions":`true`,className:be,children:[e.action,e.closable&&r&&(0,K.jsx)(`button`,{type:`button`,"aria-label":`Close ${e.title??e.id}`,onClick:t=>{t.stopPropagation(),r(e.id)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.stopPropagation(),r(e.id))},draggable:!1,className:`rounded-[var(--tabs-close-radius,0.25rem)] p-1 transition ${e.closeButtonVisibility===`always`?`opacity-100`:`opacity-0 focus-visible:opacity-100 group-hover:opacity-100`} ${A===e.id?dv(`text-current/80 hover:text-foreground`,c?.closeButtonActive):dv(`text-muted-foreground hover:text-foreground`,c?.closeButtonInactive)}`,children:(0,K.jsx)(Yf,{className:`h-3 w-3`})})]})]},e.id)});return(0,K.jsxs)(`div`,{id:I,ref:b,"data-tabs-strip-decoration":d?`on`:`off`,className:`relative isolate flex min-h-0 min-w-0 flex-1 flex-col ${s}`,children:[(0,K.jsx)(`div`,{ref:x,className:oe,children:(0,K.jsxs)(K.Fragment,{children:[l&&(0,K.jsx)(`div`,{ref:S,"data-tabs-header-shell":`true`,className:se}),(0,K.jsx)(`div`,{ref:C,"data-tabs-header-foreground":`true`,className:ce,children:(0,K.jsxs)(`div`,{ref:w,className:le,children:[(0,K.jsxs)(`div`,{ref:T,className:ue,children:[(0,K.jsx)(`div`,{ref:D,className:de,onDoubleClick:Ee,onDragOver:ae,onDrop:ie,children:De}),u&&(0,K.jsx)(`div`,{className:we,children:(0,K.jsx)(`div`,{ref:E,"data-tabs-selection-indicator":`true`,"aria-hidden":`true`,className:Te})})]}),a&&(0,K.jsxs)(`div`,{"data-tabs-actions":`true`,className:xe,children:[d&&(0,K.jsx)(`div`,{"aria-hidden":`true`,className:Se}),a]}),d&&(0,K.jsx)(`div`,{"aria-hidden":`true`,className:Ce})]})})]})}),(0,K.jsx)(`div`,{className:`relative flex min-h-0 flex-1 overflow-hidden`,children:F.map(e=>e.unmountOnHide?A===e.id&&(0,K.jsx)(`div`,{ref:t=>{k.current.set(e.id,t)},"data-tab-panel":e.id,"data-tab-panel-state":`active`,className:`flex min-h-0 flex-1 flex-col`,children:e.content},e.id):(0,K.jsx)(`div`,{ref:t=>{k.current.set(e.id,t)},"data-tab-panel":e.id,"data-tab-panel-state":A===e.id?`active`:`inactive`,"aria-hidden":A===e.id?void 0:!0,className:A===e.id?`relative flex min-h-0 flex-1 flex-col`:`pointer-events-none absolute inset-0 flex min-h-0 flex-col overflow-hidden opacity-0`,children:e.content},e.id))})]})}var dD=(0,q.forwardRef)(Kxe);function qxe({backTo:e,backTitle:t,headerRef:n,sharedDescriptor:r,icon:i,title:a,subtitle:o,toolbar:s}){return(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,K.jsx)(Rd,{to:e,vt:{source:n,sharedElements:r},className:`hover:bg-muted rounded-md p-2 transition-colors`,title:t,children:(0,K.jsx)(Wd,{className:`h-5 w-5`})}),(0,K.jsxs)(`div`,{ref:n,...fd(r,`container`),className:`flex min-w-0 flex-col gap-1`,children:[(0,K.jsxs)(`h1`,{className:`font-nav flex min-w-0 items-center gap-2 text-2xl font-bold`,children:[(0,K.jsx)(i,{...fd(r,`icon`),className:`h-6 w-6 shrink-0`}),(0,K.jsx)(`span`,{...fd(r,`title`),className:`truncate`,children:a})]}),(0,K.jsx)(`p`,{className:`text-muted-foreground truncate text-sm`,children:o})]})]}),s]})}function fD({diagnostics:e,children:t,...n}){return(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 p-4`,children:[(0,K.jsx)(qxe,{...n}),(0,K.jsx)(Xxe,{diagnostics:e??[]}),t]})}function Jxe({handoff:e,fallbackTitle:t,fallbackSubtitle:n,loadingMessage:r,...i}){return(0,K.jsx)(fD,{...i,title:e?.title??t,subtitle:e?.subtitle??n,children:(0,K.jsxs)(`div`,{className:`vt-detail-content flex min-h-[240px] flex-1 flex-col`,"aria-busy":`true`,children:[(0,K.jsx)(xE,{children:r??`loading`}),(0,K.jsx)(AE,{count:6})]})})}function Yxe({tabsRef:e,tabs:t,selectedTab:n,onTabChange:r,className:i}){return(0,K.jsx)(`div`,{className:`vt-detail-content flex min-h-0 flex-1 flex-col`,children:(0,K.jsx)(dD,{ref:e,tabs:t,selectedTab:n,onTabChange:r,className:dv(`min-h-0 flex-1`,i)})})}function Xxe({diagnostics:e}){return e.length===0?null:(0,K.jsx)(`div`,{className:`border-border bg-muted/20 flex flex-col gap-2 rounded-md border p-3 text-sm`,children:e.map((e,t)=>(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(Kf,{className:`mt-0.5 h-4 w-4 shrink-0 text-amber-500`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`font-medium capitalize`,children:e.level}),(0,K.jsxs)(`div`,{className:`text-muted-foreground`,children:[e.path?`${e.path}: `:``,e.message]})]})]},`${e.message}-${t}`))})}function pD({message:e,tone:t=`default`}){return(0,K.jsx)(`div`,{className:dv(`vt-detail-content flex min-h-[240px] flex-1 items-center justify-center rounded-lg border border-dashed p-6 text-sm`,t===`destructive`?`text-destructive border-destructive/40`:`text-muted-foreground`),children:e})}function mD({value:e,options:t,onChange:n,className:r=``,tone:i=`default`,presentation:a=`label`}){return(0,K.jsx)(`div`,{className:`inline-flex w-fit max-w-full shrink-0 self-start overflow-hidden rounded-md border ${i===`terminal`?`border-terminal-foreground/25 bg-terminal/70 text-terminal-foreground`:`border-border bg-card`} ${r}`,children:t.map((t,r)=>{let o=t.value===e,s=o?`bg-primary text-primary-foreground`:i===`terminal`?`text-terminal-foreground/72 hover:bg-terminal-foreground/10 hover:text-terminal-foreground`:`text-muted-foreground hover:bg-muted/60 hover:text-foreground`,c=t.ariaLabel??(typeof t.label==`string`?t.label:void 0),l=t.tooltip??c,u=a===`icon-only`?t.icon??t.label:a===`icon-label`&&t.icon?(0,K.jsxs)(K.Fragment,{children:[t.icon,(0,K.jsx)(`span`,{children:t.label})]}):t.label,d=(0,K.jsx)(`button`,{type:`button`,disabled:t.disabled,onClick:()=>n(t.value),"aria-pressed":o,"aria-label":a===`icon-only`?c:void 0,title:a===`icon-only`&&typeof c==`string`?c:void 0,className:`inline-flex items-center justify-center gap-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${a===`icon-only`?`h-8 w-8 p-0`:`px-3 py-1.5`} ${r>0?i===`terminal`?`border-terminal-foreground/20 border-l`:`border-border border-l`:``} ${s}`,children:u},t.value);return l?(0,K.jsx)(fv,{content:l,children:d},t.value):d})})}var Zxe=[`github`,`material`,`vscode`,`tokyo`,`gruvbox`,`monokai`,`nord`],Qxe=`github`,$xe=[{value:`github`,label:`GitHub`},{value:`material`,label:`Material`},{value:`vscode`,label:`VS Code`},{value:`tokyo`,label:`Tokyo Night`},{value:`gruvbox`,label:`Gruvbox`},{value:`monokai`,label:`Monokai`},{value:`nord`,label:`Nord`}];function hD(e){return Zxe.includes(e)}var eSe=[`HeaderMark`,`EmphasisMark`,`LinkMark`,`URL`,`HardBreak`,`QuoteMark`,`ListMark`],gD=at.mark({class:`cm-md-hidden`}),tSe=at.line({class:`cm-md-codeblock-line`}),nSe=at.line({class:`cm-md-codeblock-line-start`}),rSe=at.line({class:`cm-md-codeblock-line-end`}),iSe=at.line({class:`cm-md-codeblock-inactive`}),aSe=at.mark({class:`cm-md-link`}),oSe=at.mark({class:`cm-md-image`}),_D=at.mark({class:`cm-md-faded`}),sSe=at.mark({class:`cm-md-task-faded`}),cSe=at.mark({class:`cm-md-fence`}),lSe=(e,t)=>at.replace({widget:new uSe(e,t),inclusive:!1}),uSe=class extends we{constructor(e,t){super(),this.label=e,this.faded=t}eq(e){return this.label===e.label&&this.faded===e.faded}toDOM(){let e=document.createElement(`span`);return e.textContent=`${this.label}.`,e.className=`cm-md-olist${this.faded?` cm-md-olist-faded`:``}`,e}},dSe=class extends we{constructor(e){super(),this.faded=e}eq(e){return this.faded===e.faded}toDOM(){let e=document.createElement(`span`);return e.textContent=`•`,e.className=`cm-md-ulmark${this.faded?` cm-md-olist-faded`:``}`,e}},fSe=class extends we{constructor(e){super(),this.checked=e}eq(e){return this.checked===e.checked}toDOM(){let e=document.createElement(`span`);return e.className=`cm-md-task ${this.checked?`cm-md-task-checked`:``}`,e.ariaHidden=`true`,e}};function pSe(e,t,n,r){let i=e.state.doc.lineAt(t.from).number,a=e.state.doc.lineAt(t.to).number,o=t.to-t.from>3&&e.state.doc.sliceString(t.to-3,t.to)==="```";for(let t=i;t<=a;t++){let s=e.state.doc.line(t);n.push({from:s.from,to:s.from,decoration:tSe}),t===i&&(n.push({from:s.from,to:s.from,decoration:nSe}),!r&&o&&n.push({from:s.from,to:s.from,decoration:iSe})),t===a&&n.push({from:s.from,to:s.from,decoration:rSe})}}var mSe=class{decorations;constructor(e){this.decorations=this.buildDecorations(e)}update(e){(e.docChanged||e.viewportChanged||e.selectionSet)&&(this.decorations=this.buildDecorations(e.view))}buildDecorations(e){let t=[],n=e.state.selection.ranges.map(t=>{let n=e.state.doc.lineAt(t.from),r=e.state.doc.lineAt(t.to);return{from:Math.min(n.from,r.from),to:Math.max(n.to,r.to)}}),r=[];for(let{from:i,to:a}of e.visibleRanges)de(e.state).iterate({from:i,to:a,enter(i){let{name:a}=i.type,o=n.some(e=>i.from<e.to&&i.to>e.from),s=i.node.parent?.name??``,c=i.node.parent?.parent?.name??``,l=s.includes(`OrderedList`)||c.includes(`OrderedList`),u=e.state.doc.sliceString(i.from,i.to);if(a===`OrderedList`){r.push(1);return}if(a===`FencedCode`)return pSe(e,i,t,n.some(e=>i.from<e.to&&i.to>e.from)),!1;if(a===`Link`){let e=i.node.getChild(`LinkLabel`);e&&t.push({from:e.from,to:e.to,decoration:aSe})}if(a===`Image`&&t.push({from:i.from,to:i.to,decoration:oSe}),a===`ListMark`){if(l){let e=r[r.length-1]??1;o?t.push({from:i.from,to:i.to,decoration:_D}):t.push({from:i.from,to:i.to,decoration:lSe(e,!1)}),r.length&&(r[r.length-1]=e+1);return}o?t.push({from:i.from,to:i.to,decoration:_D}):t.push({from:i.from,to:i.to,decoration:at.replace({widget:new dSe(!1),inclusive:!1})});return}if(a===`TaskMarker`){let e=/\[[xX]\]/.test(u);o?t.push({from:i.from,to:i.to,decoration:sSe}):t.push({from:i.from,to:i.to,decoration:at.replace({widget:new fSe(e),inclusive:!1})});return}if(a===`CodeMark`||a===`CodeInfo`){let e=o?_D:cSe;t.push({from:i.from,to:i.to,decoration:e});return}if(a===`HeaderMark`){let e=o?_D:gD;t.push({from:i.from,to:i.to+1,decoration:e});return}if(eSe.includes(a)){if(o){t.push({from:i.from,to:i.to,decoration:_D});return}t.push({from:i.from,to:i.to,decoration:gD})}},leave(e){e.name===`OrderedList`&&r.pop()}});return t.sort((e,t)=>e.from-t.from||e.to-t.to),at.set(t.map(e=>e.decoration.range(e.from,e.to)))}},hSe=pe.fromClass(mSe,{decorations:e=>e.decorations}),gSe=Ae.define([{tag:U.heading1,fontWeight:`bold`,fontSize:`1.75em`,lineHeight:`1.3`},{tag:U.heading2,fontWeight:`bold`,fontSize:`1.5em`,lineHeight:`1.3`},{tag:U.heading3,fontWeight:`bold`,fontSize:`1.25em`,lineHeight:`1.3`},{tag:U.heading4,fontWeight:`bold`,fontSize:`1.1em`},{tag:U.heading5,fontWeight:`bold`,fontSize:`1em`},{tag:U.heading6,fontWeight:`bold`,fontSize:`0.9em`,color:`var(--color-muted-foreground)`},{tag:U.strong,fontWeight:`bold`},{tag:U.emphasis,fontStyle:`italic`},{tag:U.link,color:`var(--color-primary, #3b82f6)`,textDecoration:`underline`},{tag:U.monospace,fontFamily:`var(--font-mono)`,padding:`1px 4px`},{tag:U.quote,color:`var(--color-muted-foreground)`,fontStyle:`italic`},{tag:U.strikethrough,textDecoration:`line-through`}]),_Se=Te.baseTheme({".cm-md-hidden":{display:`none`},".cm-line":{position:`relative`},".cm-md-codeblock":{backgroundColor:`color-mix(in srgb, currentColor 5%, transparent)`,borderRadius:`10px`,display:`block`,padding:`12px`,fontFamily:`ui-monospace, monospace`,fontSize:`0.9em`,border:`1px solid color-mix(in srgb, currentColor 12%, transparent)`},".cm-md-codeblock-line":{backgroundColor:`color-mix(in srgb, currentColor 4%, transparent)`,paddingInline:`4px`,marginBottom:0,marginInlineStart:`4px`},".cm-md-codeblock-line-start":{borderTopLeftRadius:`8px`,borderTopRightRadius:`8px`},".cm-md-codeblock-line-end":{borderBottomLeftRadius:`8px`,borderBottomRightRadius:`8px`,marginBottom:`6px`},".cm-md-codeblock-inactive":{opacity:.6},".cm-md-fence":{color:`color-mix(in srgb, currentColor 55%, transparent)`,letterSpacing:`0.03em`,fontWeight:600},".cm-md-link":{color:`var(--color-primary, #3b82f6)`,textDecoration:`underline`,cursor:`pointer`},".cm-md-image":{display:`inline-block`},".cm-md-olist":{color:`var(--color-muted-foreground)`,paddingRight:`0.35em`,fontVariantNumeric:`tabular-nums`},".cm-md-olist.cm-md-olist-faded":{color:`color-mix(in srgb, currentColor 45%, transparent)`},".cm-md-faded":{color:`color-mix(in srgb, currentColor 40%, transparent)`,opacity:.55},".cm-md-task":{display:`inline-block`,width:`0.95em`,height:`0.95em`,borderRadius:`3px`,border:`1px solid color-mix(in srgb, currentColor 30%, transparent)`,marginRight:`0.35em`,background:`color-mix(in srgb, var(--background) 80%, transparent)`},".cm-md-task-checked":{background:`color-mix(in srgb, var(--primary) 35%, transparent)`,borderColor:`color-mix(in srgb, var(--primary) 60%, transparent)`,position:`relative`},".cm-md-task-checked::after":{content:`""`,position:`absolute`,inset:`0.6px 3px 2.4px 3px`,borderBottom:`2px solid var(--background)`,borderRight:`2px solid var(--background)`,transform:`rotate(35deg)`,opacity:.9},".cm-md-task-faded":{opacity:.55},".cm-md-ulmark":{color:`oklch(0.18 0 0)`,fontWeight:700,paddingRight:`0.2em`},".cm-line:has(.tok-quote)":{borderLeft:`3px solid color-mix(in srgb, currentColor 30%, transparent)`,paddingLeft:`12px`}});function vSe(){return[hSe,ve(gSe),_Se]}var ySe=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=yD(e.state,n.from);return r.line?bSe(e):r.block?SSe(e):!1};function vD(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var bSe=vD(TSe,0),xSe=vD(xD,0),SSe=vD((e,t)=>xD(e,t,wSe(t)),0);function yD(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var bD=50;function CSe(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-bD,r),o=e.sliceDoc(i,i+bD),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*bD?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+bD),d=e.sliceDoc(i-bD,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:/\s/.test(u.charAt(f+t.length))?1:0},close:{pos:i-p-n.length,margin:/\s/.test(d.charAt(m-1))?1:0}}:null}function wSe(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function xD(e,t,n=t.selection.ranges){let r=n.map(e=>yD(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>CSe(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function TSe(e,t,n=t.selection.ranges){let r=[],i=-1;for(let{from:e,to:a}of n){let n=r.length,o=1e9,s=yD(t,e).line;if(s){for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var SD=Pe.define(),ESe=Pe.define(),DSe=Ke.define(),CD=Ke.define({combine(e){return ue(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),wD=it.define({create(){return PD.empty},update(e,t){let n=t.state.facet(CD),r=t.annotation(SD);if(r){let i=OD.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?kD(o,o.length,n.minDepth,i):MD(o,t.startState.selection),new PD(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(ESe);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(se.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=OD.fromTransaction(t),o=t.annotation(se.time),s=t.annotation(se.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new PD(e.done.map(OD.fromJSON),e.undone.map(OD.fromJSON))}});function OSe(e={}){return[wD,CD.of(e),Te.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?ED:e.inputType==`historyRedo`?DD:null;return n?(e.preventDefault(),n(t)):!1}})]}function TD(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(wD,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var ED=TD(0,!1),DD=TD(1,!1),kSe=TD(0,!0),ASe=TD(1,!0),OD=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&tt.fromJSON(t.changes),[],t.mapped&&Ge.fromJSON(t.mapped),t.startSelection&&Re.fromJSON(t.startSelection),t.selectionsAfter.map(Re.fromJSON))}static fromTransaction(t,n){let r=jD;for(let e of t.startState.facet(DSe)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,jD)}static selection(t){return new e(void 0,jD,void 0,void 0,t)}};function kD(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function jSe(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function MSe(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function AD(e,t){return e.length?t.length?e.concat(t):e:t}var jD=[],NSe=200;function MD(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-NSe));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),kD(e,e.length-1,1e9,n.setSelAfter(r)))}else return[OD.selection([t])]}function PSe(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function ND(e,t){if(!e.length)return e;let n=e.length,r=jD;for(;n;){let i=FSe(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[OD.selection(r)]:jD}function FSe(e,t,n){let r=AD(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):jD,n);if(!e.changes)return OD.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new OD(i,Ne.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var ISe=/^(input\.type|delete)($|\.)/,PD=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||ISe.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,jSe(s.changes,t.changes))||r==`input.type.compose`)?kD(o,o.length-1,i.minDepth,new OD(t.changes.compose(s.changes),AD(Ne.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,jD)):kD(o,o.length,i.minDepth,t),new e(o,jD,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:jD;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&MSe(a[a.length-1],t)?this:new e(MD(this.done,t),this.undone,n,r)}addMapping(t){return new e(ND(this.done,t),ND(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||t.selection;if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:SD.of({side:e,rest:PSe(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?jD:r.slice(0,r.length-1);return i.mapped&&(n=ND(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:SD.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};PD.empty=new PD(jD,jD);var LSe=[{key:`Mod-z`,run:ED,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:DD,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:DD,preventDefault:!0},{key:`Mod-u`,run:kSe,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:ASe,preventDefault:!0}];function FD(e,t){return Re.create(e.ranges.map(t),e.mainIndex)}function ID(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function LD({state:e,dispatch:t},n){let r=FD(e.selection,n);return r.eq(e.selection,!0)?!1:(t(ID(e,r)),!0)}function RD(e,t){return Re.cursor(t?e.to:e.from)}function zD(e,t){return LD(e,n=>n.empty?e.moveByChar(n,t):RD(n,t))}function BD(e){return e.textDirectionAt(e.state.selection.main.head)==oe.LTR}var VD=e=>zD(e,!BD(e)),HD=e=>zD(e,BD(e));function UD(e,t){return LD(e,n=>n.empty?e.moveByGroup(n,t):RD(n,t))}var RSe=e=>UD(e,!BD(e)),zSe=e=>UD(e,BD(e));typeof Intl<`u`&&Intl.Segmenter&&new Intl.Segmenter(void 0,{granularity:`word`});function BSe(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function WD(e,t,n){let r=de(e).resolveInner(t.head),i=n?He.closedBy:He.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;BSe(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?he(e,r.from,1):he(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,Re.cursor(s,n?-1:1)}var VSe=e=>LD(e,t=>WD(e.state,t,!BD(e))),HSe=e=>LD(e,t=>WD(e.state,t,BD(e)));function GD(e,t){return LD(e,n=>{if(!n.empty)return RD(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var KD=e=>GD(e,!1),qD=e=>GD(e,!0);function JD(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(Te.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function YD(e,t){let n=JD(e),{state:r}=e,i=FD(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):RD(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=Te.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(ID(r,i),{effects:a}),!0}var XD=e=>YD(e,!1),ZD=e=>YD(e,!0);function QD(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=Re.cursor(r.from+n))}return i}var USe=e=>LD(e,t=>QD(e,t,!0)),WSe=e=>LD(e,t=>QD(e,t,!1)),GSe=e=>LD(e,t=>QD(e,t,!BD(e))),KSe=e=>LD(e,t=>QD(e,t,BD(e))),qSe=e=>LD(e,t=>Re.cursor(e.lineBlockAt(t.head).from,1)),JSe=e=>LD(e,t=>Re.cursor(e.lineBlockAt(t.head).to,-1));function YSe(e,t,n){let r=!1,i=FD(e.selection,t=>{let i=he(e,t.head,-1)||he(e,t.head,1)||t.head>0&&he(e,t.head-1,1)||t.head<e.doc.length&&he(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?Re.range(t.anchor,a):Re.cursor(a)});return r?(t(ID(e,i)),!0):!1}var XSe=({state:e,dispatch:t})=>YSe(e,t,!1);function $D(e,t){let n=FD(e.state.selection,e=>{let n=t(e);return Re.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(ID(e.state,n)),!0)}function eO(e,t){return $D(e,n=>e.moveByChar(n,t))}var tO=e=>eO(e,!BD(e)),nO=e=>eO(e,BD(e));function rO(e,t){return $D(e,n=>e.moveByGroup(n,t))}var ZSe=e=>rO(e,!BD(e)),QSe=e=>rO(e,BD(e)),$Se=e=>$D(e,t=>WD(e.state,t,!BD(e))),eCe=e=>$D(e,t=>WD(e.state,t,BD(e)));function iO(e,t){return $D(e,n=>e.moveVertically(n,t))}var aO=e=>iO(e,!1),oO=e=>iO(e,!0);function sO(e,t){return $D(e,n=>e.moveVertically(n,t,JD(e).height))}var cO=e=>sO(e,!1),lO=e=>sO(e,!0),tCe=e=>$D(e,t=>QD(e,t,!0)),nCe=e=>$D(e,t=>QD(e,t,!1)),rCe=e=>$D(e,t=>QD(e,t,!BD(e))),iCe=e=>$D(e,t=>QD(e,t,BD(e))),aCe=e=>$D(e,t=>Re.cursor(e.lineBlockAt(t.head).from)),oCe=e=>$D(e,t=>Re.cursor(e.lineBlockAt(t.head).to)),uO=({state:e,dispatch:t})=>(t(ID(e,{anchor:0})),!0),dO=({state:e,dispatch:t})=>(t(ID(e,{anchor:e.doc.length})),!0),fO=({state:e,dispatch:t})=>(t(ID(e,{anchor:e.selection.main.anchor,head:0})),!0),pO=({state:e,dispatch:t})=>(t(ID(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),mO=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),sCe=({state:e,dispatch:t})=>{let n=CO(e).map(({from:t,to:n})=>Re.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:Re.create(n),userEvent:`select`})),!0},cCe=({state:e,dispatch:t})=>{let n=FD(e.selection,t=>{let n=de(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return Re.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(ID(e,n)),!0)};function hO(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(ID(n,Re.create(i,i.length-1))),!0)}var lCe=e=>hO(e,!1),uCe=e=>hO(e,!0),dCe=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Re.create([n.main]):n.main.empty||(r=Re.create([Re.cursor(n.main.head)])),r?(t(ID(e,r)),!0):!1};function gO(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=_O(e,o,!1)):o>i&&(n=`delete.forward`,o=_O(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=_O(e,i,!1),a=_O(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:Re.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?Te.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function _O(e,t,n){if(e instanceof Te)for(let r of e.state.facet(Te.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var vO=(e,t,n)=>gO(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=ce(s,a.tabSize)%Se(a)||Se(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=_e(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=_e(o.text,c-o.from,!1,!1)+o.from);return c}),yO=e=>vO(e,!1,!0),bO=e=>vO(e,!0,!1),xO=(e,t)=>gO(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=_e(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),SO=e=>xO(e,!1),fCe=e=>xO(e,!0),pCe=e=>gO(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),mCe=e=>gO(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),hCe=e=>gO(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),gCe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:xe.of([``,``])},range:Re.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},_Ce=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:_e(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:_e(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:Re.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function CO(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function wO(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of CO(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(Re.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(Re.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:Re.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var vCe=({state:e,dispatch:t})=>wO(e,t,!1),yCe=({state:e,dispatch:t})=>wO(e,t,!0);function TO(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of CO(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:r,scrollIntoView:!0,userEvent:`input.copyline`})),!0}var bCe=({state:e,dispatch:t})=>TO(e,t,!1),xCe=({state:e,dispatch:t})=>TO(e,t,!0),SCe=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(CO(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=FD(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function CCe(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=de(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(He.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var EO=DO(!1),wCe=DO(!0);function DO(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&CCe(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new Je(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=le(s,r);for(c??=ce(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,Ue(t,c)];return o&&l.push(Ue(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:xe.of(l)},range:Re.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function OO(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:Re.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var TCe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Je(e,{overrideIndentation:e=>n[e]??-1}),i=OO(e,(t,i,a)=>{let o=le(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=Ue(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},kO=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(OO(e,(t,n)=>{n.push({from:t.from,insert:e.facet(ae)})}),{userEvent:`input.indent`})),!0),AO=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(OO(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=ce(r,e.tabSize),a=0,o=Ue(e,Math.max(0,i-Se(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),ECe=e=>(e.setTabFocusMode(),!0),DCe=[{key:`Ctrl-b`,run:VD,shift:tO,preventDefault:!0},{key:`Ctrl-f`,run:HD,shift:nO},{key:`Ctrl-p`,run:KD,shift:aO},{key:`Ctrl-n`,run:qD,shift:oO},{key:`Ctrl-a`,run:qSe,shift:aCe},{key:`Ctrl-e`,run:JSe,shift:oCe},{key:`Ctrl-d`,run:bO},{key:`Ctrl-h`,run:yO},{key:`Ctrl-k`,run:pCe},{key:`Ctrl-Alt-h`,run:SO},{key:`Ctrl-o`,run:gCe},{key:`Ctrl-t`,run:_Ce},{key:`Ctrl-v`,run:ZD}],OCe=[{key:`ArrowLeft`,run:VD,shift:tO,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:RSe,shift:ZSe,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:GSe,shift:rCe,preventDefault:!0},{key:`ArrowRight`,run:HD,shift:nO,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:zSe,shift:QSe,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:KSe,shift:iCe,preventDefault:!0},{key:`ArrowUp`,run:KD,shift:aO,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:uO,shift:fO},{mac:`Ctrl-ArrowUp`,run:XD,shift:cO},{key:`ArrowDown`,run:qD,shift:oO,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:dO,shift:pO},{mac:`Ctrl-ArrowDown`,run:ZD,shift:lO},{key:`PageUp`,run:XD,shift:cO},{key:`PageDown`,run:ZD,shift:lO},{key:`Home`,run:WSe,shift:nCe,preventDefault:!0},{key:`Mod-Home`,run:uO,shift:fO},{key:`End`,run:USe,shift:tCe,preventDefault:!0},{key:`Mod-End`,run:dO,shift:pO},{key:`Enter`,run:EO,shift:EO},{key:`Mod-a`,run:mO},{key:`Backspace`,run:yO,shift:yO,preventDefault:!0},{key:`Delete`,run:bO,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:SO,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:fCe,preventDefault:!0},{mac:`Mod-Backspace`,run:mCe,preventDefault:!0},{mac:`Mod-Delete`,run:hCe,preventDefault:!0}].concat(DCe.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),kCe=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:VSe,shift:$Se},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:HSe,shift:eCe},{key:`Alt-ArrowUp`,run:vCe},{key:`Shift-Alt-ArrowUp`,run:bCe},{key:`Alt-ArrowDown`,run:yCe},{key:`Shift-Alt-ArrowDown`,run:xCe},{key:`Mod-Alt-ArrowUp`,run:lCe},{key:`Mod-Alt-ArrowDown`,run:uCe},{key:`Escape`,run:dCe},{key:`Mod-Enter`,run:wCe},{key:`Alt-l`,mac:`Ctrl-l`,run:sCe},{key:`Mod-i`,run:cCe,preventDefault:!0},{key:`Mod-[`,run:AO},{key:`Mod-]`,run:kO},{key:`Mod-Alt-\\`,run:TCe},{key:`Shift-Mod-k`,run:SCe},{key:`Shift-Mod-\\`,run:XSe},{key:`Mod-/`,run:ySe},{key:`Alt-A`,run:xSe},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:ECe}].concat(OCe),ACe={key:`Tab`,run:kO,shift:AO};function Z(e){return new et(Le.define(e))}function jO(e){return c(()=>import(`./dist-DBANUHCV.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([26,27,28]))}var MO=[W.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return c(()=>import(`./dist-ut4rUQ9T.js`).then(e=>e.cpp()),__vite__mapDeps([29,28]))}}),W.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return c(()=>import(`./dist-ut4rUQ9T.js`).then(e=>e.cpp()),__vite__mapDeps([29,28]))}}),W.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return jO(`Cassandra`)}}),W.of({name:`CSS`,extensions:[`css`],load(){return c(()=>import(`./dist-DOslja1j.js`).then(e=>e.i).then(e=>e.css()),__vite__mapDeps([30,1,28]))}}),W.of({name:`Go`,extensions:[`go`],load(){return c(()=>import(`./dist-BqFNCcID.js`).then(e=>e.go()),__vite__mapDeps([31,27,28]))}}),W.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return c(()=>import(`./dist-BElax2Cc.js`).then(e=>e.t).then(e=>e.html()),__vite__mapDeps([32,1,30,28,33,27]))}}),W.of({name:`Java`,extensions:[`java`],load(){return c(()=>import(`./dist-ChBF8Kxw.js`).then(e=>e.java()),__vite__mapDeps([34,28]))}}),W.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return c(()=>import(`./dist-B_gB7iV-.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([33,1,27,28]))}}),W.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return c(()=>import(`./dist-CdyeiNbL.js`).then(e=>e.jinja()),__vite__mapDeps([35,30,1,28,32,33,27]))}}),W.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return c(()=>import(`./dist-BTEspn1S.js`).then(e=>e.t).then(e=>e.json()),__vite__mapDeps([36,1,28]))}}),W.of({name:`JSX`,extensions:[`jsx`],load(){return c(()=>import(`./dist-B_gB7iV-.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([33,1,27,28]))}}),W.of({name:`LESS`,extensions:[`less`],load(){return c(()=>import(`./dist-BTDPzESP.js`).then(e=>e.less()),__vite__mapDeps([37,30,1,28]))}}),W.of({name:`Liquid`,extensions:[`liquid`],load(){return c(()=>import(`./dist-DiDQaVUl.js`).then(e=>e.liquid()),__vite__mapDeps([38,30,1,28,32,33,27]))}}),W.of({name:`MariaDB SQL`,load(){return jO(`MariaSQL`)}}),W.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return c(()=>import(`./dist-BPqKJ2jd.js`).then(e=>e.t).then(e=>e.markdown()),__vite__mapDeps([39,1,27,28,32,30,33]))}}),W.of({name:`MS SQL`,load(){return jO(`MSSQL`)}}),W.of({name:`MySQL`,load(){return jO(`MySQL`)}}),W.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return c(()=>import(`./dist-Cds2ol7_.js`).then(e=>e.php()),__vite__mapDeps([40,30,1,28,32,33,27]))}}),W.of({name:`PLSQL`,extensions:[`pls`],load(){return jO(`PLSQL`)}}),W.of({name:`PostgreSQL`,load(){return jO(`PostgreSQL`)}}),W.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return c(()=>import(`./dist-DcxAxgyr.js`).then(e=>e.python()),__vite__mapDeps([41,27,28]))}}),W.of({name:`Rust`,extensions:[`rs`],load(){return c(()=>import(`./dist-DKJ1Q90V.js`).then(e=>e.rust()),__vite__mapDeps([42,28]))}}),W.of({name:`Sass`,extensions:[`sass`],load(){return c(()=>import(`./dist-H4lUSqHM.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([43,30,1,28]))}}),W.of({name:`SCSS`,extensions:[`scss`],load(){return c(()=>import(`./dist-H4lUSqHM.js`).then(e=>e.sass()),__vite__mapDeps([43,30,1,28]))}}),W.of({name:`SQL`,extensions:[`sql`],load(){return jO(`StandardSQL`)}}),W.of({name:`SQLite`,load(){return jO(`SQLite`)}}),W.of({name:`TSX`,extensions:[`tsx`],load(){return c(()=>import(`./dist-B_gB7iV-.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([33,1,27,28]))}}),W.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return c(()=>import(`./dist-B_gB7iV-.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([33,1,27,28]))}}),W.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return c(()=>import(`./dist-CUBTZf4H.js`).then(e=>e.wast()),__vite__mapDeps([44,28]))}}),W.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return c(()=>import(`./dist-CcJiXGmU.js`).then(e=>e.xml()),__vite__mapDeps([45,28]))}}),W.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return c(()=>import(`./dist-B_cOSPGy.js`).then(e=>e.t).then(e=>e.yaml()),__vite__mapDeps([46,1,28]))}}),W.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return c(()=>import(`./apl-BKE9LS24.js`).then(e=>Z(e.apl)),[])}}),W.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return c(()=>import(`./asciiarmor-DkXJ9hXf.js`).then(e=>Z(e.asciiArmor)),[])}}),W.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return c(()=>import(`./asn1-C6HuKByb.js`).then(e=>Z(e.asn1({}))),[])}}),W.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return c(()=>import(`./asterisk-Bp0w-cpJ.js`).then(e=>Z(e.asterisk)),[])}}),W.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return c(()=>import(`./brainfuck-BNc1KEem.js`).then(e=>Z(e.brainfuck)),[])}}),W.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return c(()=>import(`./cobol-CZKLUtpg.js`).then(e=>Z(e.cobol)),[])}}),W.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return c(()=>import(`./clike-DgL3SNQH.js`).then(e=>Z(e.csharp)),[])}}),W.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return c(()=>import(`./clojure-DrsR_fQG.js`).then(e=>Z(e.clojure)),[])}}),W.of({name:`ClojureScript`,extensions:[`cljs`],load(){return c(()=>import(`./clojure-DrsR_fQG.js`).then(e=>Z(e.clojure)),[])}}),W.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return c(()=>import(`./css-D4EwD1Ce.js`).then(e=>Z(e.gss)),[])}}),W.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return c(()=>import(`./cmake-DbJBMKw8.js`).then(e=>Z(e.cmake)),[])}}),W.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return c(()=>import(`./coffeescript-CDvGdAFe.js`).then(e=>Z(e.coffeeScript)),[])}}),W.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return c(()=>import(`./commonlisp-B5qPm-cW.js`).then(e=>Z(e.commonLisp)),[])}}),W.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return c(()=>import(`./cypher-CCGdR5gv.js`).then(e=>Z(e.cypher)),[])}}),W.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return c(()=>import(`./python-Cn5NMrFO.js`).then(e=>Z(e.cython)),[])}}),W.of({name:`Crystal`,extensions:[`cr`],load(){return c(()=>import(`./crystal-CWUxUKwE.js`).then(e=>Z(e.crystal)),[])}}),W.of({name:`D`,extensions:[`d`],load(){return c(()=>import(`./d-CAX17L1u.js`).then(e=>Z(e.d)),[])}}),W.of({name:`Dart`,extensions:[`dart`],load(){return c(()=>import(`./clike-DgL3SNQH.js`).then(e=>Z(e.dart)),[])}}),W.of({name:`diff`,extensions:[`diff`,`patch`],load(){return c(()=>import(`./diff-CN7BS8el.js`).then(e=>Z(e.diff)),[])}}),W.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return c(()=>import(`./dockerfile-h2epc4Vl.js`).then(e=>Z(e.dockerFile)),__vite__mapDeps([47,48]))}}),W.of({name:`DTD`,extensions:[`dtd`],load(){return c(()=>import(`./dtd-ZYymx13B.js`).then(e=>Z(e.dtd)),[])}}),W.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return c(()=>import(`./dylan-DItIDmyF.js`).then(e=>Z(e.dylan)),[])}}),W.of({name:`EBNF`,load(){return c(()=>import(`./ebnf-Dp6t8CzF.js`).then(e=>Z(e.ebnf)),[])}}),W.of({name:`ECL`,extensions:[`ecl`],load(){return c(()=>import(`./ecl-VLH9srnJ.js`).then(e=>Z(e.ecl)),[])}}),W.of({name:`edn`,extensions:[`edn`],load(){return c(()=>import(`./clojure-DrsR_fQG.js`).then(e=>Z(e.clojure)),[])}}),W.of({name:`Eiffel`,extensions:[`e`],load(){return c(()=>import(`./eiffel-BJ8iJE6v.js`).then(e=>Z(e.eiffel)),[])}}),W.of({name:`Elm`,extensions:[`elm`],load(){return c(()=>import(`./elm-CtgpLLRi.js`).then(e=>Z(e.elm)),[])}}),W.of({name:`Erlang`,extensions:[`erl`],load(){return c(()=>import(`./erlang-Y5dUBExs.js`).then(e=>Z(e.erlang)),[])}}),W.of({name:`Esper`,load(){return c(()=>import(`./sql-CVRvDkss.js`).then(e=>Z(e.esper)),[])}}),W.of({name:`Factor`,extensions:[`factor`],load(){return c(()=>import(`./factor-CeOkG9eA.js`).then(e=>Z(e.factor)),__vite__mapDeps([49,48]))}}),W.of({name:`FCL`,load(){return c(()=>import(`./fcl-B2IFvv48.js`).then(e=>Z(e.fcl)),[])}}),W.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return c(()=>import(`./forth-BuhLGLeY.js`).then(e=>Z(e.forth)),[])}}),W.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return c(()=>import(`./fortran-DO9Km__o.js`).then(e=>Z(e.fortran)),[])}}),W.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return c(()=>import(`./mllike-CsS4TnAs.js`).then(e=>Z(e.fSharp)),[])}}),W.of({name:`Gas`,extensions:[`s`],load(){return c(()=>import(`./gas-FhG4DzpI.js`).then(e=>Z(e.gas)),[])}}),W.of({name:`Gherkin`,extensions:[`feature`],load(){return c(()=>import(`./gherkin-DSXbgBKm.js`).then(e=>Z(e.gherkin)),[])}}),W.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return c(()=>import(`./groovy-66vp8M_4.js`).then(e=>Z(e.groovy)),[])}}),W.of({name:`Haskell`,extensions:[`hs`],load(){return c(()=>import(`./haskell-BNrHMW3N.js`).then(e=>Z(e.haskell)),[])}}),W.of({name:`Haxe`,extensions:[`hx`],load(){return c(()=>import(`./haxe-Z426XPce.js`).then(e=>Z(e.haxe)),[])}}),W.of({name:`HXML`,extensions:[`hxml`],load(){return c(()=>import(`./haxe-Z426XPce.js`).then(e=>Z(e.hxml)),[])}}),W.of({name:`HTTP`,load(){return c(()=>import(`./http-BSn9Z-ZR.js`).then(e=>Z(e.http)),[])}}),W.of({name:`IDL`,extensions:[`pro`],load(){return c(()=>import(`./idl-Cb7mJeSz.js`).then(e=>Z(e.idl)),[])}}),W.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return c(()=>import(`./javascript-WdgH9bdJ.js`).then(e=>Z(e.jsonld)),[])}}),W.of({name:`Julia`,extensions:[`jl`],load(){return c(()=>import(`./julia-Ds0XkmdJ.js`).then(e=>Z(e.julia)),[])}}),W.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return c(()=>import(`./clike-DgL3SNQH.js`).then(e=>Z(e.kotlin)),[])}}),W.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return c(()=>import(`./livescript-CRPiQinm.js`).then(e=>Z(e.liveScript)),[])}}),W.of({name:`Lua`,extensions:[`lua`],load(){return c(()=>import(`./lua-IdgYy2u2.js`).then(e=>Z(e.lua)),[])}}),W.of({name:`mIRC`,extensions:[`mrc`],load(){return c(()=>import(`./mirc-UFVahi7q.js`).then(e=>Z(e.mirc)),[])}}),W.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return c(()=>import(`./mathematica-IApmD8uq.js`).then(e=>Z(e.mathematica)),[])}}),W.of({name:`Modelica`,extensions:[`mo`],load(){return c(()=>import(`./modelica-DTQIlea0.js`).then(e=>Z(e.modelica)),[])}}),W.of({name:`MUMPS`,extensions:[`mps`],load(){return c(()=>import(`./mumps-C3RKfAvl.js`).then(e=>Z(e.mumps)),[])}}),W.of({name:`Mbox`,extensions:[`mbox`],load(){return c(()=>import(`./mbox-s0Ui7kYt.js`).then(e=>Z(e.mbox)),[])}}),W.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return c(()=>import(`./nginx-C-9gPoJT.js`).then(e=>Z(e.nginx)),[])}}),W.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return c(()=>import(`./nsis-CquHxL-A.js`).then(e=>Z(e.nsis)),__vite__mapDeps([50,48]))}}),W.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return c(()=>import(`./ntriples-61AWsLi8.js`).then(e=>Z(e.ntriples)),[])}}),W.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return c(()=>import(`./clike-DgL3SNQH.js`).then(e=>Z(e.objectiveC)),[])}}),W.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return c(()=>import(`./clike-DgL3SNQH.js`).then(e=>Z(e.objectiveCpp)),[])}}),W.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return c(()=>import(`./mllike-CsS4TnAs.js`).then(e=>Z(e.oCaml)),[])}}),W.of({name:`Octave`,extensions:[`m`],load(){return c(()=>import(`./octave-CImB10Oa.js`).then(e=>Z(e.octave)),[])}}),W.of({name:`Oz`,extensions:[`oz`],load(){return c(()=>import(`./oz-CoMW3YsZ.js`).then(e=>Z(e.oz)),[])}}),W.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return c(()=>import(`./pascal-gRvWM2Zf.js`).then(e=>Z(e.pascal)),[])}}),W.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return c(()=>import(`./perl-e6CciIHG.js`).then(e=>Z(e.perl)),[])}}),W.of({name:`Pig`,extensions:[`pig`],load(){return c(()=>import(`./pig-DoD9VE0T.js`).then(e=>Z(e.pig)),[])}}),W.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return c(()=>import(`./powershell-ilvKGdhZ.js`).then(e=>Z(e.powerShell)),[])}}),W.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return c(()=>import(`./properties-D3eBXfhu.js`).then(e=>Z(e.properties)),[])}}),W.of({name:`ProtoBuf`,extensions:[`proto`],load(){return c(()=>import(`./protobuf-CT1o550N.js`).then(e=>Z(e.protobuf)),[])}}),W.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return c(()=>import(`./pug-HlPEUn3L.js`).then(e=>Z(e.pug)),__vite__mapDeps([51,52]))}}),W.of({name:`Puppet`,extensions:[`pp`],load(){return c(()=>import(`./puppet-CN0SHbqs.js`).then(e=>Z(e.puppet)),[])}}),W.of({name:`Q`,extensions:[`q`],load(){return c(()=>import(`./q-BI4ez1QN.js`).then(e=>Z(e.q)),[])}}),W.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return c(()=>import(`./r-BCz567Y3.js`).then(e=>Z(e.r)),[])}}),W.of({name:`RPM Changes`,load(){return c(()=>import(`./rpm-Dct3sv7t.js`).then(e=>Z(e.rpmChanges)),[])}}),W.of({name:`RPM Spec`,extensions:[`spec`],load(){return c(()=>import(`./rpm-Dct3sv7t.js`).then(e=>Z(e.rpmSpec)),[])}}),W.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return c(()=>import(`./ruby-DjfgNRte.js`).then(e=>Z(e.ruby)),[])}}),W.of({name:`SAS`,extensions:[`sas`],load(){return c(()=>import(`./sas-xmDiF03T.js`).then(e=>Z(e.sas)),[])}}),W.of({name:`Scala`,extensions:[`scala`],load(){return c(()=>import(`./clike-DgL3SNQH.js`).then(e=>Z(e.scala)),[])}}),W.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return c(()=>import(`./scheme-CeyAY5mz.js`).then(e=>Z(e.scheme)),[])}}),W.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return c(()=>import(`./shell-Cma2QP-4.js`).then(e=>Z(e.shell)),[])}}),W.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return c(()=>import(`./sieve-DfYITjoF.js`).then(e=>Z(e.sieve)),[])}}),W.of({name:`Smalltalk`,extensions:[`st`],load(){return c(()=>import(`./smalltalk-C67u_J0B.js`).then(e=>Z(e.smalltalk)),[])}}),W.of({name:`Solr`,load(){return c(()=>import(`./solr-DuhjiPeb.js`).then(e=>Z(e.solr)),[])}}),W.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return c(()=>import(`./mllike-CsS4TnAs.js`).then(e=>Z(e.sml)),[])}}),W.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return c(()=>import(`./sparql-CJE67vaw.js`).then(e=>Z(e.sparql)),[])}}),W.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return c(()=>import(`./spreadsheet-DSuKGWYs.js`).then(e=>Z(e.spreadsheet)),[])}}),W.of({name:`Squirrel`,extensions:[`nut`],load(){return c(()=>import(`./clike-DgL3SNQH.js`).then(e=>Z(e.squirrel)),[])}}),W.of({name:`Stylus`,extensions:[`styl`],load(){return c(()=>import(`./stylus-DBxuuJ-q.js`).then(e=>Z(e.stylus)),[])}}),W.of({name:`Swift`,extensions:[`swift`],load(){return c(()=>import(`./swift-Sko2phaX.js`).then(e=>Z(e.swift)),[])}}),W.of({name:`sTeX`,load(){return c(()=>import(`./stex-ClD5ew9u.js`).then(e=>Z(e.stex)),[])}}),W.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return c(()=>import(`./stex-ClD5ew9u.js`).then(e=>Z(e.stex)),[])}}),W.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return c(()=>import(`./verilog-f9ocpVTE.js`).then(e=>Z(e.verilog)),[])}}),W.of({name:`Tcl`,extensions:[`tcl`],load(){return c(()=>import(`./tcl-DBI_Khes.js`).then(e=>Z(e.tcl)),[])}}),W.of({name:`Textile`,extensions:[`textile`],load(){return c(()=>import(`./textile-B4wNTFJ8.js`).then(e=>Z(e.textile)),[])}}),W.of({name:`TiddlyWiki`,load(){return c(()=>import(`./tiddlywiki-CSTzQu8J.js`).then(e=>Z(e.tiddlyWiki)),[])}}),W.of({name:`Tiki wiki`,load(){return c(()=>import(`./tiki-Dhr61U2N.js`).then(e=>Z(e.tiki)),[])}}),W.of({name:`TOML`,extensions:[`toml`],load(){return c(()=>import(`./toml-B2qVDGgJ.js`).then(e=>Z(e.toml)),[])}}),W.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return c(()=>import(`./troff-C3ZMwCMN.js`).then(e=>Z(e.troff)),[])}}),W.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return c(()=>import(`./ttcn-aR7mbZm6.js`).then(e=>Z(e.ttcn)),[])}}),W.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return c(()=>import(`./ttcn-cfg-8E3RA6Hy.js`).then(e=>Z(e.ttcnCfg)),[])}}),W.of({name:`Turtle`,extensions:[`ttl`],load(){return c(()=>import(`./turtle-DsAwg0Jx.js`).then(e=>Z(e.turtle)),[])}}),W.of({name:`Web IDL`,extensions:[`webidl`],load(){return c(()=>import(`./webidl-DRD6HN-7.js`).then(e=>Z(e.webIDL)),[])}}),W.of({name:`VB.NET`,extensions:[`vb`],load(){return c(()=>import(`./vb-Kgyv2pwt.js`).then(e=>Z(e.vb)),[])}}),W.of({name:`VBScript`,extensions:[`vbs`],load(){return c(()=>import(`./vbscript-CxO9TPBS.js`).then(e=>Z(e.vbScript)),[])}}),W.of({name:`Velocity`,extensions:[`vtl`],load(){return c(()=>import(`./velocity-DwmfupaX.js`).then(e=>Z(e.velocity)),[])}}),W.of({name:`Verilog`,extensions:[`v`],load(){return c(()=>import(`./verilog-f9ocpVTE.js`).then(e=>Z(e.verilog)),[])}}),W.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return c(()=>import(`./vhdl-B8lXGu5-.js`).then(e=>Z(e.vhdl)),[])}}),W.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return c(()=>import(`./xquery-CcAVZjdY.js`).then(e=>Z(e.xQuery)),[])}}),W.of({name:`Yacas`,extensions:[`ys`],load(){return c(()=>import(`./yacas-Do3HUHmu.js`).then(e=>Z(e.yacas)),[])}}),W.of({name:`Z80`,extensions:[`z80`],load(){return c(()=>import(`./z80-DRVAVfQB.js`).then(e=>Z(e.z80)),[])}}),W.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return c(()=>import(`./mscgen-Df4T1TPF.js`).then(e=>Z(e.mscgen)),[])}}),W.of({name:`Xù`,extensions:[`xu`],load(){return c(()=>import(`./mscgen-Df4T1TPF.js`).then(e=>Z(e.xu)),[])}}),W.of({name:`MsGenny`,extensions:[`msgenny`],load(){return c(()=>import(`./mscgen-Df4T1TPF.js`).then(e=>Z(e.msgenny)),[])}}),W.of({name:`Vue`,extensions:[`vue`],load(){return c(()=>import(`./dist-BfbneuyF.js`).then(e=>e.vue()),__vite__mapDeps([53,30,1,28,32,33,27]))}}),W.of({name:`Angular Template`,load(){return c(()=>import(`./dist-CuICAqXS.js`).then(e=>e.angular()),__vite__mapDeps([54,30,1,28,32,33,27]))}})],NO={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},jCe={borderLeftWidth:`2px`},PO={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},FO={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},IO={border:`none`,borderRadius:`4px`,padding:`2px 10px`},MCe={borderRadius:`2px`},LO={borderRadius:`2px`},RO={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},zO={width:`12px`,height:`12px`,borderRadius:`6px`},BO={borderRadius:`4px`,padding:`2px 6px`},VO={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},HO=`#0d1117`,UO=`#c9d1d9`,WO=`#264F78`,GO=`#8b949e`,KO=`#ffffff`,qO=`#7ee787`,JO=`#d2a8ff`,YO=`#79c0ff`,XO=`#ff7b72`,ZO=`#a5d6ff`,NCe=`#2c333a`,PCe=`#3c444d`,QO=`#ffab70`,$O=`#161b22`,ek=`#30363d`,FCe=`#21262d`,tk=`#f97583`,ICe=`#2d333b1a`,nk=`#21262d`,rk=KO,ik=WO,LCe=`#3a587a75`,ak=`#4d90fe`,ok=`#d29922`,RCe=`#3a587a55`,sk=`#58a6ff`,zCe=`#bc8cff`,ck=`#2ea04350`,lk=`#f8514940`,uk=`#7ee787`,dk=`#ff7b72`,fk=[Te.theme({"&":{color:UO,backgroundColor:HO,fontSize:NO.fontSize,fontFamily:NO.fontFamily},".cm-content":{caretColor:rk,lineHeight:NO.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:rk,borderLeftWidth:jCe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${rk}99`,color:HO},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ik},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#3a587a`,outline:`1px solid ${YO}`,color:UO,borderRadius:BO.borderRadius,"& span":{color:UO}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ak,color:KO,padding:BO.padding,"& span":{color:KO}},".cm-search.cm-panel.cm-textfield":{color:UO,borderRadius:BO.borderRadius,padding:BO.padding},".cm-panels":{backgroundColor:nk,color:UO,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${ek}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${ek}`},".cm-panel button":{backgroundColor:nk,color:UO,border:IO.border,borderRadius:IO.borderRadius,padding:IO.padding},".cm-panel button:hover":{backgroundColor:NCe},".cm-activeLine":{backgroundColor:ICe,borderRadius:MCe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:$O,color:GO,border:FO.border,borderRight:`1px solid #30363d`,paddingRight:FO.paddingRight},".cm-activeLineGutter":{backgroundColor:FCe,color:UO,fontWeight:FO.fontWeight},".cm-lineNumbers":{fontSize:FO.fontSize,lineHeight:FO.lineHeight},".cm-foldGutter":{fontSize:FO.fontSize,lineHeight:FO.lineHeight},".cm-foldGutter .cm-gutterElement":{color:GO,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:UO},".cm-insertedLine":{textDecoration:PO.insertedTextDecoration,backgroundColor:ck,color:uk,padding:PO.insertedLinePadding,borderRadius:PO.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:PO.insertedTextDecoration,backgroundColor:`${ck} !important`,color:uk,padding:PO.insertedLinePadding,borderRadius:PO.borderRadious,border:`1px solid ${uk}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:PO.deletedTextDecoration,backgroundColor:lk,color:dk,padding:PO.insertedLinePadding,borderRadius:PO.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:PO.deletedTextDecoration,backgroundColor:`${lk} !important`,color:dk,padding:PO.insertedLinePadding,borderRadius:PO.borderRadious,border:`1px solid ${dk}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:nk,border:`1px solid ${ek}`,borderRadius:VO.borderRadius,padding:VO.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:nk,border:`none`},"& > ul > li":{padding:VO.padding,lineHeight:VO.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:ik,color:KO,borderRadius:VO.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:GO,paddingRight:VO.paddingRight},"& > ul > li > span.cm-completionDetail":{color:GO,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:nk,borderBottomColor:nk},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${tk}`},"&-warning":{borderLeft:`3px solid ${ok}`},"&-info":{borderLeft:`3px solid ${sk}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${tk}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${ok}`},".cm-matchingBracket":{backgroundColor:LCe,outline:`1px solid ${ak}`,borderRadius:LO.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#f9758340`,outline:`1px solid ${tk}`,borderRadius:LO.borderRadius},".cm-selectionMatch":{backgroundColor:RCe,outline:`1px solid ${WO}50`,borderRadius:LO.borderRadius},".cm-foldPlaceholder":{backgroundColor:nk,color:GO,border:`1px dotted ${ek}70`,borderRadius:RO.borderRadius,padding:RO.padding,margin:RO.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${HO}, 0 0 0 3px ${sk}40`},"& .cm-scroller::-webkit-scrollbar":{width:zO.width,height:zO.height},"& .cm-scroller::-webkit-scrollbar-track":{background:$O},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:ek,borderRadius:zO.borderRadius,border:`3px solid ${$O}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:PCe},".cm-ghostText":{opacity:`0.5`,color:GO}},{dark:!0}),ve(Ae.define([{tag:U.keyword,color:XO,fontWeight:`bold`},{tag:U.controlKeyword,color:XO,fontWeight:`bold`},{tag:U.moduleKeyword,color:XO,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:YO},{tag:[U.variableName],color:YO},{tag:[U.propertyName],color:JO,fontStyle:`normal`},{tag:[U.typeName],color:XO},{tag:[U.className],color:JO,fontStyle:`italic`},{tag:[U.namespace],color:YO,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:UO},{tag:[U.bracket],color:GO},{tag:[U.brace],color:GO},{tag:[U.punctuation],color:GO},{tag:[U.function(U.variableName),U.labelName],color:qO},{tag:[U.definition(U.variableName)],color:YO},{tag:U.number,color:QO},{tag:U.changed,color:QO},{tag:U.annotation,color:tk,fontStyle:`italic`},{tag:U.modifier,color:QO,fontStyle:`italic`},{tag:U.self,color:QO},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:QO},{tag:[U.atom,U.bool,U.special(U.variableName)],color:QO},{tag:[U.processingInstruction,U.inserted],color:qO},{tag:[U.special(U.string),U.regexp],color:ZO},{tag:U.string,color:ZO},{tag:U.definition(U.typeName),color:XO,fontWeight:`bold`},{tag:U.meta,color:GO},{tag:U.comment,fontStyle:`italic`,color:GO},{tag:U.docComment,fontStyle:`italic`,color:GO},{tag:[U.tagName],color:qO},{tag:[U.attributeName],color:JO},{tag:[U.heading],fontWeight:`bold`,color:YO},{tag:[U.strong],fontWeight:`bold`,color:YO},{tag:[U.emphasis],fontStyle:`italic`,color:ZO},{tag:[U.link],color:zCe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:sk,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:UO,textDecoration:`underline wavy`,borderBottom:`1px wavy ${tk}`},{tag:[U.strikethrough],color:tk,textDecoration:`line-through`},{tag:U.constant(U.name),color:QO},{tag:U.deleted,color:tk},{tag:U.squareBracket,color:GO},{tag:U.angleBracket,color:GO},{tag:U.monospace,color:UO},{tag:[U.contentSeparator],color:YO},{tag:U.quote,color:GO}]))],pk={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},BCe={borderLeftWidth:`2px`},mk={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},hk={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},gk={border:`none`,borderRadius:`4px`,padding:`2px 10px`},VCe={borderRadius:`2px`},_k={borderRadius:`2px`},vk={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},yk={width:`12px`,height:`12px`,borderRadius:`6px`},bk={borderRadius:`4px`,padding:`2px 6px`},xk={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},Sk=`#ffffff`,Ck=`#24292e`,wk=`#BBDFFF`,Tk=`#6e7781`,Ek=`#f6f8fa`,HCe=`#116329`,Dk=`#6a737d`,Ok=`#6f42c1`,kk=`#005cc5`,Ak=`#d73a49`,jk=`#032f62`,UCe=`#22863a`,Mk=`#e36209`,WCe=`#f1f8ff`,Nk=`#e1e4e8`,GCe=`#f8f9fa`,Pk=`#cb2431`,KCe=`#BBDFFF20`,Fk=GCe,Ik=Ck,qCe=wk,JCe=`#e8f0fe`,YCe=`#0366d6`,XCe=`#b08800`,ZCe=`#79b8ff40`,Lk=`#0969da`,QCe=`#8250df`,$Ce=`#e6ffec80`,ewe=`#ffebe980`,Rk=`#0f6d31`,zk=`#cf222e`,Bk=[Te.theme({"&":{color:Ck,backgroundColor:Sk,fontSize:pk.fontSize,fontFamily:pk.fontFamily},".cm-content":{caretColor:Ik,lineHeight:pk.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ik,borderLeftWidth:BCe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${Ik}99`,color:Sk},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:qCe,color:Ck},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#daebff`,outline:`1px solid ${kk}`,color:Ck,borderRadius:bk.borderRadius,"& span":{color:Ck}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#79b8ff`,color:Sk,padding:bk.padding,"& span":{color:Sk}},".cm-search.cm-panel.cm-textfield":{color:Ck,borderRadius:bk.borderRadius,padding:bk.padding},".cm-panels":{backgroundColor:Ek,color:Tk,borderRadius:`0 0 4px 4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${Nk}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${Nk}`},".cm-panel button":{backgroundColor:Sk,color:Ck,border:gk.border,borderRadius:gk.borderRadius,padding:gk.padding},".cm-panel button:hover":{backgroundColor:`#f5f5f5`},".cm-activeLine":{backgroundColor:KCe,borderRadius:VCe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:Ek,color:Tk,border:hk.border,borderRight:`1px solid ${Nk}`,paddingRight:hk.paddingRight},".cm-activeLineGutter":{backgroundColor:WCe,color:Ck,fontWeight:hk.fontWeight},".cm-lineNumbers":{fontSize:hk.fontSize,lineHeight:hk.lineHeight},".cm-foldGutter":{fontSize:hk.fontSize,lineHeight:hk.lineHeight},".cm-foldGutter .cm-gutterElement":{color:Tk,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:Ck},".cm-insertedLine":{textDecoration:mk.insertedTextDecoration,backgroundColor:$Ce,color:Rk,padding:mk.insertedLinePadding,borderRadius:mk.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:mk.insertedTextDecoration,backgroundColor:`${$Ce} !important`,color:Rk,padding:mk.insertedLinePadding,borderRadius:mk.borderRadious,border:`1px solid ${Rk}30`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:mk.deletedTextDecoration,backgroundColor:ewe,color:zk,padding:mk.insertedLinePadding,borderRadius:mk.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:mk.deletedTextDecoration,backgroundColor:`${ewe} !important`,color:zk,padding:mk.insertedLinePadding,borderRadius:mk.borderRadious,border:`1px solid ${zk}30`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:Fk,border:`1px solid ${Nk}`,borderRadius:xk.borderRadius,padding:xk.padding,boxShadow:`0 1px 5px rgba(0, 0, 0, 0.1)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:Fk,border:`none`},"& > ul > li":{padding:xk.padding,lineHeight:xk.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#0366d630`,color:Ck,borderRadius:xk.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:`#0366d615`},"& > ul > li > span.cm-completionIcon":{color:Tk,paddingRight:xk.paddingRight},"& > ul > li > span.cm-completionDetail":{color:Tk,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Fk,borderBottomColor:Fk},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${Pk}`},"&-warning":{borderLeft:`3px solid ${XCe}`},"&-info":{borderLeft:`3px solid ${Lk}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${Pk}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${XCe}`},".cm-matchingBracket":{backgroundColor:JCe,outline:`1px solid ${YCe}80`,borderRadius:_k.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#ffeef080`,outline:`1px solid ${Pk}`,borderRadius:_k.borderRadius},".cm-selectionMatch":{backgroundColor:ZCe,outline:`1px solid ${wk}50`,borderRadius:_k.borderRadius},".cm-foldPlaceholder":{backgroundColor:ZCe,color:Tk,border:`1px dotted ${Nk}70`,borderRadius:vk.borderRadius,padding:vk.padding,margin:vk.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${Sk}, 0 0 0 3px ${Lk}40`},"& .cm-scroller::-webkit-scrollbar":{width:yk.width,height:yk.height},"& .cm-scroller::-webkit-scrollbar-track":{background:Nk},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:Ck,borderRadius:yk.borderRadius,border:`3px solid ${Nk}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:Dk},".cm-ghostText":{opacity:`0.5`,color:`#959da5`}},{dark:!1}),ve(Ae.define([{tag:U.keyword,color:Ak,fontWeight:`bold`},{tag:U.controlKeyword,color:Ak,fontWeight:`bold`},{tag:U.moduleKeyword,color:Ak,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:kk},{tag:[U.variableName],color:kk},{tag:[U.propertyName],color:Ok,fontStyle:`normal`},{tag:[U.typeName],color:Ak},{tag:[U.className],color:Ok,fontStyle:`italic`},{tag:[U.namespace],color:kk,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:Ck},{tag:[U.bracket],color:Dk},{tag:[U.brace],color:Dk},{tag:[U.punctuation],color:Dk},{tag:[U.function(U.variableName),U.labelName],color:UCe},{tag:[U.definition(U.variableName)],color:kk},{tag:U.number,color:Mk},{tag:U.changed,color:Mk},{tag:U.annotation,color:Pk,fontStyle:`italic`},{tag:U.modifier,color:Mk,fontStyle:`italic`},{tag:U.self,color:Mk},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:Mk},{tag:[U.atom,U.bool,U.special(U.variableName)],color:Mk},{tag:[U.processingInstruction,U.inserted],color:UCe},{tag:[U.special(U.string),U.regexp],color:jk},{tag:U.string,color:jk},{tag:U.definition(U.typeName),color:Ak,fontWeight:`bold`},{tag:U.meta,color:Dk},{tag:U.comment,fontStyle:`italic`,color:Dk},{tag:U.docComment,fontStyle:`italic`,color:Dk},{tag:[U.tagName],color:HCe},{tag:[U.attributeName],color:Ok},{tag:[U.heading],fontWeight:`bold`,color:kk},{tag:[U.strong],fontWeight:`bold`,color:kk},{tag:[U.emphasis],fontStyle:`italic`,color:jk},{tag:[U.link],color:QCe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:Lk,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:Ck,textDecoration:`underline wavy`,borderBottom:`1px wavy ${Pk}`},{tag:[U.strikethrough],color:Pk,textDecoration:`line-through`},{tag:U.constant(U.name),color:Mk},{tag:U.deleted,color:Pk},{tag:U.squareBracket,color:Dk},{tag:U.angleBracket,color:Dk},{tag:U.monospace,color:Ck},{tag:[U.contentSeparator],color:kk},{tag:U.quote,color:Dk}]))],Vk={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},twe={borderLeftWidth:`2px`},Hk={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},Uk={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},Wk={border:`none`,borderRadius:`4px`,padding:`2px 10px`},nwe={borderRadius:`2px`},Gk={borderRadius:`2px`},Kk={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},qk={width:`12px`,height:`12px`,borderRadius:`6px`},Jk={borderRadius:`4px`,padding:`2px 6px`},Yk={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},Xk=`#282828`,Zk=`#3c3836`,Qk=`#504945`,$k=`#665c54`,rwe=`#7c6f64`,eA=`#928374`,tA=`#fbf1c7`,nA=`#ebdbb2`,rA=`#fb4934`,iA=`#b8bb26`,aA=`#fabd2f`,oA=`#83a598`,sA=`#d3869b`,cA=`#8ec07c`,lA=`#fe8019`,uA=rA,iwe=Zk,awe=`#3c383660`,owe=Xk,dA=Zk,fA=Qk,swe=`#665c5480`,pA=lA,cwe=`#504945cc`,lwe=aA,mA=aA,hA=oA,uwe=sA,gA=`#32361a80`,_A=`#3c1f1e80`,vA=`#b8bb26`,yA=`#fb4934`,dwe=[Te.theme({"&":{color:nA,backgroundColor:owe,fontSize:Vk.fontSize,fontFamily:Vk.fontFamily},".cm-content":{caretColor:pA,lineHeight:Vk.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:pA,borderLeftWidth:twe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${pA}99`,color:Xk},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:fA},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#b57614cc`,outline:`1px solid ${aA}`,color:tA,borderRadius:Jk.borderRadius,"& span":{color:tA}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:lA,color:Xk,padding:Jk.padding,"& span":{color:Xk}},".cm-search.cm-panel.cm-textfield":{color:nA,borderRadius:Jk.borderRadius,padding:Jk.padding},".cm-panels":{backgroundColor:dA,color:nA,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${$k}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${$k}`},".cm-panel button":{backgroundColor:dA,color:nA,border:Wk.border,borderRadius:Wk.borderRadius,padding:Wk.padding},".cm-panel button:hover":{backgroundColor:Qk},".cm-activeLine":{backgroundColor:awe,borderRadius:nwe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:Zk,color:eA,border:Uk.border,borderRight:`1px solid ${Qk}`,paddingRight:Uk.paddingRight},".cm-activeLineGutter":{backgroundColor:iwe,color:nA,fontWeight:Uk.fontWeight},".cm-lineNumbers":{fontSize:Uk.fontSize,lineHeight:Uk.lineHeight},".cm-foldGutter":{fontSize:Uk.fontSize,lineHeight:Uk.lineHeight},".cm-foldGutter .cm-gutterElement":{color:eA,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:nA},".cm-insertedLine":{textDecoration:Hk.insertedTextDecoration,backgroundColor:gA,color:vA,padding:Hk.insertedLinePadding,borderRadius:Hk.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:Hk.insertedTextDecoration,backgroundColor:`${gA} !important`,color:vA,padding:Hk.insertedLinePadding,borderRadius:Hk.borderRadious,border:`1px solid ${vA}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:Hk.deletedTextDecoration,backgroundColor:_A,color:yA,padding:Hk.insertedLinePadding,borderRadius:Hk.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:Hk.deletedTextDecoration,backgroundColor:`${_A} !important`,color:yA,padding:Hk.insertedLinePadding,borderRadius:Hk.borderRadious,border:`1px solid ${yA}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:dA,border:`1px solid ${$k}`,borderRadius:Yk.borderRadius,padding:Yk.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:dA,border:`none`},"& > ul > li":{padding:Yk.padding,lineHeight:Yk.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:fA,color:tA,borderRadius:Yk.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:eA,paddingRight:Yk.paddingRight},"& > ul > li > span.cm-completionDetail":{color:eA,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:dA,borderBottomColor:dA},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${uA}`},"&-warning":{borderLeft:`3px solid ${mA}`},"&-info":{borderLeft:`3px solid ${hA}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${uA}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${mA}`},".cm-matchingBracket":{backgroundColor:cwe,outline:`1px solid ${lwe}`,borderRadius:Gk.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#cc241d55`,outline:`1px solid ${uA}`,borderRadius:Gk.borderRadius},".cm-selectionMatch":{backgroundColor:swe,outline:`1px solid ${$k}`,borderRadius:Gk.borderRadius},".cm-foldPlaceholder":{backgroundColor:dA,color:eA,border:`1px dotted ${$k}`,borderRadius:Kk.borderRadius,padding:Kk.padding,margin:Kk.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${Xk}, 0 0 0 3px ${lA}40`},"& .cm-scroller::-webkit-scrollbar":{width:qk.width,height:qk.height},"& .cm-scroller::-webkit-scrollbar-track":{background:Zk},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:$k,borderRadius:qk.borderRadius,border:`3px solid ${Zk}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:rwe},".cm-ghostText":{opacity:`0.5`,color:eA}},{dark:!0}),ve(Ae.define([{tag:U.keyword,color:rA,fontWeight:`bold`},{tag:U.controlKeyword,color:rA,fontWeight:`bold`},{tag:U.moduleKeyword,color:rA,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:oA},{tag:[U.variableName],color:oA},{tag:[U.propertyName],color:cA,fontStyle:`normal`},{tag:[U.typeName],color:cA},{tag:[U.className],color:aA,fontStyle:`italic`},{tag:[U.namespace],color:oA,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:nA},{tag:[U.bracket],color:eA},{tag:[U.brace],color:eA},{tag:[U.punctuation],color:eA},{tag:[U.function(U.variableName),U.labelName],color:aA},{tag:[U.definition(U.variableName)],color:oA},{tag:U.number,color:sA},{tag:U.changed,color:sA},{tag:U.annotation,color:uA,fontStyle:`italic`},{tag:U.modifier,color:sA,fontStyle:`italic`},{tag:U.self,color:sA},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:lA},{tag:[U.atom,U.bool,U.special(U.variableName)],color:lA},{tag:[U.processingInstruction,U.inserted],color:iA},{tag:[U.special(U.string),U.regexp],color:iA},{tag:U.string,color:iA},{tag:U.definition(U.typeName),color:cA,fontWeight:`bold`},{tag:U.meta,color:eA},{tag:U.comment,fontStyle:`italic`,color:eA},{tag:U.docComment,fontStyle:`italic`,color:eA},{tag:[U.tagName],color:rA},{tag:[U.attributeName],color:aA},{tag:[U.heading],fontWeight:`bold`,color:aA},{tag:[U.strong],fontWeight:`bold`,color:aA},{tag:[U.emphasis],fontStyle:`italic`,color:iA},{tag:[U.link],color:uwe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:hA,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:nA,textDecoration:`underline wavy`,borderBottom:`1px wavy ${uA}`},{tag:[U.strikethrough],color:uA,textDecoration:`line-through`},{tag:U.constant(U.name),color:lA},{tag:U.deleted,color:uA},{tag:U.squareBracket,color:eA},{tag:U.angleBracket,color:eA},{tag:U.monospace,color:nA},{tag:[U.contentSeparator],color:oA},{tag:U.quote,color:eA}]))],bA={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},fwe={borderLeftWidth:`2px`},xA={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},SA={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},CA={border:`none`,borderRadius:`4px`,padding:`2px 10px`},pwe={borderRadius:`2px`},wA={borderRadius:`2px`},TA={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},EA={width:`12px`,height:`12px`,borderRadius:`6px`},DA={borderRadius:`4px`,padding:`2px 6px`},OA={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},kA=`#3c3836`,mwe=`#504945`,hwe=`#665c54`,AA=`#7c6f64`,jA=`#928374`,MA=`#fbf1c7`,NA=`#ebdbb2`,PA=`#d5c4a1`,FA=`#bdae93`,gwe=`#a89984`,IA=`#9d0006`,LA=`#79740e`,RA=`#b57614`,zA=`#076678`,BA=`#8f3f71`,VA=`#427b58`,HA=`#af3a03`,UA=IA,_we=NA,vwe=`#ffc42e25`,ywe=MA,WA=NA,bwe=_we,xwe=`#ffc42e40`,GA=HA,Swe=`#d5c4a180`,Cwe=HA,KA=RA,qA=zA,wwe=BA,JA=`#d8e5bc80`,YA=`#f7cfcf80`,XA=`#79740e`,ZA=`#9d0006`,Twe=[Te.theme({"&":{color:kA,backgroundColor:ywe,fontSize:bA.fontSize,fontFamily:bA.fontFamily},".cm-content":{caretColor:GA,lineHeight:bA.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:GA,borderLeftWidth:fwe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${GA}99`,color:MA},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:bwe,color:kA},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#ffc42e80`,outline:`1px solid ${HA}`,color:kA,borderRadius:DA.borderRadius,"& span":{color:kA}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:HA,color:MA,padding:DA.padding,"& span":{color:MA}},".cm-search.cm-panel.cm-textfield":{color:kA,borderRadius:DA.borderRadius,padding:DA.padding},".cm-panels":{backgroundColor:NA,color:mwe,borderRadius:`0 0 4px 4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${FA}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${FA}`},".cm-panel button":{backgroundColor:MA,color:kA,border:CA.border,borderRadius:CA.borderRadius,padding:CA.padding},".cm-panel button:hover":{backgroundColor:PA},".cm-activeLine":{backgroundColor:vwe,borderRadius:pwe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:NA,color:AA,border:SA.border,borderRight:`1px solid ${FA}`,paddingRight:SA.paddingRight},".cm-activeLineGutter":{backgroundColor:PA,color:kA,fontWeight:SA.fontWeight},".cm-lineNumbers":{fontSize:SA.fontSize,lineHeight:SA.lineHeight},".cm-foldGutter":{fontSize:SA.fontSize,lineHeight:SA.lineHeight},".cm-foldGutter .cm-gutterElement":{color:AA,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:kA},".cm-insertedLine":{textDecoration:xA.insertedTextDecoration,backgroundColor:JA,color:XA,padding:xA.insertedLinePadding,borderRadius:xA.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:xA.insertedTextDecoration,backgroundColor:`${JA} !important`,color:XA,padding:xA.insertedLinePadding,borderRadius:xA.borderRadious,border:`1px solid ${XA}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:xA.deletedTextDecoration,backgroundColor:YA,color:ZA,padding:xA.insertedLinePadding,borderRadius:xA.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:xA.deletedTextDecoration,backgroundColor:`${YA} !important`,color:ZA,padding:xA.insertedLinePadding,borderRadius:xA.borderRadious,border:`1px solid ${ZA}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:WA,border:`1px solid ${FA}`,borderRadius:OA.borderRadius,padding:OA.padding,boxShadow:`0 1px 5px rgba(0, 0, 0, 0.1)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:WA,border:`none`},"& > ul > li":{padding:OA.padding,lineHeight:OA.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:HA+`30`,color:kA,borderRadius:OA.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:HA+`15`},"& > ul > li > span.cm-completionIcon":{color:AA,paddingRight:OA.paddingRight},"& > ul > li > span.cm-completionDetail":{color:AA,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:WA,borderBottomColor:WA},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${UA}`},"&-warning":{borderLeft:`3px solid ${KA}`},"&-info":{borderLeft:`3px solid ${qA}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${UA}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${KA}`},".cm-matchingBracket":{backgroundColor:Swe,outline:`1px solid ${Cwe}`,borderRadius:wA.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#fb492740`,outline:`1px solid ${UA}`,borderRadius:wA.borderRadius},".cm-selectionMatch":{backgroundColor:xwe,outline:`1px solid ${FA}`,borderRadius:wA.borderRadius},".cm-foldPlaceholder":{backgroundColor:`transparent`,color:hwe,border:`1px dotted ${FA}`,borderRadius:TA.borderRadius,padding:TA.padding,margin:TA.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${MA}, 0 0 0 3px ${HA}40`},"& .cm-scroller::-webkit-scrollbar":{width:EA.width,height:EA.height},"& .cm-scroller::-webkit-scrollbar-track":{background:MA},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:FA,borderRadius:EA.borderRadius,border:`3px solid ${MA}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:gwe},".cm-ghostText":{opacity:`0.5`,color:jA}},{dark:!1}),ve(Ae.define([{tag:U.keyword,color:IA,fontWeight:`bold`},{tag:U.controlKeyword,color:IA,fontWeight:`bold`},{tag:U.moduleKeyword,color:IA,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:zA},{tag:[U.variableName],color:zA},{tag:[U.propertyName],color:VA,fontStyle:`normal`},{tag:[U.typeName],color:VA},{tag:[U.className],color:RA,fontStyle:`italic`},{tag:[U.namespace],color:zA,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:kA},{tag:[U.bracket],color:jA},{tag:[U.brace],color:jA},{tag:[U.punctuation],color:jA},{tag:[U.function(U.variableName),U.labelName],color:RA},{tag:[U.definition(U.variableName)],color:zA},{tag:U.number,color:BA},{tag:U.changed,color:BA},{tag:U.annotation,color:UA,fontStyle:`italic`},{tag:U.modifier,color:BA,fontStyle:`italic`},{tag:U.self,color:BA},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:HA},{tag:[U.atom,U.bool,U.special(U.variableName)],color:HA},{tag:[U.processingInstruction,U.inserted],color:LA},{tag:[U.special(U.string),U.regexp],color:LA},{tag:U.string,color:LA},{tag:U.definition(U.typeName),color:VA,fontWeight:`bold`},{tag:U.meta,color:jA},{tag:U.comment,fontStyle:`italic`,color:jA},{tag:U.docComment,fontStyle:`italic`,color:jA},{tag:[U.tagName],color:IA},{tag:[U.attributeName],color:RA},{tag:[U.heading],fontWeight:`bold`,color:RA},{tag:[U.strong],fontWeight:`bold`,color:RA},{tag:[U.emphasis],fontStyle:`italic`,color:LA},{tag:[U.link],color:wwe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:qA,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:kA,textDecoration:`underline wavy`,borderBottom:`1px wavy ${UA}`},{tag:[U.strikethrough],color:UA,textDecoration:`line-through`},{tag:U.constant(U.name),color:HA},{tag:U.deleted,color:UA},{tag:U.squareBracket,color:jA},{tag:U.angleBracket,color:jA},{tag:U.monospace,color:kA},{tag:[U.contentSeparator],color:zA},{tag:U.quote,color:jA}]))],QA={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},Ewe={borderLeftWidth:`2px`},$A={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},ej={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},tj={border:`none`,borderRadius:`4px`,padding:`2px 10px`},Dwe={borderRadius:`2px`},nj={borderRadius:`2px`},rj={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},ij={width:`12px`,height:`12px`,borderRadius:`6px`},aj={borderRadius:`4px`,padding:`2px 6px`},oj={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},sj=`#212121`,cj=`#505d64`,lj=`#606f7a`,uj=`#707d8b`,Owe=`#a0a4ae`,dj=`#bdbdbd`,fj=`#e0e0e0`,kwe=`#202325`,pj=`#ff5f52`,mj=`#ff6e40`,Awe=`#fa5788`,hj=`#facf4e`,gj=`#ffad42`,_j=`#56c8d8`,vj=`#7186f0`,yj=`#cf6edf`,jwe=`#6abf69`,Mwe=`#99d066`,Nwe=`#4ebaaa`,bj=pj,xj=kwe,Pwe=`#2d333b30`,Sj=sj,Cj=cj,wj=`#ffffff1f`,Fwe=`#4A707A80`,Tj=Owe,Iwe=`#39496650`,Lwe=_j,Ej=gj,Dj=_j,Rwe=yj,Oj=`#1e3d2780`,kj=`#4e282880`,Aj=`#6abf69`,jj=`#ff5f52`,zwe=[Te.theme({"&":{color:dj,backgroundColor:Sj,fontSize:QA.fontSize,fontFamily:QA.fontFamily},".cm-content":{caretColor:Tj,lineHeight:QA.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:Tj,borderLeftWidth:Ewe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${Tj}99`,color:Sj},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:wj},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#394966cc`,outline:`1px solid ${_j}`,color:fj,borderRadius:aj.borderRadius,"& span":{color:fj}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:_j,color:Sj,padding:aj.padding,"& span":{color:Sj}},".cm-search.cm-panel.cm-textfield":{color:dj,borderRadius:aj.borderRadius,padding:aj.padding},".cm-panels":{backgroundColor:sj,color:dj,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${uj}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${uj}`},".cm-panel button":{backgroundColor:Cj,color:dj,border:tj.border,borderRadius:tj.borderRadius,padding:tj.padding},".cm-panel button:hover":{backgroundColor:lj},".cm-activeLine":{backgroundColor:Pwe,borderRadius:Dwe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:xj,color:uj,border:ej.border,borderRight:`1px solid ${cj}`,paddingRight:ej.paddingRight},".cm-activeLineGutter":{backgroundColor:`#252a2c`,color:dj,fontWeight:ej.fontWeight},".cm-lineNumbers":{fontSize:ej.fontSize,lineHeight:ej.lineHeight},".cm-foldGutter":{fontSize:ej.fontSize,lineHeight:ej.lineHeight},".cm-foldGutter .cm-gutterElement":{color:uj,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:dj},".cm-insertedLine":{textDecoration:$A.insertedTextDecoration,backgroundColor:Oj,color:Aj,padding:$A.insertedLinePadding,borderRadius:$A.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:$A.insertedTextDecoration,backgroundColor:`${Oj} !important`,color:Aj,padding:$A.insertedLinePadding,borderRadius:$A.borderRadious,border:`1px solid ${Aj}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:$A.deletedTextDecoration,backgroundColor:kj,color:jj,padding:$A.insertedLinePadding,borderRadius:$A.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:$A.deletedTextDecoration,backgroundColor:`${kj} !important`,color:jj,padding:$A.insertedLinePadding,borderRadius:$A.borderRadious,border:`1px solid ${jj}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:Cj,border:`1px solid ${uj}`,borderRadius:oj.borderRadius,padding:oj.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:Cj,border:`none`},"& > ul > li":{padding:oj.padding,lineHeight:oj.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:wj,color:fj,borderRadius:oj.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:uj,paddingRight:oj.paddingRight},"& > ul > li > span.cm-completionDetail":{color:uj,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Cj,borderBottomColor:Cj},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${bj}`},"&-warning":{borderLeft:`3px solid ${Ej}`},"&-info":{borderLeft:`3px solid ${Dj}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${bj}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${Ej}`},".cm-matchingBracket":{backgroundColor:Iwe,outline:`1px solid ${Lwe}`,borderRadius:nj.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#ff5f5240`,outline:`1px solid ${bj}`,borderRadius:nj.borderRadius},".cm-selectionMatch":{backgroundColor:Fwe,outline:`1px solid ${lj}50`,borderRadius:nj.borderRadius},".cm-foldPlaceholder":{backgroundColor:Cj,color:uj,border:`1px dotted ${uj}70`,borderRadius:rj.borderRadius,padding:rj.padding,margin:rj.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${Sj}, 0 0 0 3px ${_j}40`},"& .cm-scroller::-webkit-scrollbar":{width:ij.width,height:ij.height},"& .cm-scroller::-webkit-scrollbar-track":{background:xj},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:lj,borderRadius:ij.borderRadius,border:`3px solid ${xj}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:uj},".cm-ghostText":{opacity:`0.5`,color:uj}},{dark:!0}),ve(Ae.define([{tag:U.keyword,color:pj,fontWeight:`bold`},{tag:U.controlKeyword,color:pj,fontWeight:`bold`},{tag:U.moduleKeyword,color:pj,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:vj},{tag:[U.variableName],color:Mwe},{tag:[U.propertyName],color:yj,fontStyle:`normal`},{tag:[U.typeName],color:pj},{tag:[U.className],color:hj,fontStyle:`italic`},{tag:[U.namespace],color:vj,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:dj},{tag:[U.bracket],color:uj},{tag:[U.brace],color:uj},{tag:[U.punctuation],color:uj},{tag:[U.function(U.variableName)],color:_j},{tag:[U.labelName],color:_j,fontStyle:`italic`},{tag:[U.definition(U.function(U.variableName))],color:_j},{tag:[U.definition(U.variableName)],color:vj},{tag:U.number,color:hj},{tag:U.changed,color:hj},{tag:U.annotation,color:bj,fontStyle:`italic`},{tag:U.modifier,color:mj,fontStyle:`italic`},{tag:U.self,color:mj},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:mj},{tag:[U.atom,U.bool,U.special(U.variableName)],color:mj},{tag:[U.processingInstruction,U.inserted],color:jwe},{tag:[U.special(U.string),U.regexp],color:Awe},{tag:U.string,color:gj},{tag:U.definition(U.typeName),color:pj,fontWeight:`bold`},{tag:U.meta,color:uj},{tag:U.comment,fontStyle:`italic`,color:uj},{tag:U.docComment,fontStyle:`italic`,color:uj},{tag:[U.tagName],color:yj},{tag:[U.attributeName],color:hj},{tag:[U.heading],fontWeight:`bold`,color:Nwe},{tag:U.heading1,color:hj},{tag:U.heading2,color:gj},{tag:U.heading3,color:_j},{tag:U.heading4,color:vj},{tag:U.heading5,color:yj},{tag:U.heading6,color:pj},{tag:[U.strong],fontWeight:`bold`,color:vj},{tag:[U.emphasis],fontStyle:`italic`,color:gj},{tag:[U.link],color:Rwe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:Dj,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:dj,textDecoration:`underline wavy`,borderBottom:`1px wavy ${bj}`},{tag:[U.strikethrough],color:bj,textDecoration:`line-through`},{tag:U.constant(U.name),color:mj},{tag:U.deleted,color:bj},{tag:U.squareBracket,color:uj},{tag:U.angleBracket,color:uj},{tag:U.monospace,color:dj},{tag:[U.contentSeparator],color:vj},{tag:U.quote,color:uj}]))],Mj={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},Bwe={borderLeftWidth:`2px`},Nj={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},Pj={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},Fj={border:`none`,borderRadius:`4px`,padding:`2px 10px`},Vwe={borderRadius:`2px`},Ij={borderRadius:`2px`},Lj={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},Rj={width:`12px`,height:`12px`,borderRadius:`6px`},zj={borderRadius:`4px`,padding:`2px 6px`},Bj={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},Hwe=`#ffffff`,Vj=`#f5f5f5`,Hj=`#212121`,Uj=`#757575`,Wj=`#9e9e9e`,Gj=`#424242`,Uwe=`#eeeeee`,Kj=`#fafafa`,qj=`#f44336`,Jj=`#ff3e00`,Yj=`#FF00E9FF`,Wwe=`#ffc107`,Xj=`#ff9800`,Zj=`#00acc1`,Qj=`#3949ab`,$j=`#8e24aa`,eM=`#43a047`,tM=`#00897b`,nM=`#1e88e5`,rM=qj,Gwe=`#00000008`,iM=Hwe,aM=Vj,Kwe=`#DDEEFF`,qwe=`#90a4ae26`,oM=Wj,Jwe=`#DDEEFF80`,Ywe=Zj,sM=Xj,cM=Zj,Xwe=$j,lM=`#ECEFF180`,uM=`#e6ffed80`,dM=`#ffebe980`,fM=`#28a745`,pM=`#d73a49`,Zwe=[Te.theme({"&":{color:Hj,backgroundColor:iM,fontSize:Mj.fontSize,fontFamily:Mj.fontFamily},".cm-content":{caretColor:oM,lineHeight:Mj.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:oM,borderLeftWidth:Bwe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${Hj}99`,color:iM},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Kwe},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#FFA72680`,outline:`1px solid ${Wwe}`,color:Hj,borderRadius:zj.borderRadius,"& span":{color:Hj}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:Zj,color:iM,padding:zj.padding,"& span":{color:iM}},".cm-search.cm-panel.cm-textfield":{color:Hj,borderRadius:zj.borderRadius,padding:zj.padding},".cm-panels":{backgroundColor:Uwe,color:Hj,borderRadius:`4px`,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${Wj}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${Wj}`},".cm-panel button":{backgroundColor:aM,color:Hj,border:Fj.border,borderRadius:Fj.borderRadius,padding:Fj.padding},".cm-panel button:hover":{backgroundColor:`#CFD8DC`},".cm-activeLine":{backgroundColor:Gwe,borderRadius:Vwe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:Kj,color:Uj,border:Pj.border,borderRight:`1px solid ${Wj}`,paddingRight:Pj.paddingRight},".cm-activeLineGutter":{backgroundColor:`#E0E0E0`,color:Hj,fontWeight:Pj.fontWeight},".cm-lineNumbers":{fontSize:Pj.fontSize,lineHeight:Pj.lineHeight},".cm-foldGutter":{fontSize:Pj.fontSize,lineHeight:Pj.lineHeight},".cm-foldGutter .cm-gutterElement":{color:Uj,cursor:`pointer`,transition:`color 0.15s ease`},".cm-foldGutter .cm-gutterElement:hover":{color:Hj},".cm-insertedLine":{textDecoration:Nj.insertedTextDecoration,backgroundColor:uM,color:fM,padding:Nj.insertedLinePadding,borderRadius:Nj.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:Nj.insertedTextDecoration,backgroundColor:`${uM} !important`,color:fM,padding:Nj.insertedLinePadding,borderRadius:Nj.borderRadious,border:`1px solid ${fM}30`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:Nj.deletedTextDecoration,backgroundColor:dM,color:pM,padding:Nj.insertedLinePadding,borderRadius:Nj.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:Nj.deletedTextDecoration,backgroundColor:`${dM} !important`,color:pM,padding:Nj.insertedLinePadding,borderRadius:Nj.borderRadious,border:`1px solid ${pM}30`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:aM,border:`1px solid ${Wj}`,borderRadius:Bj.borderRadius,padding:Bj.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:aM,border:`none`},"& > ul > li":{padding:Bj.padding,lineHeight:Bj.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:lM,color:Hj,borderRadius:Bj.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:lM},"& > ul > li > span.cm-completionIcon":{color:Uj,paddingRight:Bj.paddingRight},"& > ul > li > span.cm-completionDetail":{color:Uj,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:aM,borderBottomColor:aM},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${rM}`},"&-warning":{borderLeft:`3px solid ${sM}`},"&-info":{borderLeft:`3px solid ${cM}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${rM}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${sM}`},".cm-matchingBracket":{backgroundColor:Jwe,outline:`1px solid ${Ywe}`,borderRadius:Ij.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${rM}20`,outline:`1px solid ${rM}`,borderRadius:Ij.borderRadius},".cm-selectionMatch":{backgroundColor:qwe,outline:`1px solid ${Uj}30`,borderRadius:Ij.borderRadius},".cm-foldPlaceholder":{backgroundColor:Vj,color:Uj,border:`1px dotted ${Uj}70`,borderRadius:Lj.borderRadius,padding:Lj.padding,margin:Lj.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${iM}, 0 0 0 3px ${Zj}40`},"& .cm-scroller::-webkit-scrollbar":{width:Rj.width,height:Rj.height},"& .cm-scroller::-webkit-scrollbar-track":{background:Kj},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:Uj,borderRadius:Rj.borderRadius,border:`3px solid ${Kj}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:Hj},".cm-ghostText":{opacity:`0.5`,color:Uj}},{dark:!1}),ve(Ae.define([{tag:U.keyword,color:Zj,fontWeight:`bold`},{tag:U.controlKeyword,color:Zj,fontWeight:`bold`},{tag:U.moduleKeyword,color:Zj,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:Gj},{tag:[U.variableName],color:Gj},{tag:[U.propertyName],color:tM,fontStyle:`normal`},{tag:[U.typeName],color:Xj},{tag:[U.className],color:Xj,fontStyle:`italic`},{tag:[U.namespace],color:Qj,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:Qj},{tag:[U.bracket],color:$j},{tag:[U.brace],color:$j},{tag:[U.punctuation],color:Uj},{tag:[U.function(U.variableName)],color:Jj},{tag:[U.labelName],color:nM,fontStyle:`italic`},{tag:[U.definition(U.function(U.variableName))],color:Jj},{tag:[U.definition(U.variableName)],color:Yj},{tag:U.number,color:Xj},{tag:U.changed,color:Xj},{tag:U.annotation,color:rM,fontStyle:`italic`},{tag:U.modifier,color:Xj,fontStyle:`italic`},{tag:U.self,color:Xj},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:Xj},{tag:[U.atom,U.bool],color:$j},{tag:[U.processingInstruction,U.inserted],color:eM},{tag:U.string,color:eM},{tag:[U.special(U.string),U.regexp],color:Yj},{tag:U.definition(U.typeName),color:Yj,fontWeight:`bold`},{tag:[U.definition(U.name),U.separator],color:Yj},{tag:U.meta,color:Uj},{tag:U.comment,fontStyle:`italic`,color:Uj},{tag:U.docComment,fontStyle:`italic`,color:Uj},{tag:[U.tagName],color:Jj},{tag:[U.attributeName],color:Gj},{tag:[U.heading],fontWeight:`bold`,color:tM},{tag:U.heading1,color:nM},{tag:U.heading2,color:Xj},{tag:U.heading3,color:Zj},{tag:U.heading4,color:Qj},{tag:U.heading5,color:$j},{tag:U.heading6,color:eM},{tag:[U.strong],fontWeight:`bold`,color:Qj},{tag:[U.emphasis],fontStyle:`italic`,color:Xj},{tag:[U.link],color:Xwe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:cM,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:Hj,textDecoration:`underline wavy`,borderBottom:`1px dotted ${qj}`},{tag:[U.strikethrough],color:rM,textDecoration:`line-through`},{tag:U.constant(U.name),color:Jj},{tag:U.deleted,color:rM},{tag:U.squareBracket,color:qj},{tag:U.angleBracket,color:Hj},{tag:U.monospace,color:Hj},{tag:[U.contentSeparator],color:Zj},{tag:U.quote,color:eM}]))],mM={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},Qwe={borderLeftWidth:`2px`},hM={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},gM={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},_M={border:`none`,borderRadius:`4px`,padding:`2px 10px`},$we={borderRadius:`2px`},vM={borderRadius:`2px`},yM={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},bM={width:`12px`,height:`12px`,borderRadius:`6px`},xM={borderRadius:`4px`,padding:`2px 6px`},SM={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},CM=`#272822`,wM=`#f8f8f2`,TM=`#88846f`,eTe=`#f8f8f0`,EM=`#F92672`,DM=`#FD971F`,OM=`#66D9EF`,kM=`#E6DB74`,AM=`#AE81FF`,jM=`#A6E22E`,MM=`#F44747`,NM=`#414339`,tTe=`#3e3d3257`,PM=`#34352f`,FM=`#49483E`,nTe=`#75715e70`,IM=eTe,rTe=`#75715E55`,iTe=OM,LM=DM,RM=OM,aTe=AM,zM=`#3d4d3880`,BM=`#4d393980`,VM=`#A6E22E`,HM=`#F92672`,oTe=[Te.theme({"&":{color:wM,backgroundColor:CM,fontSize:mM.fontSize,fontFamily:mM.fontFamily},".cm-content":{caretColor:IM,lineHeight:mM.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:IM,borderLeftWidth:Qwe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${IM}99`,color:CM},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:FM},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#49483E99`,outline:`1px solid ${kM}`,color:wM,borderRadius:xM.borderRadius,"& span":{color:wM}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:EM,color:CM,padding:xM.padding,"& span":{color:CM}},".cm-search.cm-panel.cm-textfield":{color:wM,borderRadius:xM.borderRadius,padding:xM.padding},".cm-panels":{backgroundColor:NM,color:wM,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${TM}80`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${TM}80`},".cm-panel button":{backgroundColor:PM,color:wM,border:_M.border,borderRadius:_M.borderRadius,padding:_M.padding},".cm-panel button:hover":{backgroundColor:`#49483E`},".cm-activeLine":{backgroundColor:tTe,borderRadius:$we.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:NM,color:TM,border:gM.border,borderRight:`1px solid #3e3d32`,paddingRight:gM.paddingRight},".cm-activeLineGutter":{backgroundColor:`#35352c`,color:wM,fontWeight:gM.fontWeight},".cm-lineNumbers":{fontSize:gM.fontSize,lineHeight:gM.lineHeight},".cm-foldGutter":{fontSize:gM.fontSize,lineHeight:gM.lineHeight},".cm-foldGutter .cm-gutterElement":{color:TM,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:wM},".cm-insertedLine":{textDecoration:hM.insertedTextDecoration,backgroundColor:zM,color:VM,padding:hM.insertedLinePadding,borderRadius:hM.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:hM.insertedTextDecoration,backgroundColor:`${zM} !important`,color:VM,padding:hM.insertedLinePadding,borderRadius:hM.borderRadious,border:`1px solid ${VM}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:hM.deletedTextDecoration,backgroundColor:BM,color:HM,padding:hM.insertedLinePadding,borderRadius:hM.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:hM.deletedTextDecoration,backgroundColor:`${BM} !important`,color:HM,padding:hM.insertedLinePadding,borderRadius:hM.borderRadious,border:`1px solid ${HM}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:PM,border:`1px solid #49483E`,borderRadius:SM.borderRadius,padding:SM.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.4)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:PM,border:`none`},"& > ul > li":{padding:SM.padding,lineHeight:SM.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:FM,color:wM,borderRadius:SM.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:TM,paddingRight:SM.paddingRight},"& > ul > li > span.cm-completionDetail":{color:TM,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:PM,borderBottomColor:PM},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${MM}`},"&-warning":{borderLeft:`3px solid ${LM}`},"&-info":{borderLeft:`3px solid ${RM}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${MM}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${LM}`},".cm-matchingBracket":{backgroundColor:rTe,outline:`1px solid ${iTe}`,borderRadius:vM.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#f9267240`,outline:`1px solid ${MM}`,borderRadius:vM.borderRadius},".cm-selectionMatch":{backgroundColor:nTe,outline:`1px solid ${TM}50`,borderRadius:vM.borderRadius},".cm-foldPlaceholder":{backgroundColor:PM,color:TM,border:`1px dotted ${TM}70`,borderRadius:yM.borderRadius,padding:yM.padding,margin:yM.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${CM}, 0 0 0 3px ${OM}40`},"& .cm-scroller::-webkit-scrollbar":{width:bM.width,height:bM.height},"& .cm-scroller::-webkit-scrollbar-track":{background:NM},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#49483E`,borderRadius:bM.borderRadius,border:`3px solid ${NM}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#5a594d`},".cm-ghostText":{opacity:`0.5`,color:TM}},{dark:!0}),ve(Ae.define([{tag:U.keyword,color:EM,fontWeight:`bold`},{tag:U.controlKeyword,color:EM,fontWeight:`bold`},{tag:U.moduleKeyword,color:EM,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:DM},{tag:[U.variableName],color:DM},{tag:[U.propertyName],color:jM,fontStyle:`normal`},{tag:[U.typeName],color:OM,fontStyle:`italic`},{tag:[U.className],color:jM,fontStyle:`italic`},{tag:[U.namespace],color:DM,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:EM},{tag:[U.bracket],color:wM},{tag:[U.brace],color:wM},{tag:[U.punctuation],color:wM},{tag:[U.function(U.variableName),U.labelName],color:OM},{tag:[U.definition(U.function(U.variableName))],color:OM},{tag:[U.definition(U.variableName)],color:DM},{tag:U.number,color:AM},{tag:U.changed,color:AM},{tag:U.annotation,color:MM,fontStyle:`italic`},{tag:U.modifier,color:AM,fontStyle:`italic`},{tag:U.self,color:AM},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:AM},{tag:[U.atom,U.bool,U.special(U.variableName)],color:AM},{tag:[U.processingInstruction,U.inserted],color:jM},{tag:[U.special(U.string),U.regexp],color:kM},{tag:U.string,color:kM},{tag:U.definition(U.typeName),color:OM,fontWeight:`bold`},{tag:U.meta,color:TM},{tag:U.comment,fontStyle:`italic`,color:TM},{tag:U.docComment,fontStyle:`italic`,color:TM},{tag:[U.tagName],color:EM},{tag:[U.attributeName],color:jM},{tag:[U.heading],fontWeight:`bold`,color:jM},{tag:[U.strong],fontWeight:`bold`,color:DM},{tag:[U.emphasis],fontStyle:`italic`,color:DM},{tag:[U.link],color:aTe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:RM,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:wM,textDecoration:`underline wavy`,borderBottom:`1px wavy ${MM}`},{tag:[U.strikethrough],color:MM,textDecoration:`line-through`},{tag:U.constant(U.name),color:AM},{tag:U.deleted,color:MM},{tag:U.squareBracket,color:wM},{tag:U.angleBracket,color:wM},{tag:U.monospace,color:wM},{tag:[U.contentSeparator],color:DM},{tag:U.quote,color:TM}]))],UM={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},sTe={borderLeftWidth:`2px`},WM={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},GM={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},KM={border:`none`,borderRadius:`4px`,padding:`2px 10px`},cTe={borderRadius:`2px`},qM={borderRadius:`2px`},JM={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},YM={width:`12px`,height:`12px`,borderRadius:`6px`},XM={borderRadius:`4px`,padding:`2px 6px`},ZM={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},lTe=`#2e3440`,QM=`#3b4252`,$M=`#434c5e`,eN=`#4c566a`,tN=`#d8dee9`,nN=`#eceff4`,rN=`#8fbcbb`,iN=`#88c0d0`,aN=`#81a1c1`,oN=`#5e81ac`,sN=`#bf616a`,cN=`#d08770`,lN=`#ebcb8b`,uN=`#a3be8c`,dN=`#b48ead`,uTe=`#d30102`,fN=`#252a33`,dTe=`#3b425277`,pN=lTe,mN=QM,fTe=$M,pTe=`#4c566a80`,hN=tN,mTe=`#4c566a55`,hTe=iN,gN=lN,_N=aN,gTe=dN,vN=`#3b4a3880`,yN=`#4a393a80`,bN=`#a3be8c`,xN=`#bf616a`,_Te=[Te.theme({"&":{color:tN,backgroundColor:pN,fontSize:UM.fontSize,fontFamily:UM.fontFamily},".cm-content":{caretColor:hN,lineHeight:UM.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:hN,borderLeftWidth:sTe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${hN}99`,color:pN},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:fTe},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#5e81ac80`,outline:`1px solid ${rN}`,color:tN,borderRadius:XM.borderRadius,"& span":{color:tN}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:aN,color:nN,padding:XM.padding,"& span":{color:nN}},".cm-search.cm-panel.cm-textfield":{color:tN,borderRadius:XM.borderRadius,padding:XM.padding},".cm-panels":{backgroundColor:fN,color:tN,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${eN}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${eN}`},".cm-panel button":{backgroundColor:mN,color:tN,border:KM.border,borderRadius:KM.borderRadius,padding:KM.padding},".cm-panel button:hover":{backgroundColor:$M},".cm-activeLine":{backgroundColor:dTe,borderRadius:cTe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:fN,color:eN,border:GM.border,borderRight:`1px solid ${$M}`,paddingRight:GM.paddingRight},".cm-activeLineGutter":{backgroundColor:QM,color:tN,fontWeight:GM.fontWeight},".cm-lineNumbers":{fontSize:GM.fontSize,lineHeight:GM.lineHeight},".cm-foldGutter":{fontSize:GM.fontSize,lineHeight:GM.lineHeight},".cm-foldGutter .cm-gutterElement":{color:eN,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:tN},".cm-insertedLine":{textDecoration:WM.insertedTextDecoration,backgroundColor:vN,color:bN,padding:WM.insertedLinePadding,borderRadius:WM.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:WM.insertedTextDecoration,backgroundColor:`${vN} !important`,color:bN,padding:WM.insertedLinePadding,borderRadius:WM.borderRadious,border:`1px solid ${bN}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:WM.deletedTextDecoration,backgroundColor:yN,color:xN,padding:WM.insertedLinePadding,borderRadius:WM.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:WM.deletedTextDecoration,backgroundColor:`${yN} !important`,color:xN,padding:WM.insertedLinePadding,borderRadius:WM.borderRadious,border:`1px solid ${xN}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:mN,border:`1px solid ${eN}`,borderRadius:ZM.borderRadius,padding:ZM.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:mN,border:`none`},"& > ul > li":{padding:ZM.padding,lineHeight:ZM.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:$M,color:nN,borderRadius:ZM.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:eN,paddingRight:ZM.paddingRight},"& > ul > li > span.cm-completionDetail":{color:eN,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:mN,borderBottomColor:mN},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${sN}`},"&-warning":{borderLeft:`3px solid ${gN}`},"&-info":{borderLeft:`3px solid ${_N}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${sN}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${gN}`},".cm-matchingBracket":{backgroundColor:mTe,outline:`1px solid ${hTe}`,borderRadius:qM.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${sN}40`,outline:`1px solid ${uTe}`,borderRadius:qM.borderRadius},".cm-selectionMatch":{backgroundColor:pTe,outline:`1px solid ${$M}50`,borderRadius:qM.borderRadius},".cm-foldPlaceholder":{backgroundColor:mN,color:eN,border:`1px dotted ${eN}70`,borderRadius:JM.borderRadius,padding:JM.padding,margin:JM.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${pN}, 0 0 0 3px ${iN}40`},"& .cm-scroller::-webkit-scrollbar":{width:YM.width,height:YM.height},"& .cm-scroller::-webkit-scrollbar-track":{background:fN},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:$M,borderRadius:YM.borderRadius,border:`3px solid ${fN}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:eN},".cm-ghostText":{opacity:`0.5`,color:eN}},{dark:!0}),ve(Ae.define([{tag:U.keyword,color:oN,fontWeight:`bold`},{tag:U.controlKeyword,color:oN,fontWeight:`bold`},{tag:U.moduleKeyword,color:oN,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:iN},{tag:[U.variableName],color:tN},{tag:[U.propertyName],color:iN,fontStyle:`normal`},{tag:[U.typeName],color:lN},{tag:[U.className],color:lN,fontStyle:`italic`},{tag:[U.namespace],color:aN,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:dN},{tag:[U.bracket],color:tN},{tag:[U.brace],color:rN},{tag:[U.punctuation],color:tN},{tag:[U.function(U.variableName),U.labelName],color:rN},{tag:[U.definition(U.function(U.variableName))],color:rN},{tag:[U.definition(U.variableName)],color:cN},{tag:U.number,color:cN},{tag:U.changed,color:dN},{tag:U.annotation,color:sN,fontStyle:`italic`},{tag:U.modifier,color:dN,fontStyle:`italic`},{tag:U.self,color:dN},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:cN},{tag:[U.atom,U.bool,U.special(U.variableName)],color:dN},{tag:[U.processingInstruction,U.inserted],color:rN},{tag:[U.special(U.string),U.regexp],color:dN},{tag:U.string,color:uN},{tag:U.definition(U.typeName),color:lN,fontWeight:`bold`},{tag:[U.definition(U.name),U.separator],color:uN},{tag:U.meta,color:eN},{tag:U.comment,fontStyle:`italic`,color:eN},{tag:U.docComment,fontStyle:`italic`,color:eN},{tag:[U.tagName],color:sN},{tag:[U.attributeName],color:lN},{tag:[U.heading],fontWeight:`bold`,color:aN},{tag:[U.strong],fontWeight:`bold`,color:iN},{tag:[U.emphasis],fontStyle:`italic`,color:lN},{tag:[U.link],color:gTe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:_N,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:tN,textDecoration:`underline wavy`,borderBottom:`1px wavy ${sN}`},{tag:[U.strikethrough],color:sN,textDecoration:`line-through`},{tag:U.constant(U.name),color:cN},{tag:U.deleted,color:sN},{tag:U.squareBracket,color:sN},{tag:U.angleBracket,color:cN},{tag:U.monospace,color:tN,fontStyle:`italic`},{tag:[U.contentSeparator],color:aN},{tag:U.quote,color:dN}]))],SN={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},vTe={borderLeftWidth:`2px`},CN={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},wN={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},TN={border:`none`,borderRadius:`4px`,padding:`2px 10px`},yTe={borderRadius:`2px`},EN={borderRadius:`2px`},DN={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},ON={width:`12px`,height:`12px`,borderRadius:`6px`},kN={borderRadius:`4px`,padding:`2px 6px`},AN={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},bTe=`#e1e2e7`,jN=`#3760bf`,MN=`#99a7df`,NN=`#848cb5`,xTe=`#8c91a8`,PN=`#3760bf`,FN=`#e9e9ec`,IN=`#d5d6db`,LN=`#f52a65`,RN=`#b15c00`,zN=`#8c6c3e`,BN=`#587539`,VN=`#007197`,HN=`#2e7de9`,UN=`#7847bd`,STe=`#9854f1`,WN=LN,GN=IN,CTe=`#5F5FAF5A`,KN=bTe,qN=FN,JN=`#99a7df40`,wTe=`#99a7df60`,YN=jN,TTe=`#0e639c20`,ETe=VN,XN=RN,ZN=VN,DTe=UN,QN=`#58753920`,$N=`#f52a6520`,eP=`#587539`,tP=`#f52a65`,OTe=[Te.theme({"&":{color:PN,backgroundColor:KN,fontSize:SN.fontSize,fontFamily:SN.fontFamily},".cm-content":{caretColor:YN,lineHeight:SN.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:YN,borderLeftWidth:vTe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${YN}99`,color:KN},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:JN},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#0e639c40`,outline:`1px solid ${VN}`,color:PN,borderRadius:kN.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:VN,color:KN,padding:kN.padding,"& span":{color:KN}},".cm-search.cm-panel.cm-textfield":{color:PN,borderRadius:kN.borderRadius,padding:kN.padding},".cm-panels":{backgroundColor:FN,color:PN,borderRadius:`4px`,boxShadow:`0 1px 3px rgba(0, 0, 0, 0.1)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${NN}30`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${NN}30`},".cm-panel button":{backgroundColor:qN,color:PN,border:TN.border,borderRadius:TN.borderRadius,padding:TN.padding},".cm-panel button:hover":{backgroundColor:IN,border:`1px solid ${MN}`},".cm-activeLine":{backgroundColor:CTe,borderRadius:yTe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:GN,color:NN,border:wN.border,borderRight:`1px solid ${IN}`,paddingRight:wN.paddingRight},".cm-activeLineGutter":{color:jN,fontWeight:wN.fontWeight},".cm-lineNumbers":{fontSize:wN.fontSize,lineHeight:wN.lineHeight},".cm-foldGutter":{fontSize:wN.fontSize,lineHeight:wN.lineHeight},".cm-foldGutter .cm-gutterElement":{color:NN,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:jN},".cm-insertedLine":{textDecoration:CN.insertedTextDecoration,backgroundColor:QN,color:eP,padding:CN.insertedLinePadding,borderRadius:CN.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:CN.insertedTextDecoration,backgroundColor:`${QN} !important`,color:eP,padding:CN.insertedLinePadding,borderRadius:CN.borderRadious,border:`1px solid ${eP}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:CN.deletedTextDecoration,backgroundColor:$N,color:tP,padding:CN.insertedLinePadding,borderRadius:CN.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:CN.deletedTextDecoration,backgroundColor:`${$N} !important`,color:tP,padding:CN.insertedLinePadding,borderRadius:CN.borderRadious,border:`1px solid ${tP}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:qN,border:`1px solid ${xTe}40`,borderRadius:AN.borderRadius,padding:AN.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:qN,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:AN.padding,lineHeight:AN.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:JN,color:jN,borderRadius:AN.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:NN,paddingRight:AN.paddingRight},"& > ul > li > span.cm-completionDetail":{color:NN,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:qN,borderBottomColor:qN},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${WN}`},"&-warning":{borderLeft:`3px solid ${XN}`},"&-info":{borderLeft:`3px solid ${ZN}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${WN}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${XN}`},".cm-matchingBracket":{backgroundColor:TTe,outline:`1px solid ${ETe}`,borderRadius:EN.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${LN}20`,outline:`1px solid ${WN}`,borderRadius:EN.borderRadius},".cm-selectionMatch":{backgroundColor:wTe,outline:`1px solid ${MN}50`,borderRadius:EN.borderRadius},".cm-foldPlaceholder":{backgroundColor:qN,color:NN,border:`1px dotted ${NN}70`,borderRadius:DN.borderRadius,padding:DN.padding,margin:DN.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${KN}, 0 0 0 3px ${VN}40`},"& .cm-scroller::-webkit-scrollbar":{width:ON.width,height:ON.height},"& .cm-scroller::-webkit-scrollbar-track":{background:GN},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:NN,borderRadius:ON.borderRadius,border:`3px solid ${GN}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:MN},".cm-ghostText":{opacity:`0.5`,color:NN}},{dark:!1}),ve(Ae.define([{tag:U.keyword,color:VN,fontWeight:`bold`},{tag:U.controlKeyword,color:VN,fontWeight:`bold`},{tag:U.moduleKeyword,color:VN,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:HN},{tag:[U.variableName],color:jN},{tag:[U.propertyName],color:HN,fontStyle:`normal`},{tag:[U.typeName],color:VN},{tag:[U.className],color:zN,fontStyle:`italic`},{tag:[U.namespace],color:UN,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:UN},{tag:[U.bracket],color:NN},{tag:[U.brace],color:NN},{tag:[U.punctuation],color:NN},{tag:[U.function(U.variableName)],color:VN},{tag:[U.labelName],color:UN,fontStyle:`italic`},{tag:[U.definition(U.function(U.variableName))],color:VN},{tag:[U.definition(U.variableName)],color:HN},{tag:U.number,color:RN},{tag:U.changed,color:RN},{tag:U.annotation,color:WN,fontStyle:`italic`},{tag:U.modifier,color:RN,fontStyle:`italic`},{tag:U.self,color:RN},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:RN},{tag:[U.atom,U.bool,U.special(U.variableName)],color:RN},{tag:[U.processingInstruction,U.inserted],color:BN},{tag:[U.special(U.string),U.regexp],color:STe},{tag:U.string,color:BN},{tag:U.definition(U.typeName),color:VN,fontWeight:`bold`},{tag:[U.definition(U.name),U.separator],color:HN},{tag:U.meta,color:NN},{tag:U.comment,fontStyle:`italic`,color:NN},{tag:U.docComment,fontStyle:`italic`,color:NN},{tag:[U.tagName],color:UN},{tag:[U.attributeName],color:zN},{tag:[U.heading],fontWeight:`bold`,color:RN},{tag:U.heading1,color:RN,fontWeight:`bold`},{tag:U.heading2,color:RN},{tag:U.heading3,color:RN},{tag:U.heading4,color:VN},{tag:U.heading5,color:VN},{tag:U.heading6,color:VN},{tag:[U.strong],fontWeight:`bold`,color:jN},{tag:[U.emphasis],fontStyle:`italic`,color:BN},{tag:[U.link],color:DTe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:ZN,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:jN,textDecoration:`underline wavy`,borderBottom:`1px wavy ${WN}`},{tag:[U.strikethrough],color:WN,textDecoration:`line-through`},{tag:U.constant(U.name),color:RN},{tag:U.deleted,color:WN},{tag:U.squareBracket,color:NN},{tag:U.angleBracket,color:NN},{tag:U.monospace,color:jN},{tag:[U.contentSeparator],color:HN},{tag:U.quote,color:NN}]))],nP={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},kTe={borderLeftWidth:`2px`},rP={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},iP={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},aP={border:`none`,borderRadius:`4px`,padding:`2px 10px`},ATe={borderRadius:`2px`},oP={borderRadius:`2px`},sP={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},cP={width:`12px`,height:`12px`,borderRadius:`6px`},lP={borderRadius:`4px`,padding:`2px 6px`},uP={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},jTe=`#24283b`,dP=`#414868`,fP=`#565f89`,pP=`#c0caf5`,mP=`#282e44`,hP=`#1f2335`,MTe=`#f7768e`,gP=`#ff9e64`,_P=`#e0af68`,vP=`#9ece6a`,yP=`#2ac3de`,bP=`#7aa2f7`,xP=`#bb9af7`,SP=`#f7768e`,CP=hP,NTe=`#292e427a`,wP=jTe,TP=mP,EP=`#6f7bb630`,PTe=`#6f7bb650`,DP=pP,FTe=`#3d59a150`,ITe=bP,OP=gP,kP=yP,LTe=xP,AP=`#3b4a3880`,jP=`#4a393a80`,MP=`#9ece6a`,NP=`#f7768e`,RTe=[Te.theme({"&":{color:pP,backgroundColor:wP,fontSize:nP.fontSize,fontFamily:nP.fontFamily},".cm-content":{caretColor:DP,lineHeight:nP.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:DP,borderLeftWidth:kTe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${DP}99`,color:wP},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:EP},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#7aa2f740`,outline:`1px solid ${bP}`,color:pP,borderRadius:lP.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:bP,color:wP,padding:lP.padding,"& span":{color:wP}},".cm-search.cm-panel.cm-textfield":{color:pP,borderRadius:lP.borderRadius,padding:lP.padding},".cm-panels":{backgroundColor:mP,color:pP,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${fP}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${fP}`},".cm-panel button":{backgroundColor:TP,color:pP,border:aP.border,borderRadius:aP.borderRadius,padding:aP.padding},".cm-panel button:hover":{backgroundColor:hP},".cm-activeLine":{backgroundColor:NTe,borderRadius:ATe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:CP,color:fP,border:iP.border,borderRight:`1px solid ${hP}`,paddingRight:iP.paddingRight},".cm-activeLineGutter":{backgroundColor:hP,color:pP,fontWeight:iP.fontWeight},".cm-lineNumbers":{fontSize:iP.fontSize,lineHeight:iP.lineHeight},".cm-foldGutter":{fontSize:iP.fontSize,lineHeight:iP.lineHeight},".cm-foldGutter .cm-gutterElement":{color:fP,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:pP},".cm-insertedLine":{textDecoration:rP.insertedTextDecoration,backgroundColor:AP,color:MP,padding:rP.insertedLinePadding,borderRadius:rP.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:rP.insertedTextDecoration,backgroundColor:`${AP} !important`,color:MP,padding:rP.insertedLinePadding,borderRadius:rP.borderRadious,border:`1px solid ${MP}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:rP.deletedTextDecoration,backgroundColor:jP,color:NP,padding:rP.insertedLinePadding,borderRadius:rP.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:rP.deletedTextDecoration,backgroundColor:`${jP} !important`,color:NP,padding:rP.insertedLinePadding,borderRadius:rP.borderRadious,border:`1px solid ${NP}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:TP,border:`1px solid ${fP}`,borderRadius:uP.borderRadius,padding:uP.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:TP,border:`none`},"& > ul > li":{padding:uP.padding,lineHeight:uP.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:EP,color:pP,borderRadius:uP.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:fP,paddingRight:uP.paddingRight},"& > ul > li > span.cm-completionDetail":{color:fP,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:TP,borderBottomColor:TP},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${SP}`},"&-warning":{borderLeft:`3px solid ${OP}`},"&-info":{borderLeft:`3px solid ${kP}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${SP}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${OP}`},".cm-matchingBracket":{backgroundColor:FTe,outline:`1px solid ${ITe}`,borderRadius:oP.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${MTe}20`,outline:`1px solid ${SP}`,borderRadius:oP.borderRadius},".cm-selectionMatch":{backgroundColor:PTe,outline:`1px solid ${dP}50`,borderRadius:oP.borderRadius},".cm-foldPlaceholder":{backgroundColor:TP,color:fP,border:`1px dotted ${fP}70`,borderRadius:sP.borderRadius,padding:sP.padding,margin:sP.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${wP}, 0 0 0 3px ${bP}40`},"& .cm-scroller::-webkit-scrollbar":{width:cP.width,height:cP.height},"& .cm-scroller::-webkit-scrollbar-track":{background:CP},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:dP,borderRadius:cP.borderRadius,border:`3px solid ${CP}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:fP},".cm-ghostText":{opacity:`0.5`,color:fP}},{dark:!0}),ve(Ae.define([{tag:U.keyword,color:xP,fontWeight:`bold`},{tag:U.controlKeyword,color:xP,fontWeight:`bold`},{tag:U.moduleKeyword,color:xP,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:pP},{tag:[U.variableName],color:pP},{tag:[U.propertyName],color:bP,fontStyle:`normal`},{tag:[U.typeName],color:yP},{tag:[U.className],color:_P,fontStyle:`italic`},{tag:[U.namespace],color:bP,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:xP},{tag:[U.bracket],color:fP},{tag:[U.brace],color:fP},{tag:[U.punctuation],color:fP},{tag:[U.function(U.variableName)],color:bP},{tag:[U.labelName],color:bP,fontStyle:`italic`},{tag:[U.definition(U.function(U.variableName))],color:bP},{tag:[U.definition(U.variableName)],color:pP},{tag:U.number,color:gP},{tag:U.changed,color:gP},{tag:U.annotation,color:SP,fontStyle:`italic`},{tag:U.modifier,color:gP,fontStyle:`italic`},{tag:U.self,color:gP},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:xP},{tag:[U.atom,U.bool,U.special(U.variableName)],color:gP},{tag:[U.processingInstruction,U.inserted],color:vP},{tag:[U.special(U.string),U.regexp],color:`#b4f9f8`},{tag:U.string,color:vP},{tag:U.definition(U.typeName),color:yP,fontWeight:`bold`},{tag:[U.definition(U.name),U.separator],color:pP},{tag:U.meta,color:fP},{tag:U.comment,fontStyle:`italic`,color:fP},{tag:U.docComment,fontStyle:`italic`,color:fP},{tag:[U.tagName],color:xP},{tag:[U.attributeName],color:_P},{tag:[U.heading],fontWeight:`bold`,color:`#89ddff`},{tag:U.heading1,color:`#89ddff`,fontWeight:`bold`},{tag:U.heading2,color:`#89ddff`},{tag:U.heading3,color:`#89ddff`},{tag:U.heading4,color:`#89ddff`},{tag:U.heading5,color:`#89ddff`},{tag:U.heading6,color:`#89ddff`},{tag:[U.strong],fontWeight:`bold`,color:pP},{tag:[U.emphasis],fontStyle:`italic`,color:yP},{tag:[U.link],color:LTe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:kP,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:pP,textDecoration:`underline wavy`,borderBottom:`1px wavy ${SP}`},{tag:[U.strikethrough],color:SP,textDecoration:`line-through`},{tag:U.constant(U.name),color:gP},{tag:U.deleted,color:SP},{tag:U.squareBracket,color:fP},{tag:U.angleBracket,color:fP},{tag:U.monospace,color:pP},{tag:[U.contentSeparator],color:bP},{tag:U.quote,color:fP}]))],PP={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},zTe={borderLeftWidth:`2px`},FP={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},IP={paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},LP={borderRadius:`4px`,padding:`2px 10px`},BTe={borderRadius:`2px`},RP={borderRadius:`2px`},zP={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},BP={width:`12px`,height:`12px`,borderRadius:`6px`},VP={borderRadius:`4px`,padding:`2px 6px`},HP={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},VTe=`#1e1e1e`,UP=`#252526`,WP=`#2d2d30`,GP=`#838383`,HTe=`#c6c6c6`,KP=`#d4d4d4`,qP=`#e9e9e9`,UTe=`#1c1c1c`,JP=`#569cd6`,WTe=`#c586c0`,YP=`#9cdcfe`,XP=`#4ec9b0`,ZP=`#dcdcaa`,GTe=`#b5cea8`,QP=`#ce9178`,$P=`#f44747`,eF=`#d7ba7d`,tF=`#6a9955`,nF=$P,rF=`#FFFFFF08`,iF=VTe,aF=UP,KTe=`#264F7899`,qTe=`#72a1ff59`,oF=HTe,JTe=`#ffffff15`,YTe=JP,sF=eF,cF=`#3794ff`,XTe=`#c586c0`,lF=`#1e3f1e80`,uF=`#4b1c1c80`,dF=`#6cc26f`,fF=`#f14c4c`,ZTe=[Te.theme({"&":{color:KP,backgroundColor:iF,fontSize:PP.fontSize,fontFamily:PP.fontFamily},".cm-content":{caretColor:oF,lineHeight:PP.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:oF,borderLeftWidth:zTe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${oF}99`,color:iF},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:KTe},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#72a1ff40`,outline:`1px solid ${JP}90`,color:qP,borderRadius:VP.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#3794ff90`,color:qP,padding:VP.padding,"& span":{color:qP}},".cm-search.cm-panel.cm-textfield":{color:KP,borderRadius:VP.borderRadius,padding:VP.padding},".cm-panels":{backgroundColor:UP,color:KP,borderRadius:`3px`,boxShadow:`0 2px 6px rgba(0, 0, 0, 0.45)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${WP}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${WP}`},".cm-panel button":{backgroundColor:WP,color:KP,border:`1px solid ${WP}`,borderRadius:LP.borderRadius,padding:LP.padding},".cm-panel button:hover":{backgroundColor:`#3a3a3a`,border:`1px solid ${GP}80`},".cm-activeLine":{backgroundColor:rF,borderRadius:BTe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:UTe,color:GP,border:`none`,borderRight:`1px solid ${WP}`,paddingRight:IP.paddingRight},".cm-activeLineGutter":{backgroundColor:rF,color:qP,fontWeight:IP.fontWeight},".cm-lineNumbers":{fontSize:IP.fontSize,lineHeight:IP.lineHeight},".cm-foldGutter":{fontSize:IP.fontSize,lineHeight:IP.lineHeight},".cm-foldGutter .cm-gutterElement":{color:GP,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:qP},".cm-insertedLine":{textDecoration:FP.insertedTextDecoration,backgroundColor:lF,color:dF,padding:FP.insertedLinePadding,borderRadius:FP.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:FP.insertedTextDecoration,backgroundColor:`${lF} !important`,color:dF,padding:FP.insertedLinePadding,borderRadius:FP.borderRadious,border:`1px solid ${dF}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:FP.deletedTextDecoration,backgroundColor:uF,color:fF,padding:FP.insertedLinePadding,borderRadius:FP.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:FP.deletedTextDecoration,backgroundColor:`${uF} !important`,color:fF,padding:FP.insertedLinePadding,borderRadius:FP.borderRadious,border:`1px solid ${fF}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:aF,border:`1px solid ${WP}`,borderRadius:HP.borderRadius,padding:HP.padding,boxShadow:`0 3px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:aF,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:HP.padding,lineHeight:HP.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#04395e`,color:qP,borderRadius:HP.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:GP,paddingRight:HP.paddingRight},"& > ul > li > span.cm-completionDetail":{color:GP,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:aF,borderBottomColor:aF},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${nF}`},"&-warning":{borderLeft:`3px solid ${sF}`},"&-info":{borderLeft:`3px solid ${cF}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${nF}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${sF}`},".cm-matchingBracket":{backgroundColor:JTe,outline:`1px solid ${YTe}80`,borderRadius:RP.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${$P}40`,outline:`1px solid ${nF}`,borderRadius:RP.borderRadius},".cm-selectionMatch":{backgroundColor:qTe,outline:`1px solid ${WP}70`,borderRadius:RP.borderRadius},".cm-foldPlaceholder":{backgroundColor:aF,color:GP,border:`1px dotted ${GP}70`,borderRadius:zP.borderRadius,padding:zP.padding,margin:zP.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 1px ${WP}`},"& .cm-scroller::-webkit-scrollbar":{width:BP.width,height:BP.height},"& .cm-scroller::-webkit-scrollbar-track":{background:iF},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#424242`,borderRadius:BP.borderRadius,border:`3px solid ${iF}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#525252`},".cm-ghostText":{opacity:`0.5`,color:GP}},{dark:!0}),ve(Ae.define([{tag:U.keyword,color:JP,fontWeight:`bold`},{tag:U.controlKeyword,color:WTe,fontWeight:`bold`},{tag:U.moduleKeyword,color:JP,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:KP},{tag:[U.variableName],color:YP},{tag:[U.propertyName],color:YP,fontStyle:`normal`},{tag:[U.typeName],color:XP},{tag:[U.className],color:XP,fontStyle:`normal`},{tag:[U.namespace],color:KP,fontStyle:`normal`},{tag:[U.operator,U.operatorKeyword],color:KP},{tag:[U.bracket],color:KP},{tag:[U.brace],color:KP},{tag:[U.punctuation],color:KP},{tag:[U.function(U.variableName)],color:ZP},{tag:[U.labelName],color:ZP,fontStyle:`normal`},{tag:[U.definition(U.function(U.variableName))],color:ZP},{tag:[U.definition(U.variableName)],color:YP},{tag:U.number,color:GTe},{tag:U.changed,color:eF},{tag:U.annotation,color:eF,fontStyle:`italic`},{tag:U.modifier,color:JP,fontStyle:`normal`},{tag:U.self,color:JP},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:YP},{tag:[U.atom,U.bool,U.special(U.variableName)],color:JP},{tag:[U.processingInstruction,U.inserted],color:QP},{tag:[U.special(U.string),U.regexp],color:`#d16969`},{tag:U.string,color:QP},{tag:U.definition(U.typeName),color:XP,fontWeight:`bold`},{tag:[U.definition(U.name),U.separator],color:KP},{tag:U.meta,color:GP},{tag:U.comment,fontStyle:`italic`,color:tF},{tag:U.docComment,fontStyle:`italic`,color:tF},{tag:[U.tagName],color:JP},{tag:[U.attributeName],color:YP},{tag:[U.heading],fontWeight:`bold`,color:JP},{tag:U.heading1,color:JP,fontWeight:`bold`},{tag:U.heading2,color:JP},{tag:U.heading3,color:JP},{tag:U.heading4,color:JP},{tag:U.heading5,color:JP},{tag:U.heading6,color:JP},{tag:[U.strong],fontWeight:`bold`,color:JP},{tag:[U.emphasis],fontStyle:`italic`,color:XP},{tag:[U.link],color:XTe,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:cF,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:KP,textDecoration:`underline wavy`,borderBottom:`1px wavy ${nF}`},{tag:[U.strikethrough],color:nF,textDecoration:`line-through`},{tag:U.constant(U.name),color:YP},{tag:U.deleted,color:nF},{tag:U.squareBracket,color:KP},{tag:U.angleBracket,color:KP},{tag:U.monospace,color:KP},{tag:[U.contentSeparator],color:KP},{tag:U.quote,color:tF}]))],pF={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},QTe={borderLeftWidth:`2px`},mF={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},hF={paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},gF={borderRadius:`4px`,padding:`2px 10px`},$Te={borderRadius:`2px`},_F={borderRadius:`2px`},vF={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},yF={width:`12px`,height:`12px`,borderRadius:`6px`},bF={borderRadius:`4px`,padding:`2px 6px`},xF={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},eEe=`#ffffff`,SF=`#f3f3f3`,CF=`#d6d6d6`,wF=`#6b6b6b`,tEe=`#000000`,TF=`#383a42`,EF=`#1f1f1f`,nEe=`#f5f5f5`,DF=`#0064ff`,OF=`#af00db`,kF=`#0070c1`,AF=`#267f99`,jF=`#795e26`,rEe=`#098658`,MF=`#a31515`,NF=`#e51400`,PF=`#795e26`,FF=`#008000`,IF=NF,LF=`#99999926`,RF=eEe,zF=SF,iEe=`#add6ff`,aEe=`#a8ac9480`,BF=tEe,oEe=`#007acc20`,sEe=`#007acc`,VF=`#bf8803`,HF=`#006ab1`,cEe=`#9e46d0`,UF=`#ddfbe0`,WF=`#ffebec`,GF=`#22863a`,KF=`#e51400`,lEe=[Te.theme({"&":{color:TF,backgroundColor:RF,fontSize:pF.fontSize,fontFamily:pF.fontFamily},".cm-content":{caretColor:BF,lineHeight:pF.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:BF,borderLeftWidth:QTe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${BF}99`,color:RF},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:iEe},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#bbdefb`,outline:`1px solid ${kF}90`,color:EF,borderRadius:bF.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#90caf9`,color:EF,padding:bF.padding,"& span":{color:EF}},".cm-search.cm-panel.cm-textfield":{color:TF,borderRadius:bF.borderRadius,padding:bF.padding},".cm-panels":{backgroundColor:SF,color:TF,borderRadius:`3px`,boxShadow:`0 2px 6px rgba(0, 0, 0, 0.15)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${CF}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${CF}`},".cm-panel button":{backgroundColor:RF,color:TF,border:`1px solid ${CF}`,borderRadius:gF.borderRadius,padding:gF.padding},".cm-panel button:hover":{backgroundColor:`#e8e8e8`,border:`1px solid ${wF}80`},".cm-activeLine":{backgroundColor:LF,borderRadius:$Te.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:nEe,color:`#237893`,border:`none`,borderRight:`1px solid ${CF}`,paddingRight:hF.paddingRight},".cm-activeLineGutter":{backgroundColor:LF,color:`#0b216f`,fontWeight:hF.fontWeight},".cm-lineNumbers":{fontSize:hF.fontSize,lineHeight:hF.lineHeight},".cm-foldGutter":{fontSize:hF.fontSize,lineHeight:hF.lineHeight},".cm-foldGutter .cm-gutterElement":{color:`#237893`,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:`#0b216f`},".cm-insertedLine":{textDecoration:mF.insertedTextDecoration,backgroundColor:UF,color:GF,padding:mF.insertedLinePadding,borderRadius:mF.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:mF.insertedTextDecoration,backgroundColor:`${UF} !important`,color:GF,padding:mF.insertedLinePadding,borderRadius:mF.borderRadious,border:`1px solid ${GF}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:mF.deletedTextDecoration,backgroundColor:WF,color:KF,padding:mF.insertedLinePadding,borderRadius:mF.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:mF.deletedTextDecoration,backgroundColor:`${WF} !important`,color:KF,padding:mF.insertedLinePadding,borderRadius:mF.borderRadious,border:`1px solid ${KF}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:zF,border:`1px solid ${CF}`,borderRadius:xF.borderRadius,padding:xF.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:zF,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:xF.padding,lineHeight:xF.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#dcebfc`,color:EF,borderRadius:xF.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:wF,paddingRight:xF.paddingRight},"& > ul > li > span.cm-completionDetail":{color:wF,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:zF,borderBottomColor:zF},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${IF}`},"&-warning":{borderLeft:`3px solid ${VF}`},"&-info":{borderLeft:`3px solid ${HF}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${IF}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${VF}`},".cm-matchingBracket":{backgroundColor:oEe,outline:`1px solid ${sEe}80`,borderRadius:_F.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${NF}20`,outline:`1px solid ${IF}`,borderRadius:_F.borderRadius},".cm-selectionMatch":{backgroundColor:aEe,outline:`1px solid ${CF}70`,borderRadius:_F.borderRadius},".cm-foldPlaceholder":{backgroundColor:zF,color:wF,border:`1px dotted ${wF}70`,borderRadius:vF.borderRadius,padding:vF.padding,margin:vF.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 1px ${CF}`},"& .cm-scroller::-webkit-scrollbar":{width:yF.width,height:yF.height},"& .cm-scroller::-webkit-scrollbar-track":{background:RF},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#dadada`,borderRadius:yF.borderRadius,border:`3px solid ${RF}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#cccccc`},".cm-ghostText":{opacity:`0.5`,color:wF}},{dark:!1}),ve(Ae.define([{tag:U.keyword,color:DF,fontWeight:`bold`},{tag:U.controlKeyword,color:OF,fontWeight:`bold`},{tag:U.moduleKeyword,color:DF,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:TF},{tag:[U.variableName],color:kF},{tag:[U.propertyName],color:kF,fontStyle:`normal`},{tag:[U.typeName],color:AF},{tag:[U.className],color:AF,fontStyle:`normal`},{tag:[U.namespace],color:TF,fontStyle:`normal`},{tag:[U.operator,U.operatorKeyword],color:TF},{tag:[U.bracket],color:TF},{tag:[U.brace],color:TF},{tag:[U.punctuation],color:TF},{tag:[U.function(U.variableName)],color:jF},{tag:[U.labelName],color:jF,fontStyle:`normal`},{tag:[U.definition(U.function(U.variableName))],color:jF},{tag:[U.definition(U.variableName)],color:kF},{tag:U.number,color:rEe},{tag:U.changed,color:PF},{tag:U.annotation,color:PF,fontStyle:`italic`},{tag:U.modifier,color:DF,fontStyle:`normal`},{tag:U.self,color:DF},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:kF},{tag:[U.atom,U.bool,U.special(U.variableName)],color:DF},{tag:[U.processingInstruction,U.inserted],color:MF},{tag:[U.special(U.string),U.regexp],color:OF},{tag:U.string,color:MF},{tag:U.definition(U.typeName),color:AF,fontWeight:`bold`},{tag:[U.definition(U.name),U.separator],color:TF},{tag:U.meta,color:wF},{tag:U.comment,fontStyle:`italic`,color:FF},{tag:U.docComment,fontStyle:`italic`,color:FF},{tag:[U.tagName],color:DF},{tag:[U.attributeName],color:kF},{tag:[U.heading],fontWeight:`bold`,color:DF},{tag:U.heading1,color:DF,fontWeight:`bold`},{tag:U.heading2,color:DF},{tag:U.heading3,color:DF},{tag:U.heading4,color:DF},{tag:U.heading5,color:DF},{tag:U.heading6,color:DF},{tag:[U.strong],fontWeight:`bold`,color:DF},{tag:[U.emphasis],fontStyle:`italic`,color:kF},{tag:[U.link],color:cEe,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:HF,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:TF,textDecoration:`underline wavy`,borderBottom:`1px wavy ${IF}`},{tag:[U.strikethrough],color:IF,textDecoration:`line-through`},{tag:U.constant(U.name),color:kF},{tag:U.deleted,color:IF},{tag:U.squareBracket,color:TF},{tag:U.angleBracket,color:TF},{tag:U.monospace,color:TF},{tag:[U.contentSeparator],color:TF},{tag:U.quote,color:FF}]))];function qF(){return qF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qF.apply(null,arguments)}function uEe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var JF=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,YF=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(JF(e)):JF,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return rt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=We(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Ce(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let a=r.charCodeAt(e),o=this.match(a,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==a&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],a=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,a=!0)),a||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<`u`&&(YF.prototype[Symbol.iterator]=function(){return this});var XF={from:-1,to:-1,match:/.*/.exec(``)},ZF=`gm`+(/x/.unicode==null?``:`u`),QF=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=XF,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new tI(e,t,n,r,i);this.re=new RegExp(t,ZF+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=nI(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=nI(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},$F=new WeakMap,eI=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=$F.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return $F.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),$F.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},tI=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=XF,this.matchPos=nI(e,r),this.re=new RegExp(t,ZF+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=eI.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=nI(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=eI.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(QF.prototype[Symbol.iterator]=tI.prototype[Symbol.iterator]=function(){return this});function dEe(e){try{return new RegExp(e,ZF),!0}catch{return!1}}function nI(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}function rI(e){let t=$e(`input`,{class:`cm-textfield`,name:`line`,value:String(e.state.doc.lineAt(e.state.selection.main.head).number)}),n=$e(`form`,{class:`cm-gotoLine`,onkeydown:t=>{t.keyCode==27?(t.preventDefault(),e.dispatch({effects:iI.of(!1)}),e.focus()):t.keyCode==13&&(t.preventDefault(),r())},onsubmit:e=>{e.preventDefault(),r()}},$e(`label`,e.state.phrase(`Go to line`),`: `,t),` `,$e(`button`,{class:`cm-button`,type:`submit`},e.state.phrase(`go`)),$e(`button`,{name:`close`,onclick:()=>{e.dispatch({effects:iI.of(!1)}),e.focus()},"aria-label":e.state.phrase(`close`),type:`button`},[`×`]));function r(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:r}=e,i=r.doc.lineAt(r.selection.main.head),[,a,o,s,c]=n,l=s?+s.slice(1):0,u=o?+o:i.number;if(o&&c){let e=u/100;a&&(e=e*(a==`-`?-1:1)+i.number/r.doc.lines),u=Math.round(r.doc.lines*e)}else o&&a&&(u=u*(a==`-`?-1:1)+i.number);let d=r.doc.line(Math.max(1,Math.min(r.doc.lines,u))),f=Re.cursor(d.from+Math.max(0,Math.min(l,d.length)));e.dispatch({effects:[iI.of(!1),Te.scrollIntoView(f.from,{y:`center`})],selection:f}),e.focus()}return{dom:n}}var iI=Ne.define(),aI=it.define({create(){return!0},update(e,t){for(let n of t.effects)n.is(iI)&&(e=n.value);return e},provide:e=>je.from(e,e=>e?rI:null)}),fEe=e=>{let t=Ze(e,rI);if(!t){let n=[iI.of(!0)];e.state.field(aI,!1)??n.push(Ne.appendConfig.of([aI,pEe])),e.dispatch({effects:n}),t=Ze(e,rI)}return t&&t.dom.querySelector(`input`).select(),!0},pEe=Te.baseTheme({".cm-panel.cm-gotoLine":{padding:`2px 6px 4px`,position:`relative`,"& label":{fontSize:`80%`},"& [name=close]":{position:`absolute`,top:`0`,bottom:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:`0`}}}),mEe={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},oI=Ke.define({combine(e){return ue(e,mEe,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function hEe(e){let t=[bEe,yEe];return e&&t.push(oI.of(e)),t}var gEe=at.mark({class:`cm-selectionMatch`}),_Ee=at.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function sI(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=Fe.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=Fe.Word)}function vEe(e,t,n,r){return e(t.sliceDoc(n,n+1))==Fe.Word&&e(t.sliceDoc(r-1,r))==Fe.Word}var yEe=pe.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(oI),{state:n}=e,r=n.selection;if(r.ranges.length>1)return at.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return at.none;let e=n.wordAt(i.head);if(!e)return at.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return at.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(sI(o,n,i.from,i.to)&&vEe(o,n,i.from,i.to)))return at.none}else if(a=n.sliceDoc(i.from,i.to),!a)return at.none}let s=[];for(let r of e.visibleRanges){let e=new YF(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||sI(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(_Ee.range(r,a)):(r>=i.to||a<=i.from)&&s.push(gEe.range(r,a)),s.length>t.maxMatches))return at.none}}return at.set(s)}},{decorations:e=>e.decorations}),bEe=Te.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),xEe=({state:e,dispatch:t})=>{let{selection:n}=e,r=Re.create(n.ranges.map(t=>e.wordAt(t.head)||Re.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function SEe(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new YF(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new YF(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var CEe=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return xEe({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=SEe(e,r);return i?(t(e.update({selection:e.selection.addRange(Re.range(i.from,i.to),!1),effects:Te.scrollIntoView(i.to)})),!0):!1},cI=Ke.define({combine(e){return ue(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new FEe(e),scrollToMatch:e=>Te.scrollIntoView(e)})}}),lI=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||dEe(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
959
|
+
`};function Wxe(e,t,n,r){if(t===n)return[...e];let i=e.filter(e=>e!==t),a=i.indexOf(n);if(a<0)return[...e];let o=r===`before`?a:a+1;return i.splice(o,0,t),i}function Gxe(e,t){let n=new Set(t),r=e.filter(e=>n.has(e)),i=t.filter(e=>!r.includes(e));return[...r,...i]}function Kxe({tabs:e,selectedTab:t,onTabChange:n,onTabClose:r,onTabOrderChange:i,actions:a,onTabBarDoubleClick:o,className:s=``,classNames:c,showHeaderShell:l=!0,showSelectionIndicator:u=!0,decorateStrip:d=!0,selectionIndicatorLayout:f=`underline`},p){let[m,h]=(0,q.useState)(e[0]?.id??``),[g,_]=(0,q.useState)(null),v=(0,q.useRef)(null),y=(0,q.useRef)(e.map(e=>e.id)),b=(0,q.useRef)(null),x=(0,q.useRef)(null),S=(0,q.useRef)(null),C=(0,q.useRef)(null),w=(0,q.useRef)(null),T=(0,q.useRef)(null),E=(0,q.useRef)(null),D=(0,q.useRef)(null),O=(0,q.useRef)(new Map),k=(0,q.useRef)(new Map),A=t??m,j=typeof i==`function`&&e.length>1,M=e.map(e=>e.id),N=M.join(`|`),P=(0,q.useMemo)(()=>new Map(e.map(e=>[e.id,e])),[e]),F=(0,q.useMemo)(()=>{let e=Gxe(y.current,M);return y.current=e,e},[M]).map(e=>P.get(e)).filter(e=>e!==void 0),I=(0,q.useId)().replace(/:/g,`_`),L=(0,q.useMemo)(()=>Uxe(I),[I]);CT(`tabs:${I}`,L),(0,q.useImperativeHandle)(p,()=>({get root(){return b.current},getTrigger(e){return O.current.get(e)??null},getPanel(e){return k.current.get(e)??null},getHeaderShell(){return S.current??T.current},getHeaderForeground(){return C.current},getSelectionIndicator(){return E.current},getActiveTabId(){return A||null}}),[A]);let R=(0,q.useCallback)(()=>{let e=E.current,t=T.current??w.current,n=A?O.current.get(A):null,r=n?.closest(`[data-tab-item="true"]`)??n;if(!e)return;if(!u||!t||!r){e.style.opacity=`0`,e.style.width=`0px`,e.style.height=f===`overlay`?`0px`:``,e.style.transform=f===`overlay`?`translate(0px, 0px)`:`translateX(0px)`;return}let i=t.getBoundingClientRect(),a=r.getBoundingClientRect();if(f===`underline`){let t=getComputedStyle(e),n=parseFloat(t.getPropertyValue(`--tabs-selection-inline-inset`))||10,r=parseFloat(t.getPropertyValue(`--tabs-selection-min-width`))||40,o=Math.max(r,a.width-n*2),s=a.left-i.left+(a.width-o)/2;e.style.opacity=`1`,e.style.width=`${o}px`,e.style.height=``,e.style.transform=`translateX(${s}px)`;return}e.style.opacity=`1`,e.style.width=`${a.width}px`,e.style.height=`${a.height+1}px`,e.style.transform=`translate(${a.left-i.left}px, ${a.top-i.top}px)`},[A,f,u]);(0,q.useLayoutEffect)(()=>{R()},[R,e]),(0,q.useLayoutEffect)(()=>{if(!u)return;let e=D.current;if(!e)return;let t=()=>{R()};if(e.addEventListener(`scroll`,t,{passive:!0}),typeof ResizeObserver>`u`)return()=>{e.removeEventListener(`scroll`,t)};let n=new ResizeObserver(()=>{R()});n.observe(e),x.current&&n.observe(x.current),T.current&&n.observe(T.current),w.current&&n.observe(w.current);let r=A?O.current.get(A):null,i=r?.closest(`[data-tab-item="true"]`)??r;return i&&n.observe(i),()=>{e.removeEventListener(`scroll`,t),n.disconnect()}},[A,u,R,N]);let z=e=>{t||h(e),n?.(e)},B=(0,q.useCallback)(e=>{v.current=e,_(e)},[]),V=(0,q.useCallback)(()=>{uD=null,B(null)},[B]),ee=(0,q.useCallback)((e,t)=>{if(!j||!uD)return;let n=Wxe(M,uD,e,t);n.some((e,t)=>e!==M[t])&&i?.(n)},[i,j,M]),H=(0,q.useCallback)((e,t)=>{!j||!e.dataTransfer||(uD=t,e.dataTransfer.setData(`text/plain`,t),e.dataTransfer.effectAllowed=`move`)},[j]),te=(0,q.useCallback)(()=>{V()},[V]),ne=(0,q.useCallback)((e,t)=>{if(!j||!uD)return;if(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`move`,t===uD){B(null);return}let n=e.currentTarget.getBoundingClientRect(),r=n.left+n.width/2;B({tabId:t,position:e.clientX<r?`before`:`after`})},[j,B]),re=(0,q.useCallback)((e,t)=>{if(!j)return;e.preventDefault(),e.stopPropagation();let n=v.current;ee(t,n?.tabId===t?n.position:`after`),V()},[ee,j,V]),ie=(0,q.useCallback)(e=>{if(j){if(e.preventDefault(),uD&&v.current===null){let e=M.filter(e=>e!==uD);e.push(uD),e.some((e,t)=>e!==M[t])&&i?.(e)}V()}},[i,j,V,M]),ae=(0,q.useCallback)(e=>{!j||!uD||(e.preventDefault(),e.dataTransfer.dropEffect=`move`)},[j]);if(e.length===0)return null;let oe=dv(`tabs-header relative sticky top-0 z-20 flex min-w-0 items-stretch`,c?.header),se=dv(f===`underline`?`tabs-header-shell bg-card/95 pointer-events-none absolute inset-0 z-0 rounded-t-md rounded-b-none border border-b-0 border-zinc-500/15 backdrop-blur-sm`:`tabs-header-shell bg-card/95 pointer-events-none absolute inset-0 z-0 rounded-md border border-zinc-500/15 shadow-[inset_0_-1px_0_color-mix(in_srgb,var(--border)_85%,transparent)] backdrop-blur-sm`,c?.headerShell),ce=dv(`tabs-header-foreground relative z-20 flex min-w-0 flex-1`,c?.headerForeground),le=dv(`tabs-header-frame relative flex min-w-0 flex-1 items-stretch`,c?.headerFrame),ue=dv(`tabs-strip relative flex min-w-0 flex-1 items-stretch px-4`,c?.strip),de=dv(`tabs-button scrollbar-none flex min-w-0 flex-1 gap-1 overflow-x-auto`,c?.list),fe=dv(`group relative z-10 flex h-full shrink-0 items-stretch`,c?.item),pe=dv(c?.activeItem),me=dv(c?.inactiveItem),he=dv(`relative m-0 flex h-full min-w-0 flex-1 px-2 py-2 text-center text-sm font-medium transition-colors`,c?.buttonBase),ge=dv(`inline-flex h-full items-center gap-2 relative`,c?.buttonInner),_e=dv(`tab-selected text-foreground`,c?.activeButton),ve=dv(`text-muted-foreground hover:text-foreground`,c?.inactiveButton),ye=dv(c?.activeButtonInner),U=dv(c?.inactiveButtonInner),be=dv(`relative z-20 flex shrink-0 items-center`,c?.tabActions),xe=dv(`tabs-actions relative flex shrink-0 items-center px-1`,c?.actions),Se=dv(`tabs-actions-divider bg-border/60 absolute inset-y-0 left-0 w-px`,c?.actionsDivider),Ce=dv(`tabs-selection-track bg-border/85 pointer-events-none absolute inset-x-0 bottom-0 h-px`,c?.selectionTrack),we=dv(f===`underline`?`pointer-events-none absolute inset-x-0 top-0 bottom-[-1px] z-10 overflow-hidden`:`pointer-events-none absolute inset-0 z-10 overflow-hidden`,c?.selectionIndicatorViewport),Te=dv(f===`underline`?`tabs-selection-indicator absolute bottom-0 left-0 h-[3px] rounded-full bg-primary opacity-0 transition-[transform,width,opacity] duration-280 ease-[cubic-bezier(0.22,1,0.36,1)] [--tabs-selection-inline-inset:10px] [--tabs-selection-min-width:40px]`:`tabs-selection-indicator border-primary bg-background/70 duration-280 absolute left-0 top-0 border-b opacity-0 transition-[transform,width,height,opacity] ease-[cubic-bezier(0.22,1,0.36,1)]`,c?.selectionIndicator),Ee=e=>{o&&(e.target.closest(`[data-tab-item="true"]`)||o())},De=e.map(e=>{let t=g?.tabId===e.id?{boxShadow:g.position===`before`?`inset 2px 0 0 var(--border)`:`inset -2px 0 0 var(--border)`}:void 0;return(0,K.jsxs)(`div`,{"data-tab-item":`true`,"data-tab-id":e.id,className:dv(fe,A===e.id?pe:me),style:t,children:[(0,K.jsxs)(`button`,{ref:t=>{O.current.set(e.id,t)},"data-tab-trigger":`true`,"data-tab-id":e.id,draggable:j,onClick:()=>z(e.id),onDragStart:t=>H(t,e.id),onDragEnd:te,onDragOver:t=>ne(t,e.id),onDrop:t=>re(t,e.id),className:`${he} ${A===e.id?_e:ve} ${j?`cursor-grab active:cursor-grabbing`:``}`,title:e.title,children:[(0,K.jsxs)(`span`,{"data-tabs-button-inner":`true`,className:`${ge} ${A===e.id?ye:U}`,children:[e.icon,e.label]}),e.badge&&(0,K.jsx)(`span`,{"data-tabs-badge":`true`,className:`pointer-events-none absolute right-0 top-0 z-30`,children:e.badge})]}),(e.action||e.closable&&r)&&(0,K.jsxs)(`span`,{"data-tabs-tab-actions":`true`,className:be,children:[e.action,e.closable&&r&&(0,K.jsx)(`button`,{type:`button`,"aria-label":`Close ${e.title??e.id}`,onClick:t=>{t.stopPropagation(),r(e.id)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.stopPropagation(),r(e.id))},draggable:!1,className:`rounded-[var(--tabs-close-radius,0.25rem)] p-1 transition ${e.closeButtonVisibility===`always`?`opacity-100`:`opacity-0 focus-visible:opacity-100 group-hover:opacity-100`} ${A===e.id?dv(`text-current/80 hover:text-foreground`,c?.closeButtonActive):dv(`text-muted-foreground hover:text-foreground`,c?.closeButtonInactive)}`,children:(0,K.jsx)(Yf,{className:`h-3 w-3`})})]})]},e.id)});return(0,K.jsxs)(`div`,{id:I,ref:b,"data-tabs-strip-decoration":d?`on`:`off`,className:`relative isolate flex min-h-0 min-w-0 flex-1 flex-col ${s}`,children:[(0,K.jsx)(`div`,{ref:x,className:oe,children:(0,K.jsxs)(K.Fragment,{children:[l&&(0,K.jsx)(`div`,{ref:S,"data-tabs-header-shell":`true`,className:se}),(0,K.jsx)(`div`,{ref:C,"data-tabs-header-foreground":`true`,className:ce,children:(0,K.jsxs)(`div`,{ref:w,className:le,children:[(0,K.jsxs)(`div`,{ref:T,className:ue,children:[(0,K.jsx)(`div`,{ref:D,className:de,onDoubleClick:Ee,onDragOver:ae,onDrop:ie,children:De}),u&&(0,K.jsx)(`div`,{className:we,children:(0,K.jsx)(`div`,{ref:E,"data-tabs-selection-indicator":`true`,"aria-hidden":`true`,className:Te})})]}),a&&(0,K.jsxs)(`div`,{"data-tabs-actions":`true`,className:xe,children:[d&&(0,K.jsx)(`div`,{"aria-hidden":`true`,className:Se}),a]}),d&&(0,K.jsx)(`div`,{"aria-hidden":`true`,className:Ce})]})})]})}),(0,K.jsx)(`div`,{className:`relative flex min-h-0 flex-1 overflow-hidden`,children:F.map(e=>e.unmountOnHide?A===e.id&&(0,K.jsx)(`div`,{ref:t=>{k.current.set(e.id,t)},"data-tab-panel":e.id,"data-tab-panel-state":`active`,className:`flex min-h-0 flex-1 flex-col`,children:e.content},e.id):(0,K.jsx)(`div`,{ref:t=>{k.current.set(e.id,t)},"data-tab-panel":e.id,"data-tab-panel-state":A===e.id?`active`:`inactive`,"aria-hidden":A===e.id?void 0:!0,className:A===e.id?`relative flex min-h-0 flex-1 flex-col`:`pointer-events-none absolute inset-0 hidden min-h-0 flex-col overflow-hidden`,children:e.content},e.id))})]})}var dD=(0,q.forwardRef)(Kxe);function qxe({backTo:e,backTitle:t,headerRef:n,sharedDescriptor:r,icon:i,title:a,subtitle:o,toolbar:s}){return(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,K.jsx)(Rd,{to:e,vt:{source:n,sharedElements:r},className:`hover:bg-muted rounded-md p-2 transition-colors`,title:t,children:(0,K.jsx)(Wd,{className:`h-5 w-5`})}),(0,K.jsxs)(`div`,{ref:n,...fd(r,`container`),className:`flex min-w-0 flex-col gap-1`,children:[(0,K.jsxs)(`h1`,{className:`font-nav flex min-w-0 items-center gap-2 text-2xl font-bold`,children:[(0,K.jsx)(i,{...fd(r,`icon`),className:`h-6 w-6 shrink-0`}),(0,K.jsx)(`span`,{...fd(r,`title`),className:`truncate`,children:a})]}),(0,K.jsx)(`p`,{className:`text-muted-foreground truncate text-sm`,children:o})]})]}),s]})}function fD({diagnostics:e,children:t,...n}){return(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 p-4`,children:[(0,K.jsx)(qxe,{...n}),(0,K.jsx)(Xxe,{diagnostics:e??[]}),t]})}function Jxe({handoff:e,fallbackTitle:t,fallbackSubtitle:n,loadingMessage:r,...i}){return(0,K.jsx)(fD,{...i,title:e?.title??t,subtitle:e?.subtitle??n,children:(0,K.jsxs)(`div`,{className:`vt-detail-content flex min-h-[240px] flex-1 flex-col`,"aria-busy":`true`,children:[(0,K.jsx)(xE,{children:r??`loading`}),(0,K.jsx)(AE,{count:6})]})})}function Yxe({tabsRef:e,tabs:t,selectedTab:n,onTabChange:r,className:i}){return(0,K.jsx)(`div`,{className:`vt-detail-content flex min-h-0 flex-1 flex-col`,children:(0,K.jsx)(dD,{ref:e,tabs:t,selectedTab:n,onTabChange:r,className:dv(`min-h-0 flex-1`,i)})})}function Xxe({diagnostics:e}){return e.length===0?null:(0,K.jsx)(`div`,{className:`border-border bg-muted/20 flex flex-col gap-2 rounded-md border p-3 text-sm`,children:e.map((e,t)=>(0,K.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,K.jsx)(Kf,{className:`mt-0.5 h-4 w-4 shrink-0 text-amber-500`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`font-medium capitalize`,children:e.level}),(0,K.jsxs)(`div`,{className:`text-muted-foreground`,children:[e.path?`${e.path}: `:``,e.message]})]})]},`${e.message}-${t}`))})}function pD({message:e,tone:t=`default`}){return(0,K.jsx)(`div`,{className:dv(`vt-detail-content flex min-h-[240px] flex-1 items-center justify-center rounded-lg border border-dashed p-6 text-sm`,t===`destructive`?`text-destructive border-destructive/40`:`text-muted-foreground`),children:e})}function mD({value:e,options:t,onChange:n,className:r=``,tone:i=`default`,presentation:a=`label`}){return(0,K.jsx)(`div`,{className:`inline-flex w-fit max-w-full shrink-0 self-start overflow-hidden rounded-md border ${i===`terminal`?`border-terminal-foreground/25 bg-terminal/70 text-terminal-foreground`:`border-border bg-card`} ${r}`,children:t.map((t,r)=>{let o=t.value===e,s=o?`bg-primary text-primary-foreground`:i===`terminal`?`text-terminal-foreground/72 hover:bg-terminal-foreground/10 hover:text-terminal-foreground`:`text-muted-foreground hover:bg-muted/60 hover:text-foreground`,c=t.ariaLabel??(typeof t.label==`string`?t.label:void 0),l=t.tooltip??c,u=a===`icon-only`?t.icon??t.label:a===`icon-label`&&t.icon?(0,K.jsxs)(K.Fragment,{children:[t.icon,(0,K.jsx)(`span`,{children:t.label})]}):t.label,d=(0,K.jsx)(`button`,{type:`button`,disabled:t.disabled,onClick:()=>n(t.value),"aria-pressed":o,"aria-label":a===`icon-only`?c:void 0,title:a===`icon-only`&&typeof c==`string`?c:void 0,className:`inline-flex items-center justify-center gap-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${a===`icon-only`?`h-8 w-8 p-0`:`px-3 py-1.5`} ${r>0?i===`terminal`?`border-terminal-foreground/20 border-l`:`border-border border-l`:``} ${s}`,children:u},t.value);return l?(0,K.jsx)(fv,{content:l,children:d},t.value):d})})}var Zxe=[`github`,`material`,`vscode`,`tokyo`,`gruvbox`,`monokai`,`nord`],Qxe=`github`,$xe=[{value:`github`,label:`GitHub`},{value:`material`,label:`Material`},{value:`vscode`,label:`VS Code`},{value:`tokyo`,label:`Tokyo Night`},{value:`gruvbox`,label:`Gruvbox`},{value:`monokai`,label:`Monokai`},{value:`nord`,label:`Nord`}];function hD(e){return Zxe.includes(e)}var eSe=[`HeaderMark`,`EmphasisMark`,`LinkMark`,`URL`,`HardBreak`,`QuoteMark`,`ListMark`],gD=at.mark({class:`cm-md-hidden`}),tSe=at.line({class:`cm-md-codeblock-line`}),nSe=at.line({class:`cm-md-codeblock-line-start`}),rSe=at.line({class:`cm-md-codeblock-line-end`}),iSe=at.line({class:`cm-md-codeblock-inactive`}),aSe=at.mark({class:`cm-md-link`}),oSe=at.mark({class:`cm-md-image`}),_D=at.mark({class:`cm-md-faded`}),sSe=at.mark({class:`cm-md-task-faded`}),cSe=at.mark({class:`cm-md-fence`}),lSe=(e,t)=>at.replace({widget:new uSe(e,t),inclusive:!1}),uSe=class extends we{constructor(e,t){super(),this.label=e,this.faded=t}eq(e){return this.label===e.label&&this.faded===e.faded}toDOM(){let e=document.createElement(`span`);return e.textContent=`${this.label}.`,e.className=`cm-md-olist${this.faded?` cm-md-olist-faded`:``}`,e}},dSe=class extends we{constructor(e){super(),this.faded=e}eq(e){return this.faded===e.faded}toDOM(){let e=document.createElement(`span`);return e.textContent=`•`,e.className=`cm-md-ulmark${this.faded?` cm-md-olist-faded`:``}`,e}},fSe=class extends we{constructor(e){super(),this.checked=e}eq(e){return this.checked===e.checked}toDOM(){let e=document.createElement(`span`);return e.className=`cm-md-task ${this.checked?`cm-md-task-checked`:``}`,e.ariaHidden=`true`,e}};function pSe(e,t,n,r){let i=e.state.doc.lineAt(t.from).number,a=e.state.doc.lineAt(t.to).number,o=t.to-t.from>3&&e.state.doc.sliceString(t.to-3,t.to)==="```";for(let t=i;t<=a;t++){let s=e.state.doc.line(t);n.push({from:s.from,to:s.from,decoration:tSe}),t===i&&(n.push({from:s.from,to:s.from,decoration:nSe}),!r&&o&&n.push({from:s.from,to:s.from,decoration:iSe})),t===a&&n.push({from:s.from,to:s.from,decoration:rSe})}}var mSe=class{decorations;constructor(e){this.decorations=this.buildDecorations(e)}update(e){(e.docChanged||e.viewportChanged||e.selectionSet)&&(this.decorations=this.buildDecorations(e.view))}buildDecorations(e){let t=[],n=e.state.selection.ranges.map(t=>{let n=e.state.doc.lineAt(t.from),r=e.state.doc.lineAt(t.to);return{from:Math.min(n.from,r.from),to:Math.max(n.to,r.to)}}),r=[];for(let{from:i,to:a}of e.visibleRanges)de(e.state).iterate({from:i,to:a,enter(i){let{name:a}=i.type,o=n.some(e=>i.from<e.to&&i.to>e.from),s=i.node.parent?.name??``,c=i.node.parent?.parent?.name??``,l=s.includes(`OrderedList`)||c.includes(`OrderedList`),u=e.state.doc.sliceString(i.from,i.to);if(a===`OrderedList`){r.push(1);return}if(a===`FencedCode`)return pSe(e,i,t,n.some(e=>i.from<e.to&&i.to>e.from)),!1;if(a===`Link`){let e=i.node.getChild(`LinkLabel`);e&&t.push({from:e.from,to:e.to,decoration:aSe})}if(a===`Image`&&t.push({from:i.from,to:i.to,decoration:oSe}),a===`ListMark`){if(l){let e=r[r.length-1]??1;o?t.push({from:i.from,to:i.to,decoration:_D}):t.push({from:i.from,to:i.to,decoration:lSe(e,!1)}),r.length&&(r[r.length-1]=e+1);return}o?t.push({from:i.from,to:i.to,decoration:_D}):t.push({from:i.from,to:i.to,decoration:at.replace({widget:new dSe(!1),inclusive:!1})});return}if(a===`TaskMarker`){let e=/\[[xX]\]/.test(u);o?t.push({from:i.from,to:i.to,decoration:sSe}):t.push({from:i.from,to:i.to,decoration:at.replace({widget:new fSe(e),inclusive:!1})});return}if(a===`CodeMark`||a===`CodeInfo`){let e=o?_D:cSe;t.push({from:i.from,to:i.to,decoration:e});return}if(a===`HeaderMark`){let e=o?_D:gD;t.push({from:i.from,to:i.to+1,decoration:e});return}if(eSe.includes(a)){if(o){t.push({from:i.from,to:i.to,decoration:_D});return}t.push({from:i.from,to:i.to,decoration:gD})}},leave(e){e.name===`OrderedList`&&r.pop()}});return t.sort((e,t)=>e.from-t.from||e.to-t.to),at.set(t.map(e=>e.decoration.range(e.from,e.to)))}},hSe=pe.fromClass(mSe,{decorations:e=>e.decorations}),gSe=Ae.define([{tag:U.heading1,fontWeight:`bold`,fontSize:`1.75em`,lineHeight:`1.3`},{tag:U.heading2,fontWeight:`bold`,fontSize:`1.5em`,lineHeight:`1.3`},{tag:U.heading3,fontWeight:`bold`,fontSize:`1.25em`,lineHeight:`1.3`},{tag:U.heading4,fontWeight:`bold`,fontSize:`1.1em`},{tag:U.heading5,fontWeight:`bold`,fontSize:`1em`},{tag:U.heading6,fontWeight:`bold`,fontSize:`0.9em`,color:`var(--color-muted-foreground)`},{tag:U.strong,fontWeight:`bold`},{tag:U.emphasis,fontStyle:`italic`},{tag:U.link,color:`var(--color-primary, #3b82f6)`,textDecoration:`underline`},{tag:U.monospace,fontFamily:`var(--font-mono)`,padding:`1px 4px`},{tag:U.quote,color:`var(--color-muted-foreground)`,fontStyle:`italic`},{tag:U.strikethrough,textDecoration:`line-through`}]),_Se=Te.baseTheme({".cm-md-hidden":{display:`none`},".cm-line":{position:`relative`},".cm-md-codeblock":{backgroundColor:`color-mix(in srgb, currentColor 5%, transparent)`,borderRadius:`10px`,display:`block`,padding:`12px`,fontFamily:`ui-monospace, monospace`,fontSize:`0.9em`,border:`1px solid color-mix(in srgb, currentColor 12%, transparent)`},".cm-md-codeblock-line":{backgroundColor:`color-mix(in srgb, currentColor 4%, transparent)`,paddingInline:`4px`,marginBottom:0,marginInlineStart:`4px`},".cm-md-codeblock-line-start":{borderTopLeftRadius:`8px`,borderTopRightRadius:`8px`},".cm-md-codeblock-line-end":{borderBottomLeftRadius:`8px`,borderBottomRightRadius:`8px`,marginBottom:`6px`},".cm-md-codeblock-inactive":{opacity:.6},".cm-md-fence":{color:`color-mix(in srgb, currentColor 55%, transparent)`,letterSpacing:`0.03em`,fontWeight:600},".cm-md-link":{color:`var(--color-primary, #3b82f6)`,textDecoration:`underline`,cursor:`pointer`},".cm-md-image":{display:`inline-block`},".cm-md-olist":{color:`var(--color-muted-foreground)`,paddingRight:`0.35em`,fontVariantNumeric:`tabular-nums`},".cm-md-olist.cm-md-olist-faded":{color:`color-mix(in srgb, currentColor 45%, transparent)`},".cm-md-faded":{color:`color-mix(in srgb, currentColor 40%, transparent)`,opacity:.55},".cm-md-task":{display:`inline-block`,width:`0.95em`,height:`0.95em`,borderRadius:`3px`,border:`1px solid color-mix(in srgb, currentColor 30%, transparent)`,marginRight:`0.35em`,background:`color-mix(in srgb, var(--background) 80%, transparent)`},".cm-md-task-checked":{background:`color-mix(in srgb, var(--primary) 35%, transparent)`,borderColor:`color-mix(in srgb, var(--primary) 60%, transparent)`,position:`relative`},".cm-md-task-checked::after":{content:`""`,position:`absolute`,inset:`0.6px 3px 2.4px 3px`,borderBottom:`2px solid var(--background)`,borderRight:`2px solid var(--background)`,transform:`rotate(35deg)`,opacity:.9},".cm-md-task-faded":{opacity:.55},".cm-md-ulmark":{color:`oklch(0.18 0 0)`,fontWeight:700,paddingRight:`0.2em`},".cm-line:has(.tok-quote)":{borderLeft:`3px solid color-mix(in srgb, currentColor 30%, transparent)`,paddingLeft:`12px`}});function vSe(){return[hSe,ve(gSe),_Se]}var ySe=e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=yD(e.state,n.from);return r.line?bSe(e):r.block?SSe(e):!1};function vD(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return i?(r(n.update(i)),!0):!1}}var bSe=vD(TSe,0),xSe=vD(xD,0),SSe=vD((e,t)=>xD(e,t,wSe(t)),0);function yD(e,t){let n=e.languageDataAt(`commentTokens`,t,1);return n.length?n[0]:{}}var bD=50;function CSe(e,{open:t,close:n},r,i){let a=e.sliceDoc(r-bD,r),o=e.sliceDoc(i,i+bD),s=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(o)[0].length,l=a.length-s;if(a.slice(l-t.length,l)==t&&o.slice(c,c+n.length)==n)return{open:{pos:r-s,margin:s&&1},close:{pos:i+c,margin:c&&1}};let u,d;i-r<=2*bD?u=d=e.sliceDoc(r,i):(u=e.sliceDoc(r,r+bD),d=e.sliceDoc(i-bD,i));let f=/^\s*/.exec(u)[0].length,p=/\s*$/.exec(d)[0].length,m=d.length-p-n.length;return u.slice(f,f+t.length)==t&&d.slice(m,m+n.length)==n?{open:{pos:r+f+t.length,margin:/\s/.test(u.charAt(f+t.length))?1:0},close:{pos:i-p-n.length,margin:/\s/.test(d.charAt(m-1))?1:0}}:null}function wSe(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:e.doc.lineAt(n.to-1));let a=t.length-1;a>=0&&t[a].to>r.from?t[a].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}function xD(e,t,n=t.selection.ranges){let r=n.map(e=>yD(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>CSe(t,r[n],e.from,e.to));if(e!=2&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+` `},{from:e.to,insert:` `+r[t].close}]))};if(e!=1&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:a,close:o}=n;e.push({from:a.pos-i.open.length,to:a.pos+a.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}function TSe(e,t,n=t.selection.ranges){let r=[],i=-1;for(let{from:e,to:a}of n){let n=r.length,o=1e9,s=yD(t,e).line;if(s){for(let n=e;n<=a;){let c=t.doc.lineAt(n);if(c.from>i&&(e==a||a>c.from)){i=c.from;let e=/^\s*/.exec(c.text)[0].length,t=e==c.length,n=c.text.slice(e,e+s.length)==s?e:-1;e<c.text.length&&e<o&&(o=e),r.push({line:c,comment:n,token:s,indent:e,empty:t,single:!1})}n=c.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}}if(e!=2&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:a,single:o}of r)(o||!a)&&e.push({from:t.from+i,insert:n+` `});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}else if(e!=1&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,a=r+i.length;t.text[a-t.from]==` `&&a++,e.push({from:r,to:a})}return{changes:e}}return null}var SD=Pe.define(),ESe=Pe.define(),DSe=Ke.define(),CD=Ke.define({combine(e){return ue(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}}),wD=it.define({create(){return PD.empty},update(e,t){let n=t.state.facet(CD),r=t.annotation(SD);if(r){let i=OD.fromTransaction(t,r.selection),a=r.side,o=a==0?e.undone:e.done;return o=i?kD(o,o.length,n.minDepth,i):MD(o,t.startState.selection),new PD(a==0?r.rest:o,a==0?o:r.rest)}let i=t.annotation(ESe);if((i==`full`||i==`before`)&&(e=e.isolate()),t.annotation(se.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let a=OD.fromTransaction(t),o=t.annotation(se.time),s=t.annotation(se.userEvent);return a?e=e.addChanges(a,o,s,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,s,n.newGroupDelay)),(i==`full`||i==`after`)&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}},fromJSON(e){return new PD(e.done.map(OD.fromJSON),e.undone.map(OD.fromJSON))}});function OSe(e={}){return[wD,CD.of(e),Te.domEventHandlers({beforeinput(e,t){let n=e.inputType==`historyUndo`?ED:e.inputType==`historyRedo`?DD:null;return n?(e.preventDefault(),n(t)):!1}})]}function TD(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(wD,!1);if(!i)return!1;let a=i.pop(e,n,t);return a?(r(a),!0):!1}}var ED=TD(0,!1),DD=TD(1,!1),kSe=TD(0,!0),ASe=TD(1,!0),OD=class e{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){return{changes:this.changes?.toJSON(),mapped:this.mapped?.toJSON(),startSelection:this.startSelection?.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(t){return new e(t.changes&&tt.fromJSON(t.changes),[],t.mapped&&Ge.fromJSON(t.mapped),t.startSelection&&Re.fromJSON(t.startSelection),t.selectionsAfter.map(Re.fromJSON))}static fromTransaction(t,n){let r=jD;for(let e of t.startState.facet(DSe)){let n=e(t);n.length&&(r=r.concat(n))}return!r.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),r,void 0,n||t.startState.selection,jD)}static selection(t){return new e(void 0,jD,void 0,void 0,t)}};function kD(e,t,n,r){let i=t+1>n+20?t-n-1:0,a=e.slice(i,t);return a.push(r),a}function jSe(e,t){let n=[],r=!1;return e.iterChangedRanges((e,t)=>n.push(e,t)),t.iterChangedRanges((e,t,i,a)=>{for(let e=0;e<n.length;){let t=n[e++],o=n[e++];a>=t&&i<=o&&(r=!0)}}),r}function MSe(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((e,n)=>e.empty!=t.ranges[n].empty).length===0}function AD(e,t){return e.length?t.length?e.concat(t):e:t}var jD=[],NSe=200;function MD(e,t){if(e.length){let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-NSe));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),kD(e,e.length-1,1e9,n.setSelAfter(r)))}else return[OD.selection([t])]}function PSe(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function ND(e,t){if(!e.length)return e;let n=e.length,r=jD;for(;n;){let i=FSe(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}else t=i.mapped,n--,r=i.selectionsAfter}return r.length?[OD.selection(r)]:jD}function FSe(e,t,n){let r=AD(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):jD,n);if(!e.changes)return OD.selection(r);let i=e.changes.map(t),a=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(a):a;return new OD(i,Ne.mapEffects(e.effects,t),o,e.startSelection.map(a),r)}var ISe=/^(input\.type|delete)($|\.)/,PD=class e{constructor(e,t,n=0,r=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(t,n,r,i,a){let o=this.done,s=o[o.length-1];return o=s&&s.changes&&!s.changes.empty&&t.changes&&(!r||ISe.test(r))&&(!s.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(a,jSe(s.changes,t.changes))||r==`input.type.compose`)?kD(o,o.length-1,i.minDepth,new OD(t.changes.compose(s.changes),AD(Ne.mapEffects(t.effects,s.changes),s.effects),s.mapped,s.startSelection,jD)):kD(o,o.length,i.minDepth,t),new e(o,jD,n,r)}addSelection(t,n,r,i){let a=this.done.length?this.done[this.done.length-1].selectionsAfter:jD;return a.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&MSe(a[a.length-1],t)?this:new e(MD(this.done,t),this.undone,n,r)}addMapping(t){return new e(ND(this.done,t),ND(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=e==0?this.done:this.undone;if(r.length==0)return null;let i=r[r.length-1],a=i.selectionsAfter[0]||t.selection;if(n&&i.selectionsAfter.length)return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:SD.of({side:e,rest:PSe(r),selection:a}),userEvent:e==0?`select.undo`:`select.redo`,scrollIntoView:!0});if(i.changes){let n=r.length==1?jD:r.slice(0,r.length-1);return i.mapped&&(n=ND(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:SD.of({side:e,rest:n,selection:a}),filter:!1,userEvent:e==0?`undo`:`redo`,scrollIntoView:!0})}else return null}};PD.empty=new PD(jD,jD);var LSe=[{key:`Mod-z`,run:ED,preventDefault:!0},{key:`Mod-y`,mac:`Mod-Shift-z`,run:DD,preventDefault:!0},{linux:`Ctrl-Shift-z`,run:DD,preventDefault:!0},{key:`Mod-u`,run:kSe,preventDefault:!0},{key:`Alt-u`,mac:`Mod-Shift-u`,run:ASe,preventDefault:!0}];function FD(e,t){return Re.create(e.ranges.map(t),e.mainIndex)}function ID(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:`select`})}function LD({state:e,dispatch:t},n){let r=FD(e.selection,n);return r.eq(e.selection,!0)?!1:(t(ID(e,r)),!0)}function RD(e,t){return Re.cursor(t?e.to:e.from)}function zD(e,t){return LD(e,n=>n.empty?e.moveByChar(n,t):RD(n,t))}function BD(e){return e.textDirectionAt(e.state.selection.main.head)==oe.LTR}var VD=e=>zD(e,!BD(e)),HD=e=>zD(e,BD(e));function UD(e,t){return LD(e,n=>n.empty?e.moveByGroup(n,t):RD(n,t))}var RSe=e=>UD(e,!BD(e)),zSe=e=>UD(e,BD(e));typeof Intl<`u`&&Intl.Segmenter&&new Intl.Segmenter(void 0,{granularity:`word`});function BSe(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function WD(e,t,n){let r=de(e).resolveInner(t.head),i=n?He.closedBy:He.openedBy;for(let a=t.head;;){let t=n?r.childAfter(a):r.childBefore(a);if(!t)break;BSe(e,t,i)?r=t:a=n?t.to:t.from}let a=r.type.prop(i),o,s;return s=a&&(o=n?he(e,r.from,1):he(e,r.to,-1))&&o.matched?n?o.end.to:o.end.from:n?r.to:r.from,Re.cursor(s,n?-1:1)}var VSe=e=>LD(e,t=>WD(e.state,t,!BD(e))),HSe=e=>LD(e,t=>WD(e.state,t,BD(e)));function GD(e,t){return LD(e,n=>{if(!n.empty)return RD(n,t);let r=e.moveVertically(n,t);return r.head==n.head?e.moveToLineBoundary(n,t):r})}var KD=e=>GD(e,!1),qD=e=>GD(e,!0);function JD(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(Te.scrollMargins)){let i=t(e);i?.top&&(n=Math.max(i?.top,n)),i?.bottom&&(r=Math.max(i?.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function YD(e,t){let n=JD(e),{state:r}=e,i=FD(r.selection,r=>r.empty?e.moveVertically(r,t,n.height):RD(r,t));if(i.eq(r.selection))return!1;let a;if(n.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),s=o.top+n.marginTop,c=o.bottom-n.marginBottom;t&&t.top>s&&t.bottom<c&&(a=Te.scrollIntoView(i.main.head,{y:`start`,yMargin:t.top-s}))}return e.dispatch(ID(r,i),{effects:a}),!0}var XD=e=>YD(e,!1),ZD=e=>YD(e,!0);function QD(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=Re.cursor(r.from+n))}return i}var USe=e=>LD(e,t=>QD(e,t,!0)),WSe=e=>LD(e,t=>QD(e,t,!1)),GSe=e=>LD(e,t=>QD(e,t,!BD(e))),KSe=e=>LD(e,t=>QD(e,t,BD(e))),qSe=e=>LD(e,t=>Re.cursor(e.lineBlockAt(t.head).from,1)),JSe=e=>LD(e,t=>Re.cursor(e.lineBlockAt(t.head).to,-1));function YSe(e,t,n){let r=!1,i=FD(e.selection,t=>{let i=he(e,t.head,-1)||he(e,t.head,1)||t.head>0&&he(e,t.head-1,1)||t.head<e.doc.length&&he(e,t.head+1,-1);if(!i||!i.end)return t;r=!0;let a=i.start.from==t.head?i.end.to:i.end.from;return n?Re.range(t.anchor,a):Re.cursor(a)});return r?(t(ID(e,i)),!0):!1}var XSe=({state:e,dispatch:t})=>YSe(e,t,!1);function $D(e,t){let n=FD(e.state.selection,e=>{let n=t(e);return Re.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return n.eq(e.state.selection)?!1:(e.dispatch(ID(e.state,n)),!0)}function eO(e,t){return $D(e,n=>e.moveByChar(n,t))}var tO=e=>eO(e,!BD(e)),nO=e=>eO(e,BD(e));function rO(e,t){return $D(e,n=>e.moveByGroup(n,t))}var ZSe=e=>rO(e,!BD(e)),QSe=e=>rO(e,BD(e)),$Se=e=>$D(e,t=>WD(e.state,t,!BD(e))),eCe=e=>$D(e,t=>WD(e.state,t,BD(e)));function iO(e,t){return $D(e,n=>e.moveVertically(n,t))}var aO=e=>iO(e,!1),oO=e=>iO(e,!0);function sO(e,t){return $D(e,n=>e.moveVertically(n,t,JD(e).height))}var cO=e=>sO(e,!1),lO=e=>sO(e,!0),tCe=e=>$D(e,t=>QD(e,t,!0)),nCe=e=>$D(e,t=>QD(e,t,!1)),rCe=e=>$D(e,t=>QD(e,t,!BD(e))),iCe=e=>$D(e,t=>QD(e,t,BD(e))),aCe=e=>$D(e,t=>Re.cursor(e.lineBlockAt(t.head).from)),oCe=e=>$D(e,t=>Re.cursor(e.lineBlockAt(t.head).to)),uO=({state:e,dispatch:t})=>(t(ID(e,{anchor:0})),!0),dO=({state:e,dispatch:t})=>(t(ID(e,{anchor:e.doc.length})),!0),fO=({state:e,dispatch:t})=>(t(ID(e,{anchor:e.selection.main.anchor,head:0})),!0),pO=({state:e,dispatch:t})=>(t(ID(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),mO=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:`select`})),!0),sCe=({state:e,dispatch:t})=>{let n=CO(e).map(({from:t,to:n})=>Re.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:Re.create(n),userEvent:`select`})),!0},cCe=({state:e,dispatch:t})=>{let n=FD(e.selection,t=>{let n=de(e),r=n.resolveStack(t.from,1);if(t.empty){let e=n.resolveStack(t.from,-1);e.node.from>=r.node.from&&e.node.to<=r.node.to&&(r=e)}for(let e=r;e;e=e.next){let{node:n}=e;if((n.from<t.from&&n.to>=t.to||n.to>t.to&&n.from<=t.from)&&e.next)return Re.range(n.to,n.from)}return t});return n.eq(e.selection)?!1:(t(ID(e,n)),!0)};function hO(e,t){let{state:n}=e,r=n.selection,i=n.selection.ranges.slice();for(let r of n.selection.ranges){let a=n.doc.lineAt(r.head);if(t?a.to<e.state.doc.length:a.from>0)for(let n=r;;){let r=e.moveVertically(n,t);if(r.head<a.from||r.head>a.to){i.some(e=>e.head==r.head)||i.push(r);break}else if(r.head==n.head)break;else n=r}}return i.length==r.ranges.length?!1:(e.dispatch(ID(n,Re.create(i,i.length-1))),!0)}var lCe=e=>hO(e,!1),uCe=e=>hO(e,!0),dCe=({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=Re.create([n.main]):n.main.empty||(r=Re.create([Re.cursor(n.main.head)])),r?(t(ID(e,r)),!0):!1};function gO(e,t){if(e.state.readOnly)return!1;let n=`delete.selection`,{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:a}=r;if(i==a){let o=t(r);o<i?(n=`delete.backward`,o=_O(e,o,!1)):o>i&&(n=`delete.forward`,o=_O(e,o,!0)),i=Math.min(i,o),a=Math.max(a,o)}else i=_O(e,i,!1),a=_O(e,a,!0);return i==a?{range:r}:{changes:{from:i,to:a},range:Re.cursor(i,i<r.head?-1:1)}});return i.changes.empty?!1:(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n==`delete.selection`?Te.announce.of(r.phrase(`Selection deleted`)):void 0})),!0)}function _O(e,t,n){if(e instanceof Te)for(let r of e.state.facet(Te.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}var vO=(e,t,n)=>gO(e,r=>{let i=r.from,{state:a}=e,o=a.doc.lineAt(i),s,c;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,i-o.from))){if(s[s.length-1]==` `)return i-1;let e=ce(s,a.tabSize)%Se(a)||Se(a);for(let t=0;t<e&&s[s.length-1-t]==` `;t++)i--;c=i}else c=_e(o.text,i-o.from,t,t)+o.from,c==i&&o.number!=(t?a.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,i-o.from))&&(c=_e(o.text,c-o.from,!1,!1)+o.from);return c}),yO=e=>vO(e,!1,!0),bO=e=>vO(e,!0,!1),xO=(e,t)=>gO(e,n=>{let r=n.head,{state:i}=e,a=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?a.to:a.from)){r==n.head&&a.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let s=_e(a.text,r-a.from,t)+a.from,c=a.text.slice(Math.min(r,s)-a.from,Math.max(r,s)-a.from),l=o(c);if(e!=null&&l!=e)break;(c!=` `||r!=n.head)&&(e=l),r=s}return r}),SO=e=>xO(e,!1),fCe=e=>xO(e,!0),pCe=e=>gO(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),mCe=e=>gO(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}),hCe=e=>gO(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)}),gCe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:xe.of([``,``])},range:Re.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:`input`})),!0},_Ce=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||t.from==0||t.from==e.doc.length)return{range:t};let n=t.from,r=e.doc.lineAt(n),i=n==r.from?n-1:_e(r.text,n-r.from,!1)+r.from,a=n==r.to?n+1:_e(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(i,n))},range:Re.cursor(a)}});return n.changes.empty?!1:(t(e.update(n,{scrollIntoView:!0,userEvent:`move.character`})),!0)};function CO(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),a=e.doc.lineAt(r.to);if(!r.empty&&r.to==a.from&&(a=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=a.to,e.ranges.push(r)}else t.push({from:i.from,to:a.to,ranges:[r]});n=a.number+1}return t}function wO(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of CO(e)){if(n?t.to==e.doc.length:t.from==0)continue;let a=e.doc.lineAt(n?t.to+1:t.from-1),o=a.length+1;if(n){r.push({from:t.to,to:a.to},{from:t.from,insert:a.text+e.lineBreak});for(let n of t.ranges)i.push(Re.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)))}else{r.push({from:a.from,to:t.from},{from:t.to,insert:e.lineBreak+a.text});for(let e of t.ranges)i.push(Re.range(e.anchor-o,e.head-o))}}return r.length?(t(e.update({changes:r,scrollIntoView:!0,selection:Re.create(i,e.selection.mainIndex),userEvent:`move.line`})),!0):!1}var vCe=({state:e,dispatch:t})=>wO(e,t,!1),yCe=({state:e,dispatch:t})=>wO(e,t,!0);function TO(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of CO(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:r,scrollIntoView:!0,userEvent:`input.copyline`})),!0}var bCe=({state:e,dispatch:t})=>TO(e,t,!1),xCe=({state:e,dispatch:t})=>TO(e,t,!0),SCe=e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(CO(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=FD(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:`delete.line`}),!0};function CCe(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=de(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),a;return r&&i&&r.to<=t&&i.from>=t&&(a=r.type.prop(He.closedBy))&&a.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}var EO=DO(!1),wCe=DO(!0);function DO(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,a=t.doc.lineAt(r),o=!e&&r==i&&CCe(t,r);e&&(r=i=(i<=a.to?a:t.doc.lineAt(i)).to);let s=new Je(t,{simulateBreak:r,simulateDoubleBreak:!!o}),c=le(s,r);for(c??=ce(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize);i<a.to&&/\s/.test(a.text[i-a.from]);)i++;o?{from:r,to:i}=o:r>a.from&&r<a.from+100&&!/\S/.test(a.text.slice(0,r))&&(r=a.from);let l=[``,Ue(t,c)];return o&&l.push(Ue(t,s.lineIndent(a.from,-1))),{changes:{from:r,to:i,insert:xe.of(l)},range:Re.cursor(r+1+l[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:`input`})),!0}}function OO(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let a=r.from;a<=r.to;){let o=e.doc.lineAt(a);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),a=o.to+1}let a=e.changes(i);return{changes:i,range:Re.range(a.mapPos(r.anchor,1),a.mapPos(r.head,1))}})}var TCe=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new Je(e,{overrideIndentation:e=>n[e]??-1}),i=OO(e,(t,i,a)=>{let o=le(r,t.from);if(o==null)return;/\S/.test(t.text)||(o=0);let s=/^\s*/.exec(t.text)[0],c=Ue(e,o);(s!=c||a.from<t.from+s.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+s.length,insert:c}))});return i.changes.empty||t(e.update(i,{userEvent:`indent`})),!0},kO=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(OO(e,(t,n)=>{n.push({from:t.from,insert:e.facet(ae)})}),{userEvent:`input.indent`})),!0),AO=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(OO(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=ce(r,e.tabSize),a=0,o=Ue(e,Math.max(0,i-Se(e)));for(;a<r.length&&a<o.length&&r.charCodeAt(a)==o.charCodeAt(a);)a++;n.push({from:t.from+a,to:t.from+r.length,insert:o.slice(a)})}),{userEvent:`delete.dedent`})),!0),ECe=e=>(e.setTabFocusMode(),!0),DCe=[{key:`Ctrl-b`,run:VD,shift:tO,preventDefault:!0},{key:`Ctrl-f`,run:HD,shift:nO},{key:`Ctrl-p`,run:KD,shift:aO},{key:`Ctrl-n`,run:qD,shift:oO},{key:`Ctrl-a`,run:qSe,shift:aCe},{key:`Ctrl-e`,run:JSe,shift:oCe},{key:`Ctrl-d`,run:bO},{key:`Ctrl-h`,run:yO},{key:`Ctrl-k`,run:pCe},{key:`Ctrl-Alt-h`,run:SO},{key:`Ctrl-o`,run:gCe},{key:`Ctrl-t`,run:_Ce},{key:`Ctrl-v`,run:ZD}],OCe=[{key:`ArrowLeft`,run:VD,shift:tO,preventDefault:!0},{key:`Mod-ArrowLeft`,mac:`Alt-ArrowLeft`,run:RSe,shift:ZSe,preventDefault:!0},{mac:`Cmd-ArrowLeft`,run:GSe,shift:rCe,preventDefault:!0},{key:`ArrowRight`,run:HD,shift:nO,preventDefault:!0},{key:`Mod-ArrowRight`,mac:`Alt-ArrowRight`,run:zSe,shift:QSe,preventDefault:!0},{mac:`Cmd-ArrowRight`,run:KSe,shift:iCe,preventDefault:!0},{key:`ArrowUp`,run:KD,shift:aO,preventDefault:!0},{mac:`Cmd-ArrowUp`,run:uO,shift:fO},{mac:`Ctrl-ArrowUp`,run:XD,shift:cO},{key:`ArrowDown`,run:qD,shift:oO,preventDefault:!0},{mac:`Cmd-ArrowDown`,run:dO,shift:pO},{mac:`Ctrl-ArrowDown`,run:ZD,shift:lO},{key:`PageUp`,run:XD,shift:cO},{key:`PageDown`,run:ZD,shift:lO},{key:`Home`,run:WSe,shift:nCe,preventDefault:!0},{key:`Mod-Home`,run:uO,shift:fO},{key:`End`,run:USe,shift:tCe,preventDefault:!0},{key:`Mod-End`,run:dO,shift:pO},{key:`Enter`,run:EO,shift:EO},{key:`Mod-a`,run:mO},{key:`Backspace`,run:yO,shift:yO,preventDefault:!0},{key:`Delete`,run:bO,preventDefault:!0},{key:`Mod-Backspace`,mac:`Alt-Backspace`,run:SO,preventDefault:!0},{key:`Mod-Delete`,mac:`Alt-Delete`,run:fCe,preventDefault:!0},{mac:`Mod-Backspace`,run:mCe,preventDefault:!0},{mac:`Mod-Delete`,run:hCe,preventDefault:!0}].concat(DCe.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),kCe=[{key:`Alt-ArrowLeft`,mac:`Ctrl-ArrowLeft`,run:VSe,shift:$Se},{key:`Alt-ArrowRight`,mac:`Ctrl-ArrowRight`,run:HSe,shift:eCe},{key:`Alt-ArrowUp`,run:vCe},{key:`Shift-Alt-ArrowUp`,run:bCe},{key:`Alt-ArrowDown`,run:yCe},{key:`Shift-Alt-ArrowDown`,run:xCe},{key:`Mod-Alt-ArrowUp`,run:lCe},{key:`Mod-Alt-ArrowDown`,run:uCe},{key:`Escape`,run:dCe},{key:`Mod-Enter`,run:wCe},{key:`Alt-l`,mac:`Ctrl-l`,run:sCe},{key:`Mod-i`,run:cCe,preventDefault:!0},{key:`Mod-[`,run:AO},{key:`Mod-]`,run:kO},{key:`Mod-Alt-\\`,run:TCe},{key:`Shift-Mod-k`,run:SCe},{key:`Shift-Mod-\\`,run:XSe},{key:`Mod-/`,run:ySe},{key:`Alt-A`,run:xSe},{key:`Ctrl-m`,mac:`Shift-Alt-m`,run:ECe}].concat(OCe),ACe={key:`Tab`,run:kO,shift:AO};function Z(e){return new et(Le.define(e))}function jO(e){return c(()=>import(`./dist-DBANUHCV.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([26,27,28]))}var MO=[W.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return c(()=>import(`./dist-ut4rUQ9T.js`).then(e=>e.cpp()),__vite__mapDeps([29,28]))}}),W.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return c(()=>import(`./dist-ut4rUQ9T.js`).then(e=>e.cpp()),__vite__mapDeps([29,28]))}}),W.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return jO(`Cassandra`)}}),W.of({name:`CSS`,extensions:[`css`],load(){return c(()=>import(`./dist-DOslja1j.js`).then(e=>e.i).then(e=>e.css()),__vite__mapDeps([30,1,28]))}}),W.of({name:`Go`,extensions:[`go`],load(){return c(()=>import(`./dist-BqFNCcID.js`).then(e=>e.go()),__vite__mapDeps([31,27,28]))}}),W.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return c(()=>import(`./dist-BElax2Cc.js`).then(e=>e.t).then(e=>e.html()),__vite__mapDeps([32,1,30,28,33,27]))}}),W.of({name:`Java`,extensions:[`java`],load(){return c(()=>import(`./dist-ChBF8Kxw.js`).then(e=>e.java()),__vite__mapDeps([34,28]))}}),W.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return c(()=>import(`./dist-B_gB7iV-.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([33,1,27,28]))}}),W.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return c(()=>import(`./dist-CdyeiNbL.js`).then(e=>e.jinja()),__vite__mapDeps([35,30,1,28,32,33,27]))}}),W.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return c(()=>import(`./dist-BTEspn1S.js`).then(e=>e.t).then(e=>e.json()),__vite__mapDeps([36,1,28]))}}),W.of({name:`JSX`,extensions:[`jsx`],load(){return c(()=>import(`./dist-B_gB7iV-.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([33,1,27,28]))}}),W.of({name:`LESS`,extensions:[`less`],load(){return c(()=>import(`./dist-BTDPzESP.js`).then(e=>e.less()),__vite__mapDeps([37,30,1,28]))}}),W.of({name:`Liquid`,extensions:[`liquid`],load(){return c(()=>import(`./dist-DiDQaVUl.js`).then(e=>e.liquid()),__vite__mapDeps([38,30,1,28,32,33,27]))}}),W.of({name:`MariaDB SQL`,load(){return jO(`MariaSQL`)}}),W.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return c(()=>import(`./dist-BPqKJ2jd.js`).then(e=>e.t).then(e=>e.markdown()),__vite__mapDeps([39,1,27,28,32,30,33]))}}),W.of({name:`MS SQL`,load(){return jO(`MSSQL`)}}),W.of({name:`MySQL`,load(){return jO(`MySQL`)}}),W.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return c(()=>import(`./dist-Cds2ol7_.js`).then(e=>e.php()),__vite__mapDeps([40,30,1,28,32,33,27]))}}),W.of({name:`PLSQL`,extensions:[`pls`],load(){return jO(`PLSQL`)}}),W.of({name:`PostgreSQL`,load(){return jO(`PostgreSQL`)}}),W.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return c(()=>import(`./dist-DcxAxgyr.js`).then(e=>e.python()),__vite__mapDeps([41,27,28]))}}),W.of({name:`Rust`,extensions:[`rs`],load(){return c(()=>import(`./dist-DKJ1Q90V.js`).then(e=>e.rust()),__vite__mapDeps([42,28]))}}),W.of({name:`Sass`,extensions:[`sass`],load(){return c(()=>import(`./dist-H4lUSqHM.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([43,30,1,28]))}}),W.of({name:`SCSS`,extensions:[`scss`],load(){return c(()=>import(`./dist-H4lUSqHM.js`).then(e=>e.sass()),__vite__mapDeps([43,30,1,28]))}}),W.of({name:`SQL`,extensions:[`sql`],load(){return jO(`StandardSQL`)}}),W.of({name:`SQLite`,load(){return jO(`SQLite`)}}),W.of({name:`TSX`,extensions:[`tsx`],load(){return c(()=>import(`./dist-B_gB7iV-.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([33,1,27,28]))}}),W.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return c(()=>import(`./dist-B_gB7iV-.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([33,1,27,28]))}}),W.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return c(()=>import(`./dist-CUBTZf4H.js`).then(e=>e.wast()),__vite__mapDeps([44,28]))}}),W.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return c(()=>import(`./dist-CcJiXGmU.js`).then(e=>e.xml()),__vite__mapDeps([45,28]))}}),W.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return c(()=>import(`./dist-B_cOSPGy.js`).then(e=>e.t).then(e=>e.yaml()),__vite__mapDeps([46,1,28]))}}),W.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return c(()=>import(`./apl-BKE9LS24.js`).then(e=>Z(e.apl)),[])}}),W.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return c(()=>import(`./asciiarmor-DkXJ9hXf.js`).then(e=>Z(e.asciiArmor)),[])}}),W.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return c(()=>import(`./asn1-C6HuKByb.js`).then(e=>Z(e.asn1({}))),[])}}),W.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return c(()=>import(`./asterisk-Bp0w-cpJ.js`).then(e=>Z(e.asterisk)),[])}}),W.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return c(()=>import(`./brainfuck-BNc1KEem.js`).then(e=>Z(e.brainfuck)),[])}}),W.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return c(()=>import(`./cobol-CZKLUtpg.js`).then(e=>Z(e.cobol)),[])}}),W.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return c(()=>import(`./clike-DgL3SNQH.js`).then(e=>Z(e.csharp)),[])}}),W.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return c(()=>import(`./clojure-DrsR_fQG.js`).then(e=>Z(e.clojure)),[])}}),W.of({name:`ClojureScript`,extensions:[`cljs`],load(){return c(()=>import(`./clojure-DrsR_fQG.js`).then(e=>Z(e.clojure)),[])}}),W.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return c(()=>import(`./css-D4EwD1Ce.js`).then(e=>Z(e.gss)),[])}}),W.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return c(()=>import(`./cmake-DbJBMKw8.js`).then(e=>Z(e.cmake)),[])}}),W.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return c(()=>import(`./coffeescript-CDvGdAFe.js`).then(e=>Z(e.coffeeScript)),[])}}),W.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return c(()=>import(`./commonlisp-B5qPm-cW.js`).then(e=>Z(e.commonLisp)),[])}}),W.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return c(()=>import(`./cypher-CCGdR5gv.js`).then(e=>Z(e.cypher)),[])}}),W.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return c(()=>import(`./python-Cn5NMrFO.js`).then(e=>Z(e.cython)),[])}}),W.of({name:`Crystal`,extensions:[`cr`],load(){return c(()=>import(`./crystal-CWUxUKwE.js`).then(e=>Z(e.crystal)),[])}}),W.of({name:`D`,extensions:[`d`],load(){return c(()=>import(`./d-CAX17L1u.js`).then(e=>Z(e.d)),[])}}),W.of({name:`Dart`,extensions:[`dart`],load(){return c(()=>import(`./clike-DgL3SNQH.js`).then(e=>Z(e.dart)),[])}}),W.of({name:`diff`,extensions:[`diff`,`patch`],load(){return c(()=>import(`./diff-CN7BS8el.js`).then(e=>Z(e.diff)),[])}}),W.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return c(()=>import(`./dockerfile-h2epc4Vl.js`).then(e=>Z(e.dockerFile)),__vite__mapDeps([47,48]))}}),W.of({name:`DTD`,extensions:[`dtd`],load(){return c(()=>import(`./dtd-ZYymx13B.js`).then(e=>Z(e.dtd)),[])}}),W.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return c(()=>import(`./dylan-DItIDmyF.js`).then(e=>Z(e.dylan)),[])}}),W.of({name:`EBNF`,load(){return c(()=>import(`./ebnf-Dp6t8CzF.js`).then(e=>Z(e.ebnf)),[])}}),W.of({name:`ECL`,extensions:[`ecl`],load(){return c(()=>import(`./ecl-VLH9srnJ.js`).then(e=>Z(e.ecl)),[])}}),W.of({name:`edn`,extensions:[`edn`],load(){return c(()=>import(`./clojure-DrsR_fQG.js`).then(e=>Z(e.clojure)),[])}}),W.of({name:`Eiffel`,extensions:[`e`],load(){return c(()=>import(`./eiffel-BJ8iJE6v.js`).then(e=>Z(e.eiffel)),[])}}),W.of({name:`Elm`,extensions:[`elm`],load(){return c(()=>import(`./elm-CtgpLLRi.js`).then(e=>Z(e.elm)),[])}}),W.of({name:`Erlang`,extensions:[`erl`],load(){return c(()=>import(`./erlang-Y5dUBExs.js`).then(e=>Z(e.erlang)),[])}}),W.of({name:`Esper`,load(){return c(()=>import(`./sql-CVRvDkss.js`).then(e=>Z(e.esper)),[])}}),W.of({name:`Factor`,extensions:[`factor`],load(){return c(()=>import(`./factor-CeOkG9eA.js`).then(e=>Z(e.factor)),__vite__mapDeps([49,48]))}}),W.of({name:`FCL`,load(){return c(()=>import(`./fcl-B2IFvv48.js`).then(e=>Z(e.fcl)),[])}}),W.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return c(()=>import(`./forth-BuhLGLeY.js`).then(e=>Z(e.forth)),[])}}),W.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return c(()=>import(`./fortran-DO9Km__o.js`).then(e=>Z(e.fortran)),[])}}),W.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return c(()=>import(`./mllike-CsS4TnAs.js`).then(e=>Z(e.fSharp)),[])}}),W.of({name:`Gas`,extensions:[`s`],load(){return c(()=>import(`./gas-FhG4DzpI.js`).then(e=>Z(e.gas)),[])}}),W.of({name:`Gherkin`,extensions:[`feature`],load(){return c(()=>import(`./gherkin-DSXbgBKm.js`).then(e=>Z(e.gherkin)),[])}}),W.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return c(()=>import(`./groovy-66vp8M_4.js`).then(e=>Z(e.groovy)),[])}}),W.of({name:`Haskell`,extensions:[`hs`],load(){return c(()=>import(`./haskell-BNrHMW3N.js`).then(e=>Z(e.haskell)),[])}}),W.of({name:`Haxe`,extensions:[`hx`],load(){return c(()=>import(`./haxe-Z426XPce.js`).then(e=>Z(e.haxe)),[])}}),W.of({name:`HXML`,extensions:[`hxml`],load(){return c(()=>import(`./haxe-Z426XPce.js`).then(e=>Z(e.hxml)),[])}}),W.of({name:`HTTP`,load(){return c(()=>import(`./http-BSn9Z-ZR.js`).then(e=>Z(e.http)),[])}}),W.of({name:`IDL`,extensions:[`pro`],load(){return c(()=>import(`./idl-Cb7mJeSz.js`).then(e=>Z(e.idl)),[])}}),W.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return c(()=>import(`./javascript-WdgH9bdJ.js`).then(e=>Z(e.jsonld)),[])}}),W.of({name:`Julia`,extensions:[`jl`],load(){return c(()=>import(`./julia-Ds0XkmdJ.js`).then(e=>Z(e.julia)),[])}}),W.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return c(()=>import(`./clike-DgL3SNQH.js`).then(e=>Z(e.kotlin)),[])}}),W.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return c(()=>import(`./livescript-CRPiQinm.js`).then(e=>Z(e.liveScript)),[])}}),W.of({name:`Lua`,extensions:[`lua`],load(){return c(()=>import(`./lua-IdgYy2u2.js`).then(e=>Z(e.lua)),[])}}),W.of({name:`mIRC`,extensions:[`mrc`],load(){return c(()=>import(`./mirc-UFVahi7q.js`).then(e=>Z(e.mirc)),[])}}),W.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return c(()=>import(`./mathematica-IApmD8uq.js`).then(e=>Z(e.mathematica)),[])}}),W.of({name:`Modelica`,extensions:[`mo`],load(){return c(()=>import(`./modelica-DTQIlea0.js`).then(e=>Z(e.modelica)),[])}}),W.of({name:`MUMPS`,extensions:[`mps`],load(){return c(()=>import(`./mumps-C3RKfAvl.js`).then(e=>Z(e.mumps)),[])}}),W.of({name:`Mbox`,extensions:[`mbox`],load(){return c(()=>import(`./mbox-s0Ui7kYt.js`).then(e=>Z(e.mbox)),[])}}),W.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return c(()=>import(`./nginx-C-9gPoJT.js`).then(e=>Z(e.nginx)),[])}}),W.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return c(()=>import(`./nsis-CquHxL-A.js`).then(e=>Z(e.nsis)),__vite__mapDeps([50,48]))}}),W.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return c(()=>import(`./ntriples-61AWsLi8.js`).then(e=>Z(e.ntriples)),[])}}),W.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return c(()=>import(`./clike-DgL3SNQH.js`).then(e=>Z(e.objectiveC)),[])}}),W.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return c(()=>import(`./clike-DgL3SNQH.js`).then(e=>Z(e.objectiveCpp)),[])}}),W.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return c(()=>import(`./mllike-CsS4TnAs.js`).then(e=>Z(e.oCaml)),[])}}),W.of({name:`Octave`,extensions:[`m`],load(){return c(()=>import(`./octave-CImB10Oa.js`).then(e=>Z(e.octave)),[])}}),W.of({name:`Oz`,extensions:[`oz`],load(){return c(()=>import(`./oz-CoMW3YsZ.js`).then(e=>Z(e.oz)),[])}}),W.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return c(()=>import(`./pascal-gRvWM2Zf.js`).then(e=>Z(e.pascal)),[])}}),W.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return c(()=>import(`./perl-e6CciIHG.js`).then(e=>Z(e.perl)),[])}}),W.of({name:`Pig`,extensions:[`pig`],load(){return c(()=>import(`./pig-DoD9VE0T.js`).then(e=>Z(e.pig)),[])}}),W.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return c(()=>import(`./powershell-ilvKGdhZ.js`).then(e=>Z(e.powerShell)),[])}}),W.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return c(()=>import(`./properties-D3eBXfhu.js`).then(e=>Z(e.properties)),[])}}),W.of({name:`ProtoBuf`,extensions:[`proto`],load(){return c(()=>import(`./protobuf-CT1o550N.js`).then(e=>Z(e.protobuf)),[])}}),W.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return c(()=>import(`./pug-HlPEUn3L.js`).then(e=>Z(e.pug)),__vite__mapDeps([51,52]))}}),W.of({name:`Puppet`,extensions:[`pp`],load(){return c(()=>import(`./puppet-CN0SHbqs.js`).then(e=>Z(e.puppet)),[])}}),W.of({name:`Q`,extensions:[`q`],load(){return c(()=>import(`./q-BI4ez1QN.js`).then(e=>Z(e.q)),[])}}),W.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return c(()=>import(`./r-BCz567Y3.js`).then(e=>Z(e.r)),[])}}),W.of({name:`RPM Changes`,load(){return c(()=>import(`./rpm-Dct3sv7t.js`).then(e=>Z(e.rpmChanges)),[])}}),W.of({name:`RPM Spec`,extensions:[`spec`],load(){return c(()=>import(`./rpm-Dct3sv7t.js`).then(e=>Z(e.rpmSpec)),[])}}),W.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return c(()=>import(`./ruby-DjfgNRte.js`).then(e=>Z(e.ruby)),[])}}),W.of({name:`SAS`,extensions:[`sas`],load(){return c(()=>import(`./sas-xmDiF03T.js`).then(e=>Z(e.sas)),[])}}),W.of({name:`Scala`,extensions:[`scala`],load(){return c(()=>import(`./clike-DgL3SNQH.js`).then(e=>Z(e.scala)),[])}}),W.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return c(()=>import(`./scheme-CeyAY5mz.js`).then(e=>Z(e.scheme)),[])}}),W.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return c(()=>import(`./shell-Cma2QP-4.js`).then(e=>Z(e.shell)),[])}}),W.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return c(()=>import(`./sieve-DfYITjoF.js`).then(e=>Z(e.sieve)),[])}}),W.of({name:`Smalltalk`,extensions:[`st`],load(){return c(()=>import(`./smalltalk-C67u_J0B.js`).then(e=>Z(e.smalltalk)),[])}}),W.of({name:`Solr`,load(){return c(()=>import(`./solr-DuhjiPeb.js`).then(e=>Z(e.solr)),[])}}),W.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return c(()=>import(`./mllike-CsS4TnAs.js`).then(e=>Z(e.sml)),[])}}),W.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return c(()=>import(`./sparql-CJE67vaw.js`).then(e=>Z(e.sparql)),[])}}),W.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return c(()=>import(`./spreadsheet-DSuKGWYs.js`).then(e=>Z(e.spreadsheet)),[])}}),W.of({name:`Squirrel`,extensions:[`nut`],load(){return c(()=>import(`./clike-DgL3SNQH.js`).then(e=>Z(e.squirrel)),[])}}),W.of({name:`Stylus`,extensions:[`styl`],load(){return c(()=>import(`./stylus-DBxuuJ-q.js`).then(e=>Z(e.stylus)),[])}}),W.of({name:`Swift`,extensions:[`swift`],load(){return c(()=>import(`./swift-Sko2phaX.js`).then(e=>Z(e.swift)),[])}}),W.of({name:`sTeX`,load(){return c(()=>import(`./stex-ClD5ew9u.js`).then(e=>Z(e.stex)),[])}}),W.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return c(()=>import(`./stex-ClD5ew9u.js`).then(e=>Z(e.stex)),[])}}),W.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return c(()=>import(`./verilog-f9ocpVTE.js`).then(e=>Z(e.verilog)),[])}}),W.of({name:`Tcl`,extensions:[`tcl`],load(){return c(()=>import(`./tcl-DBI_Khes.js`).then(e=>Z(e.tcl)),[])}}),W.of({name:`Textile`,extensions:[`textile`],load(){return c(()=>import(`./textile-B4wNTFJ8.js`).then(e=>Z(e.textile)),[])}}),W.of({name:`TiddlyWiki`,load(){return c(()=>import(`./tiddlywiki-CSTzQu8J.js`).then(e=>Z(e.tiddlyWiki)),[])}}),W.of({name:`Tiki wiki`,load(){return c(()=>import(`./tiki-Dhr61U2N.js`).then(e=>Z(e.tiki)),[])}}),W.of({name:`TOML`,extensions:[`toml`],load(){return c(()=>import(`./toml-B2qVDGgJ.js`).then(e=>Z(e.toml)),[])}}),W.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return c(()=>import(`./troff-C3ZMwCMN.js`).then(e=>Z(e.troff)),[])}}),W.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return c(()=>import(`./ttcn-aR7mbZm6.js`).then(e=>Z(e.ttcn)),[])}}),W.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return c(()=>import(`./ttcn-cfg-8E3RA6Hy.js`).then(e=>Z(e.ttcnCfg)),[])}}),W.of({name:`Turtle`,extensions:[`ttl`],load(){return c(()=>import(`./turtle-DsAwg0Jx.js`).then(e=>Z(e.turtle)),[])}}),W.of({name:`Web IDL`,extensions:[`webidl`],load(){return c(()=>import(`./webidl-DRD6HN-7.js`).then(e=>Z(e.webIDL)),[])}}),W.of({name:`VB.NET`,extensions:[`vb`],load(){return c(()=>import(`./vb-Kgyv2pwt.js`).then(e=>Z(e.vb)),[])}}),W.of({name:`VBScript`,extensions:[`vbs`],load(){return c(()=>import(`./vbscript-CxO9TPBS.js`).then(e=>Z(e.vbScript)),[])}}),W.of({name:`Velocity`,extensions:[`vtl`],load(){return c(()=>import(`./velocity-DwmfupaX.js`).then(e=>Z(e.velocity)),[])}}),W.of({name:`Verilog`,extensions:[`v`],load(){return c(()=>import(`./verilog-f9ocpVTE.js`).then(e=>Z(e.verilog)),[])}}),W.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return c(()=>import(`./vhdl-B8lXGu5-.js`).then(e=>Z(e.vhdl)),[])}}),W.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return c(()=>import(`./xquery-CcAVZjdY.js`).then(e=>Z(e.xQuery)),[])}}),W.of({name:`Yacas`,extensions:[`ys`],load(){return c(()=>import(`./yacas-Do3HUHmu.js`).then(e=>Z(e.yacas)),[])}}),W.of({name:`Z80`,extensions:[`z80`],load(){return c(()=>import(`./z80-DRVAVfQB.js`).then(e=>Z(e.z80)),[])}}),W.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return c(()=>import(`./mscgen-Df4T1TPF.js`).then(e=>Z(e.mscgen)),[])}}),W.of({name:`Xù`,extensions:[`xu`],load(){return c(()=>import(`./mscgen-Df4T1TPF.js`).then(e=>Z(e.xu)),[])}}),W.of({name:`MsGenny`,extensions:[`msgenny`],load(){return c(()=>import(`./mscgen-Df4T1TPF.js`).then(e=>Z(e.msgenny)),[])}}),W.of({name:`Vue`,extensions:[`vue`],load(){return c(()=>import(`./dist-BfbneuyF.js`).then(e=>e.vue()),__vite__mapDeps([53,30,1,28,32,33,27]))}}),W.of({name:`Angular Template`,load(){return c(()=>import(`./dist-CuICAqXS.js`).then(e=>e.angular()),__vite__mapDeps([54,30,1,28,32,33,27]))}})],NO={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},jCe={borderLeftWidth:`2px`},PO={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},FO={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},IO={border:`none`,borderRadius:`4px`,padding:`2px 10px`},MCe={borderRadius:`2px`},LO={borderRadius:`2px`},RO={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},zO={width:`12px`,height:`12px`,borderRadius:`6px`},BO={borderRadius:`4px`,padding:`2px 6px`},VO={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},HO=`#0d1117`,UO=`#c9d1d9`,WO=`#264F78`,GO=`#8b949e`,KO=`#ffffff`,qO=`#7ee787`,JO=`#d2a8ff`,YO=`#79c0ff`,XO=`#ff7b72`,ZO=`#a5d6ff`,NCe=`#2c333a`,PCe=`#3c444d`,QO=`#ffab70`,$O=`#161b22`,ek=`#30363d`,FCe=`#21262d`,tk=`#f97583`,ICe=`#2d333b1a`,nk=`#21262d`,rk=KO,ik=WO,LCe=`#3a587a75`,ak=`#4d90fe`,ok=`#d29922`,RCe=`#3a587a55`,sk=`#58a6ff`,zCe=`#bc8cff`,ck=`#2ea04350`,lk=`#f8514940`,uk=`#7ee787`,dk=`#ff7b72`,fk=[Te.theme({"&":{color:UO,backgroundColor:HO,fontSize:NO.fontSize,fontFamily:NO.fontFamily},".cm-content":{caretColor:rk,lineHeight:NO.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:rk,borderLeftWidth:jCe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${rk}99`,color:HO},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:ik},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#3a587a`,outline:`1px solid ${YO}`,color:UO,borderRadius:BO.borderRadius,"& span":{color:UO}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:ak,color:KO,padding:BO.padding,"& span":{color:KO}},".cm-search.cm-panel.cm-textfield":{color:UO,borderRadius:BO.borderRadius,padding:BO.padding},".cm-panels":{backgroundColor:nk,color:UO,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${ek}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${ek}`},".cm-panel button":{backgroundColor:nk,color:UO,border:IO.border,borderRadius:IO.borderRadius,padding:IO.padding},".cm-panel button:hover":{backgroundColor:NCe},".cm-activeLine":{backgroundColor:ICe,borderRadius:MCe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:$O,color:GO,border:FO.border,borderRight:`1px solid #30363d`,paddingRight:FO.paddingRight},".cm-activeLineGutter":{backgroundColor:FCe,color:UO,fontWeight:FO.fontWeight},".cm-lineNumbers":{fontSize:FO.fontSize,lineHeight:FO.lineHeight},".cm-foldGutter":{fontSize:FO.fontSize,lineHeight:FO.lineHeight},".cm-foldGutter .cm-gutterElement":{color:GO,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:UO},".cm-insertedLine":{textDecoration:PO.insertedTextDecoration,backgroundColor:ck,color:uk,padding:PO.insertedLinePadding,borderRadius:PO.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:PO.insertedTextDecoration,backgroundColor:`${ck} !important`,color:uk,padding:PO.insertedLinePadding,borderRadius:PO.borderRadious,border:`1px solid ${uk}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:PO.deletedTextDecoration,backgroundColor:lk,color:dk,padding:PO.insertedLinePadding,borderRadius:PO.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:PO.deletedTextDecoration,backgroundColor:`${lk} !important`,color:dk,padding:PO.insertedLinePadding,borderRadius:PO.borderRadious,border:`1px solid ${dk}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:nk,border:`1px solid ${ek}`,borderRadius:VO.borderRadius,padding:VO.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:nk,border:`none`},"& > ul > li":{padding:VO.padding,lineHeight:VO.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:ik,color:KO,borderRadius:VO.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:GO,paddingRight:VO.paddingRight},"& > ul > li > span.cm-completionDetail":{color:GO,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:nk,borderBottomColor:nk},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${tk}`},"&-warning":{borderLeft:`3px solid ${ok}`},"&-info":{borderLeft:`3px solid ${sk}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${tk}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${ok}`},".cm-matchingBracket":{backgroundColor:LCe,outline:`1px solid ${ak}`,borderRadius:LO.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#f9758340`,outline:`1px solid ${tk}`,borderRadius:LO.borderRadius},".cm-selectionMatch":{backgroundColor:RCe,outline:`1px solid ${WO}50`,borderRadius:LO.borderRadius},".cm-foldPlaceholder":{backgroundColor:nk,color:GO,border:`1px dotted ${ek}70`,borderRadius:RO.borderRadius,padding:RO.padding,margin:RO.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${HO}, 0 0 0 3px ${sk}40`},"& .cm-scroller::-webkit-scrollbar":{width:zO.width,height:zO.height},"& .cm-scroller::-webkit-scrollbar-track":{background:$O},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:ek,borderRadius:zO.borderRadius,border:`3px solid ${$O}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:PCe},".cm-ghostText":{opacity:`0.5`,color:GO}},{dark:!0}),ve(Ae.define([{tag:U.keyword,color:XO,fontWeight:`bold`},{tag:U.controlKeyword,color:XO,fontWeight:`bold`},{tag:U.moduleKeyword,color:XO,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:YO},{tag:[U.variableName],color:YO},{tag:[U.propertyName],color:JO,fontStyle:`normal`},{tag:[U.typeName],color:XO},{tag:[U.className],color:JO,fontStyle:`italic`},{tag:[U.namespace],color:YO,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:UO},{tag:[U.bracket],color:GO},{tag:[U.brace],color:GO},{tag:[U.punctuation],color:GO},{tag:[U.function(U.variableName),U.labelName],color:qO},{tag:[U.definition(U.variableName)],color:YO},{tag:U.number,color:QO},{tag:U.changed,color:QO},{tag:U.annotation,color:tk,fontStyle:`italic`},{tag:U.modifier,color:QO,fontStyle:`italic`},{tag:U.self,color:QO},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:QO},{tag:[U.atom,U.bool,U.special(U.variableName)],color:QO},{tag:[U.processingInstruction,U.inserted],color:qO},{tag:[U.special(U.string),U.regexp],color:ZO},{tag:U.string,color:ZO},{tag:U.definition(U.typeName),color:XO,fontWeight:`bold`},{tag:U.meta,color:GO},{tag:U.comment,fontStyle:`italic`,color:GO},{tag:U.docComment,fontStyle:`italic`,color:GO},{tag:[U.tagName],color:qO},{tag:[U.attributeName],color:JO},{tag:[U.heading],fontWeight:`bold`,color:YO},{tag:[U.strong],fontWeight:`bold`,color:YO},{tag:[U.emphasis],fontStyle:`italic`,color:ZO},{tag:[U.link],color:zCe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:sk,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:UO,textDecoration:`underline wavy`,borderBottom:`1px wavy ${tk}`},{tag:[U.strikethrough],color:tk,textDecoration:`line-through`},{tag:U.constant(U.name),color:QO},{tag:U.deleted,color:tk},{tag:U.squareBracket,color:GO},{tag:U.angleBracket,color:GO},{tag:U.monospace,color:UO},{tag:[U.contentSeparator],color:YO},{tag:U.quote,color:GO}]))],pk={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},BCe={borderLeftWidth:`2px`},mk={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},hk={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},gk={border:`none`,borderRadius:`4px`,padding:`2px 10px`},VCe={borderRadius:`2px`},_k={borderRadius:`2px`},vk={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},yk={width:`12px`,height:`12px`,borderRadius:`6px`},bk={borderRadius:`4px`,padding:`2px 6px`},xk={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},Sk=`#ffffff`,Ck=`#24292e`,wk=`#BBDFFF`,Tk=`#6e7781`,Ek=`#f6f8fa`,HCe=`#116329`,Dk=`#6a737d`,Ok=`#6f42c1`,kk=`#005cc5`,Ak=`#d73a49`,jk=`#032f62`,UCe=`#22863a`,Mk=`#e36209`,WCe=`#f1f8ff`,Nk=`#e1e4e8`,GCe=`#f8f9fa`,Pk=`#cb2431`,KCe=`#BBDFFF20`,Fk=GCe,Ik=Ck,qCe=wk,JCe=`#e8f0fe`,YCe=`#0366d6`,XCe=`#b08800`,ZCe=`#79b8ff40`,Lk=`#0969da`,QCe=`#8250df`,$Ce=`#e6ffec80`,ewe=`#ffebe980`,Rk=`#0f6d31`,zk=`#cf222e`,Bk=[Te.theme({"&":{color:Ck,backgroundColor:Sk,fontSize:pk.fontSize,fontFamily:pk.fontFamily},".cm-content":{caretColor:Ik,lineHeight:pk.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:Ik,borderLeftWidth:BCe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${Ik}99`,color:Sk},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:qCe,color:Ck},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#daebff`,outline:`1px solid ${kk}`,color:Ck,borderRadius:bk.borderRadius,"& span":{color:Ck}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#79b8ff`,color:Sk,padding:bk.padding,"& span":{color:Sk}},".cm-search.cm-panel.cm-textfield":{color:Ck,borderRadius:bk.borderRadius,padding:bk.padding},".cm-panels":{backgroundColor:Ek,color:Tk,borderRadius:`0 0 4px 4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${Nk}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${Nk}`},".cm-panel button":{backgroundColor:Sk,color:Ck,border:gk.border,borderRadius:gk.borderRadius,padding:gk.padding},".cm-panel button:hover":{backgroundColor:`#f5f5f5`},".cm-activeLine":{backgroundColor:KCe,borderRadius:VCe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:Ek,color:Tk,border:hk.border,borderRight:`1px solid ${Nk}`,paddingRight:hk.paddingRight},".cm-activeLineGutter":{backgroundColor:WCe,color:Ck,fontWeight:hk.fontWeight},".cm-lineNumbers":{fontSize:hk.fontSize,lineHeight:hk.lineHeight},".cm-foldGutter":{fontSize:hk.fontSize,lineHeight:hk.lineHeight},".cm-foldGutter .cm-gutterElement":{color:Tk,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:Ck},".cm-insertedLine":{textDecoration:mk.insertedTextDecoration,backgroundColor:$Ce,color:Rk,padding:mk.insertedLinePadding,borderRadius:mk.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:mk.insertedTextDecoration,backgroundColor:`${$Ce} !important`,color:Rk,padding:mk.insertedLinePadding,borderRadius:mk.borderRadious,border:`1px solid ${Rk}30`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:mk.deletedTextDecoration,backgroundColor:ewe,color:zk,padding:mk.insertedLinePadding,borderRadius:mk.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:mk.deletedTextDecoration,backgroundColor:`${ewe} !important`,color:zk,padding:mk.insertedLinePadding,borderRadius:mk.borderRadious,border:`1px solid ${zk}30`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:Fk,border:`1px solid ${Nk}`,borderRadius:xk.borderRadius,padding:xk.padding,boxShadow:`0 1px 5px rgba(0, 0, 0, 0.1)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:Fk,border:`none`},"& > ul > li":{padding:xk.padding,lineHeight:xk.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#0366d630`,color:Ck,borderRadius:xk.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:`#0366d615`},"& > ul > li > span.cm-completionIcon":{color:Tk,paddingRight:xk.paddingRight},"& > ul > li > span.cm-completionDetail":{color:Tk,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Fk,borderBottomColor:Fk},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${Pk}`},"&-warning":{borderLeft:`3px solid ${XCe}`},"&-info":{borderLeft:`3px solid ${Lk}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${Pk}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${XCe}`},".cm-matchingBracket":{backgroundColor:JCe,outline:`1px solid ${YCe}80`,borderRadius:_k.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#ffeef080`,outline:`1px solid ${Pk}`,borderRadius:_k.borderRadius},".cm-selectionMatch":{backgroundColor:ZCe,outline:`1px solid ${wk}50`,borderRadius:_k.borderRadius},".cm-foldPlaceholder":{backgroundColor:ZCe,color:Tk,border:`1px dotted ${Nk}70`,borderRadius:vk.borderRadius,padding:vk.padding,margin:vk.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${Sk}, 0 0 0 3px ${Lk}40`},"& .cm-scroller::-webkit-scrollbar":{width:yk.width,height:yk.height},"& .cm-scroller::-webkit-scrollbar-track":{background:Nk},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:Ck,borderRadius:yk.borderRadius,border:`3px solid ${Nk}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:Dk},".cm-ghostText":{opacity:`0.5`,color:`#959da5`}},{dark:!1}),ve(Ae.define([{tag:U.keyword,color:Ak,fontWeight:`bold`},{tag:U.controlKeyword,color:Ak,fontWeight:`bold`},{tag:U.moduleKeyword,color:Ak,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:kk},{tag:[U.variableName],color:kk},{tag:[U.propertyName],color:Ok,fontStyle:`normal`},{tag:[U.typeName],color:Ak},{tag:[U.className],color:Ok,fontStyle:`italic`},{tag:[U.namespace],color:kk,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:Ck},{tag:[U.bracket],color:Dk},{tag:[U.brace],color:Dk},{tag:[U.punctuation],color:Dk},{tag:[U.function(U.variableName),U.labelName],color:UCe},{tag:[U.definition(U.variableName)],color:kk},{tag:U.number,color:Mk},{tag:U.changed,color:Mk},{tag:U.annotation,color:Pk,fontStyle:`italic`},{tag:U.modifier,color:Mk,fontStyle:`italic`},{tag:U.self,color:Mk},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:Mk},{tag:[U.atom,U.bool,U.special(U.variableName)],color:Mk},{tag:[U.processingInstruction,U.inserted],color:UCe},{tag:[U.special(U.string),U.regexp],color:jk},{tag:U.string,color:jk},{tag:U.definition(U.typeName),color:Ak,fontWeight:`bold`},{tag:U.meta,color:Dk},{tag:U.comment,fontStyle:`italic`,color:Dk},{tag:U.docComment,fontStyle:`italic`,color:Dk},{tag:[U.tagName],color:HCe},{tag:[U.attributeName],color:Ok},{tag:[U.heading],fontWeight:`bold`,color:kk},{tag:[U.strong],fontWeight:`bold`,color:kk},{tag:[U.emphasis],fontStyle:`italic`,color:jk},{tag:[U.link],color:QCe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:Lk,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:Ck,textDecoration:`underline wavy`,borderBottom:`1px wavy ${Pk}`},{tag:[U.strikethrough],color:Pk,textDecoration:`line-through`},{tag:U.constant(U.name),color:Mk},{tag:U.deleted,color:Pk},{tag:U.squareBracket,color:Dk},{tag:U.angleBracket,color:Dk},{tag:U.monospace,color:Ck},{tag:[U.contentSeparator],color:kk},{tag:U.quote,color:Dk}]))],Vk={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},twe={borderLeftWidth:`2px`},Hk={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},Uk={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},Wk={border:`none`,borderRadius:`4px`,padding:`2px 10px`},nwe={borderRadius:`2px`},Gk={borderRadius:`2px`},Kk={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},qk={width:`12px`,height:`12px`,borderRadius:`6px`},Jk={borderRadius:`4px`,padding:`2px 6px`},Yk={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},Xk=`#282828`,Zk=`#3c3836`,Qk=`#504945`,$k=`#665c54`,rwe=`#7c6f64`,eA=`#928374`,tA=`#fbf1c7`,nA=`#ebdbb2`,rA=`#fb4934`,iA=`#b8bb26`,aA=`#fabd2f`,oA=`#83a598`,sA=`#d3869b`,cA=`#8ec07c`,lA=`#fe8019`,uA=rA,iwe=Zk,awe=`#3c383660`,owe=Xk,dA=Zk,fA=Qk,swe=`#665c5480`,pA=lA,cwe=`#504945cc`,lwe=aA,mA=aA,hA=oA,uwe=sA,gA=`#32361a80`,_A=`#3c1f1e80`,vA=`#b8bb26`,yA=`#fb4934`,dwe=[Te.theme({"&":{color:nA,backgroundColor:owe,fontSize:Vk.fontSize,fontFamily:Vk.fontFamily},".cm-content":{caretColor:pA,lineHeight:Vk.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:pA,borderLeftWidth:twe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${pA}99`,color:Xk},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:fA},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#b57614cc`,outline:`1px solid ${aA}`,color:tA,borderRadius:Jk.borderRadius,"& span":{color:tA}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:lA,color:Xk,padding:Jk.padding,"& span":{color:Xk}},".cm-search.cm-panel.cm-textfield":{color:nA,borderRadius:Jk.borderRadius,padding:Jk.padding},".cm-panels":{backgroundColor:dA,color:nA,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${$k}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${$k}`},".cm-panel button":{backgroundColor:dA,color:nA,border:Wk.border,borderRadius:Wk.borderRadius,padding:Wk.padding},".cm-panel button:hover":{backgroundColor:Qk},".cm-activeLine":{backgroundColor:awe,borderRadius:nwe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:Zk,color:eA,border:Uk.border,borderRight:`1px solid ${Qk}`,paddingRight:Uk.paddingRight},".cm-activeLineGutter":{backgroundColor:iwe,color:nA,fontWeight:Uk.fontWeight},".cm-lineNumbers":{fontSize:Uk.fontSize,lineHeight:Uk.lineHeight},".cm-foldGutter":{fontSize:Uk.fontSize,lineHeight:Uk.lineHeight},".cm-foldGutter .cm-gutterElement":{color:eA,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:nA},".cm-insertedLine":{textDecoration:Hk.insertedTextDecoration,backgroundColor:gA,color:vA,padding:Hk.insertedLinePadding,borderRadius:Hk.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:Hk.insertedTextDecoration,backgroundColor:`${gA} !important`,color:vA,padding:Hk.insertedLinePadding,borderRadius:Hk.borderRadious,border:`1px solid ${vA}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:Hk.deletedTextDecoration,backgroundColor:_A,color:yA,padding:Hk.insertedLinePadding,borderRadius:Hk.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:Hk.deletedTextDecoration,backgroundColor:`${_A} !important`,color:yA,padding:Hk.insertedLinePadding,borderRadius:Hk.borderRadious,border:`1px solid ${yA}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:dA,border:`1px solid ${$k}`,borderRadius:Yk.borderRadius,padding:Yk.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:dA,border:`none`},"& > ul > li":{padding:Yk.padding,lineHeight:Yk.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:fA,color:tA,borderRadius:Yk.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:eA,paddingRight:Yk.paddingRight},"& > ul > li > span.cm-completionDetail":{color:eA,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:dA,borderBottomColor:dA},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${uA}`},"&-warning":{borderLeft:`3px solid ${mA}`},"&-info":{borderLeft:`3px solid ${hA}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${uA}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${mA}`},".cm-matchingBracket":{backgroundColor:cwe,outline:`1px solid ${lwe}`,borderRadius:Gk.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#cc241d55`,outline:`1px solid ${uA}`,borderRadius:Gk.borderRadius},".cm-selectionMatch":{backgroundColor:swe,outline:`1px solid ${$k}`,borderRadius:Gk.borderRadius},".cm-foldPlaceholder":{backgroundColor:dA,color:eA,border:`1px dotted ${$k}`,borderRadius:Kk.borderRadius,padding:Kk.padding,margin:Kk.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${Xk}, 0 0 0 3px ${lA}40`},"& .cm-scroller::-webkit-scrollbar":{width:qk.width,height:qk.height},"& .cm-scroller::-webkit-scrollbar-track":{background:Zk},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:$k,borderRadius:qk.borderRadius,border:`3px solid ${Zk}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:rwe},".cm-ghostText":{opacity:`0.5`,color:eA}},{dark:!0}),ve(Ae.define([{tag:U.keyword,color:rA,fontWeight:`bold`},{tag:U.controlKeyword,color:rA,fontWeight:`bold`},{tag:U.moduleKeyword,color:rA,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:oA},{tag:[U.variableName],color:oA},{tag:[U.propertyName],color:cA,fontStyle:`normal`},{tag:[U.typeName],color:cA},{tag:[U.className],color:aA,fontStyle:`italic`},{tag:[U.namespace],color:oA,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:nA},{tag:[U.bracket],color:eA},{tag:[U.brace],color:eA},{tag:[U.punctuation],color:eA},{tag:[U.function(U.variableName),U.labelName],color:aA},{tag:[U.definition(U.variableName)],color:oA},{tag:U.number,color:sA},{tag:U.changed,color:sA},{tag:U.annotation,color:uA,fontStyle:`italic`},{tag:U.modifier,color:sA,fontStyle:`italic`},{tag:U.self,color:sA},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:lA},{tag:[U.atom,U.bool,U.special(U.variableName)],color:lA},{tag:[U.processingInstruction,U.inserted],color:iA},{tag:[U.special(U.string),U.regexp],color:iA},{tag:U.string,color:iA},{tag:U.definition(U.typeName),color:cA,fontWeight:`bold`},{tag:U.meta,color:eA},{tag:U.comment,fontStyle:`italic`,color:eA},{tag:U.docComment,fontStyle:`italic`,color:eA},{tag:[U.tagName],color:rA},{tag:[U.attributeName],color:aA},{tag:[U.heading],fontWeight:`bold`,color:aA},{tag:[U.strong],fontWeight:`bold`,color:aA},{tag:[U.emphasis],fontStyle:`italic`,color:iA},{tag:[U.link],color:uwe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:hA,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:nA,textDecoration:`underline wavy`,borderBottom:`1px wavy ${uA}`},{tag:[U.strikethrough],color:uA,textDecoration:`line-through`},{tag:U.constant(U.name),color:lA},{tag:U.deleted,color:uA},{tag:U.squareBracket,color:eA},{tag:U.angleBracket,color:eA},{tag:U.monospace,color:nA},{tag:[U.contentSeparator],color:oA},{tag:U.quote,color:eA}]))],bA={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},fwe={borderLeftWidth:`2px`},xA={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},SA={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},CA={border:`none`,borderRadius:`4px`,padding:`2px 10px`},pwe={borderRadius:`2px`},wA={borderRadius:`2px`},TA={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},EA={width:`12px`,height:`12px`,borderRadius:`6px`},DA={borderRadius:`4px`,padding:`2px 6px`},OA={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},kA=`#3c3836`,mwe=`#504945`,hwe=`#665c54`,AA=`#7c6f64`,jA=`#928374`,MA=`#fbf1c7`,NA=`#ebdbb2`,PA=`#d5c4a1`,FA=`#bdae93`,gwe=`#a89984`,IA=`#9d0006`,LA=`#79740e`,RA=`#b57614`,zA=`#076678`,BA=`#8f3f71`,VA=`#427b58`,HA=`#af3a03`,UA=IA,_we=NA,vwe=`#ffc42e25`,ywe=MA,WA=NA,bwe=_we,xwe=`#ffc42e40`,GA=HA,Swe=`#d5c4a180`,Cwe=HA,KA=RA,qA=zA,wwe=BA,JA=`#d8e5bc80`,YA=`#f7cfcf80`,XA=`#79740e`,ZA=`#9d0006`,Twe=[Te.theme({"&":{color:kA,backgroundColor:ywe,fontSize:bA.fontSize,fontFamily:bA.fontFamily},".cm-content":{caretColor:GA,lineHeight:bA.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:GA,borderLeftWidth:fwe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${GA}99`,color:MA},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:bwe,color:kA},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#ffc42e80`,outline:`1px solid ${HA}`,color:kA,borderRadius:DA.borderRadius,"& span":{color:kA}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:HA,color:MA,padding:DA.padding,"& span":{color:MA}},".cm-search.cm-panel.cm-textfield":{color:kA,borderRadius:DA.borderRadius,padding:DA.padding},".cm-panels":{backgroundColor:NA,color:mwe,borderRadius:`0 0 4px 4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${FA}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${FA}`},".cm-panel button":{backgroundColor:MA,color:kA,border:CA.border,borderRadius:CA.borderRadius,padding:CA.padding},".cm-panel button:hover":{backgroundColor:PA},".cm-activeLine":{backgroundColor:vwe,borderRadius:pwe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:NA,color:AA,border:SA.border,borderRight:`1px solid ${FA}`,paddingRight:SA.paddingRight},".cm-activeLineGutter":{backgroundColor:PA,color:kA,fontWeight:SA.fontWeight},".cm-lineNumbers":{fontSize:SA.fontSize,lineHeight:SA.lineHeight},".cm-foldGutter":{fontSize:SA.fontSize,lineHeight:SA.lineHeight},".cm-foldGutter .cm-gutterElement":{color:AA,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:kA},".cm-insertedLine":{textDecoration:xA.insertedTextDecoration,backgroundColor:JA,color:XA,padding:xA.insertedLinePadding,borderRadius:xA.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:xA.insertedTextDecoration,backgroundColor:`${JA} !important`,color:XA,padding:xA.insertedLinePadding,borderRadius:xA.borderRadious,border:`1px solid ${XA}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:xA.deletedTextDecoration,backgroundColor:YA,color:ZA,padding:xA.insertedLinePadding,borderRadius:xA.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:xA.deletedTextDecoration,backgroundColor:`${YA} !important`,color:ZA,padding:xA.insertedLinePadding,borderRadius:xA.borderRadious,border:`1px solid ${ZA}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:WA,border:`1px solid ${FA}`,borderRadius:OA.borderRadius,padding:OA.padding,boxShadow:`0 1px 5px rgba(0, 0, 0, 0.1)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:WA,border:`none`},"& > ul > li":{padding:OA.padding,lineHeight:OA.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:HA+`30`,color:kA,borderRadius:OA.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:HA+`15`},"& > ul > li > span.cm-completionIcon":{color:AA,paddingRight:OA.paddingRight},"& > ul > li > span.cm-completionDetail":{color:AA,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:WA,borderBottomColor:WA},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${UA}`},"&-warning":{borderLeft:`3px solid ${KA}`},"&-info":{borderLeft:`3px solid ${qA}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${UA}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${KA}`},".cm-matchingBracket":{backgroundColor:Swe,outline:`1px solid ${Cwe}`,borderRadius:wA.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#fb492740`,outline:`1px solid ${UA}`,borderRadius:wA.borderRadius},".cm-selectionMatch":{backgroundColor:xwe,outline:`1px solid ${FA}`,borderRadius:wA.borderRadius},".cm-foldPlaceholder":{backgroundColor:`transparent`,color:hwe,border:`1px dotted ${FA}`,borderRadius:TA.borderRadius,padding:TA.padding,margin:TA.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${MA}, 0 0 0 3px ${HA}40`},"& .cm-scroller::-webkit-scrollbar":{width:EA.width,height:EA.height},"& .cm-scroller::-webkit-scrollbar-track":{background:MA},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:FA,borderRadius:EA.borderRadius,border:`3px solid ${MA}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:gwe},".cm-ghostText":{opacity:`0.5`,color:jA}},{dark:!1}),ve(Ae.define([{tag:U.keyword,color:IA,fontWeight:`bold`},{tag:U.controlKeyword,color:IA,fontWeight:`bold`},{tag:U.moduleKeyword,color:IA,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:zA},{tag:[U.variableName],color:zA},{tag:[U.propertyName],color:VA,fontStyle:`normal`},{tag:[U.typeName],color:VA},{tag:[U.className],color:RA,fontStyle:`italic`},{tag:[U.namespace],color:zA,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:kA},{tag:[U.bracket],color:jA},{tag:[U.brace],color:jA},{tag:[U.punctuation],color:jA},{tag:[U.function(U.variableName),U.labelName],color:RA},{tag:[U.definition(U.variableName)],color:zA},{tag:U.number,color:BA},{tag:U.changed,color:BA},{tag:U.annotation,color:UA,fontStyle:`italic`},{tag:U.modifier,color:BA,fontStyle:`italic`},{tag:U.self,color:BA},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:HA},{tag:[U.atom,U.bool,U.special(U.variableName)],color:HA},{tag:[U.processingInstruction,U.inserted],color:LA},{tag:[U.special(U.string),U.regexp],color:LA},{tag:U.string,color:LA},{tag:U.definition(U.typeName),color:VA,fontWeight:`bold`},{tag:U.meta,color:jA},{tag:U.comment,fontStyle:`italic`,color:jA},{tag:U.docComment,fontStyle:`italic`,color:jA},{tag:[U.tagName],color:IA},{tag:[U.attributeName],color:RA},{tag:[U.heading],fontWeight:`bold`,color:RA},{tag:[U.strong],fontWeight:`bold`,color:RA},{tag:[U.emphasis],fontStyle:`italic`,color:LA},{tag:[U.link],color:wwe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:qA,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:kA,textDecoration:`underline wavy`,borderBottom:`1px wavy ${UA}`},{tag:[U.strikethrough],color:UA,textDecoration:`line-through`},{tag:U.constant(U.name),color:HA},{tag:U.deleted,color:UA},{tag:U.squareBracket,color:jA},{tag:U.angleBracket,color:jA},{tag:U.monospace,color:kA},{tag:[U.contentSeparator],color:zA},{tag:U.quote,color:jA}]))],QA={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},Ewe={borderLeftWidth:`2px`},$A={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},ej={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},tj={border:`none`,borderRadius:`4px`,padding:`2px 10px`},Dwe={borderRadius:`2px`},nj={borderRadius:`2px`},rj={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},ij={width:`12px`,height:`12px`,borderRadius:`6px`},aj={borderRadius:`4px`,padding:`2px 6px`},oj={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},sj=`#212121`,cj=`#505d64`,lj=`#606f7a`,uj=`#707d8b`,Owe=`#a0a4ae`,dj=`#bdbdbd`,fj=`#e0e0e0`,kwe=`#202325`,pj=`#ff5f52`,mj=`#ff6e40`,Awe=`#fa5788`,hj=`#facf4e`,gj=`#ffad42`,_j=`#56c8d8`,vj=`#7186f0`,yj=`#cf6edf`,jwe=`#6abf69`,Mwe=`#99d066`,Nwe=`#4ebaaa`,bj=pj,xj=kwe,Pwe=`#2d333b30`,Sj=sj,Cj=cj,wj=`#ffffff1f`,Fwe=`#4A707A80`,Tj=Owe,Iwe=`#39496650`,Lwe=_j,Ej=gj,Dj=_j,Rwe=yj,Oj=`#1e3d2780`,kj=`#4e282880`,Aj=`#6abf69`,jj=`#ff5f52`,zwe=[Te.theme({"&":{color:dj,backgroundColor:Sj,fontSize:QA.fontSize,fontFamily:QA.fontFamily},".cm-content":{caretColor:Tj,lineHeight:QA.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:Tj,borderLeftWidth:Ewe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${Tj}99`,color:Sj},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:wj},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#394966cc`,outline:`1px solid ${_j}`,color:fj,borderRadius:aj.borderRadius,"& span":{color:fj}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:_j,color:Sj,padding:aj.padding,"& span":{color:Sj}},".cm-search.cm-panel.cm-textfield":{color:dj,borderRadius:aj.borderRadius,padding:aj.padding},".cm-panels":{backgroundColor:sj,color:dj,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${uj}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${uj}`},".cm-panel button":{backgroundColor:Cj,color:dj,border:tj.border,borderRadius:tj.borderRadius,padding:tj.padding},".cm-panel button:hover":{backgroundColor:lj},".cm-activeLine":{backgroundColor:Pwe,borderRadius:Dwe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:xj,color:uj,border:ej.border,borderRight:`1px solid ${cj}`,paddingRight:ej.paddingRight},".cm-activeLineGutter":{backgroundColor:`#252a2c`,color:dj,fontWeight:ej.fontWeight},".cm-lineNumbers":{fontSize:ej.fontSize,lineHeight:ej.lineHeight},".cm-foldGutter":{fontSize:ej.fontSize,lineHeight:ej.lineHeight},".cm-foldGutter .cm-gutterElement":{color:uj,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:dj},".cm-insertedLine":{textDecoration:$A.insertedTextDecoration,backgroundColor:Oj,color:Aj,padding:$A.insertedLinePadding,borderRadius:$A.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:$A.insertedTextDecoration,backgroundColor:`${Oj} !important`,color:Aj,padding:$A.insertedLinePadding,borderRadius:$A.borderRadious,border:`1px solid ${Aj}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:$A.deletedTextDecoration,backgroundColor:kj,color:jj,padding:$A.insertedLinePadding,borderRadius:$A.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:$A.deletedTextDecoration,backgroundColor:`${kj} !important`,color:jj,padding:$A.insertedLinePadding,borderRadius:$A.borderRadious,border:`1px solid ${jj}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:Cj,border:`1px solid ${uj}`,borderRadius:oj.borderRadius,padding:oj.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:Cj,border:`none`},"& > ul > li":{padding:oj.padding,lineHeight:oj.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:wj,color:fj,borderRadius:oj.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:uj,paddingRight:oj.paddingRight},"& > ul > li > span.cm-completionDetail":{color:uj,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Cj,borderBottomColor:Cj},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${bj}`},"&-warning":{borderLeft:`3px solid ${Ej}`},"&-info":{borderLeft:`3px solid ${Dj}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${bj}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${Ej}`},".cm-matchingBracket":{backgroundColor:Iwe,outline:`1px solid ${Lwe}`,borderRadius:nj.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#ff5f5240`,outline:`1px solid ${bj}`,borderRadius:nj.borderRadius},".cm-selectionMatch":{backgroundColor:Fwe,outline:`1px solid ${lj}50`,borderRadius:nj.borderRadius},".cm-foldPlaceholder":{backgroundColor:Cj,color:uj,border:`1px dotted ${uj}70`,borderRadius:rj.borderRadius,padding:rj.padding,margin:rj.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${Sj}, 0 0 0 3px ${_j}40`},"& .cm-scroller::-webkit-scrollbar":{width:ij.width,height:ij.height},"& .cm-scroller::-webkit-scrollbar-track":{background:xj},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:lj,borderRadius:ij.borderRadius,border:`3px solid ${xj}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:uj},".cm-ghostText":{opacity:`0.5`,color:uj}},{dark:!0}),ve(Ae.define([{tag:U.keyword,color:pj,fontWeight:`bold`},{tag:U.controlKeyword,color:pj,fontWeight:`bold`},{tag:U.moduleKeyword,color:pj,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:vj},{tag:[U.variableName],color:Mwe},{tag:[U.propertyName],color:yj,fontStyle:`normal`},{tag:[U.typeName],color:pj},{tag:[U.className],color:hj,fontStyle:`italic`},{tag:[U.namespace],color:vj,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:dj},{tag:[U.bracket],color:uj},{tag:[U.brace],color:uj},{tag:[U.punctuation],color:uj},{tag:[U.function(U.variableName)],color:_j},{tag:[U.labelName],color:_j,fontStyle:`italic`},{tag:[U.definition(U.function(U.variableName))],color:_j},{tag:[U.definition(U.variableName)],color:vj},{tag:U.number,color:hj},{tag:U.changed,color:hj},{tag:U.annotation,color:bj,fontStyle:`italic`},{tag:U.modifier,color:mj,fontStyle:`italic`},{tag:U.self,color:mj},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:mj},{tag:[U.atom,U.bool,U.special(U.variableName)],color:mj},{tag:[U.processingInstruction,U.inserted],color:jwe},{tag:[U.special(U.string),U.regexp],color:Awe},{tag:U.string,color:gj},{tag:U.definition(U.typeName),color:pj,fontWeight:`bold`},{tag:U.meta,color:uj},{tag:U.comment,fontStyle:`italic`,color:uj},{tag:U.docComment,fontStyle:`italic`,color:uj},{tag:[U.tagName],color:yj},{tag:[U.attributeName],color:hj},{tag:[U.heading],fontWeight:`bold`,color:Nwe},{tag:U.heading1,color:hj},{tag:U.heading2,color:gj},{tag:U.heading3,color:_j},{tag:U.heading4,color:vj},{tag:U.heading5,color:yj},{tag:U.heading6,color:pj},{tag:[U.strong],fontWeight:`bold`,color:vj},{tag:[U.emphasis],fontStyle:`italic`,color:gj},{tag:[U.link],color:Rwe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:Dj,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:dj,textDecoration:`underline wavy`,borderBottom:`1px wavy ${bj}`},{tag:[U.strikethrough],color:bj,textDecoration:`line-through`},{tag:U.constant(U.name),color:mj},{tag:U.deleted,color:bj},{tag:U.squareBracket,color:uj},{tag:U.angleBracket,color:uj},{tag:U.monospace,color:dj},{tag:[U.contentSeparator],color:vj},{tag:U.quote,color:uj}]))],Mj={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},Bwe={borderLeftWidth:`2px`},Nj={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},Pj={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},Fj={border:`none`,borderRadius:`4px`,padding:`2px 10px`},Vwe={borderRadius:`2px`},Ij={borderRadius:`2px`},Lj={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},Rj={width:`12px`,height:`12px`,borderRadius:`6px`},zj={borderRadius:`4px`,padding:`2px 6px`},Bj={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},Hwe=`#ffffff`,Vj=`#f5f5f5`,Hj=`#212121`,Uj=`#757575`,Wj=`#9e9e9e`,Gj=`#424242`,Uwe=`#eeeeee`,Kj=`#fafafa`,qj=`#f44336`,Jj=`#ff3e00`,Yj=`#FF00E9FF`,Wwe=`#ffc107`,Xj=`#ff9800`,Zj=`#00acc1`,Qj=`#3949ab`,$j=`#8e24aa`,eM=`#43a047`,tM=`#00897b`,nM=`#1e88e5`,rM=qj,Gwe=`#00000008`,iM=Hwe,aM=Vj,Kwe=`#DDEEFF`,qwe=`#90a4ae26`,oM=Wj,Jwe=`#DDEEFF80`,Ywe=Zj,sM=Xj,cM=Zj,Xwe=$j,lM=`#ECEFF180`,uM=`#e6ffed80`,dM=`#ffebe980`,fM=`#28a745`,pM=`#d73a49`,Zwe=[Te.theme({"&":{color:Hj,backgroundColor:iM,fontSize:Mj.fontSize,fontFamily:Mj.fontFamily},".cm-content":{caretColor:oM,lineHeight:Mj.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:oM,borderLeftWidth:Bwe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${Hj}99`,color:iM},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Kwe},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#FFA72680`,outline:`1px solid ${Wwe}`,color:Hj,borderRadius:zj.borderRadius,"& span":{color:Hj}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:Zj,color:iM,padding:zj.padding,"& span":{color:iM}},".cm-search.cm-panel.cm-textfield":{color:Hj,borderRadius:zj.borderRadius,padding:zj.padding},".cm-panels":{backgroundColor:Uwe,color:Hj,borderRadius:`4px`,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${Wj}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${Wj}`},".cm-panel button":{backgroundColor:aM,color:Hj,border:Fj.border,borderRadius:Fj.borderRadius,padding:Fj.padding},".cm-panel button:hover":{backgroundColor:`#CFD8DC`},".cm-activeLine":{backgroundColor:Gwe,borderRadius:Vwe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:Kj,color:Uj,border:Pj.border,borderRight:`1px solid ${Wj}`,paddingRight:Pj.paddingRight},".cm-activeLineGutter":{backgroundColor:`#E0E0E0`,color:Hj,fontWeight:Pj.fontWeight},".cm-lineNumbers":{fontSize:Pj.fontSize,lineHeight:Pj.lineHeight},".cm-foldGutter":{fontSize:Pj.fontSize,lineHeight:Pj.lineHeight},".cm-foldGutter .cm-gutterElement":{color:Uj,cursor:`pointer`,transition:`color 0.15s ease`},".cm-foldGutter .cm-gutterElement:hover":{color:Hj},".cm-insertedLine":{textDecoration:Nj.insertedTextDecoration,backgroundColor:uM,color:fM,padding:Nj.insertedLinePadding,borderRadius:Nj.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:Nj.insertedTextDecoration,backgroundColor:`${uM} !important`,color:fM,padding:Nj.insertedLinePadding,borderRadius:Nj.borderRadious,border:`1px solid ${fM}30`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:Nj.deletedTextDecoration,backgroundColor:dM,color:pM,padding:Nj.insertedLinePadding,borderRadius:Nj.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:Nj.deletedTextDecoration,backgroundColor:`${dM} !important`,color:pM,padding:Nj.insertedLinePadding,borderRadius:Nj.borderRadious,border:`1px solid ${pM}30`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:aM,border:`1px solid ${Wj}`,borderRadius:Bj.borderRadius,padding:Bj.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:aM,border:`none`},"& > ul > li":{padding:Bj.padding,lineHeight:Bj.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:lM,color:Hj,borderRadius:Bj.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:lM},"& > ul > li > span.cm-completionIcon":{color:Uj,paddingRight:Bj.paddingRight},"& > ul > li > span.cm-completionDetail":{color:Uj,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:aM,borderBottomColor:aM},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${rM}`},"&-warning":{borderLeft:`3px solid ${sM}`},"&-info":{borderLeft:`3px solid ${cM}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${rM}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${sM}`},".cm-matchingBracket":{backgroundColor:Jwe,outline:`1px solid ${Ywe}`,borderRadius:Ij.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${rM}20`,outline:`1px solid ${rM}`,borderRadius:Ij.borderRadius},".cm-selectionMatch":{backgroundColor:qwe,outline:`1px solid ${Uj}30`,borderRadius:Ij.borderRadius},".cm-foldPlaceholder":{backgroundColor:Vj,color:Uj,border:`1px dotted ${Uj}70`,borderRadius:Lj.borderRadius,padding:Lj.padding,margin:Lj.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${iM}, 0 0 0 3px ${Zj}40`},"& .cm-scroller::-webkit-scrollbar":{width:Rj.width,height:Rj.height},"& .cm-scroller::-webkit-scrollbar-track":{background:Kj},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:Uj,borderRadius:Rj.borderRadius,border:`3px solid ${Kj}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:Hj},".cm-ghostText":{opacity:`0.5`,color:Uj}},{dark:!1}),ve(Ae.define([{tag:U.keyword,color:Zj,fontWeight:`bold`},{tag:U.controlKeyword,color:Zj,fontWeight:`bold`},{tag:U.moduleKeyword,color:Zj,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:Gj},{tag:[U.variableName],color:Gj},{tag:[U.propertyName],color:tM,fontStyle:`normal`},{tag:[U.typeName],color:Xj},{tag:[U.className],color:Xj,fontStyle:`italic`},{tag:[U.namespace],color:Qj,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:Qj},{tag:[U.bracket],color:$j},{tag:[U.brace],color:$j},{tag:[U.punctuation],color:Uj},{tag:[U.function(U.variableName)],color:Jj},{tag:[U.labelName],color:nM,fontStyle:`italic`},{tag:[U.definition(U.function(U.variableName))],color:Jj},{tag:[U.definition(U.variableName)],color:Yj},{tag:U.number,color:Xj},{tag:U.changed,color:Xj},{tag:U.annotation,color:rM,fontStyle:`italic`},{tag:U.modifier,color:Xj,fontStyle:`italic`},{tag:U.self,color:Xj},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:Xj},{tag:[U.atom,U.bool],color:$j},{tag:[U.processingInstruction,U.inserted],color:eM},{tag:U.string,color:eM},{tag:[U.special(U.string),U.regexp],color:Yj},{tag:U.definition(U.typeName),color:Yj,fontWeight:`bold`},{tag:[U.definition(U.name),U.separator],color:Yj},{tag:U.meta,color:Uj},{tag:U.comment,fontStyle:`italic`,color:Uj},{tag:U.docComment,fontStyle:`italic`,color:Uj},{tag:[U.tagName],color:Jj},{tag:[U.attributeName],color:Gj},{tag:[U.heading],fontWeight:`bold`,color:tM},{tag:U.heading1,color:nM},{tag:U.heading2,color:Xj},{tag:U.heading3,color:Zj},{tag:U.heading4,color:Qj},{tag:U.heading5,color:$j},{tag:U.heading6,color:eM},{tag:[U.strong],fontWeight:`bold`,color:Qj},{tag:[U.emphasis],fontStyle:`italic`,color:Xj},{tag:[U.link],color:Xwe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:cM,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:Hj,textDecoration:`underline wavy`,borderBottom:`1px dotted ${qj}`},{tag:[U.strikethrough],color:rM,textDecoration:`line-through`},{tag:U.constant(U.name),color:Jj},{tag:U.deleted,color:rM},{tag:U.squareBracket,color:qj},{tag:U.angleBracket,color:Hj},{tag:U.monospace,color:Hj},{tag:[U.contentSeparator],color:Zj},{tag:U.quote,color:eM}]))],mM={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},Qwe={borderLeftWidth:`2px`},hM={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},gM={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},_M={border:`none`,borderRadius:`4px`,padding:`2px 10px`},$we={borderRadius:`2px`},vM={borderRadius:`2px`},yM={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},bM={width:`12px`,height:`12px`,borderRadius:`6px`},xM={borderRadius:`4px`,padding:`2px 6px`},SM={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},CM=`#272822`,wM=`#f8f8f2`,TM=`#88846f`,eTe=`#f8f8f0`,EM=`#F92672`,DM=`#FD971F`,OM=`#66D9EF`,kM=`#E6DB74`,AM=`#AE81FF`,jM=`#A6E22E`,MM=`#F44747`,NM=`#414339`,tTe=`#3e3d3257`,PM=`#34352f`,FM=`#49483E`,nTe=`#75715e70`,IM=eTe,rTe=`#75715E55`,iTe=OM,LM=DM,RM=OM,aTe=AM,zM=`#3d4d3880`,BM=`#4d393980`,VM=`#A6E22E`,HM=`#F92672`,oTe=[Te.theme({"&":{color:wM,backgroundColor:CM,fontSize:mM.fontSize,fontFamily:mM.fontFamily},".cm-content":{caretColor:IM,lineHeight:mM.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:IM,borderLeftWidth:Qwe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${IM}99`,color:CM},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:FM},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#49483E99`,outline:`1px solid ${kM}`,color:wM,borderRadius:xM.borderRadius,"& span":{color:wM}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:EM,color:CM,padding:xM.padding,"& span":{color:CM}},".cm-search.cm-panel.cm-textfield":{color:wM,borderRadius:xM.borderRadius,padding:xM.padding},".cm-panels":{backgroundColor:NM,color:wM,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${TM}80`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${TM}80`},".cm-panel button":{backgroundColor:PM,color:wM,border:_M.border,borderRadius:_M.borderRadius,padding:_M.padding},".cm-panel button:hover":{backgroundColor:`#49483E`},".cm-activeLine":{backgroundColor:tTe,borderRadius:$we.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:NM,color:TM,border:gM.border,borderRight:`1px solid #3e3d32`,paddingRight:gM.paddingRight},".cm-activeLineGutter":{backgroundColor:`#35352c`,color:wM,fontWeight:gM.fontWeight},".cm-lineNumbers":{fontSize:gM.fontSize,lineHeight:gM.lineHeight},".cm-foldGutter":{fontSize:gM.fontSize,lineHeight:gM.lineHeight},".cm-foldGutter .cm-gutterElement":{color:TM,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:wM},".cm-insertedLine":{textDecoration:hM.insertedTextDecoration,backgroundColor:zM,color:VM,padding:hM.insertedLinePadding,borderRadius:hM.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:hM.insertedTextDecoration,backgroundColor:`${zM} !important`,color:VM,padding:hM.insertedLinePadding,borderRadius:hM.borderRadious,border:`1px solid ${VM}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:hM.deletedTextDecoration,backgroundColor:BM,color:HM,padding:hM.insertedLinePadding,borderRadius:hM.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:hM.deletedTextDecoration,backgroundColor:`${BM} !important`,color:HM,padding:hM.insertedLinePadding,borderRadius:hM.borderRadious,border:`1px solid ${HM}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:PM,border:`1px solid #49483E`,borderRadius:SM.borderRadius,padding:SM.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.4)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:PM,border:`none`},"& > ul > li":{padding:SM.padding,lineHeight:SM.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:FM,color:wM,borderRadius:SM.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:TM,paddingRight:SM.paddingRight},"& > ul > li > span.cm-completionDetail":{color:TM,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:PM,borderBottomColor:PM},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${MM}`},"&-warning":{borderLeft:`3px solid ${LM}`},"&-info":{borderLeft:`3px solid ${RM}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${MM}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${LM}`},".cm-matchingBracket":{backgroundColor:rTe,outline:`1px solid ${iTe}`,borderRadius:vM.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#f9267240`,outline:`1px solid ${MM}`,borderRadius:vM.borderRadius},".cm-selectionMatch":{backgroundColor:nTe,outline:`1px solid ${TM}50`,borderRadius:vM.borderRadius},".cm-foldPlaceholder":{backgroundColor:PM,color:TM,border:`1px dotted ${TM}70`,borderRadius:yM.borderRadius,padding:yM.padding,margin:yM.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${CM}, 0 0 0 3px ${OM}40`},"& .cm-scroller::-webkit-scrollbar":{width:bM.width,height:bM.height},"& .cm-scroller::-webkit-scrollbar-track":{background:NM},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#49483E`,borderRadius:bM.borderRadius,border:`3px solid ${NM}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#5a594d`},".cm-ghostText":{opacity:`0.5`,color:TM}},{dark:!0}),ve(Ae.define([{tag:U.keyword,color:EM,fontWeight:`bold`},{tag:U.controlKeyword,color:EM,fontWeight:`bold`},{tag:U.moduleKeyword,color:EM,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:DM},{tag:[U.variableName],color:DM},{tag:[U.propertyName],color:jM,fontStyle:`normal`},{tag:[U.typeName],color:OM,fontStyle:`italic`},{tag:[U.className],color:jM,fontStyle:`italic`},{tag:[U.namespace],color:DM,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:EM},{tag:[U.bracket],color:wM},{tag:[U.brace],color:wM},{tag:[U.punctuation],color:wM},{tag:[U.function(U.variableName),U.labelName],color:OM},{tag:[U.definition(U.function(U.variableName))],color:OM},{tag:[U.definition(U.variableName)],color:DM},{tag:U.number,color:AM},{tag:U.changed,color:AM},{tag:U.annotation,color:MM,fontStyle:`italic`},{tag:U.modifier,color:AM,fontStyle:`italic`},{tag:U.self,color:AM},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:AM},{tag:[U.atom,U.bool,U.special(U.variableName)],color:AM},{tag:[U.processingInstruction,U.inserted],color:jM},{tag:[U.special(U.string),U.regexp],color:kM},{tag:U.string,color:kM},{tag:U.definition(U.typeName),color:OM,fontWeight:`bold`},{tag:U.meta,color:TM},{tag:U.comment,fontStyle:`italic`,color:TM},{tag:U.docComment,fontStyle:`italic`,color:TM},{tag:[U.tagName],color:EM},{tag:[U.attributeName],color:jM},{tag:[U.heading],fontWeight:`bold`,color:jM},{tag:[U.strong],fontWeight:`bold`,color:DM},{tag:[U.emphasis],fontStyle:`italic`,color:DM},{tag:[U.link],color:aTe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:RM,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:wM,textDecoration:`underline wavy`,borderBottom:`1px wavy ${MM}`},{tag:[U.strikethrough],color:MM,textDecoration:`line-through`},{tag:U.constant(U.name),color:AM},{tag:U.deleted,color:MM},{tag:U.squareBracket,color:wM},{tag:U.angleBracket,color:wM},{tag:U.monospace,color:wM},{tag:[U.contentSeparator],color:DM},{tag:U.quote,color:TM}]))],UM={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},sTe={borderLeftWidth:`2px`},WM={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},GM={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},KM={border:`none`,borderRadius:`4px`,padding:`2px 10px`},cTe={borderRadius:`2px`},qM={borderRadius:`2px`},JM={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},YM={width:`12px`,height:`12px`,borderRadius:`6px`},XM={borderRadius:`4px`,padding:`2px 6px`},ZM={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},lTe=`#2e3440`,QM=`#3b4252`,$M=`#434c5e`,eN=`#4c566a`,tN=`#d8dee9`,nN=`#eceff4`,rN=`#8fbcbb`,iN=`#88c0d0`,aN=`#81a1c1`,oN=`#5e81ac`,sN=`#bf616a`,cN=`#d08770`,lN=`#ebcb8b`,uN=`#a3be8c`,dN=`#b48ead`,uTe=`#d30102`,fN=`#252a33`,dTe=`#3b425277`,pN=lTe,mN=QM,fTe=$M,pTe=`#4c566a80`,hN=tN,mTe=`#4c566a55`,hTe=iN,gN=lN,_N=aN,gTe=dN,vN=`#3b4a3880`,yN=`#4a393a80`,bN=`#a3be8c`,xN=`#bf616a`,_Te=[Te.theme({"&":{color:tN,backgroundColor:pN,fontSize:UM.fontSize,fontFamily:UM.fontFamily},".cm-content":{caretColor:hN,lineHeight:UM.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:hN,borderLeftWidth:sTe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${hN}99`,color:pN},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:fTe},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#5e81ac80`,outline:`1px solid ${rN}`,color:tN,borderRadius:XM.borderRadius,"& span":{color:tN}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:aN,color:nN,padding:XM.padding,"& span":{color:nN}},".cm-search.cm-panel.cm-textfield":{color:tN,borderRadius:XM.borderRadius,padding:XM.padding},".cm-panels":{backgroundColor:fN,color:tN,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${eN}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${eN}`},".cm-panel button":{backgroundColor:mN,color:tN,border:KM.border,borderRadius:KM.borderRadius,padding:KM.padding},".cm-panel button:hover":{backgroundColor:$M},".cm-activeLine":{backgroundColor:dTe,borderRadius:cTe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:fN,color:eN,border:GM.border,borderRight:`1px solid ${$M}`,paddingRight:GM.paddingRight},".cm-activeLineGutter":{backgroundColor:QM,color:tN,fontWeight:GM.fontWeight},".cm-lineNumbers":{fontSize:GM.fontSize,lineHeight:GM.lineHeight},".cm-foldGutter":{fontSize:GM.fontSize,lineHeight:GM.lineHeight},".cm-foldGutter .cm-gutterElement":{color:eN,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:tN},".cm-insertedLine":{textDecoration:WM.insertedTextDecoration,backgroundColor:vN,color:bN,padding:WM.insertedLinePadding,borderRadius:WM.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:WM.insertedTextDecoration,backgroundColor:`${vN} !important`,color:bN,padding:WM.insertedLinePadding,borderRadius:WM.borderRadious,border:`1px solid ${bN}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:WM.deletedTextDecoration,backgroundColor:yN,color:xN,padding:WM.insertedLinePadding,borderRadius:WM.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:WM.deletedTextDecoration,backgroundColor:`${yN} !important`,color:xN,padding:WM.insertedLinePadding,borderRadius:WM.borderRadious,border:`1px solid ${xN}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:mN,border:`1px solid ${eN}`,borderRadius:ZM.borderRadius,padding:ZM.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:mN,border:`none`},"& > ul > li":{padding:ZM.padding,lineHeight:ZM.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:$M,color:nN,borderRadius:ZM.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:eN,paddingRight:ZM.paddingRight},"& > ul > li > span.cm-completionDetail":{color:eN,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:mN,borderBottomColor:mN},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${sN}`},"&-warning":{borderLeft:`3px solid ${gN}`},"&-info":{borderLeft:`3px solid ${_N}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${sN}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${gN}`},".cm-matchingBracket":{backgroundColor:mTe,outline:`1px solid ${hTe}`,borderRadius:qM.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${sN}40`,outline:`1px solid ${uTe}`,borderRadius:qM.borderRadius},".cm-selectionMatch":{backgroundColor:pTe,outline:`1px solid ${$M}50`,borderRadius:qM.borderRadius},".cm-foldPlaceholder":{backgroundColor:mN,color:eN,border:`1px dotted ${eN}70`,borderRadius:JM.borderRadius,padding:JM.padding,margin:JM.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${pN}, 0 0 0 3px ${iN}40`},"& .cm-scroller::-webkit-scrollbar":{width:YM.width,height:YM.height},"& .cm-scroller::-webkit-scrollbar-track":{background:fN},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:$M,borderRadius:YM.borderRadius,border:`3px solid ${fN}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:eN},".cm-ghostText":{opacity:`0.5`,color:eN}},{dark:!0}),ve(Ae.define([{tag:U.keyword,color:oN,fontWeight:`bold`},{tag:U.controlKeyword,color:oN,fontWeight:`bold`},{tag:U.moduleKeyword,color:oN,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:iN},{tag:[U.variableName],color:tN},{tag:[U.propertyName],color:iN,fontStyle:`normal`},{tag:[U.typeName],color:lN},{tag:[U.className],color:lN,fontStyle:`italic`},{tag:[U.namespace],color:aN,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:dN},{tag:[U.bracket],color:tN},{tag:[U.brace],color:rN},{tag:[U.punctuation],color:tN},{tag:[U.function(U.variableName),U.labelName],color:rN},{tag:[U.definition(U.function(U.variableName))],color:rN},{tag:[U.definition(U.variableName)],color:cN},{tag:U.number,color:cN},{tag:U.changed,color:dN},{tag:U.annotation,color:sN,fontStyle:`italic`},{tag:U.modifier,color:dN,fontStyle:`italic`},{tag:U.self,color:dN},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:cN},{tag:[U.atom,U.bool,U.special(U.variableName)],color:dN},{tag:[U.processingInstruction,U.inserted],color:rN},{tag:[U.special(U.string),U.regexp],color:dN},{tag:U.string,color:uN},{tag:U.definition(U.typeName),color:lN,fontWeight:`bold`},{tag:[U.definition(U.name),U.separator],color:uN},{tag:U.meta,color:eN},{tag:U.comment,fontStyle:`italic`,color:eN},{tag:U.docComment,fontStyle:`italic`,color:eN},{tag:[U.tagName],color:sN},{tag:[U.attributeName],color:lN},{tag:[U.heading],fontWeight:`bold`,color:aN},{tag:[U.strong],fontWeight:`bold`,color:iN},{tag:[U.emphasis],fontStyle:`italic`,color:lN},{tag:[U.link],color:gTe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:_N,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:tN,textDecoration:`underline wavy`,borderBottom:`1px wavy ${sN}`},{tag:[U.strikethrough],color:sN,textDecoration:`line-through`},{tag:U.constant(U.name),color:cN},{tag:U.deleted,color:sN},{tag:U.squareBracket,color:sN},{tag:U.angleBracket,color:cN},{tag:U.monospace,color:tN,fontStyle:`italic`},{tag:[U.contentSeparator],color:aN},{tag:U.quote,color:dN}]))],SN={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},vTe={borderLeftWidth:`2px`},CN={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},wN={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},TN={border:`none`,borderRadius:`4px`,padding:`2px 10px`},yTe={borderRadius:`2px`},EN={borderRadius:`2px`},DN={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},ON={width:`12px`,height:`12px`,borderRadius:`6px`},kN={borderRadius:`4px`,padding:`2px 6px`},AN={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},bTe=`#e1e2e7`,jN=`#3760bf`,MN=`#99a7df`,NN=`#848cb5`,xTe=`#8c91a8`,PN=`#3760bf`,FN=`#e9e9ec`,IN=`#d5d6db`,LN=`#f52a65`,RN=`#b15c00`,zN=`#8c6c3e`,BN=`#587539`,VN=`#007197`,HN=`#2e7de9`,UN=`#7847bd`,STe=`#9854f1`,WN=LN,GN=IN,CTe=`#5F5FAF5A`,KN=bTe,qN=FN,JN=`#99a7df40`,wTe=`#99a7df60`,YN=jN,TTe=`#0e639c20`,ETe=VN,XN=RN,ZN=VN,DTe=UN,QN=`#58753920`,$N=`#f52a6520`,eP=`#587539`,tP=`#f52a65`,OTe=[Te.theme({"&":{color:PN,backgroundColor:KN,fontSize:SN.fontSize,fontFamily:SN.fontFamily},".cm-content":{caretColor:YN,lineHeight:SN.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:YN,borderLeftWidth:vTe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${YN}99`,color:KN},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:JN},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#0e639c40`,outline:`1px solid ${VN}`,color:PN,borderRadius:kN.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:VN,color:KN,padding:kN.padding,"& span":{color:KN}},".cm-search.cm-panel.cm-textfield":{color:PN,borderRadius:kN.borderRadius,padding:kN.padding},".cm-panels":{backgroundColor:FN,color:PN,borderRadius:`4px`,boxShadow:`0 1px 3px rgba(0, 0, 0, 0.1)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${NN}30`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${NN}30`},".cm-panel button":{backgroundColor:qN,color:PN,border:TN.border,borderRadius:TN.borderRadius,padding:TN.padding},".cm-panel button:hover":{backgroundColor:IN,border:`1px solid ${MN}`},".cm-activeLine":{backgroundColor:CTe,borderRadius:yTe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:GN,color:NN,border:wN.border,borderRight:`1px solid ${IN}`,paddingRight:wN.paddingRight},".cm-activeLineGutter":{color:jN,fontWeight:wN.fontWeight},".cm-lineNumbers":{fontSize:wN.fontSize,lineHeight:wN.lineHeight},".cm-foldGutter":{fontSize:wN.fontSize,lineHeight:wN.lineHeight},".cm-foldGutter .cm-gutterElement":{color:NN,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:jN},".cm-insertedLine":{textDecoration:CN.insertedTextDecoration,backgroundColor:QN,color:eP,padding:CN.insertedLinePadding,borderRadius:CN.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:CN.insertedTextDecoration,backgroundColor:`${QN} !important`,color:eP,padding:CN.insertedLinePadding,borderRadius:CN.borderRadious,border:`1px solid ${eP}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:CN.deletedTextDecoration,backgroundColor:$N,color:tP,padding:CN.insertedLinePadding,borderRadius:CN.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:CN.deletedTextDecoration,backgroundColor:`${$N} !important`,color:tP,padding:CN.insertedLinePadding,borderRadius:CN.borderRadious,border:`1px solid ${tP}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:qN,border:`1px solid ${xTe}40`,borderRadius:AN.borderRadius,padding:AN.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:qN,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:AN.padding,lineHeight:AN.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:JN,color:jN,borderRadius:AN.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:NN,paddingRight:AN.paddingRight},"& > ul > li > span.cm-completionDetail":{color:NN,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:qN,borderBottomColor:qN},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${WN}`},"&-warning":{borderLeft:`3px solid ${XN}`},"&-info":{borderLeft:`3px solid ${ZN}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${WN}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${XN}`},".cm-matchingBracket":{backgroundColor:TTe,outline:`1px solid ${ETe}`,borderRadius:EN.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${LN}20`,outline:`1px solid ${WN}`,borderRadius:EN.borderRadius},".cm-selectionMatch":{backgroundColor:wTe,outline:`1px solid ${MN}50`,borderRadius:EN.borderRadius},".cm-foldPlaceholder":{backgroundColor:qN,color:NN,border:`1px dotted ${NN}70`,borderRadius:DN.borderRadius,padding:DN.padding,margin:DN.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${KN}, 0 0 0 3px ${VN}40`},"& .cm-scroller::-webkit-scrollbar":{width:ON.width,height:ON.height},"& .cm-scroller::-webkit-scrollbar-track":{background:GN},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:NN,borderRadius:ON.borderRadius,border:`3px solid ${GN}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:MN},".cm-ghostText":{opacity:`0.5`,color:NN}},{dark:!1}),ve(Ae.define([{tag:U.keyword,color:VN,fontWeight:`bold`},{tag:U.controlKeyword,color:VN,fontWeight:`bold`},{tag:U.moduleKeyword,color:VN,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:HN},{tag:[U.variableName],color:jN},{tag:[U.propertyName],color:HN,fontStyle:`normal`},{tag:[U.typeName],color:VN},{tag:[U.className],color:zN,fontStyle:`italic`},{tag:[U.namespace],color:UN,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:UN},{tag:[U.bracket],color:NN},{tag:[U.brace],color:NN},{tag:[U.punctuation],color:NN},{tag:[U.function(U.variableName)],color:VN},{tag:[U.labelName],color:UN,fontStyle:`italic`},{tag:[U.definition(U.function(U.variableName))],color:VN},{tag:[U.definition(U.variableName)],color:HN},{tag:U.number,color:RN},{tag:U.changed,color:RN},{tag:U.annotation,color:WN,fontStyle:`italic`},{tag:U.modifier,color:RN,fontStyle:`italic`},{tag:U.self,color:RN},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:RN},{tag:[U.atom,U.bool,U.special(U.variableName)],color:RN},{tag:[U.processingInstruction,U.inserted],color:BN},{tag:[U.special(U.string),U.regexp],color:STe},{tag:U.string,color:BN},{tag:U.definition(U.typeName),color:VN,fontWeight:`bold`},{tag:[U.definition(U.name),U.separator],color:HN},{tag:U.meta,color:NN},{tag:U.comment,fontStyle:`italic`,color:NN},{tag:U.docComment,fontStyle:`italic`,color:NN},{tag:[U.tagName],color:UN},{tag:[U.attributeName],color:zN},{tag:[U.heading],fontWeight:`bold`,color:RN},{tag:U.heading1,color:RN,fontWeight:`bold`},{tag:U.heading2,color:RN},{tag:U.heading3,color:RN},{tag:U.heading4,color:VN},{tag:U.heading5,color:VN},{tag:U.heading6,color:VN},{tag:[U.strong],fontWeight:`bold`,color:jN},{tag:[U.emphasis],fontStyle:`italic`,color:BN},{tag:[U.link],color:DTe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:ZN,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:jN,textDecoration:`underline wavy`,borderBottom:`1px wavy ${WN}`},{tag:[U.strikethrough],color:WN,textDecoration:`line-through`},{tag:U.constant(U.name),color:RN},{tag:U.deleted,color:WN},{tag:U.squareBracket,color:NN},{tag:U.angleBracket,color:NN},{tag:U.monospace,color:jN},{tag:[U.contentSeparator],color:HN},{tag:U.quote,color:NN}]))],nP={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},kTe={borderLeftWidth:`2px`},rP={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},iP={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},aP={border:`none`,borderRadius:`4px`,padding:`2px 10px`},ATe={borderRadius:`2px`},oP={borderRadius:`2px`},sP={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},cP={width:`12px`,height:`12px`,borderRadius:`6px`},lP={borderRadius:`4px`,padding:`2px 6px`},uP={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},jTe=`#24283b`,dP=`#414868`,fP=`#565f89`,pP=`#c0caf5`,mP=`#282e44`,hP=`#1f2335`,MTe=`#f7768e`,gP=`#ff9e64`,_P=`#e0af68`,vP=`#9ece6a`,yP=`#2ac3de`,bP=`#7aa2f7`,xP=`#bb9af7`,SP=`#f7768e`,CP=hP,NTe=`#292e427a`,wP=jTe,TP=mP,EP=`#6f7bb630`,PTe=`#6f7bb650`,DP=pP,FTe=`#3d59a150`,ITe=bP,OP=gP,kP=yP,LTe=xP,AP=`#3b4a3880`,jP=`#4a393a80`,MP=`#9ece6a`,NP=`#f7768e`,RTe=[Te.theme({"&":{color:pP,backgroundColor:wP,fontSize:nP.fontSize,fontFamily:nP.fontFamily},".cm-content":{caretColor:DP,lineHeight:nP.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:DP,borderLeftWidth:kTe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${DP}99`,color:wP},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:EP},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#7aa2f740`,outline:`1px solid ${bP}`,color:pP,borderRadius:lP.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:bP,color:wP,padding:lP.padding,"& span":{color:wP}},".cm-search.cm-panel.cm-textfield":{color:pP,borderRadius:lP.borderRadius,padding:lP.padding},".cm-panels":{backgroundColor:mP,color:pP,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${fP}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${fP}`},".cm-panel button":{backgroundColor:TP,color:pP,border:aP.border,borderRadius:aP.borderRadius,padding:aP.padding},".cm-panel button:hover":{backgroundColor:hP},".cm-activeLine":{backgroundColor:NTe,borderRadius:ATe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:CP,color:fP,border:iP.border,borderRight:`1px solid ${hP}`,paddingRight:iP.paddingRight},".cm-activeLineGutter":{backgroundColor:hP,color:pP,fontWeight:iP.fontWeight},".cm-lineNumbers":{fontSize:iP.fontSize,lineHeight:iP.lineHeight},".cm-foldGutter":{fontSize:iP.fontSize,lineHeight:iP.lineHeight},".cm-foldGutter .cm-gutterElement":{color:fP,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:pP},".cm-insertedLine":{textDecoration:rP.insertedTextDecoration,backgroundColor:AP,color:MP,padding:rP.insertedLinePadding,borderRadius:rP.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:rP.insertedTextDecoration,backgroundColor:`${AP} !important`,color:MP,padding:rP.insertedLinePadding,borderRadius:rP.borderRadious,border:`1px solid ${MP}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:rP.deletedTextDecoration,backgroundColor:jP,color:NP,padding:rP.insertedLinePadding,borderRadius:rP.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:rP.deletedTextDecoration,backgroundColor:`${jP} !important`,color:NP,padding:rP.insertedLinePadding,borderRadius:rP.borderRadious,border:`1px solid ${NP}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:TP,border:`1px solid ${fP}`,borderRadius:uP.borderRadius,padding:uP.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:TP,border:`none`},"& > ul > li":{padding:uP.padding,lineHeight:uP.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:EP,color:pP,borderRadius:uP.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:fP,paddingRight:uP.paddingRight},"& > ul > li > span.cm-completionDetail":{color:fP,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:TP,borderBottomColor:TP},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${SP}`},"&-warning":{borderLeft:`3px solid ${OP}`},"&-info":{borderLeft:`3px solid ${kP}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${SP}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${OP}`},".cm-matchingBracket":{backgroundColor:FTe,outline:`1px solid ${ITe}`,borderRadius:oP.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${MTe}20`,outline:`1px solid ${SP}`,borderRadius:oP.borderRadius},".cm-selectionMatch":{backgroundColor:PTe,outline:`1px solid ${dP}50`,borderRadius:oP.borderRadius},".cm-foldPlaceholder":{backgroundColor:TP,color:fP,border:`1px dotted ${fP}70`,borderRadius:sP.borderRadius,padding:sP.padding,margin:sP.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${wP}, 0 0 0 3px ${bP}40`},"& .cm-scroller::-webkit-scrollbar":{width:cP.width,height:cP.height},"& .cm-scroller::-webkit-scrollbar-track":{background:CP},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:dP,borderRadius:cP.borderRadius,border:`3px solid ${CP}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:fP},".cm-ghostText":{opacity:`0.5`,color:fP}},{dark:!0}),ve(Ae.define([{tag:U.keyword,color:xP,fontWeight:`bold`},{tag:U.controlKeyword,color:xP,fontWeight:`bold`},{tag:U.moduleKeyword,color:xP,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:pP},{tag:[U.variableName],color:pP},{tag:[U.propertyName],color:bP,fontStyle:`normal`},{tag:[U.typeName],color:yP},{tag:[U.className],color:_P,fontStyle:`italic`},{tag:[U.namespace],color:bP,fontStyle:`italic`},{tag:[U.operator,U.operatorKeyword],color:xP},{tag:[U.bracket],color:fP},{tag:[U.brace],color:fP},{tag:[U.punctuation],color:fP},{tag:[U.function(U.variableName)],color:bP},{tag:[U.labelName],color:bP,fontStyle:`italic`},{tag:[U.definition(U.function(U.variableName))],color:bP},{tag:[U.definition(U.variableName)],color:pP},{tag:U.number,color:gP},{tag:U.changed,color:gP},{tag:U.annotation,color:SP,fontStyle:`italic`},{tag:U.modifier,color:gP,fontStyle:`italic`},{tag:U.self,color:gP},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:xP},{tag:[U.atom,U.bool,U.special(U.variableName)],color:gP},{tag:[U.processingInstruction,U.inserted],color:vP},{tag:[U.special(U.string),U.regexp],color:`#b4f9f8`},{tag:U.string,color:vP},{tag:U.definition(U.typeName),color:yP,fontWeight:`bold`},{tag:[U.definition(U.name),U.separator],color:pP},{tag:U.meta,color:fP},{tag:U.comment,fontStyle:`italic`,color:fP},{tag:U.docComment,fontStyle:`italic`,color:fP},{tag:[U.tagName],color:xP},{tag:[U.attributeName],color:_P},{tag:[U.heading],fontWeight:`bold`,color:`#89ddff`},{tag:U.heading1,color:`#89ddff`,fontWeight:`bold`},{tag:U.heading2,color:`#89ddff`},{tag:U.heading3,color:`#89ddff`},{tag:U.heading4,color:`#89ddff`},{tag:U.heading5,color:`#89ddff`},{tag:U.heading6,color:`#89ddff`},{tag:[U.strong],fontWeight:`bold`,color:pP},{tag:[U.emphasis],fontStyle:`italic`,color:yP},{tag:[U.link],color:LTe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:kP,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:pP,textDecoration:`underline wavy`,borderBottom:`1px wavy ${SP}`},{tag:[U.strikethrough],color:SP,textDecoration:`line-through`},{tag:U.constant(U.name),color:gP},{tag:U.deleted,color:SP},{tag:U.squareBracket,color:fP},{tag:U.angleBracket,color:fP},{tag:U.monospace,color:pP},{tag:[U.contentSeparator],color:bP},{tag:U.quote,color:fP}]))],PP={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},zTe={borderLeftWidth:`2px`},FP={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},IP={paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},LP={borderRadius:`4px`,padding:`2px 10px`},BTe={borderRadius:`2px`},RP={borderRadius:`2px`},zP={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},BP={width:`12px`,height:`12px`,borderRadius:`6px`},VP={borderRadius:`4px`,padding:`2px 6px`},HP={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},VTe=`#1e1e1e`,UP=`#252526`,WP=`#2d2d30`,GP=`#838383`,HTe=`#c6c6c6`,KP=`#d4d4d4`,qP=`#e9e9e9`,UTe=`#1c1c1c`,JP=`#569cd6`,WTe=`#c586c0`,YP=`#9cdcfe`,XP=`#4ec9b0`,ZP=`#dcdcaa`,GTe=`#b5cea8`,QP=`#ce9178`,$P=`#f44747`,eF=`#d7ba7d`,tF=`#6a9955`,nF=$P,rF=`#FFFFFF08`,iF=VTe,aF=UP,KTe=`#264F7899`,qTe=`#72a1ff59`,oF=HTe,JTe=`#ffffff15`,YTe=JP,sF=eF,cF=`#3794ff`,XTe=`#c586c0`,lF=`#1e3f1e80`,uF=`#4b1c1c80`,dF=`#6cc26f`,fF=`#f14c4c`,ZTe=[Te.theme({"&":{color:KP,backgroundColor:iF,fontSize:PP.fontSize,fontFamily:PP.fontFamily},".cm-content":{caretColor:oF,lineHeight:PP.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:oF,borderLeftWidth:zTe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${oF}99`,color:iF},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:KTe},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#72a1ff40`,outline:`1px solid ${JP}90`,color:qP,borderRadius:VP.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#3794ff90`,color:qP,padding:VP.padding,"& span":{color:qP}},".cm-search.cm-panel.cm-textfield":{color:KP,borderRadius:VP.borderRadius,padding:VP.padding},".cm-panels":{backgroundColor:UP,color:KP,borderRadius:`3px`,boxShadow:`0 2px 6px rgba(0, 0, 0, 0.45)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${WP}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${WP}`},".cm-panel button":{backgroundColor:WP,color:KP,border:`1px solid ${WP}`,borderRadius:LP.borderRadius,padding:LP.padding},".cm-panel button:hover":{backgroundColor:`#3a3a3a`,border:`1px solid ${GP}80`},".cm-activeLine":{backgroundColor:rF,borderRadius:BTe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:UTe,color:GP,border:`none`,borderRight:`1px solid ${WP}`,paddingRight:IP.paddingRight},".cm-activeLineGutter":{backgroundColor:rF,color:qP,fontWeight:IP.fontWeight},".cm-lineNumbers":{fontSize:IP.fontSize,lineHeight:IP.lineHeight},".cm-foldGutter":{fontSize:IP.fontSize,lineHeight:IP.lineHeight},".cm-foldGutter .cm-gutterElement":{color:GP,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:qP},".cm-insertedLine":{textDecoration:FP.insertedTextDecoration,backgroundColor:lF,color:dF,padding:FP.insertedLinePadding,borderRadius:FP.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:FP.insertedTextDecoration,backgroundColor:`${lF} !important`,color:dF,padding:FP.insertedLinePadding,borderRadius:FP.borderRadious,border:`1px solid ${dF}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:FP.deletedTextDecoration,backgroundColor:uF,color:fF,padding:FP.insertedLinePadding,borderRadius:FP.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:FP.deletedTextDecoration,backgroundColor:`${uF} !important`,color:fF,padding:FP.insertedLinePadding,borderRadius:FP.borderRadious,border:`1px solid ${fF}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:aF,border:`1px solid ${WP}`,borderRadius:HP.borderRadius,padding:HP.padding,boxShadow:`0 3px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:aF,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:HP.padding,lineHeight:HP.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#04395e`,color:qP,borderRadius:HP.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:GP,paddingRight:HP.paddingRight},"& > ul > li > span.cm-completionDetail":{color:GP,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:aF,borderBottomColor:aF},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${nF}`},"&-warning":{borderLeft:`3px solid ${sF}`},"&-info":{borderLeft:`3px solid ${cF}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${nF}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${sF}`},".cm-matchingBracket":{backgroundColor:JTe,outline:`1px solid ${YTe}80`,borderRadius:RP.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${$P}40`,outline:`1px solid ${nF}`,borderRadius:RP.borderRadius},".cm-selectionMatch":{backgroundColor:qTe,outline:`1px solid ${WP}70`,borderRadius:RP.borderRadius},".cm-foldPlaceholder":{backgroundColor:aF,color:GP,border:`1px dotted ${GP}70`,borderRadius:zP.borderRadius,padding:zP.padding,margin:zP.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 1px ${WP}`},"& .cm-scroller::-webkit-scrollbar":{width:BP.width,height:BP.height},"& .cm-scroller::-webkit-scrollbar-track":{background:iF},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#424242`,borderRadius:BP.borderRadius,border:`3px solid ${iF}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#525252`},".cm-ghostText":{opacity:`0.5`,color:GP}},{dark:!0}),ve(Ae.define([{tag:U.keyword,color:JP,fontWeight:`bold`},{tag:U.controlKeyword,color:WTe,fontWeight:`bold`},{tag:U.moduleKeyword,color:JP,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:KP},{tag:[U.variableName],color:YP},{tag:[U.propertyName],color:YP,fontStyle:`normal`},{tag:[U.typeName],color:XP},{tag:[U.className],color:XP,fontStyle:`normal`},{tag:[U.namespace],color:KP,fontStyle:`normal`},{tag:[U.operator,U.operatorKeyword],color:KP},{tag:[U.bracket],color:KP},{tag:[U.brace],color:KP},{tag:[U.punctuation],color:KP},{tag:[U.function(U.variableName)],color:ZP},{tag:[U.labelName],color:ZP,fontStyle:`normal`},{tag:[U.definition(U.function(U.variableName))],color:ZP},{tag:[U.definition(U.variableName)],color:YP},{tag:U.number,color:GTe},{tag:U.changed,color:eF},{tag:U.annotation,color:eF,fontStyle:`italic`},{tag:U.modifier,color:JP,fontStyle:`normal`},{tag:U.self,color:JP},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:YP},{tag:[U.atom,U.bool,U.special(U.variableName)],color:JP},{tag:[U.processingInstruction,U.inserted],color:QP},{tag:[U.special(U.string),U.regexp],color:`#d16969`},{tag:U.string,color:QP},{tag:U.definition(U.typeName),color:XP,fontWeight:`bold`},{tag:[U.definition(U.name),U.separator],color:KP},{tag:U.meta,color:GP},{tag:U.comment,fontStyle:`italic`,color:tF},{tag:U.docComment,fontStyle:`italic`,color:tF},{tag:[U.tagName],color:JP},{tag:[U.attributeName],color:YP},{tag:[U.heading],fontWeight:`bold`,color:JP},{tag:U.heading1,color:JP,fontWeight:`bold`},{tag:U.heading2,color:JP},{tag:U.heading3,color:JP},{tag:U.heading4,color:JP},{tag:U.heading5,color:JP},{tag:U.heading6,color:JP},{tag:[U.strong],fontWeight:`bold`,color:JP},{tag:[U.emphasis],fontStyle:`italic`,color:XP},{tag:[U.link],color:XTe,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:cF,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:KP,textDecoration:`underline wavy`,borderBottom:`1px wavy ${nF}`},{tag:[U.strikethrough],color:nF,textDecoration:`line-through`},{tag:U.constant(U.name),color:YP},{tag:U.deleted,color:nF},{tag:U.squareBracket,color:KP},{tag:U.angleBracket,color:KP},{tag:U.monospace,color:KP},{tag:[U.contentSeparator],color:KP},{tag:U.quote,color:tF}]))],pF={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},QTe={borderLeftWidth:`2px`},mF={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},hF={paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},gF={borderRadius:`4px`,padding:`2px 10px`},$Te={borderRadius:`2px`},_F={borderRadius:`2px`},vF={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},yF={width:`12px`,height:`12px`,borderRadius:`6px`},bF={borderRadius:`4px`,padding:`2px 6px`},xF={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},eEe=`#ffffff`,SF=`#f3f3f3`,CF=`#d6d6d6`,wF=`#6b6b6b`,tEe=`#000000`,TF=`#383a42`,EF=`#1f1f1f`,nEe=`#f5f5f5`,DF=`#0064ff`,OF=`#af00db`,kF=`#0070c1`,AF=`#267f99`,jF=`#795e26`,rEe=`#098658`,MF=`#a31515`,NF=`#e51400`,PF=`#795e26`,FF=`#008000`,IF=NF,LF=`#99999926`,RF=eEe,zF=SF,iEe=`#add6ff`,aEe=`#a8ac9480`,BF=tEe,oEe=`#007acc20`,sEe=`#007acc`,VF=`#bf8803`,HF=`#006ab1`,cEe=`#9e46d0`,UF=`#ddfbe0`,WF=`#ffebec`,GF=`#22863a`,KF=`#e51400`,lEe=[Te.theme({"&":{color:TF,backgroundColor:RF,fontSize:pF.fontSize,fontFamily:pF.fontFamily},".cm-content":{caretColor:BF,lineHeight:pF.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:BF,borderLeftWidth:QTe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${BF}99`,color:RF},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:iEe},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#bbdefb`,outline:`1px solid ${kF}90`,color:EF,borderRadius:bF.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#90caf9`,color:EF,padding:bF.padding,"& span":{color:EF}},".cm-search.cm-panel.cm-textfield":{color:TF,borderRadius:bF.borderRadius,padding:bF.padding},".cm-panels":{backgroundColor:SF,color:TF,borderRadius:`3px`,boxShadow:`0 2px 6px rgba(0, 0, 0, 0.15)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${CF}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${CF}`},".cm-panel button":{backgroundColor:RF,color:TF,border:`1px solid ${CF}`,borderRadius:gF.borderRadius,padding:gF.padding},".cm-panel button:hover":{backgroundColor:`#e8e8e8`,border:`1px solid ${wF}80`},".cm-activeLine":{backgroundColor:LF,borderRadius:$Te.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:nEe,color:`#237893`,border:`none`,borderRight:`1px solid ${CF}`,paddingRight:hF.paddingRight},".cm-activeLineGutter":{backgroundColor:LF,color:`#0b216f`,fontWeight:hF.fontWeight},".cm-lineNumbers":{fontSize:hF.fontSize,lineHeight:hF.lineHeight},".cm-foldGutter":{fontSize:hF.fontSize,lineHeight:hF.lineHeight},".cm-foldGutter .cm-gutterElement":{color:`#237893`,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:`#0b216f`},".cm-insertedLine":{textDecoration:mF.insertedTextDecoration,backgroundColor:UF,color:GF,padding:mF.insertedLinePadding,borderRadius:mF.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:mF.insertedTextDecoration,backgroundColor:`${UF} !important`,color:GF,padding:mF.insertedLinePadding,borderRadius:mF.borderRadious,border:`1px solid ${GF}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:mF.deletedTextDecoration,backgroundColor:WF,color:KF,padding:mF.insertedLinePadding,borderRadius:mF.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:mF.deletedTextDecoration,backgroundColor:`${WF} !important`,color:KF,padding:mF.insertedLinePadding,borderRadius:mF.borderRadious,border:`1px solid ${KF}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:zF,border:`1px solid ${CF}`,borderRadius:xF.borderRadius,padding:xF.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:zF,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:xF.padding,lineHeight:xF.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#dcebfc`,color:EF,borderRadius:xF.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:wF,paddingRight:xF.paddingRight},"& > ul > li > span.cm-completionDetail":{color:wF,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:zF,borderBottomColor:zF},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${IF}`},"&-warning":{borderLeft:`3px solid ${VF}`},"&-info":{borderLeft:`3px solid ${HF}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${IF}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${VF}`},".cm-matchingBracket":{backgroundColor:oEe,outline:`1px solid ${sEe}80`,borderRadius:_F.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${NF}20`,outline:`1px solid ${IF}`,borderRadius:_F.borderRadius},".cm-selectionMatch":{backgroundColor:aEe,outline:`1px solid ${CF}70`,borderRadius:_F.borderRadius},".cm-foldPlaceholder":{backgroundColor:zF,color:wF,border:`1px dotted ${wF}70`,borderRadius:vF.borderRadius,padding:vF.padding,margin:vF.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 1px ${CF}`},"& .cm-scroller::-webkit-scrollbar":{width:yF.width,height:yF.height},"& .cm-scroller::-webkit-scrollbar-track":{background:RF},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#dadada`,borderRadius:yF.borderRadius,border:`3px solid ${RF}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#cccccc`},".cm-ghostText":{opacity:`0.5`,color:wF}},{dark:!1}),ve(Ae.define([{tag:U.keyword,color:DF,fontWeight:`bold`},{tag:U.controlKeyword,color:OF,fontWeight:`bold`},{tag:U.moduleKeyword,color:DF,fontWeight:`bold`},{tag:[U.name,U.deleted,U.character,U.macroName],color:TF},{tag:[U.variableName],color:kF},{tag:[U.propertyName],color:kF,fontStyle:`normal`},{tag:[U.typeName],color:AF},{tag:[U.className],color:AF,fontStyle:`normal`},{tag:[U.namespace],color:TF,fontStyle:`normal`},{tag:[U.operator,U.operatorKeyword],color:TF},{tag:[U.bracket],color:TF},{tag:[U.brace],color:TF},{tag:[U.punctuation],color:TF},{tag:[U.function(U.variableName)],color:jF},{tag:[U.labelName],color:jF,fontStyle:`normal`},{tag:[U.definition(U.function(U.variableName))],color:jF},{tag:[U.definition(U.variableName)],color:kF},{tag:U.number,color:rEe},{tag:U.changed,color:PF},{tag:U.annotation,color:PF,fontStyle:`italic`},{tag:U.modifier,color:DF,fontStyle:`normal`},{tag:U.self,color:DF},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:kF},{tag:[U.atom,U.bool,U.special(U.variableName)],color:DF},{tag:[U.processingInstruction,U.inserted],color:MF},{tag:[U.special(U.string),U.regexp],color:OF},{tag:U.string,color:MF},{tag:U.definition(U.typeName),color:AF,fontWeight:`bold`},{tag:[U.definition(U.name),U.separator],color:TF},{tag:U.meta,color:wF},{tag:U.comment,fontStyle:`italic`,color:FF},{tag:U.docComment,fontStyle:`italic`,color:FF},{tag:[U.tagName],color:DF},{tag:[U.attributeName],color:kF},{tag:[U.heading],fontWeight:`bold`,color:DF},{tag:U.heading1,color:DF,fontWeight:`bold`},{tag:U.heading2,color:DF},{tag:U.heading3,color:DF},{tag:U.heading4,color:DF},{tag:U.heading5,color:DF},{tag:U.heading6,color:DF},{tag:[U.strong],fontWeight:`bold`,color:DF},{tag:[U.emphasis],fontStyle:`italic`,color:kF},{tag:[U.link],color:cEe,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[U.url],color:HF,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[U.invalid],color:TF,textDecoration:`underline wavy`,borderBottom:`1px wavy ${IF}`},{tag:[U.strikethrough],color:IF,textDecoration:`line-through`},{tag:U.constant(U.name),color:kF},{tag:U.deleted,color:IF},{tag:U.squareBracket,color:TF},{tag:U.angleBracket,color:TF},{tag:U.monospace,color:TF},{tag:[U.contentSeparator],color:TF},{tag:U.quote,color:FF}]))];function qF(){return qF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qF.apply(null,arguments)}function uEe(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var JF=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,YF=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(JF(e)):JF,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return rt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=We(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Ce(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let a=r.charCodeAt(e),o=this.match(a,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==a&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],a=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,a=!0)),a||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<`u`&&(YF.prototype[Symbol.iterator]=function(){return this});var XF={from:-1,to:-1,match:/.*/.exec(``)},ZF=`gm`+(/x/.unicode==null?``:`u`),QF=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=XF,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new tI(e,t,n,r,i);this.re=new RegExp(t,ZF+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=nI(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=nI(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},$F=new WeakMap,eI=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=$F.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return $F.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),$F.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},tI=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=XF,this.matchPos=nI(e,r),this.re=new RegExp(t,ZF+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=eI.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=nI(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=eI.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(QF.prototype[Symbol.iterator]=tI.prototype[Symbol.iterator]=function(){return this});function dEe(e){try{return new RegExp(e,ZF),!0}catch{return!1}}function nI(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}function rI(e){let t=$e(`input`,{class:`cm-textfield`,name:`line`,value:String(e.state.doc.lineAt(e.state.selection.main.head).number)}),n=$e(`form`,{class:`cm-gotoLine`,onkeydown:t=>{t.keyCode==27?(t.preventDefault(),e.dispatch({effects:iI.of(!1)}),e.focus()):t.keyCode==13&&(t.preventDefault(),r())},onsubmit:e=>{e.preventDefault(),r()}},$e(`label`,e.state.phrase(`Go to line`),`: `,t),` `,$e(`button`,{class:`cm-button`,type:`submit`},e.state.phrase(`go`)),$e(`button`,{name:`close`,onclick:()=>{e.dispatch({effects:iI.of(!1)}),e.focus()},"aria-label":e.state.phrase(`close`),type:`button`},[`×`]));function r(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:r}=e,i=r.doc.lineAt(r.selection.main.head),[,a,o,s,c]=n,l=s?+s.slice(1):0,u=o?+o:i.number;if(o&&c){let e=u/100;a&&(e=e*(a==`-`?-1:1)+i.number/r.doc.lines),u=Math.round(r.doc.lines*e)}else o&&a&&(u=u*(a==`-`?-1:1)+i.number);let d=r.doc.line(Math.max(1,Math.min(r.doc.lines,u))),f=Re.cursor(d.from+Math.max(0,Math.min(l,d.length)));e.dispatch({effects:[iI.of(!1),Te.scrollIntoView(f.from,{y:`center`})],selection:f}),e.focus()}return{dom:n}}var iI=Ne.define(),aI=it.define({create(){return!0},update(e,t){for(let n of t.effects)n.is(iI)&&(e=n.value);return e},provide:e=>je.from(e,e=>e?rI:null)}),fEe=e=>{let t=Ze(e,rI);if(!t){let n=[iI.of(!0)];e.state.field(aI,!1)??n.push(Ne.appendConfig.of([aI,pEe])),e.dispatch({effects:n}),t=Ze(e,rI)}return t&&t.dom.querySelector(`input`).select(),!0},pEe=Te.baseTheme({".cm-panel.cm-gotoLine":{padding:`2px 6px 4px`,position:`relative`,"& label":{fontSize:`80%`},"& [name=close]":{position:`absolute`,top:`0`,bottom:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:`0`}}}),mEe={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},oI=Ke.define({combine(e){return ue(e,mEe,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function hEe(e){let t=[bEe,yEe];return e&&t.push(oI.of(e)),t}var gEe=at.mark({class:`cm-selectionMatch`}),_Ee=at.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function sI(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=Fe.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=Fe.Word)}function vEe(e,t,n,r){return e(t.sliceDoc(n,n+1))==Fe.Word&&e(t.sliceDoc(r-1,r))==Fe.Word}var yEe=pe.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(oI),{state:n}=e,r=n.selection;if(r.ranges.length>1)return at.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return at.none;let e=n.wordAt(i.head);if(!e)return at.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return at.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(sI(o,n,i.from,i.to)&&vEe(o,n,i.from,i.to)))return at.none}else if(a=n.sliceDoc(i.from,i.to),!a)return at.none}let s=[];for(let r of e.visibleRanges){let e=new YF(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||sI(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(_Ee.range(r,a)):(r>=i.to||a<=i.from)&&s.push(gEe.range(r,a)),s.length>t.maxMatches))return at.none}}return at.set(s)}},{decorations:e=>e.decorations}),bEe=Te.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),xEe=({state:e,dispatch:t})=>{let{selection:n}=e,r=Re.create(n.ranges.map(t=>e.wordAt(t.head)||Re.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function SEe(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new YF(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new YF(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var CEe=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return xEe({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=SEe(e,r);return i?(t(e.update({selection:e.selection.addRange(Re.range(i.from,i.to),!1),effects:Te.scrollIntoView(i.to)})),!0):!1},cI=Ke.define({combine(e){return ue(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new FEe(e),scrollToMatch:e=>Te.scrollIntoView(e)})}}),lI=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||dEe(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
960
960
|
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new DEe(this):new TEe(this)}getCursor(e,t=0,n){let r=e.doc?e:Xe.create({doc:e});return n??=r.doc.length,this.regexp?fI(this,r,t,n):dI(this,r,t,n)}},uI=class{constructor(e){this.spec=e}};function dI(e,t,n,r){return new YF(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?wEe(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function wEe(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(pI(i,n-a))!=Fe.Word||t(mI(i,n-a))!=Fe.Word)&&(t(mI(i,r-a))!=Fe.Word||t(pI(i,r-a))!=Fe.Word))}var TEe=class extends uI{constructor(e){super(e)}nextMatch(e,t,n){let r=dI(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=dI(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=dI(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=dI(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=dI(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function fI(e,t,n,r){return new QF(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?EEe(t.charCategorizer(t.selection.main.head)):void 0},n,r)}function pI(e,t){return e.slice(_e(e,t,!1),t)}function mI(e,t){return e.slice(t,_e(e,t))}function EEe(e){return(t,n,r)=>!r[0].length||(e(pI(r.input,r.index))!=Fe.Word||e(mI(r.input,r.index))!=Fe.Word)&&(e(mI(r.input,r.index+r[0].length))!=Fe.Word||e(pI(r.input,r.index+r[0].length))!=Fe.Word)}var DEe=class extends uI{nextMatch(e,t,n){let r=fI(this.spec,e,n,e.doc.length).next();return r.done&&(r=fI(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=fI(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=fI(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=fI(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},hI=Ne.define(),gI=Ne.define(),_I=it.define({create(e){return new vI(wI(e).create(),null)},update(e,t){for(let n of t.effects)n.is(hI)?e=new vI(n.value.create(),e.panel):n.is(gI)&&(e=new vI(e.query,n.value?CI:null));return e},provide:e=>je.from(e,e=>e.panel)}),vI=class{constructor(e,t){this.query=e,this.panel=t}},OEe=at.mark({class:`cm-searchMatch`}),kEe=at.mark({class:`cm-searchMatch cm-searchMatch-selected`}),AEe=pe.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(_I))}update(e){let t=e.state.field(_I);(t!=e.startState.field(_I)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return at.none;let{view:n}=this,r=new nt;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?kEe:OEe)})}return r.finish()}},{decorations:e=>e.decorations});function yI(e){return t=>{let n=t.state.field(_I,!1);return n&&n.query.spec.valid?e(t,n):DI(t)}}var bI=yI((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=Re.single(r.from,r.to),a=e.state.facet(cI);return e.dispatch({selection:i,effects:[MI(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),EI(e),!0}),xI=yI((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=Re.single(i.from,i.to),o=e.state.facet(cI);return e.dispatch({selection:a,effects:[MI(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),EI(e),!0}),jEe=yI((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:Re.create(n.map(e=>Re.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),MEe=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new YF(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(Re.range(t.value.from,t.value.to))}return t(e.update({selection:Re.create(a,o),userEvent:`select.search.matches`})),!0},SI=yI((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push(Te.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`)));let d=e.state.changes(s);return o&&(c=Re.single(o.from,o.to).map(d),u.push(MI(e,o)),u.push(n.facet(cI).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),NEe=yI((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:Te.announce.of(r),userEvent:`input.replace.all`}),!0});function CI(e){return e.state.facet(cI).createPanel(e)}function wI(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(cI);return new lI({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function TI(e){let t=Ze(e,CI);return t&&t.dom.querySelector(`[main-field]`)}function EI(e){let t=TI(e);t&&t==e.root.activeElement&&t.select()}var DI=e=>{let t=e.state.field(_I,!1);if(t&&t.panel){let n=TI(e);if(n&&n!=e.root.activeElement){let r=wI(e.state,t.query.spec);r.valid&&e.dispatch({effects:hI.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[gI.of(!0),t?hI.of(wI(e.state,t.query.spec)):Ne.appendConfig.of(LEe)]});return!0},OI=e=>{let t=e.state.field(_I,!1);if(!t||!t.panel)return!1;let n=Ze(e,CI);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:gI.of(!1)}),!0},PEe=[{key:`Mod-f`,run:DI,scope:`editor search-panel`},{key:`F3`,run:bI,shift:xI,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:bI,shift:xI,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:OI,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:MEe},{key:`Mod-Alt-g`,run:fEe},{key:`Mod-d`,run:CEe,preventDefault:!0}],FEe=class{constructor(e){this.view=e;let t=this.query=e.state.field(_I).query.spec;this.commit=this.commit.bind(this),this.searchField=$e(`input`,{value:t.search,placeholder:kI(e,`Find`),"aria-label":kI(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=$e(`input`,{value:t.replace,placeholder:kI(e,`Replace`),"aria-label":kI(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=$e(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=$e(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=$e(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return $e(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=$e(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>bI(e),[kI(e,`next`)]),n(`prev`,()=>xI(e),[kI(e,`previous`)]),n(`select`,()=>jEe(e),[kI(e,`all`)]),$e(`label`,null,[this.caseField,kI(e,`match case`)]),$e(`label`,null,[this.reField,kI(e,`regexp`)]),$e(`label`,null,[this.wordField,kI(e,`by word`)]),...e.state.readOnly?[]:[$e(`br`),this.replaceField,n(`replace`,()=>SI(e),[kI(e,`replace`)]),n(`replaceAll`,()=>NEe(e),[kI(e,`replace all`)])],$e(`button`,{name:`close`,onclick:()=>OI(e),"aria-label":kI(e,`close`),type:`button`},[`×`])])}commit(){let e=new lI({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:hI.of(e)}))}keydown(e){Ve(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?xI:bI)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),SI(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(hI)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(cI).top}};function kI(e,t){return e.state.phrase(t)}var AI=30,jI=/[\s\.,:;?!]/;function MI(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-AI),o=Math.min(i,n+AI),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<AI;e++)if(!jI.test(s[e+1])&&jI.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-AI;e--)if(!jI.test(s[e-1])&&jI.test(s[e])){s=s.slice(0,e);break}}return Te.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var IEe=Te.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),LEe=[_I,Be.low(AEe),IEe],NI=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},PI=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(VI).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new nt,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=YEe(s);if(i)o.add(n,n,at.widget({widget:new GEe(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,at.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,FI(f))}};function FI(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new NI(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new NI(r.from,n,r.diagnostic)}),r}function REe(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(VI).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(II))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function zEe(e,t){return e.field(zI,!1)?t:t.concat(Ne.appendConfig.of(XEe))}var II=Ne.define(),LI=Ne.define(),RI=Ne.define(),zI=it.define({create(){return new PI(at.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=FI(n,e.selected.diagnostic,i)||FI(n,null,i)}!n.size&&i&&t.state.facet(VI).autoPanel&&(i=null),e=new PI(n,i,r)}for(let n of t.effects)if(n.is(II)){let r=t.state.facet(VI).autoPanel?n.value.length?KI.open:null:e.panel;e=PI.init(n.value,r,t.state)}else n.is(LI)?e=new PI(e.diagnostics,n.value?KI.open:null,e.selected):n.is(RI)&&(e=new PI(e.diagnostics,e.panel,n.value));return e},provide:e=>[je.from(e,e=>e.panel),Te.decorations.from(e,e=>e.diagnostics)]}),BEe=at.mark({class:`cm-lintRange cm-lintRange-active`});function VEe(e,t,n){let{diagnostics:r}=e.state.field(zI),i,a=-1,o=-1;r.between(t-(n<0?1:0),t+(n>0?1:0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(VI).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:HEe(e,i)}}}:null}function HEe(e,t){return $e(`ul`,{class:`cm-tooltip-lint`},t.map(t=>WI(e,t,!1)))}var UEe=e=>{let t=e.state.field(zI,!1);(!t||!t.panel)&&e.dispatch({effects:zEe(e.state,[LI.of(!0)])});let n=Ze(e,KI.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},BI=e=>{let t=e.state.field(zI,!1);return!t||!t.panel?!1:(e.dispatch({effects:LI.of(!1)}),!0)},WEe=[{key:`Mod-Shift-m`,run:UEe,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(zI,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return!r.value&&(r=t.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],VI=Ke.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...ue(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:HI,tooltipFilter:HI,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function HI(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function UI(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function WI(e,t,n){let r=n?UI(t.actions):[];return $e(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},$e(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=FI(e.state.field(zI).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),$e(`u`,s.slice(c,c+1)),s.slice(c+1)];return $e(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&$e(`div`,{class:`cm-diagnosticSource`},t.source))}var GEe=class extends we{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return $e(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},GI=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=WI(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},KI=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(t.keyCode==27)BI(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=UI(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=FI(this.view.state.field(zI).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=$e(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=$e(`div`,{class:`cm-panel-lint`},this.list,$e(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>BI(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(zI).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(zI),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new GI(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new GI(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=FI(this.view.state.field(zI).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:RI.of(t)})}static open(t){return new e(t)}};function KEe(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function qI(e){return KEe(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var qEe=Te.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:qI(`#d11`)},".cm-lintRange-warning":{backgroundImage:qI(`orange`)},".cm-lintRange-info":{backgroundImage:qI(`#999`)},".cm-lintRange-hint":{backgroundImage:qI(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}}});function JEe(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function YEe(e){let t=`hint`,n=1;for(let r of e){let e=JEe(r.severity);e>n&&(n=e,t=r.severity)}return t}var XEe=[zI,Te.decorations.compute([zI],e=>{let{selected:t,panel:n}=e.field(zI);return!t||!n||t.from==t.to?at.none:at.set([BEe.range(t.from,t.to)])}),ye(VEe,{hideOn:REe}),qEe],JI=function(e){e===void 0&&(e={});var{crosshairCursor:t=!1}=e,n=[];e.closeBracketsKeymap!==!1&&(n=n.concat(st)),e.defaultKeymap!==!1&&(n=n.concat(kCe)),e.searchKeymap!==!1&&(n=n.concat(PEe)),e.historyKeymap!==!1&&(n=n.concat(LSe)),e.foldKeymap!==!1&&(n=n.concat(be)),e.completionKeymap!==!1&&(n=n.concat(lt)),e.lintKeymap!==!1&&(n=n.concat(WEe));var r=[];return e.lineNumbers!==!1&&r.push(Ie()),e.highlightActiveLineGutter!==!1&&r.push(De()),e.highlightSpecialChars!==!1&&r.push(ke()),e.history!==!1&&r.push(OSe()),e.foldGutter!==!1&&r.push(Me()),e.drawSelection!==!1&&r.push(fe()),e.dropCursor!==!1&&r.push(me()),e.allowMultipleSelections!==!1&&r.push(Xe.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&r.push(ge()),e.syntaxHighlighting!==!1&&r.push(ve(ze,{fallback:!0})),e.bracketMatching!==!1&&r.push(Ye()),e.closeBrackets!==!1&&r.push(ut()),e.autocompletion!==!1&&r.push(ct()),e.rectangularSelection!==!1&&r.push(Qe()),t!==!1&&r.push(Ee()),e.highlightActiveLine!==!1&&r.push(Oe()),e.highlightSelectionMatches!==!1&&r.push(hEe()),e.tabSize&&typeof e.tabSize==`number`&&r.push(ae.of(` `.repeat(e.tabSize))),r.concat([ie.of(n.flat())]).filter(Boolean)},ZEe=`#e5c07b`,YI=`#e06c75`,QEe=`#56b6c2`,$Ee=`#ffffff`,XI=`#abb2bf`,ZI=`#7d8799`,eDe=`#61afef`,tDe=`#98c379`,QI=`#d19a66`,nDe=`#c678dd`,rDe=`#21252b`,$I=`#2c313a`,eL=`#282c34`,tL=`#353a42`,iDe=`#3E4451`,nL=`#528bff`,aDe=[Te.theme({"&":{color:XI,backgroundColor:eL},".cm-content":{caretColor:nL},".cm-cursor, .cm-dropCursor":{borderLeftColor:nL},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:iDe},".cm-panels":{backgroundColor:rDe,color:XI},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid #457dff`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#6199ff2f`},".cm-activeLine":{backgroundColor:`#6699ff0b`},".cm-selectionMatch":{backgroundColor:`#aafe661a`},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bad0f847`},".cm-gutters":{backgroundColor:eL,color:ZI,border:`none`},".cm-activeLineGutter":{backgroundColor:$I},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:tL},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:tL,borderBottomColor:tL},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:$I,color:XI}}},{dark:!0}),ve(Ae.define([{tag:U.keyword,color:nDe},{tag:[U.name,U.deleted,U.character,U.propertyName,U.macroName],color:YI},{tag:[U.function(U.variableName),U.labelName],color:eDe},{tag:[U.color,U.constant(U.name),U.standard(U.name)],color:QI},{tag:[U.definition(U.name),U.separator],color:XI},{tag:[U.typeName,U.className,U.number,U.changed,U.annotation,U.modifier,U.self,U.namespace],color:ZEe},{tag:[U.operator,U.operatorKeyword,U.url,U.escape,U.regexp,U.link,U.special(U.string)],color:QEe},{tag:[U.meta,U.comment],color:ZI},{tag:U.strong,fontWeight:`bold`},{tag:U.emphasis,fontStyle:`italic`},{tag:U.strikethrough,textDecoration:`line-through`},{tag:U.link,color:ZI,textDecoration:`underline`},{tag:U.heading,fontWeight:`bold`,color:YI},{tag:[U.atom,U.bool,U.special(U.variableName)],color:QI},{tag:[U.processingInstruction,U.string,U.inserted],color:tDe},{tag:U.invalid,color:$Ee}]))],oDe=Te.theme({"&":{backgroundColor:`#fff`}},{dark:!1}),sDe=function(e){e===void 0&&(e={});var{indentWithTab:t=!0,editable:n=!0,readOnly:r=!1,theme:i=`light`,placeholder:a=``,basicSetup:o=!0}=e,s=[];switch(t&&s.unshift(ie.of([ACe])),o&&(typeof o==`boolean`?s.unshift(JI()):s.unshift(JI(o))),a&&s.unshift(qe(a)),i){case`light`:s.push(oDe);break;case`dark`:s.push(aDe);break;case`none`:break;default:s.push(i);break}return n===!1&&s.push(Te.editable.of(!1)),r&&s.push(Xe.readOnly.of(!0)),[...s]},cDe=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)}),lDe=class{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(e=>{try{e()}catch(e){console.error(`TimeoutLatch callback error:`,e)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}},rL=class{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}},iL=null,uDe=()=>typeof window>`u`?new rL:(iL||=new rL,iL),dDe=Pe.define(),fDe=200,pDe=[];function mDe(e){var{value:t,selection:n,onChange:r,onStatistics:i,onCreateEditor:a,onUpdate:o,extensions:s=pDe,autoFocus:c,theme:l=`light`,height:u=null,minHeight:d=null,maxHeight:f=null,width:p=null,minWidth:m=null,maxWidth:h=null,placeholder:g=``,editable:_=!0,readOnly:v=!1,indentWithTab:y=!0,basicSetup:b=!0,root:x,initialState:S}=e,[C,w]=(0,q.useState)(),[T,E]=(0,q.useState)(),[D,O]=(0,q.useState)(),k=(0,q.useState)(()=>({current:null}))[0],A=(0,q.useState)(()=>({current:null}))[0],j=Te.theme({"&":{height:u,minHeight:d,maxHeight:f,width:p,minWidth:m,maxWidth:h},"& .cm-scroller":{height:`100% !important`}}),M=[Te.updateListener.of(e=>{e.docChanged&&typeof r==`function`&&!e.transactions.some(e=>e.annotation(dDe))&&(k.current?k.current.reset():(k.current=new lDe(()=>{if(A.current){var e=A.current;A.current=null,e()}k.current=null},fDe),uDe().add(k.current)),r(e.state.doc.toString(),e)),i&&i(cDe(e))}),j,...sDe({theme:l,editable:_,readOnly:v,placeholder:g,indentWithTab:y,basicSetup:b})];return o&&typeof o==`function`&&M.push(Te.updateListener.of(o)),M=M.concat(s),(0,q.useLayoutEffect)(()=>{if(C&&!D){var e={doc:t,selection:n,extensions:M},r=S?Xe.fromJSON(S.json,e,S.fields):Xe.create(e);if(O(r),!T){var i=new Te({state:r,parent:C,root:x});E(i),a&&a(i,r)}}return()=>{T&&(O(void 0),E(void 0))}},[C,D]),(0,q.useEffect)(()=>{e.container&&w(e.container)},[e.container]),(0,q.useEffect)(()=>()=>{T&&(T.destroy(),E(void 0)),k.current&&=(k.current.cancel(),null)},[T]),(0,q.useEffect)(()=>{c&&T&&T.focus()},[c,T]),(0,q.useEffect)(()=>{T&&T.dispatch({effects:Ne.reconfigure.of(M)})},[l,s,u,d,f,p,m,h,g,_,v,y,b,r,o]),(0,q.useEffect)(()=>{if(t!==void 0){var e=T?T.state.doc.toString():``;if(T&&t!==e){var n=k.current&&!k.current.isDone,r=()=>{T&&t!==T.state.doc.toString()&&T.dispatch({changes:{from:0,to:T.state.doc.toString().length,insert:t||``},annotations:[dDe.of(!0)]})};n?A.current=r:r()}}},[t,T]),{state:D,setState:O,view:T,setView:E,container:C,setContainer:w}}var hDe=[`className`,`value`,`selection`,`extensions`,`onChange`,`onStatistics`,`onCreateEditor`,`onUpdate`,`autoFocus`,`theme`,`height`,`minHeight`,`maxHeight`,`width`,`minWidth`,`maxWidth`,`basicSetup`,`placeholder`,`indentWithTab`,`editable`,`readOnly`,`root`,`initialState`],gDe=(0,q.forwardRef)((e,t)=>{var{className:n,value:r=``,selection:i,extensions:a=[],onChange:o,onStatistics:s,onCreateEditor:c,onUpdate:l,autoFocus:u,theme:d=`light`,height:f,minHeight:p,maxHeight:m,width:h,minWidth:g,maxWidth:_,basicSetup:v,placeholder:y,indentWithTab:b,editable:x,readOnly:S,root:C,initialState:w}=e,T=uEe(e,hDe),E=(0,q.useRef)(null),{state:D,view:O,container:k,setContainer:A}=mDe({root:C,value:r,autoFocus:u,theme:d,height:f,minHeight:p,maxHeight:m,width:h,minWidth:g,maxWidth:_,basicSetup:v,placeholder:y,indentWithTab:b,editable:x,readOnly:S,selection:i,onChange:o,onStatistics:s,onCreateEditor:c,onUpdate:l,extensions:a,initialState:w});(0,q.useImperativeHandle)(t,()=>({editor:E.current,state:D,view:O}),[E,k,D,O]);var j=(0,q.useCallback)(e=>{E.current=e,A(e)},[A]);if(typeof r!=`string`)throw Error(`value must be typeof string but got `+typeof r);return(0,K.jsx)(`div`,qF({ref:j,className:(typeof d==`string`?`cm-theme-`+d:`cm-theme`)+(n?` `+n:``)},T))});gDe.displayName=`CodeMirror`;function _De(e){if(!e)return!1;let t=e.toLowerCase();return t.endsWith(`.md`)||t.endsWith(`.markdown`)||t.endsWith(`.mdown`)||t.endsWith(`.mkd`)}function vDe(e){if(!e)return`plain`;let t=e.toLowerCase();return _De(t)?`markdown`:t.endsWith(`.ts`)||t.endsWith(`.tsx`)?`typescript`:t.endsWith(`.js`)||t.endsWith(`.jsx`)?`javascript`:t.endsWith(`.json`)?`json`:t.endsWith(`.yml`)||t.endsWith(`.yaml`)?`yaml`:`plain`}function yDe(e,t){switch(e){case`markdown`:return[ft({base:pt,codeLanguages:MO}),vSe()];case`typescript`:return[ot({typescript:!0,jsx:t?.endsWith(`.tsx`)})];case`javascript`:return[ot({jsx:t?.endsWith(`.jsx`)})];case`json`:return[dt()];case`yaml`:return[mt()];default:return[]}}function bDe(e){return e?W.matchFilename(MO,e):null}function xDe(e,t){switch(e){case`github`:return t?fk:Bk;case`material`:return t?zwe:Zwe;case`vscode`:return t?ZTe:lEe;case`tokyo`:return t?RTe:OTe;case`gruvbox`:return t?dwe:Twe;case`monokai`:return oTe;case`nord`:return _Te;default:return t?fk:Bk}}function aL({value:e,onChange:t,onSaveShortcut:n,readOnly:r=!1,language:i,filename:a,lineNumbers:o=!0,lineWrapping:s=!0,fontSize:c=13,className:l=``,style:u,placeholder:d,editorMinHeight:f=`240px`}){let p=ca(),{data:m}=nd(),h=m?.codeEditor?.theme??`github`,[g,_]=(0,q.useState)([]);(0,q.useEffect)(()=>{let e=!1;if(i){_([]);return}let t=vDe(a);if(t!==`plain`){_(yDe(t,a));return}let n=bDe(a);if(!n){_([]);return}if(n.support){_([n.support.extension]);return}return _([]),n.load().then(t=>{e||_([t.extension])}).catch(()=>{e||_([])}),()=>{e=!0}},[i,a]);let v=(0,q.useMemo)(()=>i?yDe(i,a):g,[i,a,g]),y=(0,q.useMemo)(()=>{let e=[Xe.readOnly.of(r),...v];return e.push(xDe(h,p)),e.push(Te.theme({".cm-line":{lineHeight:`21px`},"&":{borderRadius:`6px`,border:`1px solid var(--code-editor-border)`,height:`100%`,minHeight:`var(--code-editor-min-height, 240px)`},".cm-content":{fontFamily:`var(--font-mono)`},".cm-gutters":{fontFamily:`var(--font-mono)`},".cm-scroller":{fontFamily:`var(--font-mono)`,overflow:`auto`,scrollbarWidth:`thin`},".cm-md-codeblock":{padding:`0`,borderRadius:0}})),e.push(ie.of([{key:`Mod-a`,run:mO},{key:`Mod-s`,preventDefault:!0,run:()=>r||!n?!1:(n(),!0)}])),s&&e.push(Te.lineWrapping),e},[v,r,s,h,p,n]);return(0,K.jsx)(gDe,{value:e,onChange:t,placeholder:d,theme:`none`,basicSetup:{lineNumbers:o,foldGutter:!r,highlightActiveLine:!r,highlightActiveLineGutter:!r,autocompletion:!r,closeBrackets:!r,bracketMatching:!r},extensions:y,className:`min-h-0 overflow-hidden ${l}`,style:{fontSize:c,"--code-editor-min-height":f,...u}})}function SDe(e){if(!e)return null;if(e.type===`point`)return{x:e.x,y:e.y};let t=e.element;if(!t)return null;let n=t.getBoundingClientRect();switch(e.placement??`bottom-start`){case`bottom-end`:return{x:n.right,y:n.bottom};case`top-start`:return{x:n.left,y:n.top};case`top-end`:return{x:n.right,y:n.top};default:return{x:n.left,y:n.bottom}}}function CDe(e,t,n){let r=n?.left??0,i=n?.top??0,a=n?.right??window.innerWidth,o=n?.bottom??window.innerHeight,s=r+12,c=i+12,l=Math.max(s,a-t.width-12),u=Math.max(c,o-t.height-12);return{x:Math.max(s,Math.min(e.x,l)),y:Math.max(c,Math.min(e.y,u))}}function wDe(e,t,n){if(e?.type!==`target`)return t;switch(e.placement??`bottom-start`){case`bottom-end`:return{x:t.x-n.width,y:t.y};case`top-start`:return{x:t.x,y:t.y-n.height};case`top-end`:return{x:t.x-n.width,y:t.y-n.height};default:return t}}function TDe(e){try{return e.matches(`:popover-open`)}catch{return!1}}function oL({open:e,items:t,anchor:n,wrapperElement:r,boundaryElement:i,position:a,onClose:o}){let s=(0,q.useRef)(null),c=(0,q.useMemo)(()=>a?{type:`point`,x:a.x,y:a.y}:null,[a]),l=n??c,u=r??i??null,d=(0,q.useMemo)(()=>SDe(l),[l]),[f,p]=(0,q.useState)(null),m=`context-menu-${(0,q.useId)().replace(/[^a-zA-Z0-9_-]/g,``)}`,h=(0,q.useMemo)(()=>t.filter(e=>e.label.length>0),[t]),g=e&&!!d&&h.length>0;(0,q.useLayoutEffect)(()=>{let e=s.current;e&&(g?TDe(e)||e.showPopover?.():TDe(e)&&e.hidePopover?.())},[g]),(0,q.useLayoutEffect)(()=>{if(!e||!d){p(null);return}let t=s.current;if(!t){p(d);return}let n=u?.getBoundingClientRect()??null,r=t.getBoundingClientRect();p(CDe(wDe(l,d,r),r,n))},[l,d,u,e]),(0,q.useEffect)(()=>{let e=()=>o();return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[e,o]),(0,q.useEffect)(()=>{if(!g)return;let e=e=>{if(e.button===2)return;let t=e.target;t instanceof Node&&(s.current?.contains(t)||l?.type===`target`&&l.element?.contains(t)||o())},t=e=>{e.key===`Escape`&&o()};return window.addEventListener(`pointerdown`,e,!0),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,e,!0),window.removeEventListener(`keydown`,t)}},[l,o,g]),(0,q.useEffect)(()=>{if(!e||l?.type!==`target`||!l.element)return;let t=l.element,n=t.getAttribute(`data-context-menu-active`);return t.setAttribute(`data-context-menu-active`,`true`),()=>{n===null?t.removeAttribute(`data-context-menu-active`):t.setAttribute(`data-context-menu-active`,n)}},[l,e]);let _=f??d,v=_===null?{left:0,top:0}:{left:_.x,top:_.y};if(!g)return null;let y=String.raw;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`style`,{children:y`
|
|
961
961
|
.context-menu-popover[data-context-menu-id='${m}'] {
|
|
962
962
|
position: absolute;
|