@openspecui/web 9.0.0 → 9.0.1
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-Bxg8Uu8T.css +1 -0
- package/dist/assets/{App-pfObbe6n.js → App-CEbaO9p7.js} +73 -73
- package/dist/assets/{main-Bc_Hy41u.js → main-MGKIORYy.js} +2 -2
- package/dist/assets/{trpc--JMUaLps.js → trpc-BVbs2EGH.js} +1 -1
- package/dist/index.html +1 -1
- package/dist-ssg/client/.vite/ssr-manifest.json +29 -29
- package/dist-ssg/client/assets/CanvasRenderer-DKZvKi_9.js +1 -0
- package/dist-ssg/client/assets/WebGLRenderer-Dct7rzs_.js +1 -0
- package/dist-ssg/client/assets/WebGPURenderer-DtpKkjmH.js +1 -0
- package/dist-ssg/client/assets/browserAll-CuNkItSE.js +1 -0
- package/dist-ssg/client/assets/{config-guide-presentation-BOR0ydhm.js → config-guide-presentation-C4Z-0SFk.js} +1 -1
- package/dist-ssg/client/assets/{dist-biv4iN0V.js → dist-B6W3pPHs.js} +1 -1
- package/dist-ssg/client/assets/{dist-CcTAgsaD.js → dist-BKobWYD3.js} +1 -1
- package/dist-ssg/client/assets/{dist-DclbMTMt.js → dist-Bcjlb1bO.js} +1 -1
- package/dist-ssg/client/assets/dist-CWb-aAQf.js +1 -0
- package/dist-ssg/client/assets/dist-CYpiS1Zt.js +1 -0
- package/dist-ssg/client/assets/{dist-DFrBPW6S.js → dist-ClUVC_84.js} +1 -1
- package/dist-ssg/client/assets/{dist-BXnglWxe.js → dist-D1Kgfdnc.js} +1 -1
- package/dist-ssg/client/assets/{dist-DR4ycVu1.js → dist-D64HT2KR.js} +1 -1
- package/dist-ssg/client/assets/dist-H38juOFW.js +1 -0
- package/dist-ssg/client/assets/{dist-CqBkec9X.js → dist-PiPP3-Ah.js} +1 -1
- package/dist-ssg/client/assets/{dist-Cqsy4GXU.js → dist-k_96dSjT.js} +1 -1
- package/dist-ssg/client/assets/{dist-0yxWvQWL.js → dist-lYx3EWfZ.js} +1 -1
- package/dist-ssg/client/assets/{ghostty-web-D2QuMH_Q.js → ghostty-web-BIYzTj9q.js} +1 -1
- package/dist-ssg/client/assets/index-DqP4B4Rz.css +1 -0
- package/dist-ssg/client/assets/{index.ssg-JS2ceq7d.js → index.ssg-BtuMbAm3.js} +14 -14
- package/dist-ssg/client/assets/{init-CHYK3_IX.js → init-l-kQXEeR.js} +1 -1
- package/dist-ssg/client/assets/{trpc-B-w8tA8C.js → trpc-CHrTaCNa.js} +1 -1
- package/dist-ssg/client/assets/webworkerAll-BqQJxuyS.js +1 -0
- package/dist-ssg/client/index.ssg.html +2 -2
- package/dist-ssg/server/assets/CanvasRenderer-D5UXmqkQ.js +3 -0
- package/dist-ssg/server/assets/WebGLRenderer-CA7hgj6q.js +3 -0
- package/dist-ssg/server/assets/WebGPURenderer-CfV-9erK.js +3 -0
- package/dist-ssg/server/assets/{browserAll-BNHXRTWn.js → browserAll-DmyvKJDK.js} +2 -2
- package/dist-ssg/server/assets/{config-guide-presentation-CmUNOJoP.js → config-guide-presentation-r59qmEkS.js} +1 -1
- package/dist-ssg/server/assets/{dist-CSnQ9MUZ.js → dist-0Gp0z2-n.js} +1 -1
- package/dist-ssg/server/assets/{dist-Bg6kJ4lE.js → dist-BSrtv0FL.js} +1 -1
- package/dist-ssg/server/assets/{dist-CD_P89TI.js → dist-BaqegCo3.js} +1 -1
- package/dist-ssg/server/assets/dist-Bhwr_0k7.js +3 -0
- package/dist-ssg/server/assets/{dist-BZwNiEjE.js → dist-DRkFTPqz.js} +1 -1
- package/dist-ssg/server/assets/{dist-TFBLKdTC.js → dist-DfJANrLX.js} +1 -1
- package/dist-ssg/server/assets/{dist-CzfcaAEs.js → dist-DgvOnKuT.js} +1 -1
- package/dist-ssg/server/assets/{dist-tvIcsOn0.js → dist-DlZIJzsh.js} +1 -1
- package/dist-ssg/server/assets/dist-cgbXhCvj.js +3 -0
- package/dist-ssg/server/assets/dist-edAEd-k-.js +3 -0
- package/dist-ssg/server/assets/{dist-CkE7XypO.js → dist-jJpwOzat.js} +1 -1
- package/dist-ssg/server/assets/{dist-BTzm9CCH.js → dist-rENGOe6I.js} +1 -1
- package/dist-ssg/server/assets/{entry-server-C_EGBt5m.js → entry-server-BzFP1YY0.js} +62 -137
- package/dist-ssg/server/assets/{init-Ds70MQGb.js → init-Bx_sRhIx.js} +1 -1
- package/dist-ssg/server/assets/trpc-BbV9JZTO.js +3 -0
- package/dist-ssg/server/assets/webworkerAll-didcaEA_.js +4 -0
- package/dist-ssg/server/ssr-entry-manifest.json +24 -24
- package/package.json +3 -3
- package/dist/assets/App-BvtmL_DV.css +0 -1
- package/dist-ssg/client/assets/CanvasRenderer-BFbMT1Ul.js +0 -1
- package/dist-ssg/client/assets/WebGLRenderer-C7eR_UnH.js +0 -1
- package/dist-ssg/client/assets/WebGPURenderer-BTQYx5S7.js +0 -1
- package/dist-ssg/client/assets/browserAll-C88S5YfV.js +0 -1
- package/dist-ssg/client/assets/dist-4fNILwqh.js +0 -1
- package/dist-ssg/client/assets/dist-Cd3-dF0O.js +0 -1
- package/dist-ssg/client/assets/dist-DxTZTTY6.js +0 -1
- package/dist-ssg/client/assets/index-CrVhSCmS.css +0 -1
- package/dist-ssg/client/assets/webworkerAll-DFRsQGYS.js +0 -1
- package/dist-ssg/server/assets/CanvasRenderer-Cud3mH2M.js +0 -3
- package/dist-ssg/server/assets/WebGLRenderer-BG7MkvqA.js +0 -3
- package/dist-ssg/server/assets/WebGPURenderer--JR4o1Id.js +0 -3
- package/dist-ssg/server/assets/dist-CpgxMd46.js +0 -3
- package/dist-ssg/server/assets/dist-gfV2B0G7.js +0 -3
- package/dist-ssg/server/assets/dist-vPFtDCqy.js +0 -3
- package/dist-ssg/server/assets/trpc-DMtttD_4.js +0 -3
- package/dist-ssg/server/assets/webworkerAll-6pG_bTSk.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/trpc-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/trpc-CHrTaCNa.js","assets/jsx-runtime-BLLrG8rB.js","assets/chunk-BEqpzyXh.js","assets/browserAll-CuNkItSE.js","assets/Geometry-B_ASJa8G.js","assets/init-l-kQXEeR.js","assets/webworkerAll-BqQJxuyS.js","assets/WebGPURenderer-DtpKkjmH.js","assets/WebGLRenderer-Dct7rzs_.js","assets/CanvasRenderer-DKZvKi_9.js","assets/dist-CdAkpuDK.js","assets/dist-xTC3A7_k.js","assets/dist-B1LJ4aUx.js","assets/dist-CJCFfS8X.js","assets/dist-CYpiS1Zt.js","assets/dist-DbHhRzXY.js","assets/dist-ClUVC_84.js","assets/dist-PYiUsivk.js","assets/dist-CnO8PEuw.js","assets/dist-B6W3pPHs.js","assets/dist-H38juOFW.js","assets/dist-Bcjlb1bO.js","assets/dist-D1Kgfdnc.js","assets/dist-lYx3EWfZ.js","assets/dist-PiPP3-Ah.js","assets/dist-CGJy4k2t.js","assets/dist-DsHxTxcA.js","assets/dist-k_96dSjT.js","assets/dist-BT7-2C5q.js","assets/dist-B1p1fIxA.js","assets/dist-CWb-aAQf.js","assets/dockerfile-DPZmz0mC.js","assets/simple-mode-Cp5D7ntp.js","assets/factor-B0X9gnIy.js","assets/nsis-CqLr_sRu.js","assets/pug-B2drGkIO.js","assets/javascript-LCSAwviG.js","assets/dist-D64HT2KR.js","assets/dist-BKobWYD3.js","assets/angular-html-BcFuPi15.js","assets/html-CejWpL96.js","assets/css-CknVa4gM.js","assets/javascript-DWmkdz-Y.js","assets/angular-ts-B1BaIvxE.js","assets/scss-D_qDSlUG.js","assets/apl-Mo1iuKZS.js","assets/json-KzuwbxqD.js","assets/xml-BDIYGr99.js","assets/java-BIlD4ayK.js","assets/astro-f3WC0Kbm.js","assets/postcss-D95U44qw.js","assets/tsx-DSwWcKzk.js","assets/typescript-BbqOn_5N.js","assets/blade-Zx-ltVfj.js","assets/html-derivative-LIKtZFIg.js","assets/sql-Bg4ya6Zy.js","assets/bsl-A5qveKzZ.js","assets/sdbl-JrqL4iox.js","assets/c-CwirhoiB.js","assets/cairo-BdWB3oDj.js","assets/python-B0GFntA0.js","assets/cobol-DFJq2n2l.js","assets/coffee-Cu4JqPPD.js","assets/cpp-CbVG7imn.js","assets/glsl-ClTGjGp3.js","assets/regexp-BPGJPuK6.js","assets/crystal-BwuiCLhO.js","assets/shellscript-DY9jt5Qx.js","assets/edge-CBfNcqe4.js","assets/elixir-js0ZCHy9.js","assets/elm-D7r3M0_0.js","assets/erb-TQIGamLB.js","assets/ruby-DuCmzedi.js","assets/graphql-CR-OiOeT.js","assets/jsx-CYCAz3Hd.js","assets/haml-CF7TVg2_.js","assets/lua-DPb6RB71.js","assets/yaml-94RdW_eA.js","assets/erlang-5arsl5Y0.js","assets/markdown-BVjfI0HT.js","assets/fortran-fixed-form-DrmoxiKI.js","assets/fortran-free-form-C27VgpDn.js","assets/fsharp-IauVMwOy.js","assets/gdresource-B5Uf8QNc.js","assets/gdscript-DoLVARrK.js","assets/gdshader-E2F5d4-J.js","assets/git-commit-OZ8elXNz.js","assets/diff-Ow-jSA89.js","assets/git-rebase-C7E_HXI2.js","assets/glimmer-js-w_rEEM9P.js","assets/glimmer-ts-uTkFASYJ.js","assets/hack-BSUx7Zsw.js","assets/handlebars-DUpQGWbJ.js","assets/http-B7RDAq3H.js","assets/hurl-DjZ7lf0W.js","assets/csv-B7pWhT11.js","assets/hxml-DfYAWH_v.js","assets/haxe-CA0s0BXm.js","assets/jinja-Coga1GS8.js","assets/jison-BMpHleb5.js","assets/julia-BYR9dYGE.js","assets/r-mVHeyzcf.js","assets/latex-Dwiz3G7v.js","assets/tex-B31nUhBU.js","assets/liquid-CwbIk6kD.js","assets/marko-BhFKinQ6.js","assets/less-iH_aJfkw.js","assets/mdc-C1fcpJrh.js","assets/nginx-CDInadq6.js","assets/nim-BnK47BmR.js","assets/perl-BUFHAb42.js","assets/php-RxJ3_DV_.js","assets/pug-t7490iWr.js","assets/qml-BBJxRGXe.js","assets/razor-DaO3mVcf.js","assets/csharp-E-Y47NXl.js","assets/rst-DJ_xo8XK.js","assets/cmake-72Y6gwcf.js","assets/sas-BnjSbpOh.js","assets/shaderlab-CP9hZ8oj.js","assets/hlsl-qvDVYi2b.js","assets/shellsession-BKLbxMcg.js","assets/soy-DMNjdFnm.js","assets/sparql-BQbwscnU.js","assets/turtle-CPvSCbGp.js","assets/stata-dpMW4ci0.js","assets/svelte-CHmAX2wo.js","assets/templ-Dcwlk3J_.js","assets/go-NTM1BiXr.js","assets/ts-tags-oarEz9K0.js","assets/twig-CjHslpv7.js","assets/vue-CVJ5grBf.js","assets/vue-html-DG-GYQmJ.js","assets/vue-vine-BmcHOS8B.js","assets/stylus-BlQMrnId.js","assets/xsl-oqm-mMLQ.js","assets/config-guide-presentation-C4Z-0SFk.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{a as e,i as t,n,r,t as i}from"./chunk-BEqpzyXh.js";import{n as a,t as o}from"./jsx-runtime-BLLrG8rB.js";import{$ as s,A as c,B as l,C as u,E as d,F as f,G as p,H as m,I as h,J as g,K as _,L as v,N as y,O as b,P as x,Q as S,R as C,T as w,U as T,W as E,X as D,Y as O,Z as k,_ as A,a as j,b as M,c as N,d as P,et as F,f as ee,g as te,h as I,i as ne,it as L,j as re,k as ie,l as ae,m as oe,n as se,nt as ce,o as le,q as ue,r as de,rt as R,s as fe,t as pe,tt as me,u as he,v as ge,w as _e,x as ve,y as ye,z as be}from"./Geometry-B_ASJa8G.js";import{t as xe}from"./ImageSource-DRiTQZHU.js";import{C as Se,D as Ce,E as we,O as Te,S as Ee,T as De,_ as Oe,a as ke,b as Ae,c as je,d as Me,f as Ne,g as Pe,h as Fe,i as Ie,k as Le,l as Re,m as ze,n as Be,o as Ve,p as He,r as Ue,s as We,t as Ge,u as Ke,v as qe,w as Je,x as Ye,y as Xe}from"./RenderTargetSystem-Uat23JSZ.js";import{t as Ze}from"./getTextureBatchBindGroup-9y4fbTkZ.js";import{a as Qe,c as $e,d as et,f as tt,i as nt,l as rt,n as it,o as at,p as ot,r as st,s as ct,t as lt,u as ut}from"./BufferResource-5e2UtsWs.js";import{$ as dt,A as ft,At as pt,B as mt,C as ht,Ct as gt,D as _t,Dt as vt,E as yt,Et as bt,F as xt,Ft as St,G as Ct,H as wt,I as Tt,It as Et,K as Dt,L as Ot,Lt as kt,M as At,Mt as jt,Nt as Mt,O as Nt,Ot as Pt,P as Ft,Pt as It,Q as Lt,R as z,S as Rt,St as zt,T as Bt,Tt as Vt,U as Ht,V as Ut,W as Wt,X as Gt,Y as Kt,Z as qt,_ as Jt,a as Yt,at as Xt,b as Zt,bt as Qt,c as $t,ct as en,d as tn,dt as nn,et as rn,f as an,ft as on,g as sn,gt as cn,h as ln,i as un,it as dn,j as fn,jt as pn,k as mn,kt as hn,l as B,lt as gn,m as _n,mt as vn,n as yn,nt as bn,o as xn,p as Sn,pt as Cn,q as wn,r as Tn,rt as En,s as Dn,st as On,t as kn,u as An,ut as jn,v as Mn,vt as Nn,w as Pn,wt as eee,x as Fn,xt as In,z as Ln}from"./dist-B1LJ4aUx.js";import{a as tee,i as nee,n as Rn,o as zn,r as Bn}from"./dist-PYiUsivk.js";import{i as Vn,n as Hn,o as Un,r as Wn,t as Gn}from"./dist-xTC3A7_k.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Kn=i((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ree=i(((e,t)=>{t.exports=Kn()})),qn=i((e=>{var t=a();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=i.p;try{if(c.T=null,i.p=2,e)return e()}finally{c.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.0`})),Jn=i(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=qn()})),Yn=i((e=>{var t=ree(),n=a(),r=Jn();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return u(a),e;if(o===r)return u(a),t;o=o.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=o;else{for(var c=!1,l=a.child;l;){if(l===n){c=!0,n=a,r=o;break}if(l===r){c=!0,r=a,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=a;break}if(l===r){c=!0,r=o,n=a;break}l=l.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},te=[],I=-1;function ne(e){return{current:e}}function L(e){0>I||(e.current=te[I],te[I]=null,I--)}function re(e,t){I++,te[I]=e.current,e.current=t}var ie=ne(null),ae=ne(null),oe=ne(null),se=ne(null);function ce(e,t){switch(re(oe,t),re(ae,e),re(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Pd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Pd(t),e=Fd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}L(ie),re(ie,e)}function le(){L(ie),L(ae),L(oe)}function ue(e){e.memoizedState!==null&&re(se,e);var t=ie.current,n=Fd(t,e.type);t!==n&&(re(ae,e),re(ie,n))}function de(e){ae.current===e&&(L(ie),L(ae)),se.current===e&&(L(se),Wf._currentValue=ee)}var R,fe;function pe(e){if(R===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);R=t&&t[1]||``,fe=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+R+e+fe}var me=!1;function he(e,t){if(!e||me)return``;me=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
@@ -43,7 +43,7 @@ Error generating stack: `+e.message+`
|
|
|
43
43
|
.dark dialog.openspec-dialog::backdrop {
|
|
44
44
|
background-color: rgba(255, 255, 255, 0.2);
|
|
45
45
|
}
|
|
46
|
-
`,[])),(0,H.jsx)(`dialog`,{ref:h,"aria-labelledby":_,className:`openspec-dialog m-0 h-dvh w-screen max-w-none border-0 bg-transparent p-0 ${c}`,children:(0,H.jsx)(`div`,{className:`flex h-full w-full items-center justify-center px-4 py-4 ${l} ${u}`,children:(0,H.jsxs)(`div`,{ref:g,className:`@container/dialog bg-background text-foreground relative flex h-fit w-[calc(100%-0.5rem)] max-w-2xl flex-col overflow-hidden rounded-[var(--openspec-dialog-radius,0.75rem)] border shadow-xl ${y} ${d}`,style:{maxHeight:p},children:[(0,H.jsxs)(`div`,{className:`border-border flex flex-none shrink-0 items-center justify-between gap-3 border-b px-4 py-3`,children:[(0,H.jsx)(`div`,{id:_,className:`min-w-0 flex-1`,children:t}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[n,(0,H.jsx)(`button`,{onClick:r,className:`hover:bg-muted rounded p-1`,"aria-label":`Close dialog`,children:(0,H.jsx)(Cl,{className:`h-4 w-4`})})]})]}),(0,H.jsx)(`div`,{className:`scrollbar-thin scrollbar-track-transparent min-h-0 flex-1 overflow-auto px-4 py-3 ${f}`,children:o}),s&&(0,H.jsx)(`div`,{className:`border-border flex flex-none shrink-0 items-center justify-end gap-2 border-t px-4 py-3`,children:s})]})})})}var Dl;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(Dl||={});var Ol;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(Ol||={});var kl=Dl.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),Al=e=>{switch(typeof e){case`undefined`:return kl.undefined;case`string`:return kl.string;case`number`:return Number.isNaN(e)?kl.nan:kl.number;case`boolean`:return kl.boolean;case`function`:return kl.function;case`bigint`:return kl.bigint;case`symbol`:return kl.symbol;case`object`:return Array.isArray(e)?kl.array:e===null?kl.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?kl.promise:typeof Map<`u`&&e instanceof Map?kl.map:typeof Set<`u`&&e instanceof Set?kl.set:typeof Date<`u`&&e instanceof Date?kl.date:kl.object;default:return kl.unknown}},W=Dl.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),jl=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Dl.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};jl.create=e=>new jl(e);var Ml=(e,t)=>{let n;switch(e.code){case W.invalid_type:n=e.received===kl.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case W.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Dl.jsonStringifyReplacer)}`;break;case W.unrecognized_keys:n=`Unrecognized key(s) in object: ${Dl.joinValues(e.keys,`, `)}`;break;case W.invalid_union:n=`Invalid input`;break;case W.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Dl.joinValues(e.options)}`;break;case W.invalid_enum_value:n=`Invalid enum value. Expected ${Dl.joinValues(e.options)}, received '${e.received}'`;break;case W.invalid_arguments:n=`Invalid function arguments`;break;case W.invalid_return_type:n=`Invalid function return type`;break;case W.invalid_date:n=`Invalid date`;break;case W.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Dl.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case W.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case W.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case W.custom:n=`Invalid input`;break;case W.invalid_intersection_types:n=`Intersection results could not be merged`;break;case W.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case W.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,Dl.assertNever(e)}return{message:n}},Nl=Ml;function Pl(){return Nl}var Fl=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function G(e,t){let n=Pl(),r=Fl({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Ml?void 0:Ml].filter(e=>!!e)});e.common.issues.push(r)}var Il=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return Ll;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return Ll;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},Ll=Object.freeze({status:`aborted`}),Rl=e=>({status:`dirty`,value:e}),zl=e=>({status:`valid`,value:e}),Bl=e=>e.status===`aborted`,Vl=e=>e.status===`dirty`,Hl=e=>e.status===`valid`,Ul=e=>typeof Promise<`u`&&e instanceof Promise,Wl;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(Wl||={});var Gl=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Kl=(e,t)=>{if(Hl(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){return this._error||=new jl(e.common.issues),this._error}}};function ql(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var Jl=class{get description(){return this._def.description}_getType(e){return Al(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Al(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Il,ctx:{common:e.parent.common,data:e.data,parsedType:Al(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Ul(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Al(e)};return Kl(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Al(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Hl(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>Hl(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Al(e)},r=this._parse({data:e,path:n.path,parent:n});return Kl(n,await(Ul(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:W.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new Xu({schema:this,typeName:sd.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return Zu.create(this,this._def)}nullable(){return Qu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Mu.create(this)}promise(){return Yu.create(this,this._def)}or(e){return Fu.create([this,e],this._def)}and(e){return zu.create(this,e,this._def)}transform(e){return new Xu({...ql(this._def),schema:this,typeName:sd.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new $u({...ql(this._def),innerType:this,defaultValue:t,typeName:sd.ZodDefault})}brand(){return new nd({typeName:sd.ZodBranded,type:this,...ql(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new ed({...ql(this._def),innerType:this,catchValue:t,typeName:sd.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return rd.create(this,e)}readonly(){return id.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Yl=/^c[^\s-]{8,}$/i,Xl=/^[0-9a-z]+$/,Zl=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ql=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$l=/^[a-z0-9_-]{21}$/i,eu=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,tu=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,nu=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ru=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,iu,au=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ou=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,su=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,cu=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,lu=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,uu=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,du=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,fu=RegExp(`^${du}$`);function pu(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function mu(e){return RegExp(`^${pu(e)}$`)}function hu(e){let t=`${du}T${pu(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function gu(e,t){return!!((t===`v4`||!t)&&au.test(e)||(t===`v6`||!t)&&su.test(e))}function _u(e,t){if(!eu.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function vu(e,t){return!!((t===`v4`||!t)&&ou.test(e)||(t===`v6`||!t)&&cu.test(e))}var yu=class e extends Jl{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==kl.string){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.string,received:t.parsedType}),Ll}let t=new Il,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),G(n,{code:W.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),G(n,{code:W.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?G(n,{code:W.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&G(n,{code:W.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)nu.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`email`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)iu||=new RegExp(ru,`u`),iu.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`emoji`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)Ql.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`uuid`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)$l.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`nanoid`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)Yl.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`cuid`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)Xl.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`cuid2`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)Zl.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`ulid`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),G(n,{validation:`url`,code:W.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`regex`,code:W.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?hu(r).test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?fu.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?mu(r).test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?tu.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`duration`,code:W.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?gu(e.data,r.version)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`ip`,code:W.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?_u(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`jwt`,code:W.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?vu(e.data,r.version)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`cidr`,code:W.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?lu.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`base64`,code:W.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?uu.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`base64url`,code:W.invalid_string,message:r.message}),t.dirty()):Dl.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:W.invalid_string,...Wl.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...Wl.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...Wl.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...Wl.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...Wl.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...Wl.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...Wl.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...Wl.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...Wl.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...Wl.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...Wl.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...Wl.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...Wl.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...Wl.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Wl.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...Wl.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...Wl.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...Wl.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...Wl.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...Wl.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...Wl.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...Wl.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...Wl.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...Wl.errToObj(t)})}nonempty(e){return this.min(1,Wl.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};yu.create=e=>new yu({checks:[],typeName:sd.ZodString,coerce:e?.coerce??!1,...ql(e)});function bu(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var xu=class e extends Jl{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==kl.number){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.number,received:t.parsedType}),Ll}let t,n=new Il;for(let r of this._def.checks)r.kind===`int`?Dl.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),G(t,{code:W.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?bu(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),G(t,{code:W.not_finite,message:r.message}),n.dirty()):Dl.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,Wl.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Wl.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Wl.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Wl.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Wl.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:Wl.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:Wl.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:Wl.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:Wl.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:Wl.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Wl.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:Wl.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:Wl.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:Wl.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&Dl.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};xu.create=e=>new xu({checks:[],typeName:sd.ZodNumber,coerce:e?.coerce||!1,...ql(e)});var Su=class e extends Jl{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==kl.bigint)return this._getInvalidInput(e);let t,n=new Il;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):Dl.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.bigint,received:t.parsedType}),Ll}gte(e,t){return this.setLimit(`min`,e,!0,Wl.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Wl.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Wl.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Wl.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Wl.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:Wl.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:Wl.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:Wl.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:Wl.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Wl.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Su.create=e=>new Su({checks:[],typeName:sd.ZodBigInt,coerce:e?.coerce??!1,...ql(e)});var Cu=class extends Jl{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==kl.boolean){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.boolean,received:t.parsedType}),Ll}return zl(e.data)}};Cu.create=e=>new Cu({typeName:sd.ZodBoolean,coerce:e?.coerce||!1,...ql(e)});var wu=class e extends Jl{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==kl.date){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.date,received:t.parsedType}),Ll}if(Number.isNaN(e.data.getTime()))return G(this._getOrReturnCtx(e),{code:W.invalid_date}),Ll;let t=new Il,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),G(n,{code:W.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),G(n,{code:W.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):Dl.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:Wl.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:Wl.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};wu.create=e=>new wu({checks:[],coerce:e?.coerce||!1,typeName:sd.ZodDate,...ql(e)});var Tu=class extends Jl{_parse(e){if(this._getType(e)!==kl.symbol){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.symbol,received:t.parsedType}),Ll}return zl(e.data)}};Tu.create=e=>new Tu({typeName:sd.ZodSymbol,...ql(e)});var Eu=class extends Jl{_parse(e){if(this._getType(e)!==kl.undefined){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.undefined,received:t.parsedType}),Ll}return zl(e.data)}};Eu.create=e=>new Eu({typeName:sd.ZodUndefined,...ql(e)});var Du=class extends Jl{_parse(e){if(this._getType(e)!==kl.null){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.null,received:t.parsedType}),Ll}return zl(e.data)}};Du.create=e=>new Du({typeName:sd.ZodNull,...ql(e)});var Ou=class extends Jl{constructor(){super(...arguments),this._any=!0}_parse(e){return zl(e.data)}};Ou.create=e=>new Ou({typeName:sd.ZodAny,...ql(e)});var ku=class extends Jl{constructor(){super(...arguments),this._unknown=!0}_parse(e){return zl(e.data)}};ku.create=e=>new ku({typeName:sd.ZodUnknown,...ql(e)});var Au=class extends Jl{_parse(e){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.never,received:t.parsedType}),Ll}};Au.create=e=>new Au({typeName:sd.ZodNever,...ql(e)});var ju=class extends Jl{_parse(e){if(this._getType(e)!==kl.undefined){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.void,received:t.parsedType}),Ll}return zl(e.data)}};ju.create=e=>new ju({typeName:sd.ZodVoid,...ql(e)});var Mu=class e extends Jl{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==kl.array)return G(t,{code:W.invalid_type,expected:kl.array,received:t.parsedType}),Ll;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(G(t,{code:e?W.too_big:W.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(G(t,{code:W.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(G(t,{code:W.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new Gl(t,e,t.path,n)))).then(e=>Il.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new Gl(t,e,t.path,n)));return Il.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:Wl.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:Wl.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:Wl.toString(n)}})}nonempty(e){return this.min(1,e)}};Mu.create=(e,t)=>new Mu({type:e,minLength:null,maxLength:null,exactLength:null,typeName:sd.ZodArray,...ql(t)});function Nu(e){if(e instanceof Pu){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Zu.create(Nu(r))}return new Pu({...e._def,shape:()=>t})}else if(e instanceof Mu)return new Mu({...e._def,type:Nu(e.element)});else if(e instanceof Zu)return Zu.create(Nu(e.unwrap()));else if(e instanceof Qu)return Qu.create(Nu(e.unwrap()));else if(e instanceof Bu)return Bu.create(e.items.map(e=>Nu(e)));else return e}var Pu=class e extends Jl{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape();return this._cached={shape:e,keys:Dl.objectKeys(e)},this._cached}_parse(e){if(this._getType(e)!==kl.object){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.object,received:t.parsedType}),Ll}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Au&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new Gl(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Au){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(G(n,{code:W.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new Gl(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>Il.mergeObjectSync(t,e)):Il.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return Wl.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:Wl.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:sd.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of Dl.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of Dl.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return Nu(this)}partial(t){let n={};for(let e of Dl.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of Dl.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Zu;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return Ku(Dl.objectKeys(this.shape))}};Pu.create=(e,t)=>new Pu({shape:()=>e,unknownKeys:`strip`,catchall:Au.create(),typeName:sd.ZodObject,...ql(t)}),Pu.strictCreate=(e,t)=>new Pu({shape:()=>e,unknownKeys:`strict`,catchall:Au.create(),typeName:sd.ZodObject,...ql(t)}),Pu.lazycreate=(e,t)=>new Pu({shape:e,unknownKeys:`strip`,catchall:Au.create(),typeName:sd.ZodObject,...ql(t)});var Fu=class extends Jl{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new jl(e.ctx.common.issues));return G(t,{code:W.invalid_union,unionErrors:n}),Ll}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new jl(e));return G(t,{code:W.invalid_union,unionErrors:i}),Ll}}get options(){return this._def.options}};Fu.create=(e,t)=>new Fu({options:e,typeName:sd.ZodUnion,...ql(t)});var Iu=e=>e instanceof Wu?Iu(e.schema):e instanceof Xu?Iu(e.innerType()):e instanceof Gu?[e.value]:e instanceof qu?e.options:e instanceof Ju?Dl.objectValues(e.enum):e instanceof $u?Iu(e._def.innerType):e instanceof Eu?[void 0]:e instanceof Du?[null]:e instanceof Zu?[void 0,...Iu(e.unwrap())]:e instanceof Qu?[null,...Iu(e.unwrap())]:e instanceof nd||e instanceof id?Iu(e.unwrap()):e instanceof ed?Iu(e._def.innerType):[],Lu=class e extends Jl{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==kl.object)return G(t,{code:W.invalid_type,expected:kl.object,received:t.parsedType}),Ll;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(G(t,{code:W.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ll)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=Iu(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:sd.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...ql(r)})}};function Ru(e,t){let n=Al(e),r=Al(t);if(e===t)return{valid:!0,data:e};if(n===kl.object&&r===kl.object){let n=Dl.objectKeys(t),r=Dl.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Ru(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===kl.array&&r===kl.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Ru(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===kl.date&&r===kl.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var zu=class extends Jl{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Bl(e)||Bl(r))return Ll;let i=Ru(e.value,r.value);return i.valid?((Vl(e)||Vl(r))&&t.dirty(),{status:t.value,value:i.data}):(G(n,{code:W.invalid_intersection_types}),Ll)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};zu.create=(e,t,n)=>new zu({left:e,right:t,typeName:sd.ZodIntersection,...ql(n)});var Bu=class e extends Jl{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==kl.array)return G(n,{code:W.invalid_type,expected:kl.array,received:n.parsedType}),Ll;if(n.data.length<this._def.items.length)return G(n,{code:W.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),Ll;!this._def.rest&&n.data.length>this._def.items.length&&(G(n,{code:W.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new Gl(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>Il.mergeArray(t,e)):Il.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Bu.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new Bu({items:e,typeName:sd.ZodTuple,rest:null,...ql(t)})};var Vu=class e extends Jl{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==kl.object)return G(n,{code:W.invalid_type,expected:kl.object,received:n.parsedType}),Ll;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new Gl(n,e,n.path,e)),value:a._parse(new Gl(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?Il.mergeObjectAsync(t,r):Il.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Jl?new e({keyType:t,valueType:n,typeName:sd.ZodRecord,...ql(r)}):new e({keyType:yu.create(),valueType:t,typeName:sd.ZodRecord,...ql(n)})}},Hu=class extends Jl{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==kl.map)return G(n,{code:W.invalid_type,expected:kl.map,received:n.parsedType}),Ll;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new Gl(n,e,n.path,[a,`key`])),value:i._parse(new Gl(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return Ll;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return Ll;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};Hu.create=(e,t,n)=>new Hu({valueType:t,keyType:e,typeName:sd.ZodMap,...ql(n)});var Uu=class e extends Jl{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==kl.set)return G(n,{code:W.invalid_type,expected:kl.set,received:n.parsedType}),Ll;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(G(n,{code:W.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(G(n,{code:W.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return Ll;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new Gl(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:Wl.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:Wl.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Uu.create=(e,t)=>new Uu({valueType:e,minSize:null,maxSize:null,typeName:sd.ZodSet,...ql(t)});var cee=class e extends Jl{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==kl.function)return G(t,{code:W.invalid_type,expected:kl.function,received:t.parsedType}),Ll;function n(e,n){return Fl({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Pl(),Ml].filter(e=>!!e),issueData:{code:W.invalid_arguments,argumentsError:n}})}function r(e,n){return Fl({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Pl(),Ml].filter(e=>!!e),issueData:{code:W.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof Yu){let e=this;return zl(async function(...t){let o=new jl([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return zl(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new jl([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new jl([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Bu.create(t).rest(ku.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||Bu.create([]).rest(ku.create()),returns:n||ku.create(),typeName:sd.ZodFunction,...ql(r)})}},Wu=class extends Jl{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Wu.create=(e,t)=>new Wu({getter:e,typeName:sd.ZodLazy,...ql(t)});var Gu=class extends Jl{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return G(t,{received:t.data,code:W.invalid_literal,expected:this._def.value}),Ll}return{status:`valid`,value:e.data}}get value(){return this._def.value}};Gu.create=(e,t)=>new Gu({value:e,typeName:sd.ZodLiteral,...ql(t)});function Ku(e,t){return new qu({values:e,typeName:sd.ZodEnum,...ql(t)})}var qu=class e extends Jl{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return G(t,{expected:Dl.joinValues(n),received:t.parsedType,code:W.invalid_type}),Ll}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return G(t,{received:t.data,code:W.invalid_enum_value,options:n}),Ll}return zl(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};qu.create=Ku;var Ju=class extends Jl{_parse(e){let t=Dl.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==kl.string&&n.parsedType!==kl.number){let e=Dl.objectValues(t);return G(n,{expected:Dl.joinValues(e),received:n.parsedType,code:W.invalid_type}),Ll}if(this._cache||=new Set(Dl.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=Dl.objectValues(t);return G(n,{received:n.data,code:W.invalid_enum_value,options:e}),Ll}return zl(e.data)}get enum(){return this._def.values}};Ju.create=(e,t)=>new Ju({values:e,typeName:sd.ZodNativeEnum,...ql(t)});var Yu=class extends Jl{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==kl.promise&&t.common.async===!1?(G(t,{code:W.invalid_type,expected:kl.promise,received:t.parsedType}),Ll):zl((t.parsedType===kl.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Yu.create=(e,t)=>new Yu({type:e,typeName:sd.ZodPromise,...ql(t)});var Xu=class extends Jl{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===sd.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{G(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return Ll;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?Ll:r.status===`dirty`||t.value===`dirty`?Rl(r.value):r});{if(t.value===`aborted`)return Ll;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?Ll:r.status===`dirty`||t.value===`dirty`?Rl(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?Ll:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?Ll:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Hl(e))return Ll;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>Hl(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):Ll);Dl.assertNever(r)}};Xu.create=(e,t,n)=>new Xu({schema:e,typeName:sd.ZodEffects,effect:t,...ql(n)}),Xu.createWithPreprocess=(e,t,n)=>new Xu({schema:t,effect:{type:`preprocess`,transform:e},typeName:sd.ZodEffects,...ql(n)});var Zu=class extends Jl{_parse(e){return this._getType(e)===kl.undefined?zl(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Zu.create=(e,t)=>new Zu({innerType:e,typeName:sd.ZodOptional,...ql(t)});var Qu=class extends Jl{_parse(e){return this._getType(e)===kl.null?zl(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Qu.create=(e,t)=>new Qu({innerType:e,typeName:sd.ZodNullable,...ql(t)});var $u=class extends Jl{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===kl.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};$u.create=(e,t)=>new $u({innerType:e,typeName:sd.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...ql(t)});var ed=class extends Jl{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ul(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new jl(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new jl(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};ed.create=(e,t)=>new ed({innerType:e,typeName:sd.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...ql(t)});var td=class extends Jl{_parse(e){if(this._getType(e)!==kl.nan){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.nan,received:t.parsedType}),Ll}return{status:`valid`,value:e.data}}};td.create=e=>new td({typeName:sd.ZodNaN,...ql(e)});var nd=class extends Jl{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},rd=class e extends Jl{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?Ll:e.status===`dirty`?(t.dirty(),Rl(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?Ll:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:sd.ZodPipeline})}},id=class extends Jl{_parse(e){let t=this._def.innerType._parse(e),n=e=>(Hl(e)&&(e.value=Object.freeze(e.value)),e);return Ul(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};id.create=(e,t)=>new id({innerType:e,typeName:sd.ZodReadonly,...ql(t)});function ad(e,t){let n=typeof e==`function`?e(t):typeof e==`string`?{message:e}:e;return typeof n==`string`?{message:n}:n}function od(e,t={},n){return e?Ou.create().superRefine((r,i)=>{let a=e(r);if(a instanceof Promise)return a.then(e=>{if(!e){let e=ad(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}});if(!a){let e=ad(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}}):Ou.create()}Pu.lazycreate;var sd;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(sd||={});var K=yu.create,q=xu.create;td.create,Su.create;var cd=Cu.create;wu.create,Tu.create;var ld=Eu.create,ud=Du.create;Ou.create;var dd=ku.create;Au.create,ju.create;var J=Mu.create,Y=Pu.create;Pu.strictCreate;var fd=Fu.create,pd=Lu.create;zu.create;var md=Bu.create,hd=Vu.create;Hu.create,Uu.create,cee.create;var gd=Wu.create,X=Gu.create,_d=qu.create;Ju.create,Yu.create,Xu.create,Zu.create,Qu.create;var vd=Xu.createWithPreprocess;rd.create;var yd=Y({severity:_d([`error`,`warning`,`info`]),code:K(),message:K(),target:K().optional(),fix:K().optional()}).passthrough(),bd=_d([`store`,`declared`,`nearest`,`global_default`,`implicit`]),xd=Y({path:K(),source:bd,store_id:K().optional()}).passthrough(),lee=Y({id:K(),summary:K()}).passthrough(),Sd=Y({store_id:K(),root:K().optional(),status:J(yd)}).passthrough(),Cd=Sd.extend({specs:J(lee).optional(),fetch:K().optional()}).passthrough(),wd=Y({status:J(yd).min(1)}).passthrough(),Td=gd(()=>fd([K(),q(),cd(),ud(),J(Td),hd(K(),Td)])),Ed=Y({success:cd(),stdout:K(),stderr:K(),exitCode:q().int().nullable(),payload:Td.nullable(),diagnostics:J(yd),contractError:K().optional()}),Dd=Y({name:K(),message:K(),cliEvidence:Ed.nullable()}),Od=_d([`loading`,`ready`,`revalidating`,`error`,`refresh-error`]),kd=_d([`initial`,`dependency`,`explicit-refresh`,`subscriber-resume`]);function Ad(e){let t={identity:K().min(1),workGeneration:q().int().nonnegative(),invalidationCause:kd};return pd(`state`,[Y({...t,state:X(`loading`),data:ud(),freshness:ud(),snapshotGeneration:ud(),error:ud()}),Y({...t,state:X(`ready`),data:e,freshness:X(`current`),snapshotGeneration:q().int().nonnegative(),error:ud()}),Y({...t,state:X(`revalidating`),data:e,freshness:X(`stale-display-only`),snapshotGeneration:q().int().nonnegative(),error:ud()}),Y({...t,state:X(`error`),data:ud(),freshness:ud(),snapshotGeneration:ud(),error:Dd}),Y({...t,state:X(`refresh-error`),data:e,freshness:X(`stale-display-only`),snapshotGeneration:q().int().nonnegative(),error:Dd})])}var jd=Y({identity:K().min(1),workGeneration:q().int().nonnegative(),snapshotGeneration:q().int().nonnegative().nullable(),state:Od,invalidationCause:kd}),Md=Y({severity:K().optional(),code:K().optional(),message:K().optional(),target:K().optional(),fix:K().optional()}).passthrough(),Nd=Y({id:K(),root:K()}).passthrough();Y({stores:J(Nd).default([]),status:J(Md).optional()}).passthrough();var Pd=Y({present:cd().nullable().optional(),healthy:cd().nullable().optional()}).passthrough(),Fd=Y({present:cd().nullable().optional(),valid:cd().nullable().optional(),id:K().nullable().optional(),remote:K().nullable().optional()}).passthrough(),Id=Y({is_repository:cd().nullable().optional(),has_commits:cd().nullable().optional(),has_uncommitted_changes:cd().nullable().optional(),has_remote:cd().nullable().optional(),origin_url:K().nullable().optional()}).passthrough(),Ld=Y({id:K().optional(),root:K().optional(),metadata_path:K().nullable().optional(),openspec_root:Pd.optional(),metadata:Fd.optional(),git:Id.optional(),status:J(Md).optional()}).passthrough();Y({stores:J(Ld).default([]),status:J(Md).optional()}).passthrough();var Rd=Y({id:K(),requirementCount:q()}).passthrough(),zd=Y({name:K(),completedTasks:q(),totalTasks:q(),lastModified:K(),status:_d([`no-tasks`,`complete`,`in-progress`])}).passthrough();Y({specs:J(Rd).default([]),status:J(Md).optional()}).passthrough(),Y({changes:J(zd).default([]),status:J(Md).optional()}).passthrough(),_d([`specs`,`changes`]);var Bd=`stores.content.inspect`,Vd=Y({kind:K(),message:K(),cliVersion:K().optional()}).passthrough(),Hd=Y({available:cd(),specs:J(Rd),storeId:K(),evidence:dd().nullable().optional(),error:Vd.optional(),cliVersion:K().optional()}).passthrough(),Ud=Y({available:cd(),changes:J(zd),storeId:K(),evidence:dd().nullable().optional(),error:Vd.optional(),cliVersion:K().optional()}).passthrough(),Wd=Y({exitStatus:q().int().nullable(),stdout:K().optional(),stderr:K().optional(),diagnostics:J(yd).optional(),payload:dd().optional(),contractError:K().optional()}),Gd=Y({requestId:K().min(1),envUri:K().min(1),kind:_d([`setup`,`register`,`unregister`,`remove`]),storeId:K().min(1).optional(),observedAt:q().int().nonnegative()}),Kd=pd(`status`,[Gd.extend({status:_d([`accepted`,`running`]),result:ld().optional()}),Gd.extend({status:_d([`succeeded`,`failed`,`indeterminate`]),result:Wd})]);Kd.and(Y({rejoined:cd()})),pd(`type`,[Y({type:X(`snapshot`),cursor:q().int().nonnegative(),records:J(Kd)}),Y({type:X(`changed`),cursor:q().int().nonnegative(),record:Kd})]);var qd=[`notifications.subscribe`,`config.notifications`],Jd=[`stores.inspect`,`stores.mutate`,`contexts.inspect`],Yd=Bd,Xd=[...Jd,Yd],Zd=Y({planningRootPath:K().nullable(),rootSource:bd,storeId:K().nullable(),ready:cd()}).passthrough();Y({status:X(`ok`),projectDir:K(),projectName:K(),watcherEnabled:cd(),openspecuiVersion:K(),hostedShellProtocolVersion:X(1),embeddedUiUrl:K(),runtimeCapabilities:J(_d(qd)),apiBaseUrl:K().optional(),cliVersion:K().nullable().optional(),envUri:K().optional(),rootSummary:Zd.nullable().optional(),hostedCapabilities:J(_d(Xd)).optional(),accessGateEnabled:cd().optional()}).passthrough();var Qd=Y({kind:K(),message:K(),cliVersion:K().optional()}).passthrough(),$d=Y({available:cd(),stores:J(Nd),evidence:dd().nullable().optional(),error:Qd.optional(),cliVersion:K().optional()}).passthrough(),ef=Y({available:cd(),stores:J(Ld),evidence:dd().nullable().optional(),error:Qd.optional(),cliVersion:K().optional()}).passthrough();Ad($d),Ad(ef),Ad(Hd),Ad(Ud);var tf=jd,nf=Y({available:cd(),version:K().optional(),error:K().optional(),effectiveCommand:K().optional(),tried:J(K()).optional()}).passthrough(),rf=Y({success:cd(),stdout:K(),stderr:K(),exitCode:q().int().nullable(),diagnostics:J(yd),contractError:K().optional()}).passthrough(),af=xd.extend({healthy:cd(),status:J(yd)}).passthrough(),of=Y({role:X(`referenced_store`),id:K(),path:K().optional(),remote:K().optional(),fetch:K().optional(),status:J(yd)}).passthrough(),sf=Y({launchProject:Y({path:K(),physicalPath:K().optional()}).passthrough(),planningRoot:af.nullable(),storeId:K().nullable(),generation:K().optional(),cli:nf,references:J(Sd),contextMembers:J(of),dataScope:Y({path:K(),source:_d([`xdg-data-home`,`local-app-data`,`user-home-default`]),environmentVariable:_d([`XDG_DATA_HOME`,`LOCALAPPDATA`]).nullable()}).passthrough(),diagnostics:Y({root:J(yd),doctor:J(yd),context:J(yd)}).passthrough(),evidence:Y({doctor:rf.nullable(),context:rf.nullable()}).passthrough(),observedAt:q()}).passthrough(),cf=_d([`cli-unavailable`,`doctor-command-failed`,`doctor-contract-drift`,`root-unresolved`,`root-unhealthy`,`context-command-failed`,`context-contract-drift`,`context-root-mismatch`,`references-unresolved`,`resolver-failed`]),lf=Y({state:X(`loading`),data:ud(),attempt:ud(),error:ud(),observedAt:q()}),uf=Y({state:X(`ready`),data:sf,attempt:ud(),error:ud(),observedAt:q()}),df=Y({state:X(`refreshing`),data:sf,attempt:ud(),error:ud(),observedAt:q()}),ff=Y({state:X(`error`),data:sf.nullable(),attempt:sf,error:Y({code:cf,message:K()}),observedAt:q()}),pf=Ad(pd(`state`,[uf,ff]));pd(`state`,[lf,uf,df,ff]),Y({result:Y({data:dd()}).passthrough()}).passthrough();var mf=`credential`;function hf(e){let t=e.trim();if(!t)return null;let n;try{n=new URL(t)}catch{return null}n.hash=``,n.search=``;let r=n.pathname.replace(/\/+$/,``);return n.pathname=r.length>0?r:`/`,n.toString().replace(/\/$/,(n.pathname,``))}function gf(e,t){return new URLSearchParams(e).get(t)?.trim()||null}function _f(e){let t=gf(e.search,`session`);return{hosted:t!==null,apiBaseUrl:hf(gf(e.search,`api`)??``),sessionId:t}}function vf(e,t){let n=_f(t);return n.hosted&&n.sessionId?`hosted-session:${n.sessionId}:${e}`:e}function yf(){return typeof window<`u`&&window.location!==void 0}function uee(){return yf()?_f(window.location):{hosted:!1,apiBaseUrl:null,sessionId:null}}function bf(){return yf()?uee().apiBaseUrl??``:``}function xf(e){if(!yf())return``;let t=bf();if(t){let n=new URL(t);return`${n.protocol===`https:`?`wss:`:`ws:`}//${n.host}${e}`}return`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}${e}`}function Sf(){return xf(`/trpc`)}function Cf(){return xf(`/ws/pty`)}function wf(){let e=bf();return e?`${e}/trpc`:`/trpc`}function Tf(){let e=bf();return e?`${e}/api/health`:`/api/health`}var Ef=null;function Df(){return typeof window<`u`&&window.location!==void 0}function Of(e){let t=new URLSearchParams(e.hash.slice(1)),n=t.get(mf);if(n===null)return!1;n.length>0&&(Ef=n),t.delete(mf);let r=t.toString();return e.hash=r?`#${r}`:``,!0}function kf(){if(!Df())return Ef;let e=new URL(window.location.href);return Of(e)&&window.history.replaceState({},``,`${e.pathname}${e.search}${e.hash}`),Ef}function Af(){return kf()}function jf(){let e=Af();return e?`Bearer ${e}`:null}function Mf(e){return e===`/api`||e.startsWith(`/api/`)||e===`/trpc`||e.startsWith(`/trpc/`)}function Nf(e){if(!Df())return null;let t=e instanceof Request?e.url:e instanceof URL?e.toString():e;try{return new URL(t,window.location.href)}catch{return null}}function Pf(e){let t=Nf(e);if(!t||!Mf(t.pathname))return!1;let n=bf(),r=n?new URL(n).origin:window.location.origin;return t.origin===r}function Ff(e,t){let n=jf();if(!n||!Pf(e))return fetch(e,t);let r=new Headers(t?.headers??(e instanceof Request?e.headers:void 0));return r.has(`Authorization`)||r.set(`Authorization`,n),fetch(e,{...t,headers:r})}var If=null;typeof window<`u`&&window.__OPENSPEC_STATIC_MODE__===!0&&(If=!0,console.log(`[static-mode] Detected static export mode (via flag)`));function Lf(){return If===!0}function Rf(e){If=e}var zf=null;function Bf(){return zf===null?typeof window<`u`&&window.__OPENSPEC_BASE_PATH__||`./`:zf}function Vf(){return typeof window<`u`&&window.__INITIAL_DATA__?window.__INITIAL_DATA__:null}var Hf=`modulepreload`,Uf=function(e){return`/`+e},Wf={},Z=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Uf(t,n),t in Wf)return;Wf[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Hf,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Gf=[`/dashboard`,`/config`,`/git`,`/specs`,`/changes`,`/board`,`/archive`,`/settings`,`/terminal`],Kf=[`/dashboard`,`/config`,`/specs`,`/changes`,`/board`,`/archive`,`/settings`],qf=Lf()?[]:[`/git`,`/terminal`],Jf=[`/search`,`/notifications`,`/opsx-new`,`/opsx-propose`,`/opsx-verify`,`/opsx-compose`];function Yf(){return vf(`nav-layout`,window.location)}function Xf(e){return vf(`nav-layout:${encodeURIComponent(e)}`,window.location)}var Zf=300;function Qf(e){return Gf.includes(e)}function $f(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&Qf(e)):[]}function ep(e){if(typeof e!=`object`||!e)return null;let t=e;return!Array.isArray(t.mainTabs)||!Array.isArray(t.bottomTabs)?null:{mainTabs:$f(t.mainTabs),bottomTabs:$f(t.bottomTabs),updatedAt:typeof t.updatedAt==`number`?t.updatedAt:0}}function tp(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 np(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:tp(t,i)}}function rp(e){let t=e.trim();if(!t||t===`./`||t===`.`)return`/`;let n=t.startsWith(`/`)?t:`/${t}`;return(n.endsWith(`/`)?n:`${n}/`).replace(/\/+/g,`/`)}function ip(e,t){return t===`/`?e||`/`:e===t.slice(0,-1)?`/`:e.startsWith(t)?e.slice(t.length-1)||`/`:e||`/`}function ap(e,t){if(t===`/`)return e||`/`;let n=e.startsWith(`/`)?e:`/${e}`;return n===`/`?t.slice(0,-1)||`/`:`${t.slice(0,-1)}${n}`}function op(e){if(typeof window>`u`)return e;let t=new URL(e,window.location.origin),n=rp(Bf());return t.pathname=ip(t.pathname,n),`${t.pathname}${t.search}${t.hash}`}function sp(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 cp(e){for(let t of Gf)if(e===t||e.startsWith(t+`/`))return t;return null}function lp(e,t){if(t===`pop`)return null;let n=t===`main`?e.mainLocation:e.bottomLocation,r=t===`main`?e.mainTabs:e.bottomTabs,i=cp(n.pathname);return i&&r.includes(i)?i:null}function up(e){return Jf.some(t=>e===t||e.startsWith(t+`/`))}function dp(e,t){if(up(t))return`pop`;let n=cp(t);return n&&e.bottomTabs.includes(n)?`bottom`:`main`}function fp(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 Gf)t.has(e)||(qf.includes(e)?r.push(e):n.push(e));return{mainTabs:n,bottomTabs:r}}function pp(e,t){if(t.length===0)return np(`/`);let n=cp(e.pathname);return n&&!t.includes(n)?np(`/`):e}function mp(e,t){if(t.length===0)return np(`/`);if(e.pathname===`/`)return np(`/`,e.state);let n=cp(e.pathname);return!n||!t.includes(n)?np(`/`):e}function hp(e){return e.pathname===`/`?np(`/`,e.state):up(e.pathname)?e:np(`/`)}function gp(e){let t=fp({mainTabs:e.mainTabs,bottomTabs:e.bottomTabs});return{...e,mainTabs:t.mainTabs,bottomTabs:t.bottomTabs,mainLocation:pp(e.mainLocation,t.mainTabs),bottomLocation:mp(e.bottomLocation,t.bottomTabs),popLocation:hp(e.popLocation)}}function _p(e,t){let n=new URL(e.href),r=rp(Bf());n.pathname=ip(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=np(`${n.pathname}${n.search}${n.hash}`,o?.main),c=np(i??`/`,o?.bottom),l=np(a??`/`,o?.pop);if(!i&&!a){let e=dp(t,s.pathname);e===`bottom`?(c=s,s=np(`/`,o?.main)):e===`pop`&&(l=s,s=np(`/`,o?.main))}return{main:pp(s,t.mainTabs),bottom:mp(c,t.bottomTabs),pop:hp(l)}}function vp(e){let t=new URL(window.location.href),n=new URL(e.mainLocation.href,window.location.origin),r=rp(Bf());return n.pathname=ap(n.pathname,r),sp(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 yp(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}function bp(){return{mainTabs:[...Kf],bottomTabs:[...qf],updatedAt:0,mainLocation:np(`/dashboard`),bottomLocation:np(`/`),popLocation:np(`/`)}}function xp(){try{let e=localStorage.getItem(Yf());return e?ep(JSON.parse(e)):null}catch{return null}}function Sp(e){try{let t=localStorage.getItem(e);return t?ep(JSON.parse(t)):null}catch{return null}}function Cp(e,t=Yf()){try{localStorage.setItem(t,JSON.stringify(e))}catch{}}var wp=[({prevState:e,nextState:t,event:n})=>{if(n.type!==`MOVE_TAB`)return t;let r=e.bottomTabs.includes(n.tabId)?`bottom`:`main`;if(lp(e,r)!==n.tabId)return t;let i=r===`main`?e.mainLocation:e.bottomLocation,a=np(i.href,i.state);return n.targetArea===`main`?{...t,mainLocation:a}:{...t,bottomLocation:a}},({nextState:e})=>e.mainTabs.length===0||lp(e,`main`)!=null?e:{...e,mainLocation:np(e.mainTabs[0])}];function Tp(e,t,n){let r=t;for(let t of wp)r=t({prevState:e,nextState:r,event:n});return r}function Ep(e,t){switch(t.type){case`NAVIGATE`:{let n=t.sourceArea===`pop`?`pop`:dp(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 cp((n===`main`?e.mainLocation:e.bottomLocation).pathname)===t.tabId&&(n===`main`?s=np(`/`):c=np(`/`)),{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 yp(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?cp(e.bottomLocation.pathname)===t.tabId?{nextState:{...e,bottomLocation:np(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`}:cp(e.mainLocation.pathname)===t.tabId?{nextState:{...e,mainLocation:np(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`}}case`ACTIVATE_BOTTOM`:return dp(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:np(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`};case`ACTIVATE_POP`:return dp(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:np(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`};case`APPLY_LAYOUT`:{let n=fp(t.layout);return!(t.layout.updatedAt!==e.updatedAt||!yp(e.mainTabs,n.mainTabs)||!yp(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 Dp(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 Op(e,t,n){let r=[...e];for(let e of[`main`,`bottom`,`pop`])Dp(t,n,e)&&(r.some(t=>t.area===e)||r.push({area:e,type:`REPLACE`}));return r}var kp=new class{mainHistory=null;bottomHistory=null;popHistory=null;state=bp();listeners=new Set;snapshotCache=null;persistTimer=null;kvUnsubscribe=null;initialized=!1;storageKey=typeof window>`u`?`nav-layout`:vf(`nav-layout`,window.location);constructor(){if(typeof window>`u`)return;let e=Lf()?null:xp();if(e!=null){let t=fp(e);this.state={...this.state,mainTabs:t.mainTabs,bottomTabs:t.bottomTabs,updatedAt:e.updatedAt}}let t=_p(window.location,this.state),n=gp({...this.state,mainLocation:t.main,bottomLocation:t.bottom,popLocation:t.pop});n=gp(Tp(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:np(op(t),n)})}replace(e,t,n){this.dispatch({type:`NAVIGATE`,sourceArea:e,action:`REPLACE`,location:np(op(t),n)})}createHref(e,t,n){if(typeof window>`u`)return t;let{nextState:r}=this.computeTransition({type:`NAVIGATE`,sourceArea:e,action:`PUSH`,location:np(op(t),n)});return vp(r)}get mainTabs(){return this.state.mainTabs}get bottomTabs(){return this.state.bottomTabs}getAreaForPath(e){return dp(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:np(e)})}deactivateBottom(){this.dispatch({type:`DEACTIVATE_BOTTOM`})}activatePop(e){this.dispatch({type:`ACTIVATE_POP`,location:np(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=cp(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||Lf())){this.initialized=!0;try{let e=await this.resolveProjectScopedStorageKey();e&&e!==this.storageKey&&(this.storageKey=e,this.rebindProjectScopedLayout(e));let{trpcClient:t}=await Z(async()=>{let{trpcClient:e}=await import(`./trpc-B-w8tA8C.js`);return{trpcClient:e}},__vite__mapDeps([0,1,2])),n=ep(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=ep(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=_p(window.location,this.state);this.dispatch({type:`POPSTATE`,mainLocation:e.main,bottomLocation:e.bottom,popLocation:e.pop})};computeTransition(e){let t=Ep(this.state,e);if(!t.changed)return{transition:t,nextState:this.state};let n=Tp(this.state,t.nextState,e);return n=gp(n),{transition:t,nextState:n}}dispatch(e){if(typeof window<`u`&&e.type!==`POPSTATE`&&this.mainHistory==null){let e=_p(window.location,this.state);this.state=gp({...this.state,mainLocation:e.main,bottomLocation:e.bottom,popLocation:e.pop})}let t=Ep(this.state,e);if(!t.changed)return;let n=this.state,r=Tp(n,t.nextState,e);r=gp(r),this.state=r,t.persist===`local_and_remote`?this.persistLayout():t.persist===`local_only`&&(this.cancelPersistTimer(),Cp({mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:this.state.updatedAt},this.storageKey));let i=t.urlAction??(Dp(n,this.state,`main`)||Dp(n,this.state,`bottom`)||Dp(n,this.state,`pop`)?`REPLACE`:void 0);i&&this.syncToUrl(i);let a=Op(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=vp(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=vp(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},Cp({mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:e},this.storageKey),this.cancelPersistTimer(),this.persistTimer=setTimeout(()=>{this.persistTimer=null,Z(async()=>{let{trpcClient:e}=await import(`./trpc-B-w8tA8C.js`);return{trpcClient:e}},__vite__mapDeps([0,1,2])).then(({trpcClient:t})=>t.kv.set.mutate({key:this.storageKey,value:{mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:e}})).catch(()=>{})},Zf)}async resolveProjectScopedStorageKey(){try{let e=await Ff(Tf());if(!e.ok)return null;let t=await e.json();return typeof t.projectDir!=`string`||t.projectDir.length===0?null:Xf(t.projectDir)}catch{return null}}rebindProjectScopedLayout(e){let t=Sp(e);if(t){this.dispatch({type:`APPLY_LAYOUT`,layout:t,force:!0});return}this.state=gp({...this.state,updatedAt:0}),this.normalizeUrl(),this.notifyListeners()}};typeof window<`u`&&!Lf()&&kp.init();function Ap(){return(0,V.useSyncExternalStore)(e=>kp.subscribe(e),()=>kp.getSnapshot(),()=>kp.getSnapshot())}var jp=`gitScope`;function dee(e){return new URLSearchParams(e).get(`gitScope`)===`planning`?`planning`:`code`}function Mp(e){return e.type===`commit`?e.hash:`uncommitted`}function fee(e,t,n=``){let r=new URLSearchParams(n);t===`planning`?r.set(jp,t):r.delete(jp);let i=r.toString();return`${e}${i?`?${i}`:``}`}function pee(e,t,n){return n.type===`commit`?[`git`,e,t,`meta`,`commit`,n.hash]:[`git`,e,t,`meta`,`uncommitted`]}function mee(e){return e.type===`commit`?{type:`commit`,hash:e.hash}:{type:`uncommitted`}}function hee(e,t=`code`,n=``){return fee(e.type===`commit`?`/git/commit/${e.hash}`:`/git/uncommitted`,t,n)}function gee(e,t=`code`,n=``){return hee(mee(e),t,n)}var _ee={"7d":7,"30d":30,"90d":90,all:null},vee=/^(\d{4})-(\d{2})-(\d{2})(?:-|$)/;function Np(e){let t=vee.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 Pp(e){return Np(e.id)??e.updatedAt}function yee(e,t,n=Date.now()){let r=_ee[t];return r===null?!0:Pp(e)>=n-r*24*60*60*1e3}function bee(e,t){return t.updatedAt-e.updatedAt||e.id.localeCompare(t.id)}function xee(e){return[...e].sort(bee)}function See(e,t=10){return xee(e).slice(0,Math.max(0,Math.trunc(t)))}function Cee(e,t=10){return[...e].sort((e,t)=>Pp(t)-Pp(e)||e.id.localeCompare(t.id)).slice(0,Math.max(0,Math.trunc(t)))}var wee=[`timeout`,`memory-limit`,`runtime`,`abort`];async function Tee(e,t={}){let n=new AbortController,r=[],i=t.signal,a=Dee(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:Eee(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:Eee(e,i)}}finally{o&&clearTimeout(o),r.forEach(e=>e())}}function Eee(e,t){if(Mee(e))return e;if(t?.aborted)return{kind:`abort`,message:kee(t.reason)??`Translation cancelled.`};if(e instanceof DOMException&&e.name===`AbortError`)return{kind:`abort`,message:kee(e)??`Translation cancelled.`};let n=Oee(e);return Aee(n)?{kind:`timeout`,message:n}:jee(n)?{kind:`memory-limit`,message:n}:{kind:`runtime`,message:n}}function Dee(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.floor(e):void 0}function Oee(e){return e instanceof Error&&e.message.trim().length>0?e.message:typeof e==`string`&&e.trim().length>0?e:`Translation failed.`}function kee(e){if(e instanceof Error&&e.message.trim().length>0)return e.message;if(typeof e==`string`&&e.trim().length>0)return e}function Aee(e){return/\btime(?:d)?\s*out\b/i.test(e)}function jee(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 Mee(e){if(typeof e!=`object`||!e)return!1;let t=Reflect.get(e,`kind`),n=Reflect.get(e,`message`);return typeof t==`string`&&wee.includes(t)&&typeof n==`string`&&n.length>0}var Fp=_d([`browser`,`local`,`local-ct2`,`local-llama`,`openai`]),Ip=`browser`;function Lp(e){return e===`local`||e===`local-ct2`||e===`local-llama`}function Rp(e){return e===`local`||e===`local-ct2`}_d([`local`,`local-ct2`,`local-llama`,`openai`]);var zp=15e3,Bp=_d([`not-downloaded`,`queued`,`downloading`,`paused`,`downloaded`,`error`,`deleting`]),Vp=Y({path:K().min(1),sizeBytes:q().int().nonnegative().optional(),required:cd(),etag:K().min(1).optional(),revision:K().min(1).optional(),sourceUrl:K().min(1).optional(),raw:dd().optional()}),Nee=Y({id:K().min(1),label:K().min(1),description:K().optional(),profile:K().min(1).optional(),dtype:K().min(1).optional(),estimatedTotalBytes:q().int().nonnegative().optional(),baseGroupId:K().min(1).optional(),commitHash:K().min(1).optional(),shortCommitHash:K().min(1).optional(),rootDir:K().min(1).optional(),status:Bp.optional(),progress:q().min(0).max(1).optional(),bytesDownloaded:q().int().nonnegative().optional(),totalBytes:q().int().nonnegative().optional(),resumable:cd().optional(),error:K().optional(),selectable:cd(),selected:cd(),files:J(Vp)}),Pee=_d([`idle`,`loading`,`ready`,`error`]),Fee=Y({path:K().min(1),sizeBytes:q().int().nonnegative().optional(),required:cd(),etag:K().min(1).optional(),revision:K().min(1).optional(),sourceUrl:K().min(1).optional(),raw:dd().optional()}),Iee=Y({id:K().min(1),baseGroupId:K().min(1),label:K().min(1),displayLabel:K().min(1),description:K().optional(),profile:K().min(1).optional(),dtype:K().min(1).optional(),commitHash:K().min(1),shortCommitHash:K().min(1),rootDir:K().min(1),estimatedTotalBytes:q().int().nonnegative().optional(),selectable:cd(),files:J(Fee)}),Lee=Y({modelId:K().min(1),source:X(`huggingface`),endpoint:K().default(``),revision:K().min(1),commitHash:K().min(1),shortCommitHash:K().min(1),fetchedAt:q().int().nonnegative(),updatedAt:q().int().nonnegative(),raw:dd().optional(),groups:hd(K(),Iee).default({}),groupOrder:J(K().min(1)).default([])}),Ree=Y({path:K().min(1),sizeBytes:q().int().nonnegative().optional(),downloadedBytes:q().int().nonnegative().optional(),required:cd().default(!0),status:Bp.default(`not-downloaded`),updatedAt:q().int().nonnegative().optional(),error:K().optional()}),zee=Y({groupId:K().min(1),baseGroupId:K().min(1).optional(),status:Bp.default(`not-downloaded`),rootDir:K().min(1).optional(),bytesDownloaded:q().int().nonnegative().optional(),totalBytes:q().int().nonnegative().optional(),progress:q().min(0).max(1).optional(),resumable:cd().default(!1),error:K().optional(),installedAt:q().int().nonnegative().optional(),updatedAt:q().int().nonnegative().optional(),files:J(Ree).default([])}),Hp=Y({status:Pee.default(`idle`),message:K().optional(),error:K().optional(),updatedAt:q().int().nonnegative().optional()});Y({engineId:_d([`local`,`local-ct2`,`local-llama`]),modelId:K().min(1),selectedGroupId:K().min(1).optional(),groupId:K().min(1).optional(),status:Bp,message:K(),progress:q().min(0).max(1).optional(),bytesDownloaded:q().int().nonnegative().optional(),totalBytes:q().int().nonnegative().optional(),sessionId:K().optional(),resumable:cd().optional(),files:J(Y({path:K().min(1),sizeBytes:q().int().nonnegative().optional(),downloadedBytes:q().int().nonnegative().optional()})).optional(),updatedAt:q().int().nonnegative()});var Bee=Y({modelId:K().min(1),estimatedTotalBytes:q().int().nonnegative().optional(),files:J(Vp),profile:K().min(1).optional(),selectedGroupId:K().min(1).optional(),groups:J(Nee).optional()});Y({modelId:K().min(1),version:X(2).default(2),status:Bp.default(`not-downloaded`),selected:cd().default(!1),selectedGroupId:K().min(1).optional(),installedAt:q().int().nonnegative().optional(),updatedAt:q().int().nonnegative().optional(),bytesDownloaded:q().int().nonnegative().optional(),totalBytes:q().int().nonnegative().optional(),progress:q().min(0).max(1).optional(),resumable:cd().default(!1),error:K().optional(),profileLoad:Hp.default(Hp.parse({})),profileManifest:Lee.optional(),groupsState:hd(K(),zee).default({}),plan:Bee.optional(),files:J(Y({path:K().min(1),sizeBytes:q().int().nonnegative().optional(),downloadedBytes:q().int().nonnegative().optional()})).default([])}),_d([`local`,`network`,`recommended`]);var Vee=_d([`installed`,`installing`,`missing`,`error`,`not-applicable`]),Hee=_d([`ready`,`probing`,`failed`,`error`,`not-applicable`]),Uee=_d([`ready`,`missing`,`downloading`,`error`,`not-applicable`]),Up=Y({message:K().optional(),progress:q().min(0).max(1).optional(),error:K().optional()}),Wp=Y({dependency:Up.extend({state:Vee}),runtime:Up.extend({state:Hee}),assets:Up.extend({state:Uee}),summary:K().optional()});function Wee(e){return e.dependency.state===`installed`||e.dependency.state===`not-applicable`}function Gee(e){return e.runtime.state===`ready`||e.runtime.state===`not-applicable`}function Gp(e){return e?!Wee(e)||!Gee(e):!1}function Kee(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 Kp=_d([`stdout`,`stderr`]);Y({stream:Kp,text:K()}),pd(`type`,[Y({type:X(`status`),lifecycle:Wp}),Y({type:X(`log`),stream:Kp,text:K()}),Y({type:X(`exit`),lifecycle:Wp})]);var qp=Y({baseUrl:K().default(``),token:K().default(``),model:K().default(`gpt-4.1-mini`)}),qee=Y({baseUrl:K().optional(),token:K().optional(),model:K().optional()}),Jp=Y({model:K().default(`Xenova/nllb-200-distilled-600M`),selectedGroupId:K().optional(),hfEndpoint:K().default(``),memoryBudgetPercent:q().min(0).max(100).default(25)}),Jee=Y({model:K().min(1).optional(),selectedGroupId:K().min(1).nullable().optional(),hfEndpoint:K().optional(),memoryBudgetPercent:q().min(0).max(100).optional()}),Yp=Y({model:K().default(`ooeoeo/opus-mt-en-zh-ct2-float16`),selectedGroupId:K().optional(),hfEndpoint:K().default(``),memoryBudgetPercent:q().min(0).max(100).default(25)}),Yee=Y({model:K().min(1).optional(),selectedGroupId:K().min(1).nullable().optional(),hfEndpoint:K().optional(),memoryBudgetPercent:q().min(0).max(100).optional()}),Xp=Y({model:K().default(`bartowski/Qwen2.5-0.5B-Instruct-GGUF`),selectedGroupId:K().optional(),hfEndpoint:K().default(``),memoryBudgetPercent:q().min(0).max(100).default(25)}),Xee=Y({model:K().min(1).optional(),selectedGroupId:K().min(1).nullable().optional(),hfEndpoint:K().optional(),memoryBudgetPercent:q().min(0).max(100).optional()});Y({engineId:Fp.default(Ip),openai:qp.default(qp.parse({})),local:Jp.default(Jp.parse({})),localCt2:Yp.default(Yp.parse({})),localLlama:Xp.default(Xp.parse({}))}),Y({engineId:Fp.optional(),openai:qee.optional(),local:Jee.optional(),localCt2:Yee.optional(),localLlama:Xee.optional()}),Y({engineId:Fp,sourceLanguage:K().min(1),targetLanguage:K().min(1),model:K().min(1).optional(),selectedGroupId:K().min(1).optional(),inputs:J(K()).min(1),instructions:K().optional(),context:K().optional(),timeoutMs:q().int().positive().default(zp)}),Y({index:q().int().nonnegative(),output:K().optional(),error:Y({kind:_d(wee),message:K().min(1)}).optional()});var Zp=_d([`direct`,`bilingual`]),Zee=Y({local:Y({model:K().min(1).optional(),selectedGroupId:K().min(1).optional()}).default({}),localCt2:Y({model:K().min(1).optional(),selectedGroupId:K().min(1).optional()}).default({}),localLlama:Y({model:K().min(1).optional(),selectedGroupId:K().min(1).optional()}).default({}),openai:Y({model:K().min(1).optional()}).default({})}).default({}),Qee=Y({local:Y({model:K().min(1).optional(),selectedGroupId:K().min(1).nullable().optional()}).optional(),localCt2:Y({model:K().min(1).optional(),selectedGroupId:K().min(1).nullable().optional()}).optional(),localLlama:Y({model:K().min(1).optional(),selectedGroupId:K().min(1).nullable().optional()}).optional(),openai:Y({model:K().min(1).optional()}).optional()}),Qp=Y({enabled:cd().default(!1),targetLanguage:K().min(1).default(`zh`),displayMode:Zp.default(`direct`),cacheEnabled:cd().default(!1),engineId:Fp.default(Ip),engines:Zee});Y({enabled:cd().optional(),targetLanguage:K().min(1).optional(),displayMode:Zp.optional(),cacheEnabled:cd().optional(),engineId:Fp.optional(),engines:Qee.optional()});var $ee=1e4,$p=2e5;Y({entryLimit:q().int().min(100).max($p).default($ee)}),Y({entryLimit:q().int().min(100).max($p).optional()}),Y({key:K().min(1),keyHash:K().min(1),sourceText:K(),translatedText:K(),targetNodesJson:K().optional(),sourceLanguage:K().min(1),targetLanguage:K().min(1),placeholderTopologyHash:K().min(1),attributeTopologyHash:K().min(1),displayPolicyVersion:q().int().positive(),engineId:Fp.default(Ip),engineVersion:K().optional(),model:K().optional(),translatorContractVersion:q().int().positive().default(1),createdAt:q().int().nonnegative(),lastAccessedAt:q().int().nonnegative()}).omit({createdAt:!0,lastAccessedAt:!0}),Y({keyHash:K().min(1)}),Y({enabled:cd(),entryLimit:q().int().positive(),entries:q().int().nonnegative(),databasePath:K().optional()});var ete=`project`,tte=/^[A-Za-z]:\//;function em(e){return e.replace(/\\/g,`/`).replace(/\/+$/g,``)}function nte(e){return e.startsWith(`/`)||tte.test(e)}function rte(e){return e.replace(/^\.?\//,``)}function tm(e){return em(e).split(`/`).filter(Boolean)}function ite(e){let t=em(e),n=/(?:^|\/)node_modules\/(?:\.pnpm\/[^/]+\/node_modules\/)?(@[^/]+\/[^/]+|[^/]+)(\/.*)?/.exec(t),r=n?.[1];return r?`npm:${r}${n[2]??``}`:null}function nm(e){return`${ete}:${rte(e)}`}function ate(e,t){let n=em(e),r=em(t),i=n.toLowerCase(),a=r.toLowerCase();return a===i||a.startsWith(`${i}/`)}function ote(e,t){let n=tm(e),r=tm(t),i=0;for(;i<n.length&&i<r.length&&n[i]?.toLowerCase()===r[i]?.toLowerCase();)i+=1;return r.slice(i).join(`/`)}function ste(e){let t=tm(e),n=t.lastIndexOf(`openspec`);return n<0?null:t.slice(n).join(`/`)}function rm(e,t){let n=em(e),r=ite(n);return(t?.source===`package`||r)&&r?r:nte(n)?t?.projectDir&&ate(t.projectDir,n)?nm(ote(t.projectDir,n)):nm(ste(n)||tm(n).slice(-4).join(`/`)):nm(n)}var im=Symbol.for(`yaml.alias`),am=Symbol.for(`yaml.document`),om=Symbol.for(`yaml.map`),sm=Symbol.for(`yaml.pair`),cm=Symbol.for(`yaml.scalar`),lm=Symbol.for(`yaml.seq`),um=Symbol.for(`yaml.node.type`),dm=e=>!!e&&typeof e==`object`&&e[um]===im,fm=e=>!!e&&typeof e==`object`&&e[um]===am,pm=e=>!!e&&typeof e==`object`&&e[um]===om,mm=e=>!!e&&typeof e==`object`&&e[um]===sm,hm=e=>!!e&&typeof e==`object`&&e[um]===cm,gm=e=>!!e&&typeof e==`object`&&e[um]===lm;function _m(e){if(e&&typeof e==`object`)switch(e[um]){case om:case lm:return!0}return!1}function vm(e){if(e&&typeof e==`object`)switch(e[um]){case im:case om:case cm:case lm:return!0}return!1}var ym=e=>(hm(e)||_m(e))&&!!e.anchor,bm=Symbol(`break visit`),xm=Symbol(`skip children`),Sm=Symbol(`remove node`);function Cm(e,t){let n=Dm(t);fm(e)?wm(null,e.contents,n,Object.freeze([e]))===Sm&&(e.contents=null):wm(null,e,n,Object.freeze([]))}Cm.BREAK=bm,Cm.SKIP=xm,Cm.REMOVE=Sm;function wm(e,t,n,r){let i=Om(e,t,n,r);if(vm(i)||mm(i))return km(e,r,i),wm(e,i,n,r);if(typeof i!=`symbol`){if(_m(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=wm(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===bm)return bm;else i===Sm&&(t.items.splice(e,1),--e)}}else if(mm(t)){r=Object.freeze(r.concat(t));let e=wm(`key`,t.key,n,r);if(e===bm)return bm;e===Sm&&(t.key=null);let i=wm(`value`,t.value,n,r);if(i===bm)return bm;i===Sm&&(t.value=null)}}return i}async function Tm(e,t){let n=Dm(t);fm(e)?await Em(null,e.contents,n,Object.freeze([e]))===Sm&&(e.contents=null):await Em(null,e,n,Object.freeze([]))}Tm.BREAK=bm,Tm.SKIP=xm,Tm.REMOVE=Sm;async function Em(e,t,n,r){let i=await Om(e,t,n,r);if(vm(i)||mm(i))return km(e,r,i),Em(e,i,n,r);if(typeof i!=`symbol`){if(_m(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await Em(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===bm)return bm;else i===Sm&&(t.items.splice(e,1),--e)}}else if(mm(t)){r=Object.freeze(r.concat(t));let e=await Em(`key`,t.key,n,r);if(e===bm)return bm;e===Sm&&(t.key=null);let i=await Em(`value`,t.value,n,r);if(i===bm)return bm;i===Sm&&(t.value=null)}}return i}function Dm(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 Om(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(pm(t))return n.Map?.(e,t,r);if(gm(t))return n.Seq?.(e,t,r);if(mm(t))return n.Pair?.(e,t,r);if(hm(t))return n.Scalar?.(e,t,r);if(dm(t))return n.Alias?.(e,t,r)}function km(e,t,n){let r=t[t.length-1];if(_m(r))r.items[e]=n;else if(mm(r))e===`key`?r.key=n:r.value=n;else if(fm(r))r.contents=n;else{let e=dm(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var cte={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},lte=e=>e.replace(/[!,[\]{}]/g,e=>cte[e]),Am=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+lte(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&&vm(e.contents)){let t={};Cm(e.contents,(e,n)=>{vm(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(`
|
|
46
|
+
`,[])),(0,H.jsx)(`dialog`,{ref:h,"aria-labelledby":_,className:`openspec-dialog m-0 h-dvh w-screen max-w-none border-0 bg-transparent p-0 ${c}`,children:(0,H.jsx)(`div`,{className:`flex h-full w-full items-center justify-center px-4 py-4 ${l} ${u}`,children:(0,H.jsxs)(`div`,{ref:g,className:`@container/dialog bg-background text-foreground relative flex h-fit w-[calc(100%-0.5rem)] max-w-2xl flex-col overflow-hidden rounded-[var(--openspec-dialog-radius,0.75rem)] border shadow-xl ${y} ${d}`,style:{maxHeight:p},children:[(0,H.jsxs)(`div`,{className:`border-border flex flex-none shrink-0 items-center justify-between gap-3 border-b px-4 py-3`,children:[(0,H.jsx)(`div`,{id:_,className:`min-w-0 flex-1`,children:t}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[n,(0,H.jsx)(`button`,{onClick:r,className:`hover:bg-muted rounded p-1`,"aria-label":`Close dialog`,children:(0,H.jsx)(Cl,{className:`h-4 w-4`})})]})]}),(0,H.jsx)(`div`,{className:`scrollbar-thin scrollbar-track-transparent min-h-0 flex-1 overflow-auto px-4 py-3 ${f}`,children:o}),s&&(0,H.jsx)(`div`,{className:`border-border flex flex-none shrink-0 items-center justify-end gap-2 border-t px-4 py-3`,children:s})]})})})}var Dl;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(Dl||={});var Ol;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(Ol||={});var kl=Dl.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),Al=e=>{switch(typeof e){case`undefined`:return kl.undefined;case`string`:return kl.string;case`number`:return Number.isNaN(e)?kl.nan:kl.number;case`boolean`:return kl.boolean;case`function`:return kl.function;case`bigint`:return kl.bigint;case`symbol`:return kl.symbol;case`object`:return Array.isArray(e)?kl.array:e===null?kl.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?kl.promise:typeof Map<`u`&&e instanceof Map?kl.map:typeof Set<`u`&&e instanceof Set?kl.set:typeof Date<`u`&&e instanceof Date?kl.date:kl.object;default:return kl.unknown}},W=Dl.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),jl=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Dl.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};jl.create=e=>new jl(e);var Ml=(e,t)=>{let n;switch(e.code){case W.invalid_type:n=e.received===kl.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case W.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Dl.jsonStringifyReplacer)}`;break;case W.unrecognized_keys:n=`Unrecognized key(s) in object: ${Dl.joinValues(e.keys,`, `)}`;break;case W.invalid_union:n=`Invalid input`;break;case W.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Dl.joinValues(e.options)}`;break;case W.invalid_enum_value:n=`Invalid enum value. Expected ${Dl.joinValues(e.options)}, received '${e.received}'`;break;case W.invalid_arguments:n=`Invalid function arguments`;break;case W.invalid_return_type:n=`Invalid function return type`;break;case W.invalid_date:n=`Invalid date`;break;case W.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Dl.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case W.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case W.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case W.custom:n=`Invalid input`;break;case W.invalid_intersection_types:n=`Intersection results could not be merged`;break;case W.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case W.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,Dl.assertNever(e)}return{message:n}},Nl=Ml;function Pl(){return Nl}var Fl=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function G(e,t){let n=Pl(),r=Fl({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Ml?void 0:Ml].filter(e=>!!e)});e.common.issues.push(r)}var Il=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return Ll;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return Ll;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},Ll=Object.freeze({status:`aborted`}),Rl=e=>({status:`dirty`,value:e}),zl=e=>({status:`valid`,value:e}),Bl=e=>e.status===`aborted`,Vl=e=>e.status===`dirty`,Hl=e=>e.status===`valid`,Ul=e=>typeof Promise<`u`&&e instanceof Promise,Wl;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(Wl||={});var Gl=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Kl=(e,t)=>{if(Hl(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){return this._error||=new jl(e.common.issues),this._error}}};function ql(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var Jl=class{get description(){return this._def.description}_getType(e){return Al(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Al(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Il,ctx:{common:e.parent.common,data:e.data,parsedType:Al(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Ul(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Al(e)};return Kl(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Al(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Hl(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>Hl(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Al(e)},r=this._parse({data:e,path:n.path,parent:n});return Kl(n,await(Ul(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:W.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new Xu({schema:this,typeName:sd.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return Zu.create(this,this._def)}nullable(){return Qu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Mu.create(this)}promise(){return Yu.create(this,this._def)}or(e){return Fu.create([this,e],this._def)}and(e){return zu.create(this,e,this._def)}transform(e){return new Xu({...ql(this._def),schema:this,typeName:sd.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new $u({...ql(this._def),innerType:this,defaultValue:t,typeName:sd.ZodDefault})}brand(){return new nd({typeName:sd.ZodBranded,type:this,...ql(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new ed({...ql(this._def),innerType:this,catchValue:t,typeName:sd.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return rd.create(this,e)}readonly(){return id.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Yl=/^c[^\s-]{8,}$/i,Xl=/^[0-9a-z]+$/,Zl=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ql=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$l=/^[a-z0-9_-]{21}$/i,eu=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,tu=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,nu=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ru=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,iu,au=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ou=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,su=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,cu=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,lu=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,uu=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,du=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,fu=RegExp(`^${du}$`);function pu(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function mu(e){return RegExp(`^${pu(e)}$`)}function hu(e){let t=`${du}T${pu(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function gu(e,t){return!!((t===`v4`||!t)&&au.test(e)||(t===`v6`||!t)&&su.test(e))}function _u(e,t){if(!eu.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function vu(e,t){return!!((t===`v4`||!t)&&ou.test(e)||(t===`v6`||!t)&&cu.test(e))}var yu=class e extends Jl{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==kl.string){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.string,received:t.parsedType}),Ll}let t=new Il,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),G(n,{code:W.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),G(n,{code:W.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?G(n,{code:W.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&G(n,{code:W.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)nu.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`email`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)iu||=new RegExp(ru,`u`),iu.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`emoji`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)Ql.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`uuid`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)$l.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`nanoid`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)Yl.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`cuid`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)Xl.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`cuid2`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)Zl.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`ulid`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),G(n,{validation:`url`,code:W.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`regex`,code:W.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?hu(r).test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?fu.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?mu(r).test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?tu.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`duration`,code:W.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?gu(e.data,r.version)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`ip`,code:W.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?_u(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`jwt`,code:W.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?vu(e.data,r.version)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`cidr`,code:W.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?lu.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`base64`,code:W.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?uu.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`base64url`,code:W.invalid_string,message:r.message}),t.dirty()):Dl.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:W.invalid_string,...Wl.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...Wl.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...Wl.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...Wl.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...Wl.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...Wl.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...Wl.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...Wl.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...Wl.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...Wl.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...Wl.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...Wl.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...Wl.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...Wl.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Wl.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...Wl.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...Wl.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...Wl.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...Wl.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...Wl.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...Wl.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...Wl.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...Wl.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...Wl.errToObj(t)})}nonempty(e){return this.min(1,Wl.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};yu.create=e=>new yu({checks:[],typeName:sd.ZodString,coerce:e?.coerce??!1,...ql(e)});function bu(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var xu=class e extends Jl{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==kl.number){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.number,received:t.parsedType}),Ll}let t,n=new Il;for(let r of this._def.checks)r.kind===`int`?Dl.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),G(t,{code:W.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?bu(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),G(t,{code:W.not_finite,message:r.message}),n.dirty()):Dl.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,Wl.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Wl.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Wl.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Wl.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Wl.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:Wl.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:Wl.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:Wl.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:Wl.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:Wl.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Wl.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:Wl.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:Wl.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:Wl.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&Dl.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};xu.create=e=>new xu({checks:[],typeName:sd.ZodNumber,coerce:e?.coerce||!1,...ql(e)});var Su=class e extends Jl{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==kl.bigint)return this._getInvalidInput(e);let t,n=new Il;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):Dl.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.bigint,received:t.parsedType}),Ll}gte(e,t){return this.setLimit(`min`,e,!0,Wl.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Wl.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Wl.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Wl.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Wl.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:Wl.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:Wl.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:Wl.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:Wl.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Wl.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Su.create=e=>new Su({checks:[],typeName:sd.ZodBigInt,coerce:e?.coerce??!1,...ql(e)});var Cu=class extends Jl{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==kl.boolean){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.boolean,received:t.parsedType}),Ll}return zl(e.data)}};Cu.create=e=>new Cu({typeName:sd.ZodBoolean,coerce:e?.coerce||!1,...ql(e)});var wu=class e extends Jl{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==kl.date){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.date,received:t.parsedType}),Ll}if(Number.isNaN(e.data.getTime()))return G(this._getOrReturnCtx(e),{code:W.invalid_date}),Ll;let t=new Il,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),G(n,{code:W.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),G(n,{code:W.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):Dl.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:Wl.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:Wl.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};wu.create=e=>new wu({checks:[],coerce:e?.coerce||!1,typeName:sd.ZodDate,...ql(e)});var Tu=class extends Jl{_parse(e){if(this._getType(e)!==kl.symbol){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.symbol,received:t.parsedType}),Ll}return zl(e.data)}};Tu.create=e=>new Tu({typeName:sd.ZodSymbol,...ql(e)});var Eu=class extends Jl{_parse(e){if(this._getType(e)!==kl.undefined){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.undefined,received:t.parsedType}),Ll}return zl(e.data)}};Eu.create=e=>new Eu({typeName:sd.ZodUndefined,...ql(e)});var Du=class extends Jl{_parse(e){if(this._getType(e)!==kl.null){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.null,received:t.parsedType}),Ll}return zl(e.data)}};Du.create=e=>new Du({typeName:sd.ZodNull,...ql(e)});var Ou=class extends Jl{constructor(){super(...arguments),this._any=!0}_parse(e){return zl(e.data)}};Ou.create=e=>new Ou({typeName:sd.ZodAny,...ql(e)});var ku=class extends Jl{constructor(){super(...arguments),this._unknown=!0}_parse(e){return zl(e.data)}};ku.create=e=>new ku({typeName:sd.ZodUnknown,...ql(e)});var Au=class extends Jl{_parse(e){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.never,received:t.parsedType}),Ll}};Au.create=e=>new Au({typeName:sd.ZodNever,...ql(e)});var ju=class extends Jl{_parse(e){if(this._getType(e)!==kl.undefined){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.void,received:t.parsedType}),Ll}return zl(e.data)}};ju.create=e=>new ju({typeName:sd.ZodVoid,...ql(e)});var Mu=class e extends Jl{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==kl.array)return G(t,{code:W.invalid_type,expected:kl.array,received:t.parsedType}),Ll;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(G(t,{code:e?W.too_big:W.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(G(t,{code:W.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(G(t,{code:W.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new Gl(t,e,t.path,n)))).then(e=>Il.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new Gl(t,e,t.path,n)));return Il.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:Wl.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:Wl.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:Wl.toString(n)}})}nonempty(e){return this.min(1,e)}};Mu.create=(e,t)=>new Mu({type:e,minLength:null,maxLength:null,exactLength:null,typeName:sd.ZodArray,...ql(t)});function Nu(e){if(e instanceof Pu){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Zu.create(Nu(r))}return new Pu({...e._def,shape:()=>t})}else if(e instanceof Mu)return new Mu({...e._def,type:Nu(e.element)});else if(e instanceof Zu)return Zu.create(Nu(e.unwrap()));else if(e instanceof Qu)return Qu.create(Nu(e.unwrap()));else if(e instanceof Bu)return Bu.create(e.items.map(e=>Nu(e)));else return e}var Pu=class e extends Jl{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape();return this._cached={shape:e,keys:Dl.objectKeys(e)},this._cached}_parse(e){if(this._getType(e)!==kl.object){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.object,received:t.parsedType}),Ll}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Au&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new Gl(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Au){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(G(n,{code:W.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new Gl(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>Il.mergeObjectSync(t,e)):Il.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return Wl.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:Wl.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:sd.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of Dl.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of Dl.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return Nu(this)}partial(t){let n={};for(let e of Dl.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of Dl.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Zu;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return Ku(Dl.objectKeys(this.shape))}};Pu.create=(e,t)=>new Pu({shape:()=>e,unknownKeys:`strip`,catchall:Au.create(),typeName:sd.ZodObject,...ql(t)}),Pu.strictCreate=(e,t)=>new Pu({shape:()=>e,unknownKeys:`strict`,catchall:Au.create(),typeName:sd.ZodObject,...ql(t)}),Pu.lazycreate=(e,t)=>new Pu({shape:e,unknownKeys:`strip`,catchall:Au.create(),typeName:sd.ZodObject,...ql(t)});var Fu=class extends Jl{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new jl(e.ctx.common.issues));return G(t,{code:W.invalid_union,unionErrors:n}),Ll}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new jl(e));return G(t,{code:W.invalid_union,unionErrors:i}),Ll}}get options(){return this._def.options}};Fu.create=(e,t)=>new Fu({options:e,typeName:sd.ZodUnion,...ql(t)});var Iu=e=>e instanceof Wu?Iu(e.schema):e instanceof Xu?Iu(e.innerType()):e instanceof Gu?[e.value]:e instanceof qu?e.options:e instanceof Ju?Dl.objectValues(e.enum):e instanceof $u?Iu(e._def.innerType):e instanceof Eu?[void 0]:e instanceof Du?[null]:e instanceof Zu?[void 0,...Iu(e.unwrap())]:e instanceof Qu?[null,...Iu(e.unwrap())]:e instanceof nd||e instanceof id?Iu(e.unwrap()):e instanceof ed?Iu(e._def.innerType):[],Lu=class e extends Jl{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==kl.object)return G(t,{code:W.invalid_type,expected:kl.object,received:t.parsedType}),Ll;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(G(t,{code:W.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ll)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=Iu(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:sd.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...ql(r)})}};function Ru(e,t){let n=Al(e),r=Al(t);if(e===t)return{valid:!0,data:e};if(n===kl.object&&r===kl.object){let n=Dl.objectKeys(t),r=Dl.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Ru(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===kl.array&&r===kl.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Ru(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===kl.date&&r===kl.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var zu=class extends Jl{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Bl(e)||Bl(r))return Ll;let i=Ru(e.value,r.value);return i.valid?((Vl(e)||Vl(r))&&t.dirty(),{status:t.value,value:i.data}):(G(n,{code:W.invalid_intersection_types}),Ll)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};zu.create=(e,t,n)=>new zu({left:e,right:t,typeName:sd.ZodIntersection,...ql(n)});var Bu=class e extends Jl{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==kl.array)return G(n,{code:W.invalid_type,expected:kl.array,received:n.parsedType}),Ll;if(n.data.length<this._def.items.length)return G(n,{code:W.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),Ll;!this._def.rest&&n.data.length>this._def.items.length&&(G(n,{code:W.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new Gl(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>Il.mergeArray(t,e)):Il.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Bu.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new Bu({items:e,typeName:sd.ZodTuple,rest:null,...ql(t)})};var Vu=class e extends Jl{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==kl.object)return G(n,{code:W.invalid_type,expected:kl.object,received:n.parsedType}),Ll;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new Gl(n,e,n.path,e)),value:a._parse(new Gl(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?Il.mergeObjectAsync(t,r):Il.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Jl?new e({keyType:t,valueType:n,typeName:sd.ZodRecord,...ql(r)}):new e({keyType:yu.create(),valueType:t,typeName:sd.ZodRecord,...ql(n)})}},Hu=class extends Jl{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==kl.map)return G(n,{code:W.invalid_type,expected:kl.map,received:n.parsedType}),Ll;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new Gl(n,e,n.path,[a,`key`])),value:i._parse(new Gl(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return Ll;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return Ll;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};Hu.create=(e,t,n)=>new Hu({valueType:t,keyType:e,typeName:sd.ZodMap,...ql(n)});var Uu=class e extends Jl{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==kl.set)return G(n,{code:W.invalid_type,expected:kl.set,received:n.parsedType}),Ll;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(G(n,{code:W.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(G(n,{code:W.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return Ll;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new Gl(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:Wl.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:Wl.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Uu.create=(e,t)=>new Uu({valueType:e,minSize:null,maxSize:null,typeName:sd.ZodSet,...ql(t)});var cee=class e extends Jl{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==kl.function)return G(t,{code:W.invalid_type,expected:kl.function,received:t.parsedType}),Ll;function n(e,n){return Fl({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Pl(),Ml].filter(e=>!!e),issueData:{code:W.invalid_arguments,argumentsError:n}})}function r(e,n){return Fl({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Pl(),Ml].filter(e=>!!e),issueData:{code:W.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof Yu){let e=this;return zl(async function(...t){let o=new jl([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return zl(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new jl([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new jl([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Bu.create(t).rest(ku.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||Bu.create([]).rest(ku.create()),returns:n||ku.create(),typeName:sd.ZodFunction,...ql(r)})}},Wu=class extends Jl{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Wu.create=(e,t)=>new Wu({getter:e,typeName:sd.ZodLazy,...ql(t)});var Gu=class extends Jl{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return G(t,{received:t.data,code:W.invalid_literal,expected:this._def.value}),Ll}return{status:`valid`,value:e.data}}get value(){return this._def.value}};Gu.create=(e,t)=>new Gu({value:e,typeName:sd.ZodLiteral,...ql(t)});function Ku(e,t){return new qu({values:e,typeName:sd.ZodEnum,...ql(t)})}var qu=class e extends Jl{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return G(t,{expected:Dl.joinValues(n),received:t.parsedType,code:W.invalid_type}),Ll}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return G(t,{received:t.data,code:W.invalid_enum_value,options:n}),Ll}return zl(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};qu.create=Ku;var Ju=class extends Jl{_parse(e){let t=Dl.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==kl.string&&n.parsedType!==kl.number){let e=Dl.objectValues(t);return G(n,{expected:Dl.joinValues(e),received:n.parsedType,code:W.invalid_type}),Ll}if(this._cache||=new Set(Dl.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=Dl.objectValues(t);return G(n,{received:n.data,code:W.invalid_enum_value,options:e}),Ll}return zl(e.data)}get enum(){return this._def.values}};Ju.create=(e,t)=>new Ju({values:e,typeName:sd.ZodNativeEnum,...ql(t)});var Yu=class extends Jl{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==kl.promise&&t.common.async===!1?(G(t,{code:W.invalid_type,expected:kl.promise,received:t.parsedType}),Ll):zl((t.parsedType===kl.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Yu.create=(e,t)=>new Yu({type:e,typeName:sd.ZodPromise,...ql(t)});var Xu=class extends Jl{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===sd.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{G(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return Ll;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?Ll:r.status===`dirty`||t.value===`dirty`?Rl(r.value):r});{if(t.value===`aborted`)return Ll;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?Ll:r.status===`dirty`||t.value===`dirty`?Rl(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?Ll:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?Ll:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Hl(e))return Ll;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>Hl(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):Ll);Dl.assertNever(r)}};Xu.create=(e,t,n)=>new Xu({schema:e,typeName:sd.ZodEffects,effect:t,...ql(n)}),Xu.createWithPreprocess=(e,t,n)=>new Xu({schema:t,effect:{type:`preprocess`,transform:e},typeName:sd.ZodEffects,...ql(n)});var Zu=class extends Jl{_parse(e){return this._getType(e)===kl.undefined?zl(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Zu.create=(e,t)=>new Zu({innerType:e,typeName:sd.ZodOptional,...ql(t)});var Qu=class extends Jl{_parse(e){return this._getType(e)===kl.null?zl(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Qu.create=(e,t)=>new Qu({innerType:e,typeName:sd.ZodNullable,...ql(t)});var $u=class extends Jl{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===kl.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};$u.create=(e,t)=>new $u({innerType:e,typeName:sd.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...ql(t)});var ed=class extends Jl{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ul(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new jl(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new jl(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};ed.create=(e,t)=>new ed({innerType:e,typeName:sd.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...ql(t)});var td=class extends Jl{_parse(e){if(this._getType(e)!==kl.nan){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:kl.nan,received:t.parsedType}),Ll}return{status:`valid`,value:e.data}}};td.create=e=>new td({typeName:sd.ZodNaN,...ql(e)});var nd=class extends Jl{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},rd=class e extends Jl{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?Ll:e.status===`dirty`?(t.dirty(),Rl(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?Ll:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:sd.ZodPipeline})}},id=class extends Jl{_parse(e){let t=this._def.innerType._parse(e),n=e=>(Hl(e)&&(e.value=Object.freeze(e.value)),e);return Ul(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};id.create=(e,t)=>new id({innerType:e,typeName:sd.ZodReadonly,...ql(t)});function ad(e,t){let n=typeof e==`function`?e(t):typeof e==`string`?{message:e}:e;return typeof n==`string`?{message:n}:n}function od(e,t={},n){return e?Ou.create().superRefine((r,i)=>{let a=e(r);if(a instanceof Promise)return a.then(e=>{if(!e){let e=ad(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}});if(!a){let e=ad(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}}):Ou.create()}Pu.lazycreate;var sd;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(sd||={});var K=yu.create,q=xu.create;td.create,Su.create;var cd=Cu.create;wu.create,Tu.create;var ld=Eu.create,ud=Du.create;Ou.create;var dd=ku.create;Au.create,ju.create;var J=Mu.create,Y=Pu.create;Pu.strictCreate;var fd=Fu.create,pd=Lu.create;zu.create;var md=Bu.create,hd=Vu.create;Hu.create,Uu.create,cee.create;var gd=Wu.create,X=Gu.create,_d=qu.create;Ju.create,Yu.create,Xu.create,Zu.create,Qu.create;var vd=Xu.createWithPreprocess;rd.create;var yd=Y({severity:_d([`error`,`warning`,`info`]),code:K(),message:K(),target:K().optional(),fix:K().optional()}).passthrough(),bd=_d([`store`,`declared`,`nearest`,`global_default`,`implicit`]),xd=Y({path:K(),source:bd,store_id:K().optional()}).passthrough(),lee=Y({id:K(),summary:K()}).passthrough(),Sd=Y({store_id:K(),root:K().optional(),status:J(yd)}).passthrough(),Cd=Sd.extend({specs:J(lee).optional(),fetch:K().optional()}).passthrough(),wd=Y({status:J(yd).min(1)}).passthrough(),Td=gd(()=>fd([K(),q(),cd(),ud(),J(Td),hd(K(),Td)])),Ed=Y({success:cd(),stdout:K(),stderr:K(),exitCode:q().int().nullable(),payload:Td.nullable(),diagnostics:J(yd),contractError:K().optional()}),Dd=Y({name:K(),message:K(),cliEvidence:Ed.nullable()}),Od=_d([`loading`,`ready`,`revalidating`,`error`,`refresh-error`]),kd=_d([`initial`,`dependency`,`explicit-refresh`,`subscriber-resume`]);function Ad(e){let t={identity:K().min(1),workGeneration:q().int().nonnegative(),invalidationCause:kd};return pd(`state`,[Y({...t,state:X(`loading`),data:ud(),freshness:ud(),snapshotGeneration:ud(),error:ud()}),Y({...t,state:X(`ready`),data:e,freshness:X(`current`),snapshotGeneration:q().int().nonnegative(),error:ud()}),Y({...t,state:X(`revalidating`),data:e,freshness:X(`stale-display-only`),snapshotGeneration:q().int().nonnegative(),error:ud()}),Y({...t,state:X(`error`),data:ud(),freshness:ud(),snapshotGeneration:ud(),error:Dd}),Y({...t,state:X(`refresh-error`),data:e,freshness:X(`stale-display-only`),snapshotGeneration:q().int().nonnegative(),error:Dd})])}var jd=Y({identity:K().min(1),workGeneration:q().int().nonnegative(),snapshotGeneration:q().int().nonnegative().nullable(),state:Od,invalidationCause:kd}),Md=Y({severity:K().optional(),code:K().optional(),message:K().optional(),target:K().optional(),fix:K().optional()}).passthrough(),Nd=Y({id:K(),root:K()}).passthrough();Y({stores:J(Nd).default([]),status:J(Md).optional()}).passthrough();var Pd=Y({present:cd().nullable().optional(),healthy:cd().nullable().optional()}).passthrough(),Fd=Y({present:cd().nullable().optional(),valid:cd().nullable().optional(),id:K().nullable().optional(),remote:K().nullable().optional()}).passthrough(),Id=Y({is_repository:cd().nullable().optional(),has_commits:cd().nullable().optional(),has_uncommitted_changes:cd().nullable().optional(),has_remote:cd().nullable().optional(),origin_url:K().nullable().optional()}).passthrough(),Ld=Y({id:K().optional(),root:K().optional(),metadata_path:K().nullable().optional(),openspec_root:Pd.optional(),metadata:Fd.optional(),git:Id.optional(),status:J(Md).optional()}).passthrough();Y({stores:J(Ld).default([]),status:J(Md).optional()}).passthrough();var Rd=Y({id:K(),requirementCount:q()}).passthrough(),zd=Y({name:K(),completedTasks:q(),totalTasks:q(),lastModified:K(),status:_d([`no-tasks`,`complete`,`in-progress`])}).passthrough();Y({specs:J(Rd).default([]),status:J(Md).optional()}).passthrough(),Y({changes:J(zd).default([]),status:J(Md).optional()}).passthrough(),_d([`specs`,`changes`]);var Bd=`stores.content.inspect`,Vd=Y({kind:K(),message:K(),cliVersion:K().optional()}).passthrough(),Hd=Y({available:cd(),specs:J(Rd),storeId:K(),evidence:dd().nullable().optional(),error:Vd.optional(),cliVersion:K().optional()}).passthrough(),Ud=Y({available:cd(),changes:J(zd),storeId:K(),evidence:dd().nullable().optional(),error:Vd.optional(),cliVersion:K().optional()}).passthrough(),Wd=Y({exitStatus:q().int().nullable(),stdout:K().optional(),stderr:K().optional(),diagnostics:J(yd).optional(),payload:dd().optional(),contractError:K().optional()}),Gd=Y({requestId:K().min(1),envUri:K().min(1),kind:_d([`setup`,`register`,`unregister`,`remove`]),storeId:K().min(1).optional(),observedAt:q().int().nonnegative()}),Kd=pd(`status`,[Gd.extend({status:_d([`accepted`,`running`]),result:ld().optional()}),Gd.extend({status:_d([`succeeded`,`failed`,`indeterminate`]),result:Wd})]);Kd.and(Y({rejoined:cd()})),pd(`type`,[Y({type:X(`snapshot`),cursor:q().int().nonnegative(),records:J(Kd)}),Y({type:X(`changed`),cursor:q().int().nonnegative(),record:Kd})]);var qd=[`notifications.subscribe`,`config.notifications`],Jd=[`stores.inspect`,`stores.mutate`,`contexts.inspect`],Yd=Bd,Xd=[...Jd,Yd],Zd=Y({planningRootPath:K().nullable(),rootSource:bd,storeId:K().nullable(),ready:cd()}).passthrough();Y({status:X(`ok`),projectDir:K(),projectName:K(),watcherEnabled:cd(),openspecuiVersion:K(),hostedShellProtocolVersion:X(1),embeddedUiUrl:K(),runtimeCapabilities:J(_d(qd)),apiBaseUrl:K().optional(),cliVersion:K().nullable().optional(),envUri:K().optional(),rootSummary:Zd.nullable().optional(),hostedCapabilities:J(_d(Xd)).optional(),accessGateEnabled:cd().optional()}).passthrough();var Qd=Y({kind:K(),message:K(),cliVersion:K().optional()}).passthrough(),$d=Y({available:cd(),stores:J(Nd),evidence:dd().nullable().optional(),error:Qd.optional(),cliVersion:K().optional()}).passthrough(),ef=Y({available:cd(),stores:J(Ld),evidence:dd().nullable().optional(),error:Qd.optional(),cliVersion:K().optional()}).passthrough();Ad($d),Ad(ef),Ad(Hd),Ad(Ud);var tf=jd,nf=Y({available:cd(),version:K().optional(),error:K().optional(),effectiveCommand:K().optional(),tried:J(K()).optional()}).passthrough(),rf=Y({success:cd(),stdout:K(),stderr:K(),exitCode:q().int().nullable(),diagnostics:J(yd),contractError:K().optional()}).passthrough(),af=xd.extend({healthy:cd(),status:J(yd)}).passthrough(),of=Y({role:X(`referenced_store`),id:K(),path:K().optional(),remote:K().optional(),fetch:K().optional(),status:J(yd)}).passthrough(),sf=Y({launchProject:Y({path:K(),physicalPath:K().optional()}).passthrough(),planningRoot:af.nullable(),storeId:K().nullable(),generation:K().optional(),cli:nf,references:J(Sd),contextMembers:J(of),dataScope:Y({path:K(),source:_d([`xdg-data-home`,`local-app-data`,`user-home-default`]),environmentVariable:_d([`XDG_DATA_HOME`,`LOCALAPPDATA`]).nullable()}).passthrough(),diagnostics:Y({root:J(yd),doctor:J(yd),context:J(yd)}).passthrough(),evidence:Y({doctor:rf.nullable(),context:rf.nullable()}).passthrough(),observedAt:q()}).passthrough(),cf=_d([`cli-unavailable`,`doctor-command-failed`,`doctor-contract-drift`,`root-unresolved`,`root-unhealthy`,`context-command-failed`,`context-contract-drift`,`context-root-mismatch`,`references-unresolved`,`resolver-failed`]),lf=Y({state:X(`loading`),data:ud(),attempt:ud(),error:ud(),observedAt:q()}),uf=Y({state:X(`ready`),data:sf,attempt:ud(),error:ud(),observedAt:q()}),df=Y({state:X(`refreshing`),data:sf,attempt:ud(),error:ud(),observedAt:q()}),ff=Y({state:X(`error`),data:sf.nullable(),attempt:sf,error:Y({code:cf,message:K()}),observedAt:q()}),pf=Ad(pd(`state`,[uf,ff]));pd(`state`,[lf,uf,df,ff]),Y({result:Y({data:dd()}).passthrough()}).passthrough();var mf=`credential`;function hf(e){let t=e.trim();if(!t)return null;let n;try{n=new URL(t)}catch{return null}n.hash=``,n.search=``;let r=n.pathname.replace(/\/+$/,``);return n.pathname=r.length>0?r:`/`,n.toString().replace(/\/$/,(n.pathname,``))}function gf(e,t){return new URLSearchParams(e).get(t)?.trim()||null}function _f(e){let t=gf(e.search,`session`);return{hosted:t!==null,apiBaseUrl:hf(gf(e.search,`api`)??``),sessionId:t}}function vf(e,t){let n=_f(t);return n.hosted&&n.sessionId?`hosted-session:${n.sessionId}:${e}`:e}function yf(){return typeof window<`u`&&window.location!==void 0}function uee(){return yf()?_f(window.location):{hosted:!1,apiBaseUrl:null,sessionId:null}}function bf(){return yf()?uee().apiBaseUrl??``:``}function xf(e){if(!yf())return``;let t=bf();if(t){let n=new URL(t);return`${n.protocol===`https:`?`wss:`:`ws:`}//${n.host}${e}`}return`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}${e}`}function Sf(){return xf(`/trpc`)}function Cf(){return xf(`/ws/pty`)}function wf(){let e=bf();return e?`${e}/trpc`:`/trpc`}function Tf(){let e=bf();return e?`${e}/api/health`:`/api/health`}var Ef=null;function Df(){return typeof window<`u`&&window.location!==void 0}function Of(e){let t=new URLSearchParams(e.hash.slice(1)),n=t.get(mf);if(n===null)return!1;n.length>0&&(Ef=n),t.delete(mf);let r=t.toString();return e.hash=r?`#${r}`:``,!0}function kf(){if(!Df())return Ef;let e=new URL(window.location.href);return Of(e)&&window.history.replaceState({},``,`${e.pathname}${e.search}${e.hash}`),Ef}function Af(){return kf()}function jf(){let e=Af();return e?`Bearer ${e}`:null}function Mf(e){return e===`/api`||e.startsWith(`/api/`)||e===`/trpc`||e.startsWith(`/trpc/`)}function Nf(e){if(!Df())return null;let t=e instanceof Request?e.url:e instanceof URL?e.toString():e;try{return new URL(t,window.location.href)}catch{return null}}function Pf(e){let t=Nf(e);if(!t||!Mf(t.pathname))return!1;let n=bf(),r=n?new URL(n).origin:window.location.origin;return t.origin===r}function Ff(e,t){let n=jf();if(!n||!Pf(e))return fetch(e,t);let r=new Headers(t?.headers??(e instanceof Request?e.headers:void 0));return r.has(`Authorization`)||r.set(`Authorization`,n),fetch(e,{...t,headers:r})}var If=null;typeof window<`u`&&window.__OPENSPEC_STATIC_MODE__===!0&&(If=!0,console.log(`[static-mode] Detected static export mode (via flag)`));function Lf(){return If===!0}function Rf(e){If=e}var zf=null;function Bf(){return zf===null?typeof window<`u`&&window.__OPENSPEC_BASE_PATH__||`./`:zf}function Vf(){return typeof window<`u`&&window.__INITIAL_DATA__?window.__INITIAL_DATA__:null}var Hf=`modulepreload`,Uf=function(e){return`/`+e},Wf={},Z=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Uf(t,n),t in Wf)return;Wf[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Hf,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Gf=[`/dashboard`,`/config`,`/git`,`/specs`,`/changes`,`/board`,`/archive`,`/settings`,`/terminal`],Kf=[`/dashboard`,`/config`,`/specs`,`/changes`,`/board`,`/archive`,`/settings`],qf=Lf()?[]:[`/git`,`/terminal`],Jf=[`/search`,`/notifications`,`/opsx-new`,`/opsx-propose`,`/opsx-verify`,`/opsx-compose`];function Yf(){return vf(`nav-layout`,window.location)}function Xf(e){return vf(`nav-layout:${encodeURIComponent(e)}`,window.location)}var Zf=300;function Qf(e){return Gf.includes(e)}function $f(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&Qf(e)):[]}function ep(e){if(typeof e!=`object`||!e)return null;let t=e;return!Array.isArray(t.mainTabs)||!Array.isArray(t.bottomTabs)?null:{mainTabs:$f(t.mainTabs),bottomTabs:$f(t.bottomTabs),updatedAt:typeof t.updatedAt==`number`?t.updatedAt:0}}function tp(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 np(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:tp(t,i)}}function rp(e){let t=e.trim();if(!t||t===`./`||t===`.`)return`/`;let n=t.startsWith(`/`)?t:`/${t}`;return(n.endsWith(`/`)?n:`${n}/`).replace(/\/+/g,`/`)}function ip(e,t){return t===`/`?e||`/`:e===t.slice(0,-1)?`/`:e.startsWith(t)?e.slice(t.length-1)||`/`:e||`/`}function ap(e,t){if(t===`/`)return e||`/`;let n=e.startsWith(`/`)?e:`/${e}`;return n===`/`?t.slice(0,-1)||`/`:`${t.slice(0,-1)}${n}`}function op(e){if(typeof window>`u`)return e;let t=new URL(e,window.location.origin),n=rp(Bf());return t.pathname=ip(t.pathname,n),`${t.pathname}${t.search}${t.hash}`}function sp(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 cp(e){for(let t of Gf)if(e===t||e.startsWith(t+`/`))return t;return null}function lp(e,t){if(t===`pop`)return null;let n=t===`main`?e.mainLocation:e.bottomLocation,r=t===`main`?e.mainTabs:e.bottomTabs,i=cp(n.pathname);return i&&r.includes(i)?i:null}function up(e){return Jf.some(t=>e===t||e.startsWith(t+`/`))}function dp(e,t){if(up(t))return`pop`;let n=cp(t);return n&&e.bottomTabs.includes(n)?`bottom`:`main`}function fp(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 Gf)t.has(e)||(qf.includes(e)?r.push(e):n.push(e));return{mainTabs:n,bottomTabs:r}}function pp(e,t){if(t.length===0)return np(`/`);let n=cp(e.pathname);return n&&!t.includes(n)?np(`/`):e}function mp(e,t){if(t.length===0)return np(`/`);if(e.pathname===`/`)return np(`/`,e.state);let n=cp(e.pathname);return!n||!t.includes(n)?np(`/`):e}function hp(e){return e.pathname===`/`?np(`/`,e.state):up(e.pathname)?e:np(`/`)}function gp(e){let t=fp({mainTabs:e.mainTabs,bottomTabs:e.bottomTabs});return{...e,mainTabs:t.mainTabs,bottomTabs:t.bottomTabs,mainLocation:pp(e.mainLocation,t.mainTabs),bottomLocation:mp(e.bottomLocation,t.bottomTabs),popLocation:hp(e.popLocation)}}function _p(e,t){let n=new URL(e.href),r=rp(Bf());n.pathname=ip(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=np(`${n.pathname}${n.search}${n.hash}`,o?.main),c=np(i??`/`,o?.bottom),l=np(a??`/`,o?.pop);if(!i&&!a){let e=dp(t,s.pathname);e===`bottom`?(c=s,s=np(`/`,o?.main)):e===`pop`&&(l=s,s=np(`/`,o?.main))}return{main:pp(s,t.mainTabs),bottom:mp(c,t.bottomTabs),pop:hp(l)}}function vp(e){let t=new URL(window.location.href),n=new URL(e.mainLocation.href,window.location.origin),r=rp(Bf());return n.pathname=ap(n.pathname,r),sp(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 yp(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}function bp(){return{mainTabs:[...Kf],bottomTabs:[...qf],updatedAt:0,mainLocation:np(`/dashboard`),bottomLocation:np(`/`),popLocation:np(`/`)}}function xp(){try{let e=localStorage.getItem(Yf());return e?ep(JSON.parse(e)):null}catch{return null}}function Sp(e){try{let t=localStorage.getItem(e);return t?ep(JSON.parse(t)):null}catch{return null}}function Cp(e,t=Yf()){try{localStorage.setItem(t,JSON.stringify(e))}catch{}}var wp=[({prevState:e,nextState:t,event:n})=>{if(n.type!==`MOVE_TAB`)return t;let r=e.bottomTabs.includes(n.tabId)?`bottom`:`main`;if(lp(e,r)!==n.tabId)return t;let i=r===`main`?e.mainLocation:e.bottomLocation,a=np(i.href,i.state);return n.targetArea===`main`?{...t,mainLocation:a}:{...t,bottomLocation:a}},({nextState:e})=>e.mainTabs.length===0||lp(e,`main`)!=null?e:{...e,mainLocation:np(e.mainTabs[0])}];function Tp(e,t,n){let r=t;for(let t of wp)r=t({prevState:e,nextState:r,event:n});return r}function Ep(e,t){switch(t.type){case`NAVIGATE`:{let n=t.sourceArea===`pop`?`pop`:dp(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 cp((n===`main`?e.mainLocation:e.bottomLocation).pathname)===t.tabId&&(n===`main`?s=np(`/`):c=np(`/`)),{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 yp(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?cp(e.bottomLocation.pathname)===t.tabId?{nextState:{...e,bottomLocation:np(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`}:cp(e.mainLocation.pathname)===t.tabId?{nextState:{...e,mainLocation:np(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`}}case`ACTIVATE_BOTTOM`:return dp(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:np(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`};case`ACTIVATE_POP`:return dp(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:np(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`};case`APPLY_LAYOUT`:{let n=fp(t.layout);return!(t.layout.updatedAt!==e.updatedAt||!yp(e.mainTabs,n.mainTabs)||!yp(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 Dp(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 Op(e,t,n){let r=[...e];for(let e of[`main`,`bottom`,`pop`])Dp(t,n,e)&&(r.some(t=>t.area===e)||r.push({area:e,type:`REPLACE`}));return r}var kp=new class{mainHistory=null;bottomHistory=null;popHistory=null;state=bp();listeners=new Set;snapshotCache=null;persistTimer=null;kvUnsubscribe=null;initialized=!1;storageKey=typeof window>`u`?`nav-layout`:vf(`nav-layout`,window.location);constructor(){if(typeof window>`u`)return;let e=Lf()?null:xp();if(e!=null){let t=fp(e);this.state={...this.state,mainTabs:t.mainTabs,bottomTabs:t.bottomTabs,updatedAt:e.updatedAt}}let t=_p(window.location,this.state),n=gp({...this.state,mainLocation:t.main,bottomLocation:t.bottom,popLocation:t.pop});n=gp(Tp(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:np(op(t),n)})}replace(e,t,n){this.dispatch({type:`NAVIGATE`,sourceArea:e,action:`REPLACE`,location:np(op(t),n)})}createHref(e,t,n){if(typeof window>`u`)return t;let{nextState:r}=this.computeTransition({type:`NAVIGATE`,sourceArea:e,action:`PUSH`,location:np(op(t),n)});return vp(r)}get mainTabs(){return this.state.mainTabs}get bottomTabs(){return this.state.bottomTabs}getAreaForPath(e){return dp(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:np(e)})}deactivateBottom(){this.dispatch({type:`DEACTIVATE_BOTTOM`})}activatePop(e){this.dispatch({type:`ACTIVATE_POP`,location:np(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=cp(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||Lf())){this.initialized=!0;try{let e=await this.resolveProjectScopedStorageKey();e&&e!==this.storageKey&&(this.storageKey=e,this.rebindProjectScopedLayout(e));let{trpcClient:t}=await Z(async()=>{let{trpcClient:e}=await import(`./trpc-CHrTaCNa.js`);return{trpcClient:e}},__vite__mapDeps([0,1,2])),n=ep(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=ep(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=_p(window.location,this.state);this.dispatch({type:`POPSTATE`,mainLocation:e.main,bottomLocation:e.bottom,popLocation:e.pop})};computeTransition(e){let t=Ep(this.state,e);if(!t.changed)return{transition:t,nextState:this.state};let n=Tp(this.state,t.nextState,e);return n=gp(n),{transition:t,nextState:n}}dispatch(e){if(typeof window<`u`&&e.type!==`POPSTATE`&&this.mainHistory==null){let e=_p(window.location,this.state);this.state=gp({...this.state,mainLocation:e.main,bottomLocation:e.bottom,popLocation:e.pop})}let t=Ep(this.state,e);if(!t.changed)return;let n=this.state,r=Tp(n,t.nextState,e);r=gp(r),this.state=r,t.persist===`local_and_remote`?this.persistLayout():t.persist===`local_only`&&(this.cancelPersistTimer(),Cp({mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:this.state.updatedAt},this.storageKey));let i=t.urlAction??(Dp(n,this.state,`main`)||Dp(n,this.state,`bottom`)||Dp(n,this.state,`pop`)?`REPLACE`:void 0);i&&this.syncToUrl(i);let a=Op(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=vp(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=vp(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},Cp({mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:e},this.storageKey),this.cancelPersistTimer(),this.persistTimer=setTimeout(()=>{this.persistTimer=null,Z(async()=>{let{trpcClient:e}=await import(`./trpc-CHrTaCNa.js`);return{trpcClient:e}},__vite__mapDeps([0,1,2])).then(({trpcClient:t})=>t.kv.set.mutate({key:this.storageKey,value:{mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:e}})).catch(()=>{})},Zf)}async resolveProjectScopedStorageKey(){try{let e=await Ff(Tf());if(!e.ok)return null;let t=await e.json();return typeof t.projectDir!=`string`||t.projectDir.length===0?null:Xf(t.projectDir)}catch{return null}}rebindProjectScopedLayout(e){let t=Sp(e);if(t){this.dispatch({type:`APPLY_LAYOUT`,layout:t,force:!0});return}this.state=gp({...this.state,updatedAt:0}),this.normalizeUrl(),this.notifyListeners()}};typeof window<`u`&&!Lf()&&kp.init();function Ap(){return(0,V.useSyncExternalStore)(e=>kp.subscribe(e),()=>kp.getSnapshot(),()=>kp.getSnapshot())}var jp=`gitScope`;function dee(e){return new URLSearchParams(e).get(`gitScope`)===`planning`?`planning`:`code`}function Mp(e){return e.type===`commit`?e.hash:`uncommitted`}function fee(e,t,n=``){let r=new URLSearchParams(n);t===`planning`?r.set(jp,t):r.delete(jp);let i=r.toString();return`${e}${i?`?${i}`:``}`}function pee(e,t,n){return n.type===`commit`?[`git`,e,t,`meta`,`commit`,n.hash]:[`git`,e,t,`meta`,`uncommitted`]}function mee(e){return e.type===`commit`?{type:`commit`,hash:e.hash}:{type:`uncommitted`}}function hee(e,t=`code`,n=``){return fee(e.type===`commit`?`/git/commit/${e.hash}`:`/git/uncommitted`,t,n)}function gee(e,t=`code`,n=``){return hee(mee(e),t,n)}var _ee={"7d":7,"30d":30,"90d":90,all:null},vee=/^(\d{4})-(\d{2})-(\d{2})(?:-|$)/;function Np(e){let t=vee.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 Pp(e){return Np(e.id)??e.updatedAt}function yee(e,t,n=Date.now()){let r=_ee[t];return r===null?!0:Pp(e)>=n-r*24*60*60*1e3}function bee(e,t){return t.updatedAt-e.updatedAt||e.id.localeCompare(t.id)}function xee(e){return[...e].sort(bee)}function See(e,t=10){return xee(e).slice(0,Math.max(0,Math.trunc(t)))}function Cee(e,t=10){return[...e].sort((e,t)=>Pp(t)-Pp(e)||e.id.localeCompare(t.id)).slice(0,Math.max(0,Math.trunc(t)))}var wee=[`timeout`,`memory-limit`,`runtime`,`abort`];async function Tee(e,t={}){let n=new AbortController,r=[],i=t.signal,a=Dee(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:Eee(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:Eee(e,i)}}finally{o&&clearTimeout(o),r.forEach(e=>e())}}function Eee(e,t){if(Mee(e))return e;if(t?.aborted)return{kind:`abort`,message:kee(t.reason)??`Translation cancelled.`};if(e instanceof DOMException&&e.name===`AbortError`)return{kind:`abort`,message:kee(e)??`Translation cancelled.`};let n=Oee(e);return Aee(n)?{kind:`timeout`,message:n}:jee(n)?{kind:`memory-limit`,message:n}:{kind:`runtime`,message:n}}function Dee(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.floor(e):void 0}function Oee(e){return e instanceof Error&&e.message.trim().length>0?e.message:typeof e==`string`&&e.trim().length>0?e:`Translation failed.`}function kee(e){if(e instanceof Error&&e.message.trim().length>0)return e.message;if(typeof e==`string`&&e.trim().length>0)return e}function Aee(e){return/\btime(?:d)?\s*out\b/i.test(e)}function jee(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 Mee(e){if(typeof e!=`object`||!e)return!1;let t=Reflect.get(e,`kind`),n=Reflect.get(e,`message`);return typeof t==`string`&&wee.includes(t)&&typeof n==`string`&&n.length>0}var Fp=_d([`browser`,`local`,`local-ct2`,`local-llama`,`openai`]),Ip=`browser`;function Lp(e){return e===`local`||e===`local-ct2`||e===`local-llama`}function Rp(e){return e===`local`||e===`local-ct2`}_d([`local`,`local-ct2`,`local-llama`,`openai`]);var zp=15e3,Bp=_d([`not-downloaded`,`queued`,`downloading`,`paused`,`downloaded`,`error`,`deleting`]),Vp=Y({path:K().min(1),sizeBytes:q().int().nonnegative().optional(),required:cd(),etag:K().min(1).optional(),revision:K().min(1).optional(),sourceUrl:K().min(1).optional(),raw:dd().optional()}),Nee=Y({id:K().min(1),label:K().min(1),description:K().optional(),profile:K().min(1).optional(),dtype:K().min(1).optional(),estimatedTotalBytes:q().int().nonnegative().optional(),baseGroupId:K().min(1).optional(),commitHash:K().min(1).optional(),shortCommitHash:K().min(1).optional(),rootDir:K().min(1).optional(),status:Bp.optional(),progress:q().min(0).max(1).optional(),bytesDownloaded:q().int().nonnegative().optional(),totalBytes:q().int().nonnegative().optional(),resumable:cd().optional(),error:K().optional(),selectable:cd(),selected:cd(),files:J(Vp)}),Pee=_d([`idle`,`loading`,`ready`,`error`]),Fee=Y({path:K().min(1),sizeBytes:q().int().nonnegative().optional(),required:cd(),etag:K().min(1).optional(),revision:K().min(1).optional(),sourceUrl:K().min(1).optional(),raw:dd().optional()}),Iee=Y({id:K().min(1),baseGroupId:K().min(1),label:K().min(1),displayLabel:K().min(1),description:K().optional(),profile:K().min(1).optional(),dtype:K().min(1).optional(),commitHash:K().min(1),shortCommitHash:K().min(1),rootDir:K().min(1),estimatedTotalBytes:q().int().nonnegative().optional(),selectable:cd(),files:J(Fee)}),Lee=Y({modelId:K().min(1),source:X(`huggingface`),endpoint:K().default(``),revision:K().min(1),commitHash:K().min(1),shortCommitHash:K().min(1),fetchedAt:q().int().nonnegative(),updatedAt:q().int().nonnegative(),raw:dd().optional(),groups:hd(K(),Iee).default({}),groupOrder:J(K().min(1)).default([])}),Ree=Y({path:K().min(1),sizeBytes:q().int().nonnegative().optional(),downloadedBytes:q().int().nonnegative().optional(),required:cd().default(!0),status:Bp.default(`not-downloaded`),updatedAt:q().int().nonnegative().optional(),error:K().optional()}),zee=Y({groupId:K().min(1),baseGroupId:K().min(1).optional(),status:Bp.default(`not-downloaded`),rootDir:K().min(1).optional(),bytesDownloaded:q().int().nonnegative().optional(),totalBytes:q().int().nonnegative().optional(),progress:q().min(0).max(1).optional(),resumable:cd().default(!1),error:K().optional(),installedAt:q().int().nonnegative().optional(),updatedAt:q().int().nonnegative().optional(),files:J(Ree).default([])}),Hp=Y({status:Pee.default(`idle`),message:K().optional(),error:K().optional(),updatedAt:q().int().nonnegative().optional()});Y({engineId:_d([`local`,`local-ct2`,`local-llama`]),modelId:K().min(1),selectedGroupId:K().min(1).optional(),groupId:K().min(1).optional(),status:Bp,message:K(),progress:q().min(0).max(1).optional(),bytesDownloaded:q().int().nonnegative().optional(),totalBytes:q().int().nonnegative().optional(),sessionId:K().optional(),resumable:cd().optional(),files:J(Y({path:K().min(1),sizeBytes:q().int().nonnegative().optional(),downloadedBytes:q().int().nonnegative().optional()})).optional(),updatedAt:q().int().nonnegative()});var Bee=Y({modelId:K().min(1),estimatedTotalBytes:q().int().nonnegative().optional(),files:J(Vp),profile:K().min(1).optional(),selectedGroupId:K().min(1).optional(),groups:J(Nee).optional()});Y({modelId:K().min(1),version:X(2).default(2),status:Bp.default(`not-downloaded`),selected:cd().default(!1),selectedGroupId:K().min(1).optional(),installedAt:q().int().nonnegative().optional(),updatedAt:q().int().nonnegative().optional(),bytesDownloaded:q().int().nonnegative().optional(),totalBytes:q().int().nonnegative().optional(),progress:q().min(0).max(1).optional(),resumable:cd().default(!1),error:K().optional(),profileLoad:Hp.default(Hp.parse({})),profileManifest:Lee.optional(),groupsState:hd(K(),zee).default({}),plan:Bee.optional(),files:J(Y({path:K().min(1),sizeBytes:q().int().nonnegative().optional(),downloadedBytes:q().int().nonnegative().optional()})).default([])}),_d([`local`,`network`,`recommended`]);var Vee=_d([`installed`,`installing`,`missing`,`error`,`not-applicable`]),Hee=_d([`ready`,`probing`,`failed`,`error`,`not-applicable`]),Uee=_d([`ready`,`missing`,`downloading`,`error`,`not-applicable`]),Up=Y({message:K().optional(),progress:q().min(0).max(1).optional(),error:K().optional()}),Wp=Y({dependency:Up.extend({state:Vee}),runtime:Up.extend({state:Hee}),assets:Up.extend({state:Uee}),summary:K().optional()});function Wee(e){return e.dependency.state===`installed`||e.dependency.state===`not-applicable`}function Gee(e){return e.runtime.state===`ready`||e.runtime.state===`not-applicable`}function Gp(e){return e?!Wee(e)||!Gee(e):!1}function Kee(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 Kp=_d([`stdout`,`stderr`]);Y({stream:Kp,text:K()}),pd(`type`,[Y({type:X(`status`),lifecycle:Wp}),Y({type:X(`log`),stream:Kp,text:K()}),Y({type:X(`exit`),lifecycle:Wp})]);var qp=Y({baseUrl:K().default(``),token:K().default(``),model:K().default(`gpt-4.1-mini`)}),qee=Y({baseUrl:K().optional(),token:K().optional(),model:K().optional()}),Jp=Y({model:K().default(`Xenova/nllb-200-distilled-600M`),selectedGroupId:K().optional(),hfEndpoint:K().default(``),memoryBudgetPercent:q().min(0).max(100).default(25)}),Jee=Y({model:K().min(1).optional(),selectedGroupId:K().min(1).nullable().optional(),hfEndpoint:K().optional(),memoryBudgetPercent:q().min(0).max(100).optional()}),Yp=Y({model:K().default(`ooeoeo/opus-mt-en-zh-ct2-float16`),selectedGroupId:K().optional(),hfEndpoint:K().default(``),memoryBudgetPercent:q().min(0).max(100).default(25)}),Yee=Y({model:K().min(1).optional(),selectedGroupId:K().min(1).nullable().optional(),hfEndpoint:K().optional(),memoryBudgetPercent:q().min(0).max(100).optional()}),Xp=Y({model:K().default(`bartowski/Qwen2.5-0.5B-Instruct-GGUF`),selectedGroupId:K().optional(),hfEndpoint:K().default(``),memoryBudgetPercent:q().min(0).max(100).default(25)}),Xee=Y({model:K().min(1).optional(),selectedGroupId:K().min(1).nullable().optional(),hfEndpoint:K().optional(),memoryBudgetPercent:q().min(0).max(100).optional()});Y({engineId:Fp.default(Ip),openai:qp.default(qp.parse({})),local:Jp.default(Jp.parse({})),localCt2:Yp.default(Yp.parse({})),localLlama:Xp.default(Xp.parse({}))}),Y({engineId:Fp.optional(),openai:qee.optional(),local:Jee.optional(),localCt2:Yee.optional(),localLlama:Xee.optional()}),Y({engineId:Fp,sourceLanguage:K().min(1),targetLanguage:K().min(1),model:K().min(1).optional(),selectedGroupId:K().min(1).optional(),inputs:J(K()).min(1),instructions:K().optional(),context:K().optional(),timeoutMs:q().int().positive().default(zp)}),Y({index:q().int().nonnegative(),output:K().optional(),error:Y({kind:_d(wee),message:K().min(1)}).optional()});var Zp=_d([`direct`,`bilingual`]),Zee=Y({local:Y({model:K().min(1).optional(),selectedGroupId:K().min(1).optional()}).default({}),localCt2:Y({model:K().min(1).optional(),selectedGroupId:K().min(1).optional()}).default({}),localLlama:Y({model:K().min(1).optional(),selectedGroupId:K().min(1).optional()}).default({}),openai:Y({model:K().min(1).optional()}).default({})}).default({}),Qee=Y({local:Y({model:K().min(1).optional(),selectedGroupId:K().min(1).nullable().optional()}).optional(),localCt2:Y({model:K().min(1).optional(),selectedGroupId:K().min(1).nullable().optional()}).optional(),localLlama:Y({model:K().min(1).optional(),selectedGroupId:K().min(1).nullable().optional()}).optional(),openai:Y({model:K().min(1).optional()}).optional()}),Qp=Y({enabled:cd().default(!1),targetLanguage:K().min(1).default(`zh`),displayMode:Zp.default(`direct`),cacheEnabled:cd().default(!1),engineId:Fp.default(Ip),engines:Zee});Y({enabled:cd().optional(),targetLanguage:K().min(1).optional(),displayMode:Zp.optional(),cacheEnabled:cd().optional(),engineId:Fp.optional(),engines:Qee.optional()});var $ee=1e4,$p=2e5;Y({entryLimit:q().int().min(100).max($p).default($ee)}),Y({entryLimit:q().int().min(100).max($p).optional()}),Y({key:K().min(1),keyHash:K().min(1),sourceText:K(),translatedText:K(),targetNodesJson:K().optional(),sourceLanguage:K().min(1),targetLanguage:K().min(1),placeholderTopologyHash:K().min(1),attributeTopologyHash:K().min(1),displayPolicyVersion:q().int().positive(),engineId:Fp.default(Ip),engineVersion:K().optional(),model:K().optional(),translatorContractVersion:q().int().positive().default(1),createdAt:q().int().nonnegative(),lastAccessedAt:q().int().nonnegative()}).omit({createdAt:!0,lastAccessedAt:!0}),Y({keyHash:K().min(1)}),Y({enabled:cd(),entryLimit:q().int().positive(),entries:q().int().nonnegative(),databasePath:K().optional()});var ete=`project`,tte=/^[A-Za-z]:\//;function em(e){return e.replace(/\\/g,`/`).replace(/\/+$/g,``)}function nte(e){return e.startsWith(`/`)||tte.test(e)}function rte(e){return e.replace(/^\.?\//,``)}function tm(e){return em(e).split(`/`).filter(Boolean)}function ite(e){let t=em(e),n=/(?:^|\/)node_modules\/(?:\.pnpm\/[^/]+\/node_modules\/)?(@[^/]+\/[^/]+|[^/]+)(\/.*)?/.exec(t),r=n?.[1];return r?`npm:${r}${n[2]??``}`:null}function nm(e){return`${ete}:${rte(e)}`}function ate(e,t){let n=em(e),r=em(t),i=n.toLowerCase(),a=r.toLowerCase();return a===i||a.startsWith(`${i}/`)}function ote(e,t){let n=tm(e),r=tm(t),i=0;for(;i<n.length&&i<r.length&&n[i]?.toLowerCase()===r[i]?.toLowerCase();)i+=1;return r.slice(i).join(`/`)}function ste(e){let t=tm(e),n=t.lastIndexOf(`openspec`);return n<0?null:t.slice(n).join(`/`)}function rm(e,t){let n=em(e),r=ite(n);return(t?.source===`package`||r)&&r?r:nte(n)?t?.projectDir&&ate(t.projectDir,n)?nm(ote(t.projectDir,n)):nm(ste(n)||tm(n).slice(-4).join(`/`)):nm(n)}var im=Symbol.for(`yaml.alias`),am=Symbol.for(`yaml.document`),om=Symbol.for(`yaml.map`),sm=Symbol.for(`yaml.pair`),cm=Symbol.for(`yaml.scalar`),lm=Symbol.for(`yaml.seq`),um=Symbol.for(`yaml.node.type`),dm=e=>!!e&&typeof e==`object`&&e[um]===im,fm=e=>!!e&&typeof e==`object`&&e[um]===am,pm=e=>!!e&&typeof e==`object`&&e[um]===om,mm=e=>!!e&&typeof e==`object`&&e[um]===sm,hm=e=>!!e&&typeof e==`object`&&e[um]===cm,gm=e=>!!e&&typeof e==`object`&&e[um]===lm;function _m(e){if(e&&typeof e==`object`)switch(e[um]){case om:case lm:return!0}return!1}function vm(e){if(e&&typeof e==`object`)switch(e[um]){case im:case om:case cm:case lm:return!0}return!1}var ym=e=>(hm(e)||_m(e))&&!!e.anchor,bm=Symbol(`break visit`),xm=Symbol(`skip children`),Sm=Symbol(`remove node`);function Cm(e,t){let n=Dm(t);fm(e)?wm(null,e.contents,n,Object.freeze([e]))===Sm&&(e.contents=null):wm(null,e,n,Object.freeze([]))}Cm.BREAK=bm,Cm.SKIP=xm,Cm.REMOVE=Sm;function wm(e,t,n,r){let i=Om(e,t,n,r);if(vm(i)||mm(i))return km(e,r,i),wm(e,i,n,r);if(typeof i!=`symbol`){if(_m(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=wm(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===bm)return bm;else i===Sm&&(t.items.splice(e,1),--e)}}else if(mm(t)){r=Object.freeze(r.concat(t));let e=wm(`key`,t.key,n,r);if(e===bm)return bm;e===Sm&&(t.key=null);let i=wm(`value`,t.value,n,r);if(i===bm)return bm;i===Sm&&(t.value=null)}}return i}async function Tm(e,t){let n=Dm(t);fm(e)?await Em(null,e.contents,n,Object.freeze([e]))===Sm&&(e.contents=null):await Em(null,e,n,Object.freeze([]))}Tm.BREAK=bm,Tm.SKIP=xm,Tm.REMOVE=Sm;async function Em(e,t,n,r){let i=await Om(e,t,n,r);if(vm(i)||mm(i))return km(e,r,i),Em(e,i,n,r);if(typeof i!=`symbol`){if(_m(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await Em(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===bm)return bm;else i===Sm&&(t.items.splice(e,1),--e)}}else if(mm(t)){r=Object.freeze(r.concat(t));let e=await Em(`key`,t.key,n,r);if(e===bm)return bm;e===Sm&&(t.key=null);let i=await Em(`value`,t.value,n,r);if(i===bm)return bm;i===Sm&&(t.value=null)}}return i}function Dm(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 Om(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(pm(t))return n.Map?.(e,t,r);if(gm(t))return n.Seq?.(e,t,r);if(mm(t))return n.Pair?.(e,t,r);if(hm(t))return n.Scalar?.(e,t,r);if(dm(t))return n.Alias?.(e,t,r)}function km(e,t,n){let r=t[t.length-1];if(_m(r))r.items[e]=n;else if(mm(r))e===`key`?r.key=n:r.value=n;else if(fm(r))r.contents=n;else{let e=dm(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var cte={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},lte=e=>e.replace(/[!,[\]{}]/g,e=>cte[e]),Am=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+lte(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&&vm(e.contents)){let t={};Cm(e.contents,(e,n)=>{vm(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(`
|
|
47
47
|
`)}};Am.defaultYaml={explicit:!1,version:`1.2`},Am.defaultTags={"!!":`tag:yaml.org,2002:`};function ute(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 dte(e){let t=new Set;return Cm(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function fte(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function pte(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=dte(e);let a=fte(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(hm(t.node)||_m(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 jm(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=jm(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=jm(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=jm(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=jm(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function Mm(e,t,n){if(Array.isArray(e))return e.map((e,t)=>Mm(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!ym(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 Nm=class{constructor(e){Object.defineProperty(this,um,{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(!fm(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=Mm(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?jm(i,{"":o},``,o):o}},Pm=class extends Nm{constructor(e){super(im),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=[],Cm(e,{Node:(e,t)=>{(dm(t)||ym(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||=(Mm(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=Fm(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(ute(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 Fm(e,t,n){if(dm(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(_m(t)){let r=0;for(let i of t.items){let t=Fm(e,i,n);t>r&&(r=t)}return r}else if(mm(t)){let r=Fm(e,t.key,n),i=Fm(e,t.value,n);return Math.max(r,i)}return 1}var mte=e=>!e||typeof e!=`function`&&typeof e!=`object`,Im=class extends Nm{constructor(e){super(cm),this.value=e}toJSON(e,t){return t?.keep?this.value:Mm(this.value,e,t)}toString(){return String(this.value)}};Im.BLOCK_FOLDED=`BLOCK_FOLDED`,Im.BLOCK_LITERAL=`BLOCK_LITERAL`,Im.PLAIN=`PLAIN`,Im.QUOTE_DOUBLE=`QUOTE_DOUBLE`,Im.QUOTE_SINGLE=`QUOTE_SINGLE`;var hte=`tag:yaml.org,2002:`;function gte(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 Lm(e,t,n){if(fm(e)&&(e=e.contents),vm(e))return e;if(mm(e)){let t=n.schema[om].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 Pm(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=hte+t.slice(2));let l=gte(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new Im(e);return c&&(c.node=t),t}l=e instanceof Map?o[om]:Symbol.iterator in Object(e)?o[lm]:o[om]}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 Im(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Rm(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 Lm(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var zm=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,_te=class extends Nm{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=>vm(t)||mm(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(zm(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(_m(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Rm(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(_m(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&&hm(i)?i.value:i:_m(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!mm(t))return!1;let n=t.value;return n==null||e&&hm(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 _m(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(_m(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,Rm(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},vte=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function Bm(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Vm=(e,t,n)=>e.endsWith(`
|
|
48
48
|
`)?Bm(n,t):n.includes(`
|
|
49
49
|
`)?`
|
|
@@ -766,7 +766,7 @@ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){t
|
|
|
766
766
|
@pointerdown=${e=>this._onResizeStart(e,`br`)}
|
|
767
767
|
></div>
|
|
768
768
|
<div class="panel-body">${e}</div>
|
|
769
|
-
</dialog>`:e}};customElements.define(`input-panel`,Hge);var Uge={extension:{type:R.Environment,name:`browser`,priority:-1},test:()=>!0,load:async()=>{await Z(()=>import(`./browserAll-C88S5YfV.js`),__vite__mapDeps([3,4,2,5]))}},Wge={extension:{type:R.Environment,name:`webworker`,priority:0},test:()=>typeof self<`u`&&self.WorkerGlobalScope!==void 0,load:async()=>{await Z(()=>import(`./webworkerAll-DFRsQGYS.js`),__vite__mapDeps([6,4,2,5]))}},Gge=new C;function rj(e,t,n){let r=Gge;e.measurable=!0,ie(e,n,r),t.addBoundsMask(r),e.measurable=!1}function ij(e,t,n){let r=c.get();e.measurable=!0;let i=re.get().identity();w(e,r,aj(e,n,i)),e.measurable=!1,t.addBoundsMask(r),re.return(i),c.return(r)}function aj(e,t,n){return e?(e!==t&&(aj(e.parent,t,n),e.updateLocalTransform(),n.append(e.localTransform)),n):(h(`Mask bounds, renderable is not inside the root container`),n)}var oj=class{constructor(e){this.priority=0,this.inverse=!1,this.pipe=`alphaMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof ye),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(e,t){this.inverse||rj(this.mask,e,t)}addLocalBounds(e,t){ij(this.mask,e,t)}containsPoint(e,t){let n=this.mask;return t(n,e)}destroy(){this.reset()}static test(e){return e instanceof ye}};oj.extension=R.MaskEffect;var sj=class{constructor(e){this.priority=0,this.pipe=`colorMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e}destroy(){}static test(e){return typeof e==`number`}};sj.extension=R.MaskEffect;var cj=class{constructor(e){this.priority=0,this.pipe=`stencilMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(e,t){rj(this.mask,e,t)}addLocalBounds(e,t){ij(this.mask,e,t)}containsPoint(e,t){let n=this.mask;return t(n,e)}destroy(){this.reset()}static test(e){return e instanceof ve}};cj.extension=R.MaskEffect;var lj;async function Kge(){return lj??=(async()=>{let e=ge.get().createCanvas(1,1).getContext(`webgl`);if(!e)return`premultiply-alpha-on-upload`;let t=await new Promise(e=>{let t=document.createElement(`video`);t.onloadeddata=()=>e(t),t.onerror=()=>e(null),t.autoplay=!1,t.crossOrigin=`anonymous`,t.preload=`auto`,t.src=`data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=`,t.load()});if(!t)return`premultiply-alpha-on-upload`;let n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);let r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t);let i=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,i),e.deleteFramebuffer(r),e.deleteTexture(n),e.getExtension(`WEBGL_lose_context`)?.loseContext(),i[0]<=i[3]?`premultiplied-alpha`:`premultiply-alpha-on-upload`})(),lj}var uj=class e extends T{constructor(t){super(t),this.isReady=!1,this.uploadMethodId=`video`,t={...e.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??`premultiply-alpha-on-upload`,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){let e=I.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;let e=this.resource,t=this.options;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener(`play`,this._onPlayStart),e.addEventListener(`pause`,this._onPlayStop),e.addEventListener(`seeked`,this._onSeeked),this._isSourceReady()?this._mediaReady():(t.preload||e.addEventListener(`canplay`,this._onCanPlay),e.addEventListener(`canplaythrough`,this._onCanPlayThrough),e.addEventListener(`error`,this._onError,!0)),this.alphaMode=await Kge(),this._load=new Promise((n,r)=>{this.isValid?n(this):(this._resolve=n,this._reject=r,t.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${t.preloadTimeoutMs}ms`))})),e.load())}),this._load}_onError(e){this.resource.removeEventListener(`error`,this._onError,!0),this.emit(`error`,e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){let e=this.resource;return!e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener(`canplay`,this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener(`canplaythrough`,this._onCanPlay),this._preloadTimeout&&=(clearTimeout(this._preloadTimeout),void 0),this._mediaReady()}_mediaReady(){let e=this.resource;this.isValid&&(this.isReady=!0,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();let e=this.resource;e&&(e.removeEventListener(`play`,this._onPlayStart),e.removeEventListener(`pause`,this._onPlayStop),e.removeEventListener(`seeked`,this._onSeeked),e.removeEventListener(`canplay`,this._onCanPlay),e.removeEventListener(`canplaythrough`,this._onCanPlayThrough),e.removeEventListener(`error`,this._onError,!0),e.pause(),e.src=``,e.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(I.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(I.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(I.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};uj.extension=R.TextureSource,uj.defaultOptions={...T.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1},uj.MIME_TYPES={ogv:`video/ogg`,mov:`video/quicktime`,m4v:`video/mp4`};var qge=uj,dj=(e,t,n=!1)=>(Array.isArray(e)||(e=[e]),t?e.map(e=>typeof e==`string`||n?t(e):e):e),fj=new class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){let t=this._cache.get(e);return t||h(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){let n=dj(e),r;for(let e=0;e<this.parsers.length;e++){let i=this.parsers[e];if(i.test(t)){r=i.getCacheableAssets(n,t);break}}let i=new Map(Object.entries(r||{}));r||n.forEach(e=>{i.set(e,t)});let a=[...i.keys()],o={cacheKeys:a,keys:n};n.forEach(e=>{this._cacheMap.set(e,o)}),a.forEach(e=>{let n=r?r[e]:t;this._cache.has(e)&&this._cache.get(e)!==n&&h(`[Cache] already has key:`,e),this._cache.set(e,i.get(e))})}remove(e){if(!this._cacheMap.has(e)){h(`[Assets] Asset id ${e} was not found in the Cache`);return}let t=this._cacheMap.get(e);t.cacheKeys.forEach(e=>{this._cache.delete(e)}),t.keys.forEach(e=>{this._cacheMap.delete(e)})}get parsers(){return this._parsers}},pj=[];L.handleByList(R.TextureSource,pj);function mj(e={}){let t=e&&e.resource,n=t?e.resource:e,r=t?e:{resource:e};for(let e=0;e<pj.length;e++){let t=pj[e];if(t.test(n))return new t(r)}throw Error(`Could not find a source type for resource: ${r.resource}`)}function Jge(e={},t=!1){let n=e&&e.resource,r=n?e.resource:e,i=n?e:{resource:e};if(!t&&fj.has(r))return fj.get(r);let a=new l({source:mj(i)});return a.on(`destroy`,()=>{fj.has(r)&&fj.remove(r)}),t||fj.set(r,a),a}function Yge(e,t=!1){return typeof e==`string`?fj.get(e):e instanceof T?new l({source:e}):Jge(e,t)}l.from=Yge,T.from=mj,L.add(oj,sj,cj,qge,xe,A,m);var hj=(e=>(e[e.Low=0]=`Low`,e[e.Normal=1]=`Normal`,e[e.High=2]=`High`,e))(hj||{});function gj(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received ${JSON.stringify(e)}`)}function _j(e){return e.split(`?`)[0].split(`#`)[0]}function Xge(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Zge(e,t,n){return e.replace(new RegExp(Xge(t),`g`),n)}function Qge(e,t){let n=``,r=0,i=-1,a=0,o=-1;for(let s=0;s<=e.length;++s){if(s<e.length)o=e.charCodeAt(s);else if(o===47)break;else o=47;if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){let e=n.lastIndexOf(`/`);if(e!==n.length-1){e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}}else if(n.length===2||n.length===1){n=``,r=0,i=s,a=0;continue}}t&&(n.length>0?n+=`/..`:n=`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a!==-1?++a:a=-1}return n}var vj={toPosix(e){return Zge(e,`\\`,`/`)},isUrl(e){return/^https?:/.test(this.toPosix(e))},isDataUrl(e){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(e)},isBlobUrl(e){return e.startsWith(`blob:`)},hasProtocol(e){return/^[^/:]+:/.test(this.toPosix(e))},getProtocol(e){gj(e),e=this.toPosix(e);let t=/^file:\/\/\//.exec(e);if(t)return t[0];let n=/^[^/:]+:\/{0,2}/.exec(e);return n?n[0]:``},toAbsolute(e,t,n){if(gj(e),this.isDataUrl(e)||this.isBlobUrl(e))return e;let r=_j(this.toPosix(t??ge.get().getBaseUrl())),i=_j(this.toPosix(n??this.rootname(r)));return e=this.toPosix(e),e.startsWith(`/`)?vj.join(i,e.slice(1)):this.isAbsolute(e)?e:this.join(r,e)},normalize(e){if(gj(e),e.length===0)return`.`;if(this.isDataUrl(e)||this.isBlobUrl(e))return e;e=this.toPosix(e);let t=``,n=e.startsWith(`/`);this.hasProtocol(e)&&(t=this.rootname(e),e=e.slice(t.length));let r=e.endsWith(`/`);return e=Qge(e,!1),e.length>0&&r&&(e+=`/`),n?`/${e}`:t+e},isAbsolute(e){return gj(e),e=this.toPosix(e),this.hasProtocol(e)?!0:e.startsWith(`/`)},join(...e){if(e.length===0)return`.`;let t;for(let n=0;n<e.length;++n){let r=e[n];if(gj(r),r.length>0)if(t===void 0)t=r;else{let i=e[n-1]??``;this.joinExtensions.includes(this.extname(i).toLowerCase())?t+=`/../${r}`:t+=`/${r}`}}return t===void 0?`.`:this.normalize(t)},dirname(e){if(gj(e),e.length===0)return`.`;e=this.toPosix(e);let t=e.charCodeAt(0),n=t===47,r=-1,i=!0,a=this.getProtocol(e),o=e;e=e.slice(a.length);for(let n=e.length-1;n>=1;--n)if(t=e.charCodeAt(n),t===47){if(!i){r=n;break}}else i=!1;return r===-1?n?`/`:this.isUrl(o)?a+e:a:n&&r===1?`//`:a+e.slice(0,r)},rootname(e){gj(e),e=this.toPosix(e);let t=``;if(t=e.startsWith(`/`)?`/`:this.getProtocol(e),this.isUrl(e)){let n=e.indexOf(`/`,t.length);t=n===-1?e:e.slice(0,n),t.endsWith(`/`)||(t+=`/`)}return t},basename(e,t){gj(e),t&&gj(t),e=_j(this.toPosix(e));let n=0,r=-1,i=!0,a;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;let o=t.length-1,s=-1;for(a=e.length-1;a>=0;--a){let c=e.charCodeAt(a);if(c===47){if(!i){n=a+1;break}}else s===-1&&(i=!1,s=a+1),o>=0&&(c===t.charCodeAt(o)?--o===-1&&(r=a):(o=-1,r=s))}return n===r?r=s:r===-1&&(r=e.length),e.slice(n,r)}for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===47){if(!i){n=a+1;break}}else r===-1&&(i=!1,r=a+1);return r===-1?``:e.slice(n,r)},extname(e){gj(e),e=_j(this.toPosix(e));let t=-1,n=0,r=-1,i=!0,a=0;for(let o=e.length-1;o>=0;--o){let s=e.charCodeAt(o);if(s===47){if(!i){n=o+1;break}continue}r===-1&&(i=!1,r=o+1),s===46?t===-1?t=o:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||r===-1||a===0||a===1&&t===r-1&&t===n+1?``:e.slice(t,r)},parse(e){gj(e);let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;e=_j(this.toPosix(e));let n=e.charCodeAt(0),r=this.isAbsolute(e),i;t.root=this.rootname(e),i=r||this.hasProtocol(e)?1:0;let a=-1,o=0,s=-1,c=!0,l=e.length-1,u=0;for(;l>=i;--l){if(n=e.charCodeAt(l),n===47){if(!c){o=l+1;break}continue}s===-1&&(c=!1,s=l+1),n===46?a===-1?a=l:u!==1&&(u=1):a!==-1&&(u=-1)}return a===-1||s===-1||u===0||u===1&&a===s-1&&a===o+1?s!==-1&&(o===0&&r?t.base=t.name=e.slice(1,s):t.base=t.name=e.slice(o,s)):(o===0&&r?(t.name=e.slice(1,a),t.base=e.slice(1,s)):(t.name=e.slice(o,a),t.base=e.slice(o,s)),t.ext=e.slice(a,s)),t.dir=this.dirname(e),t},sep:`/`,delimiter:`:`,joinExtensions:[`.html`]};function yj(e,t,n,r,i){let a=t[n];for(let o=0;o<a.length;o++){let s=a[o];n<t.length-1?yj(e.replace(r[n],s),t,n+1,r,i):i.push(e.replace(r[n],s))}}function $ge(e){let t=e.match(/\{(.*?)\}/g),n=[];if(t){let r=[];t.forEach(e=>{let t=e.substring(1,e.length-1).split(`,`);r.push(t)}),yj(e,r,0,t,n)}else n.push(e);return n}var bj=e=>!Array.isArray(e),xj=class{constructor(){this._defaultBundleIdentifierOptions={connector:`-`,createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${this._bundleIdConnector}`,``)},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle(`foo`,this._createBundleAssetId(`foo`,`bar`))!==`bar`)throw Error(`[Resolver] GenerateBundleAssetId are not working correctly`)}prefer(...e){e.forEach(e=>{this._preferredOrder.push(e),e.priority||=Object.keys(e.params)}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e==`string`)this._defaultSearchParams=e;else{let t=e;this._defaultSearchParams=Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join(`&`)}}getAlias(e){let{alias:t,src:n}=e;return dj(t||n,e=>typeof e==`string`?e:Array.isArray(e)?e.map(e=>e?.src??e):e?.src?e.src:e,!0)}addManifest(e){this._manifest&&h(`[Resolver] Manifest already exists, this will be overwritten`),this._manifest=e,e.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(e,t){let n=[],r=t;Array.isArray(t)||(r=Object.entries(t).map(([e,t])=>typeof t==`string`||Array.isArray(t)?{alias:e,src:t}:{alias:e,...t})),r.forEach(t=>{let r=t.src,i=t.alias,a;if(typeof i==`string`){let t=this._createBundleAssetId(e,i);n.push(t),a=[i,t]}else{let t=i.map(t=>this._createBundleAssetId(e,t));n.push(...t),a=[...i,...t]}this.add({...t,alias:a,src:r})}),this._bundles[e]=n}add(e){let t=[];Array.isArray(e)?t.push(...e):t.push(e);let n=e=>{this.hasKey(e)&&h(`[Resolver] already has key: ${e} overwriting`)};dj(t).forEach(e=>{let{src:t}=e,{data:r,format:i,loadParser:a,parser:o}=e,s=dj(t).map(e=>typeof e==`string`?$ge(e):Array.isArray(e)?e:[e]),c=this.getAlias(e);Array.isArray(c)?c.forEach(n):n(c);let l=[],u=e=>({src:e,...this._parsers.find(t=>t.test(e))?.parse(e)});s.forEach(t=>{t.forEach(t=>{let n={};if(typeof t==`object`?(r=t.data??r,i=t.format??i,(t.loadParser||t.parser)&&(a=t.loadParser??a,o=t.parser??o),n={...u(t.src),...t}):n=u(t),!c)throw Error(`[Resolver] alias is undefined for this asset: ${n.src}`);n=this._buildResolvedAsset(n,{aliases:c,data:r,format:i,loadParser:a,parser:o,progressSize:e.progressSize}),l.push(n)})}),c.forEach(e=>{this._assetMap[e]=l})})}resolveBundle(e){let t=bj(e);e=dj(e);let n={};return e.forEach(e=>{let t=this._bundles[e];if(t){let r=this.resolve(t),i={};for(let t in r){let n=r[t];i[this._extractAssetIdFromBundle(e,t)]=n}n[e]=i}}),t?n[e[0]]:n}resolveUrl(e){let t=this.resolve(e);if(typeof e!=`string`){let e={};for(let n in t)e[n]=t[n].src;return e}return t.src}resolve(e){let t=bj(e);e=dj(e);let n={};return e.forEach(e=>{if(!this._resolverHash[e])if(this._assetMap[e]){let t=this._assetMap[e],n=this._getPreferredOrder(t);n?.priority.forEach(e=>{n.params[e].forEach(n=>{let r=t.filter(t=>t[e]?t[e]===n:!1);r.length&&(t=r)})}),this._resolverHash[e]=t[0]}else this._resolverHash[e]=this._buildResolvedAsset({alias:[e],src:e},{});n[e]=this._resolverHash[e]}),t?n[e[0]]:n}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;t<e.length;t++){let n=e[t],r=this._preferredOrder.find(e=>e.params.format.includes(n.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(e){return this._defaultSearchParams?`${e}${/\?/.test(e)?`&`:`?`}${this._defaultSearchParams}`:e}_buildResolvedAsset(e,t){let{aliases:n,data:r,loadParser:i,parser:a,format:o,progressSize:s}=t;return(this._basePath||this._rootPath)&&(e.src=vj.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=n??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...r||{},...e.data},e.loadParser=i??e.loadParser,e.parser=a??e.parser,e.format=o??e.format??e_e(e.src),s!==void 0&&(e.progressSize=s),e}};xj.RETINA_PREFIX=/@([0-9\.]+)x/;function e_e(e){return e.split(`.`).pop().split(`?`).shift().split(`#`).shift()}var Sj=(e,t)=>{let n=t.split(`?`)[1];return n&&(e+=`?${n}`),e},Cj=class e{constructor(e,t){this.linkedSheets=[];let n=e;e?.source instanceof T&&(n={texture:e,data:t});let{texture:r,data:i,cachePrefix:a=``}=n;this.cachePrefix=a,this._texture=r instanceof l?r:null,this.textureSource=r.source,this.textures={},this.animations={},this.data=i;let o=parseFloat(i.meta.scale);o?(this.resolution=o,r.source.resolution=this.resolution):this.resolution=r.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=e.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(t,n=!1){let r=t,i=n?1/0:e.BATCH_SIZE;for(;r-t<i&&r<this._frameKeys.length;){let e=this._frameKeys[r],t=this._frames[e],n=t.frame;if(n){let r=null,i=null,a=t.trimmed!==!1&&t.sourceSize?t.sourceSize:t.frame,o=new k(0,0,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution);r=t.rotated?new k(Math.floor(n.x)/this.resolution,Math.floor(n.y)/this.resolution,Math.floor(n.h)/this.resolution,Math.floor(n.w)/this.resolution):new k(Math.floor(n.x)/this.resolution,Math.floor(n.y)/this.resolution,Math.floor(n.w)/this.resolution,Math.floor(n.h)/this.resolution),t.trimmed!==!1&&t.spriteSourceSize&&(i=new k(Math.floor(t.spriteSourceSize.x)/this.resolution,Math.floor(t.spriteSourceSize.y)/this.resolution,Math.floor(n.w)/this.resolution,Math.floor(n.h)/this.resolution)),this.textures[e]=new l({source:this.textureSource,frame:r,orig:o,trim:i,rotate:t.rotated?2:0,defaultAnchor:t.anchor,defaultBorders:t.borders,label:e.toString()})}r++}}_processAnimations(){let e=this.data.animations||{};for(let t in e){this.animations[t]=[];for(let n=0;n<e[t].length;n++){let r=e[t][n];this.animations[t].push(this.textures[r])}}}_parseComplete(){let e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*e.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*e.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){for(let e in this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};Cj.BATCH_SIZE=1e3;var wj=Cj,t_e=[`jpg`,`png`,`jpeg`,`avif`,`webp`,`basis`,`etc2`,`bc7`,`bc6h`,`bc5`,`bc4`,`bc3`,`bc2`,`bc1`,`eac`,`astc`];function Tj(e,t,n){let r={};if(e.forEach(e=>{r[e]=t}),Object.keys(t.textures).forEach(e=>{r[`${t.cachePrefix}${e}`]=t.textures[e]}),!n){let n=vj.dirname(e[0]);t.linkedSheets.forEach((e,i)=>{let a=Tj([`${n}/${t.data.meta.related_multi_packs[i]}`],e,!0);Object.assign(r,a)})}return r}var n_e={extension:R.Asset,cache:{test:e=>e instanceof wj,getCacheableAssets:(e,t)=>Tj(e,t,!1)},resolver:{extension:{type:R.ResolveParser,name:`resolveSpritesheet`},test:e=>{let t=e.split(`?`)[0].split(`.`),n=t.pop(),r=t.pop();return n===`json`&&t_e.includes(r)},parse:e=>{let t=e.split(`.`);return{resolution:parseFloat(xj.RETINA_PREFIX.exec(e)?.[1]??`1`),format:t[t.length-2],src:e}}},loader:{name:`spritesheetLoader`,id:`spritesheet`,extension:{type:R.LoadParser,priority:hj.Normal,name:`spritesheetLoader`},async testParse(e,t){return vj.extname(t.src).toLowerCase()===`.json`&&!!e.frames},async parse(e,t,n){let{texture:r,imageFilename:i,textureOptions:a,cachePrefix:o}=t?.data??{},s=vj.dirname(t.src);s&&s.lastIndexOf(`/`)!==s.length-1&&(s+=`/`);let c;if(r instanceof l)c=r;else{let r=Sj(s+(i??e.meta.image),t.src);c=(await n.load([{src:r,data:a}]))[r]}let u=new wj({texture:c.source,data:e,cachePrefix:o});await u.parse();let d=e?.meta?.related_multi_packs;if(Array.isArray(d)){let e=[];for(let r of d){if(typeof r!=`string`)continue;let i=s+r;t.data?.ignoreMultiPack||(i=Sj(i,t.src),e.push(n.load({src:i,data:{textureOptions:a,ignoreMultiPack:!0}})))}let r=await Promise.all(e);u.linkedSheets=r,r.forEach(e=>{e.linkedSheets=[u].concat(u.linkedSheets.filter(t=>t!==e))})}return u},async unload(e,t,n){await n.unload(e.textureSource._sourceOrigin),e.destroy(!1)}}};L.add(n_e);var r_e=class{constructor(e){this._lastTransform=``,this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;let e=this._canvas.getBoundingClientRect(),t=this._canvas.width,n=this._canvas.height,r=e.width/t*this._renderer.resolution,i=e.height/n*this._renderer.resolution,a=`translate(${e.left}px, ${e.top}px) scale(${r}, ${i})`;a!==this._lastTransform&&(this._domElement.style.transform=a,this._lastTransform=a)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){`ResizeObserver`in globalThis?(this._observer&&=(this._observer.disconnect(),null),this._observer=new ResizeObserver(e=>{for(let t of e){if(t.target!==this._canvas)continue;let e=this.canvas.width,n=this.canvas.height,r=t.contentRect.width/e*this._renderer.resolution,i=t.contentRect.height/n*this._renderer.resolution;(this._lastScaleX!==r||this._lastScaleY!==i)&&(this.updateTranslation(),this._lastScaleX=r,this._lastScaleY=i)}}),this._observer.observe(this._canvas)):this._tickerAttached||I.shared.add(this.updateTranslation,this,te.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&I.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform=``,this._lastScaleX=null,this._lastScaleY=null}},Ej=class e{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=e.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new F,this.page=new F,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,n){throw Error(`initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.`)}initUIEvent(e,t,n,r,i){throw Error(`initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.`)}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}},Dj=/iPhone/i,Oj=/iPod/i,kj=/iPad/i,Aj=/\biOS-universal(?:.+)Mac\b/i,jj=/\bAndroid(?:.+)Mobile\b/i,Mj=/Android/i,Nj=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Pj=/Silk/i,Fj=/Windows Phone/i,Ij=/\bWindows(?:.+)ARM\b/i,Lj=/BlackBerry/i,Rj=/BB10/i,zj=/Opera Mini/i,Bj=/\b(CriOS|Chrome)(?:.+)Mobile/i,Vj=/Mobile(?:.+)Firefox\b/i,Hj=function(e){return e!==void 0&&e.platform===`MacIntel`&&typeof e.maxTouchPoints==`number`&&e.maxTouchPoints>1&&typeof MSStream>`u`};function i_e(e){return function(t){return t.test(e)}}function Uj(e){var t={userAgent:``,platform:``,maxTouchPoints:0};!e&&typeof navigator<`u`?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e==`string`?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var n=t.userAgent,r=n.split(`[FBAN`);r[1]!==void 0&&(n=r[0]),r=n.split(`Twitter`),r[1]!==void 0&&(n=r[0]);var i=i_e(n),a={apple:{phone:i(Dj)&&!i(Fj),ipod:i(Oj),tablet:!i(Dj)&&(i(kj)||Hj(t))&&!i(Fj),universal:i(Aj),device:(i(Dj)||i(Oj)||i(kj)||i(Aj)||Hj(t))&&!i(Fj)},amazon:{phone:i(Nj),tablet:!i(Nj)&&i(Pj),device:i(Nj)||i(Pj)},android:{phone:!i(Fj)&&i(Nj)||!i(Fj)&&i(jj),tablet:!i(Fj)&&!i(Nj)&&!i(jj)&&(i(Pj)||i(Mj)),device:!i(Fj)&&(i(Nj)||i(Pj)||i(jj)||i(Mj))||i(/\bokhttp\b/i)},windows:{phone:i(Fj),tablet:i(Ij),device:i(Fj)||i(Ij)},other:{blackberry:i(Lj),blackberry10:i(Rj),opera:i(zj),firefox:i(Vj),chrome:i(Bj),device:i(Lj)||i(Rj)||i(zj)||i(Vj)||i(Bj)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}var a_e=(Uj.default??Uj)(globalThis.navigator),o_e=9,Wj=100,s_e=0,c_e=0,Gj=2,Kj=1,l_e=-1e3,u_e=-1e3,d_e=2,qj=class e{constructor(e,t=a_e){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){let e=document.createElement(`button`);e.style.width=`${Kj}px`,e.style.height=`${Kj}px`,e.style.position=`absolute`,e.style.top=`${l_e}px`,e.style.left=`${u_e}px`,e.style.zIndex=d_e.toString(),e.style.backgroundColor=`#FF0000`,e.title=`select to enable accessibility for this content`,e.addEventListener(`focus`,()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&=(document.body.removeChild(this._hookDiv),null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement(`div`),this._div.style.position=`absolute`,this._div.style.top=`${s_e}px`,this._div.style.left=`${c_e}px`,this._div.style.pointerEvents=`none`,this._div.style.zIndex=Gj.toString(),this._canvasObserver=new r_e({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener(`keydown`,this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener(`mousemove`,this._boundOnMouseMove,!0);let e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{let t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener(`mousemove`,this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener(`keydown`,this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(let e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;for(let e in this._pools)this._pools[e].forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);let t=e.children;if(t)for(let e=0;e<t.length;e++)this._updateAccessibleObjects(t[e])}init(t){let n={accessibilityOptions:{...e.defaultOptions,...t?.accessibilityOptions||{}}};this.debug=n.accessibilityOptions.debug,this._activateOnTab=n.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=n.accessibilityOptions.deactivateOnMouseMove,n.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){let e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;let t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(let e of this._children)e._renderId===this._renderId&&t.add(this._children.indexOf(e))}for(let e=this._children.length-1;e>=0;e--){let n=this._children[e];t.has(e)||(n._accessibleDiv&&n._accessibleDiv.parentNode&&(n._accessibleDiv.parentNode.removeChild(n._accessibleDiv),this._getPool(n.accessibleType).push(n._accessibleDiv),n._accessibleDiv=null),n._accessibleActive=!1,y(this._children,e,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let e=0;e<this._children.length;e++){let t=this._children[e];if(!t._accessibleActive||!t._accessibleDiv)continue;let n=t._accessibleDiv,r=t.hitArea||t.getBounds().rectangle;if(t.hitArea){let e=t.worldTransform;n.style.left=`${e.tx+r.x*e.a}px`,n.style.top=`${e.ty+r.y*e.d}px`,n.style.width=`${r.width*e.a}px`,n.style.height=`${r.height*e.d}px`}else this._capHitArea(r),n.style.left=`${r.x}px`,n.style.top=`${r.y}px`,n.style.width=`${r.width}px`,n.style.height=`${r.height}px`}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);let{width:t,height:n}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>n&&(e.height=n-e.y)}_addChild(e){let t=this._getPool(e.accessibleType).pop();t?(t.innerHTML=``,t.removeAttribute(`title`),t.removeAttribute(`aria-label`),t.tabIndex=0):(e.accessibleType===`button`?t=document.createElement(`button`):(t=document.createElement(e.accessibleType),t.style.cssText=`
|
|
769
|
+
</dialog>`:e}};customElements.define(`input-panel`,Hge);var Uge={extension:{type:R.Environment,name:`browser`,priority:-1},test:()=>!0,load:async()=>{await Z(()=>import(`./browserAll-CuNkItSE.js`),__vite__mapDeps([3,4,2,5]))}},Wge={extension:{type:R.Environment,name:`webworker`,priority:0},test:()=>typeof self<`u`&&self.WorkerGlobalScope!==void 0,load:async()=>{await Z(()=>import(`./webworkerAll-BqQJxuyS.js`),__vite__mapDeps([6,4,2,5]))}},Gge=new C;function rj(e,t,n){let r=Gge;e.measurable=!0,ie(e,n,r),t.addBoundsMask(r),e.measurable=!1}function ij(e,t,n){let r=c.get();e.measurable=!0;let i=re.get().identity();w(e,r,aj(e,n,i)),e.measurable=!1,t.addBoundsMask(r),re.return(i),c.return(r)}function aj(e,t,n){return e?(e!==t&&(aj(e.parent,t,n),e.updateLocalTransform(),n.append(e.localTransform)),n):(h(`Mask bounds, renderable is not inside the root container`),n)}var oj=class{constructor(e){this.priority=0,this.inverse=!1,this.pipe=`alphaMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof ye),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(e,t){this.inverse||rj(this.mask,e,t)}addLocalBounds(e,t){ij(this.mask,e,t)}containsPoint(e,t){let n=this.mask;return t(n,e)}destroy(){this.reset()}static test(e){return e instanceof ye}};oj.extension=R.MaskEffect;var sj=class{constructor(e){this.priority=0,this.pipe=`colorMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e}destroy(){}static test(e){return typeof e==`number`}};sj.extension=R.MaskEffect;var cj=class{constructor(e){this.priority=0,this.pipe=`stencilMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(e,t){rj(this.mask,e,t)}addLocalBounds(e,t){ij(this.mask,e,t)}containsPoint(e,t){let n=this.mask;return t(n,e)}destroy(){this.reset()}static test(e){return e instanceof ve}};cj.extension=R.MaskEffect;var lj;async function Kge(){return lj??=(async()=>{let e=ge.get().createCanvas(1,1).getContext(`webgl`);if(!e)return`premultiply-alpha-on-upload`;let t=await new Promise(e=>{let t=document.createElement(`video`);t.onloadeddata=()=>e(t),t.onerror=()=>e(null),t.autoplay=!1,t.crossOrigin=`anonymous`,t.preload=`auto`,t.src=`data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=`,t.load()});if(!t)return`premultiply-alpha-on-upload`;let n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);let r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t);let i=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,i),e.deleteFramebuffer(r),e.deleteTexture(n),e.getExtension(`WEBGL_lose_context`)?.loseContext(),i[0]<=i[3]?`premultiplied-alpha`:`premultiply-alpha-on-upload`})(),lj}var uj=class e extends T{constructor(t){super(t),this.isReady=!1,this.uploadMethodId=`video`,t={...e.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??`premultiply-alpha-on-upload`,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){let e=I.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;let e=this.resource,t=this.options;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener(`play`,this._onPlayStart),e.addEventListener(`pause`,this._onPlayStop),e.addEventListener(`seeked`,this._onSeeked),this._isSourceReady()?this._mediaReady():(t.preload||e.addEventListener(`canplay`,this._onCanPlay),e.addEventListener(`canplaythrough`,this._onCanPlayThrough),e.addEventListener(`error`,this._onError,!0)),this.alphaMode=await Kge(),this._load=new Promise((n,r)=>{this.isValid?n(this):(this._resolve=n,this._reject=r,t.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${t.preloadTimeoutMs}ms`))})),e.load())}),this._load}_onError(e){this.resource.removeEventListener(`error`,this._onError,!0),this.emit(`error`,e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){let e=this.resource;return!e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener(`canplay`,this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener(`canplaythrough`,this._onCanPlay),this._preloadTimeout&&=(clearTimeout(this._preloadTimeout),void 0),this._mediaReady()}_mediaReady(){let e=this.resource;this.isValid&&(this.isReady=!0,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();let e=this.resource;e&&(e.removeEventListener(`play`,this._onPlayStart),e.removeEventListener(`pause`,this._onPlayStop),e.removeEventListener(`seeked`,this._onSeeked),e.removeEventListener(`canplay`,this._onCanPlay),e.removeEventListener(`canplaythrough`,this._onCanPlayThrough),e.removeEventListener(`error`,this._onError,!0),e.pause(),e.src=``,e.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(I.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(I.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(I.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};uj.extension=R.TextureSource,uj.defaultOptions={...T.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1},uj.MIME_TYPES={ogv:`video/ogg`,mov:`video/quicktime`,m4v:`video/mp4`};var qge=uj,dj=(e,t,n=!1)=>(Array.isArray(e)||(e=[e]),t?e.map(e=>typeof e==`string`||n?t(e):e):e),fj=new class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){let t=this._cache.get(e);return t||h(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){let n=dj(e),r;for(let e=0;e<this.parsers.length;e++){let i=this.parsers[e];if(i.test(t)){r=i.getCacheableAssets(n,t);break}}let i=new Map(Object.entries(r||{}));r||n.forEach(e=>{i.set(e,t)});let a=[...i.keys()],o={cacheKeys:a,keys:n};n.forEach(e=>{this._cacheMap.set(e,o)}),a.forEach(e=>{let n=r?r[e]:t;this._cache.has(e)&&this._cache.get(e)!==n&&h(`[Cache] already has key:`,e),this._cache.set(e,i.get(e))})}remove(e){if(!this._cacheMap.has(e)){h(`[Assets] Asset id ${e} was not found in the Cache`);return}let t=this._cacheMap.get(e);t.cacheKeys.forEach(e=>{this._cache.delete(e)}),t.keys.forEach(e=>{this._cacheMap.delete(e)})}get parsers(){return this._parsers}},pj=[];L.handleByList(R.TextureSource,pj);function mj(e={}){let t=e&&e.resource,n=t?e.resource:e,r=t?e:{resource:e};for(let e=0;e<pj.length;e++){let t=pj[e];if(t.test(n))return new t(r)}throw Error(`Could not find a source type for resource: ${r.resource}`)}function Jge(e={},t=!1){let n=e&&e.resource,r=n?e.resource:e,i=n?e:{resource:e};if(!t&&fj.has(r))return fj.get(r);let a=new l({source:mj(i)});return a.on(`destroy`,()=>{fj.has(r)&&fj.remove(r)}),t||fj.set(r,a),a}function Yge(e,t=!1){return typeof e==`string`?fj.get(e):e instanceof T?new l({source:e}):Jge(e,t)}l.from=Yge,T.from=mj,L.add(oj,sj,cj,qge,xe,A,m);var hj=(e=>(e[e.Low=0]=`Low`,e[e.Normal=1]=`Normal`,e[e.High=2]=`High`,e))(hj||{});function gj(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received ${JSON.stringify(e)}`)}function _j(e){return e.split(`?`)[0].split(`#`)[0]}function Xge(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Zge(e,t,n){return e.replace(new RegExp(Xge(t),`g`),n)}function Qge(e,t){let n=``,r=0,i=-1,a=0,o=-1;for(let s=0;s<=e.length;++s){if(s<e.length)o=e.charCodeAt(s);else if(o===47)break;else o=47;if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){let e=n.lastIndexOf(`/`);if(e!==n.length-1){e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}}else if(n.length===2||n.length===1){n=``,r=0,i=s,a=0;continue}}t&&(n.length>0?n+=`/..`:n=`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a!==-1?++a:a=-1}return n}var vj={toPosix(e){return Zge(e,`\\`,`/`)},isUrl(e){return/^https?:/.test(this.toPosix(e))},isDataUrl(e){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(e)},isBlobUrl(e){return e.startsWith(`blob:`)},hasProtocol(e){return/^[^/:]+:/.test(this.toPosix(e))},getProtocol(e){gj(e),e=this.toPosix(e);let t=/^file:\/\/\//.exec(e);if(t)return t[0];let n=/^[^/:]+:\/{0,2}/.exec(e);return n?n[0]:``},toAbsolute(e,t,n){if(gj(e),this.isDataUrl(e)||this.isBlobUrl(e))return e;let r=_j(this.toPosix(t??ge.get().getBaseUrl())),i=_j(this.toPosix(n??this.rootname(r)));return e=this.toPosix(e),e.startsWith(`/`)?vj.join(i,e.slice(1)):this.isAbsolute(e)?e:this.join(r,e)},normalize(e){if(gj(e),e.length===0)return`.`;if(this.isDataUrl(e)||this.isBlobUrl(e))return e;e=this.toPosix(e);let t=``,n=e.startsWith(`/`);this.hasProtocol(e)&&(t=this.rootname(e),e=e.slice(t.length));let r=e.endsWith(`/`);return e=Qge(e,!1),e.length>0&&r&&(e+=`/`),n?`/${e}`:t+e},isAbsolute(e){return gj(e),e=this.toPosix(e),this.hasProtocol(e)?!0:e.startsWith(`/`)},join(...e){if(e.length===0)return`.`;let t;for(let n=0;n<e.length;++n){let r=e[n];if(gj(r),r.length>0)if(t===void 0)t=r;else{let i=e[n-1]??``;this.joinExtensions.includes(this.extname(i).toLowerCase())?t+=`/../${r}`:t+=`/${r}`}}return t===void 0?`.`:this.normalize(t)},dirname(e){if(gj(e),e.length===0)return`.`;e=this.toPosix(e);let t=e.charCodeAt(0),n=t===47,r=-1,i=!0,a=this.getProtocol(e),o=e;e=e.slice(a.length);for(let n=e.length-1;n>=1;--n)if(t=e.charCodeAt(n),t===47){if(!i){r=n;break}}else i=!1;return r===-1?n?`/`:this.isUrl(o)?a+e:a:n&&r===1?`//`:a+e.slice(0,r)},rootname(e){gj(e),e=this.toPosix(e);let t=``;if(t=e.startsWith(`/`)?`/`:this.getProtocol(e),this.isUrl(e)){let n=e.indexOf(`/`,t.length);t=n===-1?e:e.slice(0,n),t.endsWith(`/`)||(t+=`/`)}return t},basename(e,t){gj(e),t&&gj(t),e=_j(this.toPosix(e));let n=0,r=-1,i=!0,a;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;let o=t.length-1,s=-1;for(a=e.length-1;a>=0;--a){let c=e.charCodeAt(a);if(c===47){if(!i){n=a+1;break}}else s===-1&&(i=!1,s=a+1),o>=0&&(c===t.charCodeAt(o)?--o===-1&&(r=a):(o=-1,r=s))}return n===r?r=s:r===-1&&(r=e.length),e.slice(n,r)}for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===47){if(!i){n=a+1;break}}else r===-1&&(i=!1,r=a+1);return r===-1?``:e.slice(n,r)},extname(e){gj(e),e=_j(this.toPosix(e));let t=-1,n=0,r=-1,i=!0,a=0;for(let o=e.length-1;o>=0;--o){let s=e.charCodeAt(o);if(s===47){if(!i){n=o+1;break}continue}r===-1&&(i=!1,r=o+1),s===46?t===-1?t=o:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||r===-1||a===0||a===1&&t===r-1&&t===n+1?``:e.slice(t,r)},parse(e){gj(e);let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;e=_j(this.toPosix(e));let n=e.charCodeAt(0),r=this.isAbsolute(e),i;t.root=this.rootname(e),i=r||this.hasProtocol(e)?1:0;let a=-1,o=0,s=-1,c=!0,l=e.length-1,u=0;for(;l>=i;--l){if(n=e.charCodeAt(l),n===47){if(!c){o=l+1;break}continue}s===-1&&(c=!1,s=l+1),n===46?a===-1?a=l:u!==1&&(u=1):a!==-1&&(u=-1)}return a===-1||s===-1||u===0||u===1&&a===s-1&&a===o+1?s!==-1&&(o===0&&r?t.base=t.name=e.slice(1,s):t.base=t.name=e.slice(o,s)):(o===0&&r?(t.name=e.slice(1,a),t.base=e.slice(1,s)):(t.name=e.slice(o,a),t.base=e.slice(o,s)),t.ext=e.slice(a,s)),t.dir=this.dirname(e),t},sep:`/`,delimiter:`:`,joinExtensions:[`.html`]};function yj(e,t,n,r,i){let a=t[n];for(let o=0;o<a.length;o++){let s=a[o];n<t.length-1?yj(e.replace(r[n],s),t,n+1,r,i):i.push(e.replace(r[n],s))}}function $ge(e){let t=e.match(/\{(.*?)\}/g),n=[];if(t){let r=[];t.forEach(e=>{let t=e.substring(1,e.length-1).split(`,`);r.push(t)}),yj(e,r,0,t,n)}else n.push(e);return n}var bj=e=>!Array.isArray(e),xj=class{constructor(){this._defaultBundleIdentifierOptions={connector:`-`,createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${this._bundleIdConnector}`,``)},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle(`foo`,this._createBundleAssetId(`foo`,`bar`))!==`bar`)throw Error(`[Resolver] GenerateBundleAssetId are not working correctly`)}prefer(...e){e.forEach(e=>{this._preferredOrder.push(e),e.priority||=Object.keys(e.params)}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e==`string`)this._defaultSearchParams=e;else{let t=e;this._defaultSearchParams=Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join(`&`)}}getAlias(e){let{alias:t,src:n}=e;return dj(t||n,e=>typeof e==`string`?e:Array.isArray(e)?e.map(e=>e?.src??e):e?.src?e.src:e,!0)}addManifest(e){this._manifest&&h(`[Resolver] Manifest already exists, this will be overwritten`),this._manifest=e,e.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(e,t){let n=[],r=t;Array.isArray(t)||(r=Object.entries(t).map(([e,t])=>typeof t==`string`||Array.isArray(t)?{alias:e,src:t}:{alias:e,...t})),r.forEach(t=>{let r=t.src,i=t.alias,a;if(typeof i==`string`){let t=this._createBundleAssetId(e,i);n.push(t),a=[i,t]}else{let t=i.map(t=>this._createBundleAssetId(e,t));n.push(...t),a=[...i,...t]}this.add({...t,alias:a,src:r})}),this._bundles[e]=n}add(e){let t=[];Array.isArray(e)?t.push(...e):t.push(e);let n=e=>{this.hasKey(e)&&h(`[Resolver] already has key: ${e} overwriting`)};dj(t).forEach(e=>{let{src:t}=e,{data:r,format:i,loadParser:a,parser:o}=e,s=dj(t).map(e=>typeof e==`string`?$ge(e):Array.isArray(e)?e:[e]),c=this.getAlias(e);Array.isArray(c)?c.forEach(n):n(c);let l=[],u=e=>({src:e,...this._parsers.find(t=>t.test(e))?.parse(e)});s.forEach(t=>{t.forEach(t=>{let n={};if(typeof t==`object`?(r=t.data??r,i=t.format??i,(t.loadParser||t.parser)&&(a=t.loadParser??a,o=t.parser??o),n={...u(t.src),...t}):n=u(t),!c)throw Error(`[Resolver] alias is undefined for this asset: ${n.src}`);n=this._buildResolvedAsset(n,{aliases:c,data:r,format:i,loadParser:a,parser:o,progressSize:e.progressSize}),l.push(n)})}),c.forEach(e=>{this._assetMap[e]=l})})}resolveBundle(e){let t=bj(e);e=dj(e);let n={};return e.forEach(e=>{let t=this._bundles[e];if(t){let r=this.resolve(t),i={};for(let t in r){let n=r[t];i[this._extractAssetIdFromBundle(e,t)]=n}n[e]=i}}),t?n[e[0]]:n}resolveUrl(e){let t=this.resolve(e);if(typeof e!=`string`){let e={};for(let n in t)e[n]=t[n].src;return e}return t.src}resolve(e){let t=bj(e);e=dj(e);let n={};return e.forEach(e=>{if(!this._resolverHash[e])if(this._assetMap[e]){let t=this._assetMap[e],n=this._getPreferredOrder(t);n?.priority.forEach(e=>{n.params[e].forEach(n=>{let r=t.filter(t=>t[e]?t[e]===n:!1);r.length&&(t=r)})}),this._resolverHash[e]=t[0]}else this._resolverHash[e]=this._buildResolvedAsset({alias:[e],src:e},{});n[e]=this._resolverHash[e]}),t?n[e[0]]:n}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;t<e.length;t++){let n=e[t],r=this._preferredOrder.find(e=>e.params.format.includes(n.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(e){return this._defaultSearchParams?`${e}${/\?/.test(e)?`&`:`?`}${this._defaultSearchParams}`:e}_buildResolvedAsset(e,t){let{aliases:n,data:r,loadParser:i,parser:a,format:o,progressSize:s}=t;return(this._basePath||this._rootPath)&&(e.src=vj.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=n??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...r||{},...e.data},e.loadParser=i??e.loadParser,e.parser=a??e.parser,e.format=o??e.format??e_e(e.src),s!==void 0&&(e.progressSize=s),e}};xj.RETINA_PREFIX=/@([0-9\.]+)x/;function e_e(e){return e.split(`.`).pop().split(`?`).shift().split(`#`).shift()}var Sj=(e,t)=>{let n=t.split(`?`)[1];return n&&(e+=`?${n}`),e},Cj=class e{constructor(e,t){this.linkedSheets=[];let n=e;e?.source instanceof T&&(n={texture:e,data:t});let{texture:r,data:i,cachePrefix:a=``}=n;this.cachePrefix=a,this._texture=r instanceof l?r:null,this.textureSource=r.source,this.textures={},this.animations={},this.data=i;let o=parseFloat(i.meta.scale);o?(this.resolution=o,r.source.resolution=this.resolution):this.resolution=r.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=e.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(t,n=!1){let r=t,i=n?1/0:e.BATCH_SIZE;for(;r-t<i&&r<this._frameKeys.length;){let e=this._frameKeys[r],t=this._frames[e],n=t.frame;if(n){let r=null,i=null,a=t.trimmed!==!1&&t.sourceSize?t.sourceSize:t.frame,o=new k(0,0,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution);r=t.rotated?new k(Math.floor(n.x)/this.resolution,Math.floor(n.y)/this.resolution,Math.floor(n.h)/this.resolution,Math.floor(n.w)/this.resolution):new k(Math.floor(n.x)/this.resolution,Math.floor(n.y)/this.resolution,Math.floor(n.w)/this.resolution,Math.floor(n.h)/this.resolution),t.trimmed!==!1&&t.spriteSourceSize&&(i=new k(Math.floor(t.spriteSourceSize.x)/this.resolution,Math.floor(t.spriteSourceSize.y)/this.resolution,Math.floor(n.w)/this.resolution,Math.floor(n.h)/this.resolution)),this.textures[e]=new l({source:this.textureSource,frame:r,orig:o,trim:i,rotate:t.rotated?2:0,defaultAnchor:t.anchor,defaultBorders:t.borders,label:e.toString()})}r++}}_processAnimations(){let e=this.data.animations||{};for(let t in e){this.animations[t]=[];for(let n=0;n<e[t].length;n++){let r=e[t][n];this.animations[t].push(this.textures[r])}}}_parseComplete(){let e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*e.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*e.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){for(let e in this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};Cj.BATCH_SIZE=1e3;var wj=Cj,t_e=[`jpg`,`png`,`jpeg`,`avif`,`webp`,`basis`,`etc2`,`bc7`,`bc6h`,`bc5`,`bc4`,`bc3`,`bc2`,`bc1`,`eac`,`astc`];function Tj(e,t,n){let r={};if(e.forEach(e=>{r[e]=t}),Object.keys(t.textures).forEach(e=>{r[`${t.cachePrefix}${e}`]=t.textures[e]}),!n){let n=vj.dirname(e[0]);t.linkedSheets.forEach((e,i)=>{let a=Tj([`${n}/${t.data.meta.related_multi_packs[i]}`],e,!0);Object.assign(r,a)})}return r}var n_e={extension:R.Asset,cache:{test:e=>e instanceof wj,getCacheableAssets:(e,t)=>Tj(e,t,!1)},resolver:{extension:{type:R.ResolveParser,name:`resolveSpritesheet`},test:e=>{let t=e.split(`?`)[0].split(`.`),n=t.pop(),r=t.pop();return n===`json`&&t_e.includes(r)},parse:e=>{let t=e.split(`.`);return{resolution:parseFloat(xj.RETINA_PREFIX.exec(e)?.[1]??`1`),format:t[t.length-2],src:e}}},loader:{name:`spritesheetLoader`,id:`spritesheet`,extension:{type:R.LoadParser,priority:hj.Normal,name:`spritesheetLoader`},async testParse(e,t){return vj.extname(t.src).toLowerCase()===`.json`&&!!e.frames},async parse(e,t,n){let{texture:r,imageFilename:i,textureOptions:a,cachePrefix:o}=t?.data??{},s=vj.dirname(t.src);s&&s.lastIndexOf(`/`)!==s.length-1&&(s+=`/`);let c;if(r instanceof l)c=r;else{let r=Sj(s+(i??e.meta.image),t.src);c=(await n.load([{src:r,data:a}]))[r]}let u=new wj({texture:c.source,data:e,cachePrefix:o});await u.parse();let d=e?.meta?.related_multi_packs;if(Array.isArray(d)){let e=[];for(let r of d){if(typeof r!=`string`)continue;let i=s+r;t.data?.ignoreMultiPack||(i=Sj(i,t.src),e.push(n.load({src:i,data:{textureOptions:a,ignoreMultiPack:!0}})))}let r=await Promise.all(e);u.linkedSheets=r,r.forEach(e=>{e.linkedSheets=[u].concat(u.linkedSheets.filter(t=>t!==e))})}return u},async unload(e,t,n){await n.unload(e.textureSource._sourceOrigin),e.destroy(!1)}}};L.add(n_e);var r_e=class{constructor(e){this._lastTransform=``,this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;let e=this._canvas.getBoundingClientRect(),t=this._canvas.width,n=this._canvas.height,r=e.width/t*this._renderer.resolution,i=e.height/n*this._renderer.resolution,a=`translate(${e.left}px, ${e.top}px) scale(${r}, ${i})`;a!==this._lastTransform&&(this._domElement.style.transform=a,this._lastTransform=a)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){`ResizeObserver`in globalThis?(this._observer&&=(this._observer.disconnect(),null),this._observer=new ResizeObserver(e=>{for(let t of e){if(t.target!==this._canvas)continue;let e=this.canvas.width,n=this.canvas.height,r=t.contentRect.width/e*this._renderer.resolution,i=t.contentRect.height/n*this._renderer.resolution;(this._lastScaleX!==r||this._lastScaleY!==i)&&(this.updateTranslation(),this._lastScaleX=r,this._lastScaleY=i)}}),this._observer.observe(this._canvas)):this._tickerAttached||I.shared.add(this.updateTranslation,this,te.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&I.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform=``,this._lastScaleX=null,this._lastScaleY=null}},Ej=class e{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=e.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new F,this.page=new F,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,n){throw Error(`initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.`)}initUIEvent(e,t,n,r,i){throw Error(`initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.`)}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}},Dj=/iPhone/i,Oj=/iPod/i,kj=/iPad/i,Aj=/\biOS-universal(?:.+)Mac\b/i,jj=/\bAndroid(?:.+)Mobile\b/i,Mj=/Android/i,Nj=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,Pj=/Silk/i,Fj=/Windows Phone/i,Ij=/\bWindows(?:.+)ARM\b/i,Lj=/BlackBerry/i,Rj=/BB10/i,zj=/Opera Mini/i,Bj=/\b(CriOS|Chrome)(?:.+)Mobile/i,Vj=/Mobile(?:.+)Firefox\b/i,Hj=function(e){return e!==void 0&&e.platform===`MacIntel`&&typeof e.maxTouchPoints==`number`&&e.maxTouchPoints>1&&typeof MSStream>`u`};function i_e(e){return function(t){return t.test(e)}}function Uj(e){var t={userAgent:``,platform:``,maxTouchPoints:0};!e&&typeof navigator<`u`?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e==`string`?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var n=t.userAgent,r=n.split(`[FBAN`);r[1]!==void 0&&(n=r[0]),r=n.split(`Twitter`),r[1]!==void 0&&(n=r[0]);var i=i_e(n),a={apple:{phone:i(Dj)&&!i(Fj),ipod:i(Oj),tablet:!i(Dj)&&(i(kj)||Hj(t))&&!i(Fj),universal:i(Aj),device:(i(Dj)||i(Oj)||i(kj)||i(Aj)||Hj(t))&&!i(Fj)},amazon:{phone:i(Nj),tablet:!i(Nj)&&i(Pj),device:i(Nj)||i(Pj)},android:{phone:!i(Fj)&&i(Nj)||!i(Fj)&&i(jj),tablet:!i(Fj)&&!i(Nj)&&!i(jj)&&(i(Pj)||i(Mj)),device:!i(Fj)&&(i(Nj)||i(Pj)||i(jj)||i(Mj))||i(/\bokhttp\b/i)},windows:{phone:i(Fj),tablet:i(Ij),device:i(Fj)||i(Ij)},other:{blackberry:i(Lj),blackberry10:i(Rj),opera:i(zj),firefox:i(Vj),chrome:i(Bj),device:i(Lj)||i(Rj)||i(zj)||i(Vj)||i(Bj)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}var a_e=(Uj.default??Uj)(globalThis.navigator),o_e=9,Wj=100,s_e=0,c_e=0,Gj=2,Kj=1,l_e=-1e3,u_e=-1e3,d_e=2,qj=class e{constructor(e,t=a_e){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){let e=document.createElement(`button`);e.style.width=`${Kj}px`,e.style.height=`${Kj}px`,e.style.position=`absolute`,e.style.top=`${l_e}px`,e.style.left=`${u_e}px`,e.style.zIndex=d_e.toString(),e.style.backgroundColor=`#FF0000`,e.title=`select to enable accessibility for this content`,e.addEventListener(`focus`,()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&=(document.body.removeChild(this._hookDiv),null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement(`div`),this._div.style.position=`absolute`,this._div.style.top=`${s_e}px`,this._div.style.left=`${c_e}px`,this._div.style.pointerEvents=`none`,this._div.style.zIndex=Gj.toString(),this._canvasObserver=new r_e({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener(`keydown`,this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener(`mousemove`,this._boundOnMouseMove,!0);let e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{let t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener(`mousemove`,this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener(`keydown`,this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(let e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;for(let e in this._pools)this._pools[e].forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);let t=e.children;if(t)for(let e=0;e<t.length;e++)this._updateAccessibleObjects(t[e])}init(t){let n={accessibilityOptions:{...e.defaultOptions,...t?.accessibilityOptions||{}}};this.debug=n.accessibilityOptions.debug,this._activateOnTab=n.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=n.accessibilityOptions.deactivateOnMouseMove,n.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){let e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;let t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(let e of this._children)e._renderId===this._renderId&&t.add(this._children.indexOf(e))}for(let e=this._children.length-1;e>=0;e--){let n=this._children[e];t.has(e)||(n._accessibleDiv&&n._accessibleDiv.parentNode&&(n._accessibleDiv.parentNode.removeChild(n._accessibleDiv),this._getPool(n.accessibleType).push(n._accessibleDiv),n._accessibleDiv=null),n._accessibleActive=!1,y(this._children,e,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let e=0;e<this._children.length;e++){let t=this._children[e];if(!t._accessibleActive||!t._accessibleDiv)continue;let n=t._accessibleDiv,r=t.hitArea||t.getBounds().rectangle;if(t.hitArea){let e=t.worldTransform;n.style.left=`${e.tx+r.x*e.a}px`,n.style.top=`${e.ty+r.y*e.d}px`,n.style.width=`${r.width*e.a}px`,n.style.height=`${r.height*e.d}px`}else this._capHitArea(r),n.style.left=`${r.x}px`,n.style.top=`${r.y}px`,n.style.width=`${r.width}px`,n.style.height=`${r.height}px`}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);let{width:t,height:n}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>n&&(e.height=n-e.y)}_addChild(e){let t=this._getPool(e.accessibleType).pop();t?(t.innerHTML=``,t.removeAttribute(`title`),t.removeAttribute(`aria-label`),t.tabIndex=0):(e.accessibleType===`button`?t=document.createElement(`button`):(t=document.createElement(e.accessibleType),t.style.cssText=`
|
|
770
770
|
color: transparent;
|
|
771
771
|
pointer-events: none;
|
|
772
772
|
padding: 0;
|
|
@@ -779,7 +779,7 @@ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){t
|
|
|
779
779
|
-webkit-user-select: none;
|
|
780
780
|
-moz-user-select: none;
|
|
781
781
|
-ms-user-select: none;
|
|
782
|
-
`,e.accessibleText&&(t.innerText=e.accessibleText)),t.style.width=`${Wj}px`,t.style.height=`${Wj}px`,t.style.backgroundColor=this.debug?`rgba(255,255,255,0.5)`:`transparent`,t.style.position=`absolute`,t.style.zIndex=Gj.toString(),t.style.borderStyle=`none`,navigator.userAgent.toLowerCase().includes(`chrome`)?t.setAttribute(`aria-live`,`off`):t.setAttribute(`aria-live`,`polite`),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute(`aria-relevant`,`additions`):t.setAttribute(`aria-relevant`,`text`),t.addEventListener(`click`,this._onClick.bind(this)),t.addEventListener(`focus`,this._onFocus.bind(this)),t.addEventListener(`focusout`,this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute(`aria-label`,e.accessibleHint),e.interactive?t.tabIndex=e.tabIndex:t.tabIndex=0,this.debug&&this._updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv)}_dispatchEvent(e,t){let{container:n}=e.target,r=this._renderer.events.rootBoundary,i=Object.assign(new Ej(r),{target:n});r.rootTarget=this._renderer.lastObjectRendered,t.forEach(e=>r.dispatchEvent(i,e))}_onClick(e){this._dispatchEvent(e,[`click`,`pointertap`,`tap`])}_onFocus(e){e.target.getAttribute(`aria-live`)||e.target.setAttribute(`aria-live`,`assertive`),this._dispatchEvent(e,[`mouseover`])}_onFocusOut(e){e.target.getAttribute(`aria-live`)||e.target.setAttribute(`aria-live`,`polite`),this._dispatchEvent(e,[`mouseout`])}_onKeyDown(e){e.keyCode!==o_e||!this._activateOnTab||this._activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate()}destroy(){this._deactivate(),this._destroyTouchHook(),this._canvasObserver?.destroy(),this._canvasObserver=null,this._div=null,this._pools=null,this._children=null,this._renderer=null,this._hookDiv=null,globalThis.removeEventListener(`keydown`,this._boundOnKeyDown),this._boundOnKeyDown=null,globalThis.document.removeEventListener(`mousemove`,this._boundOnMouseMove,!0),this._boundOnMouseMove=null}setAccessibilityEnabled(e){e?this._activate():this._deactivate()}_getPool(e){return this._pools[e]||(this._pools[e]=[]),this._pools[e]}};qj.extension={type:[R.WebGLSystem,R.WebGPUSystem],name:`accessibility`},qj.defaultOptions={enabledByDefault:!1,debug:!1,activateOnTab:!0,deactivateOnMouseMove:!0};var f_e=qj,p_e={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:`button`,accessibleText:null,accessiblePointerEvents:`auto`,accessibleChildren:!0,_accessibleActive:!1,_accessibleDiv:null,_renderId:-1},Jj;function m_e(e){return Jj===void 0&&(Jj=(()=>{let t={stencil:!0,failIfMajorPerformanceCaveat:e??Ce.defaultOptions.failIfMajorPerformanceCaveat};try{if(!ge.get().getWebGLRenderingContext())return!1;let e=ge.get().createCanvas().getContext(`webgl`,t),n=!!e?.getContextAttributes()?.stencil;if(e){let t=e.getExtension(`WEBGL_lose_context`);t&&t.loseContext()}return e=null,n}catch{return!1}})()),Jj}var Yj;async function h_e(e={}){return Yj===void 0&&(Yj=await(async()=>{let t=ge.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(e)).requestDevice(),!0}catch{return!1}})()),Yj}var Xj=[`webgl`,`webgpu`,`canvas`];async function g_e(e){let t=[];e.preference?(t.push(e.preference),Xj.forEach(n=>{n!==e.preference&&t.push(n)})):t=Xj.slice();let n,r={};for(let i=0;i<t.length;i++){let a=t[i];if(a===`webgpu`&&await h_e()){let{WebGPURenderer:t}=await Z(async()=>{let{WebGPURenderer:e}=await import(`./WebGPURenderer-BTQYx5S7.js`);return{WebGPURenderer:e}},__vite__mapDeps([7,4,2]));n=t,r={...e,...e.webgpu};break}else if(a===`webgl`&&m_e(e.failIfMajorPerformanceCaveat??Ce.defaultOptions.failIfMajorPerformanceCaveat)){let{WebGLRenderer:t}=await Z(async()=>{let{WebGLRenderer:e}=await import(`./WebGLRenderer-C7eR_UnH.js`);return{WebGLRenderer:e}},__vite__mapDeps([8,4,2]));n=t,r={...e,...e.webgl};break}else if(a===`canvas`){let{CanvasRenderer:t}=await Z(async()=>{let{CanvasRenderer:e}=await import(`./CanvasRenderer-BFbMT1Ul.js`);return{CanvasRenderer:e}},__vite__mapDeps([9,4,2]));n=t,r={...e,...e.canvasOptions};break}}if(delete r.webgpu,delete r.webgl,delete r.canvasOptions,!n)throw Error(`No available renderer for the current environment`);let i=new n;return await i.init(r),i}var Zj=class{static init(e){Object.defineProperty(this,`resizeTo`,{configurable:!0,set(e){globalThis.removeEventListener(`resize`,this.queueResize),this._resizeTo=e,e&&(globalThis.addEventListener(`resize`,this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&=(cancelAnimationFrame(this._resizeId),null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let e,t;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,t=globalThis.innerHeight;else{let{clientWidth:n,clientHeight:r}=this._resizeTo;e=n,t=r}this.renderer.resize(e,t),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener(`resize`,this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}};Zj.extension=R.Application;var Qj=class{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,`ticker`,{configurable:!0,set(e){this._ticker&&this._ticker.remove(this.render,this),this._ticker=e,e&&e.add(this.render,this,te.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?I.shared:new I,e.autoStart&&this.start()}static destroy(){if(this._ticker){let e=this._ticker;this.ticker=null,e.destroy()}}};Qj.extension=R.Application,L.add(Zj),L.add(Qj);var $j=class e{constructor(...e){this.stage=new ve,e[0]!==void 0&&ue(g,`Application constructor options are deprecated, please use Application.init() instead.`)}async init(t){t={...t},this.stage||=new ve,this.renderer=await g_e(t),e._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return ue(g,`Application.view is deprecated, please use Application.canvas instead.`),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,n=!1){let r=e._plugins.slice(0);r.reverse(),r.forEach(e=>{e.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(t),this.renderer=null}};$j._plugins=[];var eM=$j;L.handleByList(R.Application,eM._plugins),L.add(we);var __e=e(i(((e,t)=>{t.exports=i;var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=/([astvzqmhlc])([^astvzqmhlc]*)/gi;function i(e){var t=[];return e.replace(r,function(e,r,i){var a=r.toLowerCase();for(i=o(i),a==`m`&&i.length>2&&(t.push([r].concat(i.splice(0,2))),a=`l`,r=r==`m`?`l`:`L`);;){if(i.length==n[a])return i.unshift(r),t.push(i);if(i.length<n[a])throw Error(`malformed path data`);t.push([r].concat(i.splice(0,n[a])))}}),t}var a=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function o(e){var t=e.match(a);return t?t.map(Number):[]}}))(),1);function v_e(e,t){let n=(0,__e.default)(e),r=[],i=null,a=0,o=0;for(let e=0;e<n.length;e++){let s=n[e],c=s[0],l=s;switch(c){case`M`:a=l[1],o=l[2],t.moveTo(a,o);break;case`m`:a+=l[1],o+=l[2],t.moveTo(a,o);break;case`H`:a=l[1],t.lineTo(a,o);break;case`h`:a+=l[1],t.lineTo(a,o);break;case`V`:o=l[1],t.lineTo(a,o);break;case`v`:o+=l[1],t.lineTo(a,o);break;case`L`:a=l[1],o=l[2],t.lineTo(a,o);break;case`l`:a+=l[1],o+=l[2],t.lineTo(a,o);break;case`C`:a=l[5],o=l[6],t.bezierCurveTo(l[1],l[2],l[3],l[4],a,o);break;case`c`:t.bezierCurveTo(a+l[1],o+l[2],a+l[3],o+l[4],a+l[5],o+l[6]),a+=l[5],o+=l[6];break;case`S`:a=l[3],o=l[4],t.bezierCurveToShort(l[1],l[2],a,o);break;case`s`:t.bezierCurveToShort(a+l[1],o+l[2],a+l[3],o+l[4]),a+=l[3],o+=l[4];break;case`Q`:a=l[3],o=l[4],t.quadraticCurveTo(l[1],l[2],a,o);break;case`q`:t.quadraticCurveTo(a+l[1],o+l[2],a+l[3],o+l[4]),a+=l[3],o+=l[4];break;case`T`:a=l[1],o=l[2],t.quadraticCurveToShort(a,o);break;case`t`:a+=l[1],o+=l[2],t.quadraticCurveToShort(a,o);break;case`A`:a=l[6],o=l[7],t.arcToSvg(l[1],l[2],l[3],l[4],l[5],a,o);break;case`a`:a+=l[6],o+=l[7],t.arcToSvg(l[1],l[2],l[3],l[4],l[5],a,o);break;case`Z`:case`z`:t.closePath(),r.length>0&&(i=r.pop(),i?(a=i.startX,o=i.startY):(a=0,o=0)),i=null;break;default:h(`Unknown SVG path command: ${c}`)}c!==`Z`&&c!==`z`&&i===null&&(i={startX:a,startY:o},r.push(i))}return t}var y_e=class e{constructor(e=0,t=0,n=0){this.type=`circle`,this.x=e,this.y=t,this.radius=n}clone(){return new e(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return!1;let n=this.radius*this.radius,r=this.x-e,i=this.y-t;return r*=r,i*=i,r+i<=n}strokeContains(e,t,n,r=.5){if(this.radius===0)return!1;let i=this.x-e,a=this.y-t,o=this.radius,s=(1-r)*n,c=Math.sqrt(i*i+a*a);return c<=o+s&&c>o-(n-s)}getBounds(e){return e||=new k,e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}},b_e=class e{constructor(e=0,t=0,n=0,r=0){this.type=`ellipse`,this.x=e,this.y=t,this.halfWidth=n,this.halfHeight=r}clone(){return new e(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,t){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let n=(e-this.x)/this.halfWidth,r=(t-this.y)/this.halfHeight;return n*=n,r*=r,n+r<=1}strokeContains(e,t,n,r=.5){let{halfWidth:i,halfHeight:a}=this;if(i<=0||a<=0)return!1;let o=n*(1-r),s=n-o,c=i-s,l=a-s,u=i+o,d=a+o,f=e-this.x,p=t-this.y,m=f*f/(c*c)+p*p/(l*l),h=f*f/(u*u)+p*p/(d*d);return m>1&&h<=1}getBounds(e){return e||=new k,e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}};function x_e(e,t,n,r,i,a){let o=e-n,s=t-r,c=i-n,l=a-r,u=o*c+s*l,d=c*c+l*l,f=-1;d!==0&&(f=u/d);let p,m;f<0?(p=n,m=r):f>1?(p=i,m=a):(p=n+f*c,m=r+f*l);let h=e-p,g=t-m;return h*h+g*g}var S_e,C_e,tM=class e{constructor(...e){this.type=`polygon`;let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!=`number`){let e=[];for(let n=0,r=t.length;n<r;n++)e.push(t[n].x,t[n].y);t=e}this.points=t,this.closePath=!0}isClockwise(){let e=0,t=this.points,n=t.length;for(let r=0;r<n;r+=2){let i=t[r],a=t[r+1],o=t[(r+2)%n],s=t[(r+3)%n];e+=(o-i)*(s+a)}return e<0}containsPolygon(e){let t=this.getBounds(S_e),n=e.getBounds(C_e);if(!t.containsRect(n))return!1;let r=e.points;for(let e=0;e<r.length;e+=2){let t=r[e],n=r[e+1];if(!this.contains(t,n))return!1}return!0}clone(){let t=new e(this.points.slice());return t.closePath=this.closePath,t}contains(e,t){let n=!1,r=this.points.length/2;for(let i=0,a=r-1;i<r;a=i++){let r=this.points[i*2],o=this.points[i*2+1],s=this.points[a*2],c=this.points[a*2+1];o>t!=c>t&&e<(s-r)*((t-o)/(c-o))+r&&(n=!n)}return n}strokeContains(e,t,n,r=.5){let i=n*n,a=i*(1-r),o=i-a,{points:s}=this,c=s.length-(this.closePath?0:2);for(let n=0;n<c;n+=2){let r=s[n],i=s[n+1],c=s[(n+2)%s.length],l=s[(n+3)%s.length];if(x_e(e,t,r,i,c,l)<=(Math.sign((c-r)*(t-i)-(l-i)*(e-r))<0?o:a))return!0}return!1}getBounds(e){e||=new k;let t=this.points,n=1/0,r=-1/0,i=1/0,a=-1/0;for(let e=0,o=t.length;e<o;e+=2){let o=t[e],s=t[e+1];n=o<n?o:n,r=o>r?o:r,i=s<i?s:i,a=s>a?s:a}return e.x=n,e.width=r-n,e.y=i,e.height=a-i,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,t)=>`${e}, ${t}`,``)}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return ue(`8.11.0`,`Polygon.lastX is deprecated, please use Polygon.lastX instead.`),this.points[this.points.length-2]}get y(){return ue(`8.11.0`,`Polygon.y is deprecated, please use Polygon.lastY instead.`),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}},nM=(e,t,n,r,i,a,o)=>{let s=e-n,c=t-r,l=Math.sqrt(s*s+c*c);return l>=i-a&&l<=i+o},w_e=class e{constructor(e=0,t=0,n=0,r=0,i=20){this.type=`roundedRectangle`,this.x=e,this.y=t,this.width=n,this.height=r,this.radius=i}getBounds(e){return e||=new k,e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new e(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){let n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+n&&t<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;let r=e-(this.x+n),i=t-(this.y+n),a=n*n;if(r*r+i*i<=a||(r=e-(this.x+this.width-n),r*r+i*i<=a)||(i=t-(this.y+this.height-n),r*r+i*i<=a)||(r=e-(this.x+n),r*r+i*i<=a))return!0}return!1}strokeContains(e,t,n,r=.5){let{x:i,y:a,width:o,height:s,radius:c}=this,l=n*(1-r),u=n-l,d=i+c,f=a+c,p=o-c*2,m=s-c*2,h=i+o,g=a+s;return(e>=i-l&&e<=i+u||e>=h-u&&e<=h+l)&&t>=f&&t<=f+m||(t>=a-l&&t<=a+u||t>=g-u&&t<=g+l)&&e>=d&&e<=d+p?!0:e<d&&t<f&&nM(e,t,d,f,c,u,l)||e>h-c&&t<f&&nM(e,t,h-c,f,c,u,l)||e>h-c&&t>g-c&&nM(e,t,h-c,g-c,c,u,l)||e<d&&t>g-c&&nM(e,t,d,g-c,c,u,l)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}};function T_e(e,t,n,r,i,a,o,s=null){let c=0;n*=t,i*=a;let l=s.a,u=s.b,d=s.c,f=s.d,p=s.tx,m=s.ty;for(;c<o;){let o=e[n],s=e[n+1];r[i]=l*o+d*s+p,r[i+1]=u*o+f*s+m,i+=a,n+=t,c++}}function E_e(e,t,n,r){let i=0;for(t*=n;i<r;)e[t]=0,e[t+1]=0,t+=n,i++}function rM(e,t,n,r,i){let a=t.a,o=t.b,s=t.c,c=t.d,l=t.tx,u=t.ty;n||=0,r||=2,i||=e.length/r-n;let d=n*r;for(let t=0;t<i;t++){let t=e[d],n=e[d+1];e[d]=a*t+s*n+l,e[d+1]=o*t+c*n+u,d+=r}}var D_e=new s,iM=class{constructor(){this.packAsQuad=!1,this.batcherName=`default`,this.topology=`triangle-list`,this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:`normal`}get color(){let e=this.baseColor,t=e>>16|e&65280|(e&255)<<16,n=this.renderable;return n?b(t,n.groupColor)+(this.alpha*n.groupAlpha*255<<24):t+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||D_e}copyTo(e){e.indexOffset=this.indexOffset,e.indexSize=this.indexSize,e.attributeOffset=this.attributeOffset,e.attributeSize=this.attributeSize,e.baseColor=this.baseColor,e.alpha=this.alpha,e.texture=this.texture,e.geometryData=this.geometryData,e.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology=`triangle-list`}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}},aM={extension:{type:R.ShapeBuilder,name:`circle`},build(e,t){let n,r,i,a,o,s;if(e.type===`circle`){let t=e;if(o=s=t.radius,o<=0)return!1;n=t.x,r=t.y,i=a=0}else if(e.type===`ellipse`){let t=e;if(o=t.halfWidth,s=t.halfHeight,o<=0||s<=0)return!1;n=t.x,r=t.y,i=a=0}else{let t=e,c=t.width/2,l=t.height/2;n=t.x+c,r=t.y+l,o=s=Math.max(0,Math.min(t.radius,Math.min(c,l))),i=c-o,a=l-s}if(i<0||a<0)return!1;let c=Math.ceil(2.3*Math.sqrt(o+s)),l=c*8+(i?4:0)+(a?4:0);if(l===0)return!1;if(c===0)return t[0]=t[6]=n+i,t[1]=t[3]=r+a,t[2]=t[4]=n-i,t[5]=t[7]=r-a,!0;let u=0,d=c*4+(i?2:0)+2,f=d,p=l,m=i+o,h=a,g=n+m,_=n-m,v=r+h;if(t[u++]=g,t[u++]=v,t[--d]=v,t[--d]=_,a){let e=r-h;t[f++]=_,t[f++]=e,t[--p]=e,t[--p]=g}for(let e=1;e<c;e++){let l=Math.PI/2*(e/c),m=i+Math.cos(l)*o,h=a+Math.sin(l)*s,g=n+m,_=n-m,v=r+h,y=r-h;t[u++]=g,t[u++]=v,t[--d]=v,t[--d]=_,t[f++]=_,t[f++]=y,t[--p]=y,t[--p]=g}m=i,h=a+s,g=n+m,_=n-m,v=r+h;let y=r-h;return t[u++]=g,t[u++]=v,t[--p]=y,t[--p]=g,i&&(t[u++]=_,t[u++]=v,t[--p]=y,t[--p]=_),!0},triangulate(e,t,n,r,i,a){if(e.length===0)return;let o=0,s=0;for(let t=0;t<e.length;t+=2)o+=e[t],s+=e[t+1];o/=e.length/2,s/=e.length/2;let c=r;t[c*n]=o,t[c*n+1]=s;let l=c++;for(let r=0;r<e.length;r+=2)t[c*n]=e[r],t[c*n+1]=e[r+1],r>0&&(i[a++]=c,i[a++]=l,i[a++]=c-1),c++;i[a++]=l+1,i[a++]=l,i[a++]=c-1}},O_e={...aM,extension:{...aM.extension,name:`ellipse`}},k_e={...aM,extension:{...aM.extension,name:`roundedRectangle`}},oM=1e-4,sM=1e-4;function A_e(e){let t=e.length;if(t<6)return 1;let n=0;for(let r=0,i=e[t-2],a=e[t-1];r<t;r+=2){let t=e[r],o=e[r+1];n+=(t-i)*(o+a),i=t,a=o}return n<0?-1:1}function cM(e,t,n,r,i,a,o,s){let c=e-n*i,l=t-r*i,u=e+n*a,d=t+r*a,f,p;o?(f=r,p=-n):(f=-r,p=n);let m=c+f,h=l+p,g=u+f,_=d+p;return s.push(m,h),s.push(g,_),2}function lM(e,t,n,r,i,a,o,s){let c=n-e,l=r-t,u=Math.atan2(c,l),d=Math.atan2(i-e,a-t);s&&u<d?u+=Math.PI*2:!s&&u>d&&(d+=Math.PI*2);let f=u,p=d-u,m=Math.abs(p),h=Math.sqrt(c*c+l*l),g=(15*m*Math.sqrt(h)/Math.PI>>0)+1,_=p/g;if(f+=_,s){o.push(e,t),o.push(n,r);for(let n=1,r=f;n<g;n++,r+=_)o.push(e,t),o.push(e+Math.sin(r)*h,t+Math.cos(r)*h);o.push(e,t),o.push(i,a)}else{o.push(n,r),o.push(e,t);for(let n=1,r=f;n<g;n++,r+=_)o.push(e+Math.sin(r)*h,t+Math.cos(r)*h),o.push(e,t);o.push(i,a),o.push(e,t)}return g*2}function uM(e,t,n,r,i,a){let o=oM;if(e.length===0)return;let s=t,c=s.alignment;if(t.alignment!==.5){let t=A_e(e);n&&(t*=-1),c=(c-.5)*t+.5}let l=new F(e[0],e[1]),u=new F(e[e.length-2],e[e.length-1]),d=r,f=Math.abs(l.x-u.x)<o&&Math.abs(l.y-u.y)<o;if(d){e=e.slice(),f&&(e.pop(),e.pop(),u.set(e[e.length-2],e[e.length-1]));let t=(l.x+u.x)*.5,n=(u.y+l.y)*.5;e.unshift(t,n),e.push(t,n)}let p=i,m=e.length/2,h=e.length,g=p.length/2,_=s.width/2,v=_*_,y=s.miterLimit*s.miterLimit,b=e[0],x=e[1],S=e[2],C=e[3],w=0,T=0,E=-(x-C),D=b-S,O=0,k=0,A=Math.sqrt(E*E+D*D);E/=A,D/=A,E*=_,D*=_;let j=c,M=(1-j)*2,N=j*2;d||(s.cap===`round`?h+=lM(b-E*(M-N)*.5,x-D*(M-N)*.5,b-E*M,x-D*M,b+E*N,x+D*N,p,!0)+2:s.cap===`square`&&(h+=cM(b,x,E,D,M,N,!0,p))),p.push(b-E*M,x-D*M),p.push(b+E*N,x+D*N);for(let t=1;t<m-1;++t){b=e[(t-1)*2],x=e[(t-1)*2+1],S=e[t*2],C=e[t*2+1],w=e[(t+1)*2],T=e[(t+1)*2+1],E=-(x-C),D=b-S,A=Math.sqrt(E*E+D*D),E/=A,D/=A,E*=_,D*=_,O=-(C-T),k=S-w,A=Math.sqrt(O*O+k*k),O/=A,k/=A,O*=_,k*=_;let n=S-b,r=x-C,i=S-w,a=T-C,o=n*i+r*a,c=r*i-a*n,l=c<0;if(Math.abs(c)<.001*Math.abs(o)){p.push(S-E*M,C-D*M),p.push(S+E*N,C+D*N),o>=0&&(s.join===`round`?h+=lM(S,C,S-E*M,C-D*M,S-O*M,C-k*M,p,!1)+4:h+=2,p.push(S-O*N,C-k*N),p.push(S+O*M,C+k*M));continue}let u=(-E+b)*(-D+C)-(-E+S)*(-D+x),d=(-O+w)*(-k+C)-(-O+S)*(-k+T),f=(n*d-i*u)/c,m=(a*u-r*d)/c,g=(f-S)*(f-S)+(m-C)*(m-C),j=S+(f-S)*M,P=C+(m-C)*M,F=S-(f-S)*N,ee=C-(m-C)*N,te=Math.min(n*n+r*r,i*i+a*a),I=l?M:N;g<=te+I*I*v?s.join===`bevel`||g/v>y?(l?(p.push(j,P),p.push(S+E*N,C+D*N),p.push(j,P),p.push(S+O*N,C+k*N)):(p.push(S-E*M,C-D*M),p.push(F,ee),p.push(S-O*M,C-k*M),p.push(F,ee)),h+=2):s.join===`round`?l?(p.push(j,P),p.push(S+E*N,C+D*N),h+=lM(S,C,S+E*N,C+D*N,S+O*N,C+k*N,p,!0)+4,p.push(j,P),p.push(S+O*N,C+k*N)):(p.push(S-E*M,C-D*M),p.push(F,ee),h+=lM(S,C,S-E*M,C-D*M,S-O*M,C-k*M,p,!1)+4,p.push(S-O*M,C-k*M),p.push(F,ee)):(p.push(j,P),p.push(F,ee)):(p.push(S-E*M,C-D*M),p.push(S+E*N,C+D*N),s.join===`round`?l?h+=lM(S,C,S+E*N,C+D*N,S+O*N,C+k*N,p,!0)+2:h+=lM(S,C,S-E*M,C-D*M,S-O*M,C-k*M,p,!1)+2:s.join===`miter`&&g/v<=y&&(l?(p.push(F,ee),p.push(F,ee)):(p.push(j,P),p.push(j,P)),h+=2),p.push(S-O*M,C-k*M),p.push(S+O*N,C+k*N),h+=2)}b=e[(m-2)*2],x=e[(m-2)*2+1],S=e[(m-1)*2],C=e[(m-1)*2+1],E=-(x-C),D=b-S,A=Math.sqrt(E*E+D*D),E/=A,D/=A,E*=_,D*=_,p.push(S-E*M,C-D*M),p.push(S+E*N,C+D*N),d||(s.cap===`round`?h+=lM(S-E*(M-N)*.5,C-D*(M-N)*.5,S-E*M,C-D*M,S+E*N,C+D*N,p,!1)+2:s.cap===`square`&&(h+=cM(S,C,E,D,M,N,!1,p)));let P=sM*sM;for(let e=g;e<h+g-2;++e)b=p[e*2],x=p[e*2+1],S=p[(e+1)*2],C=p[(e+1)*2+1],w=p[(e+2)*2],T=p[(e+2)*2+1],!(Math.abs(b*(C-T)+S*(T-x)+w*(x-C))<P)&&a.push(e,e+1,e+2)}function j_e(e,t,n,r){let i=oM;if(e.length===0)return;let a=e[0],o=e[1],s=e[e.length-2],c=e[e.length-1],l=t||Math.abs(a-s)<i&&Math.abs(o-c)<i,u=n,d=e.length/2,f=u.length/2;for(let t=0;t<d;t++)u.push(e[t*2]),u.push(e[t*2+1]);for(let e=0;e<d-1;e++)r.push(f+e,f+e+1);l&&r.push(f+d-1,f)}function dM(e,t,n,r,i,a,o){let s=Le(e,t,2);if(!s)return;for(let e=0;e<s.length;e+=3)a[o++]=s[e]+i,a[o++]=s[e+1]+i,a[o++]=s[e+2]+i;let c=i*r;for(let t=0;t<e.length;t+=2)n[c]=e[t],n[c+1]=e[t+1],c+=r}var M_e=[],N_e={extension:{type:R.ShapeBuilder,name:`polygon`},build(e,t){for(let n=0;n<e.points.length;n++)t[n]=e.points[n];return!0},triangulate(e,t,n,r,i,a){dM(e,M_e,t,n,r,i,a)}},P_e={extension:{type:R.ShapeBuilder,name:`rectangle`},build(e,t){let n=e,r=n.x,i=n.y,a=n.width,o=n.height;return a>0&&o>0?(t[0]=r,t[1]=i,t[2]=r+a,t[3]=i,t[4]=r+a,t[5]=i+o,t[6]=r,t[7]=i+o,!0):!1},triangulate(e,t,n,r,i,a){let o=0;r*=n,t[r+o]=e[0],t[r+o+1]=e[1],o+=n,t[r+o]=e[2],t[r+o+1]=e[3],o+=n,t[r+o]=e[6],t[r+o+1]=e[7],o+=n,t[r+o]=e[4],t[r+o+1]=e[5],o+=n;let s=r/n;i[a++]=s,i[a++]=s+1,i[a++]=s+2,i[a++]=s+1,i[a++]=s+3,i[a++]=s+2}},F_e={extension:{type:R.ShapeBuilder,name:`triangle`},build(e,t){return t[0]=e.x,t[1]=e.y,t[2]=e.x2,t[3]=e.y2,t[4]=e.x3,t[5]=e.y3,!0},triangulate(e,t,n,r,i,a){let o=0;r*=n,t[r+o]=e[0],t[r+o+1]=e[1],o+=n,t[r+o]=e[2],t[r+o+1]=e[3],o+=n,t[r+o]=e[4],t[r+o+1]=e[5];let s=r/n;i[a++]=s,i[a++]=s+1,i[a++]=s+2}},fM=[{offset:0,color:`white`},{offset:1,color:`black`}],pM=class e{constructor(...t){this.uid=D(`fillGradient`),this._tick=0,this.type=`linear`,this.colorStops=[];let n=I_e(t);n={...n.type===`radial`?e.defaultRadialOptions:e.defaultLinearOptions,...p(n)},this._textureSize=n.textureSize,this._wrapMode=n.wrapMode,n.type===`radial`?(this.center=n.center,this.outerCenter=n.outerCenter??this.center,this.innerRadius=n.innerRadius,this.outerRadius=n.outerRadius,this.scale=n.scale,this.rotation=n.rotation):(this.start=n.start,this.end=n.end),this.textureSpace=n.textureSpace,this.type=n.type,n.colorStops.forEach(e=>{this.addColorStop(e.offset,e.color)})}addColorStop(e,t){return this.colorStops.push({offset:e,color:v.shared.setValue(t).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:e,y:t}=this.start,{x:n,y:r}=this.end,i=n-e,a=r-t,o=i<0||a<0;if(this._wrapMode===`clamp-to-edge`){if(i<0){let t=e;e=n,n=t,i*=-1}if(a<0){let e=t;t=r,r=e,a*=-1}}let c=this.colorStops.length?this.colorStops:fM,u=this._textureSize,{canvas:d,context:f}=gM(u,1),p=o?f.createLinearGradient(this._textureSize,0,0,0):f.createLinearGradient(0,0,this._textureSize,0);hM(p,c),f.fillStyle=p,f.fillRect(0,0,u,1),this.texture=new l({source:new xe({resource:d,addressMode:this._wrapMode})});let m=Math.sqrt(i*i+a*a),h=Math.atan2(a,i),g=new s;g.scale(m/u,1),g.rotate(h),g.translate(e,t),this.textureSpace===`local`&&g.scale(u,u),this.transform=g}buildGradient(){this.texture||this._tick++,this.type===`linear`?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;let e=this.colorStops.length?this.colorStops:fM,t=this._textureSize,{canvas:n,context:r}=gM(t,t),{x:i,y:a}=this.center,{x:o,y:c}=this.outerCenter,u=this.innerRadius,d=this.outerRadius,f=o-d,p=c-d,m=t/(d*2),h=(i-f)*m,g=(a-p)*m,_=r.createRadialGradient(h,g,u*m,(o-f)*m,(c-p)*m,d*m);hM(_,e),r.fillStyle=e[e.length-1].color,r.fillRect(0,0,t,t),r.fillStyle=_,r.translate(h,g),r.rotate(this.rotation),r.scale(1,this.scale),r.translate(-h,-g),r.fillRect(0,0,t,t),this.texture=new l({source:new xe({resource:n,addressMode:this._wrapMode})});let v=new s;v.scale(1/m,1/m),v.translate(f,p),this.textureSpace===`local`&&v.scale(t,t),this.transform=v}destroy(){this.texture?.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};pM.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:`local`,type:`linear`,textureSize:256,wrapMode:`clamp-to-edge`},pM.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:`local`,type:`radial`,textureSize:256,wrapMode:`clamp-to-edge`};var mM=pM;function hM(e,t){for(let n=0;n<t.length;n++){let r=t[n];e.addColorStop(r.offset,r.color)}}function gM(e,t){let n=ge.get().createCanvas(e,t);return{canvas:n,context:n.getContext(`2d`)}}function I_e(e){let t=e[0]??{};return(typeof t==`number`||e[1])&&(ue(`8.5.2`,`use options object instead`),t={type:`linear`,start:{x:e[0],y:e[1]},end:{x:e[2],y:e[3]},textureSpace:e[4],textureSize:e[5]??mM.defaultLinearOptions.textureSize}),t}var L_e=new s,R_e=new k;function _M(e,t,n,r){let i=t.matrix?e.copyFrom(t.matrix).invert():e.identity();if(t.textureSpace===`local`){let e=n.getBounds(R_e);t.width&&e.pad(t.width);let{x:r,y:a}=e,o=1/e.width,s=1/e.height,c=-r*o,l=-a*s,u=i.a,d=i.b,f=i.c,p=i.d;i.a*=o,i.b*=o,i.c*=s,i.d*=s,i.tx=c*u+l*f+i.tx,i.ty=c*d+l*p+i.ty}else i.translate(t.texture.frame.x,t.texture.frame.y),i.scale(1/t.texture.source.width,1/t.texture.source.height);let a=t.texture.source.style;return!(t.fill instanceof mM)&&a.addressMode===`clamp-to-edge`&&(a.addressMode=`repeat`,a.update()),r&&i.append(L_e.copyFrom(r).invert()),i}var vM={};L.handleByMap(R.ShapeBuilder,vM),L.add(P_e,N_e,F_e,aM,O_e,k_e);var z_e=new k,B_e=new s;function V_e(e,t){let{geometryData:n,batches:r}=t;r.length=0,n.indices.length=0,n.vertices.length=0,n.uvs.length=0;for(let t=0;t<e.instructions.length;t++){let i=e.instructions[t];if(i.action===`texture`)H_e(i.data,r,n);else if(i.action===`fill`||i.action===`stroke`){let e=i.action===`stroke`,t=i.data.path.shapePath,a=i.data.style,o=i.data.hole;e&&o&&yM(o.shapePath,a,!0,r,n),o&&(t.shapePrimitives[t.shapePrimitives.length-1].holes=o.shapePath.shapePrimitives),yM(t,a,e,r,n)}}}function H_e(e,t,n){let r=[],i=vM.rectangle,a=z_e;a.x=e.dx,a.y=e.dy,a.width=e.dw,a.height=e.dh;let o=e.transform;if(!i.build(a,r))return;let{vertices:s,uvs:c,indices:l}=n,u=l.length,d=s.length/2;o&&rM(r,o),i.triangulate(r,s,2,d,l,u);let f=e.image,p=f.uvs;c.push(p.x0,p.y0,p.x1,p.y1,p.x3,p.y3,p.x2,p.y2);let m=x.get(iM);m.indexOffset=u,m.indexSize=l.length-u,m.attributeOffset=d,m.attributeSize=s.length/2-d,m.baseColor=e.style,m.alpha=e.alpha,m.texture=f,m.geometryData=n,t.push(m)}function yM(e,t,n,r,i){let{vertices:a,uvs:o,indices:s}=i;e.shapePrimitives.forEach(({shape:e,transform:c,holes:u})=>{let d=[],f=vM[e.type];if(!f.build(e,d))return;let p=s.length,m=a.length/2,h=`triangle-list`;if(c&&rM(d,c),n){let n=e.closePath??!0,r=t;r.pixelLine?(j_e(d,n,a,s),h=`line-list`):uM(d,r,!1,n,a,s)}else if(u){let e=[],t=d.slice();U_e(u).forEach(n=>{e.push(t.length/2),t.push(...n)}),dM(t,e,a,2,m,s,p)}else f.triangulate(d,a,2,m,s,p);let g=o.length/2,_=t.texture;if(_!==l.WHITE){let n=_M(B_e,t,e,c);T_e(a,2,m,o,g,2,a.length/2-m,n)}else E_e(o,g,2,a.length/2-m);let v=x.get(iM);v.indexOffset=p,v.indexSize=s.length-p,v.attributeOffset=m,v.attributeSize=a.length/2-m,v.baseColor=t.color,v.alpha=t.alpha,v.texture=_,v.geometryData=i,v.topology=h,r.push(v)})}function U_e(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n].shape,i=[];vM[r.type].build(r,i)&&t.push(i)}return t}var W_e=class{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(e=>{x.return(e)}),this.graphicsData&&x.return(this.graphicsData),this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null}destroy(){this.reset(),this.batches=null,this.geometryData=null}},G_e=class{constructor(){this.instructions=new _e}init(e){let t=e.maxTextures;this.batcher?this.batcher._updateMaxTextures(t):this.batcher=new He({maxTextures:t}),this.instructions.reset()}get geometry(){return ue(O,`GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead.`),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}},bM=class e{constructor(e){this._renderer=e,this._managedContexts=new Ne({renderer:e,type:`resource`,name:`graphicsContext`})}init(t){e.defaultOptions.bezierSmoothness=t?.bezierSmoothness??e.defaultOptions.bezierSmoothness}getContextRenderData(e){return e._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(e)}updateGpuContext(e){let t=!!e._gpuData[this._renderer.uid],n=e._gpuData[this._renderer.uid]||this._initContext(e);if(e.dirty||!t){t&&n.reset(),V_e(e,n);let r=e.batchMode;e.customShader||r===`no-batch`?n.isBatchable=!1:r===`auto`?n.isBatchable=n.geometryData.vertices.length<400:n.isBatchable=!0,e.dirty=!1}return n}getGpuContext(e){return e._gpuData[this._renderer.uid]||this._initContext(e)}_initContextRenderData(e){let t=x.get(G_e,{maxTextures:this._renderer.limits.maxBatchableTextures}),n=e._gpuData[this._renderer.uid],{batches:r,geometryData:i}=n;n.graphicsData=t;let a=i.vertices.length,o=i.indices.length;for(let e=0;e<r.length;e++)r[e].applyTransform=!1;let s=t.batcher;s.ensureAttributeBuffer(a),s.ensureIndexBuffer(o),s.begin();for(let e=0;e<r.length;e++){let t=r[e];s.add(t)}s.finish(t.instructions);let c=s.geometry;c.indexBuffer.setDataWithSize(s.indexBuffer,s.indexSize,!0),c.buffers[0].setDataWithSize(s.attributeBuffer.float32View,s.attributeSize,!0);let l=s.batches;for(let e=0;e<l.length;e++){let t=l[e];t.bindGroup=Ze(t.textures.textures,t.textures.count,this._renderer.limits.maxBatchableTextures)}return t}_initContext(e){let t=new W_e;return t.context=e,e._gpuData[this._renderer.uid]=t,this._managedContexts.add(e),t}destroy(){this._managedContexts.destroy(),this._renderer=null}};bM.extension={type:[R.WebGLSystem,R.WebGPUSystem],name:`graphicsContext`},bM.defaultOptions={bezierSmoothness:.5};var xM=bM,K_e=8,SM=1.1920929e-7,q_e=1,CM=.01,wM=0,TM=0;function EM(e,t,n,r,i,a,o,s,c,l){let u=(q_e-Math.min(.99,Math.max(0,l??xM.defaultOptions.bezierSmoothness)))/1;return u*=u,J_e(t,n,r,i,a,o,s,c,e,u),e}function J_e(e,t,n,r,i,a,o,s,c,l){DM(e,t,n,r,i,a,o,s,c,l,0),c.push(o,s)}function DM(e,t,n,r,i,a,o,s,c,l,u){if(u>K_e)return;let d=Math.PI,f=(e+n)/2,p=(t+r)/2,m=(n+i)/2,h=(r+a)/2,g=(i+o)/2,_=(a+s)/2,v=(f+m)/2,y=(p+h)/2,b=(m+g)/2,x=(h+_)/2,S=(v+b)/2,C=(y+x)/2;if(u>0){let u=o-e,f=s-t,p=Math.abs((n-o)*f-(r-s)*u),m=Math.abs((i-o)*f-(a-s)*u),h,g;if(p>SM&&m>SM){if((p+m)*(p+m)<=l*(u*u+f*f)){if(wM<CM){c.push(S,C);return}let l=Math.atan2(a-r,i-n);if(h=Math.abs(l-Math.atan2(r-t,n-e)),g=Math.abs(Math.atan2(s-a,o-i)-l),h>=d&&(h=2*d-h),g>=d&&(g=2*d-g),h+g<wM){c.push(S,C);return}if(TM!==0){if(h>TM){c.push(n,r);return}if(g>TM){c.push(i,a);return}}}}else if(p>SM){if(p*p<=l*(u*u+f*f)){if(wM<CM){c.push(S,C);return}if(h=Math.abs(Math.atan2(a-r,i-n)-Math.atan2(r-t,n-e)),h>=d&&(h=2*d-h),h<wM){c.push(n,r),c.push(i,a);return}if(TM!==0&&h>TM){c.push(n,r);return}}}else if(m>SM){if(m*m<=l*(u*u+f*f)){if(wM<CM){c.push(S,C);return}if(h=Math.abs(Math.atan2(s-a,o-i)-Math.atan2(a-r,i-n)),h>=d&&(h=2*d-h),h<wM){c.push(n,r),c.push(i,a);return}if(TM!==0&&h>TM){c.push(i,a);return}}}else if(u=S-(e+o)/2,f=C-(t+s)/2,u*u+f*f<=l){c.push(S,C);return}}DM(e,t,f,p,v,y,S,C,c,l,u+1),DM(S,C,b,x,g,_,o,s,c,l,u+1)}var Y_e=8,X_e=1.1920929e-7,Z_e=1,Q_e=.01,OM=0;function $_e(e,t,n,r,i,a,o,s){let c=(Z_e-Math.min(.99,Math.max(0,s??xM.defaultOptions.bezierSmoothness)))/1;return c*=c,eve(t,n,r,i,a,o,e,c),e}function eve(e,t,n,r,i,a,o,s){kM(o,e,t,n,r,i,a,s,0),o.push(i,a)}function kM(e,t,n,r,i,a,o,s,c){if(c>Y_e)return;let l=Math.PI,u=(t+r)/2,d=(n+i)/2,f=(r+a)/2,p=(i+o)/2,m=(u+f)/2,h=(d+p)/2,g=a-t,_=o-n,v=Math.abs((r-a)*_-(i-o)*g);if(v>X_e){if(v*v<=s*(g*g+_*_)){if(OM<Q_e){e.push(m,h);return}let s=Math.abs(Math.atan2(o-i,a-r)-Math.atan2(i-n,r-t));if(s>=l&&(s=2*l-s),s<OM){e.push(m,h);return}}}else if(g=m-(t+a)/2,_=h-(n+o)/2,g*g+_*_<=s){e.push(m,h);return}kM(e,t,n,u,d,m,h,s,c+1),kM(e,m,h,f,p,a,o,s,c+1)}function AM(e,t,n,r,i,a,o,s){let c=Math.abs(i-a);(!o&&i>a||o&&a>i)&&(c=2*Math.PI-c),s||=Math.max(6,Math.floor(6*r**(1/3)*(c/Math.PI))),s=Math.max(s,3);let l=c/s,u=i;l*=o?-1:1;for(let i=0;i<s+1;i++){let i=Math.cos(u),a=Math.sin(u),o=t+i*r,s=n+a*r;e.push(o,s),u+=l}}function tve(e,t,n,r,i,a){let o=e[e.length-2],s=e[e.length-1]-n,c=o-t,l=i-n,u=r-t,d=Math.abs(s*u-c*l);if(d<1e-8||a===0){(e[e.length-2]!==t||e[e.length-1]!==n)&&e.push(t,n);return}let f=s*s+c*c,p=l*l+u*u,m=s*l+c*u,h=a*Math.sqrt(f)/d,g=a*Math.sqrt(p)/d,_=h*m/f,v=g*m/p,y=h*u+g*c,b=h*l+g*s,x=c*(g+_),S=s*(g+_),C=u*(h+v),w=l*(h+v),T=Math.atan2(S-b,x-y),E=Math.atan2(w-b,C-y);AM(e,y+t,b+n,a,T,E,c*l>u*s)}var jM=Math.PI*2,MM={centerX:0,centerY:0,ang1:0,ang2:0},NM=({x:e,y:t},n,r,i,a,o,s,c)=>{e*=n,t*=r;let l=i*e-a*t,u=a*e+i*t;return c.x=l+o,c.y=u+s,c};function nve(e,t){let n=t===-1.5707963267948966?-.551915024494:4/3*Math.tan(t/4),r=t===1.5707963267948966?.551915024494:n,i=Math.cos(e),a=Math.sin(e),o=Math.cos(e+t),s=Math.sin(e+t);return[{x:i-a*r,y:a+i*r},{x:o+s*r,y:s-o*r},{x:o,y:s}]}var PM=(e,t,n,r)=>{let i=e*r-t*n<0?-1:1,a=e*n+t*r;return a>1&&(a=1),a<-1&&(a=-1),i*Math.acos(a)},rve=(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=i**2,m=a**2,h=u**2,g=d**2,_=p*m-p*g-m*h;_<0&&(_=0),_/=p*g+m*h,_=Math.sqrt(_)*(o===s?-1:1);let v=_*i/a*d,y=_*-a/i*u,b=l*v-c*y+(e+n)/2,x=c*v+l*y+(t+r)/2,S=(u-v)/i,C=(d-y)/a,w=(-u-v)/i,T=(-d-y)/a,E=PM(1,0,S,C),D=PM(S,C,w,T);s===0&&D>0&&(D-=jM),s===1&&D<0&&(D+=jM),f.centerX=b,f.centerY=x,f.ang1=E,f.ang2=D};function ive(e,t,n,r,i,a,o,s=0,c=0,l=0){if(a===0||o===0)return;let u=Math.sin(s*jM/360),d=Math.cos(s*jM/360),f=d*(t-r)/2+u*(n-i)/2,p=-u*(t-r)/2+d*(n-i)/2;if(f===0&&p===0)return;a=Math.abs(a),o=Math.abs(o);let m=f**2/a**2+p**2/o**2;m>1&&(a*=Math.sqrt(m),o*=Math.sqrt(m)),rve(t,n,r,i,a,o,c,l,u,d,f,p,MM);let{ang1:h,ang2:g}=MM,{centerX:_,centerY:v}=MM,y=Math.abs(g)/(jM/4);Math.abs(1-y)<1e-7&&(y=1);let b=Math.max(Math.ceil(y),1);g/=b;let x=e[e.length-2],S=e[e.length-1],C={x:0,y:0};for(let t=0;t<b;t++){let t=nve(h,g),{x:n,y:r}=NM(t[0],a,o,d,u,_,v,C),{x:i,y:s}=NM(t[1],a,o,d,u,_,v,C),{x:c,y:l}=NM(t[2],a,o,d,u,_,v,C);EM(e,x,S,n,r,i,s,c,l),x=c,S=l,h+=g}}function ave(e,t,n){let r=(e,t)=>{let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);return{len:i,nx:n/i,ny:r/i}},i=(t,n)=>{t===0?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)},a=t[t.length-1];for(let o=0;o<t.length;o++){let s=t[o%t.length],c=s.radius??n;if(c<=0){i(o,s),a=s;continue}let l=t[(o+1)%t.length],u=r(s,a),d=r(s,l);if(u.len<1e-4||d.len<1e-4){i(o,s),a=s;continue}let f=Math.asin(u.nx*d.ny-u.ny*d.nx),p=1,m=!1;u.nx*d.nx-u.ny*-d.ny<0?f<0?f=Math.PI+f:(f=Math.PI-f,p=-1,m=!0):f>0&&(p=-1,m=!0);let h=f/2,g,_=Math.abs(Math.cos(h)*c/Math.sin(h));_>Math.min(u.len/2,d.len/2)?(_=Math.min(u.len/2,d.len/2),g=Math.abs(_*Math.sin(h)/Math.cos(h))):g=c;let v=s.x+d.nx*_+-d.ny*g*p,y=s.y+d.ny*_+d.nx*g*p,b=Math.atan2(u.ny,u.nx)+Math.PI/2*p,x=Math.atan2(d.ny,d.nx)-Math.PI/2*p;o===0&&e.moveTo(v+Math.cos(b)*g,y+Math.sin(b)*g),e.arc(v,y,g,b,x,m),a=s}}function ove(e,t,n,r){let i=(e,t)=>Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2),a=(e,t,n)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}),o=t.length;for(let s=0;s<o;s++){let c=t[(s+1)%o],l=c.radius??n;if(l<=0){s===0?e.moveTo(c.x,c.y):e.lineTo(c.x,c.y);continue}let u=t[s],d=t[(s+2)%o],f=i(u,c),p;p=f<1e-4?c:a(c,u,Math.min(f/2,l)/f);let m=i(d,c),h;h=m<1e-4?c:a(c,d,Math.min(m/2,l)/m),s===0?e.moveTo(p.x,p.y):e.lineTo(p.x,p.y),e.quadraticCurveTo(c.x,c.y,h.x,h.y,r)}}var sve=new k,cve=class{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new C,this._graphicsPath2D=e,this.signed=e.checkForHoles}moveTo(e,t){return this.startPoly(e,t),this}lineTo(e,t){this._ensurePoly();let n=this._currentPoly.points,r=n[n.length-2],i=n[n.length-1];return(r!==e||i!==t)&&n.push(e,t),this}arc(e,t,n,r,i,a){this._ensurePoly(!1);let o=this._currentPoly.points;return AM(o,e,t,n,r,i,a),this}arcTo(e,t,n,r,i){this._ensurePoly();let a=this._currentPoly.points;return tve(a,e,t,n,r,i),this}arcToSvg(e,t,n,r,i,a,o){let s=this._currentPoly.points;return ive(s,this._currentPoly.lastX,this._currentPoly.lastY,a,o,e,t,n,r,i),this}bezierCurveTo(e,t,n,r,i,a,o){this._ensurePoly();let s=this._currentPoly;return EM(this._currentPoly.points,s.lastX,s.lastY,e,t,n,r,i,a,o),this}quadraticCurveTo(e,t,n,r,i){this._ensurePoly();let a=this._currentPoly;return $_e(this._currentPoly.points,a.lastX,a.lastY,e,t,n,r,i),this}closePath(){return this.endPoly(!0),this}addPath(e,t){this.endPoly(),t&&!t.isIdentity()&&(e=e.clone(!0),e.transform(t));let n=this.shapePrimitives,r=n.length;for(let t=0;t<e.instructions.length;t++){let n=e.instructions[t];this[n.action](...n.data)}if(e.checkForHoles&&n.length-r>1){let e=null;for(let t=r;t<n.length;t++){let r=n[t];if(r.shape.type===`polygon`){let i=r.shape,a=e?.shape;a&&a.containsPolygon(i)?(e.holes||=[],e.holes.push(r),n.copyWithin(t,t+1),n.length--,t--):e=r}}}return this}finish(e=!1){this.endPoly(e)}rect(e,t,n,r,i){return this.drawShape(new k(e,t,n,r),i),this}circle(e,t,n,r){return this.drawShape(new y_e(e,t,n),r),this}poly(e,t,n){let r=new tM(e);return r.closePath=t,this.drawShape(r,n),this}regularPoly(e,t,n,r,i=0,a){r=Math.max(r|0,3);let o=-1*Math.PI/2+i,s=Math.PI*2/r,c=[];for(let i=0;i<r;i++){let r=o-i*s;c.push(e+n*Math.cos(r),t+n*Math.sin(r))}return this.poly(c,!0,a),this}roundPoly(e,t,n,r,i,a=0,o){if(r=Math.max(r|0,3),i<=0)return this.regularPoly(e,t,n,r,a);let s=n*Math.sin(Math.PI/r)-.001;i=Math.min(i,s);let c=-1*Math.PI/2+a,l=Math.PI*2/r,u=(r-2)*Math.PI/r/2;for(let a=0;a<r;a++){let r=a*l+c,s=e+n*Math.cos(r),d=t+n*Math.sin(r),f=r+Math.PI+u,p=r-Math.PI-u,m=s+i*Math.cos(f),h=d+i*Math.sin(f),g=s+i*Math.cos(p),_=d+i*Math.sin(p);a===0?this.moveTo(m,h):this.lineTo(m,h),this.quadraticCurveTo(s,d,g,_,o)}return this.closePath()}roundShape(e,t,n=!1,r){return e.length<3?this:(n?ove(this,e,t,r):ave(this,e,t),this.closePath())}filletRect(e,t,n,r,i){if(i===0)return this.rect(e,t,n,r);let a=Math.min(n,r)/2,o=Math.min(a,Math.max(-a,i)),s=e+n,c=t+r,l=o<0?-o:0,u=Math.abs(o);return this.moveTo(e,t+u).arcTo(e+l,t+l,e+u,t,u).lineTo(s-u,t).arcTo(s-l,t+l,s,t+u,u).lineTo(s,c-u).arcTo(s-l,c-l,e+n-u,c,u).lineTo(e+u,c).arcTo(e+l,c-l,e,c-u,u).closePath()}chamferRect(e,t,n,r,i,a){if(i<=0)return this.rect(e,t,n,r);let o=Math.min(i,Math.min(n,r)/2),s=e+n,c=t+r,l=[e+o,t,s-o,t,s,t+o,s,c-o,s-o,c,e+o,c,e,c-o,e,t+o];for(let e=l.length-1;e>=2;e-=2)l[e]===l[e-2]&&l[e-1]===l[e-3]&&l.splice(e-1,2);return this.poly(l,!0,a)}ellipse(e,t,n,r,i){return this.drawShape(new b_e(e,t,n,r),i),this}roundRect(e,t,n,r,i,a){return this.drawShape(new w_e(e,t,n,r,i),a),this}drawShape(e,t){return this.endPoly(),this.shapePrimitives.push({shape:e,transform:t}),this}startPoly(e,t){let n=this._currentPoly;return n&&this.endPoly(),n=new tM,n.points.push(e,t),this._currentPoly=n,this}endPoly(e=!1){let t=this._currentPoly;return t&&t.points.length>2&&(t.closePath=e,this.shapePrimitives.push({shape:t})),this._currentPoly=null,this}_ensurePoly(e=!0){if(!this._currentPoly&&(this._currentPoly=new tM,e)){let e=this.shapePrimitives[this.shapePrimitives.length-1];if(e){let t=e.shape.x,n=e.shape.y;if(e.transform&&!e.transform.isIdentity()){let r=e.transform,i=t;t=r.a*t+r.c*n+r.tx,n=r.b*i+r.d*n+r.ty}this._currentPoly.points.push(t,n)}else this._currentPoly.points.push(0,0)}}buildPath(){let e=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let t=0;t<e.instructions.length;t++){let n=e.instructions[t];this[n.action](...n.data)}this.finish()}get bounds(){let e=this._bounds;e.clear();let t=this.shapePrimitives;for(let n=0;n<t.length;n++){let r=t[n],i=r.shape.getBounds(sve);r.transform?e.addRect(i,r.transform):e.addRect(i)}return e}},FM=class e{constructor(e,t=!1){this.instructions=[],this.uid=D(`graphicsPath`),this._dirty=!0,this.checkForHoles=t,typeof e==`string`?v_e(e,this):this.instructions=e?.slice()??[]}get shapePath(){return this._shapePath||=new cve(this),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(e,t){return e=e.clone(),this.instructions.push({action:`addPath`,data:[e,t]}),this._dirty=!0,this}arc(...e){return this.instructions.push({action:`arc`,data:e}),this._dirty=!0,this}arcTo(...e){return this.instructions.push({action:`arcTo`,data:e}),this._dirty=!0,this}arcToSvg(...e){return this.instructions.push({action:`arcToSvg`,data:e}),this._dirty=!0,this}bezierCurveTo(...e){return this.instructions.push({action:`bezierCurveTo`,data:e}),this._dirty=!0,this}bezierCurveToShort(e,t,n,r,i){let a=this.instructions[this.instructions.length-1],o=this.getLastPoint(F.shared),s=0,c=0;if(!a||a.action!==`bezierCurveTo`)s=o.x,c=o.y;else{s=a.data[2],c=a.data[3];let e=o.x,t=o.y;s=e+(e-s),c=t+(t-c)}return this.instructions.push({action:`bezierCurveTo`,data:[s,c,e,t,n,r,i]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:`closePath`,data:[]}),this._dirty=!0,this}ellipse(...e){return this.instructions.push({action:`ellipse`,data:e}),this._dirty=!0,this}lineTo(...e){return this.instructions.push({action:`lineTo`,data:e}),this._dirty=!0,this}moveTo(...e){return this.instructions.push({action:`moveTo`,data:e}),this}quadraticCurveTo(...e){return this.instructions.push({action:`quadraticCurveTo`,data:e}),this._dirty=!0,this}quadraticCurveToShort(e,t,n){let r=this.instructions[this.instructions.length-1],i=this.getLastPoint(F.shared),a=0,o=0;if(!r||r.action!==`quadraticCurveTo`)a=i.x,o=i.y;else{a=r.data[0],o=r.data[1];let e=i.x,t=i.y;a=e+(e-a),o=t+(t-o)}return this.instructions.push({action:`quadraticCurveTo`,data:[a,o,e,t,n]}),this._dirty=!0,this}rect(e,t,n,r,i){return this.instructions.push({action:`rect`,data:[e,t,n,r,i]}),this._dirty=!0,this}circle(e,t,n,r){return this.instructions.push({action:`circle`,data:[e,t,n,r]}),this._dirty=!0,this}roundRect(...e){return this.instructions.push({action:`roundRect`,data:e}),this._dirty=!0,this}poly(...e){return this.instructions.push({action:`poly`,data:e}),this._dirty=!0,this}regularPoly(...e){return this.instructions.push({action:`regularPoly`,data:e}),this._dirty=!0,this}roundPoly(...e){return this.instructions.push({action:`roundPoly`,data:e}),this._dirty=!0,this}roundShape(...e){return this.instructions.push({action:`roundShape`,data:e}),this._dirty=!0,this}filletRect(...e){return this.instructions.push({action:`filletRect`,data:e}),this._dirty=!0,this}chamferRect(...e){return this.instructions.push({action:`chamferRect`,data:e}),this._dirty=!0,this}star(e,t,n,r,i,a,o){i||=r/2;let s=-1*Math.PI/2+a,c=n*2,l=Math.PI*2/c,u=[];for(let n=0;n<c;n++){let a=n%2?i:r,o=n*l+s;u.push(e+a*Math.cos(o),t+a*Math.sin(o))}return this.poly(u,!0,o),this}clone(t=!1){let n=new e;if(n.checkForHoles=this.checkForHoles,!t)n.instructions=this.instructions.slice();else for(let e=0;e<this.instructions.length;e++){let t=this.instructions[e];n.instructions.push({action:t.action,data:t.data.slice()})}return n}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(e){if(e.isIdentity())return this;let t=e.a,n=e.b,r=e.c,i=e.d,a=e.tx,o=e.ty,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0;for(let g=0;g<this.instructions.length;g++){let _=this.instructions[g],v=_.data;switch(_.action){case`moveTo`:case`lineTo`:s=v[0],c=v[1],v[0]=t*s+r*c+a,v[1]=n*s+i*c+o;break;case`bezierCurveTo`:l=v[0],u=v[1],d=v[2],f=v[3],s=v[4],c=v[5],v[0]=t*l+r*u+a,v[1]=n*l+i*u+o,v[2]=t*d+r*f+a,v[3]=n*d+i*f+o,v[4]=t*s+r*c+a,v[5]=n*s+i*c+o;break;case`quadraticCurveTo`:l=v[0],u=v[1],s=v[2],c=v[3],v[0]=t*l+r*u+a,v[1]=n*l+i*u+o,v[2]=t*s+r*c+a,v[3]=n*s+i*c+o;break;case`arcToSvg`:s=v[5],c=v[6],p=v[0],m=v[1],v[0]=t*p+r*m,v[1]=n*p+i*m,v[5]=t*s+r*c+a,v[6]=n*s+i*c+o;break;case`circle`:v[4]=IM(v[3],e);break;case`rect`:v[4]=IM(v[4],e);break;case`ellipse`:v[8]=IM(v[8],e);break;case`roundRect`:v[5]=IM(v[5],e);break;case`addPath`:v[0].transform(e);break;case`poly`:v[2]=IM(v[2],e);break;default:h(`unknown transform action`,_.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(e){let t=this.instructions.length-1,n=this.instructions[t];if(!n)return e.x=0,e.y=0,e;for(;n.action===`closePath`;){if(t--,t<0)return e.x=0,e.y=0,e;n=this.instructions[t]}switch(n.action){case`moveTo`:case`lineTo`:e.x=n.data[0],e.y=n.data[1];break;case`quadraticCurveTo`:e.x=n.data[2],e.y=n.data[3];break;case`bezierCurveTo`:e.x=n.data[4],e.y=n.data[5];break;case`arc`:case`arcToSvg`:e.x=n.data[5],e.y=n.data[6];break;case`addPath`:n.data[0].getLastPoint(e);break}return e}};function IM(e,t){return e?e.prepend(t):t.clone()}function LM(e,t,n){let r=e.getAttribute(t);return r?Number(r):n}function lve(e,t){let n=e.querySelectorAll(`defs`);for(let e=0;e<n.length;e++){let r=n[e];for(let e=0;e<r.children.length;e++){let n=r.children[e];switch(n.nodeName.toLowerCase()){case`lineargradient`:t.defs[n.id]=uve(n);break;case`radialgradient`:t.defs[n.id]=dve(n);break;default:break}}}}function uve(e){let t=new mM(LM(e,`x1`,0),LM(e,`y1`,0),LM(e,`x2`,1),LM(e,`y2`,0),(e.getAttribute(`gradientUnits`)||`objectBoundingBox`)===`objectBoundingBox`?`local`:`global`);for(let n=0;n<e.children.length;n++){let r=e.children[n],i=LM(r,`offset`,0),a=v.shared.setValue(r.getAttribute(`stop-color`)).toNumber();t.addColorStop(i,a)}return t}function dve(e){return h(`[SVG Parser] Radial gradients are not yet supported`),new mM(0,0,1,0)}function RM(e){let t=e.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return t?t[1]:``}var zM={fill:{type:`paint`,default:0},"fill-opacity":{type:`number`,default:1},stroke:{type:`paint`,default:0},"stroke-width":{type:`number`,default:1},"stroke-opacity":{type:`number`,default:1},"stroke-linecap":{type:`string`,default:`butt`},"stroke-linejoin":{type:`string`,default:`miter`},"stroke-miterlimit":{type:`number`,default:10},"stroke-dasharray":{type:`string`,default:`none`},"stroke-dashoffset":{type:`number`,default:0},opacity:{type:`number`,default:1}};function BM(e,t){let n=e.getAttribute(`style`),r={},i={},a={strokeStyle:r,fillStyle:i,useFill:!1,useStroke:!1};for(let n in zM){let r=e.getAttribute(n);r&&VM(t,a,n,r.trim())}if(n){let e=n.split(`;`);for(let n=0;n<e.length;n++){let[r,i]=e[n].trim().split(`:`);zM[r]&&VM(t,a,r,i.trim())}}return{strokeStyle:a.useStroke?r:null,fillStyle:a.useFill?i:null,useFill:a.useFill,useStroke:a.useStroke}}function VM(e,t,n,r){switch(n){case`stroke`:if(r!==`none`){if(r.startsWith(`url(`)){let n=RM(r);t.strokeStyle.fill=e.defs[n]}else t.strokeStyle.color=v.shared.setValue(r).toNumber();t.useStroke=!0}break;case`stroke-width`:t.strokeStyle.width=Number(r);break;case`fill`:if(r!==`none`){if(r.startsWith(`url(`)){let n=RM(r);t.fillStyle.fill=e.defs[n]}else t.fillStyle.color=v.shared.setValue(r).toNumber();t.useFill=!0}break;case`fill-opacity`:t.fillStyle.alpha=Number(r);break;case`stroke-opacity`:t.strokeStyle.alpha=Number(r);break;case`opacity`:t.fillStyle.alpha=Number(r),t.strokeStyle.alpha=Number(r);break}}function fve(e){if(e.length<=2)return!0;let t=e.map(e=>e.area).sort((e,t)=>t-e),[n,r]=t,i=t[t.length-1],a=n/r,o=r/i;return!(a>3&&o<2)}function pve(e){return e.split(/(?=[Mm])/).filter(e=>e.trim().length>0)}function mve(e){let t=e.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!t||t.length<4)return 0;let n=t.map(Number),r=[],i=[];for(let e=0;e<n.length;e+=2)e+1<n.length&&(r.push(n[e]),i.push(n[e+1]));if(r.length===0||i.length===0)return 0;let a=Math.min(...r),o=Math.max(...r),s=Math.min(...i),c=Math.max(...i);return(o-a)*(c-s)}function HM(e,t){let n=new FM(e,!1);for(let e of n.instructions)t.instructions.push(e)}function hve(e,t){if(typeof e==`string`){let t=document.createElement(`div`);t.innerHTML=e.trim(),e=t.querySelector(`svg`)}let n={context:t,defs:{},path:new FM};lve(e,n);let r=e.children,{fillStyle:i,strokeStyle:a}=BM(e,n);for(let e=0;e<r.length;e++){let t=r[e];t.nodeName.toLowerCase()!==`defs`&&UM(t,n,i,a)}return t}function UM(e,t,n,r){let i=e.children,{fillStyle:a,strokeStyle:o}=BM(e,t);a&&n?n={...n,...a}:a&&(n=a),o&&r?r={...r,...o}:o&&(r=o);let s=!n&&!r;s&&(n={color:0});let c,l,u,d,f,p,m,g,_,v,y,b,x,S,C,w,T;switch(e.nodeName.toLowerCase()){case`path`:{S=e.getAttribute(`d`);let i=e.getAttribute(`fill-rule`),a=pve(S),o=i===`evenodd`,s=a.length>1;if(o&&s){let e=a.map(e=>({path:e,area:mve(e)}));if(e.sort((e,t)=>t.area-e.area),a.length>3||!fve(e))for(let i=0;i<e.length;i++){let a=e[i],o=i===0;t.context.beginPath();let s=new FM(void 0,!0);HM(a.path,s),t.context.path(s),o?(n&&t.context.fill(n),r&&t.context.stroke(r)):t.context.cut()}else for(let i=0;i<e.length;i++){let a=e[i],o=i%2==1;t.context.beginPath();let s=new FM(void 0,!0);HM(a.path,s),t.context.path(s),o?t.context.cut():(n&&t.context.fill(n),r&&t.context.stroke(r))}}else C=new FM(S,i?i===`evenodd`:!0),t.context.path(C),n&&t.context.fill(n),r&&t.context.stroke(r);break}case`circle`:m=LM(e,`cx`,0),g=LM(e,`cy`,0),_=LM(e,`r`,0),t.context.ellipse(m,g,_,_),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`rect`:c=LM(e,`x`,0),l=LM(e,`y`,0),w=LM(e,`width`,0),T=LM(e,`height`,0),v=LM(e,`rx`,0),y=LM(e,`ry`,0),v||y?t.context.roundRect(c,l,w,T,v||y):t.context.rect(c,l,w,T),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`ellipse`:m=LM(e,`cx`,0),g=LM(e,`cy`,0),v=LM(e,`rx`,0),y=LM(e,`ry`,0),t.context.beginPath(),t.context.ellipse(m,g,v,y),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`line`:u=LM(e,`x1`,0),d=LM(e,`y1`,0),f=LM(e,`x2`,0),p=LM(e,`y2`,0),t.context.beginPath(),t.context.moveTo(u,d),t.context.lineTo(f,p),r&&t.context.stroke(r);break;case`polygon`:x=e.getAttribute(`points`),b=x.match(/-?\d+/g).map(e=>parseInt(e,10)),t.context.poly(b,!0),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`polyline`:x=e.getAttribute(`points`),b=x.match(/-?\d+/g).map(e=>parseInt(e,10)),t.context.poly(b,!1),r&&t.context.stroke(r);break;case`g`:case`svg`:break;default:h(`[SVG parser] <${e.nodeName}> elements unsupported`);break}s&&(n=null);for(let e=0;e<i.length;e++)UM(i[e],t,n,r)}var WM={repeat:{addressModeU:`repeat`,addressModeV:`repeat`},"repeat-x":{addressModeU:`repeat`,addressModeV:`clamp-to-edge`},"repeat-y":{addressModeU:`clamp-to-edge`,addressModeV:`repeat`},"no-repeat":{addressModeU:`clamp-to-edge`,addressModeV:`clamp-to-edge`}},GM=class{constructor(e,t){this.uid=D(`fillPattern`),this._tick=0,this.transform=new s,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),t&&(e.source.style.addressModeU=WM[t].addressModeU,e.source.style.addressModeV=WM[t].addressModeV)}setTransform(e){let t=this.texture;this.transform.copyFrom(e),this.transform.invert(),this.transform.scale(1/t.frame.width,1/t.frame.height),this._tick++}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture=e,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}};function gve(e){return v.isColorLike(e)}function KM(e){return e instanceof GM}function qM(e){return e instanceof mM}function _ve(e){return e instanceof l}function vve(e,t,n){let r=v.shared.setValue(t??0);return e.color=r.toNumber(),e.alpha=r.alpha===1?n.alpha:r.alpha,e.texture=l.WHITE,{...n,...e}}function yve(e,t,n){return e.texture=t,{...n,...e}}function JM(e,t,n){return e.fill=t,e.color=16777215,e.texture=t.texture,e.matrix=t.transform,{...n,...e}}function YM(e,t,n){return t.buildGradient(),e.fill=t,e.color=16777215,e.texture=t.texture,e.matrix=t.transform,e.textureSpace=t.textureSpace,{...n,...e}}function bve(e,t){let n={...t,...e},r=v.shared.setValue(n.color);return n.alpha*=r.alpha,n.color=r.toNumber(),n}function XM(e,t){if(e==null)return null;let n={},r=e;return gve(e)?vve(n,e,t):_ve(e)?yve(n,e,t):KM(e)?JM(n,e,t):qM(e)?YM(n,e,t):r.fill&&KM(r.fill)?JM(r,r.fill,t):r.fill&&qM(r.fill)?YM(r,r.fill,t):bve(r,t)}function ZM(e,t){let{width:n,alignment:r,miterLimit:i,cap:a,join:o,pixelLine:s,...c}=t,l=XM(e,c);return l?{width:n,alignment:r,miterLimit:i,cap:a,join:o,pixelLine:s,...l}:null}var xve=new F,QM=new s,$M=class e extends me{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=D(`graphicsContext`),this.dirty=!0,this.batchMode=`auto`,this.instructions=[],this.destroyed=!1,this._activePath=new FM,this._transform=new s,this._fillStyle={...e.defaultFillStyle},this._strokeStyle={...e.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new C,this._boundsDirty=!0}clone(){let t=new e;return t.batchMode=this.batchMode,t.instructions=this.instructions.slice(),t._activePath=this._activePath.clone(),t._transform=this._transform.clone(),t._fillStyle={...this._fillStyle},t._strokeStyle={...this._strokeStyle},t._stateStack=this._stateStack.slice(),t._bounds=this._bounds.clone(),t._boundsDirty=!0,t}get fillStyle(){return this._fillStyle}set fillStyle(t){this._fillStyle=XM(t,e.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=ZM(t,e.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=XM(t,e.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=XM(t,e.defaultStrokeStyle),this}texture(e,t,n,r,i,a){return this.instructions.push({action:`texture`,data:{image:e,dx:n||0,dy:r||0,dw:i||e.frame.width,dh:a||e.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:t||t===0?v.shared.setValue(t).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new FM,this}fill(t,n){let r,i=this.instructions[this.instructions.length-1];return r=this._tick===0&&i?.action===`stroke`?i.data.path:this._activePath.clone(),r?(t!=null&&(n!==void 0&&typeof t==`number`&&(ue(g,`GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead`),t={color:t,alpha:n}),this._fillStyle=XM(t,e.defaultFillStyle)),this.instructions.push({action:`fill`,data:{style:this.fillStyle,path:r}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){let{x:e,y:t}=this._activePath.getLastPoint(F.shared);this._activePath.clear(),this._activePath.moveTo(e,t)}stroke(t){let n,r=this.instructions[this.instructions.length-1];return n=this._tick===0&&r?.action===`fill`?r.data.path:this._activePath.clone(),n?(t!=null&&(this._strokeStyle=ZM(t,e.defaultStrokeStyle)),this.instructions.push({action:`stroke`,data:{style:this.strokeStyle,path:n}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let e=0;e<2;e++){let t=this.instructions[this.instructions.length-1-e],n=this._activePath.clone();if(t&&(t.action===`stroke`||t.action===`fill`))if(t.data.hole)t.data.hole.addPath(n);else{t.data.hole=n;break}}return this._initNextPathLocation(),this}arc(e,t,n,r,i,a){this._tick++;let o=this._transform;return this._activePath.arc(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,n,r,i,a),this}arcTo(e,t,n,r,i){this._tick++;let a=this._transform;return this._activePath.arcTo(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty,a.a*n+a.c*r+a.tx,a.b*n+a.d*r+a.ty,i),this}arcToSvg(e,t,n,r,i,a,o){this._tick++;let s=this._transform;return this._activePath.arcToSvg(e,t,n,r,i,s.a*a+s.c*o+s.tx,s.b*a+s.d*o+s.ty),this}bezierCurveTo(e,t,n,r,i,a,o){this._tick++;let s=this._transform;return this._activePath.bezierCurveTo(s.a*e+s.c*t+s.tx,s.b*e+s.d*t+s.ty,s.a*n+s.c*r+s.tx,s.b*n+s.d*r+s.ty,s.a*i+s.c*a+s.tx,s.b*i+s.d*a+s.ty,o),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(e,t,n,r){return this._tick++,this._activePath.ellipse(e,t,n,r,this._transform.clone()),this}circle(e,t,n){return this._tick++,this._activePath.circle(e,t,n,this._transform.clone()),this}path(e){return this._tick++,this._activePath.addPath(e,this._transform.clone()),this}lineTo(e,t){this._tick++;let n=this._transform;return this._activePath.lineTo(n.a*e+n.c*t+n.tx,n.b*e+n.d*t+n.ty),this}moveTo(e,t){this._tick++;let n=this._transform,r=this._activePath.instructions,i=n.a*e+n.c*t+n.tx,a=n.b*e+n.d*t+n.ty;return r.length===1&&r[0].action===`moveTo`?(r[0].data[0]=i,r[0].data[1]=a,this):(this._activePath.moveTo(i,a),this)}quadraticCurveTo(e,t,n,r,i){this._tick++;let a=this._transform;return this._activePath.quadraticCurveTo(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty,a.a*n+a.c*r+a.tx,a.b*n+a.d*r+a.ty,i),this}rect(e,t,n,r){return this._tick++,this._activePath.rect(e,t,n,r,this._transform.clone()),this}roundRect(e,t,n,r,i){return this._tick++,this._activePath.roundRect(e,t,n,r,i,this._transform.clone()),this}poly(e,t){return this._tick++,this._activePath.poly(e,t,this._transform.clone()),this}regularPoly(e,t,n,r,i=0,a){return this._tick++,this._activePath.regularPoly(e,t,n,r,i,a),this}roundPoly(e,t,n,r,i,a){return this._tick++,this._activePath.roundPoly(e,t,n,r,i,a),this}roundShape(e,t,n,r){return this._tick++,this._activePath.roundShape(e,t,n,r),this}filletRect(e,t,n,r,i){return this._tick++,this._activePath.filletRect(e,t,n,r,i),this}chamferRect(e,t,n,r,i,a){return this._tick++,this._activePath.chamferRect(e,t,n,r,i,a),this}star(e,t,n,r,i=0,a=0){return this._tick++,this._activePath.star(e,t,n,r,i,a,this._transform.clone()),this}svg(e){return this._tick++,hve(e,this),this}restore(){let e=this._stateStack.pop();return e&&(this._transform=e.transform,this._fillStyle=e.fillStyle,this._strokeStyle=e.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(e){return this._transform.rotate(e),this}scale(e,t=e){return this._transform.scale(e,t),this}setTransform(e,t,n,r,i,a){return e instanceof s?(this._transform.set(e.a,e.b,e.c,e.d,e.tx,e.ty),this):(this._transform.set(e,t,n,r,i,a),this)}transform(e,t,n,r,i,a){return e instanceof s?(this._transform.append(e),this):(QM.set(e,t,n,r,i,a),this._transform.append(QM),this)}translate(e,t=e){return this._transform.translate(e,t),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,!this.dirty&&(this.emit(`update`,this,16),this.dirty=!0)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;let e=this._bounds;e.clear();for(let t=0;t<this.instructions.length;t++){let n=this.instructions[t],r=n.action;if(r===`fill`){let t=n.data;e.addBounds(t.path.bounds)}else if(r===`texture`){let t=n.data;e.addFrame(t.dx,t.dy,t.dx+t.dw,t.dy+t.dh,t.transform)}if(r===`stroke`){let t=n.data,r=t.style.alignment,i=t.style.width*(1-r),a=t.path.bounds;e.addFrame(a.minX-i,a.minY-i,a.maxX+i,a.maxY+i)}}return e}containsPoint(e){if(!this.bounds.containsPoint(e.x,e.y))return!1;let t=this.instructions,n=!1;for(let r=0;r<t.length;r++){let i=t[r],a=i.data,o=a.path;if(!i.action||!o)continue;let s=a.style,c=o.shapePath.shapePrimitives;for(let t=0;t<c.length;t++){let r=c[t].shape;if(!s||!r)continue;let o=c[t].transform,l=o?o.applyInverse(e,xve):e;if(i.action===`fill`)n=r.contains(l.x,l.y);else{let e=s;n=r.strokeContains(l.x,l.y,e.width,e.alignment)}let u=a.hole;if(u){let e=u.shapePath?.shapePrimitives;if(e)for(let t=0;t<e.length;t++)e[t].shape.contains(l.x,l.y)&&(n=!1)}if(n)return!0}}return n}unload(){this.emit(`unload`,this);for(let e in this._gpuData)this._gpuData[e]?.destroy();this._gpuData=Object.create(null)}destroy(e=!1){if(!this.destroyed){if(this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit(`destroy`,this),this.removeAllListeners(),typeof e==`boolean`?e:e?.texture){let t=typeof e==`boolean`?e:e?.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&`uid`in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(t)),this._strokeStyle.texture&&(this._strokeStyle.fill&&`uid`in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(t))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}}};$M.defaultFillStyle={color:16777215,alpha:1,texture:l.WHITE,matrix:null,fill:null,textureSpace:`local`},$M.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:`butt`,join:`miter`,texture:l.WHITE,matrix:null,fill:null,textureSpace:`local`,pixelLine:!1};var eN=$M,tN=new class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this._tickerAdded||!this.domElement||(I.system.add(this._tickerUpdate,this,te.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&=(I.system.remove(this._tickerUpdate,this),!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}let e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType===`touch`||globalThis.document.dispatchEvent(this.events.supportsPointerEvents?new PointerEvent(`pointermove`,{clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,pointerId:e.pointerId}):new MouseEvent(`mousemove`,{clientX:e.clientX,clientY:e.clientY}))}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this._update())}destroy(){this.removeTickerListener(),this.events=null,this.domElement=null,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}},nN=class extends Ej{constructor(){super(...arguments),this.client=new F,this.movement=new F,this.offset=new F,this.global=new F,this.screen=new F}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(e,t,n){return e.worldTransform.applyInverse(n||this.global,t)}getModifierState(e){return`getModifierState`in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){throw Error(`Method not implemented.`)}},rN=class extends nN{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type===`pointermove`||this.type===`mousemove`||this.type===`touchmove`?[this]:[]}getPredictedEvents(){throw Error(`getPredictedEvents is not supported!`)}},iN=class extends nN{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}};iN.DOM_DELTA_PIXEL=0,iN.DOM_DELTA_LINE=1,iN.DOM_DELTA_PAGE=2;var Sve=2048,Cve=new F,aN=new F,wve=class{constructor(e){this.dispatch=new me,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=e,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping(`pointerdown`,this.mapPointerDown),this.addEventMapping(`pointermove`,this.mapPointerMove),this.addEventMapping(`pointerout`,this.mapPointerOut),this.addEventMapping(`pointerleave`,this.mapPointerOut),this.addEventMapping(`pointerover`,this.mapPointerOver),this.addEventMapping(`pointerup`,this.mapPointerUp),this.addEventMapping(`pointerupoutside`,this.mapPointerUpOutside),this.addEventMapping(`wheel`,this.mapWheel)}addEventMapping(e,t){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:t,priority:0}),this.mappingTable[e].sort((e,t)=>e.priority-t.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;let t=this.mappingTable[e.type];if(t)for(let n=0,r=t.length;n<r;n++)t[n].fn(e);else h(`[EventBoundary]: Event mapping not defined for ${e.type}`)}hitTest(e,t){tN.pauseUpdate=!0;let n=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?`hitTestMoveRecursive`:`hitTestRecursive`,r=this[n](this.rootTarget,this.rootTarget.eventMode,Cve.set(e,t),this.hitTestFn,this.hitPruneFn);return r&&r[0]}propagate(e,t){if(!e.target)return;let n=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(let r=0,i=n.length-1;r<i;r++)if(e.currentTarget=n[r],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,t),!(e.propagationStopped||e.propagationImmediatelyStopped)){e.eventPhase=e.BUBBLING_PHASE;for(let r=n.length-2;r>=0;r--)if(e.currentTarget=n[r],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,n=this._allInteractiveElements){if(n.length===0)return;e.eventPhase=e.BUBBLING_PHASE;let r=Array.isArray(t)?t:[t];for(let t=n.length-1;t>=0;t--)r.forEach(r=>{e.currentTarget=n[t],this.notifyTarget(e,r)})}propagationPath(e){let t=[e];for(let n=0;n<Sve&&e!==this.rootTarget&&e.parent;n++){if(!e.parent)throw Error(`Cannot find propagation path to disconnected target`);t.push(e.parent),e=e.parent}return t.reverse(),t}hitTestMoveRecursive(e,t,n,r,i,a=!1){let o=!1;if(this._interactivePrune(e))return null;if((e.eventMode===`dynamic`||t===`dynamic`)&&(tN.pauseUpdate=!1),e.interactiveChildren&&e.children){let s=e.children;for(let c=s.length-1;c>=0;c--){let l=s[c],u=this.hitTestMoveRecursive(l,this._isInteractive(t)?t:l.eventMode,n,r,i,a||i(e,n));if(u){if(u.length>0&&!u[u.length-1].parent)continue;let t=e.isInteractive();(u.length>0||t)&&(t&&this._allInteractiveElements.push(e),u.push(e)),this._hitElements.length===0&&(this._hitElements=u),o=!0}}}let s=this._isInteractive(t),c=e.isInteractive();return c&&c&&this._allInteractiveElements.push(e),a||this._hitElements.length>0?null:o?this._hitElements:s&&!i(e,n)&&r(e,n)?c?[e]:[]:null}hitTestRecursive(e,t,n,r,i){if(this._interactivePrune(e)||i(e,n))return null;if((e.eventMode===`dynamic`||t===`dynamic`)&&(tN.pauseUpdate=!1),e.interactiveChildren&&e.children){let a=e.children,o=n;for(let n=a.length-1;n>=0;n--){let s=a[n],c=this.hitTestRecursive(s,this._isInteractive(t)?t:s.eventMode,o,r,i);if(c){if(c.length>0&&!c[c.length-1].parent)continue;let t=e.isInteractive();return(c.length>0||t)&&c.push(e),c}}}let a=this._isInteractive(t),o=e.isInteractive();return a&&r(e,n)?o?[e]:[]:null}_isInteractive(e){return e===`static`||e===`dynamic`}_interactivePrune(e){return!e||!e.visible||!e.renderable||!e.measurable||e.eventMode===`none`||e.eventMode===`passive`&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,aN),!e.hitArea.contains(aN.x,aN.y)))return!0;if(e.effects&&e.effects.length)for(let n=0;n<e.effects.length;n++){let r=e.effects[n];if(r.containsPoint&&!r.containsPoint(t,this.hitTestFn))return!0}return!1}hitTestFn(e,t){return e.hitArea?!0:e?.containsPoint?(e.worldTransform.applyInverse(t,aN),e.containsPoint(aN)):!1}notifyTarget(e,t){if(!e.currentTarget.isInteractive())return;t??=e.type;let n=`on${t}`;e.currentTarget[n]?.(e);let r=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this._notifyListeners(e,r),e.eventPhase===e.AT_TARGET&&this._notifyListeners(e,t)}mapPointerDown(e){if(!(e instanceof rN)){h(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.createPointerEvent(e);if(this.dispatchEvent(t,`pointerdown`),t.pointerType===`touch`)this.dispatchEvent(t,`touchstart`);else if(t.pointerType===`mouse`||t.pointerType===`pen`){let e=t.button===2;this.dispatchEvent(t,e?`rightdown`:`mousedown`)}let n=this.trackingData(e.pointerId);n.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){if(!(e instanceof rN)){h(`EventBoundary cannot map a non-pointer event as a pointer event`);return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;let t=this.createPointerEvent(e);this._isPointerMoveEvent=!1;let n=t.pointerType===`mouse`||t.pointerType===`pen`,r=this.trackingData(e.pointerId),i=this.findMountedTarget(r.overTargets);if(r.overTargets?.length>0&&i!==t.target){let r=e.type===`mousemove`?`mouseout`:`pointerout`,a=this.createPointerEvent(e,r,i);if(this.dispatchEvent(a,`pointerout`),n&&this.dispatchEvent(a,`mouseout`),!t.composedPath().includes(i)){let r=this.createPointerEvent(e,`pointerleave`,i);for(r.eventPhase=r.AT_TARGET;r.target&&!t.composedPath().includes(r.target);)r.currentTarget=r.target,this.notifyTarget(r),n&&this.notifyTarget(r,`mouseleave`),r.target=r.target.parent;this.freeEvent(r)}this.freeEvent(a)}if(i!==t.target){let r=e.type===`mousemove`?`mouseover`:`pointerover`,a=this.clonePointerEvent(t,r);this.dispatchEvent(a,`pointerover`),n&&this.dispatchEvent(a,`mouseover`);let o=i?.parent;for(;o&&o!==this.rootTarget.parent&&o!==t.target;)o=o.parent;if(!o||o===this.rootTarget.parent){let e=this.clonePointerEvent(t,`pointerenter`);for(e.eventPhase=e.AT_TARGET;e.target&&e.target!==i&&e.target!==this.rootTarget.parent;)e.currentTarget=e.target,this.notifyTarget(e),n&&this.notifyTarget(e,`mouseenter`),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(a)}let a=[],o=this.enableGlobalMoveEvents??!0;this.moveOnAll?a.push(`pointermove`):this.dispatchEvent(t,`pointermove`),o&&a.push(`globalpointermove`),t.pointerType===`touch`&&(this.moveOnAll?a.splice(1,0,`touchmove`):this.dispatchEvent(t,`touchmove`),o&&a.push(`globaltouchmove`)),n&&(this.moveOnAll?a.splice(1,0,`mousemove`):this.dispatchEvent(t,`mousemove`),o&&a.push(`globalmousemove`),this.cursor=t.target?.cursor),a.length>0&&this.all(t,a),this._allInteractiveElements.length=0,this._hitElements.length=0,r.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){if(!(e instanceof rN)){h(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.trackingData(e.pointerId),n=this.createPointerEvent(e),r=n.pointerType===`mouse`||n.pointerType===`pen`;this.dispatchEvent(n,`pointerover`),r&&this.dispatchEvent(n,`mouseover`),n.pointerType===`mouse`&&(this.cursor=n.target?.cursor);let i=this.clonePointerEvent(n,`pointerenter`);for(i.eventPhase=i.AT_TARGET;i.target&&i.target!==this.rootTarget.parent;)i.currentTarget=i.target,this.notifyTarget(i),r&&this.notifyTarget(i,`mouseenter`),i.target=i.target.parent;t.overTargets=n.composedPath(),this.freeEvent(n),this.freeEvent(i)}mapPointerOut(e){if(!(e instanceof rN)){h(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.trackingData(e.pointerId);if(t.overTargets){let n=e.pointerType===`mouse`||e.pointerType===`pen`,r=this.findMountedTarget(t.overTargets),i=this.createPointerEvent(e,`pointerout`,r);this.dispatchEvent(i),n&&this.dispatchEvent(i,`mouseout`);let a=this.createPointerEvent(e,`pointerleave`,r);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),n&&this.notifyTarget(a,`mouseleave`),a.target=a.target.parent;t.overTargets=null,this.freeEvent(i),this.freeEvent(a)}this.cursor=null}mapPointerUp(e){if(!(e instanceof rN)){h(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=performance.now(),n=this.createPointerEvent(e);if(this.dispatchEvent(n,`pointerup`),n.pointerType===`touch`)this.dispatchEvent(n,`touchend`);else if(n.pointerType===`mouse`||n.pointerType===`pen`){let e=n.button===2;this.dispatchEvent(n,e?`rightup`:`mouseup`)}let r=this.trackingData(e.pointerId),i=this.findMountedTarget(r.pressTargetsByButton[e.button]),a=i;if(i&&!n.composedPath().includes(i)){let t=i;for(;t&&!n.composedPath().includes(t);){if(n.currentTarget=t,this.notifyTarget(n,`pointerupoutside`),n.pointerType===`touch`)this.notifyTarget(n,`touchendoutside`);else if(n.pointerType===`mouse`||n.pointerType===`pen`){let e=n.button===2;this.notifyTarget(n,e?`rightupoutside`:`mouseupoutside`)}t=t.parent}delete r.pressTargetsByButton[e.button],a=t}if(a){let i=this.clonePointerEvent(n,`click`);i.target=a,i.path=null,r.clicksByButton[e.button]||(r.clicksByButton[e.button]={clickCount:0,target:i.target,timeStamp:t});let o=r.clicksByButton[e.button];if(o.target===i.target&&t-o.timeStamp<200?++o.clickCount:o.clickCount=1,o.target=i.target,o.timeStamp=t,i.detail=o.clickCount,i.pointerType===`mouse`){let e=i.button===2;this.dispatchEvent(i,e?`rightclick`:`click`)}else i.pointerType===`touch`&&this.dispatchEvent(i,`tap`);this.dispatchEvent(i,`pointertap`),this.freeEvent(i)}this.freeEvent(n)}mapPointerUpOutside(e){if(!(e instanceof rN)){h(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.trackingData(e.pointerId),n=this.findMountedTarget(t.pressTargetsByButton[e.button]),r=this.createPointerEvent(e);if(n){let i=n;for(;i;)r.currentTarget=i,this.notifyTarget(r,`pointerupoutside`),r.pointerType===`touch`?this.notifyTarget(r,`touchendoutside`):(r.pointerType===`mouse`||r.pointerType===`pen`)&&this.notifyTarget(r,r.button===2?`rightupoutside`:`mouseupoutside`),i=i.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(r)}mapWheel(e){if(!(e instanceof iN)){h(`EventBoundary cannot map a non-wheel event as a wheel event`);return}let t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let n=1;n<e.length&&e[n].parent===t;n++)t=e[n];return t}createPointerEvent(e,t,n){let r=this.allocateEvent(rN);return this.copyPointerData(e,r),this.copyMouseData(e,r),this.copyData(e,r),r.nativeEvent=e.nativeEvent,r.originalEvent=e,r.target=n??this.hitTest(r.global.x,r.global.y)??this._hitElements[0],typeof t==`string`&&(r.type=t),r}createWheelEvent(e){let t=this.allocateEvent(iN);return this.copyWheelData(e,t),this.copyMouseData(e,t),this.copyData(e,t),t.nativeEvent=e.nativeEvent,t.originalEvent=e,t.target=this.hitTest(t.global.x,t.global.y),t}clonePointerEvent(e,t){let n=this.allocateEvent(rN);return n.nativeEvent=e.nativeEvent,n.originalEvent=e.originalEvent,this.copyPointerData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.target=e.target,n.path=e.composedPath().slice(),n.type=t??n.type,n}copyWheelData(e,t){t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ}copyPointerData(e,t){e instanceof rN&&t instanceof rN&&(t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist)}copyMouseData(e,t){e instanceof nN&&t instanceof nN&&(t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.copyFrom(e.client),t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.copyFrom(e.movement),t.screen.copyFrom(e.screen),t.shiftKey=e.shiftKey,t.global.copyFrom(e.global))}copyData(e,t){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.detail=e.detail,t.view=e.view,t.which=e.which,t.layer.copyFrom(e.layer),t.page.copyFrom(e.page)}trackingData(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}allocateEvent(e){this.eventPool.has(e)||this.eventPool.set(e,[]);let t=this.eventPool.get(e).pop()||new e(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.defaultPrevented=!1,t.path=null,t.target=null,t}freeEvent(e){if(e.manager!==this)throw Error(`It is illegal to free an event not managed by this EventBoundary!`);let t=e.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(e)}_notifyListeners(e,t){let n=e.currentTarget._events[t];if(n)if(`fn`in n)n.once&&e.currentTarget.removeListener(t,n.fn,void 0,!0),n.fn.call(n.context,e);else for(let r=0,i=n.length;r<i&&!e.propagationImmediatelyStopped;r++)n[r].once&&e.currentTarget.removeListener(t,n[r].fn,void 0,!0),n[r].fn.call(n[r].context,e)}},Tve=1,Eve={touchstart:`pointerdown`,touchend:`pointerup`,touchendoutside:`pointerupoutside`,touchmove:`pointermove`,touchcancel:`pointercancel`},oN=class e{constructor(t){this.supportsTouchEvents=`ontouchstart`in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=t,this.rootBoundary=new wve(null),tN.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new rN(null),this._rootWheelEvent=new iN(null),this.cursorStyles={default:`inherit`,pointer:`pointer`},this.features=new Proxy({...e.defaultEventFeatures},{set:(e,t,n)=>(t===`globalMove`&&(this.rootBoundary.enableGlobalMoveEvents=n),e[t]=n,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(t){let{canvas:n,resolution:r}=this.renderer;this.setTargetElement(n),this.resolution=r,e._defaultEventMode=t.eventMode??`passive`,Object.assign(this.features,t.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){tN.destroy(),this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(e){e||=`default`;let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this._currentCursor===e)return;this._currentCursor=e;let n=this.cursorStyles[e];if(n)switch(typeof n){case`string`:t&&(this.domElement.style.cursor=n);break;case`function`:n(e);break;case`object`:t&&Object.assign(this.domElement.style,n);break}else t&&typeof e==`string`&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!(`cancelable`in e))&&e.preventDefault();for(let e=0,n=t.length;e<n;e++){let n=t[e],r=this._bootstrapEvent(this._rootPointerEvent,n);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(e){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,tN.pointerMoved();let t=this._normalizeToPointerData(e);for(let e=0,n=t.length;e<n;e++){let n=this._bootstrapEvent(this._rootPointerEvent,t[e]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);let n=t===this.domElement?``:`outside`,r=this._normalizeToPointerData(e);for(let e=0,t=r.length;e<t;e++){let t=this._bootstrapEvent(this._rootPointerEvent,r[e]);t.type+=n,this.rootBoundary.mapEvent(t)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this._normalizeToPointerData(e);for(let e=0,n=t.length;e<n;e++){let n=this._bootstrapEvent(this._rootPointerEvent,t[e]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}onWheel(e){if(!this.features.wheel)return;let t=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(t)}setTargetElement(e){this._removeEvents(),this.domElement=e,tN.domElement=e,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;tN.addTickerListener();let e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming=`none`,e.msTouchAction=`none`):this.supportsPointerEvents&&(e.touchAction=`none`)),this.supportsPointerEvents?(globalThis.document.addEventListener(`pointermove`,this._onPointerMove,!0),this.domElement.addEventListener(`pointerdown`,this._onPointerDown,!0),this.domElement.addEventListener(`pointerleave`,this._onPointerOverOut,!0),this.domElement.addEventListener(`pointerover`,this._onPointerOverOut,!0),globalThis.addEventListener(`pointerup`,this._onPointerUp,!0)):(globalThis.document.addEventListener(`mousemove`,this._onPointerMove,!0),this.domElement.addEventListener(`mousedown`,this._onPointerDown,!0),this.domElement.addEventListener(`mouseout`,this._onPointerOverOut,!0),this.domElement.addEventListener(`mouseover`,this._onPointerOverOut,!0),globalThis.addEventListener(`mouseup`,this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener(`touchstart`,this._onPointerDown,!0),this.domElement.addEventListener(`touchend`,this._onPointerUp,!0),this.domElement.addEventListener(`touchmove`,this._onPointerMove,!0))),this.domElement.addEventListener(`wheel`,this.onWheel,{passive:!0,capture:!0}),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;tN.removeTickerListener();let e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming=``,e.msTouchAction=``):this.supportsPointerEvents&&(e.touchAction=``)),this.supportsPointerEvents?(globalThis.document.removeEventListener(`pointermove`,this._onPointerMove,!0),this.domElement.removeEventListener(`pointerdown`,this._onPointerDown,!0),this.domElement.removeEventListener(`pointerleave`,this._onPointerOverOut,!0),this.domElement.removeEventListener(`pointerover`,this._onPointerOverOut,!0),globalThis.removeEventListener(`pointerup`,this._onPointerUp,!0)):(globalThis.document.removeEventListener(`mousemove`,this._onPointerMove,!0),this.domElement.removeEventListener(`mousedown`,this._onPointerDown,!0),this.domElement.removeEventListener(`mouseout`,this._onPointerOverOut,!0),this.domElement.removeEventListener(`mouseover`,this._onPointerOverOut,!0),globalThis.removeEventListener(`mouseup`,this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener(`touchstart`,this._onPointerDown,!0),this.domElement.removeEventListener(`touchend`,this._onPointerUp,!0),this.domElement.removeEventListener(`touchmove`,this._onPointerMove,!0))),this.domElement.removeEventListener(`wheel`,this.onWheel,!0),this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(e,t,n){let r=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},i=1/this.resolution;e.x=(t-r.left)*(this.domElement.width/r.width)*i,e.y=(n-r.top)*(this.domElement.height/r.height)*i}_normalizeToPointerData(e){let t=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let n=0,r=e.changedTouches.length;n<r;n++){let r=e.changedTouches[n];r.button===void 0&&(r.button=0),r.buttons===void 0&&(r.buttons=1),r.isPrimary===void 0&&(r.isPrimary=e.touches.length===1&&e.type===`touchstart`),r.width===void 0&&(r.width=r.radiusX||1),r.height===void 0&&(r.height=r.radiusY||1),r.tiltX===void 0&&(r.tiltX=0),r.tiltY===void 0&&(r.tiltY=0),r.pointerType===void 0&&(r.pointerType=`touch`),r.pointerId===void 0&&(r.pointerId=r.identifier||0),r.pressure===void 0&&(r.pressure=r.force||.5),r.twist===void 0&&(r.twist=0),r.tangentialPressure===void 0&&(r.tangentialPressure=0),r.layerX===void 0&&(r.layerX=r.offsetX=r.clientX),r.layerY===void 0&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=e.type,t.push(r)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){let n=e;n.isPrimary===void 0&&(n.isPrimary=!0),n.width===void 0&&(n.width=1),n.height===void 0&&(n.height=1),n.tiltX===void 0&&(n.tiltX=0),n.tiltY===void 0&&(n.tiltY=0),n.pointerType===void 0&&(n.pointerType=`mouse`),n.pointerId===void 0&&(n.pointerId=Tve),n.pressure===void 0&&(n.pressure=.5),n.twist===void 0&&(n.twist=0),n.tangentialPressure===void 0&&(n.tangentialPressure=0),n.isNormalized=!0,t.push(n)}else t.push(e);return t}normalizeWheelEvent(e){let t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type===`pointerleave`&&(e.type=`pointerout`),e.type.startsWith(`mouse`)&&(e.type=e.type.replace(`mouse`,`pointer`)),e.type.startsWith(`touch`)&&(e.type=Eve[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};oN.extension={name:`events`,type:[R.WebGLSystem,R.CanvasSystem,R.WebGPUSystem],priority:-1},oN.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};var sN=oN,Dve={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode===`dynamic`||this.eventMode===`static`},set interactive(e){this.eventMode=e?`static`:`passive`},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??sN.defaultEventMode},set eventMode(e){this._internalEventMode=e},isInteractive(){return this.eventMode===`static`||this.eventMode===`dynamic`},interactiveChildren:!0,hitArea:null,addEventListener(e,t,n){let r=typeof n==`boolean`&&n||typeof n==`object`&&n.capture,i=typeof n==`object`?n.signal:void 0,a=typeof n==`object`?n.once===!0:!1,o=typeof t==`function`?void 0:t;e=r?`${e}capture`:e;let s=typeof t==`function`?t:t.handleEvent,c=this;i&&i.addEventListener(`abort`,()=>{c.off(e,s,o)}),a?c.once(e,s,o):c.on(e,s,o)},removeEventListener(e,t,n){let r=typeof n==`boolean`&&n||typeof n==`object`&&n.capture,i=typeof t==`function`?void 0:t;e=r?`${e}capture`:e,t=typeof t==`function`?t:t.handleEvent,this.off(e,t,i)},dispatchEvent(e){if(!(e instanceof Ej))throw Error(`Container cannot propagate events outside of the Federated Events API`);return e.defaultPrevented=!1,e.path=null,e.target=this,e.manager.dispatchEvent(e),!e.defaultPrevented}},Ove=`in vec2 aPosition;
|
|
782
|
+
`,e.accessibleText&&(t.innerText=e.accessibleText)),t.style.width=`${Wj}px`,t.style.height=`${Wj}px`,t.style.backgroundColor=this.debug?`rgba(255,255,255,0.5)`:`transparent`,t.style.position=`absolute`,t.style.zIndex=Gj.toString(),t.style.borderStyle=`none`,navigator.userAgent.toLowerCase().includes(`chrome`)?t.setAttribute(`aria-live`,`off`):t.setAttribute(`aria-live`,`polite`),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute(`aria-relevant`,`additions`):t.setAttribute(`aria-relevant`,`text`),t.addEventListener(`click`,this._onClick.bind(this)),t.addEventListener(`focus`,this._onFocus.bind(this)),t.addEventListener(`focusout`,this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute(`aria-label`,e.accessibleHint),e.interactive?t.tabIndex=e.tabIndex:t.tabIndex=0,this.debug&&this._updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv)}_dispatchEvent(e,t){let{container:n}=e.target,r=this._renderer.events.rootBoundary,i=Object.assign(new Ej(r),{target:n});r.rootTarget=this._renderer.lastObjectRendered,t.forEach(e=>r.dispatchEvent(i,e))}_onClick(e){this._dispatchEvent(e,[`click`,`pointertap`,`tap`])}_onFocus(e){e.target.getAttribute(`aria-live`)||e.target.setAttribute(`aria-live`,`assertive`),this._dispatchEvent(e,[`mouseover`])}_onFocusOut(e){e.target.getAttribute(`aria-live`)||e.target.setAttribute(`aria-live`,`polite`),this._dispatchEvent(e,[`mouseout`])}_onKeyDown(e){e.keyCode!==o_e||!this._activateOnTab||this._activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate()}destroy(){this._deactivate(),this._destroyTouchHook(),this._canvasObserver?.destroy(),this._canvasObserver=null,this._div=null,this._pools=null,this._children=null,this._renderer=null,this._hookDiv=null,globalThis.removeEventListener(`keydown`,this._boundOnKeyDown),this._boundOnKeyDown=null,globalThis.document.removeEventListener(`mousemove`,this._boundOnMouseMove,!0),this._boundOnMouseMove=null}setAccessibilityEnabled(e){e?this._activate():this._deactivate()}_getPool(e){return this._pools[e]||(this._pools[e]=[]),this._pools[e]}};qj.extension={type:[R.WebGLSystem,R.WebGPUSystem],name:`accessibility`},qj.defaultOptions={enabledByDefault:!1,debug:!1,activateOnTab:!0,deactivateOnMouseMove:!0};var f_e=qj,p_e={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:`button`,accessibleText:null,accessiblePointerEvents:`auto`,accessibleChildren:!0,_accessibleActive:!1,_accessibleDiv:null,_renderId:-1},Jj;function m_e(e){return Jj===void 0&&(Jj=(()=>{let t={stencil:!0,failIfMajorPerformanceCaveat:e??Ce.defaultOptions.failIfMajorPerformanceCaveat};try{if(!ge.get().getWebGLRenderingContext())return!1;let e=ge.get().createCanvas().getContext(`webgl`,t),n=!!e?.getContextAttributes()?.stencil;if(e){let t=e.getExtension(`WEBGL_lose_context`);t&&t.loseContext()}return e=null,n}catch{return!1}})()),Jj}var Yj;async function h_e(e={}){return Yj===void 0&&(Yj=await(async()=>{let t=ge.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(e)).requestDevice(),!0}catch{return!1}})()),Yj}var Xj=[`webgl`,`webgpu`,`canvas`];async function g_e(e){let t=[];e.preference?(t.push(e.preference),Xj.forEach(n=>{n!==e.preference&&t.push(n)})):t=Xj.slice();let n,r={};for(let i=0;i<t.length;i++){let a=t[i];if(a===`webgpu`&&await h_e()){let{WebGPURenderer:t}=await Z(async()=>{let{WebGPURenderer:e}=await import(`./WebGPURenderer-DtpKkjmH.js`);return{WebGPURenderer:e}},__vite__mapDeps([7,4,2]));n=t,r={...e,...e.webgpu};break}else if(a===`webgl`&&m_e(e.failIfMajorPerformanceCaveat??Ce.defaultOptions.failIfMajorPerformanceCaveat)){let{WebGLRenderer:t}=await Z(async()=>{let{WebGLRenderer:e}=await import(`./WebGLRenderer-Dct7rzs_.js`);return{WebGLRenderer:e}},__vite__mapDeps([8,4,2]));n=t,r={...e,...e.webgl};break}else if(a===`canvas`){let{CanvasRenderer:t}=await Z(async()=>{let{CanvasRenderer:e}=await import(`./CanvasRenderer-DKZvKi_9.js`);return{CanvasRenderer:e}},__vite__mapDeps([9,4,2]));n=t,r={...e,...e.canvasOptions};break}}if(delete r.webgpu,delete r.webgl,delete r.canvasOptions,!n)throw Error(`No available renderer for the current environment`);let i=new n;return await i.init(r),i}var Zj=class{static init(e){Object.defineProperty(this,`resizeTo`,{configurable:!0,set(e){globalThis.removeEventListener(`resize`,this.queueResize),this._resizeTo=e,e&&(globalThis.addEventListener(`resize`,this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&=(cancelAnimationFrame(this._resizeId),null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let e,t;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,t=globalThis.innerHeight;else{let{clientWidth:n,clientHeight:r}=this._resizeTo;e=n,t=r}this.renderer.resize(e,t),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener(`resize`,this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}};Zj.extension=R.Application;var Qj=class{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,`ticker`,{configurable:!0,set(e){this._ticker&&this._ticker.remove(this.render,this),this._ticker=e,e&&e.add(this.render,this,te.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?I.shared:new I,e.autoStart&&this.start()}static destroy(){if(this._ticker){let e=this._ticker;this.ticker=null,e.destroy()}}};Qj.extension=R.Application,L.add(Zj),L.add(Qj);var $j=class e{constructor(...e){this.stage=new ve,e[0]!==void 0&&ue(g,`Application constructor options are deprecated, please use Application.init() instead.`)}async init(t){t={...t},this.stage||=new ve,this.renderer=await g_e(t),e._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return ue(g,`Application.view is deprecated, please use Application.canvas instead.`),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,n=!1){let r=e._plugins.slice(0);r.reverse(),r.forEach(e=>{e.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(t),this.renderer=null}};$j._plugins=[];var eM=$j;L.handleByList(R.Application,eM._plugins),L.add(we);var __e=e(i(((e,t)=>{t.exports=i;var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=/([astvzqmhlc])([^astvzqmhlc]*)/gi;function i(e){var t=[];return e.replace(r,function(e,r,i){var a=r.toLowerCase();for(i=o(i),a==`m`&&i.length>2&&(t.push([r].concat(i.splice(0,2))),a=`l`,r=r==`m`?`l`:`L`);;){if(i.length==n[a])return i.unshift(r),t.push(i);if(i.length<n[a])throw Error(`malformed path data`);t.push([r].concat(i.splice(0,n[a])))}}),t}var a=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function o(e){var t=e.match(a);return t?t.map(Number):[]}}))(),1);function v_e(e,t){let n=(0,__e.default)(e),r=[],i=null,a=0,o=0;for(let e=0;e<n.length;e++){let s=n[e],c=s[0],l=s;switch(c){case`M`:a=l[1],o=l[2],t.moveTo(a,o);break;case`m`:a+=l[1],o+=l[2],t.moveTo(a,o);break;case`H`:a=l[1],t.lineTo(a,o);break;case`h`:a+=l[1],t.lineTo(a,o);break;case`V`:o=l[1],t.lineTo(a,o);break;case`v`:o+=l[1],t.lineTo(a,o);break;case`L`:a=l[1],o=l[2],t.lineTo(a,o);break;case`l`:a+=l[1],o+=l[2],t.lineTo(a,o);break;case`C`:a=l[5],o=l[6],t.bezierCurveTo(l[1],l[2],l[3],l[4],a,o);break;case`c`:t.bezierCurveTo(a+l[1],o+l[2],a+l[3],o+l[4],a+l[5],o+l[6]),a+=l[5],o+=l[6];break;case`S`:a=l[3],o=l[4],t.bezierCurveToShort(l[1],l[2],a,o);break;case`s`:t.bezierCurveToShort(a+l[1],o+l[2],a+l[3],o+l[4]),a+=l[3],o+=l[4];break;case`Q`:a=l[3],o=l[4],t.quadraticCurveTo(l[1],l[2],a,o);break;case`q`:t.quadraticCurveTo(a+l[1],o+l[2],a+l[3],o+l[4]),a+=l[3],o+=l[4];break;case`T`:a=l[1],o=l[2],t.quadraticCurveToShort(a,o);break;case`t`:a+=l[1],o+=l[2],t.quadraticCurveToShort(a,o);break;case`A`:a=l[6],o=l[7],t.arcToSvg(l[1],l[2],l[3],l[4],l[5],a,o);break;case`a`:a+=l[6],o+=l[7],t.arcToSvg(l[1],l[2],l[3],l[4],l[5],a,o);break;case`Z`:case`z`:t.closePath(),r.length>0&&(i=r.pop(),i?(a=i.startX,o=i.startY):(a=0,o=0)),i=null;break;default:h(`Unknown SVG path command: ${c}`)}c!==`Z`&&c!==`z`&&i===null&&(i={startX:a,startY:o},r.push(i))}return t}var y_e=class e{constructor(e=0,t=0,n=0){this.type=`circle`,this.x=e,this.y=t,this.radius=n}clone(){return new e(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return!1;let n=this.radius*this.radius,r=this.x-e,i=this.y-t;return r*=r,i*=i,r+i<=n}strokeContains(e,t,n,r=.5){if(this.radius===0)return!1;let i=this.x-e,a=this.y-t,o=this.radius,s=(1-r)*n,c=Math.sqrt(i*i+a*a);return c<=o+s&&c>o-(n-s)}getBounds(e){return e||=new k,e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}},b_e=class e{constructor(e=0,t=0,n=0,r=0){this.type=`ellipse`,this.x=e,this.y=t,this.halfWidth=n,this.halfHeight=r}clone(){return new e(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,t){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let n=(e-this.x)/this.halfWidth,r=(t-this.y)/this.halfHeight;return n*=n,r*=r,n+r<=1}strokeContains(e,t,n,r=.5){let{halfWidth:i,halfHeight:a}=this;if(i<=0||a<=0)return!1;let o=n*(1-r),s=n-o,c=i-s,l=a-s,u=i+o,d=a+o,f=e-this.x,p=t-this.y,m=f*f/(c*c)+p*p/(l*l),h=f*f/(u*u)+p*p/(d*d);return m>1&&h<=1}getBounds(e){return e||=new k,e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}};function x_e(e,t,n,r,i,a){let o=e-n,s=t-r,c=i-n,l=a-r,u=o*c+s*l,d=c*c+l*l,f=-1;d!==0&&(f=u/d);let p,m;f<0?(p=n,m=r):f>1?(p=i,m=a):(p=n+f*c,m=r+f*l);let h=e-p,g=t-m;return h*h+g*g}var S_e,C_e,tM=class e{constructor(...e){this.type=`polygon`;let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!=`number`){let e=[];for(let n=0,r=t.length;n<r;n++)e.push(t[n].x,t[n].y);t=e}this.points=t,this.closePath=!0}isClockwise(){let e=0,t=this.points,n=t.length;for(let r=0;r<n;r+=2){let i=t[r],a=t[r+1],o=t[(r+2)%n],s=t[(r+3)%n];e+=(o-i)*(s+a)}return e<0}containsPolygon(e){let t=this.getBounds(S_e),n=e.getBounds(C_e);if(!t.containsRect(n))return!1;let r=e.points;for(let e=0;e<r.length;e+=2){let t=r[e],n=r[e+1];if(!this.contains(t,n))return!1}return!0}clone(){let t=new e(this.points.slice());return t.closePath=this.closePath,t}contains(e,t){let n=!1,r=this.points.length/2;for(let i=0,a=r-1;i<r;a=i++){let r=this.points[i*2],o=this.points[i*2+1],s=this.points[a*2],c=this.points[a*2+1];o>t!=c>t&&e<(s-r)*((t-o)/(c-o))+r&&(n=!n)}return n}strokeContains(e,t,n,r=.5){let i=n*n,a=i*(1-r),o=i-a,{points:s}=this,c=s.length-(this.closePath?0:2);for(let n=0;n<c;n+=2){let r=s[n],i=s[n+1],c=s[(n+2)%s.length],l=s[(n+3)%s.length];if(x_e(e,t,r,i,c,l)<=(Math.sign((c-r)*(t-i)-(l-i)*(e-r))<0?o:a))return!0}return!1}getBounds(e){e||=new k;let t=this.points,n=1/0,r=-1/0,i=1/0,a=-1/0;for(let e=0,o=t.length;e<o;e+=2){let o=t[e],s=t[e+1];n=o<n?o:n,r=o>r?o:r,i=s<i?s:i,a=s>a?s:a}return e.x=n,e.width=r-n,e.y=i,e.height=a-i,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,t)=>`${e}, ${t}`,``)}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return ue(`8.11.0`,`Polygon.lastX is deprecated, please use Polygon.lastX instead.`),this.points[this.points.length-2]}get y(){return ue(`8.11.0`,`Polygon.y is deprecated, please use Polygon.lastY instead.`),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}},nM=(e,t,n,r,i,a,o)=>{let s=e-n,c=t-r,l=Math.sqrt(s*s+c*c);return l>=i-a&&l<=i+o},w_e=class e{constructor(e=0,t=0,n=0,r=0,i=20){this.type=`roundedRectangle`,this.x=e,this.y=t,this.width=n,this.height=r,this.radius=i}getBounds(e){return e||=new k,e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new e(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){let n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+n&&t<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;let r=e-(this.x+n),i=t-(this.y+n),a=n*n;if(r*r+i*i<=a||(r=e-(this.x+this.width-n),r*r+i*i<=a)||(i=t-(this.y+this.height-n),r*r+i*i<=a)||(r=e-(this.x+n),r*r+i*i<=a))return!0}return!1}strokeContains(e,t,n,r=.5){let{x:i,y:a,width:o,height:s,radius:c}=this,l=n*(1-r),u=n-l,d=i+c,f=a+c,p=o-c*2,m=s-c*2,h=i+o,g=a+s;return(e>=i-l&&e<=i+u||e>=h-u&&e<=h+l)&&t>=f&&t<=f+m||(t>=a-l&&t<=a+u||t>=g-u&&t<=g+l)&&e>=d&&e<=d+p?!0:e<d&&t<f&&nM(e,t,d,f,c,u,l)||e>h-c&&t<f&&nM(e,t,h-c,f,c,u,l)||e>h-c&&t>g-c&&nM(e,t,h-c,g-c,c,u,l)||e<d&&t>g-c&&nM(e,t,d,g-c,c,u,l)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}};function T_e(e,t,n,r,i,a,o,s=null){let c=0;n*=t,i*=a;let l=s.a,u=s.b,d=s.c,f=s.d,p=s.tx,m=s.ty;for(;c<o;){let o=e[n],s=e[n+1];r[i]=l*o+d*s+p,r[i+1]=u*o+f*s+m,i+=a,n+=t,c++}}function E_e(e,t,n,r){let i=0;for(t*=n;i<r;)e[t]=0,e[t+1]=0,t+=n,i++}function rM(e,t,n,r,i){let a=t.a,o=t.b,s=t.c,c=t.d,l=t.tx,u=t.ty;n||=0,r||=2,i||=e.length/r-n;let d=n*r;for(let t=0;t<i;t++){let t=e[d],n=e[d+1];e[d]=a*t+s*n+l,e[d+1]=o*t+c*n+u,d+=r}}var D_e=new s,iM=class{constructor(){this.packAsQuad=!1,this.batcherName=`default`,this.topology=`triangle-list`,this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:`normal`}get color(){let e=this.baseColor,t=e>>16|e&65280|(e&255)<<16,n=this.renderable;return n?b(t,n.groupColor)+(this.alpha*n.groupAlpha*255<<24):t+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||D_e}copyTo(e){e.indexOffset=this.indexOffset,e.indexSize=this.indexSize,e.attributeOffset=this.attributeOffset,e.attributeSize=this.attributeSize,e.baseColor=this.baseColor,e.alpha=this.alpha,e.texture=this.texture,e.geometryData=this.geometryData,e.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology=`triangle-list`}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}},aM={extension:{type:R.ShapeBuilder,name:`circle`},build(e,t){let n,r,i,a,o,s;if(e.type===`circle`){let t=e;if(o=s=t.radius,o<=0)return!1;n=t.x,r=t.y,i=a=0}else if(e.type===`ellipse`){let t=e;if(o=t.halfWidth,s=t.halfHeight,o<=0||s<=0)return!1;n=t.x,r=t.y,i=a=0}else{let t=e,c=t.width/2,l=t.height/2;n=t.x+c,r=t.y+l,o=s=Math.max(0,Math.min(t.radius,Math.min(c,l))),i=c-o,a=l-s}if(i<0||a<0)return!1;let c=Math.ceil(2.3*Math.sqrt(o+s)),l=c*8+(i?4:0)+(a?4:0);if(l===0)return!1;if(c===0)return t[0]=t[6]=n+i,t[1]=t[3]=r+a,t[2]=t[4]=n-i,t[5]=t[7]=r-a,!0;let u=0,d=c*4+(i?2:0)+2,f=d,p=l,m=i+o,h=a,g=n+m,_=n-m,v=r+h;if(t[u++]=g,t[u++]=v,t[--d]=v,t[--d]=_,a){let e=r-h;t[f++]=_,t[f++]=e,t[--p]=e,t[--p]=g}for(let e=1;e<c;e++){let l=Math.PI/2*(e/c),m=i+Math.cos(l)*o,h=a+Math.sin(l)*s,g=n+m,_=n-m,v=r+h,y=r-h;t[u++]=g,t[u++]=v,t[--d]=v,t[--d]=_,t[f++]=_,t[f++]=y,t[--p]=y,t[--p]=g}m=i,h=a+s,g=n+m,_=n-m,v=r+h;let y=r-h;return t[u++]=g,t[u++]=v,t[--p]=y,t[--p]=g,i&&(t[u++]=_,t[u++]=v,t[--p]=y,t[--p]=_),!0},triangulate(e,t,n,r,i,a){if(e.length===0)return;let o=0,s=0;for(let t=0;t<e.length;t+=2)o+=e[t],s+=e[t+1];o/=e.length/2,s/=e.length/2;let c=r;t[c*n]=o,t[c*n+1]=s;let l=c++;for(let r=0;r<e.length;r+=2)t[c*n]=e[r],t[c*n+1]=e[r+1],r>0&&(i[a++]=c,i[a++]=l,i[a++]=c-1),c++;i[a++]=l+1,i[a++]=l,i[a++]=c-1}},O_e={...aM,extension:{...aM.extension,name:`ellipse`}},k_e={...aM,extension:{...aM.extension,name:`roundedRectangle`}},oM=1e-4,sM=1e-4;function A_e(e){let t=e.length;if(t<6)return 1;let n=0;for(let r=0,i=e[t-2],a=e[t-1];r<t;r+=2){let t=e[r],o=e[r+1];n+=(t-i)*(o+a),i=t,a=o}return n<0?-1:1}function cM(e,t,n,r,i,a,o,s){let c=e-n*i,l=t-r*i,u=e+n*a,d=t+r*a,f,p;o?(f=r,p=-n):(f=-r,p=n);let m=c+f,h=l+p,g=u+f,_=d+p;return s.push(m,h),s.push(g,_),2}function lM(e,t,n,r,i,a,o,s){let c=n-e,l=r-t,u=Math.atan2(c,l),d=Math.atan2(i-e,a-t);s&&u<d?u+=Math.PI*2:!s&&u>d&&(d+=Math.PI*2);let f=u,p=d-u,m=Math.abs(p),h=Math.sqrt(c*c+l*l),g=(15*m*Math.sqrt(h)/Math.PI>>0)+1,_=p/g;if(f+=_,s){o.push(e,t),o.push(n,r);for(let n=1,r=f;n<g;n++,r+=_)o.push(e,t),o.push(e+Math.sin(r)*h,t+Math.cos(r)*h);o.push(e,t),o.push(i,a)}else{o.push(n,r),o.push(e,t);for(let n=1,r=f;n<g;n++,r+=_)o.push(e+Math.sin(r)*h,t+Math.cos(r)*h),o.push(e,t);o.push(i,a),o.push(e,t)}return g*2}function uM(e,t,n,r,i,a){let o=oM;if(e.length===0)return;let s=t,c=s.alignment;if(t.alignment!==.5){let t=A_e(e);n&&(t*=-1),c=(c-.5)*t+.5}let l=new F(e[0],e[1]),u=new F(e[e.length-2],e[e.length-1]),d=r,f=Math.abs(l.x-u.x)<o&&Math.abs(l.y-u.y)<o;if(d){e=e.slice(),f&&(e.pop(),e.pop(),u.set(e[e.length-2],e[e.length-1]));let t=(l.x+u.x)*.5,n=(u.y+l.y)*.5;e.unshift(t,n),e.push(t,n)}let p=i,m=e.length/2,h=e.length,g=p.length/2,_=s.width/2,v=_*_,y=s.miterLimit*s.miterLimit,b=e[0],x=e[1],S=e[2],C=e[3],w=0,T=0,E=-(x-C),D=b-S,O=0,k=0,A=Math.sqrt(E*E+D*D);E/=A,D/=A,E*=_,D*=_;let j=c,M=(1-j)*2,N=j*2;d||(s.cap===`round`?h+=lM(b-E*(M-N)*.5,x-D*(M-N)*.5,b-E*M,x-D*M,b+E*N,x+D*N,p,!0)+2:s.cap===`square`&&(h+=cM(b,x,E,D,M,N,!0,p))),p.push(b-E*M,x-D*M),p.push(b+E*N,x+D*N);for(let t=1;t<m-1;++t){b=e[(t-1)*2],x=e[(t-1)*2+1],S=e[t*2],C=e[t*2+1],w=e[(t+1)*2],T=e[(t+1)*2+1],E=-(x-C),D=b-S,A=Math.sqrt(E*E+D*D),E/=A,D/=A,E*=_,D*=_,O=-(C-T),k=S-w,A=Math.sqrt(O*O+k*k),O/=A,k/=A,O*=_,k*=_;let n=S-b,r=x-C,i=S-w,a=T-C,o=n*i+r*a,c=r*i-a*n,l=c<0;if(Math.abs(c)<.001*Math.abs(o)){p.push(S-E*M,C-D*M),p.push(S+E*N,C+D*N),o>=0&&(s.join===`round`?h+=lM(S,C,S-E*M,C-D*M,S-O*M,C-k*M,p,!1)+4:h+=2,p.push(S-O*N,C-k*N),p.push(S+O*M,C+k*M));continue}let u=(-E+b)*(-D+C)-(-E+S)*(-D+x),d=(-O+w)*(-k+C)-(-O+S)*(-k+T),f=(n*d-i*u)/c,m=(a*u-r*d)/c,g=(f-S)*(f-S)+(m-C)*(m-C),j=S+(f-S)*M,P=C+(m-C)*M,F=S-(f-S)*N,ee=C-(m-C)*N,te=Math.min(n*n+r*r,i*i+a*a),I=l?M:N;g<=te+I*I*v?s.join===`bevel`||g/v>y?(l?(p.push(j,P),p.push(S+E*N,C+D*N),p.push(j,P),p.push(S+O*N,C+k*N)):(p.push(S-E*M,C-D*M),p.push(F,ee),p.push(S-O*M,C-k*M),p.push(F,ee)),h+=2):s.join===`round`?l?(p.push(j,P),p.push(S+E*N,C+D*N),h+=lM(S,C,S+E*N,C+D*N,S+O*N,C+k*N,p,!0)+4,p.push(j,P),p.push(S+O*N,C+k*N)):(p.push(S-E*M,C-D*M),p.push(F,ee),h+=lM(S,C,S-E*M,C-D*M,S-O*M,C-k*M,p,!1)+4,p.push(S-O*M,C-k*M),p.push(F,ee)):(p.push(j,P),p.push(F,ee)):(p.push(S-E*M,C-D*M),p.push(S+E*N,C+D*N),s.join===`round`?l?h+=lM(S,C,S+E*N,C+D*N,S+O*N,C+k*N,p,!0)+2:h+=lM(S,C,S-E*M,C-D*M,S-O*M,C-k*M,p,!1)+2:s.join===`miter`&&g/v<=y&&(l?(p.push(F,ee),p.push(F,ee)):(p.push(j,P),p.push(j,P)),h+=2),p.push(S-O*M,C-k*M),p.push(S+O*N,C+k*N),h+=2)}b=e[(m-2)*2],x=e[(m-2)*2+1],S=e[(m-1)*2],C=e[(m-1)*2+1],E=-(x-C),D=b-S,A=Math.sqrt(E*E+D*D),E/=A,D/=A,E*=_,D*=_,p.push(S-E*M,C-D*M),p.push(S+E*N,C+D*N),d||(s.cap===`round`?h+=lM(S-E*(M-N)*.5,C-D*(M-N)*.5,S-E*M,C-D*M,S+E*N,C+D*N,p,!1)+2:s.cap===`square`&&(h+=cM(S,C,E,D,M,N,!1,p)));let P=sM*sM;for(let e=g;e<h+g-2;++e)b=p[e*2],x=p[e*2+1],S=p[(e+1)*2],C=p[(e+1)*2+1],w=p[(e+2)*2],T=p[(e+2)*2+1],!(Math.abs(b*(C-T)+S*(T-x)+w*(x-C))<P)&&a.push(e,e+1,e+2)}function j_e(e,t,n,r){let i=oM;if(e.length===0)return;let a=e[0],o=e[1],s=e[e.length-2],c=e[e.length-1],l=t||Math.abs(a-s)<i&&Math.abs(o-c)<i,u=n,d=e.length/2,f=u.length/2;for(let t=0;t<d;t++)u.push(e[t*2]),u.push(e[t*2+1]);for(let e=0;e<d-1;e++)r.push(f+e,f+e+1);l&&r.push(f+d-1,f)}function dM(e,t,n,r,i,a,o){let s=Le(e,t,2);if(!s)return;for(let e=0;e<s.length;e+=3)a[o++]=s[e]+i,a[o++]=s[e+1]+i,a[o++]=s[e+2]+i;let c=i*r;for(let t=0;t<e.length;t+=2)n[c]=e[t],n[c+1]=e[t+1],c+=r}var M_e=[],N_e={extension:{type:R.ShapeBuilder,name:`polygon`},build(e,t){for(let n=0;n<e.points.length;n++)t[n]=e.points[n];return!0},triangulate(e,t,n,r,i,a){dM(e,M_e,t,n,r,i,a)}},P_e={extension:{type:R.ShapeBuilder,name:`rectangle`},build(e,t){let n=e,r=n.x,i=n.y,a=n.width,o=n.height;return a>0&&o>0?(t[0]=r,t[1]=i,t[2]=r+a,t[3]=i,t[4]=r+a,t[5]=i+o,t[6]=r,t[7]=i+o,!0):!1},triangulate(e,t,n,r,i,a){let o=0;r*=n,t[r+o]=e[0],t[r+o+1]=e[1],o+=n,t[r+o]=e[2],t[r+o+1]=e[3],o+=n,t[r+o]=e[6],t[r+o+1]=e[7],o+=n,t[r+o]=e[4],t[r+o+1]=e[5],o+=n;let s=r/n;i[a++]=s,i[a++]=s+1,i[a++]=s+2,i[a++]=s+1,i[a++]=s+3,i[a++]=s+2}},F_e={extension:{type:R.ShapeBuilder,name:`triangle`},build(e,t){return t[0]=e.x,t[1]=e.y,t[2]=e.x2,t[3]=e.y2,t[4]=e.x3,t[5]=e.y3,!0},triangulate(e,t,n,r,i,a){let o=0;r*=n,t[r+o]=e[0],t[r+o+1]=e[1],o+=n,t[r+o]=e[2],t[r+o+1]=e[3],o+=n,t[r+o]=e[4],t[r+o+1]=e[5];let s=r/n;i[a++]=s,i[a++]=s+1,i[a++]=s+2}},fM=[{offset:0,color:`white`},{offset:1,color:`black`}],pM=class e{constructor(...t){this.uid=D(`fillGradient`),this._tick=0,this.type=`linear`,this.colorStops=[];let n=I_e(t);n={...n.type===`radial`?e.defaultRadialOptions:e.defaultLinearOptions,...p(n)},this._textureSize=n.textureSize,this._wrapMode=n.wrapMode,n.type===`radial`?(this.center=n.center,this.outerCenter=n.outerCenter??this.center,this.innerRadius=n.innerRadius,this.outerRadius=n.outerRadius,this.scale=n.scale,this.rotation=n.rotation):(this.start=n.start,this.end=n.end),this.textureSpace=n.textureSpace,this.type=n.type,n.colorStops.forEach(e=>{this.addColorStop(e.offset,e.color)})}addColorStop(e,t){return this.colorStops.push({offset:e,color:v.shared.setValue(t).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:e,y:t}=this.start,{x:n,y:r}=this.end,i=n-e,a=r-t,o=i<0||a<0;if(this._wrapMode===`clamp-to-edge`){if(i<0){let t=e;e=n,n=t,i*=-1}if(a<0){let e=t;t=r,r=e,a*=-1}}let c=this.colorStops.length?this.colorStops:fM,u=this._textureSize,{canvas:d,context:f}=gM(u,1),p=o?f.createLinearGradient(this._textureSize,0,0,0):f.createLinearGradient(0,0,this._textureSize,0);hM(p,c),f.fillStyle=p,f.fillRect(0,0,u,1),this.texture=new l({source:new xe({resource:d,addressMode:this._wrapMode})});let m=Math.sqrt(i*i+a*a),h=Math.atan2(a,i),g=new s;g.scale(m/u,1),g.rotate(h),g.translate(e,t),this.textureSpace===`local`&&g.scale(u,u),this.transform=g}buildGradient(){this.texture||this._tick++,this.type===`linear`?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;let e=this.colorStops.length?this.colorStops:fM,t=this._textureSize,{canvas:n,context:r}=gM(t,t),{x:i,y:a}=this.center,{x:o,y:c}=this.outerCenter,u=this.innerRadius,d=this.outerRadius,f=o-d,p=c-d,m=t/(d*2),h=(i-f)*m,g=(a-p)*m,_=r.createRadialGradient(h,g,u*m,(o-f)*m,(c-p)*m,d*m);hM(_,e),r.fillStyle=e[e.length-1].color,r.fillRect(0,0,t,t),r.fillStyle=_,r.translate(h,g),r.rotate(this.rotation),r.scale(1,this.scale),r.translate(-h,-g),r.fillRect(0,0,t,t),this.texture=new l({source:new xe({resource:n,addressMode:this._wrapMode})});let v=new s;v.scale(1/m,1/m),v.translate(f,p),this.textureSpace===`local`&&v.scale(t,t),this.transform=v}destroy(){this.texture?.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};pM.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:`local`,type:`linear`,textureSize:256,wrapMode:`clamp-to-edge`},pM.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:`local`,type:`radial`,textureSize:256,wrapMode:`clamp-to-edge`};var mM=pM;function hM(e,t){for(let n=0;n<t.length;n++){let r=t[n];e.addColorStop(r.offset,r.color)}}function gM(e,t){let n=ge.get().createCanvas(e,t);return{canvas:n,context:n.getContext(`2d`)}}function I_e(e){let t=e[0]??{};return(typeof t==`number`||e[1])&&(ue(`8.5.2`,`use options object instead`),t={type:`linear`,start:{x:e[0],y:e[1]},end:{x:e[2],y:e[3]},textureSpace:e[4],textureSize:e[5]??mM.defaultLinearOptions.textureSize}),t}var L_e=new s,R_e=new k;function _M(e,t,n,r){let i=t.matrix?e.copyFrom(t.matrix).invert():e.identity();if(t.textureSpace===`local`){let e=n.getBounds(R_e);t.width&&e.pad(t.width);let{x:r,y:a}=e,o=1/e.width,s=1/e.height,c=-r*o,l=-a*s,u=i.a,d=i.b,f=i.c,p=i.d;i.a*=o,i.b*=o,i.c*=s,i.d*=s,i.tx=c*u+l*f+i.tx,i.ty=c*d+l*p+i.ty}else i.translate(t.texture.frame.x,t.texture.frame.y),i.scale(1/t.texture.source.width,1/t.texture.source.height);let a=t.texture.source.style;return!(t.fill instanceof mM)&&a.addressMode===`clamp-to-edge`&&(a.addressMode=`repeat`,a.update()),r&&i.append(L_e.copyFrom(r).invert()),i}var vM={};L.handleByMap(R.ShapeBuilder,vM),L.add(P_e,N_e,F_e,aM,O_e,k_e);var z_e=new k,B_e=new s;function V_e(e,t){let{geometryData:n,batches:r}=t;r.length=0,n.indices.length=0,n.vertices.length=0,n.uvs.length=0;for(let t=0;t<e.instructions.length;t++){let i=e.instructions[t];if(i.action===`texture`)H_e(i.data,r,n);else if(i.action===`fill`||i.action===`stroke`){let e=i.action===`stroke`,t=i.data.path.shapePath,a=i.data.style,o=i.data.hole;e&&o&&yM(o.shapePath,a,!0,r,n),o&&(t.shapePrimitives[t.shapePrimitives.length-1].holes=o.shapePath.shapePrimitives),yM(t,a,e,r,n)}}}function H_e(e,t,n){let r=[],i=vM.rectangle,a=z_e;a.x=e.dx,a.y=e.dy,a.width=e.dw,a.height=e.dh;let o=e.transform;if(!i.build(a,r))return;let{vertices:s,uvs:c,indices:l}=n,u=l.length,d=s.length/2;o&&rM(r,o),i.triangulate(r,s,2,d,l,u);let f=e.image,p=f.uvs;c.push(p.x0,p.y0,p.x1,p.y1,p.x3,p.y3,p.x2,p.y2);let m=x.get(iM);m.indexOffset=u,m.indexSize=l.length-u,m.attributeOffset=d,m.attributeSize=s.length/2-d,m.baseColor=e.style,m.alpha=e.alpha,m.texture=f,m.geometryData=n,t.push(m)}function yM(e,t,n,r,i){let{vertices:a,uvs:o,indices:s}=i;e.shapePrimitives.forEach(({shape:e,transform:c,holes:u})=>{let d=[],f=vM[e.type];if(!f.build(e,d))return;let p=s.length,m=a.length/2,h=`triangle-list`;if(c&&rM(d,c),n){let n=e.closePath??!0,r=t;r.pixelLine?(j_e(d,n,a,s),h=`line-list`):uM(d,r,!1,n,a,s)}else if(u){let e=[],t=d.slice();U_e(u).forEach(n=>{e.push(t.length/2),t.push(...n)}),dM(t,e,a,2,m,s,p)}else f.triangulate(d,a,2,m,s,p);let g=o.length/2,_=t.texture;if(_!==l.WHITE){let n=_M(B_e,t,e,c);T_e(a,2,m,o,g,2,a.length/2-m,n)}else E_e(o,g,2,a.length/2-m);let v=x.get(iM);v.indexOffset=p,v.indexSize=s.length-p,v.attributeOffset=m,v.attributeSize=a.length/2-m,v.baseColor=t.color,v.alpha=t.alpha,v.texture=_,v.geometryData=i,v.topology=h,r.push(v)})}function U_e(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n].shape,i=[];vM[r.type].build(r,i)&&t.push(i)}return t}var W_e=class{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(e=>{x.return(e)}),this.graphicsData&&x.return(this.graphicsData),this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null}destroy(){this.reset(),this.batches=null,this.geometryData=null}},G_e=class{constructor(){this.instructions=new _e}init(e){let t=e.maxTextures;this.batcher?this.batcher._updateMaxTextures(t):this.batcher=new He({maxTextures:t}),this.instructions.reset()}get geometry(){return ue(O,`GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead.`),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}},bM=class e{constructor(e){this._renderer=e,this._managedContexts=new Ne({renderer:e,type:`resource`,name:`graphicsContext`})}init(t){e.defaultOptions.bezierSmoothness=t?.bezierSmoothness??e.defaultOptions.bezierSmoothness}getContextRenderData(e){return e._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(e)}updateGpuContext(e){let t=!!e._gpuData[this._renderer.uid],n=e._gpuData[this._renderer.uid]||this._initContext(e);if(e.dirty||!t){t&&n.reset(),V_e(e,n);let r=e.batchMode;e.customShader||r===`no-batch`?n.isBatchable=!1:r===`auto`?n.isBatchable=n.geometryData.vertices.length<400:n.isBatchable=!0,e.dirty=!1}return n}getGpuContext(e){return e._gpuData[this._renderer.uid]||this._initContext(e)}_initContextRenderData(e){let t=x.get(G_e,{maxTextures:this._renderer.limits.maxBatchableTextures}),n=e._gpuData[this._renderer.uid],{batches:r,geometryData:i}=n;n.graphicsData=t;let a=i.vertices.length,o=i.indices.length;for(let e=0;e<r.length;e++)r[e].applyTransform=!1;let s=t.batcher;s.ensureAttributeBuffer(a),s.ensureIndexBuffer(o),s.begin();for(let e=0;e<r.length;e++){let t=r[e];s.add(t)}s.finish(t.instructions);let c=s.geometry;c.indexBuffer.setDataWithSize(s.indexBuffer,s.indexSize,!0),c.buffers[0].setDataWithSize(s.attributeBuffer.float32View,s.attributeSize,!0);let l=s.batches;for(let e=0;e<l.length;e++){let t=l[e];t.bindGroup=Ze(t.textures.textures,t.textures.count,this._renderer.limits.maxBatchableTextures)}return t}_initContext(e){let t=new W_e;return t.context=e,e._gpuData[this._renderer.uid]=t,this._managedContexts.add(e),t}destroy(){this._managedContexts.destroy(),this._renderer=null}};bM.extension={type:[R.WebGLSystem,R.WebGPUSystem],name:`graphicsContext`},bM.defaultOptions={bezierSmoothness:.5};var xM=bM,K_e=8,SM=1.1920929e-7,q_e=1,CM=.01,wM=0,TM=0;function EM(e,t,n,r,i,a,o,s,c,l){let u=(q_e-Math.min(.99,Math.max(0,l??xM.defaultOptions.bezierSmoothness)))/1;return u*=u,J_e(t,n,r,i,a,o,s,c,e,u),e}function J_e(e,t,n,r,i,a,o,s,c,l){DM(e,t,n,r,i,a,o,s,c,l,0),c.push(o,s)}function DM(e,t,n,r,i,a,o,s,c,l,u){if(u>K_e)return;let d=Math.PI,f=(e+n)/2,p=(t+r)/2,m=(n+i)/2,h=(r+a)/2,g=(i+o)/2,_=(a+s)/2,v=(f+m)/2,y=(p+h)/2,b=(m+g)/2,x=(h+_)/2,S=(v+b)/2,C=(y+x)/2;if(u>0){let u=o-e,f=s-t,p=Math.abs((n-o)*f-(r-s)*u),m=Math.abs((i-o)*f-(a-s)*u),h,g;if(p>SM&&m>SM){if((p+m)*(p+m)<=l*(u*u+f*f)){if(wM<CM){c.push(S,C);return}let l=Math.atan2(a-r,i-n);if(h=Math.abs(l-Math.atan2(r-t,n-e)),g=Math.abs(Math.atan2(s-a,o-i)-l),h>=d&&(h=2*d-h),g>=d&&(g=2*d-g),h+g<wM){c.push(S,C);return}if(TM!==0){if(h>TM){c.push(n,r);return}if(g>TM){c.push(i,a);return}}}}else if(p>SM){if(p*p<=l*(u*u+f*f)){if(wM<CM){c.push(S,C);return}if(h=Math.abs(Math.atan2(a-r,i-n)-Math.atan2(r-t,n-e)),h>=d&&(h=2*d-h),h<wM){c.push(n,r),c.push(i,a);return}if(TM!==0&&h>TM){c.push(n,r);return}}}else if(m>SM){if(m*m<=l*(u*u+f*f)){if(wM<CM){c.push(S,C);return}if(h=Math.abs(Math.atan2(s-a,o-i)-Math.atan2(a-r,i-n)),h>=d&&(h=2*d-h),h<wM){c.push(n,r),c.push(i,a);return}if(TM!==0&&h>TM){c.push(i,a);return}}}else if(u=S-(e+o)/2,f=C-(t+s)/2,u*u+f*f<=l){c.push(S,C);return}}DM(e,t,f,p,v,y,S,C,c,l,u+1),DM(S,C,b,x,g,_,o,s,c,l,u+1)}var Y_e=8,X_e=1.1920929e-7,Z_e=1,Q_e=.01,OM=0;function $_e(e,t,n,r,i,a,o,s){let c=(Z_e-Math.min(.99,Math.max(0,s??xM.defaultOptions.bezierSmoothness)))/1;return c*=c,eve(t,n,r,i,a,o,e,c),e}function eve(e,t,n,r,i,a,o,s){kM(o,e,t,n,r,i,a,s,0),o.push(i,a)}function kM(e,t,n,r,i,a,o,s,c){if(c>Y_e)return;let l=Math.PI,u=(t+r)/2,d=(n+i)/2,f=(r+a)/2,p=(i+o)/2,m=(u+f)/2,h=(d+p)/2,g=a-t,_=o-n,v=Math.abs((r-a)*_-(i-o)*g);if(v>X_e){if(v*v<=s*(g*g+_*_)){if(OM<Q_e){e.push(m,h);return}let s=Math.abs(Math.atan2(o-i,a-r)-Math.atan2(i-n,r-t));if(s>=l&&(s=2*l-s),s<OM){e.push(m,h);return}}}else if(g=m-(t+a)/2,_=h-(n+o)/2,g*g+_*_<=s){e.push(m,h);return}kM(e,t,n,u,d,m,h,s,c+1),kM(e,m,h,f,p,a,o,s,c+1)}function AM(e,t,n,r,i,a,o,s){let c=Math.abs(i-a);(!o&&i>a||o&&a>i)&&(c=2*Math.PI-c),s||=Math.max(6,Math.floor(6*r**(1/3)*(c/Math.PI))),s=Math.max(s,3);let l=c/s,u=i;l*=o?-1:1;for(let i=0;i<s+1;i++){let i=Math.cos(u),a=Math.sin(u),o=t+i*r,s=n+a*r;e.push(o,s),u+=l}}function tve(e,t,n,r,i,a){let o=e[e.length-2],s=e[e.length-1]-n,c=o-t,l=i-n,u=r-t,d=Math.abs(s*u-c*l);if(d<1e-8||a===0){(e[e.length-2]!==t||e[e.length-1]!==n)&&e.push(t,n);return}let f=s*s+c*c,p=l*l+u*u,m=s*l+c*u,h=a*Math.sqrt(f)/d,g=a*Math.sqrt(p)/d,_=h*m/f,v=g*m/p,y=h*u+g*c,b=h*l+g*s,x=c*(g+_),S=s*(g+_),C=u*(h+v),w=l*(h+v),T=Math.atan2(S-b,x-y),E=Math.atan2(w-b,C-y);AM(e,y+t,b+n,a,T,E,c*l>u*s)}var jM=Math.PI*2,MM={centerX:0,centerY:0,ang1:0,ang2:0},NM=({x:e,y:t},n,r,i,a,o,s,c)=>{e*=n,t*=r;let l=i*e-a*t,u=a*e+i*t;return c.x=l+o,c.y=u+s,c};function nve(e,t){let n=t===-1.5707963267948966?-.551915024494:4/3*Math.tan(t/4),r=t===1.5707963267948966?.551915024494:n,i=Math.cos(e),a=Math.sin(e),o=Math.cos(e+t),s=Math.sin(e+t);return[{x:i-a*r,y:a+i*r},{x:o+s*r,y:s-o*r},{x:o,y:s}]}var PM=(e,t,n,r)=>{let i=e*r-t*n<0?-1:1,a=e*n+t*r;return a>1&&(a=1),a<-1&&(a=-1),i*Math.acos(a)},rve=(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=i**2,m=a**2,h=u**2,g=d**2,_=p*m-p*g-m*h;_<0&&(_=0),_/=p*g+m*h,_=Math.sqrt(_)*(o===s?-1:1);let v=_*i/a*d,y=_*-a/i*u,b=l*v-c*y+(e+n)/2,x=c*v+l*y+(t+r)/2,S=(u-v)/i,C=(d-y)/a,w=(-u-v)/i,T=(-d-y)/a,E=PM(1,0,S,C),D=PM(S,C,w,T);s===0&&D>0&&(D-=jM),s===1&&D<0&&(D+=jM),f.centerX=b,f.centerY=x,f.ang1=E,f.ang2=D};function ive(e,t,n,r,i,a,o,s=0,c=0,l=0){if(a===0||o===0)return;let u=Math.sin(s*jM/360),d=Math.cos(s*jM/360),f=d*(t-r)/2+u*(n-i)/2,p=-u*(t-r)/2+d*(n-i)/2;if(f===0&&p===0)return;a=Math.abs(a),o=Math.abs(o);let m=f**2/a**2+p**2/o**2;m>1&&(a*=Math.sqrt(m),o*=Math.sqrt(m)),rve(t,n,r,i,a,o,c,l,u,d,f,p,MM);let{ang1:h,ang2:g}=MM,{centerX:_,centerY:v}=MM,y=Math.abs(g)/(jM/4);Math.abs(1-y)<1e-7&&(y=1);let b=Math.max(Math.ceil(y),1);g/=b;let x=e[e.length-2],S=e[e.length-1],C={x:0,y:0};for(let t=0;t<b;t++){let t=nve(h,g),{x:n,y:r}=NM(t[0],a,o,d,u,_,v,C),{x:i,y:s}=NM(t[1],a,o,d,u,_,v,C),{x:c,y:l}=NM(t[2],a,o,d,u,_,v,C);EM(e,x,S,n,r,i,s,c,l),x=c,S=l,h+=g}}function ave(e,t,n){let r=(e,t)=>{let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);return{len:i,nx:n/i,ny:r/i}},i=(t,n)=>{t===0?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)},a=t[t.length-1];for(let o=0;o<t.length;o++){let s=t[o%t.length],c=s.radius??n;if(c<=0){i(o,s),a=s;continue}let l=t[(o+1)%t.length],u=r(s,a),d=r(s,l);if(u.len<1e-4||d.len<1e-4){i(o,s),a=s;continue}let f=Math.asin(u.nx*d.ny-u.ny*d.nx),p=1,m=!1;u.nx*d.nx-u.ny*-d.ny<0?f<0?f=Math.PI+f:(f=Math.PI-f,p=-1,m=!0):f>0&&(p=-1,m=!0);let h=f/2,g,_=Math.abs(Math.cos(h)*c/Math.sin(h));_>Math.min(u.len/2,d.len/2)?(_=Math.min(u.len/2,d.len/2),g=Math.abs(_*Math.sin(h)/Math.cos(h))):g=c;let v=s.x+d.nx*_+-d.ny*g*p,y=s.y+d.ny*_+d.nx*g*p,b=Math.atan2(u.ny,u.nx)+Math.PI/2*p,x=Math.atan2(d.ny,d.nx)-Math.PI/2*p;o===0&&e.moveTo(v+Math.cos(b)*g,y+Math.sin(b)*g),e.arc(v,y,g,b,x,m),a=s}}function ove(e,t,n,r){let i=(e,t)=>Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2),a=(e,t,n)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}),o=t.length;for(let s=0;s<o;s++){let c=t[(s+1)%o],l=c.radius??n;if(l<=0){s===0?e.moveTo(c.x,c.y):e.lineTo(c.x,c.y);continue}let u=t[s],d=t[(s+2)%o],f=i(u,c),p;p=f<1e-4?c:a(c,u,Math.min(f/2,l)/f);let m=i(d,c),h;h=m<1e-4?c:a(c,d,Math.min(m/2,l)/m),s===0?e.moveTo(p.x,p.y):e.lineTo(p.x,p.y),e.quadraticCurveTo(c.x,c.y,h.x,h.y,r)}}var sve=new k,cve=class{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new C,this._graphicsPath2D=e,this.signed=e.checkForHoles}moveTo(e,t){return this.startPoly(e,t),this}lineTo(e,t){this._ensurePoly();let n=this._currentPoly.points,r=n[n.length-2],i=n[n.length-1];return(r!==e||i!==t)&&n.push(e,t),this}arc(e,t,n,r,i,a){this._ensurePoly(!1);let o=this._currentPoly.points;return AM(o,e,t,n,r,i,a),this}arcTo(e,t,n,r,i){this._ensurePoly();let a=this._currentPoly.points;return tve(a,e,t,n,r,i),this}arcToSvg(e,t,n,r,i,a,o){let s=this._currentPoly.points;return ive(s,this._currentPoly.lastX,this._currentPoly.lastY,a,o,e,t,n,r,i),this}bezierCurveTo(e,t,n,r,i,a,o){this._ensurePoly();let s=this._currentPoly;return EM(this._currentPoly.points,s.lastX,s.lastY,e,t,n,r,i,a,o),this}quadraticCurveTo(e,t,n,r,i){this._ensurePoly();let a=this._currentPoly;return $_e(this._currentPoly.points,a.lastX,a.lastY,e,t,n,r,i),this}closePath(){return this.endPoly(!0),this}addPath(e,t){this.endPoly(),t&&!t.isIdentity()&&(e=e.clone(!0),e.transform(t));let n=this.shapePrimitives,r=n.length;for(let t=0;t<e.instructions.length;t++){let n=e.instructions[t];this[n.action](...n.data)}if(e.checkForHoles&&n.length-r>1){let e=null;for(let t=r;t<n.length;t++){let r=n[t];if(r.shape.type===`polygon`){let i=r.shape,a=e?.shape;a&&a.containsPolygon(i)?(e.holes||=[],e.holes.push(r),n.copyWithin(t,t+1),n.length--,t--):e=r}}}return this}finish(e=!1){this.endPoly(e)}rect(e,t,n,r,i){return this.drawShape(new k(e,t,n,r),i),this}circle(e,t,n,r){return this.drawShape(new y_e(e,t,n),r),this}poly(e,t,n){let r=new tM(e);return r.closePath=t,this.drawShape(r,n),this}regularPoly(e,t,n,r,i=0,a){r=Math.max(r|0,3);let o=-1*Math.PI/2+i,s=Math.PI*2/r,c=[];for(let i=0;i<r;i++){let r=o-i*s;c.push(e+n*Math.cos(r),t+n*Math.sin(r))}return this.poly(c,!0,a),this}roundPoly(e,t,n,r,i,a=0,o){if(r=Math.max(r|0,3),i<=0)return this.regularPoly(e,t,n,r,a);let s=n*Math.sin(Math.PI/r)-.001;i=Math.min(i,s);let c=-1*Math.PI/2+a,l=Math.PI*2/r,u=(r-2)*Math.PI/r/2;for(let a=0;a<r;a++){let r=a*l+c,s=e+n*Math.cos(r),d=t+n*Math.sin(r),f=r+Math.PI+u,p=r-Math.PI-u,m=s+i*Math.cos(f),h=d+i*Math.sin(f),g=s+i*Math.cos(p),_=d+i*Math.sin(p);a===0?this.moveTo(m,h):this.lineTo(m,h),this.quadraticCurveTo(s,d,g,_,o)}return this.closePath()}roundShape(e,t,n=!1,r){return e.length<3?this:(n?ove(this,e,t,r):ave(this,e,t),this.closePath())}filletRect(e,t,n,r,i){if(i===0)return this.rect(e,t,n,r);let a=Math.min(n,r)/2,o=Math.min(a,Math.max(-a,i)),s=e+n,c=t+r,l=o<0?-o:0,u=Math.abs(o);return this.moveTo(e,t+u).arcTo(e+l,t+l,e+u,t,u).lineTo(s-u,t).arcTo(s-l,t+l,s,t+u,u).lineTo(s,c-u).arcTo(s-l,c-l,e+n-u,c,u).lineTo(e+u,c).arcTo(e+l,c-l,e,c-u,u).closePath()}chamferRect(e,t,n,r,i,a){if(i<=0)return this.rect(e,t,n,r);let o=Math.min(i,Math.min(n,r)/2),s=e+n,c=t+r,l=[e+o,t,s-o,t,s,t+o,s,c-o,s-o,c,e+o,c,e,c-o,e,t+o];for(let e=l.length-1;e>=2;e-=2)l[e]===l[e-2]&&l[e-1]===l[e-3]&&l.splice(e-1,2);return this.poly(l,!0,a)}ellipse(e,t,n,r,i){return this.drawShape(new b_e(e,t,n,r),i),this}roundRect(e,t,n,r,i,a){return this.drawShape(new w_e(e,t,n,r,i),a),this}drawShape(e,t){return this.endPoly(),this.shapePrimitives.push({shape:e,transform:t}),this}startPoly(e,t){let n=this._currentPoly;return n&&this.endPoly(),n=new tM,n.points.push(e,t),this._currentPoly=n,this}endPoly(e=!1){let t=this._currentPoly;return t&&t.points.length>2&&(t.closePath=e,this.shapePrimitives.push({shape:t})),this._currentPoly=null,this}_ensurePoly(e=!0){if(!this._currentPoly&&(this._currentPoly=new tM,e)){let e=this.shapePrimitives[this.shapePrimitives.length-1];if(e){let t=e.shape.x,n=e.shape.y;if(e.transform&&!e.transform.isIdentity()){let r=e.transform,i=t;t=r.a*t+r.c*n+r.tx,n=r.b*i+r.d*n+r.ty}this._currentPoly.points.push(t,n)}else this._currentPoly.points.push(0,0)}}buildPath(){let e=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let t=0;t<e.instructions.length;t++){let n=e.instructions[t];this[n.action](...n.data)}this.finish()}get bounds(){let e=this._bounds;e.clear();let t=this.shapePrimitives;for(let n=0;n<t.length;n++){let r=t[n],i=r.shape.getBounds(sve);r.transform?e.addRect(i,r.transform):e.addRect(i)}return e}},FM=class e{constructor(e,t=!1){this.instructions=[],this.uid=D(`graphicsPath`),this._dirty=!0,this.checkForHoles=t,typeof e==`string`?v_e(e,this):this.instructions=e?.slice()??[]}get shapePath(){return this._shapePath||=new cve(this),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(e,t){return e=e.clone(),this.instructions.push({action:`addPath`,data:[e,t]}),this._dirty=!0,this}arc(...e){return this.instructions.push({action:`arc`,data:e}),this._dirty=!0,this}arcTo(...e){return this.instructions.push({action:`arcTo`,data:e}),this._dirty=!0,this}arcToSvg(...e){return this.instructions.push({action:`arcToSvg`,data:e}),this._dirty=!0,this}bezierCurveTo(...e){return this.instructions.push({action:`bezierCurveTo`,data:e}),this._dirty=!0,this}bezierCurveToShort(e,t,n,r,i){let a=this.instructions[this.instructions.length-1],o=this.getLastPoint(F.shared),s=0,c=0;if(!a||a.action!==`bezierCurveTo`)s=o.x,c=o.y;else{s=a.data[2],c=a.data[3];let e=o.x,t=o.y;s=e+(e-s),c=t+(t-c)}return this.instructions.push({action:`bezierCurveTo`,data:[s,c,e,t,n,r,i]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:`closePath`,data:[]}),this._dirty=!0,this}ellipse(...e){return this.instructions.push({action:`ellipse`,data:e}),this._dirty=!0,this}lineTo(...e){return this.instructions.push({action:`lineTo`,data:e}),this._dirty=!0,this}moveTo(...e){return this.instructions.push({action:`moveTo`,data:e}),this}quadraticCurveTo(...e){return this.instructions.push({action:`quadraticCurveTo`,data:e}),this._dirty=!0,this}quadraticCurveToShort(e,t,n){let r=this.instructions[this.instructions.length-1],i=this.getLastPoint(F.shared),a=0,o=0;if(!r||r.action!==`quadraticCurveTo`)a=i.x,o=i.y;else{a=r.data[0],o=r.data[1];let e=i.x,t=i.y;a=e+(e-a),o=t+(t-o)}return this.instructions.push({action:`quadraticCurveTo`,data:[a,o,e,t,n]}),this._dirty=!0,this}rect(e,t,n,r,i){return this.instructions.push({action:`rect`,data:[e,t,n,r,i]}),this._dirty=!0,this}circle(e,t,n,r){return this.instructions.push({action:`circle`,data:[e,t,n,r]}),this._dirty=!0,this}roundRect(...e){return this.instructions.push({action:`roundRect`,data:e}),this._dirty=!0,this}poly(...e){return this.instructions.push({action:`poly`,data:e}),this._dirty=!0,this}regularPoly(...e){return this.instructions.push({action:`regularPoly`,data:e}),this._dirty=!0,this}roundPoly(...e){return this.instructions.push({action:`roundPoly`,data:e}),this._dirty=!0,this}roundShape(...e){return this.instructions.push({action:`roundShape`,data:e}),this._dirty=!0,this}filletRect(...e){return this.instructions.push({action:`filletRect`,data:e}),this._dirty=!0,this}chamferRect(...e){return this.instructions.push({action:`chamferRect`,data:e}),this._dirty=!0,this}star(e,t,n,r,i,a,o){i||=r/2;let s=-1*Math.PI/2+a,c=n*2,l=Math.PI*2/c,u=[];for(let n=0;n<c;n++){let a=n%2?i:r,o=n*l+s;u.push(e+a*Math.cos(o),t+a*Math.sin(o))}return this.poly(u,!0,o),this}clone(t=!1){let n=new e;if(n.checkForHoles=this.checkForHoles,!t)n.instructions=this.instructions.slice();else for(let e=0;e<this.instructions.length;e++){let t=this.instructions[e];n.instructions.push({action:t.action,data:t.data.slice()})}return n}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(e){if(e.isIdentity())return this;let t=e.a,n=e.b,r=e.c,i=e.d,a=e.tx,o=e.ty,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0;for(let g=0;g<this.instructions.length;g++){let _=this.instructions[g],v=_.data;switch(_.action){case`moveTo`:case`lineTo`:s=v[0],c=v[1],v[0]=t*s+r*c+a,v[1]=n*s+i*c+o;break;case`bezierCurveTo`:l=v[0],u=v[1],d=v[2],f=v[3],s=v[4],c=v[5],v[0]=t*l+r*u+a,v[1]=n*l+i*u+o,v[2]=t*d+r*f+a,v[3]=n*d+i*f+o,v[4]=t*s+r*c+a,v[5]=n*s+i*c+o;break;case`quadraticCurveTo`:l=v[0],u=v[1],s=v[2],c=v[3],v[0]=t*l+r*u+a,v[1]=n*l+i*u+o,v[2]=t*s+r*c+a,v[3]=n*s+i*c+o;break;case`arcToSvg`:s=v[5],c=v[6],p=v[0],m=v[1],v[0]=t*p+r*m,v[1]=n*p+i*m,v[5]=t*s+r*c+a,v[6]=n*s+i*c+o;break;case`circle`:v[4]=IM(v[3],e);break;case`rect`:v[4]=IM(v[4],e);break;case`ellipse`:v[8]=IM(v[8],e);break;case`roundRect`:v[5]=IM(v[5],e);break;case`addPath`:v[0].transform(e);break;case`poly`:v[2]=IM(v[2],e);break;default:h(`unknown transform action`,_.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(e){let t=this.instructions.length-1,n=this.instructions[t];if(!n)return e.x=0,e.y=0,e;for(;n.action===`closePath`;){if(t--,t<0)return e.x=0,e.y=0,e;n=this.instructions[t]}switch(n.action){case`moveTo`:case`lineTo`:e.x=n.data[0],e.y=n.data[1];break;case`quadraticCurveTo`:e.x=n.data[2],e.y=n.data[3];break;case`bezierCurveTo`:e.x=n.data[4],e.y=n.data[5];break;case`arc`:case`arcToSvg`:e.x=n.data[5],e.y=n.data[6];break;case`addPath`:n.data[0].getLastPoint(e);break}return e}};function IM(e,t){return e?e.prepend(t):t.clone()}function LM(e,t,n){let r=e.getAttribute(t);return r?Number(r):n}function lve(e,t){let n=e.querySelectorAll(`defs`);for(let e=0;e<n.length;e++){let r=n[e];for(let e=0;e<r.children.length;e++){let n=r.children[e];switch(n.nodeName.toLowerCase()){case`lineargradient`:t.defs[n.id]=uve(n);break;case`radialgradient`:t.defs[n.id]=dve(n);break;default:break}}}}function uve(e){let t=new mM(LM(e,`x1`,0),LM(e,`y1`,0),LM(e,`x2`,1),LM(e,`y2`,0),(e.getAttribute(`gradientUnits`)||`objectBoundingBox`)===`objectBoundingBox`?`local`:`global`);for(let n=0;n<e.children.length;n++){let r=e.children[n],i=LM(r,`offset`,0),a=v.shared.setValue(r.getAttribute(`stop-color`)).toNumber();t.addColorStop(i,a)}return t}function dve(e){return h(`[SVG Parser] Radial gradients are not yet supported`),new mM(0,0,1,0)}function RM(e){let t=e.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return t?t[1]:``}var zM={fill:{type:`paint`,default:0},"fill-opacity":{type:`number`,default:1},stroke:{type:`paint`,default:0},"stroke-width":{type:`number`,default:1},"stroke-opacity":{type:`number`,default:1},"stroke-linecap":{type:`string`,default:`butt`},"stroke-linejoin":{type:`string`,default:`miter`},"stroke-miterlimit":{type:`number`,default:10},"stroke-dasharray":{type:`string`,default:`none`},"stroke-dashoffset":{type:`number`,default:0},opacity:{type:`number`,default:1}};function BM(e,t){let n=e.getAttribute(`style`),r={},i={},a={strokeStyle:r,fillStyle:i,useFill:!1,useStroke:!1};for(let n in zM){let r=e.getAttribute(n);r&&VM(t,a,n,r.trim())}if(n){let e=n.split(`;`);for(let n=0;n<e.length;n++){let[r,i]=e[n].trim().split(`:`);zM[r]&&VM(t,a,r,i.trim())}}return{strokeStyle:a.useStroke?r:null,fillStyle:a.useFill?i:null,useFill:a.useFill,useStroke:a.useStroke}}function VM(e,t,n,r){switch(n){case`stroke`:if(r!==`none`){if(r.startsWith(`url(`)){let n=RM(r);t.strokeStyle.fill=e.defs[n]}else t.strokeStyle.color=v.shared.setValue(r).toNumber();t.useStroke=!0}break;case`stroke-width`:t.strokeStyle.width=Number(r);break;case`fill`:if(r!==`none`){if(r.startsWith(`url(`)){let n=RM(r);t.fillStyle.fill=e.defs[n]}else t.fillStyle.color=v.shared.setValue(r).toNumber();t.useFill=!0}break;case`fill-opacity`:t.fillStyle.alpha=Number(r);break;case`stroke-opacity`:t.strokeStyle.alpha=Number(r);break;case`opacity`:t.fillStyle.alpha=Number(r),t.strokeStyle.alpha=Number(r);break}}function fve(e){if(e.length<=2)return!0;let t=e.map(e=>e.area).sort((e,t)=>t-e),[n,r]=t,i=t[t.length-1],a=n/r,o=r/i;return!(a>3&&o<2)}function pve(e){return e.split(/(?=[Mm])/).filter(e=>e.trim().length>0)}function mve(e){let t=e.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!t||t.length<4)return 0;let n=t.map(Number),r=[],i=[];for(let e=0;e<n.length;e+=2)e+1<n.length&&(r.push(n[e]),i.push(n[e+1]));if(r.length===0||i.length===0)return 0;let a=Math.min(...r),o=Math.max(...r),s=Math.min(...i),c=Math.max(...i);return(o-a)*(c-s)}function HM(e,t){let n=new FM(e,!1);for(let e of n.instructions)t.instructions.push(e)}function hve(e,t){if(typeof e==`string`){let t=document.createElement(`div`);t.innerHTML=e.trim(),e=t.querySelector(`svg`)}let n={context:t,defs:{},path:new FM};lve(e,n);let r=e.children,{fillStyle:i,strokeStyle:a}=BM(e,n);for(let e=0;e<r.length;e++){let t=r[e];t.nodeName.toLowerCase()!==`defs`&&UM(t,n,i,a)}return t}function UM(e,t,n,r){let i=e.children,{fillStyle:a,strokeStyle:o}=BM(e,t);a&&n?n={...n,...a}:a&&(n=a),o&&r?r={...r,...o}:o&&(r=o);let s=!n&&!r;s&&(n={color:0});let c,l,u,d,f,p,m,g,_,v,y,b,x,S,C,w,T;switch(e.nodeName.toLowerCase()){case`path`:{S=e.getAttribute(`d`);let i=e.getAttribute(`fill-rule`),a=pve(S),o=i===`evenodd`,s=a.length>1;if(o&&s){let e=a.map(e=>({path:e,area:mve(e)}));if(e.sort((e,t)=>t.area-e.area),a.length>3||!fve(e))for(let i=0;i<e.length;i++){let a=e[i],o=i===0;t.context.beginPath();let s=new FM(void 0,!0);HM(a.path,s),t.context.path(s),o?(n&&t.context.fill(n),r&&t.context.stroke(r)):t.context.cut()}else for(let i=0;i<e.length;i++){let a=e[i],o=i%2==1;t.context.beginPath();let s=new FM(void 0,!0);HM(a.path,s),t.context.path(s),o?t.context.cut():(n&&t.context.fill(n),r&&t.context.stroke(r))}}else C=new FM(S,i?i===`evenodd`:!0),t.context.path(C),n&&t.context.fill(n),r&&t.context.stroke(r);break}case`circle`:m=LM(e,`cx`,0),g=LM(e,`cy`,0),_=LM(e,`r`,0),t.context.ellipse(m,g,_,_),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`rect`:c=LM(e,`x`,0),l=LM(e,`y`,0),w=LM(e,`width`,0),T=LM(e,`height`,0),v=LM(e,`rx`,0),y=LM(e,`ry`,0),v||y?t.context.roundRect(c,l,w,T,v||y):t.context.rect(c,l,w,T),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`ellipse`:m=LM(e,`cx`,0),g=LM(e,`cy`,0),v=LM(e,`rx`,0),y=LM(e,`ry`,0),t.context.beginPath(),t.context.ellipse(m,g,v,y),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`line`:u=LM(e,`x1`,0),d=LM(e,`y1`,0),f=LM(e,`x2`,0),p=LM(e,`y2`,0),t.context.beginPath(),t.context.moveTo(u,d),t.context.lineTo(f,p),r&&t.context.stroke(r);break;case`polygon`:x=e.getAttribute(`points`),b=x.match(/-?\d+/g).map(e=>parseInt(e,10)),t.context.poly(b,!0),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`polyline`:x=e.getAttribute(`points`),b=x.match(/-?\d+/g).map(e=>parseInt(e,10)),t.context.poly(b,!1),r&&t.context.stroke(r);break;case`g`:case`svg`:break;default:h(`[SVG parser] <${e.nodeName}> elements unsupported`);break}s&&(n=null);for(let e=0;e<i.length;e++)UM(i[e],t,n,r)}var WM={repeat:{addressModeU:`repeat`,addressModeV:`repeat`},"repeat-x":{addressModeU:`repeat`,addressModeV:`clamp-to-edge`},"repeat-y":{addressModeU:`clamp-to-edge`,addressModeV:`repeat`},"no-repeat":{addressModeU:`clamp-to-edge`,addressModeV:`clamp-to-edge`}},GM=class{constructor(e,t){this.uid=D(`fillPattern`),this._tick=0,this.transform=new s,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),t&&(e.source.style.addressModeU=WM[t].addressModeU,e.source.style.addressModeV=WM[t].addressModeV)}setTransform(e){let t=this.texture;this.transform.copyFrom(e),this.transform.invert(),this.transform.scale(1/t.frame.width,1/t.frame.height),this._tick++}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture=e,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}};function gve(e){return v.isColorLike(e)}function KM(e){return e instanceof GM}function qM(e){return e instanceof mM}function _ve(e){return e instanceof l}function vve(e,t,n){let r=v.shared.setValue(t??0);return e.color=r.toNumber(),e.alpha=r.alpha===1?n.alpha:r.alpha,e.texture=l.WHITE,{...n,...e}}function yve(e,t,n){return e.texture=t,{...n,...e}}function JM(e,t,n){return e.fill=t,e.color=16777215,e.texture=t.texture,e.matrix=t.transform,{...n,...e}}function YM(e,t,n){return t.buildGradient(),e.fill=t,e.color=16777215,e.texture=t.texture,e.matrix=t.transform,e.textureSpace=t.textureSpace,{...n,...e}}function bve(e,t){let n={...t,...e},r=v.shared.setValue(n.color);return n.alpha*=r.alpha,n.color=r.toNumber(),n}function XM(e,t){if(e==null)return null;let n={},r=e;return gve(e)?vve(n,e,t):_ve(e)?yve(n,e,t):KM(e)?JM(n,e,t):qM(e)?YM(n,e,t):r.fill&&KM(r.fill)?JM(r,r.fill,t):r.fill&&qM(r.fill)?YM(r,r.fill,t):bve(r,t)}function ZM(e,t){let{width:n,alignment:r,miterLimit:i,cap:a,join:o,pixelLine:s,...c}=t,l=XM(e,c);return l?{width:n,alignment:r,miterLimit:i,cap:a,join:o,pixelLine:s,...l}:null}var xve=new F,QM=new s,$M=class e extends me{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=D(`graphicsContext`),this.dirty=!0,this.batchMode=`auto`,this.instructions=[],this.destroyed=!1,this._activePath=new FM,this._transform=new s,this._fillStyle={...e.defaultFillStyle},this._strokeStyle={...e.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new C,this._boundsDirty=!0}clone(){let t=new e;return t.batchMode=this.batchMode,t.instructions=this.instructions.slice(),t._activePath=this._activePath.clone(),t._transform=this._transform.clone(),t._fillStyle={...this._fillStyle},t._strokeStyle={...this._strokeStyle},t._stateStack=this._stateStack.slice(),t._bounds=this._bounds.clone(),t._boundsDirty=!0,t}get fillStyle(){return this._fillStyle}set fillStyle(t){this._fillStyle=XM(t,e.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=ZM(t,e.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=XM(t,e.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=XM(t,e.defaultStrokeStyle),this}texture(e,t,n,r,i,a){return this.instructions.push({action:`texture`,data:{image:e,dx:n||0,dy:r||0,dw:i||e.frame.width,dh:a||e.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:t||t===0?v.shared.setValue(t).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new FM,this}fill(t,n){let r,i=this.instructions[this.instructions.length-1];return r=this._tick===0&&i?.action===`stroke`?i.data.path:this._activePath.clone(),r?(t!=null&&(n!==void 0&&typeof t==`number`&&(ue(g,`GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead`),t={color:t,alpha:n}),this._fillStyle=XM(t,e.defaultFillStyle)),this.instructions.push({action:`fill`,data:{style:this.fillStyle,path:r}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){let{x:e,y:t}=this._activePath.getLastPoint(F.shared);this._activePath.clear(),this._activePath.moveTo(e,t)}stroke(t){let n,r=this.instructions[this.instructions.length-1];return n=this._tick===0&&r?.action===`fill`?r.data.path:this._activePath.clone(),n?(t!=null&&(this._strokeStyle=ZM(t,e.defaultStrokeStyle)),this.instructions.push({action:`stroke`,data:{style:this.strokeStyle,path:n}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let e=0;e<2;e++){let t=this.instructions[this.instructions.length-1-e],n=this._activePath.clone();if(t&&(t.action===`stroke`||t.action===`fill`))if(t.data.hole)t.data.hole.addPath(n);else{t.data.hole=n;break}}return this._initNextPathLocation(),this}arc(e,t,n,r,i,a){this._tick++;let o=this._transform;return this._activePath.arc(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,n,r,i,a),this}arcTo(e,t,n,r,i){this._tick++;let a=this._transform;return this._activePath.arcTo(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty,a.a*n+a.c*r+a.tx,a.b*n+a.d*r+a.ty,i),this}arcToSvg(e,t,n,r,i,a,o){this._tick++;let s=this._transform;return this._activePath.arcToSvg(e,t,n,r,i,s.a*a+s.c*o+s.tx,s.b*a+s.d*o+s.ty),this}bezierCurveTo(e,t,n,r,i,a,o){this._tick++;let s=this._transform;return this._activePath.bezierCurveTo(s.a*e+s.c*t+s.tx,s.b*e+s.d*t+s.ty,s.a*n+s.c*r+s.tx,s.b*n+s.d*r+s.ty,s.a*i+s.c*a+s.tx,s.b*i+s.d*a+s.ty,o),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(e,t,n,r){return this._tick++,this._activePath.ellipse(e,t,n,r,this._transform.clone()),this}circle(e,t,n){return this._tick++,this._activePath.circle(e,t,n,this._transform.clone()),this}path(e){return this._tick++,this._activePath.addPath(e,this._transform.clone()),this}lineTo(e,t){this._tick++;let n=this._transform;return this._activePath.lineTo(n.a*e+n.c*t+n.tx,n.b*e+n.d*t+n.ty),this}moveTo(e,t){this._tick++;let n=this._transform,r=this._activePath.instructions,i=n.a*e+n.c*t+n.tx,a=n.b*e+n.d*t+n.ty;return r.length===1&&r[0].action===`moveTo`?(r[0].data[0]=i,r[0].data[1]=a,this):(this._activePath.moveTo(i,a),this)}quadraticCurveTo(e,t,n,r,i){this._tick++;let a=this._transform;return this._activePath.quadraticCurveTo(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty,a.a*n+a.c*r+a.tx,a.b*n+a.d*r+a.ty,i),this}rect(e,t,n,r){return this._tick++,this._activePath.rect(e,t,n,r,this._transform.clone()),this}roundRect(e,t,n,r,i){return this._tick++,this._activePath.roundRect(e,t,n,r,i,this._transform.clone()),this}poly(e,t){return this._tick++,this._activePath.poly(e,t,this._transform.clone()),this}regularPoly(e,t,n,r,i=0,a){return this._tick++,this._activePath.regularPoly(e,t,n,r,i,a),this}roundPoly(e,t,n,r,i,a){return this._tick++,this._activePath.roundPoly(e,t,n,r,i,a),this}roundShape(e,t,n,r){return this._tick++,this._activePath.roundShape(e,t,n,r),this}filletRect(e,t,n,r,i){return this._tick++,this._activePath.filletRect(e,t,n,r,i),this}chamferRect(e,t,n,r,i,a){return this._tick++,this._activePath.chamferRect(e,t,n,r,i,a),this}star(e,t,n,r,i=0,a=0){return this._tick++,this._activePath.star(e,t,n,r,i,a,this._transform.clone()),this}svg(e){return this._tick++,hve(e,this),this}restore(){let e=this._stateStack.pop();return e&&(this._transform=e.transform,this._fillStyle=e.fillStyle,this._strokeStyle=e.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(e){return this._transform.rotate(e),this}scale(e,t=e){return this._transform.scale(e,t),this}setTransform(e,t,n,r,i,a){return e instanceof s?(this._transform.set(e.a,e.b,e.c,e.d,e.tx,e.ty),this):(this._transform.set(e,t,n,r,i,a),this)}transform(e,t,n,r,i,a){return e instanceof s?(this._transform.append(e),this):(QM.set(e,t,n,r,i,a),this._transform.append(QM),this)}translate(e,t=e){return this._transform.translate(e,t),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,!this.dirty&&(this.emit(`update`,this,16),this.dirty=!0)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;let e=this._bounds;e.clear();for(let t=0;t<this.instructions.length;t++){let n=this.instructions[t],r=n.action;if(r===`fill`){let t=n.data;e.addBounds(t.path.bounds)}else if(r===`texture`){let t=n.data;e.addFrame(t.dx,t.dy,t.dx+t.dw,t.dy+t.dh,t.transform)}if(r===`stroke`){let t=n.data,r=t.style.alignment,i=t.style.width*(1-r),a=t.path.bounds;e.addFrame(a.minX-i,a.minY-i,a.maxX+i,a.maxY+i)}}return e}containsPoint(e){if(!this.bounds.containsPoint(e.x,e.y))return!1;let t=this.instructions,n=!1;for(let r=0;r<t.length;r++){let i=t[r],a=i.data,o=a.path;if(!i.action||!o)continue;let s=a.style,c=o.shapePath.shapePrimitives;for(let t=0;t<c.length;t++){let r=c[t].shape;if(!s||!r)continue;let o=c[t].transform,l=o?o.applyInverse(e,xve):e;if(i.action===`fill`)n=r.contains(l.x,l.y);else{let e=s;n=r.strokeContains(l.x,l.y,e.width,e.alignment)}let u=a.hole;if(u){let e=u.shapePath?.shapePrimitives;if(e)for(let t=0;t<e.length;t++)e[t].shape.contains(l.x,l.y)&&(n=!1)}if(n)return!0}}return n}unload(){this.emit(`unload`,this);for(let e in this._gpuData)this._gpuData[e]?.destroy();this._gpuData=Object.create(null)}destroy(e=!1){if(!this.destroyed){if(this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit(`destroy`,this),this.removeAllListeners(),typeof e==`boolean`?e:e?.texture){let t=typeof e==`boolean`?e:e?.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&`uid`in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(t)),this._strokeStyle.texture&&(this._strokeStyle.fill&&`uid`in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(t))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}}};$M.defaultFillStyle={color:16777215,alpha:1,texture:l.WHITE,matrix:null,fill:null,textureSpace:`local`},$M.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:`butt`,join:`miter`,texture:l.WHITE,matrix:null,fill:null,textureSpace:`local`,pixelLine:!1};var eN=$M,tN=new class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this._tickerAdded||!this.domElement||(I.system.add(this._tickerUpdate,this,te.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&=(I.system.remove(this._tickerUpdate,this),!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}let e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType===`touch`||globalThis.document.dispatchEvent(this.events.supportsPointerEvents?new PointerEvent(`pointermove`,{clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,pointerId:e.pointerId}):new MouseEvent(`mousemove`,{clientX:e.clientX,clientY:e.clientY}))}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this._update())}destroy(){this.removeTickerListener(),this.events=null,this.domElement=null,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}},nN=class extends Ej{constructor(){super(...arguments),this.client=new F,this.movement=new F,this.offset=new F,this.global=new F,this.screen=new F}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(e,t,n){return e.worldTransform.applyInverse(n||this.global,t)}getModifierState(e){return`getModifierState`in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){throw Error(`Method not implemented.`)}},rN=class extends nN{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type===`pointermove`||this.type===`mousemove`||this.type===`touchmove`?[this]:[]}getPredictedEvents(){throw Error(`getPredictedEvents is not supported!`)}},iN=class extends nN{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}};iN.DOM_DELTA_PIXEL=0,iN.DOM_DELTA_LINE=1,iN.DOM_DELTA_PAGE=2;var Sve=2048,Cve=new F,aN=new F,wve=class{constructor(e){this.dispatch=new me,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=e,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping(`pointerdown`,this.mapPointerDown),this.addEventMapping(`pointermove`,this.mapPointerMove),this.addEventMapping(`pointerout`,this.mapPointerOut),this.addEventMapping(`pointerleave`,this.mapPointerOut),this.addEventMapping(`pointerover`,this.mapPointerOver),this.addEventMapping(`pointerup`,this.mapPointerUp),this.addEventMapping(`pointerupoutside`,this.mapPointerUpOutside),this.addEventMapping(`wheel`,this.mapWheel)}addEventMapping(e,t){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:t,priority:0}),this.mappingTable[e].sort((e,t)=>e.priority-t.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;let t=this.mappingTable[e.type];if(t)for(let n=0,r=t.length;n<r;n++)t[n].fn(e);else h(`[EventBoundary]: Event mapping not defined for ${e.type}`)}hitTest(e,t){tN.pauseUpdate=!0;let n=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?`hitTestMoveRecursive`:`hitTestRecursive`,r=this[n](this.rootTarget,this.rootTarget.eventMode,Cve.set(e,t),this.hitTestFn,this.hitPruneFn);return r&&r[0]}propagate(e,t){if(!e.target)return;let n=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(let r=0,i=n.length-1;r<i;r++)if(e.currentTarget=n[r],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,t),!(e.propagationStopped||e.propagationImmediatelyStopped)){e.eventPhase=e.BUBBLING_PHASE;for(let r=n.length-2;r>=0;r--)if(e.currentTarget=n[r],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,n=this._allInteractiveElements){if(n.length===0)return;e.eventPhase=e.BUBBLING_PHASE;let r=Array.isArray(t)?t:[t];for(let t=n.length-1;t>=0;t--)r.forEach(r=>{e.currentTarget=n[t],this.notifyTarget(e,r)})}propagationPath(e){let t=[e];for(let n=0;n<Sve&&e!==this.rootTarget&&e.parent;n++){if(!e.parent)throw Error(`Cannot find propagation path to disconnected target`);t.push(e.parent),e=e.parent}return t.reverse(),t}hitTestMoveRecursive(e,t,n,r,i,a=!1){let o=!1;if(this._interactivePrune(e))return null;if((e.eventMode===`dynamic`||t===`dynamic`)&&(tN.pauseUpdate=!1),e.interactiveChildren&&e.children){let s=e.children;for(let c=s.length-1;c>=0;c--){let l=s[c],u=this.hitTestMoveRecursive(l,this._isInteractive(t)?t:l.eventMode,n,r,i,a||i(e,n));if(u){if(u.length>0&&!u[u.length-1].parent)continue;let t=e.isInteractive();(u.length>0||t)&&(t&&this._allInteractiveElements.push(e),u.push(e)),this._hitElements.length===0&&(this._hitElements=u),o=!0}}}let s=this._isInteractive(t),c=e.isInteractive();return c&&c&&this._allInteractiveElements.push(e),a||this._hitElements.length>0?null:o?this._hitElements:s&&!i(e,n)&&r(e,n)?c?[e]:[]:null}hitTestRecursive(e,t,n,r,i){if(this._interactivePrune(e)||i(e,n))return null;if((e.eventMode===`dynamic`||t===`dynamic`)&&(tN.pauseUpdate=!1),e.interactiveChildren&&e.children){let a=e.children,o=n;for(let n=a.length-1;n>=0;n--){let s=a[n],c=this.hitTestRecursive(s,this._isInteractive(t)?t:s.eventMode,o,r,i);if(c){if(c.length>0&&!c[c.length-1].parent)continue;let t=e.isInteractive();return(c.length>0||t)&&c.push(e),c}}}let a=this._isInteractive(t),o=e.isInteractive();return a&&r(e,n)?o?[e]:[]:null}_isInteractive(e){return e===`static`||e===`dynamic`}_interactivePrune(e){return!e||!e.visible||!e.renderable||!e.measurable||e.eventMode===`none`||e.eventMode===`passive`&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,aN),!e.hitArea.contains(aN.x,aN.y)))return!0;if(e.effects&&e.effects.length)for(let n=0;n<e.effects.length;n++){let r=e.effects[n];if(r.containsPoint&&!r.containsPoint(t,this.hitTestFn))return!0}return!1}hitTestFn(e,t){return e.hitArea?!0:e?.containsPoint?(e.worldTransform.applyInverse(t,aN),e.containsPoint(aN)):!1}notifyTarget(e,t){if(!e.currentTarget.isInteractive())return;t??=e.type;let n=`on${t}`;e.currentTarget[n]?.(e);let r=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this._notifyListeners(e,r),e.eventPhase===e.AT_TARGET&&this._notifyListeners(e,t)}mapPointerDown(e){if(!(e instanceof rN)){h(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.createPointerEvent(e);if(this.dispatchEvent(t,`pointerdown`),t.pointerType===`touch`)this.dispatchEvent(t,`touchstart`);else if(t.pointerType===`mouse`||t.pointerType===`pen`){let e=t.button===2;this.dispatchEvent(t,e?`rightdown`:`mousedown`)}let n=this.trackingData(e.pointerId);n.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){if(!(e instanceof rN)){h(`EventBoundary cannot map a non-pointer event as a pointer event`);return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;let t=this.createPointerEvent(e);this._isPointerMoveEvent=!1;let n=t.pointerType===`mouse`||t.pointerType===`pen`,r=this.trackingData(e.pointerId),i=this.findMountedTarget(r.overTargets);if(r.overTargets?.length>0&&i!==t.target){let r=e.type===`mousemove`?`mouseout`:`pointerout`,a=this.createPointerEvent(e,r,i);if(this.dispatchEvent(a,`pointerout`),n&&this.dispatchEvent(a,`mouseout`),!t.composedPath().includes(i)){let r=this.createPointerEvent(e,`pointerleave`,i);for(r.eventPhase=r.AT_TARGET;r.target&&!t.composedPath().includes(r.target);)r.currentTarget=r.target,this.notifyTarget(r),n&&this.notifyTarget(r,`mouseleave`),r.target=r.target.parent;this.freeEvent(r)}this.freeEvent(a)}if(i!==t.target){let r=e.type===`mousemove`?`mouseover`:`pointerover`,a=this.clonePointerEvent(t,r);this.dispatchEvent(a,`pointerover`),n&&this.dispatchEvent(a,`mouseover`);let o=i?.parent;for(;o&&o!==this.rootTarget.parent&&o!==t.target;)o=o.parent;if(!o||o===this.rootTarget.parent){let e=this.clonePointerEvent(t,`pointerenter`);for(e.eventPhase=e.AT_TARGET;e.target&&e.target!==i&&e.target!==this.rootTarget.parent;)e.currentTarget=e.target,this.notifyTarget(e),n&&this.notifyTarget(e,`mouseenter`),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(a)}let a=[],o=this.enableGlobalMoveEvents??!0;this.moveOnAll?a.push(`pointermove`):this.dispatchEvent(t,`pointermove`),o&&a.push(`globalpointermove`),t.pointerType===`touch`&&(this.moveOnAll?a.splice(1,0,`touchmove`):this.dispatchEvent(t,`touchmove`),o&&a.push(`globaltouchmove`)),n&&(this.moveOnAll?a.splice(1,0,`mousemove`):this.dispatchEvent(t,`mousemove`),o&&a.push(`globalmousemove`),this.cursor=t.target?.cursor),a.length>0&&this.all(t,a),this._allInteractiveElements.length=0,this._hitElements.length=0,r.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){if(!(e instanceof rN)){h(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.trackingData(e.pointerId),n=this.createPointerEvent(e),r=n.pointerType===`mouse`||n.pointerType===`pen`;this.dispatchEvent(n,`pointerover`),r&&this.dispatchEvent(n,`mouseover`),n.pointerType===`mouse`&&(this.cursor=n.target?.cursor);let i=this.clonePointerEvent(n,`pointerenter`);for(i.eventPhase=i.AT_TARGET;i.target&&i.target!==this.rootTarget.parent;)i.currentTarget=i.target,this.notifyTarget(i),r&&this.notifyTarget(i,`mouseenter`),i.target=i.target.parent;t.overTargets=n.composedPath(),this.freeEvent(n),this.freeEvent(i)}mapPointerOut(e){if(!(e instanceof rN)){h(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.trackingData(e.pointerId);if(t.overTargets){let n=e.pointerType===`mouse`||e.pointerType===`pen`,r=this.findMountedTarget(t.overTargets),i=this.createPointerEvent(e,`pointerout`,r);this.dispatchEvent(i),n&&this.dispatchEvent(i,`mouseout`);let a=this.createPointerEvent(e,`pointerleave`,r);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),n&&this.notifyTarget(a,`mouseleave`),a.target=a.target.parent;t.overTargets=null,this.freeEvent(i),this.freeEvent(a)}this.cursor=null}mapPointerUp(e){if(!(e instanceof rN)){h(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=performance.now(),n=this.createPointerEvent(e);if(this.dispatchEvent(n,`pointerup`),n.pointerType===`touch`)this.dispatchEvent(n,`touchend`);else if(n.pointerType===`mouse`||n.pointerType===`pen`){let e=n.button===2;this.dispatchEvent(n,e?`rightup`:`mouseup`)}let r=this.trackingData(e.pointerId),i=this.findMountedTarget(r.pressTargetsByButton[e.button]),a=i;if(i&&!n.composedPath().includes(i)){let t=i;for(;t&&!n.composedPath().includes(t);){if(n.currentTarget=t,this.notifyTarget(n,`pointerupoutside`),n.pointerType===`touch`)this.notifyTarget(n,`touchendoutside`);else if(n.pointerType===`mouse`||n.pointerType===`pen`){let e=n.button===2;this.notifyTarget(n,e?`rightupoutside`:`mouseupoutside`)}t=t.parent}delete r.pressTargetsByButton[e.button],a=t}if(a){let i=this.clonePointerEvent(n,`click`);i.target=a,i.path=null,r.clicksByButton[e.button]||(r.clicksByButton[e.button]={clickCount:0,target:i.target,timeStamp:t});let o=r.clicksByButton[e.button];if(o.target===i.target&&t-o.timeStamp<200?++o.clickCount:o.clickCount=1,o.target=i.target,o.timeStamp=t,i.detail=o.clickCount,i.pointerType===`mouse`){let e=i.button===2;this.dispatchEvent(i,e?`rightclick`:`click`)}else i.pointerType===`touch`&&this.dispatchEvent(i,`tap`);this.dispatchEvent(i,`pointertap`),this.freeEvent(i)}this.freeEvent(n)}mapPointerUpOutside(e){if(!(e instanceof rN)){h(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.trackingData(e.pointerId),n=this.findMountedTarget(t.pressTargetsByButton[e.button]),r=this.createPointerEvent(e);if(n){let i=n;for(;i;)r.currentTarget=i,this.notifyTarget(r,`pointerupoutside`),r.pointerType===`touch`?this.notifyTarget(r,`touchendoutside`):(r.pointerType===`mouse`||r.pointerType===`pen`)&&this.notifyTarget(r,r.button===2?`rightupoutside`:`mouseupoutside`),i=i.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(r)}mapWheel(e){if(!(e instanceof iN)){h(`EventBoundary cannot map a non-wheel event as a wheel event`);return}let t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let n=1;n<e.length&&e[n].parent===t;n++)t=e[n];return t}createPointerEvent(e,t,n){let r=this.allocateEvent(rN);return this.copyPointerData(e,r),this.copyMouseData(e,r),this.copyData(e,r),r.nativeEvent=e.nativeEvent,r.originalEvent=e,r.target=n??this.hitTest(r.global.x,r.global.y)??this._hitElements[0],typeof t==`string`&&(r.type=t),r}createWheelEvent(e){let t=this.allocateEvent(iN);return this.copyWheelData(e,t),this.copyMouseData(e,t),this.copyData(e,t),t.nativeEvent=e.nativeEvent,t.originalEvent=e,t.target=this.hitTest(t.global.x,t.global.y),t}clonePointerEvent(e,t){let n=this.allocateEvent(rN);return n.nativeEvent=e.nativeEvent,n.originalEvent=e.originalEvent,this.copyPointerData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.target=e.target,n.path=e.composedPath().slice(),n.type=t??n.type,n}copyWheelData(e,t){t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ}copyPointerData(e,t){e instanceof rN&&t instanceof rN&&(t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist)}copyMouseData(e,t){e instanceof nN&&t instanceof nN&&(t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.copyFrom(e.client),t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.copyFrom(e.movement),t.screen.copyFrom(e.screen),t.shiftKey=e.shiftKey,t.global.copyFrom(e.global))}copyData(e,t){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.detail=e.detail,t.view=e.view,t.which=e.which,t.layer.copyFrom(e.layer),t.page.copyFrom(e.page)}trackingData(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}allocateEvent(e){this.eventPool.has(e)||this.eventPool.set(e,[]);let t=this.eventPool.get(e).pop()||new e(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.defaultPrevented=!1,t.path=null,t.target=null,t}freeEvent(e){if(e.manager!==this)throw Error(`It is illegal to free an event not managed by this EventBoundary!`);let t=e.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(e)}_notifyListeners(e,t){let n=e.currentTarget._events[t];if(n)if(`fn`in n)n.once&&e.currentTarget.removeListener(t,n.fn,void 0,!0),n.fn.call(n.context,e);else for(let r=0,i=n.length;r<i&&!e.propagationImmediatelyStopped;r++)n[r].once&&e.currentTarget.removeListener(t,n[r].fn,void 0,!0),n[r].fn.call(n[r].context,e)}},Tve=1,Eve={touchstart:`pointerdown`,touchend:`pointerup`,touchendoutside:`pointerupoutside`,touchmove:`pointermove`,touchcancel:`pointercancel`},oN=class e{constructor(t){this.supportsTouchEvents=`ontouchstart`in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=t,this.rootBoundary=new wve(null),tN.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new rN(null),this._rootWheelEvent=new iN(null),this.cursorStyles={default:`inherit`,pointer:`pointer`},this.features=new Proxy({...e.defaultEventFeatures},{set:(e,t,n)=>(t===`globalMove`&&(this.rootBoundary.enableGlobalMoveEvents=n),e[t]=n,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(t){let{canvas:n,resolution:r}=this.renderer;this.setTargetElement(n),this.resolution=r,e._defaultEventMode=t.eventMode??`passive`,Object.assign(this.features,t.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){tN.destroy(),this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(e){e||=`default`;let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this._currentCursor===e)return;this._currentCursor=e;let n=this.cursorStyles[e];if(n)switch(typeof n){case`string`:t&&(this.domElement.style.cursor=n);break;case`function`:n(e);break;case`object`:t&&Object.assign(this.domElement.style,n);break}else t&&typeof e==`string`&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!(`cancelable`in e))&&e.preventDefault();for(let e=0,n=t.length;e<n;e++){let n=t[e],r=this._bootstrapEvent(this._rootPointerEvent,n);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(e){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,tN.pointerMoved();let t=this._normalizeToPointerData(e);for(let e=0,n=t.length;e<n;e++){let n=this._bootstrapEvent(this._rootPointerEvent,t[e]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);let n=t===this.domElement?``:`outside`,r=this._normalizeToPointerData(e);for(let e=0,t=r.length;e<t;e++){let t=this._bootstrapEvent(this._rootPointerEvent,r[e]);t.type+=n,this.rootBoundary.mapEvent(t)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this._normalizeToPointerData(e);for(let e=0,n=t.length;e<n;e++){let n=this._bootstrapEvent(this._rootPointerEvent,t[e]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}onWheel(e){if(!this.features.wheel)return;let t=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(t)}setTargetElement(e){this._removeEvents(),this.domElement=e,tN.domElement=e,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;tN.addTickerListener();let e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming=`none`,e.msTouchAction=`none`):this.supportsPointerEvents&&(e.touchAction=`none`)),this.supportsPointerEvents?(globalThis.document.addEventListener(`pointermove`,this._onPointerMove,!0),this.domElement.addEventListener(`pointerdown`,this._onPointerDown,!0),this.domElement.addEventListener(`pointerleave`,this._onPointerOverOut,!0),this.domElement.addEventListener(`pointerover`,this._onPointerOverOut,!0),globalThis.addEventListener(`pointerup`,this._onPointerUp,!0)):(globalThis.document.addEventListener(`mousemove`,this._onPointerMove,!0),this.domElement.addEventListener(`mousedown`,this._onPointerDown,!0),this.domElement.addEventListener(`mouseout`,this._onPointerOverOut,!0),this.domElement.addEventListener(`mouseover`,this._onPointerOverOut,!0),globalThis.addEventListener(`mouseup`,this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener(`touchstart`,this._onPointerDown,!0),this.domElement.addEventListener(`touchend`,this._onPointerUp,!0),this.domElement.addEventListener(`touchmove`,this._onPointerMove,!0))),this.domElement.addEventListener(`wheel`,this.onWheel,{passive:!0,capture:!0}),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;tN.removeTickerListener();let e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming=``,e.msTouchAction=``):this.supportsPointerEvents&&(e.touchAction=``)),this.supportsPointerEvents?(globalThis.document.removeEventListener(`pointermove`,this._onPointerMove,!0),this.domElement.removeEventListener(`pointerdown`,this._onPointerDown,!0),this.domElement.removeEventListener(`pointerleave`,this._onPointerOverOut,!0),this.domElement.removeEventListener(`pointerover`,this._onPointerOverOut,!0),globalThis.removeEventListener(`pointerup`,this._onPointerUp,!0)):(globalThis.document.removeEventListener(`mousemove`,this._onPointerMove,!0),this.domElement.removeEventListener(`mousedown`,this._onPointerDown,!0),this.domElement.removeEventListener(`mouseout`,this._onPointerOverOut,!0),this.domElement.removeEventListener(`mouseover`,this._onPointerOverOut,!0),globalThis.removeEventListener(`mouseup`,this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener(`touchstart`,this._onPointerDown,!0),this.domElement.removeEventListener(`touchend`,this._onPointerUp,!0),this.domElement.removeEventListener(`touchmove`,this._onPointerMove,!0))),this.domElement.removeEventListener(`wheel`,this.onWheel,!0),this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(e,t,n){let r=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},i=1/this.resolution;e.x=(t-r.left)*(this.domElement.width/r.width)*i,e.y=(n-r.top)*(this.domElement.height/r.height)*i}_normalizeToPointerData(e){let t=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let n=0,r=e.changedTouches.length;n<r;n++){let r=e.changedTouches[n];r.button===void 0&&(r.button=0),r.buttons===void 0&&(r.buttons=1),r.isPrimary===void 0&&(r.isPrimary=e.touches.length===1&&e.type===`touchstart`),r.width===void 0&&(r.width=r.radiusX||1),r.height===void 0&&(r.height=r.radiusY||1),r.tiltX===void 0&&(r.tiltX=0),r.tiltY===void 0&&(r.tiltY=0),r.pointerType===void 0&&(r.pointerType=`touch`),r.pointerId===void 0&&(r.pointerId=r.identifier||0),r.pressure===void 0&&(r.pressure=r.force||.5),r.twist===void 0&&(r.twist=0),r.tangentialPressure===void 0&&(r.tangentialPressure=0),r.layerX===void 0&&(r.layerX=r.offsetX=r.clientX),r.layerY===void 0&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=e.type,t.push(r)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){let n=e;n.isPrimary===void 0&&(n.isPrimary=!0),n.width===void 0&&(n.width=1),n.height===void 0&&(n.height=1),n.tiltX===void 0&&(n.tiltX=0),n.tiltY===void 0&&(n.tiltY=0),n.pointerType===void 0&&(n.pointerType=`mouse`),n.pointerId===void 0&&(n.pointerId=Tve),n.pressure===void 0&&(n.pressure=.5),n.twist===void 0&&(n.twist=0),n.tangentialPressure===void 0&&(n.tangentialPressure=0),n.isNormalized=!0,t.push(n)}else t.push(e);return t}normalizeWheelEvent(e){let t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type===`pointerleave`&&(e.type=`pointerout`),e.type.startsWith(`mouse`)&&(e.type=e.type.replace(`mouse`,`pointer`)),e.type.startsWith(`touch`)&&(e.type=Eve[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};oN.extension={name:`events`,type:[R.WebGLSystem,R.CanvasSystem,R.WebGPUSystem],priority:-1},oN.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};var sN=oN,Dve={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode===`dynamic`||this.eventMode===`static`},set interactive(e){this.eventMode=e?`static`:`passive`},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??sN.defaultEventMode},set eventMode(e){this._internalEventMode=e},isInteractive(){return this.eventMode===`static`||this.eventMode===`dynamic`},interactiveChildren:!0,hitArea:null,addEventListener(e,t,n){let r=typeof n==`boolean`&&n||typeof n==`object`&&n.capture,i=typeof n==`object`?n.signal:void 0,a=typeof n==`object`?n.once===!0:!1,o=typeof t==`function`?void 0:t;e=r?`${e}capture`:e;let s=typeof t==`function`?t:t.handleEvent,c=this;i&&i.addEventListener(`abort`,()=>{c.off(e,s,o)}),a?c.once(e,s,o):c.on(e,s,o)},removeEventListener(e,t,n){let r=typeof n==`boolean`&&n||typeof n==`object`&&n.capture,i=typeof t==`function`?void 0:t;e=r?`${e}capture`:e,t=typeof t==`function`?t:t.handleEvent,this.off(e,t,i)},dispatchEvent(e){if(!(e instanceof Ej))throw Error(`Container cannot propagate events outside of the Federated Events API`);return e.defaultPrevented=!1,e.path=null,e.target=this,e.manager.dispatchEvent(e),!e.defaultPrevented}},Ove=`in vec2 aPosition;
|
|
783
783
|
out vec2 vTextureCoord;
|
|
784
784
|
|
|
785
785
|
uniform vec4 uInputSize;
|
|
@@ -1214,7 +1214,7 @@ fn mainFragment(
|
|
|
1214
1214
|
<div class="pixi-host">
|
|
1215
1215
|
<div class="edge-glow"></div>
|
|
1216
1216
|
</div>
|
|
1217
|
-
`}};customElements.define(`virtual-trackpad-tab`,Mxe);function Nxe(e){return new URLSearchParams(e.search).get(`session`)?.trim()||null}function tI(e,t=window.location){let n=Nxe(t);return n?`hosted-session:${n}:${e}`:e}var nI=1.5,rI=30,Pxe=50,iI=15;function aI(){return`ontouchstart`in window||navigator.maxTouchPoints>0}function oI(e){return e instanceof HTMLElement&&e.classList.contains(`terminal-touch-mouse-overlay`)}function Fxe(e,t,n){let r=document.elementFromPoint(t,n);if(r&&oI(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)&&!oI(r)?r:e.querySelector(`.xterm-screen`)??e}function sI(e){return e===`input`||e===`keys`||e===`shortcuts`||e===`trackpad`||e===`settings`}function Ixe(e){return e===`copy`||e===`paste`||e===`select-all`}function cI(e){return typeof e==`object`&&!!e}function lI(){try{let e=localStorage.getItem(tI(`xtermInputPanelState`));if(!e)return{};let t=JSON.parse(e);return cI(t)?t:{}}catch{return{}}}function Lxe(e){try{localStorage.setItem(tI(`xtermInputPanelState`),JSON.stringify(e))}catch{}}function Rxe(e){let t=lI().sessions;if(!t)return null;let n=t[e];if(!cI(n))return null;let r={activeTab:`input`,inputDraft:``};return sI(n.activeTab)&&(r.activeTab=n.activeTab),typeof n.inputDraft==`string`&&(r.inputDraft=n.inputDraft),r}function uI(){let e=lI();return sI(e.lastActiveTab)?e.lastActiveTab:`input`}var dI=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(YA(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=Rxe(this._stateKey);n?(this._panelSessionState=n,this._hasOwnPersistedState=!0):this._panelSessionState.activeTab=e._lastActiveTab||uI()}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=lI(),n={...t.sessions,[this._stateKey]:{activeTab:this._panelSessionState.activeTab,inputDraft:this._panelSessionState.inputDraft}};Lxe({...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,aI()&&!this._isOpen&&this.open()};t.addEventListener(`focus`,n),this._persistentCleanups.push(()=>t.removeEventListener(`focus`,n)),aI()&&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=uI();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(!cI(t))return;let n=t.command;if(!Ixe(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;sI(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,aI()||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&&(aI()&&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=Nge(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*nI)),this._cursorPos.y=Math.max(0,Math.min(r.height,this._cursorPos.y+t*nI)),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?Fxe(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<rI,r=this._cursorPos.y>t.height-rI;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<rI?t.top-iI:t.bottom+iI;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}))},Pxe)}_stopEdgeScroll(){this._edgeScrollTimer&&=(clearInterval(this._edgeScrollTimer),null)}_suppressKeyboard(){if(!aI())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 fI(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 zxe(e){return e.trim().replace(/ /g,`+`)}function Bxe(e){let t=e.families.map(zxe).filter(Boolean),{apiHost:n}=fI(e.lang??``),r=t.map(e=>`family=${e}`),i=`display=${e.display??`swap`}`;return`${n}/css2?${[...r,i].join(`&`)}`}function Vxe(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=fI(n),i=Bxe({...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 pI=null,mI=null,hI=null,gI=null,_I=!1,vI=!1;function yI(){return typeof window>`u`?null:window.AudioContext??window.webkitAudioContext??null}function bI(){return _I?!0:typeof navigator>`u`?!1:navigator.userActivation?.hasBeenActive===!0||navigator.userActivation?.isActive===!0}function Hxe(){typeof window>`u`||!vI||(window.removeEventListener(`pointerdown`,xI,!0),window.removeEventListener(`keydown`,xI,!0),vI=!1)}function xI(){_I=!0,Hxe(),gI?.(),gI=null,hI=null}function SI(){typeof window>`u`||vI||bI()||(window.addEventListener(`pointerdown`,xI,{capture:!0,once:!0,passive:!0}),window.addEventListener(`keydown`,xI,{capture:!0,once:!0}),vI=!0)}function Uxe(){SI()}function Wxe(){return typeof window>`u`||bI()?Promise.resolve():hI||(hI=new Promise(e=>{gI=e,SI()}),hI)}async function Gxe(){return pI||mI||(yI()?(mI=Wxe().then(async()=>{let e=yI();if(!e)return null;let t=pI??new e;return pI=t,t.state===`suspended`&&await t.resume(),t}).finally(()=>{mI=null}),mI):null)}var Kxe=class{fallbackSound;unlocked=!1;unlockPromise=null;silentAudio=null;activeAudios=new Set;constructor(e){this.fallbackSound=e===`bell`?Bg:Vg}init(){Uxe()}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 Gxe()){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=jne(e);if(t)return t;let n=Ane(e);if(!n)return null;let r=bf(),i=`/api/sounds/custom/${n}`;return r?`${r}${i}`:i}async isMissingSound(e){try{return(await Ff(e,{method:`HEAD`})).status===404}catch{return!1}}createManagedAudio(e,t){let n=new Audio(e);n.volume=qxe(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 qxe(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):1}var Jxe=class extends Kxe{constructor(){super(`bell`)}},CI=`xtermInputPanelSettings`,Yxe=50,Xxe=1e3,Zxe=1,Qxe=1,wI=`terminal-meta`;function TI(){return vf(`terminal-input-history`,window.location)}function $xe(){return vf(`openspecui-terminal`,window.location)}function EI(){return vf(`input-history`,window.location)}function DI(){return vf(`terminal-input-history-fallback`,window.location)}function OI(e){return Math.max(Zxe,Math.min(Xxe,Math.round(e)))}function kI(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 AI(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,OI(t))}function jI(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 MI(){try{let e=localStorage.getItem(CI);if(!e)return{};let t=JSON.parse(e);return typeof t!=`object`||!t?{}:t}catch{return{}}}function eSe(e){let t=MI();try{localStorage.setItem(CI,JSON.stringify({...t,...e}))}catch{}}async function NI(){return typeof window>`u`||!(`indexedDB`in window)?null:await new Promise(e=>{let t=window.indexedDB.open($xe(),Qxe);t.onupgradeneeded=()=>{let e=t.result;e.objectStoreNames.contains(wI)||e.createObjectStore(wI)},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null)})}async function tSe(){let e=await NI();return e?await new Promise(t=>{let n=e.transaction(wI,`readonly`),r=n.objectStore(wI).get(EI());r.onsuccess=()=>{t(kI(r.result))},r.onerror=()=>t([]),n.oncomplete=()=>e.close(),n.onerror=()=>e.close(),n.onabort=()=>e.close()}):null}async function nSe(e){let t=await NI();return t?await new Promise(n=>{let r=t.transaction(wI,`readwrite`);r.objectStore(wI).put(e,EI()),r.oncomplete=()=>{t.close(),n(!0)},r.onerror=()=>{t.close(),n(!1)},r.onabort=()=>{t.close(),n(!1)}}):!1}function rSe(){try{let e=localStorage.getItem(DI());return e?kI(JSON.parse(e)):[]}catch{return[]}}function iSe(e){try{localStorage.setItem(DI(),JSON.stringify(e))}catch{}}async function aSe(){return await tSe()||rSe()}async function PI(e){await nSe(e)||iSe(e)}var oSe=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=MI().historyLimit;return typeof e==`number`&&Number.isFinite(e)?OI(e):Yxe}async setLimit(e){let t=OI(e);eSe({historyLimit:t}),await this.ensureInitialized();let n=AI(this.records,t);await this.commit(n,{persistRemote:!0})}async add(e){let t=e.trim();if(!t)return;await this.ensureInitialized();let n=AI([{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=AI(await aSe(),this.getLimit()),this.emit(),!Lf())try{let e=kI(await Cy.kv.get.query({key:TI()})),t=AI([...this.records,...e],this.getLimit());jI(this.records,t)||(this.records=t,await PI(this.records),this.emit()),jI(e,this.records)||this.persistRemote(this.records);let n=Cy.kv.subscribe.subscribe({key:TI()},{onData:e=>{this.onRemoteData(e)}});this.kvUnsubscribe=()=>n.unsubscribe()}catch{}}async onRemoteData(e){let t=kI(e),n=AI([...this.records,...t],this.getLimit());await this.commit(n,{persistRemote:!1})}async commit(e,t){jI(this.records,e)||(this.records=e,await PI(this.records),this.emit(),t.persistRemote&&!Lf()&&this.persistRemote(this.records))}async persistRemote(e){try{await Cy.kv.set.mutate({key:TI(),value:e})}catch{}}emit(){for(let e of this.listeners)e(this.records)}};function FI(e){return e.type===`keydown`}function II(e,t){return e.key.toLowerCase()===t}function LI(e){return e.metaKey||e.ctrlKey}function RI(e){return LI(e)&&!e.altKey}function zI(e){return e.clipboard?e.clipboard:typeof navigator>`u`?null:navigator.clipboard??null}function BI(e,t){e.catch(e=>{t.onAsyncError?.(e)})}async function sSe(e,t){let n=zI(e);n?.writeText&&await n.writeText(t)}async function cSe(e){let t=zI(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 lSe=[{id:`terminal.copy-selection`,handle:(e,t)=>!FI(e)||!RI(e)||!II(e,`c`)?null:t.terminal.hasSelection?.()?VI(t):`allow`},{id:`terminal.paste-clipboard`,handle:(e,t)=>!FI(e)||!RI(e)||!II(e,`v`)?null:HI(t)},{id:`terminal.select-all`,handle:(e,t)=>!FI(e)||!e.metaKey||e.ctrlKey||e.altKey||!II(e,`a`)?null:UI(t)},{id:`terminal.zoom-in`,handle:(e,t)=>!FI(e)||!LI(e)||e.key!==`=`&&e.key!==`+`?null:(t.zoomFont(1),`block`)},{id:`terminal.zoom-out`,handle:(e,t)=>!FI(e)||!LI(e)||e.key!==`-`?null:(t.zoomFont(-1),`block`)},{id:`terminal.zoom-reset`,handle:(e,t)=>!FI(e)||!LI(e)||e.key!==`0`?null:(t.resetFontSize(),`block`)}];function VI(e){if(!e.terminal.hasSelection?.())return`allow`;let t=e.terminal.getSelection?.()??``;return t?(BI(sSe(e,t),e),`block`):`allow`}function HI(e){return zI(e)?.readText?(BI(cSe(e),e),`block`):`allow`}function UI(e){return e.terminal.selectAll?(e.terminal.selectAll(),`block`):`allow`}var uSe=[{id:`terminal.command.copy-selection`,command:`copy`,run:VI},{id:`terminal.command.paste-clipboard`,command:`paste`,run:HI},{id:`terminal.command.select-all`,command:`select-all`,run:UI}],dSe=class{constructor(e=lSe,t=uSe){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`}},fSe={"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 pSe(e){let t=e.useTheme??`app`;return t===`light`?`light`:t===`dark`?`dark`:t===`system`?e.systemDarkMode?`dark`:`light`:e.appDarkMode?`dark`:`light`}function WI(e){let t=pSe(e),n=t===`dark`?e.darkTheme??`default-dark`:e.lightTheme??`default-light`;return{id:n,mode:t,definition:fSe[n]}}var GI=`"JetBrains Mono Variable", "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`,KI={fontSize:13,fontFamily:``,cursorBlink:!0,cursorStyle:`block`,scrollback:1e3,useTheme:`app`,lightTheme:`default-light`,darkTheme:`default-dark`,rendererEngine:`xterm`,bellSound:Bg,bellVolume:1},qI=1500,JI=1e3,mSe=1e4,YI=`common`,hSe=512*1024,gSe=8,_Se=32,XI=13,vSe=800,ySe={ArrowUp:`\x1B[A`,ArrowDown:`\x1B[B`},bSe={ArrowLeft:`\x1Bb`,ArrowRight:`\x1Bf`,ArrowUp:`\x1B[1;3A`,ArrowDown:`\x1B[1;3B`},xSe={ArrowLeft:``,ArrowUp:``,ArrowRight:``,ArrowDown:``},SSe=[`JetBrains Mono`,`Fira Code`,`Source Code Pro`,`IBM Plex Mono`,`Inconsolata`,`Roboto Mono`,`Ubuntu Mono`,`Space Mono`],CSe={"JetBrains Mono":`"JetBrains Mono Variable"`,"Share Tech Mono":`"Share Tech Mono"`},ZI=new Set;function QI(e){try{return(new URL(e).pathname.split(`/`).pop()??``).replace(/\.[^.]+$/,``).replace(/[-_]/g,` `)||`CustomFont`}catch{return`CustomFont`}}async function wSe(e){let t=e.trim();if(!t)return``;if(!/^https?:\/\//i.test(t))return t;if(ZI.has(t))return QI(t);try{let e=(await Ff(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),ZI.add(t),``}if(e.startsWith(`font/`)){let e=QI(t),n=document.createElement(`style`);return n.dataset.fontSrc=t,n.textContent=`@font-face { font-family: '${e}'; src: url('${t}'); }`,document.head.appendChild(n),ZI.add(t),e}}catch{}return t}function TSe(e){let t=`google:${e}`;if(ZI.has(t))return;let n=Vxe({families:[e]});n&&(n.dataset.fontSrc=t),ZI.add(t)}var ESe=class{instances=new Map;listeners=new Set;activationListeners=new Set;idCounter=0;config={...KI};snapshotCache=null;inputHistoryStore=new oSe;bellSoundEngine=new Jxe;keybindings=new dSe;ghosttyModule=null;ghosttyInitPromise=null;appDarkMode=!1;systemDarkMode=!1;resolvedTheme=WI({useTheme:KI.useTheme,lightTheme:KI.lightTheme,darkTheme:KI.darkTheme,appDarkMode:!1,systemDarkMode:!1});ws=null;wsConnected=!1;reconnectTimer=null;reconnectDelay=JI;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:YI,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=WI({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:GI,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 Yhe(e),n=new ipe;return t.loadAddon(n),t.loadAddon(new upe),{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 dI({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?bSe[e.key]??null:e.metaKey&&!e.altKey&&!e.ctrlKey&&!e.shiftKey?xSe[e.key]??null:!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey?ySe[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>hSe&&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||=Z(()=>import(`./ghostty-web-D2QuMH_Q.js`).then(async e=>(await e.init(),this.ghosttyModule=e,e)),[]).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=WI({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(GI);return}let t=e.split(/[,]+/).map(e=>e.trim()).filter(Boolean),n=[];for(let e of t){let t=CSe[e];if(t)n.push(t);else if(SSe.includes(e))TSe(e),n.push(e);else{let t=await wSe(e);t&&n.push(t)}}n.push(GI),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,Z(async()=>{let{trpcClient:e}=await import(`./trpc-B-w8tA8C.js`);return{trpcClient:e}},__vite__mapDeps([0,1,2])).then(({trpcClient:e})=>{e.config.update.mutate({terminal:{fontSize:this.config.fontSize}})}).catch(()=>{})},vSe)}zoomFont(e){let t=Math.min(_Se,Math.max(gSe,this.config.fontSize+e));t!==this.config.fontSize&&(this.applyConfig({fontSize:t}),this.persistFontSize())}resetFontSize(){this.config.fontSize!==XI&&(this.applyConfig({fontSize:XI}),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<qI;t.lastOutputTime=Date.now(),n||this.notify(),t.outputIdleTimer&&clearTimeout(t.outputIdleTimer),t.outputIdleTimer=setTimeout(()=>{t.outputIdleTimer=null,this.notify()},qI)}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){dI.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<qI,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(Cf());this.ws=e,e.onopen=()=>{this.wsConnected=!0,this.reconnectDelay=JI;let t=Af();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=epe.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,mSe)},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??YI,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??YI,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=DSe(e.closeCallbackUrl,e.exitCode);t&&OSe(t)}wsSend(e){return this.ws?.readyState===WebSocket.OPEN?(this.ws.send(JSON.stringify(e)),!0):!1}};function DSe(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 OSe(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=kp.getAreaForPath(t.pathname);kp.push(n,e,null);return}window.open(t.toString(),`_blank`,`noopener,noreferrer`)}new ESe,e(i(((e,t)=>{t.exports={}}))(),1),Y({sound:Dne.default(Vg),volume:One,systemNotificationsEnabled:cd().default(!1)});var kSe=pd(`type`,[Y({type:X(`terminal`),sessionId:K().min(1),title:K().optional()}),Y({type:X(`openspec-change`),changeId:K().min(1),title:K().optional()}),Y({type:X(`hooks-plugin`),pluginId:K().min(1),title:K().optional()}),Y({type:X(`root-context`)}),Y({type:X(`custom`),groupId:K().min(1),title:K().optional()})]),ASe=pd(`type`,[Y({type:X(`terminal.focus`),label:K().default(`Focus terminal`),target:Y({sessionId:K().min(1)})}),Y({type:X(`href.open`),label:K().default(`Open`),target:Y({href:K().min(1)})})]),jSe=K().min(1);Y({title:K().min(1).max(160),body:K().max(2e3).default(``),source:kSe,actions:J(ASe).default([]),level:_d([`info`,`success`,`warning`,`error`]).default(`info`),createdAt:q().int().positive().optional()}).extend({id:K().min(1),createdAt:q().int().positive(),groupKey:jSe});var MSe=(0,V.createContext)(null),NSe={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 PSe(){return(0,V.useContext)(MSe)||NSe}function $I({className:e,badgeClassName:t,iconClassName:n,size:r=`mobile`}){let{unreadCount:i,openPanel:a}=PSe();return(0,H.jsx)(fE,{label:i>0?`Open notifications, ${i} unread`:`Open notifications`,icon:(0,H.jsx)(qs,{className:tE(`h-4 w-4`,n)}),badge:i>0?(0,H.jsx)(iE,{count:i,className:tE(`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 eL({children:e,maxWidth:t=300,duration:n=10,gap:r=20,className:i=``}){let[a,o]=(0,V.useState)(!1),[s,c]=(0,V.useState)(!1),l=(0,V.useRef)(null),u=(0,V.useRef)(null);(0,V.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,V.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,H.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,H.jsx)(`div`,{ref:l,className:`relative overflow-hidden whitespace-nowrap`,style:{maxWidth:f},children:(0,H.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,H.jsx)(`span`,{className:`text-muted-foreground group-hover:text-foreground shrink-0 transition-colors`,children:a?(0,H.jsx)(Qs,{className:`h-3.5 w-3.5 text-green-500`}):(0,H.jsx)(lc,{className:`h-3.5 w-3.5`})})]})}function tL({compact:e=!1}){if(Lf())return(0,H.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,H.jsx)(Zs,{className:`h-3.5 w-3.5 text-blue-500`}),!e&&(0,H.jsx)(`span`,{className:`status-text text-blue-600`,children:`Static`})]});let t=hE(),n=Rfe();if(t.connected){let n=t.watcherEnabled?`Watching for changes`:`File watcher disabled`;return(0,H.jsxs)(`div`,{className:`status-indicator flex items-center gap-1.5 text-xs`,children:[(0,H.jsx)(Ic,{className:`h-3.5 w-3.5 text-green-500`}),!e&&(0,H.jsx)(nE,{content:n,children:(0,H.jsx)(`span`,{className:`status-text cursor-default text-green-600`,children:`Live`})})]})}return(0,H.jsxs)(`div`,{className:`status-indicator flex items-center gap-1.5 text-xs`,children:[(0,H.jsx)(bl,{className:`h-3.5 w-3.5 text-red-500`}),!e&&(0,H.jsx)(`span`,{className:`status-text text-red-600`,children:`Offline`}),t.reconnectCountdown!==null&&(0,H.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,H.jsxs)(`span`,{className:`text-xs`,children:[`(`,t.reconnectCountdown,`s)`]}),(0,H.jsx)(el,{className:`h-3 w-3`})]})]})}function FSe(){let e=Lf(),[t,n]=(0,V.useState)(`Unknown`),[r,i]=(0,V.useState)(null);if((0,V.useEffect)(()=>{e&&tv().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,H.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,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,H.jsx)(tL,{}),(0,H.jsxs)(`span`,{className:`truncate`,children:[`Generated: `,t]}),r&&(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,H.jsx)(Ac,{className:`h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(eL,{children:r,maxWidth:280,duration:12,className:`text-xs`})]})]})});let a=hE();return(0,H.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,H.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,H.jsx)(tL,{}),a.projectDir&&(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(Cc,{className:`h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(eL,{children:a.projectDir,maxWidth:300,duration:12,className:`text-xs`})]})]}),(0,H.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,H.jsx)($I,{})})]})}function ISe(){let[e,t]=(0,V.useState)(!1),n=Ub(),r=hE(),i=Ap(),a=r.dirName??`OpenSpec`,o=Bf(),s=Lf(),c=()=>t(!1);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`header`,{className:`mobile-header border-border bg-background flex h-12 items-center justify-between border-b px-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`button`,{onClick:()=>t(!0),className:`hover:bg-muted -ml-1.5 rounded-md p-1.5`,"aria-label":`Open menu`,children:(0,H.jsx)(Uc,{className:`h-5 w-5`})}),(0,H.jsx)(`span`,{className:`font-nav max-w-[min(52vw,18rem)] truncate text-[12px] tracking-[0.04em]`,children:a})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(fE,{label:`Open search`,icon:(0,H.jsx)(al,{className:`h-4 w-4`}),onClick:()=>Ib.activatePop(`/search`)}),!s&&(0,H.jsx)($I,{}),(0,H.jsx)(tL,{compact:!0})]})]}),e&&(0,H.jsxs)(`div`,{className:`fixed inset-0 z-50 flex`,children:[(0,H.jsx)(`div`,{className:`animate-in fade-in absolute inset-0 bg-black/50 duration-200`,onClick:c}),(0,H.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,H.jsxs)(`div`,{className:`mb-6 flex items-center justify-between`,children:[(0,H.jsx)(`img`,{src:n?`${o}openspec_pixel_dark.svg`:`${o}openspec_pixel_light.svg`,alt:`OpenSpec`,className:`h-5`}),(0,H.jsx)(`button`,{onClick:c,className:`hover:bg-muted rounded-md p-1.5`,"aria-label":`Close menu`,children:(0,H.jsx)(Cl,{className:`h-5 w-5`})})]}),s?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`ul`,{className:`flex-1 space-y-1`,children:cE.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(Nb,{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,H.jsx)(e.icon,{className:`h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{className:`font-nav text-base tracking-[0.04em]`,children:e.label})]})},e.to))}),(0,H.jsx)(`div`,{className:`border-border space-y-1 border-t pt-4`,children:(0,H.jsxs)(Nb,{to:lE.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,H.jsx)(lE.icon,{className:`h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{className:`font-nav text-base tracking-[0.04em]`,children:lE.label})]})})]}):(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2`,children:[(0,H.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,H.jsx)(dE,{area:`main`,tabs:i.mainTabs,className:`scrollbar-thin scrollbar-track-transparent h-full overflow-auto`,useLinks:!0,onNavigate:c})}),(0,H.jsx)(`div`,{className:`text-muted-foreground text-[10px] font-medium uppercase tracking-wider`,children:`Bottom`}),(0,H.jsx)(`div`,{className:`border-border border-t pt-2`,children:(0,H.jsx)(dE,{area:`bottom`,tabs:i.bottomTabs,onNavigate:c})})]})]})]})]})}function LSe(){let e=Ap();return(0,H.jsx)(`nav`,{className:`mobile-tabbar border-border bg-background flex h-14 items-stretch border-t`,children:(Lf()?Nfe:e.mainTabs.map(e=>sE.find(t=>t.to===e)).filter(e=>e!=null)).map(e=>(0,H.jsxs)(Nb,{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,H.jsxs)(`span`,{className:`relative`,children:[(0,H.jsx)(e.icon,{className:`h-5 w-5 shrink-0`}),e.beta?(0,H.jsx)(oE,{}):null]}),(0,H.jsx)(`span`,{className:`font-nav text-[10px] tracking-[0.03em]`,children:e.label})]},e.to))})}function RSe(){return(0,H.jsxs)(`div`,{className:`@container/app fixed inset-0`,style:{containerName:`app`},children:[(0,H.jsxs)(`div`,{className:`app-layout h-full`,children:[(0,H.jsx)(Ife,{}),(0,H.jsxs)(`div`,{className:`app-body flex min-h-0 flex-1 flex-col`,children:[(0,H.jsx)(ISe,{}),(0,H.jsx)(`main`,{className:`main-content scrollbar-thin scrollbar-track-transparent view-transition-route flex min-h-0 flex-1 flex-col`,children:(0,H.jsx)(Ms,{})}),(0,H.jsx)(LSe,{}),(0,H.jsx)(FSe,{})]})]}),(0,H.jsx)(Ose,{})]})}var zSe={primary:`bg-primary text-primary-foreground hover:bg-primary/90`,secondary:`border-border bg-background text-foreground border hover:bg-muted`,ghost:`text-foreground hover:bg-muted`,destructive:`bg-red-600 text-white hover:bg-red-700 focus-visible:ring-red-500 dark:bg-red-600 dark:hover:bg-red-700`},BSe={primary:`bg-primary/10 text-primary hover:bg-primary/10`,secondary:`border-primary/40 bg-primary/10 text-primary border hover:bg-primary/10`,ghost:`bg-primary/10 text-primary hover:bg-primary/10`,destructive:`bg-red-600/10 text-red-600 hover:bg-red-600/10 dark:text-red-400`},VSe={sm:`gap-1.5 rounded-md px-3 py-1.5 text-xs`,md:`gap-2 rounded-md px-4 py-2 text-sm`,"icon-sm":`h-7 w-7 rounded-md p-0`,"icon-md":`h-9 w-9 rounded-md p-0`},nL=(0,V.forwardRef)(function({variant:e=`primary`,size:t=`md`,activity:n=!1,disabled:r=!1,type:i=`button`,className:a,onClick:o,"aria-disabled":s,...c},l){let u=e=>{if(n){e.preventDefault(),e.stopPropagation();return}o?.(e)};return(0,H.jsx)(`button`,{ref:l,type:i,disabled:r,"aria-disabled":s??(n?!0:void 0),"data-activity":n?`true`:void 0,onClick:u,className:tE(`inline-flex shrink-0 items-center justify-center font-medium outline-none transition-colors`,`focus-visible:ring-primary focus-visible:ring-1`,r?`cursor-not-allowed opacity-50`:n?`cursor-default`:`cursor-pointer`,n?BSe[e]:zSe[e],VSe[t],a),...c})});function HSe({pending:e,settled:t=!1,disabled:n,children:r,className:i,...a}){return(0,H.jsx)(nL,{...a,activity:e||t,disabled:n??!1,"aria-busy":e||void 0,className:tE(i),children:r})}function rL({children:e,className:t}){let n=e!=null&&e!==!1&&e!==``;return(0,H.jsx)(`span`,{className:tE(`sr-only`,t),role:n?`status`:void 0,"aria-live":n?`polite`:void 0,"aria-atomic":n?`true`:void 0,children:e})}function iL({children:e,className:t,active:n=!0,statusLabel:r=`updating`,persistent:i=!1}){return(0,H.jsxs)(`div`,{className:tE(!n&&!i&&`contents`,n&&`rt-revalidate-cue`,t),"aria-busy":n||void 0,children:[(0,H.jsx)(rL,{children:n?r:null}),e]})}function USe({progress:e,className:t}){if(e===null)return null;if(e.total===`unknown`)return(0,H.jsx)(`div`,{className:tE(`rt-progress-indeterminate`,t),role:`progressbar`,"aria-valuetext":`loading`});let n=e.total===0?1:e.total,r=Math.max(0,Math.min(100,e.completed/n*100));return(0,H.jsx)(`div`,{className:tE(`rt-progress-track`,t),role:`progressbar`,"aria-valuemin":0,"aria-valuemax":e.total,"aria-valuenow":e.completed,children:(0,H.jsx)(`div`,{className:`rt-progress-fill`,style:{inlineSize:`${r}%`}})})}(0,V.createContext)(null);function aL({className:e,style:t}){return(0,H.jsx)(`div`,{className:tE(`rt-skeleton`,e),style:t,"aria-hidden":`true`})}function oL({className:e,style:t}){return(0,H.jsx)(aL,{className:tE(`rt-skeleton-line`,e),style:t})}function WSe({className:e,style:t}){return(0,H.jsx)(aL,{className:tE(`rt-skeleton-row`,e),style:t})}var GSe={"list-divide":`rt-anchor border-border bg-border grid gap-px overflow-hidden rounded-lg border`,"grid-cards":`rt-anchor grid gap-3`,plain:`rt-anchor space-y-2`};function sL({mode:e=`plain`,containerClassName:t,count:n=4,rowClassName:r,renderRow:i}){return(0,H.jsx)(`div`,{className:tE(GSe[e],t),"aria-hidden":`true`,children:Array.from({length:n},(e,t)=>i?(0,H.jsx)(V.Fragment,{children:i(t)},t):(0,H.jsx)(WSe,{className:r},t))})}function KSe(){return(0,H.jsxs)(`div`,{className:`space-y-4 p-4 md:p-6`,"aria-busy":`true`,children:[(0,H.jsx)(rL,{children:`loading route`}),(0,H.jsx)(aL,{className:`h-8 w-48`}),(0,H.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:[(0,H.jsx)(aL,{className:`h-24`}),(0,H.jsx)(aL,{className:`h-24`}),(0,H.jsx)(aL,{className:`h-24`})]}),(0,H.jsx)(aL,{className:`h-48`})]})}function cL({titleWidth:e=`w-1/3`,subtitleWidth:t=`w-1/4`,className:n}){return(0,H.jsxs)(`div`,{className:tE(`bg-background flex items-center justify-between gap-3 px-4 py-3`,n),children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,H.jsx)(aL,{className:`mt-0.5 size-5 shrink-0`}),(0,H.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,H.jsx)(aL,{className:tE(`h-4`,e)}),(0,H.jsx)(aL,{className:tE(`h-3`,t)})]})]}),(0,H.jsxs)(`div`,{className:`flex flex-col items-end gap-1.5`,children:[(0,H.jsx)(aL,{className:`h-5 w-16`}),(0,H.jsx)(aL,{className:`h-3 w-10`})]})]})}function lL({count:e=5}){return(0,H.jsx)(sL,{mode:`list-divide`,count:e,renderRow:()=>(0,H.jsx)(cL,{titleWidth:`w-1/3`,subtitleWidth:`w-1/4`})})}function qSe({count:e=5}){return(0,H.jsx)(sL,{mode:`list-divide`,count:e,renderRow:()=>(0,H.jsx)(cL,{titleWidth:`w-2/5`,subtitleWidth:`w-1/5`})})}function uL({count:e=5}){return(0,H.jsx)(sL,{mode:`list-divide`,count:e,renderRow:()=>(0,H.jsx)(cL,{titleWidth:`w-1/4`,subtitleWidth:`w-1/6`})})}function JSe({count:e=4}){return(0,H.jsx)(sL,{mode:`plain`,count:e,renderRow:()=>(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border px-2.5 py-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(aL,{className:`size-4`}),(0,H.jsx)(aL,{className:`h-4 w-28`})]}),(0,H.jsx)(aL,{className:`h-4 w-12`})]})})}function dL({count:e=6}){return(0,H.jsx)(`div`,{className:`flex flex-col gap-3`,"aria-hidden":`true`,children:Array.from({length:e},(e,t)=>(0,H.jsx)(aL,{className:t%3==2?`h-24`:`h-4`},t))})}function YSe({fields:e=4}){return(0,H.jsxs)(`section`,{className:`border-border bg-card flex flex-col gap-4 rounded-lg border p-4`,"aria-hidden":`true`,children:[(0,H.jsxs)(`header`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(aL,{className:`h-4 w-40`}),(0,H.jsx)(aL,{className:`h-3 w-56`})]}),(0,H.jsx)(aL,{className:`h-8 w-20`})]}),(0,H.jsx)(`div`,{className:`flex flex-col gap-3`,children:Array.from({length:e},(e,t)=>(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(aL,{className:`h-3 w-24`}),(0,H.jsx)(aL,{className:`h-9 w-full`})]},t))})]})}function XSe({children:e,className:t}){return(0,H.jsx)(`span`,{className:tE(`rt-shiny-text`,t),children:e})}function fL({label:e,message:t,className:n,...r}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(nE,{content:t,children:(0,H.jsx)(rE,{role:`note`,tabIndex:0,"aria-label":t,tone:`muted`,className:tE(`focus-visible:ring-primary cursor-help px-1.5 text-[11px] font-medium outline-none focus-visible:ring-2 focus-visible:ring-offset-2`,n),...r,children:(0,H.jsx)(XSe,{children:e})})}),(0,H.jsx)(rL,{children:t})]})}var pL=(0,V.createContext)(null);function ZSe({children:e}){let[t,n]=(0,V.useState)({open:!1,changeId:``,changeName:``}),r=(0,V.useCallback)((e,t)=>{n({open:!0,changeId:e,changeName:t})},[]),i=(0,V.useCallback)(()=>{n(e=>({...e,open:!1}))},[]);return(0,H.jsx)(pL.Provider,{value:{state:t,openArchiveModal:r,closeArchiveModal:i},children:e})}function QSe(){let e=(0,V.useContext)(pL);if(!e)throw Error(`useArchiveModal must be used within ArchiveModalProvider`);return e}function $Se(e,t){let n=yi({getLocation(){return t.getLocation(e)},getLength(){return window.history.length},pushState(n,r){t.push(e,n,r)},replaceState(n,r){t.replace(e,n,r)},go(e){window.history.go(e)},back(){window.history.back()},forward(){window.history.forward()},createHref(n){return t.createHref(e,n)}});return t.setHistoryRef(e,n),n}function mL(e){if(!e)return``;let t=Date.now()-e,n=Math.floor(t/1e3),r=Math.floor(n/60),i=Math.floor(r/60),a=Math.floor(i/24),o=Math.floor(a/7),s=Math.floor(a/30),c=Math.floor(a/365);return n<60?`just now`:r<60?`${r}m ago`:i<24?`${i}h ago`:a<7?`${a}d ago`:o<4?`${o}w ago`:s<12?`${s}mo ago`:`${c}y ago`}function hL(e){return e?new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}):``}function eCe(e){return e?new Date(e).toLocaleString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,hour:`2-digit`,minute:`2-digit`}):``}function tCe(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id)}function nCe(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function rCe(e,t){return!!(t&&!nCe()&&typeof e.startViewTransition==`function`&&!e.activeViewTransition)}function iCe(e){if(typeof document>`u`){e.update();return}let t=e.container,n=document;if(!rCe(n,t)){e.update();return}t.style.viewTransitionName=e.transitionName;try{n.startViewTransition(()=>(0,es.flushSync)(e.update)).finished.catch(()=>{}).finally(()=>{t.style.viewTransitionName===e.transitionName&&(t.style.viewTransitionName=``)})}catch{t.style.viewTransitionName=``,e.update()}}function aCe(e,t){let[n,r]=(0,V.useState)(e),i=(0,V.useRef)(!1),a=(0,V.useRef)(e),o=(0,V.useRef)(0),s=`vt-archive-list-${(0,V.useId)().replace(/[^a-zA-Z0-9_-]/g,``)}`;return(0,V.useEffect)(()=>{if(!i.current){i.current=!0,a.current=e,r(e);return}let n=a.current;a.current=e;let c=o.current+1;if(o.current=c,e===void 0||n===void 0||tCe(n,e)){r(e);return}queueMicrotask(()=>{o.current===c&&iCe({container:t.current,transitionName:s,update:()=>{o.current===c&&r(e)}})})},[t,e,s]),n}function oCe(){let{data:e,isLoading:t,isUpdating:n,error:r}=Ky(),i=(0,V.useRef)(null),a=aCe(e,i);return t&&!e&&!r?(0,H.jsxs)(`div`,{className:`space-y-6 p-4`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(Ws,{className:`h-6 w-6 shrink-0`}),`Archive`]}),(0,H.jsx)(qSe,{count:5})]}):(0,H.jsxs)(`div`,{className:`space-y-6 p-4`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(Ws,{className:`h-6 w-6 shrink-0`}),`Archive`]}),(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`Completed changes archived in the current writable Planning root.`}),r?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`font-medium`,children:`Archive subscription failed.`}),(0,H.jsx)(`p`,{className:`break-words`,children:r.message})]})]}):null,e&&(!r||e.length>0)?(0,H.jsx)(iL,{active:n,children:(0,H.jsxs)(`div`,{ref:i,"data-archive-list-continuity":!0,className:`border-border divide-border divide-y rounded-lg border`,children:[a?.map(e=>{let t={family:`archive`,entityId:e.id};return(0,H.jsxs)(Nb,{to:`/archive/$changeId`,params:{changeId:e.id},state:t=>({...t,__vtHandoff:{family:`archive`,entityId:e.id,title:e.name,subtitle:e.id}}),vt:{sharedElements:t},...rb(t,`container`),className:`hover:bg-muted/50 flex items-center justify-between p-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(Ws,{...rb(t,`icon`),className:`text-muted-foreground h-5 w-5`}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{...rb(t,`title`),className:`font-medium`,children:e.name}),(0,H.jsxs)(`div`,{className:`text-muted-foreground text-sm`,children:[e.id,e.updatedAt>0&&(0,H.jsxs)(H.Fragment,{children:[` · `,mL(e.updatedAt)]})]})]})]}),(0,H.jsx)(ec,{className:`text-muted-foreground h-4 w-4`})]},e.id)}),a?.length===0&&!n&&(0,H.jsxs)(`div`,{className:`text-muted-foreground p-8 text-center`,children:[(0,H.jsx)(Ws,{className:`mx-auto mb-4 h-12 w-12 opacity-50`}),(0,H.jsx)(`p`,{children:`No archived changes yet.`}),(0,H.jsxs)(`p`,{className:`mt-2 text-sm`,children:[`Changes in this Planning root are archived using`,` `,(0,H.jsx)(`code`,{className:`bg-muted rounded px-1`,children:`openspec archive`})]})]})]})}):null]})}function gL(e,t,n){let r=e.findIndex(e=>e.id===t),i=e.findIndex(e=>e.id===n);return r<0||i<0||r===i?null:i>r?`forward`:`backward`}var _L=`tabVisibleHeight`,vL=`tabTopInset`,yL=`tabScrollOffset`,bL=`tabLayoutBridge`,xL=`tabLayoutBridgeBasePadding`,SL=`tabLayoutBridgeInlinePadding`,CL=`[data-tab-scroll-root="true"]`;function wL(e,t,n){return Math.min(Math.max(e,t),n)}function TL(e){return Math.max(e.scrollHeight-e.clientHeight,0)}function EL(e,t){return Math.max(e.scrollHeight-t,0)}function sCe(e){return Number(e.dataset[bL]??`0`)||0}function cCe(e){e.dataset[xL]||=window.getComputedStyle(e).paddingBottom,e.dataset[SL]||=e.style.paddingBottom}function lCe(e,t){cCe(e);let n=Math.max(Math.ceil(t),0);if(e.dataset[bL]=String(n),n<=0){e.style.paddingBottom=e.dataset[SL]??``;return}let r=e.dataset[xL]??`0px`;e.style.paddingBottom=`calc(${r} + ${n}px)`}function uCe(e,t,n){let r=()=>{if(!e.isConnected||!t.isConnected)return!0;let r=sCe(t),i=Math.max(TL(e)-r,0);lCe(t,Math.max(n-i,0));let a=wL(n,0,TL(e));return e.scrollTop=a,e.scrollTop===a};if(r()||typeof requestAnimationFrame!=`function`)return;let i=10,a=()=>{r()||i<=0||(--i,requestAnimationFrame(a))};requestAnimationFrame(a)}function DL(e){return e===`auto`||e===`scroll`||e===`overlay`}function dCe(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),n=null;for(;t.nextNode();){let e=t.currentNode;if(e instanceof HTMLElement&&!(!DL(window.getComputedStyle(e).overflowY)||e.scrollHeight<=e.clientHeight)){if(e.scrollTop>0)return e;n??=e}}return n}function fCe(e){return(e.matches(CL)?e:e.querySelector(CL))||dCe(e)}function pCe(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return t.scrollTop+n.top-r.top}function mCe(e,t){e.dataset[_L]=String(t.visibleHeight),e.dataset[vL]=String(t.topInset),e.dataset[yL]=String(t.innerScrollTop)}function hCe(e){delete e.dataset[_L],delete e.dataset[vL],delete e.dataset[yL]}function gCe(e,t){let n={height:e.style.height,maxHeight:e.style.maxHeight,minHeight:e.style.minHeight,overflowY:e.style.overflowY},r=`${t.visibleHeight}px`;return e.style.height=r,e.style.minHeight=r,e.style.maxHeight=r,e.style.overflowY=`hidden`,mCe(e,t),n}function _Ce(e,t){e.style.height=t.height,e.style.maxHeight=t.maxHeight,e.style.minHeight=t.minHeight,e.style.overflowY=t.overflowY,hCe(e)}function OL(e,t){if(!e)return;let n=()=>e.isConnected?(e.scrollTop=t,e.scrollTop===t):!0;if(n()||typeof requestAnimationFrame!=`function`)return;let r=10,i=()=>{n()||r<=0||(--r,requestAnimationFrame(i))};requestAnimationFrame(i)}function vCe(e){return typeof e==`string`?e.split(`,`).map(e=>e.trim()):[...e]}function yCe(e,t){let n=vCe(t);for(let t of n)if(t)try{let n=e.closest(t);if(n instanceof HTMLElement)return n}catch{return null}return null}function bCe(e,t){let n=e.parentElement;for(;n;){if(DL(window.getComputedStyle(n).overflowY)&&n.scrollHeight>n.clientHeight)return n;if(t&&n===t)break;n=n.parentElement}return t&&DL(window.getComputedStyle(t).overflowY)?t:null}function kL(e,t,n){if(!n)return null;let r=e?.getPanel(t);if(!(r instanceof HTMLElement))return null;let i=bCe(r,yCe(r,n));return i instanceof HTMLElement?{panel:r,contentScrollRoot:fCe(r),viewport:i}:null}function xCe(e,t){if(!(e instanceof HTMLElement)||!t)return;let n=fCe(e);n&&n!==e&&OL(n,t.contentScrollTop)}function SCe(e,t,n){if(!(!(e instanceof HTMLElement)||!(t instanceof HTMLElement))){if(!n){lCe(e,0);return}uCe(t,e,n.viewportScrollTop)}}function AL(e){let{panel:t,contentScrollRoot:n,viewport:r}=e,i=t.getBoundingClientRect(),a=r.getBoundingClientRect(),o=wL(Math.min(i.bottom,a.bottom)-Math.max(i.top,a.top),0,r.clientHeight);if(o<=0)return null;let s=Math.max(i.top-a.top,0),c=wL(Math.max(a.top-i.top,0),0,EL(t,o));return{contentScrollTop:n&&n!==t?n.scrollTop:0,innerScrollTop:c,topInset:s,visibleHeight:o,viewportScrollTop:r.scrollTop}}function CCe(e,t){let n=gCe(e.panel,t);return e.contentScrollRoot&&e.contentScrollRoot!==e.panel&&OL(e.contentScrollRoot,t.contentScrollTop),e.panel.scrollTop=t.innerScrollTop,t.innerScrollTop>0&&(e.viewport.scrollTop=wL(e.viewport.scrollTop-t.innerScrollTop,0,TL(e.viewport))),{contentScrollRoot:e.contentScrollRoot&&e.contentScrollRoot!==e.panel?e.contentScrollRoot:null,contentScrollTop:t.contentScrollTop,finalViewportScrollTop:t.viewportScrollTop,panel:e.panel,previousStyles:n,viewport:e.viewport}}function wCe(e,t){let n={contentScrollTop:e.contentScrollRoot&&e.contentScrollRoot!==e.panel?t.contentScrollTop:0,topInset:wL(t.topInset,0,e.viewport.clientHeight),visibleHeight:wL(t.visibleHeight,1,e.viewport.clientHeight),innerScrollTop:0,viewportScrollTop:t.viewportScrollTop};n.innerScrollTop=wL(t.innerScrollTop,0,EL(e.panel,n.visibleHeight));let r=wL(pCe(e.panel,e.viewport)-n.topInset,0,TL(e.viewport)),i=gCe(e.panel,n);return e.viewport.scrollTop=r,e.contentScrollRoot&&e.contentScrollRoot!==e.panel&&OL(e.contentScrollRoot,n.contentScrollTop),e.panel.scrollTop=n.innerScrollTop,{contentScrollRoot:e.contentScrollRoot&&e.contentScrollRoot!==e.panel?e.contentScrollRoot:null,contentScrollTop:n.contentScrollTop,finalViewportScrollTop:t.viewportScrollTop,panel:e.panel,previousStyles:i,viewport:e.viewport}}function TCe(e){_Ce(e.panel,e.previousStyles),uCe(e.viewport,e.panel,e.finalViewportScrollTop),e.panel.scrollTop=0,e.contentScrollRoot&&OL(e.contentScrollRoot,e.contentScrollTop)}function ECe(e){_Ce(e.panel,e.previousStyles),e.panel.scrollTop=0}var jL={pathname:`/`,search:``,hash:``,state:void 0};function DCe(e){let t=new Set(e.tabs.map(e=>e.id)),n=new URLSearchParams(e.search).get(e.queryKey);return n&&(t.has(n)||e.allowUnknownSelection)?n:e.initialTab&&t.has(e.initialTab)?e.initialTab:e.tabs[0]?.id??``}function OCe(e,t,n,r,i){let a=new URLSearchParams(t);a.set(r,i);let o=a.toString();return`${e}${o.length>0?`?${o}`:``}${n}`}function ML(e,t){return t||(Lf()?`main`:kp.getAreaForPath(e))}function kCe(e){if(!e)return;let t=(typeof e==`string`?e.split(`,`):[...e]).map(e=>e.trim()).filter(e=>e.length>0);return t.length>0?t:void 0}function ACe(){return typeof window>`u`?jL:{pathname:window.location.pathname||`/`,search:window.location.search,hash:window.location.hash,state:window.history.state}}function jCe(e){let t=e.__store.state.location;return{pathname:t.pathname,search:t.searchStr,hash:t.hash,state:t.state}}function MCe(e,t,n){if(typeof window>`u`)return;let r=new URL(e,window.location.origin),i=`${r.pathname}${r.search}${r.hash}`;t?window.history.replaceState(n,``,i):window.history.pushState(n,``,i),window.dispatchEvent(new PopStateEvent(`popstate`,{state:window.history.state}))}function NCe(){let e=(0,V.useContext)(zo()),t=(0,V.useRef)(jL);return{location:(0,V.useSyncExternalStore)((0,V.useCallback)(t=>e?.__store?e.__store.subscribe(()=>{t()}):typeof window>`u`?()=>{}:(window.addEventListener(`popstate`,t),window.addEventListener(`hashchange`,t),()=>{window.removeEventListener(`popstate`,t),window.removeEventListener(`hashchange`,t)}),[e]),(0,V.useCallback)(()=>{let n=e?.__store?jCe(e):ACe(),r=t.current;return r.pathname===n.pathname&&r.search===n.search&&r.hash===n.hash&&r.state===n.state?r:(t.current=n,n)},[e]),()=>jL),router:e}}function NL(e,t){if(!e)return[];let n=[],r=e.getHeaderShell();r&&n.push([r,`vt-tab-header-shell`]);let i=e.getSelectionIndicator();i&&n.push([i,`vt-tab-edge`]);let a=e.getHeaderForeground();a&&n.push([a,`vt-tab-header-foreground`]);let o=e.getPanel(t);return o&&n.push([o,`vt-tab-panel`]),n}function PCe({queryKey:e,tabs:t,initialTab:n,area:r,history:i=`replace`,allowUnknownSelection:a=!1,viewportSelector:o}){let{location:s,router:c}=NCe(),l=(0,V.useRef)(null),u=(0,V.useMemo)(()=>kCe(o),[typeof o==`string`?o:(o??[]).join(`\0`)]),d=(0,V.useRef)(new Map),f=(0,V.useRef)(new Map),p=(0,V.useRef)(0),m=(0,V.useRef)(null),h=(0,V.useMemo)(()=>DCe({tabs:t,queryKey:e,search:s.search,initialTab:n,allowUnknownSelection:a}),[a,n,s.search,e,t]),[g,_]=(0,V.useState)(h),v=(0,V.useRef)({allowUnknownSelection:a,area:r,history:i,location:s,queryKey:e,router:c,selectedFromLocation:h,selectedTab:g,tabs:t,viewportSelector:u});v.current={allowUnknownSelection:a,area:r,history:i,location:s,queryKey:e,router:c,selectedFromLocation:h,selectedTab:g,tabs:t,viewportSelector:u};let y=(0,V.useCallback)((e,t)=>{let n=f.current.get(e);!n||t!=null&&n.token!==t||(ECe(n.state),f.current.delete(e))},[]),b=(0,V.useCallback)(()=>{for(let e of f.current.values())ECe(e.state);f.current.clear()},[]),x=(0,V.useCallback)((e,t)=>{let n=kL(l.current,e,t);return n?AL(n):null},[]),S=(0,V.useCallback)((e,t,n)=>{let r=kL(l.current,e,t);if(!r)return;let i=n??AL(r);if(!i)return;d.current.set(e,i),y(e);let a=++p.current;return f.current.set(e,{token:a,state:CCe(r,i)}),a},[y]),C=(0,V.useCallback)((e,t,n)=>{let r=kL(l.current,e,t);if(!r)return null;let i=d.current.get(e)??n??AL(r);if(!i)return null;d.current.has(e)||d.current.set(e,i),y(e);let a=++p.current;return f.current.set(e,{token:a,state:wCe(r,i)}),a},[y]),w=(0,V.useCallback)((e,t)=>{let n=f.current.get(e);!n||t!=null&&n.token!==t||(TCe(n.state),f.current.delete(e))},[]);(0,V.useEffect)(()=>{_(e=>e===h?e:h)},[h]),(0,V.useLayoutEffect)(()=>{if(m.current===g){m.current=null;return}let e=d.current.get(g),t=kL(l.current,g,u),n=t?.panel??l.current?.getPanel(g)??null;xCe(n,e),SCe(n,t?.viewport??null,e)},[g,u]),(0,V.useEffect)(()=>{let e=kL(l.current,g,u),t=e?.contentScrollRoot;if(!e||!t||t===e.panel)return;let n=()=>{let e=d.current.get(g);e&&d.current.set(g,{...e,contentScrollTop:t.scrollTop})};return n(),t.addEventListener(`scroll`,n,{passive:!0}),()=>{t.removeEventListener(`scroll`,n)}},[g,u]),(0,V.useEffect)(()=>{let e=new Set(t.map(e=>e.id));for(let t of d.current.keys())e.has(t)||d.current.delete(t);for(let t of Array.from(f.current.keys()))e.has(t)||y(t)},[y,t]),(0,V.useEffect)(()=>{d.current.clear(),b()},[b,s.pathname]),(0,V.useEffect)(()=>()=>{b()},[b]);let T=(0,V.useCallback)((e,t)=>{let{allowUnknownSelection:n,area:r,history:i,location:a,queryKey:o,router:s,selectedFromLocation:c,selectedTab:u,tabs:f,viewportSelector:p}=v.current;if(!new Set(f.map(e=>e.id)).has(e)&&!n)return;let h=t?.history??i,g=t?.transferScroll??!0;if(u===e&&c===e)return;let b=()=>{_(e);let t=OCe(a.pathname,a.search,a.hash,o,e);if(Lf()){if(s){s.navigate({href:t,replace:h===`replace`,state:a.state});return}MCe(t,h===`replace`,a.state);return}let n=ML(a.pathname,r);if(h===`replace`){kp.replace(n,t,a.state);return}kp.push(n,t,a.state)};if(!g){let n=x(u,p);if(n&&d.current.set(u,n),m.current=e,!t?.animate||u===e){b();return}let i=gL(f,u,e);if(!i){b();return}Ob({intent:{area:ML(a.pathname,r),kind:`tab-carousel`,direction:i},collectBeforeEntries:()=>NL(l.current,u),collectAfterEntries:()=>NL(l.current,e),update:b});return}let T=gL(f,u,e),E=(t,n)=>{let i=x(u,p),o=d.current.get(e)??i??x(e,p),s=S(u,p,i);if(!t){(0,es.flushSync)(()=>{b()});let t=C(e,p,o);t!=null&&w(e,t),s!=null&&y(u,s);return}let c=null;Ob({intent:{area:ML(a.pathname,r),kind:`tab-carousel`,direction:n},collectBeforeEntries:()=>NL(l.current,u),collectAfterEntries:()=>(c??=C(e,p,o),NL(l.current,e)),update:b}).finally(()=>{c??=C(e,p,o),c!=null&&w(e,c),s!=null&&y(u,s)})};if(!t?.animate||u===e){E(!1);return}if(!T){E(!1);return}E(!0,T)},[S,x,y,w,C]);return{tabsRef:l,selectedTab:g,setSelectedTab:T,onTabChange:(0,V.useCallback)(e=>{T(e,{animate:!0})},[T])}}var PL=null,FCe=e=>{let t=`--tabs-button-${e}`;return String.raw`
|
|
1217
|
+
`}};customElements.define(`virtual-trackpad-tab`,Mxe);function Nxe(e){return new URLSearchParams(e.search).get(`session`)?.trim()||null}function tI(e,t=window.location){let n=Nxe(t);return n?`hosted-session:${n}:${e}`:e}var nI=1.5,rI=30,Pxe=50,iI=15;function aI(){return`ontouchstart`in window||navigator.maxTouchPoints>0}function oI(e){return e instanceof HTMLElement&&e.classList.contains(`terminal-touch-mouse-overlay`)}function Fxe(e,t,n){let r=document.elementFromPoint(t,n);if(r&&oI(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)&&!oI(r)?r:e.querySelector(`.xterm-screen`)??e}function sI(e){return e===`input`||e===`keys`||e===`shortcuts`||e===`trackpad`||e===`settings`}function Ixe(e){return e===`copy`||e===`paste`||e===`select-all`}function cI(e){return typeof e==`object`&&!!e}function lI(){try{let e=localStorage.getItem(tI(`xtermInputPanelState`));if(!e)return{};let t=JSON.parse(e);return cI(t)?t:{}}catch{return{}}}function Lxe(e){try{localStorage.setItem(tI(`xtermInputPanelState`),JSON.stringify(e))}catch{}}function Rxe(e){let t=lI().sessions;if(!t)return null;let n=t[e];if(!cI(n))return null;let r={activeTab:`input`,inputDraft:``};return sI(n.activeTab)&&(r.activeTab=n.activeTab),typeof n.inputDraft==`string`&&(r.inputDraft=n.inputDraft),r}function uI(){let e=lI();return sI(e.lastActiveTab)?e.lastActiveTab:`input`}var dI=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(YA(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=Rxe(this._stateKey);n?(this._panelSessionState=n,this._hasOwnPersistedState=!0):this._panelSessionState.activeTab=e._lastActiveTab||uI()}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=lI(),n={...t.sessions,[this._stateKey]:{activeTab:this._panelSessionState.activeTab,inputDraft:this._panelSessionState.inputDraft}};Lxe({...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,aI()&&!this._isOpen&&this.open()};t.addEventListener(`focus`,n),this._persistentCleanups.push(()=>t.removeEventListener(`focus`,n)),aI()&&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=uI();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(!cI(t))return;let n=t.command;if(!Ixe(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;sI(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,aI()||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&&(aI()&&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=Nge(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*nI)),this._cursorPos.y=Math.max(0,Math.min(r.height,this._cursorPos.y+t*nI)),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?Fxe(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<rI,r=this._cursorPos.y>t.height-rI;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<rI?t.top-iI:t.bottom+iI;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}))},Pxe)}_stopEdgeScroll(){this._edgeScrollTimer&&=(clearInterval(this._edgeScrollTimer),null)}_suppressKeyboard(){if(!aI())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 fI(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 zxe(e){return e.trim().replace(/ /g,`+`)}function Bxe(e){let t=e.families.map(zxe).filter(Boolean),{apiHost:n}=fI(e.lang??``),r=t.map(e=>`family=${e}`),i=`display=${e.display??`swap`}`;return`${n}/css2?${[...r,i].join(`&`)}`}function Vxe(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=fI(n),i=Bxe({...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 pI=null,mI=null,hI=null,gI=null,_I=!1,vI=!1;function yI(){return typeof window>`u`?null:window.AudioContext??window.webkitAudioContext??null}function bI(){return _I?!0:typeof navigator>`u`?!1:navigator.userActivation?.hasBeenActive===!0||navigator.userActivation?.isActive===!0}function Hxe(){typeof window>`u`||!vI||(window.removeEventListener(`pointerdown`,xI,!0),window.removeEventListener(`keydown`,xI,!0),vI=!1)}function xI(){_I=!0,Hxe(),gI?.(),gI=null,hI=null}function SI(){typeof window>`u`||vI||bI()||(window.addEventListener(`pointerdown`,xI,{capture:!0,once:!0,passive:!0}),window.addEventListener(`keydown`,xI,{capture:!0,once:!0}),vI=!0)}function Uxe(){SI()}function Wxe(){return typeof window>`u`||bI()?Promise.resolve():hI||(hI=new Promise(e=>{gI=e,SI()}),hI)}async function Gxe(){return pI||mI||(yI()?(mI=Wxe().then(async()=>{let e=yI();if(!e)return null;let t=pI??new e;return pI=t,t.state===`suspended`&&await t.resume(),t}).finally(()=>{mI=null}),mI):null)}var Kxe=class{fallbackSound;unlocked=!1;unlockPromise=null;silentAudio=null;activeAudios=new Set;constructor(e){this.fallbackSound=e===`bell`?Bg:Vg}init(){Uxe()}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 Gxe()){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=jne(e);if(t)return t;let n=Ane(e);if(!n)return null;let r=bf(),i=`/api/sounds/custom/${n}`;return r?`${r}${i}`:i}async isMissingSound(e){try{return(await Ff(e,{method:`HEAD`})).status===404}catch{return!1}}createManagedAudio(e,t){let n=new Audio(e);n.volume=qxe(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 qxe(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):1}var Jxe=class extends Kxe{constructor(){super(`bell`)}},CI=`xtermInputPanelSettings`,Yxe=50,Xxe=1e3,Zxe=1,Qxe=1,wI=`terminal-meta`;function TI(){return vf(`terminal-input-history`,window.location)}function $xe(){return vf(`openspecui-terminal`,window.location)}function EI(){return vf(`input-history`,window.location)}function DI(){return vf(`terminal-input-history-fallback`,window.location)}function OI(e){return Math.max(Zxe,Math.min(Xxe,Math.round(e)))}function kI(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 AI(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,OI(t))}function jI(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 MI(){try{let e=localStorage.getItem(CI);if(!e)return{};let t=JSON.parse(e);return typeof t!=`object`||!t?{}:t}catch{return{}}}function eSe(e){let t=MI();try{localStorage.setItem(CI,JSON.stringify({...t,...e}))}catch{}}async function NI(){return typeof window>`u`||!(`indexedDB`in window)?null:await new Promise(e=>{let t=window.indexedDB.open($xe(),Qxe);t.onupgradeneeded=()=>{let e=t.result;e.objectStoreNames.contains(wI)||e.createObjectStore(wI)},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null)})}async function tSe(){let e=await NI();return e?await new Promise(t=>{let n=e.transaction(wI,`readonly`),r=n.objectStore(wI).get(EI());r.onsuccess=()=>{t(kI(r.result))},r.onerror=()=>t([]),n.oncomplete=()=>e.close(),n.onerror=()=>e.close(),n.onabort=()=>e.close()}):null}async function nSe(e){let t=await NI();return t?await new Promise(n=>{let r=t.transaction(wI,`readwrite`);r.objectStore(wI).put(e,EI()),r.oncomplete=()=>{t.close(),n(!0)},r.onerror=()=>{t.close(),n(!1)},r.onabort=()=>{t.close(),n(!1)}}):!1}function rSe(){try{let e=localStorage.getItem(DI());return e?kI(JSON.parse(e)):[]}catch{return[]}}function iSe(e){try{localStorage.setItem(DI(),JSON.stringify(e))}catch{}}async function aSe(){return await tSe()||rSe()}async function PI(e){await nSe(e)||iSe(e)}var oSe=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=MI().historyLimit;return typeof e==`number`&&Number.isFinite(e)?OI(e):Yxe}async setLimit(e){let t=OI(e);eSe({historyLimit:t}),await this.ensureInitialized();let n=AI(this.records,t);await this.commit(n,{persistRemote:!0})}async add(e){let t=e.trim();if(!t)return;await this.ensureInitialized();let n=AI([{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=AI(await aSe(),this.getLimit()),this.emit(),!Lf())try{let e=kI(await Cy.kv.get.query({key:TI()})),t=AI([...this.records,...e],this.getLimit());jI(this.records,t)||(this.records=t,await PI(this.records),this.emit()),jI(e,this.records)||this.persistRemote(this.records);let n=Cy.kv.subscribe.subscribe({key:TI()},{onData:e=>{this.onRemoteData(e)}});this.kvUnsubscribe=()=>n.unsubscribe()}catch{}}async onRemoteData(e){let t=kI(e),n=AI([...this.records,...t],this.getLimit());await this.commit(n,{persistRemote:!1})}async commit(e,t){jI(this.records,e)||(this.records=e,await PI(this.records),this.emit(),t.persistRemote&&!Lf()&&this.persistRemote(this.records))}async persistRemote(e){try{await Cy.kv.set.mutate({key:TI(),value:e})}catch{}}emit(){for(let e of this.listeners)e(this.records)}};function FI(e){return e.type===`keydown`}function II(e,t){return e.key.toLowerCase()===t}function LI(e){return e.metaKey||e.ctrlKey}function RI(e){return LI(e)&&!e.altKey}function zI(e){return e.clipboard?e.clipboard:typeof navigator>`u`?null:navigator.clipboard??null}function BI(e,t){e.catch(e=>{t.onAsyncError?.(e)})}async function sSe(e,t){let n=zI(e);n?.writeText&&await n.writeText(t)}async function cSe(e){let t=zI(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 lSe=[{id:`terminal.copy-selection`,handle:(e,t)=>!FI(e)||!RI(e)||!II(e,`c`)?null:t.terminal.hasSelection?.()?VI(t):`allow`},{id:`terminal.paste-clipboard`,handle:(e,t)=>!FI(e)||!RI(e)||!II(e,`v`)?null:HI(t)},{id:`terminal.select-all`,handle:(e,t)=>!FI(e)||!e.metaKey||e.ctrlKey||e.altKey||!II(e,`a`)?null:UI(t)},{id:`terminal.zoom-in`,handle:(e,t)=>!FI(e)||!LI(e)||e.key!==`=`&&e.key!==`+`?null:(t.zoomFont(1),`block`)},{id:`terminal.zoom-out`,handle:(e,t)=>!FI(e)||!LI(e)||e.key!==`-`?null:(t.zoomFont(-1),`block`)},{id:`terminal.zoom-reset`,handle:(e,t)=>!FI(e)||!LI(e)||e.key!==`0`?null:(t.resetFontSize(),`block`)}];function VI(e){if(!e.terminal.hasSelection?.())return`allow`;let t=e.terminal.getSelection?.()??``;return t?(BI(sSe(e,t),e),`block`):`allow`}function HI(e){return zI(e)?.readText?(BI(cSe(e),e),`block`):`allow`}function UI(e){return e.terminal.selectAll?(e.terminal.selectAll(),`block`):`allow`}var uSe=[{id:`terminal.command.copy-selection`,command:`copy`,run:VI},{id:`terminal.command.paste-clipboard`,command:`paste`,run:HI},{id:`terminal.command.select-all`,command:`select-all`,run:UI}],dSe=class{constructor(e=lSe,t=uSe){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`}},fSe={"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 pSe(e){let t=e.useTheme??`app`;return t===`light`?`light`:t===`dark`?`dark`:t===`system`?e.systemDarkMode?`dark`:`light`:e.appDarkMode?`dark`:`light`}function WI(e){let t=pSe(e),n=t===`dark`?e.darkTheme??`default-dark`:e.lightTheme??`default-light`;return{id:n,mode:t,definition:fSe[n]}}var GI=`"JetBrains Mono Variable", "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`,KI={fontSize:13,fontFamily:``,cursorBlink:!0,cursorStyle:`block`,scrollback:1e3,useTheme:`app`,lightTheme:`default-light`,darkTheme:`default-dark`,rendererEngine:`xterm`,bellSound:Bg,bellVolume:1},qI=1500,JI=1e3,mSe=1e4,YI=`common`,hSe=512*1024,gSe=8,_Se=32,XI=13,vSe=800,ySe={ArrowUp:`\x1B[A`,ArrowDown:`\x1B[B`},bSe={ArrowLeft:`\x1Bb`,ArrowRight:`\x1Bf`,ArrowUp:`\x1B[1;3A`,ArrowDown:`\x1B[1;3B`},xSe={ArrowLeft:``,ArrowUp:``,ArrowRight:``,ArrowDown:``},SSe=[`JetBrains Mono`,`Fira Code`,`Source Code Pro`,`IBM Plex Mono`,`Inconsolata`,`Roboto Mono`,`Ubuntu Mono`,`Space Mono`],CSe={"JetBrains Mono":`"JetBrains Mono Variable"`,"Share Tech Mono":`"Share Tech Mono"`},ZI=new Set;function QI(e){try{return(new URL(e).pathname.split(`/`).pop()??``).replace(/\.[^.]+$/,``).replace(/[-_]/g,` `)||`CustomFont`}catch{return`CustomFont`}}async function wSe(e){let t=e.trim();if(!t)return``;if(!/^https?:\/\//i.test(t))return t;if(ZI.has(t))return QI(t);try{let e=(await Ff(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),ZI.add(t),``}if(e.startsWith(`font/`)){let e=QI(t),n=document.createElement(`style`);return n.dataset.fontSrc=t,n.textContent=`@font-face { font-family: '${e}'; src: url('${t}'); }`,document.head.appendChild(n),ZI.add(t),e}}catch{}return t}function TSe(e){let t=`google:${e}`;if(ZI.has(t))return;let n=Vxe({families:[e]});n&&(n.dataset.fontSrc=t),ZI.add(t)}var ESe=class{instances=new Map;listeners=new Set;activationListeners=new Set;idCounter=0;config={...KI};snapshotCache=null;inputHistoryStore=new oSe;bellSoundEngine=new Jxe;keybindings=new dSe;ghosttyModule=null;ghosttyInitPromise=null;appDarkMode=!1;systemDarkMode=!1;resolvedTheme=WI({useTheme:KI.useTheme,lightTheme:KI.lightTheme,darkTheme:KI.darkTheme,appDarkMode:!1,systemDarkMode:!1});ws=null;wsConnected=!1;reconnectTimer=null;reconnectDelay=JI;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:YI,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=WI({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:GI,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 Yhe(e),n=new ipe;return t.loadAddon(n),t.loadAddon(new upe),{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 dI({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?bSe[e.key]??null:e.metaKey&&!e.altKey&&!e.ctrlKey&&!e.shiftKey?xSe[e.key]??null:!e.altKey&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey?ySe[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>hSe&&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||=Z(()=>import(`./ghostty-web-BIYzTj9q.js`).then(async e=>(await e.init(),this.ghosttyModule=e,e)),[]).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=WI({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(GI);return}let t=e.split(/[,]+/).map(e=>e.trim()).filter(Boolean),n=[];for(let e of t){let t=CSe[e];if(t)n.push(t);else if(SSe.includes(e))TSe(e),n.push(e);else{let t=await wSe(e);t&&n.push(t)}}n.push(GI),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,Z(async()=>{let{trpcClient:e}=await import(`./trpc-CHrTaCNa.js`);return{trpcClient:e}},__vite__mapDeps([0,1,2])).then(({trpcClient:e})=>{e.config.update.mutate({terminal:{fontSize:this.config.fontSize}})}).catch(()=>{})},vSe)}zoomFont(e){let t=Math.min(_Se,Math.max(gSe,this.config.fontSize+e));t!==this.config.fontSize&&(this.applyConfig({fontSize:t}),this.persistFontSize())}resetFontSize(){this.config.fontSize!==XI&&(this.applyConfig({fontSize:XI}),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<qI;t.lastOutputTime=Date.now(),n||this.notify(),t.outputIdleTimer&&clearTimeout(t.outputIdleTimer),t.outputIdleTimer=setTimeout(()=>{t.outputIdleTimer=null,this.notify()},qI)}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){dI.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<qI,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(Cf());this.ws=e,e.onopen=()=>{this.wsConnected=!0,this.reconnectDelay=JI;let t=Af();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=epe.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,mSe)},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??YI,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??YI,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=DSe(e.closeCallbackUrl,e.exitCode);t&&OSe(t)}wsSend(e){return this.ws?.readyState===WebSocket.OPEN?(this.ws.send(JSON.stringify(e)),!0):!1}};function DSe(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 OSe(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=kp.getAreaForPath(t.pathname);kp.push(n,e,null);return}window.open(t.toString(),`_blank`,`noopener,noreferrer`)}new ESe,e(i(((e,t)=>{t.exports={}}))(),1),Y({sound:Dne.default(Vg),volume:One,systemNotificationsEnabled:cd().default(!1)});var kSe=pd(`type`,[Y({type:X(`terminal`),sessionId:K().min(1),title:K().optional()}),Y({type:X(`openspec-change`),changeId:K().min(1),title:K().optional()}),Y({type:X(`hooks-plugin`),pluginId:K().min(1),title:K().optional()}),Y({type:X(`root-context`)}),Y({type:X(`custom`),groupId:K().min(1),title:K().optional()})]),ASe=pd(`type`,[Y({type:X(`terminal.focus`),label:K().default(`Focus terminal`),target:Y({sessionId:K().min(1)})}),Y({type:X(`href.open`),label:K().default(`Open`),target:Y({href:K().min(1)})})]),jSe=K().min(1);Y({title:K().min(1).max(160),body:K().max(2e3).default(``),source:kSe,actions:J(ASe).default([]),level:_d([`info`,`success`,`warning`,`error`]).default(`info`),createdAt:q().int().positive().optional()}).extend({id:K().min(1),createdAt:q().int().positive(),groupKey:jSe});var MSe=(0,V.createContext)(null),NSe={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 PSe(){return(0,V.useContext)(MSe)||NSe}function $I({className:e,badgeClassName:t,iconClassName:n,size:r=`mobile`}){let{unreadCount:i,openPanel:a}=PSe();return(0,H.jsx)(fE,{label:i>0?`Open notifications, ${i} unread`:`Open notifications`,icon:(0,H.jsx)(qs,{className:tE(`h-4 w-4`,n)}),badge:i>0?(0,H.jsx)(iE,{count:i,className:tE(`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 eL({children:e,maxWidth:t=300,duration:n=10,gap:r=20,className:i=``}){let[a,o]=(0,V.useState)(!1),[s,c]=(0,V.useState)(!1),l=(0,V.useRef)(null),u=(0,V.useRef)(null);(0,V.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,V.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,H.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,H.jsx)(`div`,{ref:l,className:`relative overflow-hidden whitespace-nowrap`,style:{maxWidth:f},children:(0,H.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,H.jsx)(`span`,{className:`text-muted-foreground group-hover:text-foreground shrink-0 transition-colors`,children:a?(0,H.jsx)(Qs,{className:`h-3.5 w-3.5 text-green-500`}):(0,H.jsx)(lc,{className:`h-3.5 w-3.5`})})]})}function tL({compact:e=!1}){if(Lf())return(0,H.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,H.jsx)(Zs,{className:`h-3.5 w-3.5 text-blue-500`}),!e&&(0,H.jsx)(`span`,{className:`status-text text-blue-600`,children:`Static`})]});let t=hE(),n=Rfe();if(t.connected){let n=t.watcherEnabled?`Watching for changes`:`File watcher disabled`;return(0,H.jsxs)(`div`,{className:`status-indicator flex items-center gap-1.5 text-xs`,children:[(0,H.jsx)(Ic,{className:`h-3.5 w-3.5 text-green-500`}),!e&&(0,H.jsx)(nE,{content:n,children:(0,H.jsx)(`span`,{className:`status-text cursor-default text-green-600`,children:`Live`})})]})}return(0,H.jsxs)(`div`,{className:`status-indicator flex items-center gap-1.5 text-xs`,children:[(0,H.jsx)(bl,{className:`h-3.5 w-3.5 text-red-500`}),!e&&(0,H.jsx)(`span`,{className:`status-text text-red-600`,children:`Offline`}),t.reconnectCountdown!==null&&(0,H.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,H.jsxs)(`span`,{className:`text-xs`,children:[`(`,t.reconnectCountdown,`s)`]}),(0,H.jsx)(el,{className:`h-3 w-3`})]})]})}function FSe(){let e=Lf(),[t,n]=(0,V.useState)(`Unknown`),[r,i]=(0,V.useState)(null);if((0,V.useEffect)(()=>{e&&tv().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,H.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,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,H.jsx)(tL,{}),(0,H.jsxs)(`span`,{className:`truncate`,children:[`Generated: `,t]}),r&&(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,H.jsx)(Ac,{className:`h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(eL,{children:r,maxWidth:280,duration:12,className:`text-xs`})]})]})});let a=hE();return(0,H.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,H.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,H.jsx)(tL,{}),a.projectDir&&(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(Cc,{className:`h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(eL,{children:a.projectDir,maxWidth:300,duration:12,className:`text-xs`})]})]}),(0,H.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,H.jsx)($I,{})})]})}function ISe(){let[e,t]=(0,V.useState)(!1),n=Ub(),r=hE(),i=Ap(),a=r.dirName??`OpenSpec`,o=Bf(),s=Lf(),c=()=>t(!1);return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`header`,{className:`mobile-header border-border bg-background flex h-12 items-center justify-between border-b px-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(`button`,{onClick:()=>t(!0),className:`hover:bg-muted -ml-1.5 rounded-md p-1.5`,"aria-label":`Open menu`,children:(0,H.jsx)(Uc,{className:`h-5 w-5`})}),(0,H.jsx)(`span`,{className:`font-nav max-w-[min(52vw,18rem)] truncate text-[12px] tracking-[0.04em]`,children:a})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(fE,{label:`Open search`,icon:(0,H.jsx)(al,{className:`h-4 w-4`}),onClick:()=>Ib.activatePop(`/search`)}),!s&&(0,H.jsx)($I,{}),(0,H.jsx)(tL,{compact:!0})]})]}),e&&(0,H.jsxs)(`div`,{className:`fixed inset-0 z-50 flex`,children:[(0,H.jsx)(`div`,{className:`animate-in fade-in absolute inset-0 bg-black/50 duration-200`,onClick:c}),(0,H.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,H.jsxs)(`div`,{className:`mb-6 flex items-center justify-between`,children:[(0,H.jsx)(`img`,{src:n?`${o}openspec_pixel_dark.svg`:`${o}openspec_pixel_light.svg`,alt:`OpenSpec`,className:`h-5`}),(0,H.jsx)(`button`,{onClick:c,className:`hover:bg-muted rounded-md p-1.5`,"aria-label":`Close menu`,children:(0,H.jsx)(Cl,{className:`h-5 w-5`})})]}),s?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`ul`,{className:`flex-1 space-y-1`,children:cE.map(e=>(0,H.jsx)(`li`,{children:(0,H.jsxs)(Nb,{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,H.jsx)(e.icon,{className:`h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{className:`font-nav text-base tracking-[0.04em]`,children:e.label})]})},e.to))}),(0,H.jsx)(`div`,{className:`border-border space-y-1 border-t pt-4`,children:(0,H.jsxs)(Nb,{to:lE.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,H.jsx)(lE.icon,{className:`h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{className:`font-nav text-base tracking-[0.04em]`,children:lE.label})]})})]}):(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2`,children:[(0,H.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,H.jsx)(dE,{area:`main`,tabs:i.mainTabs,className:`scrollbar-thin scrollbar-track-transparent h-full overflow-auto`,useLinks:!0,onNavigate:c})}),(0,H.jsx)(`div`,{className:`text-muted-foreground text-[10px] font-medium uppercase tracking-wider`,children:`Bottom`}),(0,H.jsx)(`div`,{className:`border-border border-t pt-2`,children:(0,H.jsx)(dE,{area:`bottom`,tabs:i.bottomTabs,onNavigate:c})})]})]})]})]})}function LSe(){let e=Ap();return(0,H.jsx)(`nav`,{className:`mobile-tabbar border-border bg-background flex h-14 items-stretch border-t`,children:(Lf()?Nfe:e.mainTabs.map(e=>sE.find(t=>t.to===e)).filter(e=>e!=null)).map(e=>(0,H.jsxs)(Nb,{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,H.jsxs)(`span`,{className:`relative`,children:[(0,H.jsx)(e.icon,{className:`h-5 w-5 shrink-0`}),e.beta?(0,H.jsx)(oE,{}):null]}),(0,H.jsx)(`span`,{className:`font-nav text-[10px] tracking-[0.03em]`,children:e.label})]},e.to))})}function RSe(){return(0,H.jsxs)(`div`,{className:`@container/app fixed inset-0`,style:{containerName:`app`},children:[(0,H.jsxs)(`div`,{className:`app-layout h-full`,children:[(0,H.jsx)(Ife,{}),(0,H.jsxs)(`div`,{className:`app-body flex min-h-0 flex-1 flex-col`,children:[(0,H.jsx)(ISe,{}),(0,H.jsx)(`main`,{className:`main-content scrollbar-thin scrollbar-track-transparent view-transition-route flex min-h-0 flex-1 flex-col`,children:(0,H.jsx)(Ms,{})}),(0,H.jsx)(LSe,{}),(0,H.jsx)(FSe,{})]})]}),(0,H.jsx)(Ose,{})]})}var zSe={primary:`bg-primary text-primary-foreground hover:bg-primary/90`,secondary:`border-border bg-background text-foreground border hover:bg-muted`,ghost:`text-foreground hover:bg-muted`,destructive:`bg-red-600 text-white hover:bg-red-700 focus-visible:ring-red-500 dark:bg-red-600 dark:hover:bg-red-700`},BSe={primary:`bg-primary/10 text-primary hover:bg-primary/10`,secondary:`border-primary/40 bg-primary/10 text-primary border hover:bg-primary/10`,ghost:`bg-primary/10 text-primary hover:bg-primary/10`,destructive:`bg-red-600/10 text-red-600 hover:bg-red-600/10 dark:text-red-400`},VSe={sm:`gap-1.5 rounded-md px-3 py-1.5 text-xs`,md:`gap-2 rounded-md px-4 py-2 text-sm`,"icon-sm":`h-7 w-7 rounded-md p-0`,"icon-md":`h-9 w-9 rounded-md p-0`},nL=(0,V.forwardRef)(function({variant:e=`primary`,size:t=`md`,activity:n=!1,disabled:r=!1,type:i=`button`,className:a,onClick:o,"aria-disabled":s,...c},l){let u=e=>{if(n){e.preventDefault(),e.stopPropagation();return}o?.(e)};return(0,H.jsx)(`button`,{ref:l,type:i,disabled:r,"aria-disabled":s??(n?!0:void 0),"data-activity":n?`true`:void 0,onClick:u,className:tE(`inline-flex shrink-0 items-center justify-center font-medium outline-none transition-colors`,`focus-visible:ring-primary focus-visible:ring-1`,r?`cursor-not-allowed opacity-50`:n?`cursor-default`:`cursor-pointer`,n?BSe[e]:zSe[e],VSe[t],a),...c})});function HSe({pending:e,settled:t=!1,disabled:n,children:r,className:i,...a}){return(0,H.jsx)(nL,{...a,activity:e||t,disabled:n??!1,"aria-busy":e||void 0,className:tE(i),children:r})}function rL({children:e,className:t}){let n=e!=null&&e!==!1&&e!==``;return(0,H.jsx)(`span`,{className:tE(`sr-only`,t),role:n?`status`:void 0,"aria-live":n?`polite`:void 0,"aria-atomic":n?`true`:void 0,children:e})}function iL({children:e,className:t,active:n=!0,statusLabel:r=`updating`,persistent:i=!1}){return(0,H.jsxs)(`div`,{className:tE(!n&&!i&&`contents`,n&&`rt-revalidate-cue`,t),"aria-busy":n||void 0,children:[(0,H.jsx)(rL,{children:n?r:null}),e]})}function USe({progress:e,className:t}){if(e===null)return null;if(e.total===`unknown`)return(0,H.jsx)(`div`,{className:tE(`rt-progress-indeterminate`,t),role:`progressbar`,"aria-valuetext":`loading`});let n=e.total===0?1:e.total,r=Math.max(0,Math.min(100,e.completed/n*100));return(0,H.jsx)(`div`,{className:tE(`rt-progress-track`,t),role:`progressbar`,"aria-valuemin":0,"aria-valuemax":e.total,"aria-valuenow":e.completed,children:(0,H.jsx)(`div`,{className:`rt-progress-fill`,style:{inlineSize:`${r}%`}})})}(0,V.createContext)(null);function aL({className:e,style:t}){return(0,H.jsx)(`div`,{className:tE(`rt-skeleton`,e),style:t,"aria-hidden":`true`})}function oL({className:e,style:t}){return(0,H.jsx)(aL,{className:tE(`rt-skeleton-line`,e),style:t})}function WSe({className:e,style:t}){return(0,H.jsx)(aL,{className:tE(`rt-skeleton-row`,e),style:t})}var GSe={"list-divide":`rt-anchor border-border bg-border grid gap-px overflow-hidden rounded-lg border`,"grid-cards":`rt-anchor grid gap-3`,plain:`rt-anchor space-y-2`};function sL({mode:e=`plain`,containerClassName:t,count:n=4,rowClassName:r,renderRow:i}){return(0,H.jsx)(`div`,{className:tE(GSe[e],t),"aria-hidden":`true`,children:Array.from({length:n},(e,t)=>i?(0,H.jsx)(V.Fragment,{children:i(t)},t):(0,H.jsx)(WSe,{className:r},t))})}function KSe(){return(0,H.jsxs)(`div`,{className:`space-y-4 p-4 md:p-6`,"aria-busy":`true`,children:[(0,H.jsx)(rL,{children:`loading route`}),(0,H.jsx)(aL,{className:`h-8 w-48`}),(0,H.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-3`,children:[(0,H.jsx)(aL,{className:`h-24`}),(0,H.jsx)(aL,{className:`h-24`}),(0,H.jsx)(aL,{className:`h-24`})]}),(0,H.jsx)(aL,{className:`h-48`})]})}function cL({titleWidth:e=`w-1/3`,subtitleWidth:t=`w-1/4`,className:n}){return(0,H.jsxs)(`div`,{className:tE(`bg-background flex items-center justify-between gap-3 px-4 py-3`,n),children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,H.jsx)(aL,{className:`mt-0.5 size-5 shrink-0`}),(0,H.jsxs)(`div`,{className:`flex-1 space-y-2`,children:[(0,H.jsx)(aL,{className:tE(`h-4`,e)}),(0,H.jsx)(aL,{className:tE(`h-3`,t)})]})]}),(0,H.jsxs)(`div`,{className:`flex flex-col items-end gap-1.5`,children:[(0,H.jsx)(aL,{className:`h-5 w-16`}),(0,H.jsx)(aL,{className:`h-3 w-10`})]})]})}function lL({count:e=5}){return(0,H.jsx)(sL,{mode:`list-divide`,count:e,renderRow:()=>(0,H.jsx)(cL,{titleWidth:`w-1/3`,subtitleWidth:`w-1/4`})})}function qSe({count:e=5}){return(0,H.jsx)(sL,{mode:`list-divide`,count:e,renderRow:()=>(0,H.jsx)(cL,{titleWidth:`w-2/5`,subtitleWidth:`w-1/5`})})}function uL({count:e=5}){return(0,H.jsx)(sL,{mode:`list-divide`,count:e,renderRow:()=>(0,H.jsx)(cL,{titleWidth:`w-1/4`,subtitleWidth:`w-1/6`})})}function JSe({count:e=4}){return(0,H.jsx)(sL,{mode:`plain`,count:e,renderRow:()=>(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-2 rounded-md border px-2.5 py-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,H.jsx)(aL,{className:`size-4`}),(0,H.jsx)(aL,{className:`h-4 w-28`})]}),(0,H.jsx)(aL,{className:`h-4 w-12`})]})})}function dL({count:e=6}){return(0,H.jsx)(`div`,{className:`flex flex-col gap-3`,"aria-hidden":`true`,children:Array.from({length:e},(e,t)=>(0,H.jsx)(aL,{className:t%3==2?`h-24`:`h-4`},t))})}function YSe({fields:e=4}){return(0,H.jsxs)(`section`,{className:`border-border bg-card flex flex-col gap-4 rounded-lg border p-4`,"aria-hidden":`true`,children:[(0,H.jsxs)(`header`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(aL,{className:`h-4 w-40`}),(0,H.jsx)(aL,{className:`h-3 w-56`})]}),(0,H.jsx)(aL,{className:`h-8 w-20`})]}),(0,H.jsx)(`div`,{className:`flex flex-col gap-3`,children:Array.from({length:e},(e,t)=>(0,H.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,H.jsx)(aL,{className:`h-3 w-24`}),(0,H.jsx)(aL,{className:`h-9 w-full`})]},t))})]})}function XSe({children:e,className:t}){return(0,H.jsx)(`span`,{className:tE(`rt-shiny-text`,t),children:e})}function fL({label:e,message:t,className:n,...r}){return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(nE,{content:t,children:(0,H.jsx)(rE,{role:`note`,tabIndex:0,"aria-label":t,tone:`muted`,className:tE(`focus-visible:ring-primary cursor-help px-1.5 text-[11px] font-medium outline-none focus-visible:ring-2 focus-visible:ring-offset-2`,n),...r,children:(0,H.jsx)(XSe,{children:e})})}),(0,H.jsx)(rL,{children:t})]})}var pL=(0,V.createContext)(null);function ZSe({children:e}){let[t,n]=(0,V.useState)({open:!1,changeId:``,changeName:``}),r=(0,V.useCallback)((e,t)=>{n({open:!0,changeId:e,changeName:t})},[]),i=(0,V.useCallback)(()=>{n(e=>({...e,open:!1}))},[]);return(0,H.jsx)(pL.Provider,{value:{state:t,openArchiveModal:r,closeArchiveModal:i},children:e})}function QSe(){let e=(0,V.useContext)(pL);if(!e)throw Error(`useArchiveModal must be used within ArchiveModalProvider`);return e}function $Se(e,t){let n=yi({getLocation(){return t.getLocation(e)},getLength(){return window.history.length},pushState(n,r){t.push(e,n,r)},replaceState(n,r){t.replace(e,n,r)},go(e){window.history.go(e)},back(){window.history.back()},forward(){window.history.forward()},createHref(n){return t.createHref(e,n)}});return t.setHistoryRef(e,n),n}function mL(e){if(!e)return``;let t=Date.now()-e,n=Math.floor(t/1e3),r=Math.floor(n/60),i=Math.floor(r/60),a=Math.floor(i/24),o=Math.floor(a/7),s=Math.floor(a/30),c=Math.floor(a/365);return n<60?`just now`:r<60?`${r}m ago`:i<24?`${i}h ago`:a<7?`${a}d ago`:o<4?`${o}w ago`:s<12?`${s}mo ago`:`${c}y ago`}function hL(e){return e?new Date(e).toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`}):``}function eCe(e){return e?new Date(e).toLocaleString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,hour:`2-digit`,minute:`2-digit`}):``}function tCe(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id)}function nCe(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function rCe(e,t){return!!(t&&!nCe()&&typeof e.startViewTransition==`function`&&!e.activeViewTransition)}function iCe(e){if(typeof document>`u`){e.update();return}let t=e.container,n=document;if(!rCe(n,t)){e.update();return}t.style.viewTransitionName=e.transitionName;try{n.startViewTransition(()=>(0,es.flushSync)(e.update)).finished.catch(()=>{}).finally(()=>{t.style.viewTransitionName===e.transitionName&&(t.style.viewTransitionName=``)})}catch{t.style.viewTransitionName=``,e.update()}}function aCe(e,t){let[n,r]=(0,V.useState)(e),i=(0,V.useRef)(!1),a=(0,V.useRef)(e),o=(0,V.useRef)(0),s=`vt-archive-list-${(0,V.useId)().replace(/[^a-zA-Z0-9_-]/g,``)}`;return(0,V.useEffect)(()=>{if(!i.current){i.current=!0,a.current=e,r(e);return}let n=a.current;a.current=e;let c=o.current+1;if(o.current=c,e===void 0||n===void 0||tCe(n,e)){r(e);return}queueMicrotask(()=>{o.current===c&&iCe({container:t.current,transitionName:s,update:()=>{o.current===c&&r(e)}})})},[t,e,s]),n}function oCe(){let{data:e,isLoading:t,isUpdating:n,error:r}=Ky(),i=(0,V.useRef)(null),a=aCe(e,i);return t&&!e&&!r?(0,H.jsxs)(`div`,{className:`space-y-6 p-4`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(Ws,{className:`h-6 w-6 shrink-0`}),`Archive`]}),(0,H.jsx)(qSe,{count:5})]}):(0,H.jsxs)(`div`,{className:`space-y-6 p-4`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(Ws,{className:`h-6 w-6 shrink-0`}),`Archive`]}),(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`Completed changes archived in the current writable Planning root.`}),r?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`font-medium`,children:`Archive subscription failed.`}),(0,H.jsx)(`p`,{className:`break-words`,children:r.message})]})]}):null,e&&(!r||e.length>0)?(0,H.jsx)(iL,{active:n,children:(0,H.jsxs)(`div`,{ref:i,"data-archive-list-continuity":!0,className:`border-border divide-border divide-y rounded-lg border`,children:[a?.map(e=>{let t={family:`archive`,entityId:e.id};return(0,H.jsxs)(Nb,{to:`/archive/$changeId`,params:{changeId:e.id},state:t=>({...t,__vtHandoff:{family:`archive`,entityId:e.id,title:e.name,subtitle:e.id}}),vt:{sharedElements:t},...rb(t,`container`),className:`hover:bg-muted/50 flex items-center justify-between p-4`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(Ws,{...rb(t,`icon`),className:`text-muted-foreground h-5 w-5`}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{...rb(t,`title`),className:`font-medium`,children:e.name}),(0,H.jsxs)(`div`,{className:`text-muted-foreground text-sm`,children:[e.id,e.updatedAt>0&&(0,H.jsxs)(H.Fragment,{children:[` · `,mL(e.updatedAt)]})]})]})]}),(0,H.jsx)(ec,{className:`text-muted-foreground h-4 w-4`})]},e.id)}),a?.length===0&&!n&&(0,H.jsxs)(`div`,{className:`text-muted-foreground p-8 text-center`,children:[(0,H.jsx)(Ws,{className:`mx-auto mb-4 h-12 w-12 opacity-50`}),(0,H.jsx)(`p`,{children:`No archived changes yet.`}),(0,H.jsxs)(`p`,{className:`mt-2 text-sm`,children:[`Changes in this Planning root are archived using`,` `,(0,H.jsx)(`code`,{className:`bg-muted rounded px-1`,children:`openspec archive`})]})]})]})}):null]})}function gL(e,t,n){let r=e.findIndex(e=>e.id===t),i=e.findIndex(e=>e.id===n);return r<0||i<0||r===i?null:i>r?`forward`:`backward`}var _L=`tabVisibleHeight`,vL=`tabTopInset`,yL=`tabScrollOffset`,bL=`tabLayoutBridge`,xL=`tabLayoutBridgeBasePadding`,SL=`tabLayoutBridgeInlinePadding`,CL=`[data-tab-scroll-root="true"]`;function wL(e,t,n){return Math.min(Math.max(e,t),n)}function TL(e){return Math.max(e.scrollHeight-e.clientHeight,0)}function EL(e,t){return Math.max(e.scrollHeight-t,0)}function sCe(e){return Number(e.dataset[bL]??`0`)||0}function cCe(e){e.dataset[xL]||=window.getComputedStyle(e).paddingBottom,e.dataset[SL]||=e.style.paddingBottom}function lCe(e,t){cCe(e);let n=Math.max(Math.ceil(t),0);if(e.dataset[bL]=String(n),n<=0){e.style.paddingBottom=e.dataset[SL]??``;return}let r=e.dataset[xL]??`0px`;e.style.paddingBottom=`calc(${r} + ${n}px)`}function uCe(e,t,n){let r=()=>{if(!e.isConnected||!t.isConnected)return!0;let r=sCe(t),i=Math.max(TL(e)-r,0);lCe(t,Math.max(n-i,0));let a=wL(n,0,TL(e));return e.scrollTop=a,e.scrollTop===a};if(r()||typeof requestAnimationFrame!=`function`)return;let i=10,a=()=>{r()||i<=0||(--i,requestAnimationFrame(a))};requestAnimationFrame(a)}function DL(e){return e===`auto`||e===`scroll`||e===`overlay`}function dCe(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT),n=null;for(;t.nextNode();){let e=t.currentNode;if(e instanceof HTMLElement&&!(!DL(window.getComputedStyle(e).overflowY)||e.scrollHeight<=e.clientHeight)){if(e.scrollTop>0)return e;n??=e}}return n}function fCe(e){return(e.matches(CL)?e:e.querySelector(CL))||dCe(e)}function pCe(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return t.scrollTop+n.top-r.top}function mCe(e,t){e.dataset[_L]=String(t.visibleHeight),e.dataset[vL]=String(t.topInset),e.dataset[yL]=String(t.innerScrollTop)}function hCe(e){delete e.dataset[_L],delete e.dataset[vL],delete e.dataset[yL]}function gCe(e,t){let n={height:e.style.height,maxHeight:e.style.maxHeight,minHeight:e.style.minHeight,overflowY:e.style.overflowY},r=`${t.visibleHeight}px`;return e.style.height=r,e.style.minHeight=r,e.style.maxHeight=r,e.style.overflowY=`hidden`,mCe(e,t),n}function _Ce(e,t){e.style.height=t.height,e.style.maxHeight=t.maxHeight,e.style.minHeight=t.minHeight,e.style.overflowY=t.overflowY,hCe(e)}function OL(e,t){if(!e)return;let n=()=>e.isConnected?(e.scrollTop=t,e.scrollTop===t):!0;if(n()||typeof requestAnimationFrame!=`function`)return;let r=10,i=()=>{n()||r<=0||(--r,requestAnimationFrame(i))};requestAnimationFrame(i)}function vCe(e){return typeof e==`string`?e.split(`,`).map(e=>e.trim()):[...e]}function yCe(e,t){let n=vCe(t);for(let t of n)if(t)try{let n=e.closest(t);if(n instanceof HTMLElement)return n}catch{return null}return null}function bCe(e,t){let n=e.parentElement;for(;n;){if(DL(window.getComputedStyle(n).overflowY)&&n.scrollHeight>n.clientHeight)return n;if(t&&n===t)break;n=n.parentElement}return t&&DL(window.getComputedStyle(t).overflowY)?t:null}function kL(e,t,n){if(!n)return null;let r=e?.getPanel(t);if(!(r instanceof HTMLElement))return null;let i=bCe(r,yCe(r,n));return i instanceof HTMLElement?{panel:r,contentScrollRoot:fCe(r),viewport:i}:null}function xCe(e,t){if(!(e instanceof HTMLElement)||!t)return;let n=fCe(e);n&&n!==e&&OL(n,t.contentScrollTop)}function SCe(e,t,n){if(!(!(e instanceof HTMLElement)||!(t instanceof HTMLElement))){if(!n){lCe(e,0);return}uCe(t,e,n.viewportScrollTop)}}function AL(e){let{panel:t,contentScrollRoot:n,viewport:r}=e,i=t.getBoundingClientRect(),a=r.getBoundingClientRect(),o=wL(Math.min(i.bottom,a.bottom)-Math.max(i.top,a.top),0,r.clientHeight);if(o<=0)return null;let s=Math.max(i.top-a.top,0),c=wL(Math.max(a.top-i.top,0),0,EL(t,o));return{contentScrollTop:n&&n!==t?n.scrollTop:0,innerScrollTop:c,topInset:s,visibleHeight:o,viewportScrollTop:r.scrollTop}}function CCe(e,t){let n=gCe(e.panel,t);return e.contentScrollRoot&&e.contentScrollRoot!==e.panel&&OL(e.contentScrollRoot,t.contentScrollTop),e.panel.scrollTop=t.innerScrollTop,t.innerScrollTop>0&&(e.viewport.scrollTop=wL(e.viewport.scrollTop-t.innerScrollTop,0,TL(e.viewport))),{contentScrollRoot:e.contentScrollRoot&&e.contentScrollRoot!==e.panel?e.contentScrollRoot:null,contentScrollTop:t.contentScrollTop,finalViewportScrollTop:t.viewportScrollTop,panel:e.panel,previousStyles:n,viewport:e.viewport}}function wCe(e,t){let n={contentScrollTop:e.contentScrollRoot&&e.contentScrollRoot!==e.panel?t.contentScrollTop:0,topInset:wL(t.topInset,0,e.viewport.clientHeight),visibleHeight:wL(t.visibleHeight,1,e.viewport.clientHeight),innerScrollTop:0,viewportScrollTop:t.viewportScrollTop};n.innerScrollTop=wL(t.innerScrollTop,0,EL(e.panel,n.visibleHeight));let r=wL(pCe(e.panel,e.viewport)-n.topInset,0,TL(e.viewport)),i=gCe(e.panel,n);return e.viewport.scrollTop=r,e.contentScrollRoot&&e.contentScrollRoot!==e.panel&&OL(e.contentScrollRoot,n.contentScrollTop),e.panel.scrollTop=n.innerScrollTop,{contentScrollRoot:e.contentScrollRoot&&e.contentScrollRoot!==e.panel?e.contentScrollRoot:null,contentScrollTop:n.contentScrollTop,finalViewportScrollTop:t.viewportScrollTop,panel:e.panel,previousStyles:i,viewport:e.viewport}}function TCe(e){_Ce(e.panel,e.previousStyles),uCe(e.viewport,e.panel,e.finalViewportScrollTop),e.panel.scrollTop=0,e.contentScrollRoot&&OL(e.contentScrollRoot,e.contentScrollTop)}function ECe(e){_Ce(e.panel,e.previousStyles),e.panel.scrollTop=0}var jL={pathname:`/`,search:``,hash:``,state:void 0};function DCe(e){let t=new Set(e.tabs.map(e=>e.id)),n=new URLSearchParams(e.search).get(e.queryKey);return n&&(t.has(n)||e.allowUnknownSelection)?n:e.initialTab&&t.has(e.initialTab)?e.initialTab:e.tabs[0]?.id??``}function OCe(e,t,n,r,i){let a=new URLSearchParams(t);a.set(r,i);let o=a.toString();return`${e}${o.length>0?`?${o}`:``}${n}`}function ML(e,t){return t||(Lf()?`main`:kp.getAreaForPath(e))}function kCe(e){if(!e)return;let t=(typeof e==`string`?e.split(`,`):[...e]).map(e=>e.trim()).filter(e=>e.length>0);return t.length>0?t:void 0}function ACe(){return typeof window>`u`?jL:{pathname:window.location.pathname||`/`,search:window.location.search,hash:window.location.hash,state:window.history.state}}function jCe(e){let t=e.__store.state.location;return{pathname:t.pathname,search:t.searchStr,hash:t.hash,state:t.state}}function MCe(e,t,n){if(typeof window>`u`)return;let r=new URL(e,window.location.origin),i=`${r.pathname}${r.search}${r.hash}`;t?window.history.replaceState(n,``,i):window.history.pushState(n,``,i),window.dispatchEvent(new PopStateEvent(`popstate`,{state:window.history.state}))}function NCe(){let e=(0,V.useContext)(zo()),t=(0,V.useRef)(jL);return{location:(0,V.useSyncExternalStore)((0,V.useCallback)(t=>e?.__store?e.__store.subscribe(()=>{t()}):typeof window>`u`?()=>{}:(window.addEventListener(`popstate`,t),window.addEventListener(`hashchange`,t),()=>{window.removeEventListener(`popstate`,t),window.removeEventListener(`hashchange`,t)}),[e]),(0,V.useCallback)(()=>{let n=e?.__store?jCe(e):ACe(),r=t.current;return r.pathname===n.pathname&&r.search===n.search&&r.hash===n.hash&&r.state===n.state?r:(t.current=n,n)},[e]),()=>jL),router:e}}function NL(e,t){if(!e)return[];let n=[],r=e.getHeaderShell();r&&n.push([r,`vt-tab-header-shell`]);let i=e.getSelectionIndicator();i&&n.push([i,`vt-tab-edge`]);let a=e.getHeaderForeground();a&&n.push([a,`vt-tab-header-foreground`]);let o=e.getPanel(t);return o&&n.push([o,`vt-tab-panel`]),n}function PCe({queryKey:e,tabs:t,initialTab:n,area:r,history:i=`replace`,allowUnknownSelection:a=!1,viewportSelector:o}){let{location:s,router:c}=NCe(),l=(0,V.useRef)(null),u=(0,V.useMemo)(()=>kCe(o),[typeof o==`string`?o:(o??[]).join(`\0`)]),d=(0,V.useRef)(new Map),f=(0,V.useRef)(new Map),p=(0,V.useRef)(0),m=(0,V.useRef)(null),h=(0,V.useMemo)(()=>DCe({tabs:t,queryKey:e,search:s.search,initialTab:n,allowUnknownSelection:a}),[a,n,s.search,e,t]),[g,_]=(0,V.useState)(h),v=(0,V.useRef)({allowUnknownSelection:a,area:r,history:i,location:s,queryKey:e,router:c,selectedFromLocation:h,selectedTab:g,tabs:t,viewportSelector:u});v.current={allowUnknownSelection:a,area:r,history:i,location:s,queryKey:e,router:c,selectedFromLocation:h,selectedTab:g,tabs:t,viewportSelector:u};let y=(0,V.useCallback)((e,t)=>{let n=f.current.get(e);!n||t!=null&&n.token!==t||(ECe(n.state),f.current.delete(e))},[]),b=(0,V.useCallback)(()=>{for(let e of f.current.values())ECe(e.state);f.current.clear()},[]),x=(0,V.useCallback)((e,t)=>{let n=kL(l.current,e,t);return n?AL(n):null},[]),S=(0,V.useCallback)((e,t,n)=>{let r=kL(l.current,e,t);if(!r)return;let i=n??AL(r);if(!i)return;d.current.set(e,i),y(e);let a=++p.current;return f.current.set(e,{token:a,state:CCe(r,i)}),a},[y]),C=(0,V.useCallback)((e,t,n)=>{let r=kL(l.current,e,t);if(!r)return null;let i=d.current.get(e)??n??AL(r);if(!i)return null;d.current.has(e)||d.current.set(e,i),y(e);let a=++p.current;return f.current.set(e,{token:a,state:wCe(r,i)}),a},[y]),w=(0,V.useCallback)((e,t)=>{let n=f.current.get(e);!n||t!=null&&n.token!==t||(TCe(n.state),f.current.delete(e))},[]);(0,V.useEffect)(()=>{_(e=>e===h?e:h)},[h]),(0,V.useLayoutEffect)(()=>{if(m.current===g){m.current=null;return}let e=d.current.get(g),t=kL(l.current,g,u),n=t?.panel??l.current?.getPanel(g)??null;xCe(n,e),SCe(n,t?.viewport??null,e)},[g,u]),(0,V.useEffect)(()=>{let e=kL(l.current,g,u),t=e?.contentScrollRoot;if(!e||!t||t===e.panel)return;let n=()=>{let e=d.current.get(g);e&&d.current.set(g,{...e,contentScrollTop:t.scrollTop})};return n(),t.addEventListener(`scroll`,n,{passive:!0}),()=>{t.removeEventListener(`scroll`,n)}},[g,u]),(0,V.useEffect)(()=>{let e=new Set(t.map(e=>e.id));for(let t of d.current.keys())e.has(t)||d.current.delete(t);for(let t of Array.from(f.current.keys()))e.has(t)||y(t)},[y,t]),(0,V.useEffect)(()=>{d.current.clear(),b()},[b,s.pathname]),(0,V.useEffect)(()=>()=>{b()},[b]);let T=(0,V.useCallback)((e,t)=>{let{allowUnknownSelection:n,area:r,history:i,location:a,queryKey:o,router:s,selectedFromLocation:c,selectedTab:u,tabs:f,viewportSelector:p}=v.current;if(!new Set(f.map(e=>e.id)).has(e)&&!n)return;let h=t?.history??i,g=t?.transferScroll??!0;if(u===e&&c===e)return;let b=()=>{_(e);let t=OCe(a.pathname,a.search,a.hash,o,e);if(Lf()){if(s){s.navigate({href:t,replace:h===`replace`,state:a.state});return}MCe(t,h===`replace`,a.state);return}let n=ML(a.pathname,r);if(h===`replace`){kp.replace(n,t,a.state);return}kp.push(n,t,a.state)};if(!g){let n=x(u,p);if(n&&d.current.set(u,n),m.current=e,!t?.animate||u===e){b();return}let i=gL(f,u,e);if(!i){b();return}Ob({intent:{area:ML(a.pathname,r),kind:`tab-carousel`,direction:i},collectBeforeEntries:()=>NL(l.current,u),collectAfterEntries:()=>NL(l.current,e),update:b});return}let T=gL(f,u,e),E=(t,n)=>{let i=x(u,p),o=d.current.get(e)??i??x(e,p),s=S(u,p,i);if(!t){(0,es.flushSync)(()=>{b()});let t=C(e,p,o);t!=null&&w(e,t),s!=null&&y(u,s);return}let c=null;Ob({intent:{area:ML(a.pathname,r),kind:`tab-carousel`,direction:n},collectBeforeEntries:()=>NL(l.current,u),collectAfterEntries:()=>(c??=C(e,p,o),NL(l.current,e)),update:b}).finally(()=>{c??=C(e,p,o),c!=null&&w(e,c),s!=null&&y(u,s)})};if(!t?.animate||u===e){E(!1);return}if(!T){E(!1);return}E(!0,T)},[S,x,y,w,C]);return{tabsRef:l,selectedTab:g,setSelectedTab:T,onTabChange:(0,V.useCallback)(e=>{T(e,{animate:!0})},[T])}}var PL=null,FCe=e=>{let t=`--tabs-button-${e}`;return String.raw`
|
|
1218
1218
|
#${e} .tabs-button {
|
|
1219
1219
|
anchor-name: ${t};
|
|
1220
1220
|
overflow-x: auto;
|
|
@@ -1260,7 +1260,7 @@ fn mainFragment(
|
|
|
1260
1260
|
`+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=VR(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=PEe;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+lR[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to);break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
|
|
1261
1261
|
`?``:t;else{let e=t.indexOf(`
|
|
1262
1262
|
`);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=hEe.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new Et(this.parser.nodeSet.types[e],wR,wR,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(BR(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?IEe(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=BR(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(lR.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?OR(this.parser.getNodeType(e),t,n,r):new DR(e,t)}get buffer(){return new TR(this.parser.nodeSet)}};function IEe(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function l(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){l(u.from+r,!0);let n=u.from+r,d,f=i.get(u.tree);f?d=f:u.to+r>a?(d=IEe(e,t,u,r,i),l(u.to+r,!1)):d=u.toTree(),o.push(d),s.push(n-c)}return l(n.to+r,!1),new Et(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var LEe=class e extends St{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new FEe(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(t){let n=xR(t);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,a=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),s=this.blockNames.slice(),c=this.inlineParsers.slice(),l=this.inlineNames.slice(),u=this.endLeafBlock.slice(),d=this.wrappers;if(bR(n.defineNodes)){i=Object.assign({},i);let e=r.types.slice(),t;for(let r of n.defineNodes){let{name:n,block:a,composite:o,style:s}=typeof r==`string`?{name:r}:r;if(e.some(e=>e.name==n))continue;o&&(i[e.length]=(e,t,n)=>o(t,n,e.value));let c=e.length,l=o?[`Block`,`BlockContext`]:a?c>=lR.ATXHeading1&&c<=lR.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(Mt.define({id:c,name:n,props:l&&[[pn.group,l]]})),s&&(t||={},Array.isArray(s)||s instanceof Tt?t[n]=s:Object.assign(t,s))}r=new jt(e),t&&(r=r.extend(Ot(t)))}if(bR(n.props)&&(r=r.extend(...n.props)),bR(n.remove))for(let e of n.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(a[t]=o[t]=void 0),n>-1&&(c[n]=void 0)}if(bR(n.parseBlock))for(let e of n.parseBlock){let t=s.indexOf(e.name);if(t>-1)a[t]=e.parse,o[t]=e.leaf;else{let t=e.before?SR(s,e.before):e.after?SR(s,e.after)+1:s.length-1;a.splice(t,0,e.parse),o.splice(t,0,e.leaf),s.splice(t,0,e.name)}e.endLeaf&&u.push(e.endLeaf)}if(bR(n.parseInline))for(let e of n.parseInline){let t=l.indexOf(e.name);if(t>-1)c[t]=e.parse;else{let t=e.before?SR(l,e.before):e.after?SR(l,e.after)+1:l.length-1;c.splice(t,0,e.parse),l.splice(t,0,e.name)}}return n.wrap&&(d=d.concat(n.wrap)),new e(r,a,o,s,u,i,c,l,d)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new zR(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function bR(e){return e!=null&&e.length>0}function xR(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=xR(e[0]);if(e.length==1)return t;let n=xR(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||wR).concat(t||wR),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function SR(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var CR=[Mt.none];for(let e=1,t;t=lR[e];e++)CR[e]=Mt.define({id:e,name:t,props:e>=lR.Escape?[]:[[pn.group,e in yEe?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var wR=[],TR=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return Et.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},ER=class{constructor(e,t,n,r=wR){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new TR(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},DR=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return wR}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function OR(e,t,n,r){return new ER(e,t,n,r)}var kR={resolve:`Emphasis`,mark:`EmphasisMark`},AR={resolve:`Emphasis`,mark:`EmphasisMark`},jR={},MR={},NR=class{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}},REe=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,PR=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{PR=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var FR={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(REe.charCodeAt(t)==r)return e.append(OR(lR.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(OR(lR.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(OR(lR.InlineCode,n,r+1,[OR(lR.CodeMark,n,n+i),OR(lR.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(OR(lR.Autolink,n,n+1+i[0].length,[OR(lR.LinkMark,n,n+1),OR(lR.URL,n+1,n+i[0].length),OR(lR.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(OR(lR.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(OR(lR.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(OR(lR.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=PR.test(i),s=PR.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new NR(t==95?kR:AR,n,r,(f?1:0)|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(OR(lR.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(OR(lR.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new NR(jR,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new NR(MR,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof NR&&(r.type==jR||r.type==MR)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=zEe(e,i,r.type==jR?lR.Link:lR.Image,r.from,n+1);if(r.type==jR)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof NR&&t.type==jR&&(t.side=0)}return a.to}}return-1}};function zEe(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(OR(lR.LinkMark,r,r+(n==lR.Image?2:1))),t.push(OR(lR.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=IR(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=LR(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(OR(lR.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(OR(lR.LinkMark,n,s)))}else if(o==91){let n=RR(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return OR(n,r,s,t)}function IR(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return OR(lR.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}else{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(uR(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?OR(lR.URL,t+n,i+n):i==e.length?null:!1}}function LR(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return OR(lR.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function RR(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return r?!1:OR(lR.LinkLabel,t+n,a+1+n);else{if(r&&!uR(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var zR=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new NR(e,t,n,(r?1:0)|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof NR&&(t.type==jR||t.type==MR))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof NR&&n.type.resolve&&n.side&2))continue;let r=n.type==kR||n.type==AR,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof NR&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof ER&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new NR(a.type,a.from,l,a.side):null,(this.parts[t]=r&&n.to!=u?new NR(n.type,u,n.to,n.side):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof ER&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof NR&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof NR?t:null}skipSpace(e){return dR(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?OR(this.parser.getNodeType(e),t,n,r):new DR(e,t)}};zR.linkStart=jR,zR.imageStart=MR;function BR(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof ER&&(n[r]=new ER(t.type,t.from,t.to,BR(t.children,[e])))}else n.splice(r++,0,e)}return n}var BEe=[lR.CodeBlock,lR.ListItem,lR.OrderedList,lR.BulletList],VEe=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
|
|
1263
|
-
`;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(pn.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=VR(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new Et(e.parser.nodeSet.types[lR.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(BEe.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c,s=t.to-n,c=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function VR(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var HEe=Ot({"Blockquote/...":z.quote,HorizontalRule:z.contentSeparator,"ATXHeading1/... SetextHeading1/...":z.heading1,"ATXHeading2/... SetextHeading2/...":z.heading2,"ATXHeading3/...":z.heading3,"ATXHeading4/...":z.heading4,"ATXHeading5/...":z.heading5,"ATXHeading6/...":z.heading6,"Comment CommentBlock":z.comment,Escape:z.escape,Entity:z.character,"Emphasis/...":z.emphasis,"StrongEmphasis/...":z.strong,"Link/... Image/...":z.link,"OrderedList/... BulletList/...":z.list,"BlockQuote/...":z.quote,"InlineCode CodeText":z.monospace,"URL Autolink":z.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":z.processingInstruction,"CodeInfo LinkLabel":z.labelName,LinkTitle:z.string,Paragraph:z.content}),UEe=new LEe(new jt(CR).extend(HEe),Object.keys(vR).map(e=>vR[e]),Object.keys(vR).map(e=>MEe[e]),Object.keys(vR),NEe,yEe,Object.keys(FR).map(e=>FR[e]),Object.keys(FR),[]);function WEe(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function GEe(e){let{codeParser:t,htmlParser:n}=e;return{wrap:kt((e,r)=>{let i=e.type.id;if(t&&(i==lR.CodeBlock||i==lR.FencedCode)){let n=``;if(i==lR.FencedCode){let t=e.node.getChild(lR.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==lR.CodeText}}else if(n&&(i==lR.HTMLBlock||i==lR.HTMLTag||i==lR.CommentBlock))return{parser:n,overlay:WEe(e.node,e.from,e.to)};return null})}}var KEe={resolve:`Strikethrough`,mark:`StrikethroughMark`},qEe={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":z.strikethrough}},{name:`StrikethroughMark`,style:z.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=PR.test(r),c=PR.test(i);return e.addDelimiter(KEe,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function HR(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function UR(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var WR=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,GR=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&WR.test(r=t.text.slice(t.pos))){let i=[];HR(e,n.content,0,i,n.start)==HR(e,r,t.pos)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];HR(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},JEe={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":z.heading}},`TableRow`,{name:`TableCell`,style:z.content},{name:`TableDelimiter`,style:z.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return UR(t.content,0)?new GR:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof GR)||!UR(t.text,t.basePos))return!1;let r=e.peekLine();return WR.test(r)&&HR(e,t.text,t.basePos)==HR(e,r,t.basePos)},before:`SetextHeading`}]},YEe=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},XEe={defineNodes:[{name:`Task`,block:!0,style:z.list},{name:`TaskMarker`,style:z.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new YEe:null},after:`SetextHeading`}]},KR=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,qR=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,ZEe=/[\w-]+\.[\w-]+($|\/)/,JR=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,YR=/\/[a-zA-Z\d@.]+/gy;function XR(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function QEe(e,t){qR.lastIndex=t;let n=qR.exec(e);if(!n||ZEe.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&XR(e,t,r,`)`)>XR(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function ZR(e,t){JR.lastIndex=t;let n=JR.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-(r==`.`?1:0)}var $Ee=[JEe,XEe,qEe,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;KR.lastIndex=r;let i=KR.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=QEe(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=ZR(e.text,r):(a=ZR(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(YR.lastIndex=a,i=YR.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function QR(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),uR(s))break}return-1}}var eDe={defineNodes:[{name:`Superscript`,style:z.special(z.content)},{name:`SuperscriptMark`,style:z.processingInstruction}],parseInline:[{name:`Superscript`,parse:QR(94,`Superscript`,`SuperscriptMark`)}]},tDe={defineNodes:[{name:`Subscript`,style:z.special(z.content)},{name:`SubscriptMark`,style:z.processingInstruction}],parseInline:[{name:`Subscript`,parse:QR(126,`Subscript`,`SubscriptMark`)}]},nDe={defineNodes:[{name:`Emoji`,style:z.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},rDe=55,iDe=1,aDe=56,oDe=2,sDe=57,cDe=3,$R=4,lDe=5,ez=6,tz=7,nz=8,rz=9,iz=10,uDe=11,dDe=12,fDe=13,az=58,pDe=14,mDe=15,oz=59,sz=21,hDe=23,cz=24,gDe=25,lz=27,uz=28,_De=29,vDe=32,yDe=35,bDe=37,xDe=38,SDe=0,CDe=1,wDe={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},TDe={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},dz={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function EDe(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}var fz=null,pz=null,mz=0;function hz(e,t){let n=e.pos+t;if(mz==n&&pz==e)return fz;let r=e.peek(t),i=``;for(;EDe(r);)i+=String.fromCharCode(r),r=e.peek(++t);return pz=e,mz=n,fz=i?i.toLowerCase():r==DDe||r==ODe?void 0:null}var gz=60,_z=62,vz=47,DDe=63,ODe=33,kDe=45;function yz(e,t){this.name=e,this.parent=t}var ADe=[ez,iz,tz,nz,rz],jDe=new kn({start:null,shift(e,t,n,r){return ADe.indexOf(t)>-1?new yz(hz(r,1)||``,e):e},reduce(e,t){return t==sz&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==ez||i==bDe?new yz(hz(r,1)||``,e):e},strict:!1}),MDe=new yn((e,t)=>{if(e.next!=gz){e.next<0&&t.context&&e.acceptToken(az);return}e.advance();let n=e.next==vz;n&&e.advance();let r=hz(e,0);if(r===void 0)return;if(!r)return e.acceptToken(n?mDe:pDe);let i=t.context?t.context.name:null;if(n){if(r==i)return e.acceptToken(uDe);if(i&&TDe[i])return e.acceptToken(az,-2);if(t.dialectEnabled(SDe))return e.acceptToken(dDe);for(let e=t.context;e;e=e.parent)if(e.name==r)return;e.acceptToken(fDe)}else{if(r==`script`)return e.acceptToken(tz);if(r==`style`)return e.acceptToken(nz);if(r==`textarea`)return e.acceptToken(rz);if(wDe.hasOwnProperty(r))return e.acceptToken(iz);i&&dz[i]&&dz[i][r]?e.acceptToken(az,-1):e.acceptToken(ez)}},{contextual:!0}),NDe=new yn(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(oz);break}if(e.next==kDe)t++;else if(e.next==_z&&t>=2){n>=3&&e.acceptToken(oz,-2);break}else t=0;e.advance()}});function PDe(e){for(;e;e=e.parent)if(e.name==`svg`||e.name==`math`)return!0;return!1}var FDe=new yn((e,t)=>{if(e.next==vz&&e.peek(1)==_z){let n=t.dialectEnabled(CDe)||PDe(t.context);e.acceptToken(n?lDe:$R,2)}else e.next==_z&&e.acceptToken($R,1)});function bz(e,t,n){let r=2+e.length;return new yn(i=>{for(let a=0,o=0,s=0;;s++){if(i.next<0){s&&i.acceptToken(t);break}if(a==0&&i.next==gz||a==1&&i.next==vz||a>=2&&a<r&&i.next==e.charCodeAt(a-2))a++,o++;else if(a==r&&i.next==_z){s>o?i.acceptToken(t,-o):i.acceptToken(n,-(o-2));break}else if((i.next==10||i.next==13)&&s){i.acceptToken(t,1);break}else a=o=0;i.advance()}})}var IDe=bz(`script`,rDe,iDe),LDe=bz(`style`,aDe,oDe),RDe=bz(`textarea`,sDe,cDe),zDe=Ot({"Text RawText IncompleteTag IncompleteCloseTag":z.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":z.angleBracket,TagName:z.tagName,"MismatchedCloseTag/TagName":[z.tagName,z.invalid],AttributeName:z.attributeName,"AttributeValue UnquotedAttributeValue":z.attributeValue,Is:z.definitionOperator,"EntityReference CharacterReference":z.character,Comment:z.blockComment,ProcessingInst:z.processingInstruction,DoctypeDecl:z.documentMeta}),BDe=Tn.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:`,c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~`,goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:`⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl`,maxTerm:68,context:jDe,nodeProps:[[`closedBy`,-10,1,2,3,7,8,9,10,11,12,13,`EndTag`,6,`EndTag SelfClosingEndTag`,-4,22,31,34,37,`CloseTag`],[`openedBy`,4,`StartTag StartCloseTag`,5,`StartTag`,-4,30,33,36,38,`OpenTag`],[`group`,-10,14,15,18,19,20,21,40,41,42,43,`Entity`,17,`Entity TextContent`,-3,29,32,35,`TextContent Entity`],[`isolate`,-11,22,30,31,33,34,36,37,38,39,42,43,`ltr`,-3,27,28,40,``]],propSources:[zDe],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[IDe,LDe,RDe,FDe,MDe,NDe,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function xz(e,t){let n=Object.create(null);for(let r of e.getChildren(cz)){let e=r.getChild(gDe),i=r.getChild(lz)||r.getChild(uz);e&&(n[t.read(e.from,e.to)]=i?i.type.id==lz?t.read(i.from+1,i.to-1):t.read(i.from,i.to):``)}return n}function Sz(e,t){let n=e.getChild(hDe);return n?t.read(n.from,n.to):` `}function Cz(e,t,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||=xz(e.node.parent.firstChild,t)))return{parser:i.parser};return null}function wz(e=[],t=[]){let n=[],r=[],i=[],a=[];for(let t of e)(t.tag==`script`?n:t.tag==`style`?r:t.tag==`textarea`?i:a).push(t);let o=t.length?Object.create(null):null;for(let e of t)(o[e.name]||(o[e.name]=[])).push(e);return kt((e,t)=>{let s=e.type.id;if(s==_De)return Cz(e,t,n);if(s==vDe)return Cz(e,t,r);if(s==yDe)return Cz(e,t,i);if(s==sz&&a.length){let n=e.node,r=n.firstChild,i=r&&Sz(r,t),o;if(i){for(let e of a)if(e.tag==i&&(!e.attrs||e.attrs(o||=xz(r,t)))){let t=n.lastChild,i=t.type.id==xDe?t.from:n.to;if(i>r.to)return{parser:e.parser,overlay:[{from:r.to,to:i}]}}}}if(o&&s==cz){let n=e.node,r;if(r=n.firstChild){let e=o[t.read(r.from,r.to)];if(e)for(let r of e){if(r.tagName&&r.tagName!=Sz(n.parent,t))continue;let e=n.lastChild;if(e.type.id==lz){let t=e.from+1,n=e.lastChild,i=e.to-(n&&n.isError?0:1);if(i>t)return{parser:r.parser,overlay:[{from:t,to:i}]}}else if(e.type.id==uz)return{parser:r.parser,overlay:[{from:e.from,to:e.to}]}}}}return null})}var VDe=122,Tz=1,HDe=123,UDe=124,Ez=2,WDe=125,GDe=3,KDe=4,Dz=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],qDe=58,JDe=40,Oz=95,YDe=91,kz=45,XDe=46,ZDe=35,QDe=37,$De=38,eOe=92,tOe=10,nOe=42;function Az(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function jz(e){return e>=48&&e<=57}function Mz(e){return jz(e)||e>=97&&e<=102||e>=65&&e<=70}var Nz=(e,t,n)=>(r,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:c}=r;if(Az(c)||c==kz||c==Oz||a&&jz(c))!a&&(c!=kz||s>0)&&(a=!0),o===s&&c==kz&&o++,r.advance();else if(c==eOe&&r.peek(1)!=tOe){if(r.advance(),Mz(r.next)){do r.advance();while(Mz(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();a=!0}else{a&&r.acceptToken(o==2&&i.canShift(Ez)?t:c==JDe?n:e);break}}},rOe=new yn(Nz(HDe,Ez,UDe)),iOe=new yn(Nz(WDe,GDe,KDe)),aOe=new yn(e=>{if(Dz.includes(e.peek(-1))){let{next:t}=e;(Az(t)||t==Oz||t==ZDe||t==XDe||t==nOe||t==YDe||t==qDe&&Az(e.peek(1))||t==kz||t==$De)&&e.acceptToken(VDe)}}),oOe=new yn(e=>{if(!Dz.includes(e.peek(-1))){let{next:t}=e;if(t==QDe&&(e.advance(),e.acceptToken(Tz)),Az(t)){do e.advance();while(Az(e.next)||jz(e.next));e.acceptToken(Tz)}}}),sOe=Ot({"AtKeyword import charset namespace keyframes media supports":z.definitionKeyword,"from to selector":z.keyword,NamespaceName:z.namespace,KeyframeName:z.labelName,KeyframeRangeName:z.operatorKeyword,TagName:z.tagName,ClassName:z.className,PseudoClassName:z.constant(z.className),IdName:z.labelName,"FeatureName PropertyName":z.propertyName,AttributeName:z.attributeName,NumberLiteral:z.number,KeywordQuery:z.keyword,UnaryQueryOp:z.operatorKeyword,"CallTag ValueName":z.atom,VariableName:z.variableName,Callee:z.operatorKeyword,Unit:z.unit,"UniversalSelector NestingSelector":z.definitionOperator,"MatchOp CompareOp":z.compareOperator,"ChildOp SiblingOp, LogicOp":z.logicOperator,BinOp:z.arithmeticOperator,Important:z.modifier,Comment:z.blockComment,ColorLiteral:z.color,"ParenthesizedContent StringLiteral":z.string,":":z.punctuation,"PseudoOp #":z.derefOperator,"; ,":z.separator,"( )":z.paren,"[ ]":z.squareBracket,"{ }":z.brace}),cOe={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},lOe={__proto__:null,or:98,and:98,not:106,only:106,layer:170},uOe={__proto__:null,selector:112,layer:166},dOe={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},fOe={__proto__:null,to:207},pOe=Tn.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mO<rQhO'#EQOOQW'#EQ'#EQO=WQ`O1G0UO1[QhO1G0UOOQ[,59o,59oO'tQhO'#DXOOQ[,59q,59qO=]Q#tO,5:VOOQS1G0[1G0[OOQS1G0^1G0^OOQS1G0`1G0`O=hQ`O1G0`O=mQdO'#E`OOQS1G0c1G0cOOQS1G0i1G0iO=xQaO,5:RO-`Q`O1G0kOOQS1G0k1G0kO-eQ`O1G0kO>PQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<<IOOElQdO'#EqOEvQ`O,5;yOOQP1G/u1G/uOOQS-E8j-E8jOFOQdO'#EpOFYQ`O,5;rOOQ]1G.x1G.xOOQP<<IO<<IOOFbQdO7+$|OOQO'#D]'#D]OFiQ!bO7+%QOFqQhO'#EoOF{Q`O,5;xO&lQdO,5;xOOQW1G/o1G/oOOQO'#ES'#ESOGTQ`O1G0WOOQS<<I[<<I[O&lQdO,59tOGnQhO1G/_OOQ[1G/_1G/_OGuQ`O1G/_OOQW-E8l-E8lOOQ[7+%]7+%]OOQO,5:{,5:{O=pQdO'#ExOCeQ`O,5;cOOQS,5;c,5;cOOQS-E8u-E8uOOQS1G0f1G0fOOQS<<Iq<<IqOG}Q!fO,5;_OOQS-E8q-E8qOOQO<<IX<<IXOOQPAN>jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<<Hh<<HhOOQW<<Hl<<HlOIjQhO<<HlOI{QhO,5;ZOJWQ`O,5;ZOOQO-E8m-E8mOJ]QdO1G1dOBZQdO'#EuOJgQ`O7+%rOOQW7+%r7+%rOJoQ!bO1G/`OOQ[7+$y7+$yOJzQhO7+$yPKRQ`O'#EnOOQO,5;d,5;dOOQO-E8v-E8vOOQS1G0}1G0}OKWQ`OAN>WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<<I^<<I^OOQ[<<He<<HePOQW,5;Y,5;YOOQWG23rG23rOKeQdO7+&a",stateData:"Kx~O#sOS#tQQ~OW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#oRO~OQiOW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#ohO~O#m$SP~P!dO#tmO~O#ooO~O]qO`rOarOjsOmtO!juO!mwO#nvO~OpzO!^xO~P$SOc!QO#o|O#p}O~O#o!RO~O#o!TO~OW[OZ[O]TO`VOaVOjWOmXO!jYO!mZO#oRO~OS!]Oe!YO!V![O!Y!`O#q!XOp$TP~Ok$TP~P&POQ!jOe!cOm!dOp!eOr!mOt!mOz!kO!`!lO#o!bO#p!hO#}!fO~Ot!qO!`!lO#o!pO~Ot!sO#o!sO~OS!]Oe!YO!V![O!Y!`O#q!XO~Oe!vOpzO#Z!xO~O]YX`YX`!pXaYXjYXmYXpYX!^YX!jYX!mYX#nYX~O`!zO~Ok!{O#m$SXo$SX~O#m$SXo$SX~P!dO#u#OO#v#OO#w#QO~Oc#UO#o|O#p}O~OpzO!^xO~Oo$SP~P!dOe#`O~Oe#aO~Ol#bO!h#cO~O]qO`rOarOjsOmtO~Op!ia!^!ia!j!ia!m!ia#n!iad!ia~P*zOp!la!^!la!j!la!m!la#n!lad!la~P*zOR#gOS!]Oe!YOr#gOt#gO!V![O!Y!`O#q#dO#}!fO~O!R#iO!^#jOk$TXp$TX~Oe#mO~Ok#oOpzO~Oe!vO~O]#rO`#rOd#uOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl#wO~P&lO]#rO`#rOi#rOj#rOk#rOo#yO~P&lOP#zOSsXesXksXvsX!VsX!YsX!usX!wsX#qsX!TsXQsX]sX`sXdsXisXjsXmsXpsXrsXtsXzsX!`sX#osX#psX#}sXlsXosX!^sX!qsX#msX~Ov#{O!u#|O!w#}Ok$TP~P'tOe#aOS#{Xk#{Xv#{X!V#{X!Y#{X!u#{X!w#{X#q#{XQ#{X]#{X`#{Xd#{Xi#{Xj#{Xm#{Xp#{Xr#{Xt#{Xz#{X!`#{X#o#{X#p#{X#}#{Xl#{Xo#{X!^#{X!q#{X#m#{X~Oe$RO~Oe$TO~Ok$VOv#{O~Ok$WO~Ot$XO!`!lO~Op$YO~OpzO!R#iO~OpzO#Z$`O~O!q$bOk!oa#m!oao!oa~P&lOk#hX#m#hXo#hX~P!dOk!{O#m$Sao$Sa~O#u#OO#v#OO#w$hO~Ol$jO!h$kO~Op!ii!^!ii!j!ii!m!ii#n!iid!ii~P*zOp!ki!^!ki!j!ki!m!ki#n!kid!ki~P*zOp!li!^!li!j!li!m!li#n!lid!li~P*zOp#fa!^#fa~P$SOo$lO~Od$RP~P%_Od#zP~P&lO`!PXd}X!R}X!T!PX~O`$sO!T$tO~Od$uO!R#iO~Ok#jXp#jX!^#jX~P'tO!^#jOk$Tap$Ta~O!R#iOk!Uap!Ua!^!Uad!Ua`!Ua~OS!]Oe!YO!V![O!Y!`O#q$yO~Od$QP~P9dOv#{OQ#|X]#|X`#|Xd#|Xe#|Xi#|Xj#|Xk#|Xm#|Xp#|Xr#|Xt#|Xz#|X!`#|X#o#|X#p#|X#}#|Xl#|Xo#|X~O]#rO`#rOd%OOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl%PO~P&lO]#rO`#rOi#rOj#rOk#rOo%QO~P&lOe%SOS!tXk!tX!V!tX!Y!tX#q!tX~Ok%TO~Od%YOt%ZO!a%ZO~Ok%[O~Oo%cO#o%^O#}%]O~Od%dO~P$SOv#{O!^%hO!q%jOk!oi#m!oio!oi~P&lOk#ha#m#hao#ha~P!dOk!{O#m$Sio$Si~O!^%mOd$RX~P$SOd%oO~Ov#{OQ#`Xd#`Xe#`Xm#`Xp#`Xr#`Xt#`Xz#`X!^#`X!`#`X#o#`X#p#`X#}#`X~O!^%qOd#zX~P&lOd%sO~Ol%tOv#{O~OR#gOr#gOt#gO#q%vO#}!fO~O!R#iOk#jap#ja!^#ja~O`!PXd}X!R}X!^}X~O!R#iO!^%xOd$QX~O`%zO~Od%{O~O#o%|O~Ok&OO~O`&PO!R#iO~Od&ROk&QO~Od&UO~OP#zOpsX!^sXdsX~O#}%]Op#TX!^#TX~OpzO!^&WO~Oo&[O#o%^O#}%]O~Ov#{OQ#gXe#gXk#gXm#gXp#gXr#gXt#gXz#gX!^#gX!`#gX!q#gX#m#gX#o#gX#p#gX#}#gXo#gX~O!^%hO!q&`Ok!oq#m!oqo!oq~P&lOl&aOv#{O~Od#eX!^#eX~P%_O!^%mOd$Ra~Od#dX!^#dX~P&lO!^%qOd#za~Od&fO~P&lOd&gO!T&hO~Od#cX!^#cX~P9dO!^%xOd$Qa~O]&mOd&oO~OS#bae#ba!V#ba!Y#ba#q#ba~Od&qO~PG]Od&qOk&rO~Ov#{OQ#gae#gak#gam#gap#gar#gat#gaz#ga!^#ga!`#ga!q#ga#m#ga#o#ga#p#ga#}#gao#ga~Od#ea!^#ea~P$SOd#da!^#da~P&lOR#gOr#gOt#gO#q%vO#}%]O~O!R#iOd#ca!^#ca~O`&xO~O!^%xOd$Qi~P&lO]&mOd&|O~Ov#{Od|ik|i~Od&}O~PG]Ok'OO~Od'PO~O!^%xOd$Qq~Od#cq!^#cq~P&lO#s!a#t#}]#}v!m~",goto:"2h$UPPPPP$VP$YP$c$uP$cP%X$cPP%_PPP%e%o%oPPPPP%oPP%oP&]P%oP%o'W%oP't'w'}'}(^'}P'}P'}P'}'}P(m'}(yP(|PP)p)v$c)|$c*SP$cP$c$cP*Y*{+YP$YP+aP+dP$YP$YP$YP+j$YP+m+p+s+z$YP$YPP$YP,P,V,f,|-[-b-l-r-x.O.U.`.f.l.rPPPPPPPPPPP.x/R/w/z0|P1U1u2O2R2U2[RnQ_^OP`kz!{$dq[OPYZ`kuvwxz!v!{#`$d%mqSOPYZ`kuvwxz!v!{#`$d%mQpTR#RqQ!OVR#SrQ#S!QS$Q!i!jR$i#U!V!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'Q!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QU#g!Y$t&hU%`$Y%b&WR&V%_!V!iac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QR$S!kQ%W$RR&S%Xk!^]bf!Y![!g#i#j#m$P$R%X%xQ#e!YQ${#mQ%w$tQ&j%xR&w&hQ!ygQ#p!`Q$^!xR%f$`R#n!]!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QQ!qdR$X!rQ!PVR#TrQ#S!PR$i#TQ!SWR#VsQ!UXR#WtQ{UQ!wgQ#^yQ#o!_Q$U!nQ$[!uQ$_!yQ%e$^Q&Y%aQ&]%fR&v&XSjPzQ!}kQ$c!{R%k$dZiPkz!{$dR$P!gQ%}%SR&z&mR!rdR!teR$Z!tS%a$Y%bR&t&WV%_$Y%b&WQ#PmR$g#PQ`OSkPzU!a`k$dR$d!{Q$p#aY%p$p%u&d&l'QQ%u$sQ&d%qQ&l%zR'Q&xQ#t!cQ#v!dQ#x!eV$}#t#v#xQ%X$RR&T%XQ%y$zS&k%y&yR&y&lQ%r$pR&e%rQ%n$mR&c%nQyUR#]yQ%i$aR&_%iQ!|jS$e!|$fR$f!}Q&n%}R&{&nQ#k!ZR$x#kQ%b$YR&Z%bQ&X%aR&u&X__OP`kz!{$d^UOP`kz!{$dQ!VYQ!WZQ#XuQ#YvQ#ZwQ#[xQ$]!vQ$m#`R&b%mR$q#aQ!gaQ!oc[#q!c!d!e#t#v#xQ$a!zd$o#a$p$s%q%u%z&d&l&x'QQ$r#cQ%R#{S%g$a%iQ%l$kQ&^%hR&p&P]#s!c!d!e#t#v#xW!Z]b!g$PQ!ufQ#f!YQ#l![Q$v#iQ$w#jQ$z#mS%V$R%XR&i%xQ#h!YQ%w$tR&w&hR$|#mR$n#`QlPR#_zQ!_]Q!nbQ$O!gR%U$P",nodeNames:`⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to AtRule Styles`,maxTerm:143,nodeProps:[[`isolate`,-2,5,36,``],[`openedBy`,20,`(`,28,`[`,31,`{`],[`closedBy`,21,`)`,29,`]`,32,`}`]],propSources:[sOe],skippedNodes:[0,5,106],repeatNodeCount:15,tokenData:"JQ~R!YOX$qX^%i^p$qpq%iqr({rs-ust/itu6Wuv$qvw7Qwx7cxy9Qyz9cz{9h{|:R|}>t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj<VY!a`Oy%Qz{%Q{|<u|}%Q}!O<u!O!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj<zU!a`Oy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj=eU!a`#}YOy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj>O[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj>yS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%QjBUU`YOy%Qz![%Q![!]Bh!];'S%Q;'S;=`%c<%lO%QbBoSaQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjCQSkYOy%Qz;'S%Q;'S;=`%c<%lO%QhCcU!TWOy%Qz!_%Q!_!`Cu!`;'S%Q;'S;=`%c<%lO%QhC|S!TW!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QlDaS!TW!hSOy%Qz;'S%Q;'S;=`%c<%lO%QjDtV!jQ!TWOy%Qz!_%Q!_!`Cu!`!aEZ!a;'S%Q;'S;=`%c<%lO%QbEbS!jQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjEqYOy%Qz}%Q}!OFa!O!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjFfW!a`Oy%Qz!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjGV[iY!a`Oy%Qz}%Q}!OGO!O!Q%Q!Q![GO![!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjHQSmYOy%Qz;'S%Q;'S;=`%c<%lO%QnHcSl^Oy%Qz;'S%Q;'S;=`%c<%lO%QjHtSpYOy%Qz;'S%Q;'S;=`%c<%lO%QjIVSoYOy%Qz;'S%Q;'S;=`%c<%lO%QfIhU!mQOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Q`I}P;=`<%l$q",tokenizers:[aOe,oOe,rOe,iOe,1,2,3,4,new un(`m~RRYZ[z{a~~g~aO#v~~dP!P!Qg~lO#w~~`,28,129)],topRules:{StyleSheet:[0,6],Styles:[1,105]},specialized:[{term:124,get:e=>cOe[e]||-1},{term:125,get:e=>lOe[e]||-1},{term:4,get:e=>uOe[e]||-1},{term:25,get:e=>dOe[e]||-1},{term:123,get:e=>fOe[e]||-1}],tokenPrec:1963}),Pz=null;function Fz(){if(!Pz&&typeof document==`object`&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let r in e)r!=`cssText`&&r!=`cssFloat`&&typeof e[r]==`string`&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,e=>`-`+e.toLowerCase())),n.has(r)||(t.push(r),n.add(r)));Pz=t.sort().map(e=>({type:`property`,label:e,apply:e+`: `}))}return Pz||[]}var Iz=`active.after.any-link.autofill.backdrop.before.checked.cue.default.defined.disabled.empty.enabled.file-selector-button.first.first-child.first-letter.first-line.first-of-type.focus.focus-visible.focus-within.fullscreen.has.host.host-context.hover.in-range.indeterminate.invalid.is.lang.last-child.last-of-type.left.link.marker.modal.not.nth-child.nth-last-child.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.part.placeholder.placeholder-shown.read-only.read-write.required.right.root.scope.selection.slotted.target.target-text.valid.visited.where`.split(`.`).map(e=>({type:`class`,label:e})),Lz=`above.absolute.activeborder.additive.activecaption.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.antialiased.appworkspace.asterisks.attr.auto.auto-flow.avoid.avoid-column.avoid-page.avoid-region.axis-pan.background.backwards.baseline.below.bidi-override.blink.block.block-axis.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.bullets.button.button-bevel.buttonface.buttonhighlight.buttonshadow.buttontext.calc.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.clear.clip.close-quote.col-resize.collapse.color.color-burn.color-dodge.column.column-reverse.compact.condensed.contain.content.contents.content-box.context-menu.continuous.copy.counter.counters.cover.crop.cross.crosshair.currentcolor.cursive.cyclic.darken.dashed.decimal.decimal-leading-zero.default.default-button.dense.destination-atop.destination-in.destination-out.destination-over.difference.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic-abegede-gez.ethiopic-halehame-aa-er.ethiopic-halehame-gez.ew-resize.exclusion.expanded.extends.extra-condensed.extra-expanded.fantasy.fast.fill.fill-box.fixed.flat.flex.flex-end.flex-start.footnotes.forwards.from.geometricPrecision.graytext.grid.groove.hand.hard-light.help.hidden.hide.higher.highlight.highlighttext.horizontal.hsl.hsla.hue.icon.ignore.inactiveborder.inactivecaption.inactivecaptiontext.infinite.infobackground.infotext.inherit.initial.inline.inline-axis.inline-block.inline-flex.inline-grid.inline-table.inset.inside.intrinsic.invert.italic.justify.keep-all.landscape.large.larger.left.level.lighter.lighten.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-hexadecimal.lower-latin.lower-norwegian.lowercase.ltr.luminosity.manipulation.match.matrix.matrix3d.medium.menu.menutext.message-box.middle.min-intrinsic.mix.monospace.move.multiple.multiple_mask_images.multiply.n-resize.narrower.ne-resize.nesw-resize.no-close-quote.no-drop.no-open-quote.no-repeat.none.normal.not-allowed.nowrap.ns-resize.numbers.numeric.nw-resize.nwse-resize.oblique.opacity.open-quote.optimizeLegibility.optimizeSpeed.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.perspective.pinch-zoom.plus-darker.plus-lighter.pointer.polygon.portrait.pre.pre-line.pre-wrap.preserve-3d.progress.push-button.radial-gradient.radio.read-only.read-write.read-write-plaintext-only.rectangle.region.relative.repeat.repeating-linear-gradient.repeating-radial-gradient.repeat-x.repeat-y.reset.reverse.rgb.rgba.ridge.right.rotate.rotate3d.rotateX.rotateY.rotateZ.round.row.row-resize.row-reverse.rtl.run-in.running.s-resize.sans-serif.saturation.scale.scale3d.scaleX.scaleY.scaleZ.screen.scroll.scrollbar.scroll-position.se-resize.self-start.self-end.semi-condensed.semi-expanded.separate.serif.show.single.skew.skewX.skewY.skip-white-space.slide.slider-horizontal.slider-vertical.sliderthumb-horizontal.sliderthumb-vertical.slow.small.small-caps.small-caption.smaller.soft-light.solid.source-atop.source-in.source-out.source-over.space.space-around.space-between.space-evenly.spell-out.square.start.static.status-bar.stretch.stroke.stroke-box.sub.subpixel-antialiased.svg_masks.super.sw-resize.symbolic.symbols.system-ui.table.table-caption.table-cell.table-column.table-column-group.table-footer-group.table-header-group.table-row.table-row-group.text.text-bottom.text-top.textarea.textfield.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.to.top.transform.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.unidirectional-pan.unset.up.upper-latin.uppercase.url.var.vertical.vertical-text.view-box.visible.visibleFill.visiblePainted.visibleStroke.visual.w-resize.wait.wave.wider.window.windowframe.windowtext.words.wrap.wrap-reverse.x-large.x-small.xor.xx-large.xx-small`.split(`.`).map(e=>({type:`keyword`,label:e})).concat(`aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.grey.green.greenyellow.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen`.split(`.`).map(e=>({type:`constant`,label:e}))),mOe=`a.abbr.address.article.aside.b.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.dd.del.details.dfn.dialog.div.dl.dt.em.figcaption.figure.footer.form.header.hgroup.h1.h2.h3.h4.h5.h6.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.main.meter.nav.ol.output.p.pre.ruby.section.select.small.source.span.strong.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.tr.u.ul`.split(`.`).map(e=>({type:`type`,label:e})),hOe=[`@charset`,`@color-profile`,`@container`,`@counter-style`,`@font-face`,`@font-feature-values`,`@font-palette-values`,`@import`,`@keyframes`,`@layer`,`@media`,`@namespace`,`@page`,`@position-try`,`@property`,`@scope`,`@starting-style`,`@supports`,`@view-transition`].map(e=>({type:`keyword`,label:e})),Rz=/^(\w[\w-]*|-\w[\w-]*|)$/,gOe=/^-(-[\w-]*)?$/;function _Oe(e,t){if((e.name==`(`||e.type.isError)&&(e=e.parent||e),e.name!=`ArgList`)return!1;let n=e.parent?.firstChild;return n?.name==`Callee`?t.sliceString(n.from,n.to)==`var`:!1}var zz=new It,vOe=[`Declaration`];function yOe(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function Bz(e,t,n){if(t.to-t.from>4096){let r=zz.get(t);if(r)return r;let i=[],a=new Set,o=t.cursor(pt.IncludeAnonymous);if(o.firstChild())do for(let t of Bz(e,o.node,n))a.has(t.label)||(a.add(t.label),i.push(t));while(o.nextSibling());return zz.set(t,i),i}else{let r=[],i=new Set;return t.cursor().iterate(t=>{if(n(t)&&t.matchContext(vOe)&&t.node.nextSibling?.name==`:`){let n=e.sliceString(t.from,t.to);i.has(n)||(i.add(n),r.push({label:n,type:`variable`}))}}),r}}var Vz=e=>t=>{let{state:n,pos:r}=t,i=xt(n).resolveInner(r,-1),a=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)==`-`;if(i.name==`PropertyName`||(a||i.name==`TagName`)&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:Fz(),validFor:Rz};if(i.name==`ValueName`)return{from:i.from,options:Lz,validFor:Rz};if(i.name==`PseudoClassName`)return{from:i.from,options:Iz,validFor:Rz};if(e(i)||(t.explicit||a)&&_Oe(i,n.doc))return{from:e(i)||a?i.from:r,options:Bz(n.doc,yOe(i),e),validFor:gOe};if(i.name==`TagName`){for(let{parent:e}=i;e;e=e.parent)if(e.name==`Block`)return{from:i.from,options:Fz(),validFor:Rz};return{from:i.from,options:mOe,validFor:Rz}}if(i.name==`AtKeyword`)return{from:i.from,options:hOe,validFor:Rz};if(!t.explicit)return null;let o=i.resolve(r),s=o.childBefore(r);return s&&s.name==`:`&&o.name==`PseudoClassSelector`?{from:r,options:Iz,validFor:Rz}:s&&s.name==`:`&&o.name==`Declaration`||o.name==`ArgList`?{from:r,options:Lz,validFor:Rz}:o.name==`Block`||o.name==`Styles`?{from:r,options:Fz(),validFor:Rz}:null},Hz=Vz(e=>e.name==`VariableName`),Uz=Dn.define({name:`css`,parser:pOe.configure({props:[_t.add({Declaration:ln()}),ht.add({"Block KeyframeList":Fn})]}),languageData:{commentTokens:{block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*\}$/,wordChars:`-`}});function Wz(){return new An(Uz,Uz.data.of({autocomplete:Hz}))}var Gz=[`_blank`,`_self`,`_top`,`_parent`],Kz=[`ascii`,`utf-8`,`utf-16`,`latin1`,`latin1`],qz=[`get`,`post`,`put`,`delete`],Jz=[`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`],Yz=[`true`,`false`],Xz={},bOe={a:{attrs:{href:null,ping:null,type:null,media:null,target:Gz,hreflang:null}},abbr:Xz,address:Xz,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:[`default`,`rect`,`circle`,`poly`]}},article:Xz,aside:Xz,audio:{attrs:{src:null,mediagroup:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`none`,`metadata`,`auto`],autoplay:[`autoplay`],loop:[`loop`],controls:[`controls`]}},b:Xz,base:{attrs:{href:null,target:Gz}},bdi:Xz,bdo:Xz,blockquote:{attrs:{cite:null}},body:Xz,br:Xz,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[`autofocus`],disabled:[`autofocus`],formenctype:Jz,formmethod:qz,formnovalidate:[`novalidate`],formtarget:Gz,type:[`submit`,`reset`,`button`]}},canvas:{attrs:{width:null,height:null}},caption:Xz,center:Xz,cite:Xz,code:Xz,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:[`command`,`checkbox`,`radio`],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:[`disabled`],checked:[`checked`]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:[`disabled`],multiple:[`multiple`]}},datalist:{attrs:{data:null}},dd:Xz,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[`open`]}},dfn:Xz,div:Xz,dl:Xz,dt:Xz,em:Xz,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[`disabled`],form:null,name:null}},figcaption:Xz,figure:Xz,footer:Xz,form:{attrs:{action:null,name:null,"accept-charset":Kz,autocomplete:[`on`,`off`],enctype:Jz,method:qz,novalidate:[`novalidate`],target:Gz}},h1:Xz,h2:Xz,h3:Xz,h4:Xz,h5:Xz,h6:Xz,head:{children:[`title`,`base`,`link`,`style`,`meta`,`script`,`noscript`,`command`]},header:Xz,hgroup:Xz,hr:Xz,html:{attrs:{manifest:null}},i:Xz,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:[`allow-top-navigation`,`allow-same-origin`,`allow-forms`,`allow-scripts`],seamless:[`seamless`]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:[`audio/*`,`video/*`,`image/*`],autocomplete:[`on`,`off`],autofocus:[`autofocus`],checked:[`checked`],disabled:[`disabled`],formenctype:Jz,formmethod:qz,formnovalidate:[`novalidate`],formtarget:Gz,multiple:[`multiple`],readonly:[`readonly`],required:[`required`],type:[`hidden`,`text`,`search`,`tel`,`url`,`email`,`password`,`datetime`,`date`,`month`,`week`,`time`,`datetime-local`,`number`,`range`,`color`,`checkbox`,`radio`,`file`,`submit`,`image`,`reset`,`button`]}},ins:{attrs:{cite:null,datetime:null}},kbd:Xz,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[`autofocus`],disabled:[`disabled`],keytype:[`RSA`]}},label:{attrs:{for:null,form:null}},legend:Xz,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:[`all`,`16x16`,`16x16 32x32`,`16x16 32x32 64x64`]}},map:{attrs:{name:null}},mark:Xz,menu:{attrs:{label:null,type:[`list`,`context`,`toolbar`]}},meta:{attrs:{content:null,charset:Kz,name:[`viewport`,`application-name`,`author`,`description`,`generator`,`keywords`],"http-equiv":[`content-language`,`content-type`,`default-style`,`refresh`]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Xz,noscript:Xz,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:[`typemustmatch`]}},ol:{attrs:{reversed:[`reversed`],start:null,type:[`1`,`a`,`A`,`i`,`I`]},children:[`li`,`script`,`template`,`ul`,`ol`]},optgroup:{attrs:{disabled:[`disabled`],label:null}},option:{attrs:{disabled:[`disabled`],label:null,selected:[`selected`],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Xz,param:{attrs:{name:null,value:null}},pre:Xz,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Xz,rt:Xz,ruby:Xz,samp:Xz,script:{attrs:{type:[`text/javascript`],src:null,async:[`async`],defer:[`defer`],charset:Kz}},section:Xz,select:{attrs:{form:null,name:null,size:null,autofocus:[`autofocus`],disabled:[`disabled`],multiple:[`multiple`]}},slot:{attrs:{name:null}},small:Xz,source:{attrs:{src:null,type:null,media:null}},span:Xz,strong:Xz,style:{attrs:{type:[`text/css`],media:null,scoped:null}},sub:Xz,summary:Xz,sup:Xz,table:Xz,tbody:Xz,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Xz,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:[`autofocus`],disabled:[`disabled`],readonly:[`readonly`],required:[`required`],wrap:[`soft`,`hard`]}},tfoot:Xz,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[`row`,`col`,`rowgroup`,`colgroup`]}},thead:Xz,time:{attrs:{datetime:null}},title:Xz,tr:Xz,track:{attrs:{src:null,label:null,default:null,kind:[`subtitles`,`captions`,`descriptions`,`chapters`,`metadata`],srclang:null}},ul:{children:[`li`,`script`,`template`,`ul`,`ol`]},var:Xz,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`auto`,`metadata`,`none`],autoplay:[`autoplay`],mediagroup:[`movie`],muted:[`muted`],controls:[`controls`]}},wbr:Xz},Zz={accesskey:null,class:null,contenteditable:Yz,contextmenu:null,dir:[`ltr`,`rtl`,`auto`],draggable:[`true`,`false`,`auto`],dropzone:[`copy`,`move`,`link`,`string:`,`file:`],hidden:[`hidden`],id:null,inert:[`inert`],itemid:null,itemprop:null,itemref:null,itemscope:[`itemscope`],itemtype:null,lang:[`ar`,`bn`,`de`,`en-GB`,`en-US`,`es`,`fr`,`hi`,`id`,`ja`,`pa`,`pt`,`ru`,`tr`,`zh`],spellcheck:Yz,autocorrect:Yz,autocapitalize:Yz,style:null,tabindex:null,title:null,translate:[`yes`,`no`],rel:[`stylesheet`,`alternate`,`author`,`bookmark`,`help`,`license`,`next`,`nofollow`,`noreferrer`,`prefetch`,`prev`,`search`,`tag`],role:`alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer`.split(` `),"aria-activedescendant":null,"aria-atomic":Yz,"aria-autocomplete":[`inline`,`list`,`both`,`none`],"aria-busy":Yz,"aria-checked":[`true`,`false`,`mixed`,`undefined`],"aria-controls":null,"aria-describedby":null,"aria-disabled":Yz,"aria-dropeffect":null,"aria-expanded":[`true`,`false`,`undefined`],"aria-flowto":null,"aria-grabbed":[`true`,`false`,`undefined`],"aria-haspopup":Yz,"aria-hidden":Yz,"aria-invalid":[`true`,`false`,`grammar`,`spelling`],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":[`off`,`polite`,`assertive`],"aria-multiline":Yz,"aria-multiselectable":Yz,"aria-owns":null,"aria-posinset":null,"aria-pressed":[`true`,`false`,`mixed`,`undefined`],"aria-readonly":Yz,"aria-relevant":null,"aria-required":Yz,"aria-selected":[`true`,`false`,`undefined`],"aria-setsize":null,"aria-sort":[`ascending`,`descending`,`none`,`other`],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Qz=`beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload`.split(` `).map(e=>`on`+e);for(let e of Qz)Zz[e]=null;var $z=class{constructor(e,t){this.tags={...bOe,...e},this.globalAttrs={...Zz,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};$z.default=new $z;function eB(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}function tB(e,t=!1){for(;e;e=e.parent)if(e.name==`Element`)if(t)t=!1;else return e;return null}function nB(e,t,n){return n.tags[eB(e,tB(t))]?.children||n.allTags}function rB(e,t){let n=[];for(let r=tB(t);r&&!r.type.isTop;r=tB(r.parent)){let i=eB(e,r);if(i&&r.lastChild.name==`CloseTag`)break;i&&n.indexOf(i)<0&&(t.name==`EndTag`||t.from>=r.firstChild.to)&&n.push(i)}return n}var iB=/^[:\-\.\w\u00b7-\uffff]*$/;function aB(e,t,n,r,i){let a=/\s*>/.test(e.sliceDoc(i,i+5))?``:`>`,o=tB(n,n.name==`StartTag`||n.name==`TagName`);return{from:r,to:i,options:nB(e.doc,o,t).map(e=>({label:e,type:`type`})).concat(rB(e.doc,n).map((e,t)=>({label:`/`+e,apply:`/`+e+a,type:`type`,boost:99-t}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function oB(e,t,n,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?``:`>`;return{from:n,to:r,options:rB(e.doc,t).map((e,t)=>({label:e,apply:e+i,type:`type`,boost:99-t})),validFor:iB}}function xOe(e,t,n,r){let i=[],a=0;for(let r of nB(e.doc,n,t))i.push({label:`<`+r,type:`type`});for(let t of rB(e.doc,n))i.push({label:`</`+t+`>`,type:`type`,boost:99-a++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function SOe(e,t,n,r,i){let a=tB(n),o=a?t.tags[eB(e.doc,a)]:null,s=o&&o.attrs?Object.keys(o.attrs):[];return{from:r,to:i,options:(o&&o.globalAttrs===!1?s:s.length?s.concat(t.globalAttrNames):t.globalAttrNames).map(e=>({label:e,type:`property`})),validFor:iB}}function COe(e,t,n,r,i){let a=n.parent?.getChild(`AttributeName`),o=[],s;if(a){let c=e.sliceDoc(a.from,a.to),l=t.globalAttrs[c];if(!l){let r=tB(n),i=r?t.tags[eB(e.doc,r)]:null;l=i?.attrs&&i.attrs[c]}if(l){let t=e.sliceDoc(r,i).toLowerCase(),n=`"`,a=`"`;/^['"]/.test(t)?(s=t[0]==`"`?/^[^"]*$/:/^[^']*$/,n=``,a=e.sliceDoc(i,i+1)==t[0]?``:t[0],t=t.slice(1),r++):s=/^[^\s<>='"]*$/;for(let e of l)o.push({label:e,apply:n+e+a,type:`constant`})}}return{from:r,to:i,options:o,validFor:s}}function sB(e,t){let{state:n,pos:r}=t,i=xt(n).resolveInner(r,-1),a=i.resolve(r);for(let e=r,t;a==i&&(t=i.childBefore(e));){let n=t.lastChild;if(!n||!n.type.isError||n.from<n.to)break;a=i=t,e=n.from}return i.name==`TagName`?i.parent&&/CloseTag$/.test(i.parent.name)?oB(n,i,i.from,r):aB(n,e,i,i.from,r):i.name==`StartTag`||i.name==`IncompleteTag`?aB(n,e,i,r,r):i.name==`StartCloseTag`||i.name==`IncompleteCloseTag`?oB(n,i,r,r):i.name==`OpenTag`||i.name==`SelfClosingTag`||i.name==`AttributeName`?SOe(n,e,i,i.name==`AttributeName`?i.from:r,r):i.name==`Is`||i.name==`AttributeValue`||i.name==`UnquotedAttributeValue`?COe(n,e,i,i.name==`Is`?r:i.from,r):t.explicit&&(a.name==`Element`||a.name==`Text`||a.name==`Document`)?xOe(n,e,i,r):null}function cB(e){return sB($z.default,e)}function lB(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new $z(t,n):$z.default;return e=>sB(r,e)}var wOe=Bn.parser.configure({top:`SingleExpression`}),uB=[{tag:`script`,attrs:e=>e.type==`text/typescript`||e.lang==`ts`,parser:zn.parser},{tag:`script`,attrs:e=>e.type==`text/babel`||e.type==`text/jsx`,parser:nee.parser},{tag:`script`,attrs:e=>e.type==`text/typescript-jsx`,parser:tee.parser},{tag:`script`,attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:wOe},{tag:`script`,attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:Bn.parser},{tag:`style`,attrs(e){return(!e.lang||e.lang==`css`)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:Uz.parser}],dB=[{name:`style`,parser:Uz.parser.configure({top:`Styles`})}].concat(Qz.map(e=>({name:e,parser:Bn.parser}))),fB=Dn.define({name:`html`,parser:BDe.configure({props:[_t.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let n=e.node;;){let e=n.lastChild;if(!e||e.name!=`Element`||e.to!=n.to)break;t=n=e}return t&&!((n=t.lastChild)&&(n.name==`CloseTag`||n.name==`SelfClosingTag`))?e.lineIndent(t.from)+e.unit:null}}),ht.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),_n.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:`-_`}}),pB=fB.configure({wrap:wz(uB,dB)});function mB(e={}){let t=``,n;return e.matchClosingTags===!1&&(t=`noMatch`),e.selfClosingTags===!0&&(t=(t?t+` `:``)+`selfClosing`),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=wz((e.nestedLanguages||[]).concat(uB),(e.nestedAttributes||[]).concat(dB))),new An(n?fB.configure({wrap:n,dialect:t}):t?pB.configure({dialect:t}):pB,[pB.data.of({autocomplete:lB(e)}),e.autoCloseTags===!1?[]:gB,Rn().support,Wz().support])}var hB=new Set(`area base br col command embed frame hr img input keygen link meta param source track wbr menuitem`.split(` `)),gB=Ut.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!pB.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let t=o.doc.sliceString(e.from-1,e.to)==r,{head:n}=e,i=xt(o).resolveInner(n,-1),a;if(t&&r==`>`&&i.name==`EndTag`){let t=i.parent;if(t.parent?.lastChild?.name!=`CloseTag`&&(a=eB(o.doc,t.parent,n))&&!hB.has(a))return{range:e,changes:{from:n,to:n+(o.doc.sliceString(n,n+1)===`>`?1:0),insert:`</${a}>`}}}else if(t&&r==`/`&&i.name==`IncompleteCloseTag`){let e=i.parent;if(i.from==n-2&&e.lastChild?.name!=`CloseTag`&&(a=eB(o.doc,e,n))&&!hB.has(a)){let e=n+(o.doc.sliceString(n,n+1)===`>`?1:0),t=`${a}>`;return{range:on.cursor(n+t.length,-1),changes:{from:n,to:e,insert:t}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),_B=Jt({commentTokens:{block:{open:`<!--`,close:`-->`}}}),vB=new pn,yB=UEe.configure({props:[ht.add(e=>!e.is(`Block`)||e.is(`Document`)||bB(e)!=null||TOe(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),vB.add(bB),_t.add({Document:()=>null}),fn.add({Document:_B})]});function bB(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function TOe(e){return e.name==`OrderedList`||e.name==`BulletList`}function EOe(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=bB(e.type))!=null&&r<=t)break;n=e}return n.to}var DOe=Pn.of((e,t,n)=>{for(let r=xt(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(vB);if(e==null)continue;let t=EOe(r,e);if(t>n)return{from:n,to:t}}return null});function xB(e){return new $t(_B,e,[],`markdown`)}var SB=xB(yB),CB=xB(yB.configure([$Ee,tDe,eDe,nDe,{props:[ht.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function OOe(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):B.matchLanguageName(e,n,!0),t instanceof B)return t.support?t.support.language.parser:tn.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var wB=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}else{for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}}marker(e,t){let n=this.node.name==`OrderedList`?String(+EB(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function TB(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new wB(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new wB(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new wB(i.parent,s,s+t,a[1],e,n,i))}}return r}function EB(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function DB(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=EB(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function OB(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(ft)!=` `)return e;let r=vt(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var kB=(e={})=>({state:t,dispatch:n})=>{let r=xt(t),{doc:i}=t,a=null,o=t.changeByRange(n=>{if(!n.empty||!CB.isActiveAt(t,n.from,-1)&&!CB.isActiveAt(t,n.from,1))return a={range:n};let o=n.from,s=i.lineAt(o),c=TB(r.resolveInner(o,-1),i);for(;c.length&&c[c.length-1].from>o-s.from;)c.pop();if(!c.length)return a={range:n};let l=c[c.length-1];if(l.to-l.spaceAfter.length>o-s.from)return a={range:n};let u=o>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&u){let n=l.node.firstChild,r=l.node.getChild(`ListItem`,`ListItem`);if(n.to>=o||r&&r.to<o||s.from>0&&!/[^\s>]/.test(i.lineAt(s.from-1).text)||e.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(i,1)):t=s.from+(e?e.to:0);let r=[{from:t,to:o,insert:n}];return l.node.name==`OrderedList`&&DB(l.item,i,r,-2),e&&e.node.name==`OrderedList`&&DB(e.item,i,r),{range:on.cursor(t+n.length),changes:r}}else{let e=MB(c,t,s);return{range:on.cursor(o+e.length+1),changes:{from:s.from,insert:e+t.lineBreak}}}}if(l.node.name==`Blockquote`&&u&&s.from){let e=i.lineAt(s.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==l.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:s.from+l.from,to:s.to}]);return{range:n.map(i),changes:i}}}let d=[];l.node.name==`OrderedList`&&DB(l.item,i,d);let f=l.item&&l.item.from<s.from,p=``;if(!f||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=l.to)for(let e=0,t=c.length-1;e<=t;e++)p+=e==t&&!f?c[e].marker(i,1):c[e].blank(e<t?vt(s.text,4,c[e+1].from)-p.length:null);let m=o;for(;m>s.from&&/\s/.test(s.text.charAt(m-s.from-1));)m--;return p=OB(p,t),kOe(l.node,t.doc)&&(p=MB(c,t,s)+t.lineBreak+p),d.push({from:m,to:o,insert:t.lineBreak+p}),{range:on.cursor(m+p.length+1),changes:d}});return a?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:`input`})),!0)},AB=kB();function jB(e){return e.name==`QuoteMark`||e.name==`ListMark`}function kOe(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+(o?0:1)<a.number}function MB(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?vt(n.text,4,e[t+1].from)-r.length:null,t<i);return OB(r,t)}function AOe(e,t){let n=e.resolveInner(t,-1),r=t;jB(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(jB(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var NB=({state:e,dispatch:t})=>{let n=xt(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&CB.isActiveAt(e,t.from)){let t=a.lineAt(i),r=TB(AOe(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+(n.spaceAfter?1:0);if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:on.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(vt(t.text,4,n.to)-vt(t.text,4,n.from));return r==t.from&&(i=OB(i,e)),{range:on.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:on.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return r?!1:(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)},PB=[{key:`Enter`,run:AB},{key:`Backspace`,run:NB}],FB=mB({matchClosingTags:!1});function IB(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=SB,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:s=FB}=e;if(!(i instanceof LEe))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[s.support,DOe],u;o&&l.push(RB),n instanceof An?(l.push(n.support),u=n.language):n&&(u=n);let d=t||u?OOe(t,u):void 0;c.push(GEe({codeParser:d,htmlParser:s.language.parser})),r&&l.push(cn.high(dt.of(PB)));let f=xB(i.configure(c));return a&&l.push(f.data.of({autocomplete:jOe})),new An(f,l)}function jOe(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=xt(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:MOe(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var LB=null;function MOe(){if(LB)return LB;let e=cB(new Gn(Cn.create({extensions:FB}),0,!0));return LB=e?e.options:[]}var NOe=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,RB=Ut.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!CB.isActiveAt(t.state,n.from,1)))return!1;let i=xt(t.state),a=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||NOe.test(e.name))&&(a=!0)},leave:e=>{e.to<n.to&&(a=!0)}}),a?!1:(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}}),zB=63,BB=64,POe=1,FOe=2,VB=3,IOe=4,HB=5,LOe=6,ROe=7,UB=65,zOe=66,BOe=8,VOe=9,HOe=10,UOe=11,WOe=12,WB=13,GOe=19,KOe=20,qOe=29,JOe=33,YOe=34,XOe=47,ZOe=0,GB=1,KB=2,qB=3,JB=4,YB=class{constructor(e,t,n){this.parent=e,this.depth=t,this.type=n,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)+n}};YB.top=new YB(null,-1,ZOe);function XB(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let t=e.peek(r);if(QB(t)||t==-1)return n}}function ZB(e){return e==32||e==9}function QB(e){return e==10||e==13}function $B(e){return ZB(e)||QB(e)}function eV(e){return e<0||$B(e)}var QOe=new kn({start:YB.top,reduce(e,t){return e.type==qB&&(t==KOe||t==YOe)?e.parent:e},shift(e,t,n,r){if(t==VB)return new YB(e,XB(r,r.pos),GB);if(t==UB||t==HB)return new YB(e,XB(r,r.pos),KB);if(t==zB)return e.parent;if(t==GOe||t==JOe)return new YB(e,0,qB);if(t==WB&&e.type==JB)return e.parent;if(t==XOe){let t=/[1-9]/.exec(r.read(r.pos,n.pos));if(t)return new YB(e,e.depth+ +t[0],JB)}return e},hash(e){return e.hash}});function tV(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&eV(e.peek(n+3))}var $Oe=new yn((e,t)=>{if(e.next==-1&&t.canShift(BB))return e.acceptToken(BB);let n=e.peek(-1);if((QB(n)||n<0)&&t.context.type!=qB){if(tV(e,45))if(t.canShift(zB))e.acceptToken(zB);else return e.acceptToken(POe,3);if(tV(e,46))if(t.canShift(zB))e.acceptToken(zB);else return e.acceptToken(FOe,3);let n=0;for(;e.next==32;)n++,e.advance();(n<t.context.depth||n==t.context.depth&&t.context.type==GB&&(e.next!=45||!eV(e.peek(1))))&&e.next!=-1&&!QB(e.next)&&e.next!=35&&e.acceptToken(zB,-n)}},{contextual:!0}),eke=new yn((e,t)=>{if(t.context.type==qB){e.next==63&&(e.advance(),eV(e.next)&&e.acceptToken(ROe));return}if(e.next==45)e.advance(),eV(e.next)&&e.acceptToken(t.context.type==GB&&t.context.depth==XB(e,e.pos-1)?IOe:VB);else if(e.next==63)e.advance(),eV(e.next)&&e.acceptToken(t.context.type==KB&&t.context.depth==XB(e,e.pos-1)?LOe:HB);else{let n=e.pos;for(;;)if(ZB(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)iV(e);else if(e.next==38)aV(e);else if(e.next==42){aV(e);break}else if(e.next==39||e.next==34){if(oV(e,!0))break;return}else if(e.next==91||e.next==123){if(!nke(e))return;break}else{lV(e,!0,!1,0);break}for(;ZB(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(qOe))return;eV(e.peek(1))&&e.acceptTokenTo(t.context.type==KB&&t.context.depth==XB(e,n)?zOe:UB,n)}}},{contextual:!0});function tke(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function nV(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function rV(e,t){return e.next==37?(e.advance(),nV(e.next)&&e.advance(),nV(e.next)&&e.advance(),!0):tke(e.next)||t&&e.next==44?(e.advance(),!0):!1}function iV(e){if(e.advance(),e.next==60){for(e.advance();;)if(!rV(e,!0)){e.next==62&&e.advance();break}}else for(;rV(e,!1););}function aV(e){for(e.advance();!eV(e.next)&&sV(e.tag)!=`f`;)e.advance()}function oV(e,t){let n=e.next,r=!1,i=e.pos;for(e.advance();;){let a=e.next;if(a<0)break;if(e.advance(),a==n)if(a==39)if(e.next==39)e.advance();else break;else break;else if(a==92&&n==34)e.next>=0&&e.advance();else if(QB(a)){if(t)return!1;r=!0}else if(t&&e.pos>=i+1024)return!1}return!r}function nke(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!oV(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else if(e.next<0||e.pos>n||QB(e.next))return!1;else e.advance()}var rke=`iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif`;function sV(e){return e<33?`u`:e>125?`s`:rke[e-33]}function cV(e,t){let n=sV(e);return n!=`u`&&!(t&&n==`f`)}function lV(e,t,n,r){if(sV(e.next)==`s`||(e.next==63||e.next==58||e.next==45)&&cV(e.peek(1),n))e.advance();else return!1;let i=e.pos;for(;;){let a=e.next,o=0,s=r+1;for(;$B(a);){if(QB(a)){if(t)return!1;s=0}else s++;a=e.peek(++o)}if(!(a>=0&&(a==58?cV(e.peek(o+1),n):a==35?e.peek(o-1)!=32:cV(a,n)))||!n&&s<=r||s==0&&!n&&(tV(e,45,o)||tV(e,46,o)))break;if(t&&sV(a)==`f`)return!1;for(let t=o;t>=0;t--)e.advance();if(t&&e.pos>i+1024)return!1}return!0}var ike=new yn((e,t)=>{if(e.next==33)iV(e),e.acceptToken(WOe);else if(e.next==38||e.next==42){let t=e.next==38?HOe:UOe;aV(e),e.acceptToken(t)}else e.next==39||e.next==34?(oV(e,!1),e.acceptToken(VOe)):lV(e,!1,t.context.type==qB,t.context.depth)&&e.acceptToken(BOe)}),ake=new yn((e,t)=>{let n=t.context.type==JB?t.context.depth:-1,r=e.pos;scan:for(;;){let i=0,a=e.next;for(;a==32;)a=e.peek(++i);if(!i&&(tV(e,45,i)||tV(e,46,i))||!QB(a)&&(n<0&&(n=Math.max(t.context.depth+1,i)),i<n))break;for(;;){if(e.next<0)break scan;let t=QB(e.next);if(e.advance(),t)continue scan;r=e.pos}}e.acceptTokenTo(WB,r)}),oke=Ot({DirectiveName:z.keyword,DirectiveContent:z.attributeValue,"DirectiveEnd DocEnd":z.meta,QuotedLiteral:z.string,BlockLiteralHeader:z.special(z.string),BlockLiteralContent:z.content,Literal:z.content,"Key/Literal Key/QuotedLiteral":z.definition(z.propertyName),"Anchor Alias":z.labelName,Tag:z.typeName,Comment:z.lineComment,": , -":z.separator,"?":z.punctuation,"[ ]":z.squareBracket,"{ }":z.brace}),ske=Tn.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:`⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document`,maxTerm:74,context:QOe,nodeProps:[[`isolate`,-3,8,9,14,``],[`openedBy`,18,`[`,32,`{`],[`closedBy`,19,`]`,33,`}`]],propSources:[oke],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[$Oe,eke,ike,ake,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),cke=Tn.deserialize({version:14,states:"!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:`!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~`,goto:`vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS`,nodeNames:`⚠ Document Frontmatter DashLine FrontmatterContent Body`,maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),uV=Dn.define({name:`yaml`,parser:ske.configure({props:[_t.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name==`BlockLiteralContent`&&t.from<t.to)return e.baseIndentFor(t);if(t.name==`BlockLiteral`)return e.baseIndentFor(t)+e.unit;if(t.name==`BlockSequence`||t.name==`BlockMapping`)return e.column(t.from,1);if(t.name==`QuotedLiteral`)return null;if(t.name==`Literal`){let n=e.column(t.from,1);if(n==e.lineIndent(t.from,1))return n;if(t.to>e.pos)return null}}return null},FlowMapping:Mn({closing:`}`}),FlowSequence:Mn({closing:`]`})}),ht.add({"FlowMapping FlowSequence":Fn,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:`#`},indentOnInput:/^\s*[\]\}]$/}});function dV(){return new An(uV)}Dn.define({name:`yaml-frontmatter`,parser:cke.configure({props:[Ot({DashLine:z.meta})]})});function Q(e){return new An(an.define(e))}function fV(e){return Z(()=>import(`./dist-CdAkpuDK.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([10,11,12]))}var pV=[B.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return Z(()=>import(`./dist-CJCFfS8X.js`).then(e=>e.cpp()),__vite__mapDeps([13,12]))}}),B.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return Z(()=>import(`./dist-CJCFfS8X.js`).then(e=>e.cpp()),__vite__mapDeps([13,12]))}}),B.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return fV(`Cassandra`)}}),B.of({name:`CSS`,extensions:[`css`],load(){return Z(()=>import(`./dist-DxTZTTY6.js`).then(e=>e.css()),__vite__mapDeps([14,12]))}}),B.of({name:`Go`,extensions:[`go`],load(){return Z(()=>import(`./dist-DbHhRzXY.js`).then(e=>e.go()),__vite__mapDeps([15,11,12]))}}),B.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return Z(()=>import(`./dist-DFrBPW6S.js`).then(e=>e.html()),__vite__mapDeps([16,17,2,11,12]))}}),B.of({name:`Java`,extensions:[`java`],load(){return Z(()=>import(`./dist-CnO8PEuw.js`).then(e=>e.java()),__vite__mapDeps([18,12]))}}),B.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return Z(()=>import(`./dist-PYiUsivk.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([17,2,11,12]))}}),B.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return Z(()=>import(`./dist-biv4iN0V.js`).then(e=>e.jinja()),__vite__mapDeps([19,17,2,11,12]))}}),B.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return Z(()=>import(`./dist-Cd3-dF0O.js`).then(e=>e.json()),__vite__mapDeps([20,12]))}}),B.of({name:`JSX`,extensions:[`jsx`],load(){return Z(()=>import(`./dist-PYiUsivk.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([17,2,11,12]))}}),B.of({name:`LESS`,extensions:[`less`],load(){return Z(()=>import(`./dist-DclbMTMt.js`).then(e=>e.less()),__vite__mapDeps([21,12]))}}),B.of({name:`Liquid`,extensions:[`liquid`],load(){return Z(()=>import(`./dist-BXnglWxe.js`).then(e=>e.liquid()),__vite__mapDeps([22,17,2,11,12]))}}),B.of({name:`MariaDB SQL`,load(){return fV(`MariaSQL`)}}),B.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return Z(()=>import(`./dist-0yxWvQWL.js`).then(e=>e.markdown()),__vite__mapDeps([23,17,2,11,12]))}}),B.of({name:`MS SQL`,load(){return fV(`MSSQL`)}}),B.of({name:`MySQL`,load(){return fV(`MySQL`)}}),B.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return Z(()=>import(`./dist-CqBkec9X.js`).then(e=>e.php()),__vite__mapDeps([24,17,2,11,12]))}}),B.of({name:`PLSQL`,extensions:[`pls`],load(){return fV(`PLSQL`)}}),B.of({name:`PostgreSQL`,load(){return fV(`PostgreSQL`)}}),B.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return Z(()=>import(`./dist-CGJy4k2t.js`).then(e=>e.python()),__vite__mapDeps([25,11,12]))}}),B.of({name:`Rust`,extensions:[`rs`],load(){return Z(()=>import(`./dist-DsHxTxcA.js`).then(e=>e.rust()),__vite__mapDeps([26,12]))}}),B.of({name:`Sass`,extensions:[`sass`],load(){return Z(()=>import(`./dist-Cqsy4GXU.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([27,12]))}}),B.of({name:`SCSS`,extensions:[`scss`],load(){return Z(()=>import(`./dist-Cqsy4GXU.js`).then(e=>e.sass()),__vite__mapDeps([27,12]))}}),B.of({name:`SQL`,extensions:[`sql`],load(){return fV(`StandardSQL`)}}),B.of({name:`SQLite`,load(){return fV(`SQLite`)}}),B.of({name:`TSX`,extensions:[`tsx`],load(){return Z(()=>import(`./dist-PYiUsivk.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([17,2,11,12]))}}),B.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return Z(()=>import(`./dist-PYiUsivk.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([17,2,11,12]))}}),B.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return Z(()=>import(`./dist-BT7-2C5q.js`).then(e=>e.wast()),__vite__mapDeps([28,12]))}}),B.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return Z(()=>import(`./dist-B1p1fIxA.js`).then(e=>e.xml()),__vite__mapDeps([29,12]))}}),B.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return Z(()=>import(`./dist-4fNILwqh.js`).then(e=>e.yaml()),__vite__mapDeps([30,12]))}}),B.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return Z(()=>import(`./apl-CYISZphB.js`).then(e=>Q(e.apl)),[])}}),B.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return Z(()=>import(`./asciiarmor-HBcwrfTl.js`).then(e=>Q(e.asciiArmor)),[])}}),B.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return Z(()=>import(`./asn1-B7aRTScN.js`).then(e=>Q(e.asn1({}))),[])}}),B.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return Z(()=>import(`./asterisk-DN6Y5NwP.js`).then(e=>Q(e.asterisk)),[])}}),B.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return Z(()=>import(`./brainfuck-CuRUsj7k.js`).then(e=>Q(e.brainfuck)),[])}}),B.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return Z(()=>import(`./cobol-mb97iEDV.js`).then(e=>Q(e.cobol)),[])}}),B.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return Z(()=>import(`./clike-B8uP_5i6.js`).then(e=>Q(e.csharp)),[])}}),B.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return Z(()=>import(`./clojure-DhLYUYUD.js`).then(e=>Q(e.clojure)),[])}}),B.of({name:`ClojureScript`,extensions:[`cljs`],load(){return Z(()=>import(`./clojure-DhLYUYUD.js`).then(e=>Q(e.clojure)),[])}}),B.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return Z(()=>import(`./css-BEerEcwg.js`).then(e=>Q(e.gss)),[])}}),B.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return Z(()=>import(`./cmake-CrkTPxpC.js`).then(e=>Q(e.cmake)),[])}}),B.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return Z(()=>import(`./coffeescript-CpkMzBuh.js`).then(e=>Q(e.coffeeScript)),[])}}),B.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return Z(()=>import(`./commonlisp-Bvx01cnI.js`).then(e=>Q(e.commonLisp)),[])}}),B.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return Z(()=>import(`./cypher-BWxkUNlk.js`).then(e=>Q(e.cypher)),[])}}),B.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return Z(()=>import(`./python-CYXPDD4I.js`).then(e=>Q(e.cython)),[])}}),B.of({name:`Crystal`,extensions:[`cr`],load(){return Z(()=>import(`./crystal-BpH_STG5.js`).then(e=>Q(e.crystal)),[])}}),B.of({name:`D`,extensions:[`d`],load(){return Z(()=>import(`./d-BbO5ubRg.js`).then(e=>Q(e.d)),[])}}),B.of({name:`Dart`,extensions:[`dart`],load(){return Z(()=>import(`./clike-B8uP_5i6.js`).then(e=>Q(e.dart)),[])}}),B.of({name:`diff`,extensions:[`diff`,`patch`],load(){return Z(()=>import(`./diff-jUUrepKE.js`).then(e=>Q(e.diff)),[])}}),B.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return Z(()=>import(`./dockerfile-DPZmz0mC.js`).then(e=>Q(e.dockerFile)),__vite__mapDeps([31,32]))}}),B.of({name:`DTD`,extensions:[`dtd`],load(){return Z(()=>import(`./dtd-CVCnBQzV.js`).then(e=>Q(e.dtd)),[])}}),B.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return Z(()=>import(`./dylan-BoJgTcA5.js`).then(e=>Q(e.dylan)),[])}}),B.of({name:`EBNF`,load(){return Z(()=>import(`./ebnf-DhPacwJT.js`).then(e=>Q(e.ebnf)),[])}}),B.of({name:`ECL`,extensions:[`ecl`],load(){return Z(()=>import(`./ecl-BMVjKtDk.js`).then(e=>Q(e.ecl)),[])}}),B.of({name:`edn`,extensions:[`edn`],load(){return Z(()=>import(`./clojure-DhLYUYUD.js`).then(e=>Q(e.clojure)),[])}}),B.of({name:`Eiffel`,extensions:[`e`],load(){return Z(()=>import(`./eiffel-ChPO0raq.js`).then(e=>Q(e.eiffel)),[])}}),B.of({name:`Elm`,extensions:[`elm`],load(){return Z(()=>import(`./elm-BFrHhzOf.js`).then(e=>Q(e.elm)),[])}}),B.of({name:`Erlang`,extensions:[`erl`],load(){return Z(()=>import(`./erlang-B1G82j14.js`).then(e=>Q(e.erlang)),[])}}),B.of({name:`Esper`,load(){return Z(()=>import(`./sql-B8tBavZM.js`).then(e=>Q(e.esper)),[])}}),B.of({name:`Factor`,extensions:[`factor`],load(){return Z(()=>import(`./factor-B0X9gnIy.js`).then(e=>Q(e.factor)),__vite__mapDeps([33,32]))}}),B.of({name:`FCL`,load(){return Z(()=>import(`./fcl-nCo1IVPi.js`).then(e=>Q(e.fcl)),[])}}),B.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return Z(()=>import(`./forth-CftEcDBX.js`).then(e=>Q(e.forth)),[])}}),B.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return Z(()=>import(`./fortran-B6GPIfoB.js`).then(e=>Q(e.fortran)),[])}}),B.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return Z(()=>import(`./mllike-BmhQglqS.js`).then(e=>Q(e.fSharp)),[])}}),B.of({name:`Gas`,extensions:[`s`],load(){return Z(()=>import(`./gas-DR4EL-uU.js`).then(e=>Q(e.gas)),[])}}),B.of({name:`Gherkin`,extensions:[`feature`],load(){return Z(()=>import(`./gherkin-Cpl0I9V7.js`).then(e=>Q(e.gherkin)),[])}}),B.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return Z(()=>import(`./groovy-DLlEwdqc.js`).then(e=>Q(e.groovy)),[])}}),B.of({name:`Haskell`,extensions:[`hs`],load(){return Z(()=>import(`./haskell-nNlu0Bhn.js`).then(e=>Q(e.haskell)),[])}}),B.of({name:`Haxe`,extensions:[`hx`],load(){return Z(()=>import(`./haxe-DsvjREf7.js`).then(e=>Q(e.haxe)),[])}}),B.of({name:`HXML`,extensions:[`hxml`],load(){return Z(()=>import(`./haxe-DsvjREf7.js`).then(e=>Q(e.hxml)),[])}}),B.of({name:`HTTP`,load(){return Z(()=>import(`./http-D_KkyP4m.js`).then(e=>Q(e.http)),[])}}),B.of({name:`IDL`,extensions:[`pro`],load(){return Z(()=>import(`./idl-Bqii7Vbi.js`).then(e=>Q(e.idl)),[])}}),B.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return Z(()=>import(`./javascript-LCSAwviG.js`).then(e=>Q(e.jsonld)),[])}}),B.of({name:`Julia`,extensions:[`jl`],load(){return Z(()=>import(`./julia-ByGjwiLn.js`).then(e=>Q(e.julia)),[])}}),B.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return Z(()=>import(`./clike-B8uP_5i6.js`).then(e=>Q(e.kotlin)),[])}}),B.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return Z(()=>import(`./livescript-B8l2m7xO.js`).then(e=>Q(e.liveScript)),[])}}),B.of({name:`Lua`,extensions:[`lua`],load(){return Z(()=>import(`./lua-DrfAKnQQ.js`).then(e=>Q(e.lua)),[])}}),B.of({name:`mIRC`,extensions:[`mrc`],load(){return Z(()=>import(`./mirc-DStbUCmv.js`).then(e=>Q(e.mirc)),[])}}),B.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return Z(()=>import(`./mathematica-DYk_2Ik_.js`).then(e=>Q(e.mathematica)),[])}}),B.of({name:`Modelica`,extensions:[`mo`],load(){return Z(()=>import(`./modelica-ZElxtbqD.js`).then(e=>Q(e.modelica)),[])}}),B.of({name:`MUMPS`,extensions:[`mps`],load(){return Z(()=>import(`./mumps-B79RJJhR.js`).then(e=>Q(e.mumps)),[])}}),B.of({name:`Mbox`,extensions:[`mbox`],load(){return Z(()=>import(`./mbox-BOzVHzVt.js`).then(e=>Q(e.mbox)),[])}}),B.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return Z(()=>import(`./nginx-c--axfuP.js`).then(e=>Q(e.nginx)),[])}}),B.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return Z(()=>import(`./nsis-CqLr_sRu.js`).then(e=>Q(e.nsis)),__vite__mapDeps([34,32]))}}),B.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return Z(()=>import(`./ntriples-CgD4YZZC.js`).then(e=>Q(e.ntriples)),[])}}),B.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return Z(()=>import(`./clike-B8uP_5i6.js`).then(e=>Q(e.objectiveC)),[])}}),B.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return Z(()=>import(`./clike-B8uP_5i6.js`).then(e=>Q(e.objectiveCpp)),[])}}),B.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return Z(()=>import(`./mllike-BmhQglqS.js`).then(e=>Q(e.oCaml)),[])}}),B.of({name:`Octave`,extensions:[`m`],load(){return Z(()=>import(`./octave-BQk-bCrp.js`).then(e=>Q(e.octave)),[])}}),B.of({name:`Oz`,extensions:[`oz`],load(){return Z(()=>import(`./oz-DPCSPrx5.js`).then(e=>Q(e.oz)),[])}}),B.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return Z(()=>import(`./pascal-C1iGzZ53.js`).then(e=>Q(e.pascal)),[])}}),B.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return Z(()=>import(`./perl-DQ3L8ffg.js`).then(e=>Q(e.perl)),[])}}),B.of({name:`Pig`,extensions:[`pig`],load(){return Z(()=>import(`./pig-B4S8acys.js`).then(e=>Q(e.pig)),[])}}),B.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return Z(()=>import(`./powershell-BhSVdaeY.js`).then(e=>Q(e.powerShell)),[])}}),B.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return Z(()=>import(`./properties-B2nfdtxE.js`).then(e=>Q(e.properties)),[])}}),B.of({name:`ProtoBuf`,extensions:[`proto`],load(){return Z(()=>import(`./protobuf-BFW_iwVN.js`).then(e=>Q(e.protobuf)),[])}}),B.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return Z(()=>import(`./pug-B2drGkIO.js`).then(e=>Q(e.pug)),__vite__mapDeps([35,36]))}}),B.of({name:`Puppet`,extensions:[`pp`],load(){return Z(()=>import(`./puppet-C1-CkyhQ.js`).then(e=>Q(e.puppet)),[])}}),B.of({name:`Q`,extensions:[`q`],load(){return Z(()=>import(`./q-Bub5Xmxm.js`).then(e=>Q(e.q)),[])}}),B.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return Z(()=>import(`./r-C59ONZO2.js`).then(e=>Q(e.r)),[])}}),B.of({name:`RPM Changes`,load(){return Z(()=>import(`./rpm-DiM-R-wd.js`).then(e=>Q(e.rpmChanges)),[])}}),B.of({name:`RPM Spec`,extensions:[`spec`],load(){return Z(()=>import(`./rpm-DiM-R-wd.js`).then(e=>Q(e.rpmSpec)),[])}}),B.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return Z(()=>import(`./ruby-DTqG95KX.js`).then(e=>Q(e.ruby)),[])}}),B.of({name:`SAS`,extensions:[`sas`],load(){return Z(()=>import(`./sas-BjdhmGHX.js`).then(e=>Q(e.sas)),[])}}),B.of({name:`Scala`,extensions:[`scala`],load(){return Z(()=>import(`./clike-B8uP_5i6.js`).then(e=>Q(e.scala)),[])}}),B.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return Z(()=>import(`./scheme-CWNdoI17.js`).then(e=>Q(e.scheme)),[])}}),B.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return Z(()=>import(`./shell-iaorleRB.js`).then(e=>Q(e.shell)),[])}}),B.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return Z(()=>import(`./sieve-D8m9Etmd.js`).then(e=>Q(e.sieve)),[])}}),B.of({name:`Smalltalk`,extensions:[`st`],load(){return Z(()=>import(`./smalltalk-28WS1mUj.js`).then(e=>Q(e.smalltalk)),[])}}),B.of({name:`Solr`,load(){return Z(()=>import(`./solr-x8qQ6eAP.js`).then(e=>Q(e.solr)),[])}}),B.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return Z(()=>import(`./mllike-BmhQglqS.js`).then(e=>Q(e.sml)),[])}}),B.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return Z(()=>import(`./sparql-BvLmi7B6.js`).then(e=>Q(e.sparql)),[])}}),B.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return Z(()=>import(`./spreadsheet-BuqSwScP.js`).then(e=>Q(e.spreadsheet)),[])}}),B.of({name:`Squirrel`,extensions:[`nut`],load(){return Z(()=>import(`./clike-B8uP_5i6.js`).then(e=>Q(e.squirrel)),[])}}),B.of({name:`Stylus`,extensions:[`styl`],load(){return Z(()=>import(`./stylus-CMEhEjuV.js`).then(e=>Q(e.stylus)),[])}}),B.of({name:`Swift`,extensions:[`swift`],load(){return Z(()=>import(`./swift-wY9II8hY.js`).then(e=>Q(e.swift)),[])}}),B.of({name:`sTeX`,load(){return Z(()=>import(`./stex-Bx4bLPxI.js`).then(e=>Q(e.stex)),[])}}),B.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return Z(()=>import(`./stex-Bx4bLPxI.js`).then(e=>Q(e.stex)),[])}}),B.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return Z(()=>import(`./verilog-DbEC7ose.js`).then(e=>Q(e.verilog)),[])}}),B.of({name:`Tcl`,extensions:[`tcl`],load(){return Z(()=>import(`./tcl-BGywDEsi.js`).then(e=>Q(e.tcl)),[])}}),B.of({name:`Textile`,extensions:[`textile`],load(){return Z(()=>import(`./textile-K_mvsehZ.js`).then(e=>Q(e.textile)),[])}}),B.of({name:`TiddlyWiki`,load(){return Z(()=>import(`./tiddlywiki-BrpeQ34q.js`).then(e=>Q(e.tiddlyWiki)),[])}}),B.of({name:`Tiki wiki`,load(){return Z(()=>import(`./tiki-z2eQQPgI.js`).then(e=>Q(e.tiki)),[])}}),B.of({name:`TOML`,extensions:[`toml`],load(){return Z(()=>import(`./toml-Dcu7S7XA.js`).then(e=>Q(e.toml)),[])}}),B.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return Z(()=>import(`./troff-Djlumm7T.js`).then(e=>Q(e.troff)),[])}}),B.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return Z(()=>import(`./ttcn-XqU6tthJ.js`).then(e=>Q(e.ttcn)),[])}}),B.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return Z(()=>import(`./ttcn-cfg-BzD0wr3i.js`).then(e=>Q(e.ttcnCfg)),[])}}),B.of({name:`Turtle`,extensions:[`ttl`],load(){return Z(()=>import(`./turtle-DcjXkx6M.js`).then(e=>Q(e.turtle)),[])}}),B.of({name:`Web IDL`,extensions:[`webidl`],load(){return Z(()=>import(`./webidl-CnE8KY-y.js`).then(e=>Q(e.webIDL)),[])}}),B.of({name:`VB.NET`,extensions:[`vb`],load(){return Z(()=>import(`./vb-DV4y2QrD.js`).then(e=>Q(e.vb)),[])}}),B.of({name:`VBScript`,extensions:[`vbs`],load(){return Z(()=>import(`./vbscript-BS8DsYJ_.js`).then(e=>Q(e.vbScript)),[])}}),B.of({name:`Velocity`,extensions:[`vtl`],load(){return Z(()=>import(`./velocity-CS6Ly2yV.js`).then(e=>Q(e.velocity)),[])}}),B.of({name:`Verilog`,extensions:[`v`],load(){return Z(()=>import(`./verilog-DbEC7ose.js`).then(e=>Q(e.verilog)),[])}}),B.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return Z(()=>import(`./vhdl-DBLrW9bF.js`).then(e=>Q(e.vhdl)),[])}}),B.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return Z(()=>import(`./xquery--K5Za5EW.js`).then(e=>Q(e.xQuery)),[])}}),B.of({name:`Yacas`,extensions:[`ys`],load(){return Z(()=>import(`./yacas-ClQfYBmX.js`).then(e=>Q(e.yacas)),[])}}),B.of({name:`Z80`,extensions:[`z80`],load(){return Z(()=>import(`./z80-Dr2oR3X2.js`).then(e=>Q(e.z80)),[])}}),B.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return Z(()=>import(`./mscgen-f-YxHPr0.js`).then(e=>Q(e.mscgen)),[])}}),B.of({name:`Xù`,extensions:[`xu`],load(){return Z(()=>import(`./mscgen-f-YxHPr0.js`).then(e=>Q(e.xu)),[])}}),B.of({name:`MsGenny`,extensions:[`msgenny`],load(){return Z(()=>import(`./mscgen-f-YxHPr0.js`).then(e=>Q(e.msgenny)),[])}}),B.of({name:`Vue`,extensions:[`vue`],load(){return Z(()=>import(`./dist-DR4ycVu1.js`).then(e=>e.vue()),__vite__mapDeps([37,17,2,11,12]))}}),B.of({name:`Angular Template`,load(){return Z(()=>import(`./dist-CcTAgsaD.js`).then(e=>e.angular()),__vite__mapDeps([38,17,2,11,12]))}})],mV={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},lke={borderLeftWidth:`2px`},hV={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},gV={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},_V={border:`none`,borderRadius:`4px`,padding:`2px 10px`},uke={borderRadius:`2px`},vV={borderRadius:`2px`},yV={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},bV={width:`12px`,height:`12px`,borderRadius:`6px`},xV={borderRadius:`4px`,padding:`2px 6px`},SV={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},CV=`#0d1117`,wV=`#c9d1d9`,TV=`#264F78`,EV=`#8b949e`,DV=`#ffffff`,OV=`#7ee787`,kV=`#d2a8ff`,AV=`#79c0ff`,jV=`#ff7b72`,MV=`#a5d6ff`,dke=`#2c333a`,fke=`#3c444d`,NV=`#ffab70`,PV=`#161b22`,FV=`#30363d`,pke=`#21262d`,IV=`#f97583`,mke=`#2d333b1a`,LV=`#21262d`,RV=DV,zV=TV,hke=`#3a587a75`,BV=`#4d90fe`,VV=`#d29922`,gke=`#3a587a55`,HV=`#58a6ff`,_ke=`#bc8cff`,UV=`#2ea04350`,WV=`#f8514940`,GV=`#7ee787`,KV=`#ff7b72`,qV=[Ut.theme({"&":{color:wV,backgroundColor:CV,fontSize:mV.fontSize,fontFamily:mV.fontFamily},".cm-content":{caretColor:RV,lineHeight:mV.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:RV,borderLeftWidth:lke.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${RV}99`,color:CV},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:zV},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#3a587a`,outline:`1px solid ${AV}`,color:wV,borderRadius:xV.borderRadius,"& span":{color:wV}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:BV,color:DV,padding:xV.padding,"& span":{color:DV}},".cm-search.cm-panel.cm-textfield":{color:wV,borderRadius:xV.borderRadius,padding:xV.padding},".cm-panels":{backgroundColor:LV,color:wV,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${FV}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${FV}`},".cm-panel button":{backgroundColor:LV,color:wV,border:_V.border,borderRadius:_V.borderRadius,padding:_V.padding},".cm-panel button:hover":{backgroundColor:dke},".cm-activeLine":{backgroundColor:mke,borderRadius:uke.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:PV,color:EV,border:gV.border,borderRight:`1px solid #30363d`,paddingRight:gV.paddingRight},".cm-activeLineGutter":{backgroundColor:pke,color:wV,fontWeight:gV.fontWeight},".cm-lineNumbers":{fontSize:gV.fontSize,lineHeight:gV.lineHeight},".cm-foldGutter":{fontSize:gV.fontSize,lineHeight:gV.lineHeight},".cm-foldGutter .cm-gutterElement":{color:EV,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:wV},".cm-insertedLine":{textDecoration:hV.insertedTextDecoration,backgroundColor:UV,color:GV,padding:hV.insertedLinePadding,borderRadius:hV.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:hV.insertedTextDecoration,backgroundColor:`${UV} !important`,color:GV,padding:hV.insertedLinePadding,borderRadius:hV.borderRadious,border:`1px solid ${GV}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:hV.deletedTextDecoration,backgroundColor:WV,color:KV,padding:hV.insertedLinePadding,borderRadius:hV.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:hV.deletedTextDecoration,backgroundColor:`${WV} !important`,color:KV,padding:hV.insertedLinePadding,borderRadius:hV.borderRadious,border:`1px solid ${KV}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:LV,border:`1px solid ${FV}`,borderRadius:SV.borderRadius,padding:SV.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:LV,border:`none`},"& > ul > li":{padding:SV.padding,lineHeight:SV.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:zV,color:DV,borderRadius:SV.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:EV,paddingRight:SV.paddingRight},"& > ul > li > span.cm-completionDetail":{color:EV,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:LV,borderBottomColor:LV},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${IV}`},"&-warning":{borderLeft:`3px solid ${VV}`},"&-info":{borderLeft:`3px solid ${HV}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${IV}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${VV}`},".cm-matchingBracket":{backgroundColor:hke,outline:`1px solid ${BV}`,borderRadius:vV.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#f9758340`,outline:`1px solid ${IV}`,borderRadius:vV.borderRadius},".cm-selectionMatch":{backgroundColor:gke,outline:`1px solid ${TV}50`,borderRadius:vV.borderRadius},".cm-foldPlaceholder":{backgroundColor:LV,color:EV,border:`1px dotted ${FV}70`,borderRadius:yV.borderRadius,padding:yV.padding,margin:yV.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${CV}, 0 0 0 3px ${HV}40`},"& .cm-scroller::-webkit-scrollbar":{width:bV.width,height:bV.height},"& .cm-scroller::-webkit-scrollbar-track":{background:PV},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:FV,borderRadius:bV.borderRadius,border:`3px solid ${PV}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:fke},".cm-ghostText":{opacity:`0.5`,color:EV}},{dark:!0}),Ft(Yt.define([{tag:z.keyword,color:jV,fontWeight:`bold`},{tag:z.controlKeyword,color:jV,fontWeight:`bold`},{tag:z.moduleKeyword,color:jV,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:AV},{tag:[z.variableName],color:AV},{tag:[z.propertyName],color:kV,fontStyle:`normal`},{tag:[z.typeName],color:jV},{tag:[z.className],color:kV,fontStyle:`italic`},{tag:[z.namespace],color:AV,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:wV},{tag:[z.bracket],color:EV},{tag:[z.brace],color:EV},{tag:[z.punctuation],color:EV},{tag:[z.function(z.variableName),z.labelName],color:OV},{tag:[z.definition(z.variableName)],color:AV},{tag:z.number,color:NV},{tag:z.changed,color:NV},{tag:z.annotation,color:IV,fontStyle:`italic`},{tag:z.modifier,color:NV,fontStyle:`italic`},{tag:z.self,color:NV},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:NV},{tag:[z.atom,z.bool,z.special(z.variableName)],color:NV},{tag:[z.processingInstruction,z.inserted],color:OV},{tag:[z.special(z.string),z.regexp],color:MV},{tag:z.string,color:MV},{tag:z.definition(z.typeName),color:jV,fontWeight:`bold`},{tag:z.meta,color:EV},{tag:z.comment,fontStyle:`italic`,color:EV},{tag:z.docComment,fontStyle:`italic`,color:EV},{tag:[z.tagName],color:OV},{tag:[z.attributeName],color:kV},{tag:[z.heading],fontWeight:`bold`,color:AV},{tag:[z.strong],fontWeight:`bold`,color:AV},{tag:[z.emphasis],fontStyle:`italic`,color:MV},{tag:[z.link],color:_ke,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:HV,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:wV,textDecoration:`underline wavy`,borderBottom:`1px wavy ${IV}`},{tag:[z.strikethrough],color:IV,textDecoration:`line-through`},{tag:z.constant(z.name),color:NV},{tag:z.deleted,color:IV},{tag:z.squareBracket,color:EV},{tag:z.angleBracket,color:EV},{tag:z.monospace,color:wV},{tag:[z.contentSeparator],color:AV},{tag:z.quote,color:EV}]))],JV={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},vke={borderLeftWidth:`2px`},YV={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},XV={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},ZV={border:`none`,borderRadius:`4px`,padding:`2px 10px`},yke={borderRadius:`2px`},QV={borderRadius:`2px`},$V={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},eH={width:`12px`,height:`12px`,borderRadius:`6px`},tH={borderRadius:`4px`,padding:`2px 6px`},nH={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},rH=`#ffffff`,iH=`#24292e`,aH=`#BBDFFF`,oH=`#6e7781`,sH=`#f6f8fa`,bke=`#116329`,cH=`#6a737d`,lH=`#6f42c1`,uH=`#005cc5`,dH=`#d73a49`,fH=`#032f62`,pH=`#22863a`,mH=`#e36209`,xke=`#f1f8ff`,hH=`#e1e4e8`,Ske=`#f8f9fa`,gH=`#cb2431`,Cke=`#BBDFFF20`,_H=Ske,vH=iH,wke=aH,Tke=`#e8f0fe`,Eke=`#0366d6`,yH=`#b08800`,bH=`#79b8ff40`,xH=`#0969da`,Dke=`#8250df`,SH=`#e6ffec80`,CH=`#ffebe980`,wH=`#0f6d31`,TH=`#cf222e`,EH=[Ut.theme({"&":{color:iH,backgroundColor:rH,fontSize:JV.fontSize,fontFamily:JV.fontFamily},".cm-content":{caretColor:vH,lineHeight:JV.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:vH,borderLeftWidth:vke.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${vH}99`,color:rH},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:wke,color:iH},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#daebff`,outline:`1px solid ${uH}`,color:iH,borderRadius:tH.borderRadius,"& span":{color:iH}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#79b8ff`,color:rH,padding:tH.padding,"& span":{color:rH}},".cm-search.cm-panel.cm-textfield":{color:iH,borderRadius:tH.borderRadius,padding:tH.padding},".cm-panels":{backgroundColor:sH,color:oH,borderRadius:`0 0 4px 4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${hH}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${hH}`},".cm-panel button":{backgroundColor:rH,color:iH,border:ZV.border,borderRadius:ZV.borderRadius,padding:ZV.padding},".cm-panel button:hover":{backgroundColor:`#f5f5f5`},".cm-activeLine":{backgroundColor:Cke,borderRadius:yke.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:sH,color:oH,border:XV.border,borderRight:`1px solid ${hH}`,paddingRight:XV.paddingRight},".cm-activeLineGutter":{backgroundColor:xke,color:iH,fontWeight:XV.fontWeight},".cm-lineNumbers":{fontSize:XV.fontSize,lineHeight:XV.lineHeight},".cm-foldGutter":{fontSize:XV.fontSize,lineHeight:XV.lineHeight},".cm-foldGutter .cm-gutterElement":{color:oH,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:iH},".cm-insertedLine":{textDecoration:YV.insertedTextDecoration,backgroundColor:SH,color:wH,padding:YV.insertedLinePadding,borderRadius:YV.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:YV.insertedTextDecoration,backgroundColor:`${SH} !important`,color:wH,padding:YV.insertedLinePadding,borderRadius:YV.borderRadious,border:`1px solid ${wH}30`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:YV.deletedTextDecoration,backgroundColor:CH,color:TH,padding:YV.insertedLinePadding,borderRadius:YV.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:YV.deletedTextDecoration,backgroundColor:`${CH} !important`,color:TH,padding:YV.insertedLinePadding,borderRadius:YV.borderRadious,border:`1px solid ${TH}30`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:_H,border:`1px solid ${hH}`,borderRadius:nH.borderRadius,padding:nH.padding,boxShadow:`0 1px 5px rgba(0, 0, 0, 0.1)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:_H,border:`none`},"& > ul > li":{padding:nH.padding,lineHeight:nH.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#0366d630`,color:iH,borderRadius:nH.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:`#0366d615`},"& > ul > li > span.cm-completionIcon":{color:oH,paddingRight:nH.paddingRight},"& > ul > li > span.cm-completionDetail":{color:oH,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:_H,borderBottomColor:_H},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${gH}`},"&-warning":{borderLeft:`3px solid ${yH}`},"&-info":{borderLeft:`3px solid ${xH}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${gH}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${yH}`},".cm-matchingBracket":{backgroundColor:Tke,outline:`1px solid ${Eke}80`,borderRadius:QV.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#ffeef080`,outline:`1px solid ${gH}`,borderRadius:QV.borderRadius},".cm-selectionMatch":{backgroundColor:bH,outline:`1px solid ${aH}50`,borderRadius:QV.borderRadius},".cm-foldPlaceholder":{backgroundColor:bH,color:oH,border:`1px dotted ${hH}70`,borderRadius:$V.borderRadius,padding:$V.padding,margin:$V.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${rH}, 0 0 0 3px ${xH}40`},"& .cm-scroller::-webkit-scrollbar":{width:eH.width,height:eH.height},"& .cm-scroller::-webkit-scrollbar-track":{background:hH},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:iH,borderRadius:eH.borderRadius,border:`3px solid ${hH}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:cH},".cm-ghostText":{opacity:`0.5`,color:`#959da5`}},{dark:!1}),Ft(Yt.define([{tag:z.keyword,color:dH,fontWeight:`bold`},{tag:z.controlKeyword,color:dH,fontWeight:`bold`},{tag:z.moduleKeyword,color:dH,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:uH},{tag:[z.variableName],color:uH},{tag:[z.propertyName],color:lH,fontStyle:`normal`},{tag:[z.typeName],color:dH},{tag:[z.className],color:lH,fontStyle:`italic`},{tag:[z.namespace],color:uH,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:iH},{tag:[z.bracket],color:cH},{tag:[z.brace],color:cH},{tag:[z.punctuation],color:cH},{tag:[z.function(z.variableName),z.labelName],color:pH},{tag:[z.definition(z.variableName)],color:uH},{tag:z.number,color:mH},{tag:z.changed,color:mH},{tag:z.annotation,color:gH,fontStyle:`italic`},{tag:z.modifier,color:mH,fontStyle:`italic`},{tag:z.self,color:mH},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:mH},{tag:[z.atom,z.bool,z.special(z.variableName)],color:mH},{tag:[z.processingInstruction,z.inserted],color:pH},{tag:[z.special(z.string),z.regexp],color:fH},{tag:z.string,color:fH},{tag:z.definition(z.typeName),color:dH,fontWeight:`bold`},{tag:z.meta,color:cH},{tag:z.comment,fontStyle:`italic`,color:cH},{tag:z.docComment,fontStyle:`italic`,color:cH},{tag:[z.tagName],color:bke},{tag:[z.attributeName],color:lH},{tag:[z.heading],fontWeight:`bold`,color:uH},{tag:[z.strong],fontWeight:`bold`,color:uH},{tag:[z.emphasis],fontStyle:`italic`,color:fH},{tag:[z.link],color:Dke,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:xH,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:iH,textDecoration:`underline wavy`,borderBottom:`1px wavy ${gH}`},{tag:[z.strikethrough],color:gH,textDecoration:`line-through`},{tag:z.constant(z.name),color:mH},{tag:z.deleted,color:gH},{tag:z.squareBracket,color:cH},{tag:z.angleBracket,color:cH},{tag:z.monospace,color:iH},{tag:[z.contentSeparator],color:uH},{tag:z.quote,color:cH}]))],DH={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},Oke={borderLeftWidth:`2px`},OH={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},kH={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},AH={border:`none`,borderRadius:`4px`,padding:`2px 10px`},kke={borderRadius:`2px`},jH={borderRadius:`2px`},MH={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},NH={width:`12px`,height:`12px`,borderRadius:`6px`},PH={borderRadius:`4px`,padding:`2px 6px`},FH={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},IH=`#282828`,LH=`#3c3836`,RH=`#504945`,zH=`#665c54`,Ake=`#7c6f64`,BH=`#928374`,VH=`#fbf1c7`,HH=`#ebdbb2`,UH=`#fb4934`,WH=`#b8bb26`,GH=`#fabd2f`,KH=`#83a598`,qH=`#d3869b`,JH=`#8ec07c`,YH=`#fe8019`,XH=UH,jke=LH,Mke=`#3c383660`,Nke=IH,ZH=LH,QH=RH,Pke=`#665c5480`,$H=YH,Fke=`#504945cc`,Ike=GH,eU=GH,tU=KH,Lke=qH,nU=`#32361a80`,rU=`#3c1f1e80`,iU=`#b8bb26`,aU=`#fb4934`,Rke=[Ut.theme({"&":{color:HH,backgroundColor:Nke,fontSize:DH.fontSize,fontFamily:DH.fontFamily},".cm-content":{caretColor:$H,lineHeight:DH.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:$H,borderLeftWidth:Oke.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${$H}99`,color:IH},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:QH},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#b57614cc`,outline:`1px solid ${GH}`,color:VH,borderRadius:PH.borderRadius,"& span":{color:VH}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:YH,color:IH,padding:PH.padding,"& span":{color:IH}},".cm-search.cm-panel.cm-textfield":{color:HH,borderRadius:PH.borderRadius,padding:PH.padding},".cm-panels":{backgroundColor:ZH,color:HH,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${zH}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${zH}`},".cm-panel button":{backgroundColor:ZH,color:HH,border:AH.border,borderRadius:AH.borderRadius,padding:AH.padding},".cm-panel button:hover":{backgroundColor:RH},".cm-activeLine":{backgroundColor:Mke,borderRadius:kke.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:LH,color:BH,border:kH.border,borderRight:`1px solid ${RH}`,paddingRight:kH.paddingRight},".cm-activeLineGutter":{backgroundColor:jke,color:HH,fontWeight:kH.fontWeight},".cm-lineNumbers":{fontSize:kH.fontSize,lineHeight:kH.lineHeight},".cm-foldGutter":{fontSize:kH.fontSize,lineHeight:kH.lineHeight},".cm-foldGutter .cm-gutterElement":{color:BH,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:HH},".cm-insertedLine":{textDecoration:OH.insertedTextDecoration,backgroundColor:nU,color:iU,padding:OH.insertedLinePadding,borderRadius:OH.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:OH.insertedTextDecoration,backgroundColor:`${nU} !important`,color:iU,padding:OH.insertedLinePadding,borderRadius:OH.borderRadious,border:`1px solid ${iU}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:OH.deletedTextDecoration,backgroundColor:rU,color:aU,padding:OH.insertedLinePadding,borderRadius:OH.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:OH.deletedTextDecoration,backgroundColor:`${rU} !important`,color:aU,padding:OH.insertedLinePadding,borderRadius:OH.borderRadious,border:`1px solid ${aU}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:ZH,border:`1px solid ${zH}`,borderRadius:FH.borderRadius,padding:FH.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:ZH,border:`none`},"& > ul > li":{padding:FH.padding,lineHeight:FH.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:QH,color:VH,borderRadius:FH.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:BH,paddingRight:FH.paddingRight},"& > ul > li > span.cm-completionDetail":{color:BH,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:ZH,borderBottomColor:ZH},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${XH}`},"&-warning":{borderLeft:`3px solid ${eU}`},"&-info":{borderLeft:`3px solid ${tU}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${XH}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${eU}`},".cm-matchingBracket":{backgroundColor:Fke,outline:`1px solid ${Ike}`,borderRadius:jH.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#cc241d55`,outline:`1px solid ${XH}`,borderRadius:jH.borderRadius},".cm-selectionMatch":{backgroundColor:Pke,outline:`1px solid ${zH}`,borderRadius:jH.borderRadius},".cm-foldPlaceholder":{backgroundColor:ZH,color:BH,border:`1px dotted ${zH}`,borderRadius:MH.borderRadius,padding:MH.padding,margin:MH.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${IH}, 0 0 0 3px ${YH}40`},"& .cm-scroller::-webkit-scrollbar":{width:NH.width,height:NH.height},"& .cm-scroller::-webkit-scrollbar-track":{background:LH},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:zH,borderRadius:NH.borderRadius,border:`3px solid ${LH}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:Ake},".cm-ghostText":{opacity:`0.5`,color:BH}},{dark:!0}),Ft(Yt.define([{tag:z.keyword,color:UH,fontWeight:`bold`},{tag:z.controlKeyword,color:UH,fontWeight:`bold`},{tag:z.moduleKeyword,color:UH,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:KH},{tag:[z.variableName],color:KH},{tag:[z.propertyName],color:JH,fontStyle:`normal`},{tag:[z.typeName],color:JH},{tag:[z.className],color:GH,fontStyle:`italic`},{tag:[z.namespace],color:KH,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:HH},{tag:[z.bracket],color:BH},{tag:[z.brace],color:BH},{tag:[z.punctuation],color:BH},{tag:[z.function(z.variableName),z.labelName],color:GH},{tag:[z.definition(z.variableName)],color:KH},{tag:z.number,color:qH},{tag:z.changed,color:qH},{tag:z.annotation,color:XH,fontStyle:`italic`},{tag:z.modifier,color:qH,fontStyle:`italic`},{tag:z.self,color:qH},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:YH},{tag:[z.atom,z.bool,z.special(z.variableName)],color:YH},{tag:[z.processingInstruction,z.inserted],color:WH},{tag:[z.special(z.string),z.regexp],color:WH},{tag:z.string,color:WH},{tag:z.definition(z.typeName),color:JH,fontWeight:`bold`},{tag:z.meta,color:BH},{tag:z.comment,fontStyle:`italic`,color:BH},{tag:z.docComment,fontStyle:`italic`,color:BH},{tag:[z.tagName],color:UH},{tag:[z.attributeName],color:GH},{tag:[z.heading],fontWeight:`bold`,color:GH},{tag:[z.strong],fontWeight:`bold`,color:GH},{tag:[z.emphasis],fontStyle:`italic`,color:WH},{tag:[z.link],color:Lke,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:tU,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:HH,textDecoration:`underline wavy`,borderBottom:`1px wavy ${XH}`},{tag:[z.strikethrough],color:XH,textDecoration:`line-through`},{tag:z.constant(z.name),color:YH},{tag:z.deleted,color:XH},{tag:z.squareBracket,color:BH},{tag:z.angleBracket,color:BH},{tag:z.monospace,color:HH},{tag:[z.contentSeparator],color:KH},{tag:z.quote,color:BH}]))],oU={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},zke={borderLeftWidth:`2px`},sU={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},cU={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},lU={border:`none`,borderRadius:`4px`,padding:`2px 10px`},Bke={borderRadius:`2px`},uU={borderRadius:`2px`},dU={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},fU={width:`12px`,height:`12px`,borderRadius:`6px`},pU={borderRadius:`4px`,padding:`2px 6px`},mU={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},hU=`#3c3836`,Vke=`#504945`,Hke=`#665c54`,gU=`#7c6f64`,_U=`#928374`,vU=`#fbf1c7`,yU=`#ebdbb2`,bU=`#d5c4a1`,xU=`#bdae93`,Uke=`#a89984`,SU=`#9d0006`,CU=`#79740e`,wU=`#b57614`,TU=`#076678`,EU=`#8f3f71`,DU=`#427b58`,OU=`#af3a03`,kU=SU,Wke=yU,Gke=`#ffc42e25`,Kke=vU,AU=yU,qke=Wke,Jke=`#ffc42e40`,jU=OU,Yke=`#d5c4a180`,Xke=OU,MU=wU,NU=TU,Zke=EU,PU=`#d8e5bc80`,FU=`#f7cfcf80`,IU=`#79740e`,LU=`#9d0006`,Qke=[Ut.theme({"&":{color:hU,backgroundColor:Kke,fontSize:oU.fontSize,fontFamily:oU.fontFamily},".cm-content":{caretColor:jU,lineHeight:oU.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:jU,borderLeftWidth:zke.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${jU}99`,color:vU},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:qke,color:hU},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#ffc42e80`,outline:`1px solid ${OU}`,color:hU,borderRadius:pU.borderRadius,"& span":{color:hU}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:OU,color:vU,padding:pU.padding,"& span":{color:vU}},".cm-search.cm-panel.cm-textfield":{color:hU,borderRadius:pU.borderRadius,padding:pU.padding},".cm-panels":{backgroundColor:yU,color:Vke,borderRadius:`0 0 4px 4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${xU}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${xU}`},".cm-panel button":{backgroundColor:vU,color:hU,border:lU.border,borderRadius:lU.borderRadius,padding:lU.padding},".cm-panel button:hover":{backgroundColor:bU},".cm-activeLine":{backgroundColor:Gke,borderRadius:Bke.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:yU,color:gU,border:cU.border,borderRight:`1px solid ${xU}`,paddingRight:cU.paddingRight},".cm-activeLineGutter":{backgroundColor:bU,color:hU,fontWeight:cU.fontWeight},".cm-lineNumbers":{fontSize:cU.fontSize,lineHeight:cU.lineHeight},".cm-foldGutter":{fontSize:cU.fontSize,lineHeight:cU.lineHeight},".cm-foldGutter .cm-gutterElement":{color:gU,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:hU},".cm-insertedLine":{textDecoration:sU.insertedTextDecoration,backgroundColor:PU,color:IU,padding:sU.insertedLinePadding,borderRadius:sU.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:sU.insertedTextDecoration,backgroundColor:`${PU} !important`,color:IU,padding:sU.insertedLinePadding,borderRadius:sU.borderRadious,border:`1px solid ${IU}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:sU.deletedTextDecoration,backgroundColor:FU,color:LU,padding:sU.insertedLinePadding,borderRadius:sU.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:sU.deletedTextDecoration,backgroundColor:`${FU} !important`,color:LU,padding:sU.insertedLinePadding,borderRadius:sU.borderRadious,border:`1px solid ${LU}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:AU,border:`1px solid ${xU}`,borderRadius:mU.borderRadius,padding:mU.padding,boxShadow:`0 1px 5px rgba(0, 0, 0, 0.1)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:AU,border:`none`},"& > ul > li":{padding:mU.padding,lineHeight:mU.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:OU+`30`,color:hU,borderRadius:mU.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:OU+`15`},"& > ul > li > span.cm-completionIcon":{color:gU,paddingRight:mU.paddingRight},"& > ul > li > span.cm-completionDetail":{color:gU,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:AU,borderBottomColor:AU},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${kU}`},"&-warning":{borderLeft:`3px solid ${MU}`},"&-info":{borderLeft:`3px solid ${NU}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${kU}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${MU}`},".cm-matchingBracket":{backgroundColor:Yke,outline:`1px solid ${Xke}`,borderRadius:uU.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#fb492740`,outline:`1px solid ${kU}`,borderRadius:uU.borderRadius},".cm-selectionMatch":{backgroundColor:Jke,outline:`1px solid ${xU}`,borderRadius:uU.borderRadius},".cm-foldPlaceholder":{backgroundColor:`transparent`,color:Hke,border:`1px dotted ${xU}`,borderRadius:dU.borderRadius,padding:dU.padding,margin:dU.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${vU}, 0 0 0 3px ${OU}40`},"& .cm-scroller::-webkit-scrollbar":{width:fU.width,height:fU.height},"& .cm-scroller::-webkit-scrollbar-track":{background:vU},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:xU,borderRadius:fU.borderRadius,border:`3px solid ${vU}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:Uke},".cm-ghostText":{opacity:`0.5`,color:_U}},{dark:!1}),Ft(Yt.define([{tag:z.keyword,color:SU,fontWeight:`bold`},{tag:z.controlKeyword,color:SU,fontWeight:`bold`},{tag:z.moduleKeyword,color:SU,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:TU},{tag:[z.variableName],color:TU},{tag:[z.propertyName],color:DU,fontStyle:`normal`},{tag:[z.typeName],color:DU},{tag:[z.className],color:wU,fontStyle:`italic`},{tag:[z.namespace],color:TU,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:hU},{tag:[z.bracket],color:_U},{tag:[z.brace],color:_U},{tag:[z.punctuation],color:_U},{tag:[z.function(z.variableName),z.labelName],color:wU},{tag:[z.definition(z.variableName)],color:TU},{tag:z.number,color:EU},{tag:z.changed,color:EU},{tag:z.annotation,color:kU,fontStyle:`italic`},{tag:z.modifier,color:EU,fontStyle:`italic`},{tag:z.self,color:EU},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:OU},{tag:[z.atom,z.bool,z.special(z.variableName)],color:OU},{tag:[z.processingInstruction,z.inserted],color:CU},{tag:[z.special(z.string),z.regexp],color:CU},{tag:z.string,color:CU},{tag:z.definition(z.typeName),color:DU,fontWeight:`bold`},{tag:z.meta,color:_U},{tag:z.comment,fontStyle:`italic`,color:_U},{tag:z.docComment,fontStyle:`italic`,color:_U},{tag:[z.tagName],color:SU},{tag:[z.attributeName],color:wU},{tag:[z.heading],fontWeight:`bold`,color:wU},{tag:[z.strong],fontWeight:`bold`,color:wU},{tag:[z.emphasis],fontStyle:`italic`,color:CU},{tag:[z.link],color:Zke,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:NU,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:hU,textDecoration:`underline wavy`,borderBottom:`1px wavy ${kU}`},{tag:[z.strikethrough],color:kU,textDecoration:`line-through`},{tag:z.constant(z.name),color:OU},{tag:z.deleted,color:kU},{tag:z.squareBracket,color:_U},{tag:z.angleBracket,color:_U},{tag:z.monospace,color:hU},{tag:[z.contentSeparator],color:TU},{tag:z.quote,color:_U}]))],RU={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},$ke={borderLeftWidth:`2px`},zU={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},BU={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},VU={border:`none`,borderRadius:`4px`,padding:`2px 10px`},eAe={borderRadius:`2px`},HU={borderRadius:`2px`},UU={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},WU={width:`12px`,height:`12px`,borderRadius:`6px`},GU={borderRadius:`4px`,padding:`2px 6px`},KU={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},qU=`#212121`,JU=`#505d64`,YU=`#606f7a`,XU=`#707d8b`,tAe=`#a0a4ae`,ZU=`#bdbdbd`,QU=`#e0e0e0`,nAe=`#202325`,$U=`#ff5f52`,eW=`#ff6e40`,rAe=`#fa5788`,tW=`#facf4e`,nW=`#ffad42`,rW=`#56c8d8`,iW=`#7186f0`,aW=`#cf6edf`,iAe=`#6abf69`,aAe=`#99d066`,oAe=`#4ebaaa`,oW=$U,sW=nAe,sAe=`#2d333b30`,cW=qU,lW=JU,uW=`#ffffff1f`,cAe=`#4A707A80`,dW=tAe,lAe=`#39496650`,uAe=rW,fW=nW,pW=rW,dAe=aW,mW=`#1e3d2780`,hW=`#4e282880`,gW=`#6abf69`,_W=`#ff5f52`,fAe=[Ut.theme({"&":{color:ZU,backgroundColor:cW,fontSize:RU.fontSize,fontFamily:RU.fontFamily},".cm-content":{caretColor:dW,lineHeight:RU.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:dW,borderLeftWidth:$ke.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${dW}99`,color:cW},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:uW},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#394966cc`,outline:`1px solid ${rW}`,color:QU,borderRadius:GU.borderRadius,"& span":{color:QU}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:rW,color:cW,padding:GU.padding,"& span":{color:cW}},".cm-search.cm-panel.cm-textfield":{color:ZU,borderRadius:GU.borderRadius,padding:GU.padding},".cm-panels":{backgroundColor:qU,color:ZU,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${XU}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${XU}`},".cm-panel button":{backgroundColor:lW,color:ZU,border:VU.border,borderRadius:VU.borderRadius,padding:VU.padding},".cm-panel button:hover":{backgroundColor:YU},".cm-activeLine":{backgroundColor:sAe,borderRadius:eAe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:sW,color:XU,border:BU.border,borderRight:`1px solid ${JU}`,paddingRight:BU.paddingRight},".cm-activeLineGutter":{backgroundColor:`#252a2c`,color:ZU,fontWeight:BU.fontWeight},".cm-lineNumbers":{fontSize:BU.fontSize,lineHeight:BU.lineHeight},".cm-foldGutter":{fontSize:BU.fontSize,lineHeight:BU.lineHeight},".cm-foldGutter .cm-gutterElement":{color:XU,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:ZU},".cm-insertedLine":{textDecoration:zU.insertedTextDecoration,backgroundColor:mW,color:gW,padding:zU.insertedLinePadding,borderRadius:zU.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:zU.insertedTextDecoration,backgroundColor:`${mW} !important`,color:gW,padding:zU.insertedLinePadding,borderRadius:zU.borderRadious,border:`1px solid ${gW}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:zU.deletedTextDecoration,backgroundColor:hW,color:_W,padding:zU.insertedLinePadding,borderRadius:zU.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:zU.deletedTextDecoration,backgroundColor:`${hW} !important`,color:_W,padding:zU.insertedLinePadding,borderRadius:zU.borderRadious,border:`1px solid ${_W}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:lW,border:`1px solid ${XU}`,borderRadius:KU.borderRadius,padding:KU.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:lW,border:`none`},"& > ul > li":{padding:KU.padding,lineHeight:KU.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:uW,color:QU,borderRadius:KU.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:XU,paddingRight:KU.paddingRight},"& > ul > li > span.cm-completionDetail":{color:XU,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:lW,borderBottomColor:lW},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${oW}`},"&-warning":{borderLeft:`3px solid ${fW}`},"&-info":{borderLeft:`3px solid ${pW}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${oW}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${fW}`},".cm-matchingBracket":{backgroundColor:lAe,outline:`1px solid ${uAe}`,borderRadius:HU.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#ff5f5240`,outline:`1px solid ${oW}`,borderRadius:HU.borderRadius},".cm-selectionMatch":{backgroundColor:cAe,outline:`1px solid ${YU}50`,borderRadius:HU.borderRadius},".cm-foldPlaceholder":{backgroundColor:lW,color:XU,border:`1px dotted ${XU}70`,borderRadius:UU.borderRadius,padding:UU.padding,margin:UU.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${cW}, 0 0 0 3px ${rW}40`},"& .cm-scroller::-webkit-scrollbar":{width:WU.width,height:WU.height},"& .cm-scroller::-webkit-scrollbar-track":{background:sW},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:YU,borderRadius:WU.borderRadius,border:`3px solid ${sW}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:XU},".cm-ghostText":{opacity:`0.5`,color:XU}},{dark:!0}),Ft(Yt.define([{tag:z.keyword,color:$U,fontWeight:`bold`},{tag:z.controlKeyword,color:$U,fontWeight:`bold`},{tag:z.moduleKeyword,color:$U,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:iW},{tag:[z.variableName],color:aAe},{tag:[z.propertyName],color:aW,fontStyle:`normal`},{tag:[z.typeName],color:$U},{tag:[z.className],color:tW,fontStyle:`italic`},{tag:[z.namespace],color:iW,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:ZU},{tag:[z.bracket],color:XU},{tag:[z.brace],color:XU},{tag:[z.punctuation],color:XU},{tag:[z.function(z.variableName)],color:rW},{tag:[z.labelName],color:rW,fontStyle:`italic`},{tag:[z.definition(z.function(z.variableName))],color:rW},{tag:[z.definition(z.variableName)],color:iW},{tag:z.number,color:tW},{tag:z.changed,color:tW},{tag:z.annotation,color:oW,fontStyle:`italic`},{tag:z.modifier,color:eW,fontStyle:`italic`},{tag:z.self,color:eW},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:eW},{tag:[z.atom,z.bool,z.special(z.variableName)],color:eW},{tag:[z.processingInstruction,z.inserted],color:iAe},{tag:[z.special(z.string),z.regexp],color:rAe},{tag:z.string,color:nW},{tag:z.definition(z.typeName),color:$U,fontWeight:`bold`},{tag:z.meta,color:XU},{tag:z.comment,fontStyle:`italic`,color:XU},{tag:z.docComment,fontStyle:`italic`,color:XU},{tag:[z.tagName],color:aW},{tag:[z.attributeName],color:tW},{tag:[z.heading],fontWeight:`bold`,color:oAe},{tag:z.heading1,color:tW},{tag:z.heading2,color:nW},{tag:z.heading3,color:rW},{tag:z.heading4,color:iW},{tag:z.heading5,color:aW},{tag:z.heading6,color:$U},{tag:[z.strong],fontWeight:`bold`,color:iW},{tag:[z.emphasis],fontStyle:`italic`,color:nW},{tag:[z.link],color:dAe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:pW,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:ZU,textDecoration:`underline wavy`,borderBottom:`1px wavy ${oW}`},{tag:[z.strikethrough],color:oW,textDecoration:`line-through`},{tag:z.constant(z.name),color:eW},{tag:z.deleted,color:oW},{tag:z.squareBracket,color:XU},{tag:z.angleBracket,color:XU},{tag:z.monospace,color:ZU},{tag:[z.contentSeparator],color:iW},{tag:z.quote,color:XU}]))],vW={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},pAe={borderLeftWidth:`2px`},yW={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},bW={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},xW={border:`none`,borderRadius:`4px`,padding:`2px 10px`},mAe={borderRadius:`2px`},SW={borderRadius:`2px`},CW={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},wW={width:`12px`,height:`12px`,borderRadius:`6px`},TW={borderRadius:`4px`,padding:`2px 6px`},EW={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},hAe=`#ffffff`,DW=`#f5f5f5`,OW=`#212121`,kW=`#757575`,AW=`#9e9e9e`,jW=`#424242`,gAe=`#eeeeee`,MW=`#fafafa`,NW=`#f44336`,PW=`#ff3e00`,FW=`#FF00E9FF`,_Ae=`#ffc107`,IW=`#ff9800`,LW=`#00acc1`,RW=`#3949ab`,zW=`#8e24aa`,BW=`#43a047`,VW=`#00897b`,HW=`#1e88e5`,UW=NW,vAe=`#00000008`,WW=hAe,GW=DW,yAe=`#DDEEFF`,bAe=`#90a4ae26`,KW=AW,xAe=`#DDEEFF80`,SAe=LW,qW=IW,JW=LW,CAe=zW,YW=`#ECEFF180`,XW=`#e6ffed80`,ZW=`#ffebe980`,QW=`#28a745`,$W=`#d73a49`,wAe=[Ut.theme({"&":{color:OW,backgroundColor:WW,fontSize:vW.fontSize,fontFamily:vW.fontFamily},".cm-content":{caretColor:KW,lineHeight:vW.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:KW,borderLeftWidth:pAe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${OW}99`,color:WW},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:yAe},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#FFA72680`,outline:`1px solid ${_Ae}`,color:OW,borderRadius:TW.borderRadius,"& span":{color:OW}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:LW,color:WW,padding:TW.padding,"& span":{color:WW}},".cm-search.cm-panel.cm-textfield":{color:OW,borderRadius:TW.borderRadius,padding:TW.padding},".cm-panels":{backgroundColor:gAe,color:OW,borderRadius:`4px`,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${AW}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${AW}`},".cm-panel button":{backgroundColor:GW,color:OW,border:xW.border,borderRadius:xW.borderRadius,padding:xW.padding},".cm-panel button:hover":{backgroundColor:`#CFD8DC`},".cm-activeLine":{backgroundColor:vAe,borderRadius:mAe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:MW,color:kW,border:bW.border,borderRight:`1px solid ${AW}`,paddingRight:bW.paddingRight},".cm-activeLineGutter":{backgroundColor:`#E0E0E0`,color:OW,fontWeight:bW.fontWeight},".cm-lineNumbers":{fontSize:bW.fontSize,lineHeight:bW.lineHeight},".cm-foldGutter":{fontSize:bW.fontSize,lineHeight:bW.lineHeight},".cm-foldGutter .cm-gutterElement":{color:kW,cursor:`pointer`,transition:`color 0.15s ease`},".cm-foldGutter .cm-gutterElement:hover":{color:OW},".cm-insertedLine":{textDecoration:yW.insertedTextDecoration,backgroundColor:XW,color:QW,padding:yW.insertedLinePadding,borderRadius:yW.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:yW.insertedTextDecoration,backgroundColor:`${XW} !important`,color:QW,padding:yW.insertedLinePadding,borderRadius:yW.borderRadious,border:`1px solid ${QW}30`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:yW.deletedTextDecoration,backgroundColor:ZW,color:$W,padding:yW.insertedLinePadding,borderRadius:yW.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:yW.deletedTextDecoration,backgroundColor:`${ZW} !important`,color:$W,padding:yW.insertedLinePadding,borderRadius:yW.borderRadious,border:`1px solid ${$W}30`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:GW,border:`1px solid ${AW}`,borderRadius:EW.borderRadius,padding:EW.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:GW,border:`none`},"& > ul > li":{padding:EW.padding,lineHeight:EW.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:YW,color:OW,borderRadius:EW.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:YW},"& > ul > li > span.cm-completionIcon":{color:kW,paddingRight:EW.paddingRight},"& > ul > li > span.cm-completionDetail":{color:kW,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:GW,borderBottomColor:GW},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${UW}`},"&-warning":{borderLeft:`3px solid ${qW}`},"&-info":{borderLeft:`3px solid ${JW}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${UW}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${qW}`},".cm-matchingBracket":{backgroundColor:xAe,outline:`1px solid ${SAe}`,borderRadius:SW.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${UW}20`,outline:`1px solid ${UW}`,borderRadius:SW.borderRadius},".cm-selectionMatch":{backgroundColor:bAe,outline:`1px solid ${kW}30`,borderRadius:SW.borderRadius},".cm-foldPlaceholder":{backgroundColor:DW,color:kW,border:`1px dotted ${kW}70`,borderRadius:CW.borderRadius,padding:CW.padding,margin:CW.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${WW}, 0 0 0 3px ${LW}40`},"& .cm-scroller::-webkit-scrollbar":{width:wW.width,height:wW.height},"& .cm-scroller::-webkit-scrollbar-track":{background:MW},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:kW,borderRadius:wW.borderRadius,border:`3px solid ${MW}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:OW},".cm-ghostText":{opacity:`0.5`,color:kW}},{dark:!1}),Ft(Yt.define([{tag:z.keyword,color:LW,fontWeight:`bold`},{tag:z.controlKeyword,color:LW,fontWeight:`bold`},{tag:z.moduleKeyword,color:LW,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:jW},{tag:[z.variableName],color:jW},{tag:[z.propertyName],color:VW,fontStyle:`normal`},{tag:[z.typeName],color:IW},{tag:[z.className],color:IW,fontStyle:`italic`},{tag:[z.namespace],color:RW,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:RW},{tag:[z.bracket],color:zW},{tag:[z.brace],color:zW},{tag:[z.punctuation],color:kW},{tag:[z.function(z.variableName)],color:PW},{tag:[z.labelName],color:HW,fontStyle:`italic`},{tag:[z.definition(z.function(z.variableName))],color:PW},{tag:[z.definition(z.variableName)],color:FW},{tag:z.number,color:IW},{tag:z.changed,color:IW},{tag:z.annotation,color:UW,fontStyle:`italic`},{tag:z.modifier,color:IW,fontStyle:`italic`},{tag:z.self,color:IW},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:IW},{tag:[z.atom,z.bool],color:zW},{tag:[z.processingInstruction,z.inserted],color:BW},{tag:z.string,color:BW},{tag:[z.special(z.string),z.regexp],color:FW},{tag:z.definition(z.typeName),color:FW,fontWeight:`bold`},{tag:[z.definition(z.name),z.separator],color:FW},{tag:z.meta,color:kW},{tag:z.comment,fontStyle:`italic`,color:kW},{tag:z.docComment,fontStyle:`italic`,color:kW},{tag:[z.tagName],color:PW},{tag:[z.attributeName],color:jW},{tag:[z.heading],fontWeight:`bold`,color:VW},{tag:z.heading1,color:HW},{tag:z.heading2,color:IW},{tag:z.heading3,color:LW},{tag:z.heading4,color:RW},{tag:z.heading5,color:zW},{tag:z.heading6,color:BW},{tag:[z.strong],fontWeight:`bold`,color:RW},{tag:[z.emphasis],fontStyle:`italic`,color:IW},{tag:[z.link],color:CAe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:JW,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:OW,textDecoration:`underline wavy`,borderBottom:`1px dotted ${NW}`},{tag:[z.strikethrough],color:UW,textDecoration:`line-through`},{tag:z.constant(z.name),color:PW},{tag:z.deleted,color:UW},{tag:z.squareBracket,color:NW},{tag:z.angleBracket,color:OW},{tag:z.monospace,color:OW},{tag:[z.contentSeparator],color:LW},{tag:z.quote,color:BW}]))],eG={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},TAe={borderLeftWidth:`2px`},tG={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},nG={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},rG={border:`none`,borderRadius:`4px`,padding:`2px 10px`},EAe={borderRadius:`2px`},iG={borderRadius:`2px`},aG={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},oG={width:`12px`,height:`12px`,borderRadius:`6px`},sG={borderRadius:`4px`,padding:`2px 6px`},cG={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},lG=`#272822`,uG=`#f8f8f2`,dG=`#88846f`,DAe=`#f8f8f0`,fG=`#F92672`,pG=`#FD971F`,mG=`#66D9EF`,hG=`#E6DB74`,gG=`#AE81FF`,_G=`#A6E22E`,vG=`#F44747`,yG=`#414339`,OAe=`#3e3d3257`,bG=`#34352f`,xG=`#49483E`,kAe=`#75715e70`,SG=DAe,AAe=`#75715E55`,jAe=mG,CG=pG,wG=mG,MAe=gG,TG=`#3d4d3880`,EG=`#4d393980`,DG=`#A6E22E`,OG=`#F92672`,NAe=[Ut.theme({"&":{color:uG,backgroundColor:lG,fontSize:eG.fontSize,fontFamily:eG.fontFamily},".cm-content":{caretColor:SG,lineHeight:eG.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:SG,borderLeftWidth:TAe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${SG}99`,color:lG},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:xG},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#49483E99`,outline:`1px solid ${hG}`,color:uG,borderRadius:sG.borderRadius,"& span":{color:uG}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:fG,color:lG,padding:sG.padding,"& span":{color:lG}},".cm-search.cm-panel.cm-textfield":{color:uG,borderRadius:sG.borderRadius,padding:sG.padding},".cm-panels":{backgroundColor:yG,color:uG,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${dG}80`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${dG}80`},".cm-panel button":{backgroundColor:bG,color:uG,border:rG.border,borderRadius:rG.borderRadius,padding:rG.padding},".cm-panel button:hover":{backgroundColor:`#49483E`},".cm-activeLine":{backgroundColor:OAe,borderRadius:EAe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:yG,color:dG,border:nG.border,borderRight:`1px solid #3e3d32`,paddingRight:nG.paddingRight},".cm-activeLineGutter":{backgroundColor:`#35352c`,color:uG,fontWeight:nG.fontWeight},".cm-lineNumbers":{fontSize:nG.fontSize,lineHeight:nG.lineHeight},".cm-foldGutter":{fontSize:nG.fontSize,lineHeight:nG.lineHeight},".cm-foldGutter .cm-gutterElement":{color:dG,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:uG},".cm-insertedLine":{textDecoration:tG.insertedTextDecoration,backgroundColor:TG,color:DG,padding:tG.insertedLinePadding,borderRadius:tG.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:tG.insertedTextDecoration,backgroundColor:`${TG} !important`,color:DG,padding:tG.insertedLinePadding,borderRadius:tG.borderRadious,border:`1px solid ${DG}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:tG.deletedTextDecoration,backgroundColor:EG,color:OG,padding:tG.insertedLinePadding,borderRadius:tG.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:tG.deletedTextDecoration,backgroundColor:`${EG} !important`,color:OG,padding:tG.insertedLinePadding,borderRadius:tG.borderRadious,border:`1px solid ${OG}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:bG,border:`1px solid #49483E`,borderRadius:cG.borderRadius,padding:cG.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.4)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:bG,border:`none`},"& > ul > li":{padding:cG.padding,lineHeight:cG.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:xG,color:uG,borderRadius:cG.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:dG,paddingRight:cG.paddingRight},"& > ul > li > span.cm-completionDetail":{color:dG,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:bG,borderBottomColor:bG},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${vG}`},"&-warning":{borderLeft:`3px solid ${CG}`},"&-info":{borderLeft:`3px solid ${wG}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${vG}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${CG}`},".cm-matchingBracket":{backgroundColor:AAe,outline:`1px solid ${jAe}`,borderRadius:iG.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#f9267240`,outline:`1px solid ${vG}`,borderRadius:iG.borderRadius},".cm-selectionMatch":{backgroundColor:kAe,outline:`1px solid ${dG}50`,borderRadius:iG.borderRadius},".cm-foldPlaceholder":{backgroundColor:bG,color:dG,border:`1px dotted ${dG}70`,borderRadius:aG.borderRadius,padding:aG.padding,margin:aG.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${lG}, 0 0 0 3px ${mG}40`},"& .cm-scroller::-webkit-scrollbar":{width:oG.width,height:oG.height},"& .cm-scroller::-webkit-scrollbar-track":{background:yG},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#49483E`,borderRadius:oG.borderRadius,border:`3px solid ${yG}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#5a594d`},".cm-ghostText":{opacity:`0.5`,color:dG}},{dark:!0}),Ft(Yt.define([{tag:z.keyword,color:fG,fontWeight:`bold`},{tag:z.controlKeyword,color:fG,fontWeight:`bold`},{tag:z.moduleKeyword,color:fG,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:pG},{tag:[z.variableName],color:pG},{tag:[z.propertyName],color:_G,fontStyle:`normal`},{tag:[z.typeName],color:mG,fontStyle:`italic`},{tag:[z.className],color:_G,fontStyle:`italic`},{tag:[z.namespace],color:pG,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:fG},{tag:[z.bracket],color:uG},{tag:[z.brace],color:uG},{tag:[z.punctuation],color:uG},{tag:[z.function(z.variableName),z.labelName],color:mG},{tag:[z.definition(z.function(z.variableName))],color:mG},{tag:[z.definition(z.variableName)],color:pG},{tag:z.number,color:gG},{tag:z.changed,color:gG},{tag:z.annotation,color:vG,fontStyle:`italic`},{tag:z.modifier,color:gG,fontStyle:`italic`},{tag:z.self,color:gG},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:gG},{tag:[z.atom,z.bool,z.special(z.variableName)],color:gG},{tag:[z.processingInstruction,z.inserted],color:_G},{tag:[z.special(z.string),z.regexp],color:hG},{tag:z.string,color:hG},{tag:z.definition(z.typeName),color:mG,fontWeight:`bold`},{tag:z.meta,color:dG},{tag:z.comment,fontStyle:`italic`,color:dG},{tag:z.docComment,fontStyle:`italic`,color:dG},{tag:[z.tagName],color:fG},{tag:[z.attributeName],color:_G},{tag:[z.heading],fontWeight:`bold`,color:_G},{tag:[z.strong],fontWeight:`bold`,color:pG},{tag:[z.emphasis],fontStyle:`italic`,color:pG},{tag:[z.link],color:MAe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:wG,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:uG,textDecoration:`underline wavy`,borderBottom:`1px wavy ${vG}`},{tag:[z.strikethrough],color:vG,textDecoration:`line-through`},{tag:z.constant(z.name),color:gG},{tag:z.deleted,color:vG},{tag:z.squareBracket,color:uG},{tag:z.angleBracket,color:uG},{tag:z.monospace,color:uG},{tag:[z.contentSeparator],color:pG},{tag:z.quote,color:dG}]))],kG={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},PAe={borderLeftWidth:`2px`},AG={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},jG={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},MG={border:`none`,borderRadius:`4px`,padding:`2px 10px`},FAe={borderRadius:`2px`},NG={borderRadius:`2px`},PG={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},FG={width:`12px`,height:`12px`,borderRadius:`6px`},IG={borderRadius:`4px`,padding:`2px 6px`},LG={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},IAe=`#2e3440`,RG=`#3b4252`,zG=`#434c5e`,BG=`#4c566a`,VG=`#d8dee9`,HG=`#eceff4`,UG=`#8fbcbb`,WG=`#88c0d0`,GG=`#81a1c1`,KG=`#5e81ac`,qG=`#bf616a`,JG=`#d08770`,YG=`#ebcb8b`,XG=`#a3be8c`,ZG=`#b48ead`,LAe=`#d30102`,QG=`#252a33`,RAe=`#3b425277`,$G=IAe,eK=RG,zAe=zG,BAe=`#4c566a80`,tK=VG,VAe=`#4c566a55`,HAe=WG,nK=YG,rK=GG,UAe=ZG,iK=`#3b4a3880`,aK=`#4a393a80`,oK=`#a3be8c`,sK=`#bf616a`,WAe=[Ut.theme({"&":{color:VG,backgroundColor:$G,fontSize:kG.fontSize,fontFamily:kG.fontFamily},".cm-content":{caretColor:tK,lineHeight:kG.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:tK,borderLeftWidth:PAe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${tK}99`,color:$G},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:zAe},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#5e81ac80`,outline:`1px solid ${UG}`,color:VG,borderRadius:IG.borderRadius,"& span":{color:VG}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:GG,color:HG,padding:IG.padding,"& span":{color:HG}},".cm-search.cm-panel.cm-textfield":{color:VG,borderRadius:IG.borderRadius,padding:IG.padding},".cm-panels":{backgroundColor:QG,color:VG,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${BG}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${BG}`},".cm-panel button":{backgroundColor:eK,color:VG,border:MG.border,borderRadius:MG.borderRadius,padding:MG.padding},".cm-panel button:hover":{backgroundColor:zG},".cm-activeLine":{backgroundColor:RAe,borderRadius:FAe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:QG,color:BG,border:jG.border,borderRight:`1px solid ${zG}`,paddingRight:jG.paddingRight},".cm-activeLineGutter":{backgroundColor:RG,color:VG,fontWeight:jG.fontWeight},".cm-lineNumbers":{fontSize:jG.fontSize,lineHeight:jG.lineHeight},".cm-foldGutter":{fontSize:jG.fontSize,lineHeight:jG.lineHeight},".cm-foldGutter .cm-gutterElement":{color:BG,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:VG},".cm-insertedLine":{textDecoration:AG.insertedTextDecoration,backgroundColor:iK,color:oK,padding:AG.insertedLinePadding,borderRadius:AG.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:AG.insertedTextDecoration,backgroundColor:`${iK} !important`,color:oK,padding:AG.insertedLinePadding,borderRadius:AG.borderRadious,border:`1px solid ${oK}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:AG.deletedTextDecoration,backgroundColor:aK,color:sK,padding:AG.insertedLinePadding,borderRadius:AG.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:AG.deletedTextDecoration,backgroundColor:`${aK} !important`,color:sK,padding:AG.insertedLinePadding,borderRadius:AG.borderRadious,border:`1px solid ${sK}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:eK,border:`1px solid ${BG}`,borderRadius:LG.borderRadius,padding:LG.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:eK,border:`none`},"& > ul > li":{padding:LG.padding,lineHeight:LG.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:zG,color:HG,borderRadius:LG.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:BG,paddingRight:LG.paddingRight},"& > ul > li > span.cm-completionDetail":{color:BG,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:eK,borderBottomColor:eK},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${qG}`},"&-warning":{borderLeft:`3px solid ${nK}`},"&-info":{borderLeft:`3px solid ${rK}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${qG}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${nK}`},".cm-matchingBracket":{backgroundColor:VAe,outline:`1px solid ${HAe}`,borderRadius:NG.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${qG}40`,outline:`1px solid ${LAe}`,borderRadius:NG.borderRadius},".cm-selectionMatch":{backgroundColor:BAe,outline:`1px solid ${zG}50`,borderRadius:NG.borderRadius},".cm-foldPlaceholder":{backgroundColor:eK,color:BG,border:`1px dotted ${BG}70`,borderRadius:PG.borderRadius,padding:PG.padding,margin:PG.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${$G}, 0 0 0 3px ${WG}40`},"& .cm-scroller::-webkit-scrollbar":{width:FG.width,height:FG.height},"& .cm-scroller::-webkit-scrollbar-track":{background:QG},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:zG,borderRadius:FG.borderRadius,border:`3px solid ${QG}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:BG},".cm-ghostText":{opacity:`0.5`,color:BG}},{dark:!0}),Ft(Yt.define([{tag:z.keyword,color:KG,fontWeight:`bold`},{tag:z.controlKeyword,color:KG,fontWeight:`bold`},{tag:z.moduleKeyword,color:KG,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:WG},{tag:[z.variableName],color:VG},{tag:[z.propertyName],color:WG,fontStyle:`normal`},{tag:[z.typeName],color:YG},{tag:[z.className],color:YG,fontStyle:`italic`},{tag:[z.namespace],color:GG,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:ZG},{tag:[z.bracket],color:VG},{tag:[z.brace],color:UG},{tag:[z.punctuation],color:VG},{tag:[z.function(z.variableName),z.labelName],color:UG},{tag:[z.definition(z.function(z.variableName))],color:UG},{tag:[z.definition(z.variableName)],color:JG},{tag:z.number,color:JG},{tag:z.changed,color:ZG},{tag:z.annotation,color:qG,fontStyle:`italic`},{tag:z.modifier,color:ZG,fontStyle:`italic`},{tag:z.self,color:ZG},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:JG},{tag:[z.atom,z.bool,z.special(z.variableName)],color:ZG},{tag:[z.processingInstruction,z.inserted],color:UG},{tag:[z.special(z.string),z.regexp],color:ZG},{tag:z.string,color:XG},{tag:z.definition(z.typeName),color:YG,fontWeight:`bold`},{tag:[z.definition(z.name),z.separator],color:XG},{tag:z.meta,color:BG},{tag:z.comment,fontStyle:`italic`,color:BG},{tag:z.docComment,fontStyle:`italic`,color:BG},{tag:[z.tagName],color:qG},{tag:[z.attributeName],color:YG},{tag:[z.heading],fontWeight:`bold`,color:GG},{tag:[z.strong],fontWeight:`bold`,color:WG},{tag:[z.emphasis],fontStyle:`italic`,color:YG},{tag:[z.link],color:UAe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:rK,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:VG,textDecoration:`underline wavy`,borderBottom:`1px wavy ${qG}`},{tag:[z.strikethrough],color:qG,textDecoration:`line-through`},{tag:z.constant(z.name),color:JG},{tag:z.deleted,color:qG},{tag:z.squareBracket,color:qG},{tag:z.angleBracket,color:JG},{tag:z.monospace,color:VG,fontStyle:`italic`},{tag:[z.contentSeparator],color:GG},{tag:z.quote,color:ZG}]))],cK={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},GAe={borderLeftWidth:`2px`},lK={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},uK={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},dK={border:`none`,borderRadius:`4px`,padding:`2px 10px`},KAe={borderRadius:`2px`},fK={borderRadius:`2px`},pK={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},mK={width:`12px`,height:`12px`,borderRadius:`6px`},hK={borderRadius:`4px`,padding:`2px 6px`},gK={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},qAe=`#e1e2e7`,_K=`#3760bf`,vK=`#99a7df`,yK=`#848cb5`,JAe=`#8c91a8`,bK=`#3760bf`,xK=`#e9e9ec`,SK=`#d5d6db`,CK=`#f52a65`,wK=`#b15c00`,TK=`#8c6c3e`,EK=`#587539`,DK=`#007197`,OK=`#2e7de9`,kK=`#7847bd`,YAe=`#9854f1`,AK=CK,jK=SK,XAe=`#5F5FAF5A`,MK=qAe,NK=xK,PK=`#99a7df40`,ZAe=`#99a7df60`,FK=_K,QAe=`#0e639c20`,$Ae=DK,IK=wK,LK=DK,eje=kK,RK=`#58753920`,zK=`#f52a6520`,BK=`#587539`,VK=`#f52a65`,tje=[Ut.theme({"&":{color:bK,backgroundColor:MK,fontSize:cK.fontSize,fontFamily:cK.fontFamily},".cm-content":{caretColor:FK,lineHeight:cK.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:FK,borderLeftWidth:GAe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${FK}99`,color:MK},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:PK},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#0e639c40`,outline:`1px solid ${DK}`,color:bK,borderRadius:hK.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:DK,color:MK,padding:hK.padding,"& span":{color:MK}},".cm-search.cm-panel.cm-textfield":{color:bK,borderRadius:hK.borderRadius,padding:hK.padding},".cm-panels":{backgroundColor:xK,color:bK,borderRadius:`4px`,boxShadow:`0 1px 3px rgba(0, 0, 0, 0.1)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${yK}30`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${yK}30`},".cm-panel button":{backgroundColor:NK,color:bK,border:dK.border,borderRadius:dK.borderRadius,padding:dK.padding},".cm-panel button:hover":{backgroundColor:SK,border:`1px solid ${vK}`},".cm-activeLine":{backgroundColor:XAe,borderRadius:KAe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:jK,color:yK,border:uK.border,borderRight:`1px solid ${SK}`,paddingRight:uK.paddingRight},".cm-activeLineGutter":{color:_K,fontWeight:uK.fontWeight},".cm-lineNumbers":{fontSize:uK.fontSize,lineHeight:uK.lineHeight},".cm-foldGutter":{fontSize:uK.fontSize,lineHeight:uK.lineHeight},".cm-foldGutter .cm-gutterElement":{color:yK,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:_K},".cm-insertedLine":{textDecoration:lK.insertedTextDecoration,backgroundColor:RK,color:BK,padding:lK.insertedLinePadding,borderRadius:lK.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:lK.insertedTextDecoration,backgroundColor:`${RK} !important`,color:BK,padding:lK.insertedLinePadding,borderRadius:lK.borderRadious,border:`1px solid ${BK}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:lK.deletedTextDecoration,backgroundColor:zK,color:VK,padding:lK.insertedLinePadding,borderRadius:lK.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:lK.deletedTextDecoration,backgroundColor:`${zK} !important`,color:VK,padding:lK.insertedLinePadding,borderRadius:lK.borderRadious,border:`1px solid ${VK}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:NK,border:`1px solid ${JAe}40`,borderRadius:gK.borderRadius,padding:gK.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:NK,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:gK.padding,lineHeight:gK.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:PK,color:_K,borderRadius:gK.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:yK,paddingRight:gK.paddingRight},"& > ul > li > span.cm-completionDetail":{color:yK,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 ${AK}`},"&-warning":{borderLeft:`3px solid ${IK}`},"&-info":{borderLeft:`3px solid ${LK}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${AK}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${IK}`},".cm-matchingBracket":{backgroundColor:QAe,outline:`1px solid ${$Ae}`,borderRadius:fK.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${CK}20`,outline:`1px solid ${AK}`,borderRadius:fK.borderRadius},".cm-selectionMatch":{backgroundColor:ZAe,outline:`1px solid ${vK}50`,borderRadius:fK.borderRadius},".cm-foldPlaceholder":{backgroundColor:NK,color:yK,border:`1px dotted ${yK}70`,borderRadius:pK.borderRadius,padding:pK.padding,margin:pK.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${MK}, 0 0 0 3px ${DK}40`},"& .cm-scroller::-webkit-scrollbar":{width:mK.width,height:mK.height},"& .cm-scroller::-webkit-scrollbar-track":{background:jK},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:yK,borderRadius:mK.borderRadius,border:`3px solid ${jK}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:vK},".cm-ghostText":{opacity:`0.5`,color:yK}},{dark:!1}),Ft(Yt.define([{tag:z.keyword,color:DK,fontWeight:`bold`},{tag:z.controlKeyword,color:DK,fontWeight:`bold`},{tag:z.moduleKeyword,color:DK,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:OK},{tag:[z.variableName],color:_K},{tag:[z.propertyName],color:OK,fontStyle:`normal`},{tag:[z.typeName],color:DK},{tag:[z.className],color:TK,fontStyle:`italic`},{tag:[z.namespace],color:kK,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:kK},{tag:[z.bracket],color:yK},{tag:[z.brace],color:yK},{tag:[z.punctuation],color:yK},{tag:[z.function(z.variableName)],color:DK},{tag:[z.labelName],color:kK,fontStyle:`italic`},{tag:[z.definition(z.function(z.variableName))],color:DK},{tag:[z.definition(z.variableName)],color:OK},{tag:z.number,color:wK},{tag:z.changed,color:wK},{tag:z.annotation,color:AK,fontStyle:`italic`},{tag:z.modifier,color:wK,fontStyle:`italic`},{tag:z.self,color:wK},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:wK},{tag:[z.atom,z.bool,z.special(z.variableName)],color:wK},{tag:[z.processingInstruction,z.inserted],color:EK},{tag:[z.special(z.string),z.regexp],color:YAe},{tag:z.string,color:EK},{tag:z.definition(z.typeName),color:DK,fontWeight:`bold`},{tag:[z.definition(z.name),z.separator],color:OK},{tag:z.meta,color:yK},{tag:z.comment,fontStyle:`italic`,color:yK},{tag:z.docComment,fontStyle:`italic`,color:yK},{tag:[z.tagName],color:kK},{tag:[z.attributeName],color:TK},{tag:[z.heading],fontWeight:`bold`,color:wK},{tag:z.heading1,color:wK,fontWeight:`bold`},{tag:z.heading2,color:wK},{tag:z.heading3,color:wK},{tag:z.heading4,color:DK},{tag:z.heading5,color:DK},{tag:z.heading6,color:DK},{tag:[z.strong],fontWeight:`bold`,color:_K},{tag:[z.emphasis],fontStyle:`italic`,color:EK},{tag:[z.link],color:eje,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:LK,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:_K,textDecoration:`underline wavy`,borderBottom:`1px wavy ${AK}`},{tag:[z.strikethrough],color:AK,textDecoration:`line-through`},{tag:z.constant(z.name),color:wK},{tag:z.deleted,color:AK},{tag:z.squareBracket,color:yK},{tag:z.angleBracket,color:yK},{tag:z.monospace,color:_K},{tag:[z.contentSeparator],color:OK},{tag:z.quote,color:yK}]))],HK={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},nje={borderLeftWidth:`2px`},UK={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},WK={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},GK={border:`none`,borderRadius:`4px`,padding:`2px 10px`},rje={borderRadius:`2px`},KK={borderRadius:`2px`},qK={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},JK={width:`12px`,height:`12px`,borderRadius:`6px`},YK={borderRadius:`4px`,padding:`2px 6px`},XK={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},ije=`#24283b`,ZK=`#414868`,QK=`#565f89`,$K=`#c0caf5`,eq=`#282e44`,tq=`#1f2335`,aje=`#f7768e`,nq=`#ff9e64`,rq=`#e0af68`,iq=`#9ece6a`,aq=`#2ac3de`,oq=`#7aa2f7`,sq=`#bb9af7`,cq=`#f7768e`,lq=tq,oje=`#292e427a`,uq=ije,dq=eq,fq=`#6f7bb630`,sje=`#6f7bb650`,pq=$K,cje=`#3d59a150`,lje=oq,mq=nq,hq=aq,uje=sq,gq=`#3b4a3880`,_q=`#4a393a80`,vq=`#9ece6a`,yq=`#f7768e`,dje=[Ut.theme({"&":{color:$K,backgroundColor:uq,fontSize:HK.fontSize,fontFamily:HK.fontFamily},".cm-content":{caretColor:pq,lineHeight:HK.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:pq,borderLeftWidth:nje.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${pq}99`,color:uq},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:fq},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#7aa2f740`,outline:`1px solid ${oq}`,color:$K,borderRadius:YK.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:oq,color:uq,padding:YK.padding,"& span":{color:uq}},".cm-search.cm-panel.cm-textfield":{color:$K,borderRadius:YK.borderRadius,padding:YK.padding},".cm-panels":{backgroundColor:eq,color:$K,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${QK}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${QK}`},".cm-panel button":{backgroundColor:dq,color:$K,border:GK.border,borderRadius:GK.borderRadius,padding:GK.padding},".cm-panel button:hover":{backgroundColor:tq},".cm-activeLine":{backgroundColor:oje,borderRadius:rje.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:lq,color:QK,border:WK.border,borderRight:`1px solid ${tq}`,paddingRight:WK.paddingRight},".cm-activeLineGutter":{backgroundColor:tq,color:$K,fontWeight:WK.fontWeight},".cm-lineNumbers":{fontSize:WK.fontSize,lineHeight:WK.lineHeight},".cm-foldGutter":{fontSize:WK.fontSize,lineHeight:WK.lineHeight},".cm-foldGutter .cm-gutterElement":{color:QK,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:$K},".cm-insertedLine":{textDecoration:UK.insertedTextDecoration,backgroundColor:gq,color:vq,padding:UK.insertedLinePadding,borderRadius:UK.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:UK.insertedTextDecoration,backgroundColor:`${gq} !important`,color:vq,padding:UK.insertedLinePadding,borderRadius:UK.borderRadious,border:`1px solid ${vq}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:UK.deletedTextDecoration,backgroundColor:_q,color:yq,padding:UK.insertedLinePadding,borderRadius:UK.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:UK.deletedTextDecoration,backgroundColor:`${_q} !important`,color:yq,padding:UK.insertedLinePadding,borderRadius:UK.borderRadious,border:`1px solid ${yq}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:dq,border:`1px solid ${QK}`,borderRadius:XK.borderRadius,padding:XK.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:dq,border:`none`},"& > ul > li":{padding:XK.padding,lineHeight:XK.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:fq,color:$K,borderRadius:XK.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:QK,paddingRight:XK.paddingRight},"& > ul > li > span.cm-completionDetail":{color:QK,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:dq,borderBottomColor:dq},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${cq}`},"&-warning":{borderLeft:`3px solid ${mq}`},"&-info":{borderLeft:`3px solid ${hq}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${cq}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${mq}`},".cm-matchingBracket":{backgroundColor:cje,outline:`1px solid ${lje}`,borderRadius:KK.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${aje}20`,outline:`1px solid ${cq}`,borderRadius:KK.borderRadius},".cm-selectionMatch":{backgroundColor:sje,outline:`1px solid ${ZK}50`,borderRadius:KK.borderRadius},".cm-foldPlaceholder":{backgroundColor:dq,color:QK,border:`1px dotted ${QK}70`,borderRadius:qK.borderRadius,padding:qK.padding,margin:qK.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${uq}, 0 0 0 3px ${oq}40`},"& .cm-scroller::-webkit-scrollbar":{width:JK.width,height:JK.height},"& .cm-scroller::-webkit-scrollbar-track":{background:lq},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:ZK,borderRadius:JK.borderRadius,border:`3px solid ${lq}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:QK},".cm-ghostText":{opacity:`0.5`,color:QK}},{dark:!0}),Ft(Yt.define([{tag:z.keyword,color:sq,fontWeight:`bold`},{tag:z.controlKeyword,color:sq,fontWeight:`bold`},{tag:z.moduleKeyword,color:sq,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:$K},{tag:[z.variableName],color:$K},{tag:[z.propertyName],color:oq,fontStyle:`normal`},{tag:[z.typeName],color:aq},{tag:[z.className],color:rq,fontStyle:`italic`},{tag:[z.namespace],color:oq,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:sq},{tag:[z.bracket],color:QK},{tag:[z.brace],color:QK},{tag:[z.punctuation],color:QK},{tag:[z.function(z.variableName)],color:oq},{tag:[z.labelName],color:oq,fontStyle:`italic`},{tag:[z.definition(z.function(z.variableName))],color:oq},{tag:[z.definition(z.variableName)],color:$K},{tag:z.number,color:nq},{tag:z.changed,color:nq},{tag:z.annotation,color:cq,fontStyle:`italic`},{tag:z.modifier,color:nq,fontStyle:`italic`},{tag:z.self,color:nq},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:sq},{tag:[z.atom,z.bool,z.special(z.variableName)],color:nq},{tag:[z.processingInstruction,z.inserted],color:iq},{tag:[z.special(z.string),z.regexp],color:`#b4f9f8`},{tag:z.string,color:iq},{tag:z.definition(z.typeName),color:aq,fontWeight:`bold`},{tag:[z.definition(z.name),z.separator],color:$K},{tag:z.meta,color:QK},{tag:z.comment,fontStyle:`italic`,color:QK},{tag:z.docComment,fontStyle:`italic`,color:QK},{tag:[z.tagName],color:sq},{tag:[z.attributeName],color:rq},{tag:[z.heading],fontWeight:`bold`,color:`#89ddff`},{tag:z.heading1,color:`#89ddff`,fontWeight:`bold`},{tag:z.heading2,color:`#89ddff`},{tag:z.heading3,color:`#89ddff`},{tag:z.heading4,color:`#89ddff`},{tag:z.heading5,color:`#89ddff`},{tag:z.heading6,color:`#89ddff`},{tag:[z.strong],fontWeight:`bold`,color:$K},{tag:[z.emphasis],fontStyle:`italic`,color:aq},{tag:[z.link],color:uje,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:hq,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:$K,textDecoration:`underline wavy`,borderBottom:`1px wavy ${cq}`},{tag:[z.strikethrough],color:cq,textDecoration:`line-through`},{tag:z.constant(z.name),color:nq},{tag:z.deleted,color:cq},{tag:z.squareBracket,color:QK},{tag:z.angleBracket,color:QK},{tag:z.monospace,color:$K},{tag:[z.contentSeparator],color:oq},{tag:z.quote,color:QK}]))],bq={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},fje={borderLeftWidth:`2px`},xq={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},Sq={paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},Cq={borderRadius:`4px`,padding:`2px 10px`},pje={borderRadius:`2px`},wq={borderRadius:`2px`},Tq={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},Eq={width:`12px`,height:`12px`,borderRadius:`6px`},Dq={borderRadius:`4px`,padding:`2px 6px`},Oq={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},mje=`#1e1e1e`,kq=`#252526`,Aq=`#2d2d30`,jq=`#838383`,hje=`#c6c6c6`,Mq=`#d4d4d4`,Nq=`#e9e9e9`,gje=`#1c1c1c`,Pq=`#569cd6`,_je=`#c586c0`,Fq=`#9cdcfe`,Iq=`#4ec9b0`,Lq=`#dcdcaa`,vje=`#b5cea8`,Rq=`#ce9178`,zq=`#f44747`,Bq=`#d7ba7d`,Vq=`#6a9955`,Hq=zq,Uq=`#FFFFFF08`,Wq=mje,Gq=kq,yje=`#264F7899`,bje=`#72a1ff59`,Kq=hje,xje=`#ffffff15`,Sje=Pq,qq=Bq,Jq=`#3794ff`,Cje=`#c586c0`,Yq=`#1e3f1e80`,Xq=`#4b1c1c80`,Zq=`#6cc26f`,Qq=`#f14c4c`,wje=[Ut.theme({"&":{color:Mq,backgroundColor:Wq,fontSize:bq.fontSize,fontFamily:bq.fontFamily},".cm-content":{caretColor:Kq,lineHeight:bq.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:Kq,borderLeftWidth:fje.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${Kq}99`,color:Wq},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:yje},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#72a1ff40`,outline:`1px solid ${Pq}90`,color:Nq,borderRadius:Dq.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#3794ff90`,color:Nq,padding:Dq.padding,"& span":{color:Nq}},".cm-search.cm-panel.cm-textfield":{color:Mq,borderRadius:Dq.borderRadius,padding:Dq.padding},".cm-panels":{backgroundColor:kq,color:Mq,borderRadius:`3px`,boxShadow:`0 2px 6px rgba(0, 0, 0, 0.45)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${Aq}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${Aq}`},".cm-panel button":{backgroundColor:Aq,color:Mq,border:`1px solid ${Aq}`,borderRadius:Cq.borderRadius,padding:Cq.padding},".cm-panel button:hover":{backgroundColor:`#3a3a3a`,border:`1px solid ${jq}80`},".cm-activeLine":{backgroundColor:Uq,borderRadius:pje.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:gje,color:jq,border:`none`,borderRight:`1px solid ${Aq}`,paddingRight:Sq.paddingRight},".cm-activeLineGutter":{backgroundColor:Uq,color:Nq,fontWeight:Sq.fontWeight},".cm-lineNumbers":{fontSize:Sq.fontSize,lineHeight:Sq.lineHeight},".cm-foldGutter":{fontSize:Sq.fontSize,lineHeight:Sq.lineHeight},".cm-foldGutter .cm-gutterElement":{color:jq,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:Nq},".cm-insertedLine":{textDecoration:xq.insertedTextDecoration,backgroundColor:Yq,color:Zq,padding:xq.insertedLinePadding,borderRadius:xq.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:xq.insertedTextDecoration,backgroundColor:`${Yq} !important`,color:Zq,padding:xq.insertedLinePadding,borderRadius:xq.borderRadious,border:`1px solid ${Zq}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:xq.deletedTextDecoration,backgroundColor:Xq,color:Qq,padding:xq.insertedLinePadding,borderRadius:xq.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:xq.deletedTextDecoration,backgroundColor:`${Xq} !important`,color:Qq,padding:xq.insertedLinePadding,borderRadius:xq.borderRadious,border:`1px solid ${Qq}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:Gq,border:`1px solid ${Aq}`,borderRadius:Oq.borderRadius,padding:Oq.padding,boxShadow:`0 3px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:Gq,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:Oq.padding,lineHeight:Oq.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#04395e`,color:Nq,borderRadius:Oq.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:jq,paddingRight:Oq.paddingRight},"& > ul > li > span.cm-completionDetail":{color:jq,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Gq,borderBottomColor:Gq},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${Hq}`},"&-warning":{borderLeft:`3px solid ${qq}`},"&-info":{borderLeft:`3px solid ${Jq}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${Hq}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${qq}`},".cm-matchingBracket":{backgroundColor:xje,outline:`1px solid ${Sje}80`,borderRadius:wq.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${zq}40`,outline:`1px solid ${Hq}`,borderRadius:wq.borderRadius},".cm-selectionMatch":{backgroundColor:bje,outline:`1px solid ${Aq}70`,borderRadius:wq.borderRadius},".cm-foldPlaceholder":{backgroundColor:Gq,color:jq,border:`1px dotted ${jq}70`,borderRadius:Tq.borderRadius,padding:Tq.padding,margin:Tq.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 1px ${Aq}`},"& .cm-scroller::-webkit-scrollbar":{width:Eq.width,height:Eq.height},"& .cm-scroller::-webkit-scrollbar-track":{background:Wq},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#424242`,borderRadius:Eq.borderRadius,border:`3px solid ${Wq}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#525252`},".cm-ghostText":{opacity:`0.5`,color:jq}},{dark:!0}),Ft(Yt.define([{tag:z.keyword,color:Pq,fontWeight:`bold`},{tag:z.controlKeyword,color:_je,fontWeight:`bold`},{tag:z.moduleKeyword,color:Pq,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:Mq},{tag:[z.variableName],color:Fq},{tag:[z.propertyName],color:Fq,fontStyle:`normal`},{tag:[z.typeName],color:Iq},{tag:[z.className],color:Iq,fontStyle:`normal`},{tag:[z.namespace],color:Mq,fontStyle:`normal`},{tag:[z.operator,z.operatorKeyword],color:Mq},{tag:[z.bracket],color:Mq},{tag:[z.brace],color:Mq},{tag:[z.punctuation],color:Mq},{tag:[z.function(z.variableName)],color:Lq},{tag:[z.labelName],color:Lq,fontStyle:`normal`},{tag:[z.definition(z.function(z.variableName))],color:Lq},{tag:[z.definition(z.variableName)],color:Fq},{tag:z.number,color:vje},{tag:z.changed,color:Bq},{tag:z.annotation,color:Bq,fontStyle:`italic`},{tag:z.modifier,color:Pq,fontStyle:`normal`},{tag:z.self,color:Pq},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:Fq},{tag:[z.atom,z.bool,z.special(z.variableName)],color:Pq},{tag:[z.processingInstruction,z.inserted],color:Rq},{tag:[z.special(z.string),z.regexp],color:`#d16969`},{tag:z.string,color:Rq},{tag:z.definition(z.typeName),color:Iq,fontWeight:`bold`},{tag:[z.definition(z.name),z.separator],color:Mq},{tag:z.meta,color:jq},{tag:z.comment,fontStyle:`italic`,color:Vq},{tag:z.docComment,fontStyle:`italic`,color:Vq},{tag:[z.tagName],color:Pq},{tag:[z.attributeName],color:Fq},{tag:[z.heading],fontWeight:`bold`,color:Pq},{tag:z.heading1,color:Pq,fontWeight:`bold`},{tag:z.heading2,color:Pq},{tag:z.heading3,color:Pq},{tag:z.heading4,color:Pq},{tag:z.heading5,color:Pq},{tag:z.heading6,color:Pq},{tag:[z.strong],fontWeight:`bold`,color:Pq},{tag:[z.emphasis],fontStyle:`italic`,color:Iq},{tag:[z.link],color:Cje,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:Jq,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:Mq,textDecoration:`underline wavy`,borderBottom:`1px wavy ${Hq}`},{tag:[z.strikethrough],color:Hq,textDecoration:`line-through`},{tag:z.constant(z.name),color:Fq},{tag:z.deleted,color:Hq},{tag:z.squareBracket,color:Mq},{tag:z.angleBracket,color:Mq},{tag:z.monospace,color:Mq},{tag:[z.contentSeparator],color:Mq},{tag:z.quote,color:Vq}]))],$q={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},Tje={borderLeftWidth:`2px`},eJ={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},tJ={paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},nJ={borderRadius:`4px`,padding:`2px 10px`},Eje={borderRadius:`2px`},rJ={borderRadius:`2px`},iJ={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},aJ={width:`12px`,height:`12px`,borderRadius:`6px`},oJ={borderRadius:`4px`,padding:`2px 6px`},sJ={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},Dje=`#ffffff`,cJ=`#f3f3f3`,lJ=`#d6d6d6`,uJ=`#6b6b6b`,Oje=`#000000`,dJ=`#383a42`,fJ=`#1f1f1f`,kje=`#f5f5f5`,pJ=`#0064ff`,mJ=`#af00db`,hJ=`#0070c1`,gJ=`#267f99`,_J=`#795e26`,Aje=`#098658`,vJ=`#a31515`,yJ=`#e51400`,bJ=`#795e26`,xJ=`#008000`,SJ=yJ,CJ=`#99999926`,wJ=Dje,TJ=cJ,jje=`#add6ff`,Mje=`#a8ac9480`,EJ=Oje,Nje=`#007acc20`,Pje=`#007acc`,DJ=`#bf8803`,OJ=`#006ab1`,Fje=`#9e46d0`,kJ=`#ddfbe0`,AJ=`#ffebec`,jJ=`#22863a`,MJ=`#e51400`,Ije=[Ut.theme({"&":{color:dJ,backgroundColor:wJ,fontSize:$q.fontSize,fontFamily:$q.fontFamily},".cm-content":{caretColor:EJ,lineHeight:$q.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:EJ,borderLeftWidth:Tje.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${EJ}99`,color:wJ},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:jje},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#bbdefb`,outline:`1px solid ${hJ}90`,color:fJ,borderRadius:oJ.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#90caf9`,color:fJ,padding:oJ.padding,"& span":{color:fJ}},".cm-search.cm-panel.cm-textfield":{color:dJ,borderRadius:oJ.borderRadius,padding:oJ.padding},".cm-panels":{backgroundColor:cJ,color:dJ,borderRadius:`3px`,boxShadow:`0 2px 6px rgba(0, 0, 0, 0.15)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${lJ}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${lJ}`},".cm-panel button":{backgroundColor:wJ,color:dJ,border:`1px solid ${lJ}`,borderRadius:nJ.borderRadius,padding:nJ.padding},".cm-panel button:hover":{backgroundColor:`#e8e8e8`,border:`1px solid ${uJ}80`},".cm-activeLine":{backgroundColor:CJ,borderRadius:Eje.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:kje,color:`#237893`,border:`none`,borderRight:`1px solid ${lJ}`,paddingRight:tJ.paddingRight},".cm-activeLineGutter":{backgroundColor:CJ,color:`#0b216f`,fontWeight:tJ.fontWeight},".cm-lineNumbers":{fontSize:tJ.fontSize,lineHeight:tJ.lineHeight},".cm-foldGutter":{fontSize:tJ.fontSize,lineHeight:tJ.lineHeight},".cm-foldGutter .cm-gutterElement":{color:`#237893`,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:`#0b216f`},".cm-insertedLine":{textDecoration:eJ.insertedTextDecoration,backgroundColor:kJ,color:jJ,padding:eJ.insertedLinePadding,borderRadius:eJ.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:eJ.insertedTextDecoration,backgroundColor:`${kJ} !important`,color:jJ,padding:eJ.insertedLinePadding,borderRadius:eJ.borderRadious,border:`1px solid ${jJ}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:eJ.deletedTextDecoration,backgroundColor:AJ,color:MJ,padding:eJ.insertedLinePadding,borderRadius:eJ.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:eJ.deletedTextDecoration,backgroundColor:`${AJ} !important`,color:MJ,padding:eJ.insertedLinePadding,borderRadius:eJ.borderRadious,border:`1px solid ${MJ}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:TJ,border:`1px solid ${lJ}`,borderRadius:sJ.borderRadius,padding:sJ.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:TJ,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:sJ.padding,lineHeight:sJ.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#dcebfc`,color:fJ,borderRadius:sJ.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:uJ,paddingRight:sJ.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:TJ,borderBottomColor:TJ},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${SJ}`},"&-warning":{borderLeft:`3px solid ${DJ}`},"&-info":{borderLeft:`3px solid ${OJ}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${SJ}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${DJ}`},".cm-matchingBracket":{backgroundColor:Nje,outline:`1px solid ${Pje}80`,borderRadius:rJ.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${yJ}20`,outline:`1px solid ${SJ}`,borderRadius:rJ.borderRadius},".cm-selectionMatch":{backgroundColor:Mje,outline:`1px solid ${lJ}70`,borderRadius:rJ.borderRadius},".cm-foldPlaceholder":{backgroundColor:TJ,color:uJ,border:`1px dotted ${uJ}70`,borderRadius:iJ.borderRadius,padding:iJ.padding,margin:iJ.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 1px ${lJ}`},"& .cm-scroller::-webkit-scrollbar":{width:aJ.width,height:aJ.height},"& .cm-scroller::-webkit-scrollbar-track":{background:wJ},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#dadada`,borderRadius:aJ.borderRadius,border:`3px solid ${wJ}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#cccccc`},".cm-ghostText":{opacity:`0.5`,color:uJ}},{dark:!1}),Ft(Yt.define([{tag:z.keyword,color:pJ,fontWeight:`bold`},{tag:z.controlKeyword,color:mJ,fontWeight:`bold`},{tag:z.moduleKeyword,color:pJ,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:dJ},{tag:[z.variableName],color:hJ},{tag:[z.propertyName],color:hJ,fontStyle:`normal`},{tag:[z.typeName],color:gJ},{tag:[z.className],color:gJ,fontStyle:`normal`},{tag:[z.namespace],color:dJ,fontStyle:`normal`},{tag:[z.operator,z.operatorKeyword],color:dJ},{tag:[z.bracket],color:dJ},{tag:[z.brace],color:dJ},{tag:[z.punctuation],color:dJ},{tag:[z.function(z.variableName)],color:_J},{tag:[z.labelName],color:_J,fontStyle:`normal`},{tag:[z.definition(z.function(z.variableName))],color:_J},{tag:[z.definition(z.variableName)],color:hJ},{tag:z.number,color:Aje},{tag:z.changed,color:bJ},{tag:z.annotation,color:bJ,fontStyle:`italic`},{tag:z.modifier,color:pJ,fontStyle:`normal`},{tag:z.self,color:pJ},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:hJ},{tag:[z.atom,z.bool,z.special(z.variableName)],color:pJ},{tag:[z.processingInstruction,z.inserted],color:vJ},{tag:[z.special(z.string),z.regexp],color:mJ},{tag:z.string,color:vJ},{tag:z.definition(z.typeName),color:gJ,fontWeight:`bold`},{tag:[z.definition(z.name),z.separator],color:dJ},{tag:z.meta,color:uJ},{tag:z.comment,fontStyle:`italic`,color:xJ},{tag:z.docComment,fontStyle:`italic`,color:xJ},{tag:[z.tagName],color:pJ},{tag:[z.attributeName],color:hJ},{tag:[z.heading],fontWeight:`bold`,color:pJ},{tag:z.heading1,color:pJ,fontWeight:`bold`},{tag:z.heading2,color:pJ},{tag:z.heading3,color:pJ},{tag:z.heading4,color:pJ},{tag:z.heading5,color:pJ},{tag:z.heading6,color:pJ},{tag:[z.strong],fontWeight:`bold`,color:pJ},{tag:[z.emphasis],fontStyle:`italic`,color:hJ},{tag:[z.link],color:Fje,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:OJ,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:dJ,textDecoration:`underline wavy`,borderBottom:`1px wavy ${SJ}`},{tag:[z.strikethrough],color:SJ,textDecoration:`line-through`},{tag:z.constant(z.name),color:hJ},{tag:z.deleted,color:SJ},{tag:z.squareBracket,color:dJ},{tag:z.angleBracket,color:dJ},{tag:z.monospace,color:dJ},{tag:[z.contentSeparator],color:dJ},{tag:z.quote,color:xJ}]))];function NJ(){return NJ=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},NJ.apply(null,arguments)}function Lje(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 PJ=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,FJ=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(PJ(e)):PJ,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 eee(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=hn(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Vt(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`&&(FJ.prototype[Symbol.iterator]=function(){return this});var IJ={from:-1,to:-1,match:/.*/.exec(``)},LJ=`gm`+(/x/.unicode==null?``:`u`),RJ=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=IJ,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new VJ(e,t,n,r,i);this.re=new RegExp(t,LJ+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=HJ(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=HJ(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}}},zJ=new WeakMap,BJ=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=zJ.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return zJ.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)),zJ.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},VJ=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=IJ,this.matchPos=HJ(e,r),this.re=new RegExp(t,LJ+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=BJ.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=HJ(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=BJ.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(RJ.prototype[Symbol.iterator]=VJ.prototype[Symbol.iterator]=function(){return this});function Rje(e){try{return new RegExp(e,LJ),!0}catch{return!1}}function HJ(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 UJ(e){let t=On(`input`,{class:`cm-textfield`,name:`line`,value:String(e.state.doc.lineAt(e.state.selection.main.head).number)}),n=On(`form`,{class:`cm-gotoLine`,onkeydown:t=>{t.keyCode==27?(t.preventDefault(),e.dispatch({effects:WJ.of(!1)}),e.focus()):t.keyCode==13&&(t.preventDefault(),r())},onsubmit:e=>{e.preventDefault(),r()}},On(`label`,e.state.phrase(`Go to line`),`: `,t),` `,On(`button`,{class:`cm-button`,type:`submit`},e.state.phrase(`go`)),On(`button`,{name:`close`,onclick:()=>{e.dispatch({effects:WJ.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=on.cursor(d.from+Math.max(0,Math.min(l,d.length)));e.dispatch({effects:[WJ.of(!1),Ut.scrollIntoView(f.from,{y:`center`})],selection:f}),e.focus()}return{dom:n}}var WJ=Qt.define(),GJ=In.define({create(){return!0},update(e,t){for(let n of t.effects)n.is(WJ)&&(e=n.value);return e},provide:e=>Xt.from(e,e=>e?UJ:null)}),zje=e=>{let t=wn(e,UJ);if(!t){let n=[WJ.of(!0)];e.state.field(GJ,!1)??n.push(Qt.appendConfig.of([GJ,Bje])),e.dispatch({effects:n}),t=wn(e,UJ)}return t&&t.dom.querySelector(`input`).select(),!0},Bje=Ut.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`}}}),Vje={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},KJ=vn.define({combine(e){return bt(e,Vje,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Hje(e){let t=[qje,Kje];return e&&t.push(KJ.of(e)),t}var Uje=Ln.mark({class:`cm-selectionMatch`}),Wje=Ln.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function qJ(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=nn.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=nn.Word)}function Gje(e,t,n,r){return e(t.sliceDoc(n,n+1))==nn.Word&&e(t.sliceDoc(r-1,r))==nn.Word}var Kje=wt.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(KJ),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Ln.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return Ln.none;let e=n.wordAt(i.head);if(!e)return Ln.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 Ln.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(qJ(o,n,i.from,i.to)&&Gje(o,n,i.from,i.to)))return Ln.none}else if(a=n.sliceDoc(i.from,i.to),!a)return Ln.none}let s=[];for(let r of e.visibleRanges){let e=new FJ(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||qJ(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(Wje.range(r,a)):(r>=i.to||a<=i.from)&&s.push(Uje.range(r,a)),s.length>t.maxMatches))return Ln.none}}return Ln.set(s)}},{decorations:e=>e.decorations}),qje=Ut.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),Jje=({state:e,dispatch:t})=>{let{selection:n}=e,r=on.create(n.ranges.map(t=>e.wordAt(t.head)||on.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Yje(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 FJ(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new FJ(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 Xje=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return Jje({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=Yje(e,r);return i?(t(e.update({selection:e.selection.addRange(on.range(i.from,i.to),!1),effects:Ut.scrollIntoView(i.to)})),!0):!1},JJ=vn.define({combine(e){return bt(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new cMe(e),scrollToMatch:e=>Ut.scrollIntoView(e)})}}),YJ=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||Rje(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`?`
|
|
1263
|
+
`;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(pn.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=VR(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new Et(e.parser.nodeSet.types[lR.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(BEe.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c,s=t.to-n,c=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function VR(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var HEe=Ot({"Blockquote/...":z.quote,HorizontalRule:z.contentSeparator,"ATXHeading1/... SetextHeading1/...":z.heading1,"ATXHeading2/... SetextHeading2/...":z.heading2,"ATXHeading3/...":z.heading3,"ATXHeading4/...":z.heading4,"ATXHeading5/...":z.heading5,"ATXHeading6/...":z.heading6,"Comment CommentBlock":z.comment,Escape:z.escape,Entity:z.character,"Emphasis/...":z.emphasis,"StrongEmphasis/...":z.strong,"Link/... Image/...":z.link,"OrderedList/... BulletList/...":z.list,"BlockQuote/...":z.quote,"InlineCode CodeText":z.monospace,"URL Autolink":z.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":z.processingInstruction,"CodeInfo LinkLabel":z.labelName,LinkTitle:z.string,Paragraph:z.content}),UEe=new LEe(new jt(CR).extend(HEe),Object.keys(vR).map(e=>vR[e]),Object.keys(vR).map(e=>MEe[e]),Object.keys(vR),NEe,yEe,Object.keys(FR).map(e=>FR[e]),Object.keys(FR),[]);function WEe(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function GEe(e){let{codeParser:t,htmlParser:n}=e;return{wrap:kt((e,r)=>{let i=e.type.id;if(t&&(i==lR.CodeBlock||i==lR.FencedCode)){let n=``;if(i==lR.FencedCode){let t=e.node.getChild(lR.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==lR.CodeText}}else if(n&&(i==lR.HTMLBlock||i==lR.HTMLTag||i==lR.CommentBlock))return{parser:n,overlay:WEe(e.node,e.from,e.to)};return null})}}var KEe={resolve:`Strikethrough`,mark:`StrikethroughMark`},qEe={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":z.strikethrough}},{name:`StrikethroughMark`,style:z.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=PR.test(r),c=PR.test(i);return e.addDelimiter(KEe,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function HR(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function UR(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var WR=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,GR=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&WR.test(r=t.text.slice(t.pos))){let i=[];HR(e,n.content,0,i,n.start)==HR(e,r,t.pos)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];HR(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},JEe={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":z.heading}},`TableRow`,{name:`TableCell`,style:z.content},{name:`TableDelimiter`,style:z.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return UR(t.content,0)?new GR:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof GR)||!UR(t.text,t.basePos))return!1;let r=e.peekLine();return WR.test(r)&&HR(e,t.text,t.basePos)==HR(e,r,t.basePos)},before:`SetextHeading`}]},YEe=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},XEe={defineNodes:[{name:`Task`,block:!0,style:z.list},{name:`TaskMarker`,style:z.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new YEe:null},after:`SetextHeading`}]},KR=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,qR=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,ZEe=/[\w-]+\.[\w-]+($|\/)/,JR=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,YR=/\/[a-zA-Z\d@.]+/gy;function XR(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function QEe(e,t){qR.lastIndex=t;let n=qR.exec(e);if(!n||ZEe.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&XR(e,t,r,`)`)>XR(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function ZR(e,t){JR.lastIndex=t;let n=JR.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-(r==`.`?1:0)}var $Ee=[JEe,XEe,qEe,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;KR.lastIndex=r;let i=KR.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=QEe(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=ZR(e.text,r):(a=ZR(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(YR.lastIndex=a,i=YR.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function QR(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),uR(s))break}return-1}}var eDe={defineNodes:[{name:`Superscript`,style:z.special(z.content)},{name:`SuperscriptMark`,style:z.processingInstruction}],parseInline:[{name:`Superscript`,parse:QR(94,`Superscript`,`SuperscriptMark`)}]},tDe={defineNodes:[{name:`Subscript`,style:z.special(z.content)},{name:`SubscriptMark`,style:z.processingInstruction}],parseInline:[{name:`Subscript`,parse:QR(126,`Subscript`,`SubscriptMark`)}]},nDe={defineNodes:[{name:`Emoji`,style:z.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},rDe=55,iDe=1,aDe=56,oDe=2,sDe=57,cDe=3,$R=4,lDe=5,ez=6,tz=7,nz=8,rz=9,iz=10,uDe=11,dDe=12,fDe=13,az=58,pDe=14,mDe=15,oz=59,sz=21,hDe=23,cz=24,gDe=25,lz=27,uz=28,_De=29,vDe=32,yDe=35,bDe=37,xDe=38,SDe=0,CDe=1,wDe={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},TDe={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},dz={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function EDe(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}var fz=null,pz=null,mz=0;function hz(e,t){let n=e.pos+t;if(mz==n&&pz==e)return fz;let r=e.peek(t),i=``;for(;EDe(r);)i+=String.fromCharCode(r),r=e.peek(++t);return pz=e,mz=n,fz=i?i.toLowerCase():r==DDe||r==ODe?void 0:null}var gz=60,_z=62,vz=47,DDe=63,ODe=33,kDe=45;function yz(e,t){this.name=e,this.parent=t}var ADe=[ez,iz,tz,nz,rz],jDe=new kn({start:null,shift(e,t,n,r){return ADe.indexOf(t)>-1?new yz(hz(r,1)||``,e):e},reduce(e,t){return t==sz&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==ez||i==bDe?new yz(hz(r,1)||``,e):e},strict:!1}),MDe=new yn((e,t)=>{if(e.next!=gz){e.next<0&&t.context&&e.acceptToken(az);return}e.advance();let n=e.next==vz;n&&e.advance();let r=hz(e,0);if(r===void 0)return;if(!r)return e.acceptToken(n?mDe:pDe);let i=t.context?t.context.name:null;if(n){if(r==i)return e.acceptToken(uDe);if(i&&TDe[i])return e.acceptToken(az,-2);if(t.dialectEnabled(SDe))return e.acceptToken(dDe);for(let e=t.context;e;e=e.parent)if(e.name==r)return;e.acceptToken(fDe)}else{if(r==`script`)return e.acceptToken(tz);if(r==`style`)return e.acceptToken(nz);if(r==`textarea`)return e.acceptToken(rz);if(wDe.hasOwnProperty(r))return e.acceptToken(iz);i&&dz[i]&&dz[i][r]?e.acceptToken(az,-1):e.acceptToken(ez)}},{contextual:!0}),NDe=new yn(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(oz);break}if(e.next==kDe)t++;else if(e.next==_z&&t>=2){n>=3&&e.acceptToken(oz,-2);break}else t=0;e.advance()}});function PDe(e){for(;e;e=e.parent)if(e.name==`svg`||e.name==`math`)return!0;return!1}var FDe=new yn((e,t)=>{if(e.next==vz&&e.peek(1)==_z){let n=t.dialectEnabled(CDe)||PDe(t.context);e.acceptToken(n?lDe:$R,2)}else e.next==_z&&e.acceptToken($R,1)});function bz(e,t,n){let r=2+e.length;return new yn(i=>{for(let a=0,o=0,s=0;;s++){if(i.next<0){s&&i.acceptToken(t);break}if(a==0&&i.next==gz||a==1&&i.next==vz||a>=2&&a<r&&i.next==e.charCodeAt(a-2))a++,o++;else if(a==r&&i.next==_z){s>o?i.acceptToken(t,-o):i.acceptToken(n,-(o-2));break}else if((i.next==10||i.next==13)&&s){i.acceptToken(t,1);break}else a=o=0;i.advance()}})}var IDe=bz(`script`,rDe,iDe),LDe=bz(`style`,aDe,oDe),RDe=bz(`textarea`,sDe,cDe),zDe=Ot({"Text RawText IncompleteTag IncompleteCloseTag":z.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":z.angleBracket,TagName:z.tagName,"MismatchedCloseTag/TagName":[z.tagName,z.invalid],AttributeName:z.attributeName,"AttributeValue UnquotedAttributeValue":z.attributeValue,Is:z.definitionOperator,"EntityReference CharacterReference":z.character,Comment:z.blockComment,ProcessingInst:z.processingInstruction,DoctypeDecl:z.documentMeta}),BDe=Tn.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:`,c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~`,goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:`⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl`,maxTerm:68,context:jDe,nodeProps:[[`closedBy`,-10,1,2,3,7,8,9,10,11,12,13,`EndTag`,6,`EndTag SelfClosingEndTag`,-4,22,31,34,37,`CloseTag`],[`openedBy`,4,`StartTag StartCloseTag`,5,`StartTag`,-4,30,33,36,38,`OpenTag`],[`group`,-10,14,15,18,19,20,21,40,41,42,43,`Entity`,17,`Entity TextContent`,-3,29,32,35,`TextContent Entity`],[`isolate`,-11,22,30,31,33,34,36,37,38,39,42,43,`ltr`,-3,27,28,40,``]],propSources:[zDe],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[IDe,LDe,RDe,FDe,MDe,NDe,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function xz(e,t){let n=Object.create(null);for(let r of e.getChildren(cz)){let e=r.getChild(gDe),i=r.getChild(lz)||r.getChild(uz);e&&(n[t.read(e.from,e.to)]=i?i.type.id==lz?t.read(i.from+1,i.to-1):t.read(i.from,i.to):``)}return n}function Sz(e,t){let n=e.getChild(hDe);return n?t.read(n.from,n.to):` `}function Cz(e,t,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||=xz(e.node.parent.firstChild,t)))return{parser:i.parser};return null}function wz(e=[],t=[]){let n=[],r=[],i=[],a=[];for(let t of e)(t.tag==`script`?n:t.tag==`style`?r:t.tag==`textarea`?i:a).push(t);let o=t.length?Object.create(null):null;for(let e of t)(o[e.name]||(o[e.name]=[])).push(e);return kt((e,t)=>{let s=e.type.id;if(s==_De)return Cz(e,t,n);if(s==vDe)return Cz(e,t,r);if(s==yDe)return Cz(e,t,i);if(s==sz&&a.length){let n=e.node,r=n.firstChild,i=r&&Sz(r,t),o;if(i){for(let e of a)if(e.tag==i&&(!e.attrs||e.attrs(o||=xz(r,t)))){let t=n.lastChild,i=t.type.id==xDe?t.from:n.to;if(i>r.to)return{parser:e.parser,overlay:[{from:r.to,to:i}]}}}}if(o&&s==cz){let n=e.node,r;if(r=n.firstChild){let e=o[t.read(r.from,r.to)];if(e)for(let r of e){if(r.tagName&&r.tagName!=Sz(n.parent,t))continue;let e=n.lastChild;if(e.type.id==lz){let t=e.from+1,n=e.lastChild,i=e.to-(n&&n.isError?0:1);if(i>t)return{parser:r.parser,overlay:[{from:t,to:i}]}}else if(e.type.id==uz)return{parser:r.parser,overlay:[{from:e.from,to:e.to}]}}}}return null})}var VDe=122,Tz=1,HDe=123,UDe=124,Ez=2,WDe=125,GDe=3,KDe=4,Dz=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],qDe=58,JDe=40,Oz=95,YDe=91,kz=45,XDe=46,ZDe=35,QDe=37,$De=38,eOe=92,tOe=10,nOe=42;function Az(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function jz(e){return e>=48&&e<=57}function Mz(e){return jz(e)||e>=97&&e<=102||e>=65&&e<=70}var Nz=(e,t,n)=>(r,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:c}=r;if(Az(c)||c==kz||c==Oz||a&&jz(c))!a&&(c!=kz||s>0)&&(a=!0),o===s&&c==kz&&o++,r.advance();else if(c==eOe&&r.peek(1)!=tOe){if(r.advance(),Mz(r.next)){do r.advance();while(Mz(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();a=!0}else{a&&r.acceptToken(o==2&&i.canShift(Ez)?t:c==JDe?n:e);break}}},rOe=new yn(Nz(HDe,Ez,UDe)),iOe=new yn(Nz(WDe,GDe,KDe)),aOe=new yn(e=>{if(Dz.includes(e.peek(-1))){let{next:t}=e;(Az(t)||t==Oz||t==ZDe||t==XDe||t==nOe||t==YDe||t==qDe&&Az(e.peek(1))||t==kz||t==$De)&&e.acceptToken(VDe)}}),oOe=new yn(e=>{if(!Dz.includes(e.peek(-1))){let{next:t}=e;if(t==QDe&&(e.advance(),e.acceptToken(Tz)),Az(t)){do e.advance();while(Az(e.next)||jz(e.next));e.acceptToken(Tz)}}}),sOe=Ot({"AtKeyword import charset namespace keyframes media supports":z.definitionKeyword,"from to selector":z.keyword,NamespaceName:z.namespace,KeyframeName:z.labelName,KeyframeRangeName:z.operatorKeyword,TagName:z.tagName,ClassName:z.className,PseudoClassName:z.constant(z.className),IdName:z.labelName,"FeatureName PropertyName":z.propertyName,AttributeName:z.attributeName,NumberLiteral:z.number,KeywordQuery:z.keyword,UnaryQueryOp:z.operatorKeyword,"CallTag ValueName":z.atom,VariableName:z.variableName,Callee:z.operatorKeyword,Unit:z.unit,"UniversalSelector NestingSelector":z.definitionOperator,"MatchOp CompareOp":z.compareOperator,"ChildOp SiblingOp, LogicOp":z.logicOperator,BinOp:z.arithmeticOperator,Important:z.modifier,Comment:z.blockComment,ColorLiteral:z.color,"ParenthesizedContent StringLiteral":z.string,":":z.punctuation,"PseudoOp #":z.derefOperator,"; ,":z.separator,"( )":z.paren,"[ ]":z.squareBracket,"{ }":z.brace}),cOe={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},lOe={__proto__:null,or:98,and:98,not:106,only:106,layer:170},uOe={__proto__:null,selector:112,layer:166},dOe={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},fOe={__proto__:null,to:207},pOe=Tn.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mO<rQhO'#EQOOQW'#EQ'#EQO=WQ`O1G0UO1[QhO1G0UOOQ[,59o,59oO'tQhO'#DXOOQ[,59q,59qO=]Q#tO,5:VOOQS1G0[1G0[OOQS1G0^1G0^OOQS1G0`1G0`O=hQ`O1G0`O=mQdO'#E`OOQS1G0c1G0cOOQS1G0i1G0iO=xQaO,5:RO-`Q`O1G0kOOQS1G0k1G0kO-eQ`O1G0kO>PQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<<IOOElQdO'#EqOEvQ`O,5;yOOQP1G/u1G/uOOQS-E8j-E8jOFOQdO'#EpOFYQ`O,5;rOOQ]1G.x1G.xOOQP<<IO<<IOOFbQdO7+$|OOQO'#D]'#D]OFiQ!bO7+%QOFqQhO'#EoOF{Q`O,5;xO&lQdO,5;xOOQW1G/o1G/oOOQO'#ES'#ESOGTQ`O1G0WOOQS<<I[<<I[O&lQdO,59tOGnQhO1G/_OOQ[1G/_1G/_OGuQ`O1G/_OOQW-E8l-E8lOOQ[7+%]7+%]OOQO,5:{,5:{O=pQdO'#ExOCeQ`O,5;cOOQS,5;c,5;cOOQS-E8u-E8uOOQS1G0f1G0fOOQS<<Iq<<IqOG}Q!fO,5;_OOQS-E8q-E8qOOQO<<IX<<IXOOQPAN>jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<<Hh<<HhOOQW<<Hl<<HlOIjQhO<<HlOI{QhO,5;ZOJWQ`O,5;ZOOQO-E8m-E8mOJ]QdO1G1dOBZQdO'#EuOJgQ`O7+%rOOQW7+%r7+%rOJoQ!bO1G/`OOQ[7+$y7+$yOJzQhO7+$yPKRQ`O'#EnOOQO,5;d,5;dOOQO-E8v-E8vOOQS1G0}1G0}OKWQ`OAN>WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<<I^<<I^OOQ[<<He<<HePOQW,5;Y,5;YOOQWG23rG23rOKeQdO7+&a",stateData:"Kx~O#sOS#tQQ~OW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#oRO~OQiOW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#ohO~O#m$SP~P!dO#tmO~O#ooO~O]qO`rOarOjsOmtO!juO!mwO#nvO~OpzO!^xO~P$SOc!QO#o|O#p}O~O#o!RO~O#o!TO~OW[OZ[O]TO`VOaVOjWOmXO!jYO!mZO#oRO~OS!]Oe!YO!V![O!Y!`O#q!XOp$TP~Ok$TP~P&POQ!jOe!cOm!dOp!eOr!mOt!mOz!kO!`!lO#o!bO#p!hO#}!fO~Ot!qO!`!lO#o!pO~Ot!sO#o!sO~OS!]Oe!YO!V![O!Y!`O#q!XO~Oe!vOpzO#Z!xO~O]YX`YX`!pXaYXjYXmYXpYX!^YX!jYX!mYX#nYX~O`!zO~Ok!{O#m$SXo$SX~O#m$SXo$SX~P!dO#u#OO#v#OO#w#QO~Oc#UO#o|O#p}O~OpzO!^xO~Oo$SP~P!dOe#`O~Oe#aO~Ol#bO!h#cO~O]qO`rOarOjsOmtO~Op!ia!^!ia!j!ia!m!ia#n!iad!ia~P*zOp!la!^!la!j!la!m!la#n!lad!la~P*zOR#gOS!]Oe!YOr#gOt#gO!V![O!Y!`O#q#dO#}!fO~O!R#iO!^#jOk$TXp$TX~Oe#mO~Ok#oOpzO~Oe!vO~O]#rO`#rOd#uOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl#wO~P&lO]#rO`#rOi#rOj#rOk#rOo#yO~P&lOP#zOSsXesXksXvsX!VsX!YsX!usX!wsX#qsX!TsXQsX]sX`sXdsXisXjsXmsXpsXrsXtsXzsX!`sX#osX#psX#}sXlsXosX!^sX!qsX#msX~Ov#{O!u#|O!w#}Ok$TP~P'tOe#aOS#{Xk#{Xv#{X!V#{X!Y#{X!u#{X!w#{X#q#{XQ#{X]#{X`#{Xd#{Xi#{Xj#{Xm#{Xp#{Xr#{Xt#{Xz#{X!`#{X#o#{X#p#{X#}#{Xl#{Xo#{X!^#{X!q#{X#m#{X~Oe$RO~Oe$TO~Ok$VOv#{O~Ok$WO~Ot$XO!`!lO~Op$YO~OpzO!R#iO~OpzO#Z$`O~O!q$bOk!oa#m!oao!oa~P&lOk#hX#m#hXo#hX~P!dOk!{O#m$Sao$Sa~O#u#OO#v#OO#w$hO~Ol$jO!h$kO~Op!ii!^!ii!j!ii!m!ii#n!iid!ii~P*zOp!ki!^!ki!j!ki!m!ki#n!kid!ki~P*zOp!li!^!li!j!li!m!li#n!lid!li~P*zOp#fa!^#fa~P$SOo$lO~Od$RP~P%_Od#zP~P&lO`!PXd}X!R}X!T!PX~O`$sO!T$tO~Od$uO!R#iO~Ok#jXp#jX!^#jX~P'tO!^#jOk$Tap$Ta~O!R#iOk!Uap!Ua!^!Uad!Ua`!Ua~OS!]Oe!YO!V![O!Y!`O#q$yO~Od$QP~P9dOv#{OQ#|X]#|X`#|Xd#|Xe#|Xi#|Xj#|Xk#|Xm#|Xp#|Xr#|Xt#|Xz#|X!`#|X#o#|X#p#|X#}#|Xl#|Xo#|X~O]#rO`#rOd%OOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl%PO~P&lO]#rO`#rOi#rOj#rOk#rOo%QO~P&lOe%SOS!tXk!tX!V!tX!Y!tX#q!tX~Ok%TO~Od%YOt%ZO!a%ZO~Ok%[O~Oo%cO#o%^O#}%]O~Od%dO~P$SOv#{O!^%hO!q%jOk!oi#m!oio!oi~P&lOk#ha#m#hao#ha~P!dOk!{O#m$Sio$Si~O!^%mOd$RX~P$SOd%oO~Ov#{OQ#`Xd#`Xe#`Xm#`Xp#`Xr#`Xt#`Xz#`X!^#`X!`#`X#o#`X#p#`X#}#`X~O!^%qOd#zX~P&lOd%sO~Ol%tOv#{O~OR#gOr#gOt#gO#q%vO#}!fO~O!R#iOk#jap#ja!^#ja~O`!PXd}X!R}X!^}X~O!R#iO!^%xOd$QX~O`%zO~Od%{O~O#o%|O~Ok&OO~O`&PO!R#iO~Od&ROk&QO~Od&UO~OP#zOpsX!^sXdsX~O#}%]Op#TX!^#TX~OpzO!^&WO~Oo&[O#o%^O#}%]O~Ov#{OQ#gXe#gXk#gXm#gXp#gXr#gXt#gXz#gX!^#gX!`#gX!q#gX#m#gX#o#gX#p#gX#}#gXo#gX~O!^%hO!q&`Ok!oq#m!oqo!oq~P&lOl&aOv#{O~Od#eX!^#eX~P%_O!^%mOd$Ra~Od#dX!^#dX~P&lO!^%qOd#za~Od&fO~P&lOd&gO!T&hO~Od#cX!^#cX~P9dO!^%xOd$Qa~O]&mOd&oO~OS#bae#ba!V#ba!Y#ba#q#ba~Od&qO~PG]Od&qOk&rO~Ov#{OQ#gae#gak#gam#gap#gar#gat#gaz#ga!^#ga!`#ga!q#ga#m#ga#o#ga#p#ga#}#gao#ga~Od#ea!^#ea~P$SOd#da!^#da~P&lOR#gOr#gOt#gO#q%vO#}%]O~O!R#iOd#ca!^#ca~O`&xO~O!^%xOd$Qi~P&lO]&mOd&|O~Ov#{Od|ik|i~Od&}O~PG]Ok'OO~Od'PO~O!^%xOd$Qq~Od#cq!^#cq~P&lO#s!a#t#}]#}v!m~",goto:"2h$UPPPPP$VP$YP$c$uP$cP%X$cPP%_PPP%e%o%oPPPPP%oPP%oP&]P%oP%o'W%oP't'w'}'}(^'}P'}P'}P'}'}P(m'}(yP(|PP)p)v$c)|$c*SP$cP$c$cP*Y*{+YP$YP+aP+dP$YP$YP$YP+j$YP+m+p+s+z$YP$YPP$YP,P,V,f,|-[-b-l-r-x.O.U.`.f.l.rPPPPPPPPPPP.x/R/w/z0|P1U1u2O2R2U2[RnQ_^OP`kz!{$dq[OPYZ`kuvwxz!v!{#`$d%mqSOPYZ`kuvwxz!v!{#`$d%mQpTR#RqQ!OVR#SrQ#S!QS$Q!i!jR$i#U!V!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'Q!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QU#g!Y$t&hU%`$Y%b&WR&V%_!V!iac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QR$S!kQ%W$RR&S%Xk!^]bf!Y![!g#i#j#m$P$R%X%xQ#e!YQ${#mQ%w$tQ&j%xR&w&hQ!ygQ#p!`Q$^!xR%f$`R#n!]!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QQ!qdR$X!rQ!PVR#TrQ#S!PR$i#TQ!SWR#VsQ!UXR#WtQ{UQ!wgQ#^yQ#o!_Q$U!nQ$[!uQ$_!yQ%e$^Q&Y%aQ&]%fR&v&XSjPzQ!}kQ$c!{R%k$dZiPkz!{$dR$P!gQ%}%SR&z&mR!rdR!teR$Z!tS%a$Y%bR&t&WV%_$Y%b&WQ#PmR$g#PQ`OSkPzU!a`k$dR$d!{Q$p#aY%p$p%u&d&l'QQ%u$sQ&d%qQ&l%zR'Q&xQ#t!cQ#v!dQ#x!eV$}#t#v#xQ%X$RR&T%XQ%y$zS&k%y&yR&y&lQ%r$pR&e%rQ%n$mR&c%nQyUR#]yQ%i$aR&_%iQ!|jS$e!|$fR$f!}Q&n%}R&{&nQ#k!ZR$x#kQ%b$YR&Z%bQ&X%aR&u&X__OP`kz!{$d^UOP`kz!{$dQ!VYQ!WZQ#XuQ#YvQ#ZwQ#[xQ$]!vQ$m#`R&b%mR$q#aQ!gaQ!oc[#q!c!d!e#t#v#xQ$a!zd$o#a$p$s%q%u%z&d&l&x'QQ$r#cQ%R#{S%g$a%iQ%l$kQ&^%hR&p&P]#s!c!d!e#t#v#xW!Z]b!g$PQ!ufQ#f!YQ#l![Q$v#iQ$w#jQ$z#mS%V$R%XR&i%xQ#h!YQ%w$tR&w&hR$|#mR$n#`QlPR#_zQ!_]Q!nbQ$O!gR%U$P",nodeNames:`⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to AtRule Styles`,maxTerm:143,nodeProps:[[`isolate`,-2,5,36,``],[`openedBy`,20,`(`,28,`[`,31,`{`],[`closedBy`,21,`)`,29,`]`,32,`}`]],propSources:[sOe],skippedNodes:[0,5,106],repeatNodeCount:15,tokenData:"JQ~R!YOX$qX^%i^p$qpq%iqr({rs-ust/itu6Wuv$qvw7Qwx7cxy9Qyz9cz{9h{|:R|}>t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj<VY!a`Oy%Qz{%Q{|<u|}%Q}!O<u!O!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj<zU!a`Oy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj=eU!a`#}YOy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj>O[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj>yS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%QjBUU`YOy%Qz![%Q![!]Bh!];'S%Q;'S;=`%c<%lO%QbBoSaQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjCQSkYOy%Qz;'S%Q;'S;=`%c<%lO%QhCcU!TWOy%Qz!_%Q!_!`Cu!`;'S%Q;'S;=`%c<%lO%QhC|S!TW!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QlDaS!TW!hSOy%Qz;'S%Q;'S;=`%c<%lO%QjDtV!jQ!TWOy%Qz!_%Q!_!`Cu!`!aEZ!a;'S%Q;'S;=`%c<%lO%QbEbS!jQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjEqYOy%Qz}%Q}!OFa!O!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjFfW!a`Oy%Qz!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjGV[iY!a`Oy%Qz}%Q}!OGO!O!Q%Q!Q![GO![!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjHQSmYOy%Qz;'S%Q;'S;=`%c<%lO%QnHcSl^Oy%Qz;'S%Q;'S;=`%c<%lO%QjHtSpYOy%Qz;'S%Q;'S;=`%c<%lO%QjIVSoYOy%Qz;'S%Q;'S;=`%c<%lO%QfIhU!mQOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Q`I}P;=`<%l$q",tokenizers:[aOe,oOe,rOe,iOe,1,2,3,4,new un(`m~RRYZ[z{a~~g~aO#v~~dP!P!Qg~lO#w~~`,28,129)],topRules:{StyleSheet:[0,6],Styles:[1,105]},specialized:[{term:124,get:e=>cOe[e]||-1},{term:125,get:e=>lOe[e]||-1},{term:4,get:e=>uOe[e]||-1},{term:25,get:e=>dOe[e]||-1},{term:123,get:e=>fOe[e]||-1}],tokenPrec:1963}),Pz=null;function Fz(){if(!Pz&&typeof document==`object`&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let r in e)r!=`cssText`&&r!=`cssFloat`&&typeof e[r]==`string`&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,e=>`-`+e.toLowerCase())),n.has(r)||(t.push(r),n.add(r)));Pz=t.sort().map(e=>({type:`property`,label:e,apply:e+`: `}))}return Pz||[]}var Iz=`active.after.any-link.autofill.backdrop.before.checked.cue.default.defined.disabled.empty.enabled.file-selector-button.first.first-child.first-letter.first-line.first-of-type.focus.focus-visible.focus-within.fullscreen.has.host.host-context.hover.in-range.indeterminate.invalid.is.lang.last-child.last-of-type.left.link.marker.modal.not.nth-child.nth-last-child.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.part.placeholder.placeholder-shown.read-only.read-write.required.right.root.scope.selection.slotted.target.target-text.valid.visited.where`.split(`.`).map(e=>({type:`class`,label:e})),Lz=`above.absolute.activeborder.additive.activecaption.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.antialiased.appworkspace.asterisks.attr.auto.auto-flow.avoid.avoid-column.avoid-page.avoid-region.axis-pan.background.backwards.baseline.below.bidi-override.blink.block.block-axis.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.bullets.button.button-bevel.buttonface.buttonhighlight.buttonshadow.buttontext.calc.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.clear.clip.close-quote.col-resize.collapse.color.color-burn.color-dodge.column.column-reverse.compact.condensed.contain.content.contents.content-box.context-menu.continuous.copy.counter.counters.cover.crop.cross.crosshair.currentcolor.cursive.cyclic.darken.dashed.decimal.decimal-leading-zero.default.default-button.dense.destination-atop.destination-in.destination-out.destination-over.difference.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic-abegede-gez.ethiopic-halehame-aa-er.ethiopic-halehame-gez.ew-resize.exclusion.expanded.extends.extra-condensed.extra-expanded.fantasy.fast.fill.fill-box.fixed.flat.flex.flex-end.flex-start.footnotes.forwards.from.geometricPrecision.graytext.grid.groove.hand.hard-light.help.hidden.hide.higher.highlight.highlighttext.horizontal.hsl.hsla.hue.icon.ignore.inactiveborder.inactivecaption.inactivecaptiontext.infinite.infobackground.infotext.inherit.initial.inline.inline-axis.inline-block.inline-flex.inline-grid.inline-table.inset.inside.intrinsic.invert.italic.justify.keep-all.landscape.large.larger.left.level.lighter.lighten.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-hexadecimal.lower-latin.lower-norwegian.lowercase.ltr.luminosity.manipulation.match.matrix.matrix3d.medium.menu.menutext.message-box.middle.min-intrinsic.mix.monospace.move.multiple.multiple_mask_images.multiply.n-resize.narrower.ne-resize.nesw-resize.no-close-quote.no-drop.no-open-quote.no-repeat.none.normal.not-allowed.nowrap.ns-resize.numbers.numeric.nw-resize.nwse-resize.oblique.opacity.open-quote.optimizeLegibility.optimizeSpeed.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.perspective.pinch-zoom.plus-darker.plus-lighter.pointer.polygon.portrait.pre.pre-line.pre-wrap.preserve-3d.progress.push-button.radial-gradient.radio.read-only.read-write.read-write-plaintext-only.rectangle.region.relative.repeat.repeating-linear-gradient.repeating-radial-gradient.repeat-x.repeat-y.reset.reverse.rgb.rgba.ridge.right.rotate.rotate3d.rotateX.rotateY.rotateZ.round.row.row-resize.row-reverse.rtl.run-in.running.s-resize.sans-serif.saturation.scale.scale3d.scaleX.scaleY.scaleZ.screen.scroll.scrollbar.scroll-position.se-resize.self-start.self-end.semi-condensed.semi-expanded.separate.serif.show.single.skew.skewX.skewY.skip-white-space.slide.slider-horizontal.slider-vertical.sliderthumb-horizontal.sliderthumb-vertical.slow.small.small-caps.small-caption.smaller.soft-light.solid.source-atop.source-in.source-out.source-over.space.space-around.space-between.space-evenly.spell-out.square.start.static.status-bar.stretch.stroke.stroke-box.sub.subpixel-antialiased.svg_masks.super.sw-resize.symbolic.symbols.system-ui.table.table-caption.table-cell.table-column.table-column-group.table-footer-group.table-header-group.table-row.table-row-group.text.text-bottom.text-top.textarea.textfield.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.to.top.transform.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.unidirectional-pan.unset.up.upper-latin.uppercase.url.var.vertical.vertical-text.view-box.visible.visibleFill.visiblePainted.visibleStroke.visual.w-resize.wait.wave.wider.window.windowframe.windowtext.words.wrap.wrap-reverse.x-large.x-small.xor.xx-large.xx-small`.split(`.`).map(e=>({type:`keyword`,label:e})).concat(`aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.grey.green.greenyellow.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen`.split(`.`).map(e=>({type:`constant`,label:e}))),mOe=`a.abbr.address.article.aside.b.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.dd.del.details.dfn.dialog.div.dl.dt.em.figcaption.figure.footer.form.header.hgroup.h1.h2.h3.h4.h5.h6.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.main.meter.nav.ol.output.p.pre.ruby.section.select.small.source.span.strong.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.tr.u.ul`.split(`.`).map(e=>({type:`type`,label:e})),hOe=[`@charset`,`@color-profile`,`@container`,`@counter-style`,`@font-face`,`@font-feature-values`,`@font-palette-values`,`@import`,`@keyframes`,`@layer`,`@media`,`@namespace`,`@page`,`@position-try`,`@property`,`@scope`,`@starting-style`,`@supports`,`@view-transition`].map(e=>({type:`keyword`,label:e})),Rz=/^(\w[\w-]*|-\w[\w-]*|)$/,gOe=/^-(-[\w-]*)?$/;function _Oe(e,t){if((e.name==`(`||e.type.isError)&&(e=e.parent||e),e.name!=`ArgList`)return!1;let n=e.parent?.firstChild;return n?.name==`Callee`?t.sliceString(n.from,n.to)==`var`:!1}var zz=new It,vOe=[`Declaration`];function yOe(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function Bz(e,t,n){if(t.to-t.from>4096){let r=zz.get(t);if(r)return r;let i=[],a=new Set,o=t.cursor(pt.IncludeAnonymous);if(o.firstChild())do for(let t of Bz(e,o.node,n))a.has(t.label)||(a.add(t.label),i.push(t));while(o.nextSibling());return zz.set(t,i),i}else{let r=[],i=new Set;return t.cursor().iterate(t=>{if(n(t)&&t.matchContext(vOe)&&t.node.nextSibling?.name==`:`){let n=e.sliceString(t.from,t.to);i.has(n)||(i.add(n),r.push({label:n,type:`variable`}))}}),r}}var Vz=e=>t=>{let{state:n,pos:r}=t,i=xt(n).resolveInner(r,-1),a=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)==`-`;if(i.name==`PropertyName`||(a||i.name==`TagName`)&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:Fz(),validFor:Rz};if(i.name==`ValueName`)return{from:i.from,options:Lz,validFor:Rz};if(i.name==`PseudoClassName`)return{from:i.from,options:Iz,validFor:Rz};if(e(i)||(t.explicit||a)&&_Oe(i,n.doc))return{from:e(i)||a?i.from:r,options:Bz(n.doc,yOe(i),e),validFor:gOe};if(i.name==`TagName`){for(let{parent:e}=i;e;e=e.parent)if(e.name==`Block`)return{from:i.from,options:Fz(),validFor:Rz};return{from:i.from,options:mOe,validFor:Rz}}if(i.name==`AtKeyword`)return{from:i.from,options:hOe,validFor:Rz};if(!t.explicit)return null;let o=i.resolve(r),s=o.childBefore(r);return s&&s.name==`:`&&o.name==`PseudoClassSelector`?{from:r,options:Iz,validFor:Rz}:s&&s.name==`:`&&o.name==`Declaration`||o.name==`ArgList`?{from:r,options:Lz,validFor:Rz}:o.name==`Block`||o.name==`Styles`?{from:r,options:Fz(),validFor:Rz}:null},Hz=Vz(e=>e.name==`VariableName`),Uz=Dn.define({name:`css`,parser:pOe.configure({props:[_t.add({Declaration:ln()}),ht.add({"Block KeyframeList":Fn})]}),languageData:{commentTokens:{block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*\}$/,wordChars:`-`}});function Wz(){return new An(Uz,Uz.data.of({autocomplete:Hz}))}var Gz=[`_blank`,`_self`,`_top`,`_parent`],Kz=[`ascii`,`utf-8`,`utf-16`,`latin1`,`latin1`],qz=[`get`,`post`,`put`,`delete`],Jz=[`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`],Yz=[`true`,`false`],Xz={},bOe={a:{attrs:{href:null,ping:null,type:null,media:null,target:Gz,hreflang:null}},abbr:Xz,address:Xz,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:[`default`,`rect`,`circle`,`poly`]}},article:Xz,aside:Xz,audio:{attrs:{src:null,mediagroup:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`none`,`metadata`,`auto`],autoplay:[`autoplay`],loop:[`loop`],controls:[`controls`]}},b:Xz,base:{attrs:{href:null,target:Gz}},bdi:Xz,bdo:Xz,blockquote:{attrs:{cite:null}},body:Xz,br:Xz,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[`autofocus`],disabled:[`autofocus`],formenctype:Jz,formmethod:qz,formnovalidate:[`novalidate`],formtarget:Gz,type:[`submit`,`reset`,`button`]}},canvas:{attrs:{width:null,height:null}},caption:Xz,center:Xz,cite:Xz,code:Xz,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:[`command`,`checkbox`,`radio`],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:[`disabled`],checked:[`checked`]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:[`disabled`],multiple:[`multiple`]}},datalist:{attrs:{data:null}},dd:Xz,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[`open`]}},dfn:Xz,div:Xz,dl:Xz,dt:Xz,em:Xz,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[`disabled`],form:null,name:null}},figcaption:Xz,figure:Xz,footer:Xz,form:{attrs:{action:null,name:null,"accept-charset":Kz,autocomplete:[`on`,`off`],enctype:Jz,method:qz,novalidate:[`novalidate`],target:Gz}},h1:Xz,h2:Xz,h3:Xz,h4:Xz,h5:Xz,h6:Xz,head:{children:[`title`,`base`,`link`,`style`,`meta`,`script`,`noscript`,`command`]},header:Xz,hgroup:Xz,hr:Xz,html:{attrs:{manifest:null}},i:Xz,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:[`allow-top-navigation`,`allow-same-origin`,`allow-forms`,`allow-scripts`],seamless:[`seamless`]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:[`audio/*`,`video/*`,`image/*`],autocomplete:[`on`,`off`],autofocus:[`autofocus`],checked:[`checked`],disabled:[`disabled`],formenctype:Jz,formmethod:qz,formnovalidate:[`novalidate`],formtarget:Gz,multiple:[`multiple`],readonly:[`readonly`],required:[`required`],type:[`hidden`,`text`,`search`,`tel`,`url`,`email`,`password`,`datetime`,`date`,`month`,`week`,`time`,`datetime-local`,`number`,`range`,`color`,`checkbox`,`radio`,`file`,`submit`,`image`,`reset`,`button`]}},ins:{attrs:{cite:null,datetime:null}},kbd:Xz,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[`autofocus`],disabled:[`disabled`],keytype:[`RSA`]}},label:{attrs:{for:null,form:null}},legend:Xz,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:[`all`,`16x16`,`16x16 32x32`,`16x16 32x32 64x64`]}},map:{attrs:{name:null}},mark:Xz,menu:{attrs:{label:null,type:[`list`,`context`,`toolbar`]}},meta:{attrs:{content:null,charset:Kz,name:[`viewport`,`application-name`,`author`,`description`,`generator`,`keywords`],"http-equiv":[`content-language`,`content-type`,`default-style`,`refresh`]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Xz,noscript:Xz,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:[`typemustmatch`]}},ol:{attrs:{reversed:[`reversed`],start:null,type:[`1`,`a`,`A`,`i`,`I`]},children:[`li`,`script`,`template`,`ul`,`ol`]},optgroup:{attrs:{disabled:[`disabled`],label:null}},option:{attrs:{disabled:[`disabled`],label:null,selected:[`selected`],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Xz,param:{attrs:{name:null,value:null}},pre:Xz,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Xz,rt:Xz,ruby:Xz,samp:Xz,script:{attrs:{type:[`text/javascript`],src:null,async:[`async`],defer:[`defer`],charset:Kz}},section:Xz,select:{attrs:{form:null,name:null,size:null,autofocus:[`autofocus`],disabled:[`disabled`],multiple:[`multiple`]}},slot:{attrs:{name:null}},small:Xz,source:{attrs:{src:null,type:null,media:null}},span:Xz,strong:Xz,style:{attrs:{type:[`text/css`],media:null,scoped:null}},sub:Xz,summary:Xz,sup:Xz,table:Xz,tbody:Xz,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Xz,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:[`autofocus`],disabled:[`disabled`],readonly:[`readonly`],required:[`required`],wrap:[`soft`,`hard`]}},tfoot:Xz,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[`row`,`col`,`rowgroup`,`colgroup`]}},thead:Xz,time:{attrs:{datetime:null}},title:Xz,tr:Xz,track:{attrs:{src:null,label:null,default:null,kind:[`subtitles`,`captions`,`descriptions`,`chapters`,`metadata`],srclang:null}},ul:{children:[`li`,`script`,`template`,`ul`,`ol`]},var:Xz,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`auto`,`metadata`,`none`],autoplay:[`autoplay`],mediagroup:[`movie`],muted:[`muted`],controls:[`controls`]}},wbr:Xz},Zz={accesskey:null,class:null,contenteditable:Yz,contextmenu:null,dir:[`ltr`,`rtl`,`auto`],draggable:[`true`,`false`,`auto`],dropzone:[`copy`,`move`,`link`,`string:`,`file:`],hidden:[`hidden`],id:null,inert:[`inert`],itemid:null,itemprop:null,itemref:null,itemscope:[`itemscope`],itemtype:null,lang:[`ar`,`bn`,`de`,`en-GB`,`en-US`,`es`,`fr`,`hi`,`id`,`ja`,`pa`,`pt`,`ru`,`tr`,`zh`],spellcheck:Yz,autocorrect:Yz,autocapitalize:Yz,style:null,tabindex:null,title:null,translate:[`yes`,`no`],rel:[`stylesheet`,`alternate`,`author`,`bookmark`,`help`,`license`,`next`,`nofollow`,`noreferrer`,`prefetch`,`prev`,`search`,`tag`],role:`alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer`.split(` `),"aria-activedescendant":null,"aria-atomic":Yz,"aria-autocomplete":[`inline`,`list`,`both`,`none`],"aria-busy":Yz,"aria-checked":[`true`,`false`,`mixed`,`undefined`],"aria-controls":null,"aria-describedby":null,"aria-disabled":Yz,"aria-dropeffect":null,"aria-expanded":[`true`,`false`,`undefined`],"aria-flowto":null,"aria-grabbed":[`true`,`false`,`undefined`],"aria-haspopup":Yz,"aria-hidden":Yz,"aria-invalid":[`true`,`false`,`grammar`,`spelling`],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":[`off`,`polite`,`assertive`],"aria-multiline":Yz,"aria-multiselectable":Yz,"aria-owns":null,"aria-posinset":null,"aria-pressed":[`true`,`false`,`mixed`,`undefined`],"aria-readonly":Yz,"aria-relevant":null,"aria-required":Yz,"aria-selected":[`true`,`false`,`undefined`],"aria-setsize":null,"aria-sort":[`ascending`,`descending`,`none`,`other`],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Qz=`beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload`.split(` `).map(e=>`on`+e);for(let e of Qz)Zz[e]=null;var $z=class{constructor(e,t){this.tags={...bOe,...e},this.globalAttrs={...Zz,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};$z.default=new $z;function eB(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}function tB(e,t=!1){for(;e;e=e.parent)if(e.name==`Element`)if(t)t=!1;else return e;return null}function nB(e,t,n){return n.tags[eB(e,tB(t))]?.children||n.allTags}function rB(e,t){let n=[];for(let r=tB(t);r&&!r.type.isTop;r=tB(r.parent)){let i=eB(e,r);if(i&&r.lastChild.name==`CloseTag`)break;i&&n.indexOf(i)<0&&(t.name==`EndTag`||t.from>=r.firstChild.to)&&n.push(i)}return n}var iB=/^[:\-\.\w\u00b7-\uffff]*$/;function aB(e,t,n,r,i){let a=/\s*>/.test(e.sliceDoc(i,i+5))?``:`>`,o=tB(n,n.name==`StartTag`||n.name==`TagName`);return{from:r,to:i,options:nB(e.doc,o,t).map(e=>({label:e,type:`type`})).concat(rB(e.doc,n).map((e,t)=>({label:`/`+e,apply:`/`+e+a,type:`type`,boost:99-t}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function oB(e,t,n,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?``:`>`;return{from:n,to:r,options:rB(e.doc,t).map((e,t)=>({label:e,apply:e+i,type:`type`,boost:99-t})),validFor:iB}}function xOe(e,t,n,r){let i=[],a=0;for(let r of nB(e.doc,n,t))i.push({label:`<`+r,type:`type`});for(let t of rB(e.doc,n))i.push({label:`</`+t+`>`,type:`type`,boost:99-a++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function SOe(e,t,n,r,i){let a=tB(n),o=a?t.tags[eB(e.doc,a)]:null,s=o&&o.attrs?Object.keys(o.attrs):[];return{from:r,to:i,options:(o&&o.globalAttrs===!1?s:s.length?s.concat(t.globalAttrNames):t.globalAttrNames).map(e=>({label:e,type:`property`})),validFor:iB}}function COe(e,t,n,r,i){let a=n.parent?.getChild(`AttributeName`),o=[],s;if(a){let c=e.sliceDoc(a.from,a.to),l=t.globalAttrs[c];if(!l){let r=tB(n),i=r?t.tags[eB(e.doc,r)]:null;l=i?.attrs&&i.attrs[c]}if(l){let t=e.sliceDoc(r,i).toLowerCase(),n=`"`,a=`"`;/^['"]/.test(t)?(s=t[0]==`"`?/^[^"]*$/:/^[^']*$/,n=``,a=e.sliceDoc(i,i+1)==t[0]?``:t[0],t=t.slice(1),r++):s=/^[^\s<>='"]*$/;for(let e of l)o.push({label:e,apply:n+e+a,type:`constant`})}}return{from:r,to:i,options:o,validFor:s}}function sB(e,t){let{state:n,pos:r}=t,i=xt(n).resolveInner(r,-1),a=i.resolve(r);for(let e=r,t;a==i&&(t=i.childBefore(e));){let n=t.lastChild;if(!n||!n.type.isError||n.from<n.to)break;a=i=t,e=n.from}return i.name==`TagName`?i.parent&&/CloseTag$/.test(i.parent.name)?oB(n,i,i.from,r):aB(n,e,i,i.from,r):i.name==`StartTag`||i.name==`IncompleteTag`?aB(n,e,i,r,r):i.name==`StartCloseTag`||i.name==`IncompleteCloseTag`?oB(n,i,r,r):i.name==`OpenTag`||i.name==`SelfClosingTag`||i.name==`AttributeName`?SOe(n,e,i,i.name==`AttributeName`?i.from:r,r):i.name==`Is`||i.name==`AttributeValue`||i.name==`UnquotedAttributeValue`?COe(n,e,i,i.name==`Is`?r:i.from,r):t.explicit&&(a.name==`Element`||a.name==`Text`||a.name==`Document`)?xOe(n,e,i,r):null}function cB(e){return sB($z.default,e)}function lB(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new $z(t,n):$z.default;return e=>sB(r,e)}var wOe=Bn.parser.configure({top:`SingleExpression`}),uB=[{tag:`script`,attrs:e=>e.type==`text/typescript`||e.lang==`ts`,parser:zn.parser},{tag:`script`,attrs:e=>e.type==`text/babel`||e.type==`text/jsx`,parser:nee.parser},{tag:`script`,attrs:e=>e.type==`text/typescript-jsx`,parser:tee.parser},{tag:`script`,attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:wOe},{tag:`script`,attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:Bn.parser},{tag:`style`,attrs(e){return(!e.lang||e.lang==`css`)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:Uz.parser}],dB=[{name:`style`,parser:Uz.parser.configure({top:`Styles`})}].concat(Qz.map(e=>({name:e,parser:Bn.parser}))),fB=Dn.define({name:`html`,parser:BDe.configure({props:[_t.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let n=e.node;;){let e=n.lastChild;if(!e||e.name!=`Element`||e.to!=n.to)break;t=n=e}return t&&!((n=t.lastChild)&&(n.name==`CloseTag`||n.name==`SelfClosingTag`))?e.lineIndent(t.from)+e.unit:null}}),ht.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),_n.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:`-_`}}),pB=fB.configure({wrap:wz(uB,dB)});function mB(e={}){let t=``,n;return e.matchClosingTags===!1&&(t=`noMatch`),e.selfClosingTags===!0&&(t=(t?t+` `:``)+`selfClosing`),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=wz((e.nestedLanguages||[]).concat(uB),(e.nestedAttributes||[]).concat(dB))),new An(n?fB.configure({wrap:n,dialect:t}):t?pB.configure({dialect:t}):pB,[pB.data.of({autocomplete:lB(e)}),e.autoCloseTags===!1?[]:gB,Rn().support,Wz().support])}var hB=new Set(`area base br col command embed frame hr img input keygen link meta param source track wbr menuitem`.split(` `)),gB=Ut.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!pB.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let t=o.doc.sliceString(e.from-1,e.to)==r,{head:n}=e,i=xt(o).resolveInner(n,-1),a;if(t&&r==`>`&&i.name==`EndTag`){let t=i.parent;if(t.parent?.lastChild?.name!=`CloseTag`&&(a=eB(o.doc,t.parent,n))&&!hB.has(a))return{range:e,changes:{from:n,to:n+(o.doc.sliceString(n,n+1)===`>`?1:0),insert:`</${a}>`}}}else if(t&&r==`/`&&i.name==`IncompleteCloseTag`){let e=i.parent;if(i.from==n-2&&e.lastChild?.name!=`CloseTag`&&(a=eB(o.doc,e,n))&&!hB.has(a)){let e=n+(o.doc.sliceString(n,n+1)===`>`?1:0),t=`${a}>`;return{range:on.cursor(n+t.length,-1),changes:{from:n,to:e,insert:t}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),_B=Jt({commentTokens:{block:{open:`<!--`,close:`-->`}}}),vB=new pn,yB=UEe.configure({props:[ht.add(e=>!e.is(`Block`)||e.is(`Document`)||bB(e)!=null||TOe(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),vB.add(bB),_t.add({Document:()=>null}),fn.add({Document:_B})]});function bB(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function TOe(e){return e.name==`OrderedList`||e.name==`BulletList`}function EOe(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=bB(e.type))!=null&&r<=t)break;n=e}return n.to}var DOe=Pn.of((e,t,n)=>{for(let r=xt(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(vB);if(e==null)continue;let t=EOe(r,e);if(t>n)return{from:n,to:t}}return null});function xB(e){return new $t(_B,e,[],`markdown`)}var SB=xB(yB),CB=xB(yB.configure([$Ee,tDe,eDe,nDe,{props:[ht.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function OOe(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):B.matchLanguageName(e,n,!0),t instanceof B)return t.support?t.support.language.parser:tn.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var wB=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}else{for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}}marker(e,t){let n=this.node.name==`OrderedList`?String(+EB(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function TB(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new wB(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new wB(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new wB(i.parent,s,s+t,a[1],e,n,i))}}return r}function EB(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function DB(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=EB(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function OB(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(ft)!=` `)return e;let r=vt(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var kB=(e={})=>({state:t,dispatch:n})=>{let r=xt(t),{doc:i}=t,a=null,o=t.changeByRange(n=>{if(!n.empty||!CB.isActiveAt(t,n.from,-1)&&!CB.isActiveAt(t,n.from,1))return a={range:n};let o=n.from,s=i.lineAt(o),c=TB(r.resolveInner(o,-1),i);for(;c.length&&c[c.length-1].from>o-s.from;)c.pop();if(!c.length)return a={range:n};let l=c[c.length-1];if(l.to-l.spaceAfter.length>o-s.from)return a={range:n};let u=o>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&u){let n=l.node.firstChild,r=l.node.getChild(`ListItem`,`ListItem`);if(n.to>=o||r&&r.to<o||s.from>0&&!/[^\s>]/.test(i.lineAt(s.from-1).text)||e.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(i,1)):t=s.from+(e?e.to:0);let r=[{from:t,to:o,insert:n}];return l.node.name==`OrderedList`&&DB(l.item,i,r,-2),e&&e.node.name==`OrderedList`&&DB(e.item,i,r),{range:on.cursor(t+n.length),changes:r}}else{let e=MB(c,t,s);return{range:on.cursor(o+e.length+1),changes:{from:s.from,insert:e+t.lineBreak}}}}if(l.node.name==`Blockquote`&&u&&s.from){let e=i.lineAt(s.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==l.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:s.from+l.from,to:s.to}]);return{range:n.map(i),changes:i}}}let d=[];l.node.name==`OrderedList`&&DB(l.item,i,d);let f=l.item&&l.item.from<s.from,p=``;if(!f||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=l.to)for(let e=0,t=c.length-1;e<=t;e++)p+=e==t&&!f?c[e].marker(i,1):c[e].blank(e<t?vt(s.text,4,c[e+1].from)-p.length:null);let m=o;for(;m>s.from&&/\s/.test(s.text.charAt(m-s.from-1));)m--;return p=OB(p,t),kOe(l.node,t.doc)&&(p=MB(c,t,s)+t.lineBreak+p),d.push({from:m,to:o,insert:t.lineBreak+p}),{range:on.cursor(m+p.length+1),changes:d}});return a?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:`input`})),!0)},AB=kB();function jB(e){return e.name==`QuoteMark`||e.name==`ListMark`}function kOe(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+(o?0:1)<a.number}function MB(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?vt(n.text,4,e[t+1].from)-r.length:null,t<i);return OB(r,t)}function AOe(e,t){let n=e.resolveInner(t,-1),r=t;jB(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(jB(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var NB=({state:e,dispatch:t})=>{let n=xt(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&CB.isActiveAt(e,t.from)){let t=a.lineAt(i),r=TB(AOe(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+(n.spaceAfter?1:0);if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:on.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(vt(t.text,4,n.to)-vt(t.text,4,n.from));return r==t.from&&(i=OB(i,e)),{range:on.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:on.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return r?!1:(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)},PB=[{key:`Enter`,run:AB},{key:`Backspace`,run:NB}],FB=mB({matchClosingTags:!1});function IB(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=SB,completeHTMLTags:a=!0,pasteURLAsLink:o=!0,htmlTagLanguage:s=FB}=e;if(!(i instanceof LEe))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=e.extensions?[e.extensions]:[],l=[s.support,DOe],u;o&&l.push(RB),n instanceof An?(l.push(n.support),u=n.language):n&&(u=n);let d=t||u?OOe(t,u):void 0;c.push(GEe({codeParser:d,htmlParser:s.language.parser})),r&&l.push(cn.high(dt.of(PB)));let f=xB(i.configure(c));return a&&l.push(f.data.of({autocomplete:jOe})),new An(f,l)}function jOe(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=xt(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:MOe(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var LB=null;function MOe(){if(LB)return LB;let e=cB(new Gn(Cn.create({extensions:FB}),0,!0));return LB=e?e.options:[]}var NOe=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,RB=Ut.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!CB.isActiveAt(t.state,n.from,1)))return!1;let i=xt(t.state),a=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||NOe.test(e.name))&&(a=!0)},leave:e=>{e.to<n.to&&(a=!0)}}),a?!1:(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}}),zB=63,BB=64,POe=1,FOe=2,VB=3,IOe=4,HB=5,LOe=6,ROe=7,UB=65,zOe=66,BOe=8,VOe=9,HOe=10,UOe=11,WOe=12,WB=13,GOe=19,KOe=20,qOe=29,JOe=33,YOe=34,XOe=47,ZOe=0,GB=1,KB=2,qB=3,JB=4,YB=class{constructor(e,t,n){this.parent=e,this.depth=t,this.type=n,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)+n}};YB.top=new YB(null,-1,ZOe);function XB(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let t=e.peek(r);if(QB(t)||t==-1)return n}}function ZB(e){return e==32||e==9}function QB(e){return e==10||e==13}function $B(e){return ZB(e)||QB(e)}function eV(e){return e<0||$B(e)}var QOe=new kn({start:YB.top,reduce(e,t){return e.type==qB&&(t==KOe||t==YOe)?e.parent:e},shift(e,t,n,r){if(t==VB)return new YB(e,XB(r,r.pos),GB);if(t==UB||t==HB)return new YB(e,XB(r,r.pos),KB);if(t==zB)return e.parent;if(t==GOe||t==JOe)return new YB(e,0,qB);if(t==WB&&e.type==JB)return e.parent;if(t==XOe){let t=/[1-9]/.exec(r.read(r.pos,n.pos));if(t)return new YB(e,e.depth+ +t[0],JB)}return e},hash(e){return e.hash}});function tV(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&eV(e.peek(n+3))}var $Oe=new yn((e,t)=>{if(e.next==-1&&t.canShift(BB))return e.acceptToken(BB);let n=e.peek(-1);if((QB(n)||n<0)&&t.context.type!=qB){if(tV(e,45))if(t.canShift(zB))e.acceptToken(zB);else return e.acceptToken(POe,3);if(tV(e,46))if(t.canShift(zB))e.acceptToken(zB);else return e.acceptToken(FOe,3);let n=0;for(;e.next==32;)n++,e.advance();(n<t.context.depth||n==t.context.depth&&t.context.type==GB&&(e.next!=45||!eV(e.peek(1))))&&e.next!=-1&&!QB(e.next)&&e.next!=35&&e.acceptToken(zB,-n)}},{contextual:!0}),eke=new yn((e,t)=>{if(t.context.type==qB){e.next==63&&(e.advance(),eV(e.next)&&e.acceptToken(ROe));return}if(e.next==45)e.advance(),eV(e.next)&&e.acceptToken(t.context.type==GB&&t.context.depth==XB(e,e.pos-1)?IOe:VB);else if(e.next==63)e.advance(),eV(e.next)&&e.acceptToken(t.context.type==KB&&t.context.depth==XB(e,e.pos-1)?LOe:HB);else{let n=e.pos;for(;;)if(ZB(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)iV(e);else if(e.next==38)aV(e);else if(e.next==42){aV(e);break}else if(e.next==39||e.next==34){if(oV(e,!0))break;return}else if(e.next==91||e.next==123){if(!nke(e))return;break}else{lV(e,!0,!1,0);break}for(;ZB(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(qOe))return;eV(e.peek(1))&&e.acceptTokenTo(t.context.type==KB&&t.context.depth==XB(e,n)?zOe:UB,n)}}},{contextual:!0});function tke(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function nV(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function rV(e,t){return e.next==37?(e.advance(),nV(e.next)&&e.advance(),nV(e.next)&&e.advance(),!0):tke(e.next)||t&&e.next==44?(e.advance(),!0):!1}function iV(e){if(e.advance(),e.next==60){for(e.advance();;)if(!rV(e,!0)){e.next==62&&e.advance();break}}else for(;rV(e,!1););}function aV(e){for(e.advance();!eV(e.next)&&sV(e.tag)!=`f`;)e.advance()}function oV(e,t){let n=e.next,r=!1,i=e.pos;for(e.advance();;){let a=e.next;if(a<0)break;if(e.advance(),a==n)if(a==39)if(e.next==39)e.advance();else break;else break;else if(a==92&&n==34)e.next>=0&&e.advance();else if(QB(a)){if(t)return!1;r=!0}else if(t&&e.pos>=i+1024)return!1}return!r}function nke(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!oV(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else if(e.next<0||e.pos>n||QB(e.next))return!1;else e.advance()}var rke=`iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif`;function sV(e){return e<33?`u`:e>125?`s`:rke[e-33]}function cV(e,t){let n=sV(e);return n!=`u`&&!(t&&n==`f`)}function lV(e,t,n,r){if(sV(e.next)==`s`||(e.next==63||e.next==58||e.next==45)&&cV(e.peek(1),n))e.advance();else return!1;let i=e.pos;for(;;){let a=e.next,o=0,s=r+1;for(;$B(a);){if(QB(a)){if(t)return!1;s=0}else s++;a=e.peek(++o)}if(!(a>=0&&(a==58?cV(e.peek(o+1),n):a==35?e.peek(o-1)!=32:cV(a,n)))||!n&&s<=r||s==0&&!n&&(tV(e,45,o)||tV(e,46,o)))break;if(t&&sV(a)==`f`)return!1;for(let t=o;t>=0;t--)e.advance();if(t&&e.pos>i+1024)return!1}return!0}var ike=new yn((e,t)=>{if(e.next==33)iV(e),e.acceptToken(WOe);else if(e.next==38||e.next==42){let t=e.next==38?HOe:UOe;aV(e),e.acceptToken(t)}else e.next==39||e.next==34?(oV(e,!1),e.acceptToken(VOe)):lV(e,!1,t.context.type==qB,t.context.depth)&&e.acceptToken(BOe)}),ake=new yn((e,t)=>{let n=t.context.type==JB?t.context.depth:-1,r=e.pos;scan:for(;;){let i=0,a=e.next;for(;a==32;)a=e.peek(++i);if(!i&&(tV(e,45,i)||tV(e,46,i))||!QB(a)&&(n<0&&(n=Math.max(t.context.depth+1,i)),i<n))break;for(;;){if(e.next<0)break scan;let t=QB(e.next);if(e.advance(),t)continue scan;r=e.pos}}e.acceptTokenTo(WB,r)}),oke=Ot({DirectiveName:z.keyword,DirectiveContent:z.attributeValue,"DirectiveEnd DocEnd":z.meta,QuotedLiteral:z.string,BlockLiteralHeader:z.special(z.string),BlockLiteralContent:z.content,Literal:z.content,"Key/Literal Key/QuotedLiteral":z.definition(z.propertyName),"Anchor Alias":z.labelName,Tag:z.typeName,Comment:z.lineComment,": , -":z.separator,"?":z.punctuation,"[ ]":z.squareBracket,"{ }":z.brace}),ske=Tn.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:`⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document`,maxTerm:74,context:QOe,nodeProps:[[`isolate`,-3,8,9,14,``],[`openedBy`,18,`[`,32,`{`],[`closedBy`,19,`]`,33,`}`]],propSources:[oke],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[$Oe,eke,ike,ake,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),cke=Tn.deserialize({version:14,states:"!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:`!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~`,goto:`vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS`,nodeNames:`⚠ Document Frontmatter DashLine FrontmatterContent Body`,maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),uV=Dn.define({name:`yaml`,parser:ske.configure({props:[_t.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name==`BlockLiteralContent`&&t.from<t.to)return e.baseIndentFor(t);if(t.name==`BlockLiteral`)return e.baseIndentFor(t)+e.unit;if(t.name==`BlockSequence`||t.name==`BlockMapping`)return e.column(t.from,1);if(t.name==`QuotedLiteral`)return null;if(t.name==`Literal`){let n=e.column(t.from,1);if(n==e.lineIndent(t.from,1))return n;if(t.to>e.pos)return null}}return null},FlowMapping:Mn({closing:`}`}),FlowSequence:Mn({closing:`]`})}),ht.add({"FlowMapping FlowSequence":Fn,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:`#`},indentOnInput:/^\s*[\]\}]$/}});function dV(){return new An(uV)}Dn.define({name:`yaml-frontmatter`,parser:cke.configure({props:[Ot({DashLine:z.meta})]})});function Q(e){return new An(an.define(e))}function fV(e){return Z(()=>import(`./dist-CdAkpuDK.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([10,11,12]))}var pV=[B.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return Z(()=>import(`./dist-CJCFfS8X.js`).then(e=>e.cpp()),__vite__mapDeps([13,12]))}}),B.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return Z(()=>import(`./dist-CJCFfS8X.js`).then(e=>e.cpp()),__vite__mapDeps([13,12]))}}),B.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return fV(`Cassandra`)}}),B.of({name:`CSS`,extensions:[`css`],load(){return Z(()=>import(`./dist-CYpiS1Zt.js`).then(e=>e.css()),__vite__mapDeps([14,12]))}}),B.of({name:`Go`,extensions:[`go`],load(){return Z(()=>import(`./dist-DbHhRzXY.js`).then(e=>e.go()),__vite__mapDeps([15,11,12]))}}),B.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return Z(()=>import(`./dist-ClUVC_84.js`).then(e=>e.html()),__vite__mapDeps([16,17,2,11,12]))}}),B.of({name:`Java`,extensions:[`java`],load(){return Z(()=>import(`./dist-CnO8PEuw.js`).then(e=>e.java()),__vite__mapDeps([18,12]))}}),B.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return Z(()=>import(`./dist-PYiUsivk.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([17,2,11,12]))}}),B.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return Z(()=>import(`./dist-B6W3pPHs.js`).then(e=>e.jinja()),__vite__mapDeps([19,17,2,11,12]))}}),B.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return Z(()=>import(`./dist-H38juOFW.js`).then(e=>e.json()),__vite__mapDeps([20,12]))}}),B.of({name:`JSX`,extensions:[`jsx`],load(){return Z(()=>import(`./dist-PYiUsivk.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([17,2,11,12]))}}),B.of({name:`LESS`,extensions:[`less`],load(){return Z(()=>import(`./dist-Bcjlb1bO.js`).then(e=>e.less()),__vite__mapDeps([21,12]))}}),B.of({name:`Liquid`,extensions:[`liquid`],load(){return Z(()=>import(`./dist-D1Kgfdnc.js`).then(e=>e.liquid()),__vite__mapDeps([22,17,2,11,12]))}}),B.of({name:`MariaDB SQL`,load(){return fV(`MariaSQL`)}}),B.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return Z(()=>import(`./dist-lYx3EWfZ.js`).then(e=>e.markdown()),__vite__mapDeps([23,17,2,11,12]))}}),B.of({name:`MS SQL`,load(){return fV(`MSSQL`)}}),B.of({name:`MySQL`,load(){return fV(`MySQL`)}}),B.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return Z(()=>import(`./dist-PiPP3-Ah.js`).then(e=>e.php()),__vite__mapDeps([24,17,2,11,12]))}}),B.of({name:`PLSQL`,extensions:[`pls`],load(){return fV(`PLSQL`)}}),B.of({name:`PostgreSQL`,load(){return fV(`PostgreSQL`)}}),B.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return Z(()=>import(`./dist-CGJy4k2t.js`).then(e=>e.python()),__vite__mapDeps([25,11,12]))}}),B.of({name:`Rust`,extensions:[`rs`],load(){return Z(()=>import(`./dist-DsHxTxcA.js`).then(e=>e.rust()),__vite__mapDeps([26,12]))}}),B.of({name:`Sass`,extensions:[`sass`],load(){return Z(()=>import(`./dist-k_96dSjT.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([27,12]))}}),B.of({name:`SCSS`,extensions:[`scss`],load(){return Z(()=>import(`./dist-k_96dSjT.js`).then(e=>e.sass()),__vite__mapDeps([27,12]))}}),B.of({name:`SQL`,extensions:[`sql`],load(){return fV(`StandardSQL`)}}),B.of({name:`SQLite`,load(){return fV(`SQLite`)}}),B.of({name:`TSX`,extensions:[`tsx`],load(){return Z(()=>import(`./dist-PYiUsivk.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([17,2,11,12]))}}),B.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return Z(()=>import(`./dist-PYiUsivk.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([17,2,11,12]))}}),B.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return Z(()=>import(`./dist-BT7-2C5q.js`).then(e=>e.wast()),__vite__mapDeps([28,12]))}}),B.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return Z(()=>import(`./dist-B1p1fIxA.js`).then(e=>e.xml()),__vite__mapDeps([29,12]))}}),B.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return Z(()=>import(`./dist-CWb-aAQf.js`).then(e=>e.yaml()),__vite__mapDeps([30,12]))}}),B.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return Z(()=>import(`./apl-CYISZphB.js`).then(e=>Q(e.apl)),[])}}),B.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return Z(()=>import(`./asciiarmor-HBcwrfTl.js`).then(e=>Q(e.asciiArmor)),[])}}),B.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return Z(()=>import(`./asn1-B7aRTScN.js`).then(e=>Q(e.asn1({}))),[])}}),B.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return Z(()=>import(`./asterisk-DN6Y5NwP.js`).then(e=>Q(e.asterisk)),[])}}),B.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return Z(()=>import(`./brainfuck-CuRUsj7k.js`).then(e=>Q(e.brainfuck)),[])}}),B.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return Z(()=>import(`./cobol-mb97iEDV.js`).then(e=>Q(e.cobol)),[])}}),B.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return Z(()=>import(`./clike-B8uP_5i6.js`).then(e=>Q(e.csharp)),[])}}),B.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return Z(()=>import(`./clojure-DhLYUYUD.js`).then(e=>Q(e.clojure)),[])}}),B.of({name:`ClojureScript`,extensions:[`cljs`],load(){return Z(()=>import(`./clojure-DhLYUYUD.js`).then(e=>Q(e.clojure)),[])}}),B.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return Z(()=>import(`./css-BEerEcwg.js`).then(e=>Q(e.gss)),[])}}),B.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return Z(()=>import(`./cmake-CrkTPxpC.js`).then(e=>Q(e.cmake)),[])}}),B.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return Z(()=>import(`./coffeescript-CpkMzBuh.js`).then(e=>Q(e.coffeeScript)),[])}}),B.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return Z(()=>import(`./commonlisp-Bvx01cnI.js`).then(e=>Q(e.commonLisp)),[])}}),B.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return Z(()=>import(`./cypher-BWxkUNlk.js`).then(e=>Q(e.cypher)),[])}}),B.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return Z(()=>import(`./python-CYXPDD4I.js`).then(e=>Q(e.cython)),[])}}),B.of({name:`Crystal`,extensions:[`cr`],load(){return Z(()=>import(`./crystal-BpH_STG5.js`).then(e=>Q(e.crystal)),[])}}),B.of({name:`D`,extensions:[`d`],load(){return Z(()=>import(`./d-BbO5ubRg.js`).then(e=>Q(e.d)),[])}}),B.of({name:`Dart`,extensions:[`dart`],load(){return Z(()=>import(`./clike-B8uP_5i6.js`).then(e=>Q(e.dart)),[])}}),B.of({name:`diff`,extensions:[`diff`,`patch`],load(){return Z(()=>import(`./diff-jUUrepKE.js`).then(e=>Q(e.diff)),[])}}),B.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return Z(()=>import(`./dockerfile-DPZmz0mC.js`).then(e=>Q(e.dockerFile)),__vite__mapDeps([31,32]))}}),B.of({name:`DTD`,extensions:[`dtd`],load(){return Z(()=>import(`./dtd-CVCnBQzV.js`).then(e=>Q(e.dtd)),[])}}),B.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return Z(()=>import(`./dylan-BoJgTcA5.js`).then(e=>Q(e.dylan)),[])}}),B.of({name:`EBNF`,load(){return Z(()=>import(`./ebnf-DhPacwJT.js`).then(e=>Q(e.ebnf)),[])}}),B.of({name:`ECL`,extensions:[`ecl`],load(){return Z(()=>import(`./ecl-BMVjKtDk.js`).then(e=>Q(e.ecl)),[])}}),B.of({name:`edn`,extensions:[`edn`],load(){return Z(()=>import(`./clojure-DhLYUYUD.js`).then(e=>Q(e.clojure)),[])}}),B.of({name:`Eiffel`,extensions:[`e`],load(){return Z(()=>import(`./eiffel-ChPO0raq.js`).then(e=>Q(e.eiffel)),[])}}),B.of({name:`Elm`,extensions:[`elm`],load(){return Z(()=>import(`./elm-BFrHhzOf.js`).then(e=>Q(e.elm)),[])}}),B.of({name:`Erlang`,extensions:[`erl`],load(){return Z(()=>import(`./erlang-B1G82j14.js`).then(e=>Q(e.erlang)),[])}}),B.of({name:`Esper`,load(){return Z(()=>import(`./sql-B8tBavZM.js`).then(e=>Q(e.esper)),[])}}),B.of({name:`Factor`,extensions:[`factor`],load(){return Z(()=>import(`./factor-B0X9gnIy.js`).then(e=>Q(e.factor)),__vite__mapDeps([33,32]))}}),B.of({name:`FCL`,load(){return Z(()=>import(`./fcl-nCo1IVPi.js`).then(e=>Q(e.fcl)),[])}}),B.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return Z(()=>import(`./forth-CftEcDBX.js`).then(e=>Q(e.forth)),[])}}),B.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return Z(()=>import(`./fortran-B6GPIfoB.js`).then(e=>Q(e.fortran)),[])}}),B.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return Z(()=>import(`./mllike-BmhQglqS.js`).then(e=>Q(e.fSharp)),[])}}),B.of({name:`Gas`,extensions:[`s`],load(){return Z(()=>import(`./gas-DR4EL-uU.js`).then(e=>Q(e.gas)),[])}}),B.of({name:`Gherkin`,extensions:[`feature`],load(){return Z(()=>import(`./gherkin-Cpl0I9V7.js`).then(e=>Q(e.gherkin)),[])}}),B.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return Z(()=>import(`./groovy-DLlEwdqc.js`).then(e=>Q(e.groovy)),[])}}),B.of({name:`Haskell`,extensions:[`hs`],load(){return Z(()=>import(`./haskell-nNlu0Bhn.js`).then(e=>Q(e.haskell)),[])}}),B.of({name:`Haxe`,extensions:[`hx`],load(){return Z(()=>import(`./haxe-DsvjREf7.js`).then(e=>Q(e.haxe)),[])}}),B.of({name:`HXML`,extensions:[`hxml`],load(){return Z(()=>import(`./haxe-DsvjREf7.js`).then(e=>Q(e.hxml)),[])}}),B.of({name:`HTTP`,load(){return Z(()=>import(`./http-D_KkyP4m.js`).then(e=>Q(e.http)),[])}}),B.of({name:`IDL`,extensions:[`pro`],load(){return Z(()=>import(`./idl-Bqii7Vbi.js`).then(e=>Q(e.idl)),[])}}),B.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return Z(()=>import(`./javascript-LCSAwviG.js`).then(e=>Q(e.jsonld)),[])}}),B.of({name:`Julia`,extensions:[`jl`],load(){return Z(()=>import(`./julia-ByGjwiLn.js`).then(e=>Q(e.julia)),[])}}),B.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return Z(()=>import(`./clike-B8uP_5i6.js`).then(e=>Q(e.kotlin)),[])}}),B.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return Z(()=>import(`./livescript-B8l2m7xO.js`).then(e=>Q(e.liveScript)),[])}}),B.of({name:`Lua`,extensions:[`lua`],load(){return Z(()=>import(`./lua-DrfAKnQQ.js`).then(e=>Q(e.lua)),[])}}),B.of({name:`mIRC`,extensions:[`mrc`],load(){return Z(()=>import(`./mirc-DStbUCmv.js`).then(e=>Q(e.mirc)),[])}}),B.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return Z(()=>import(`./mathematica-DYk_2Ik_.js`).then(e=>Q(e.mathematica)),[])}}),B.of({name:`Modelica`,extensions:[`mo`],load(){return Z(()=>import(`./modelica-ZElxtbqD.js`).then(e=>Q(e.modelica)),[])}}),B.of({name:`MUMPS`,extensions:[`mps`],load(){return Z(()=>import(`./mumps-B79RJJhR.js`).then(e=>Q(e.mumps)),[])}}),B.of({name:`Mbox`,extensions:[`mbox`],load(){return Z(()=>import(`./mbox-BOzVHzVt.js`).then(e=>Q(e.mbox)),[])}}),B.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return Z(()=>import(`./nginx-c--axfuP.js`).then(e=>Q(e.nginx)),[])}}),B.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return Z(()=>import(`./nsis-CqLr_sRu.js`).then(e=>Q(e.nsis)),__vite__mapDeps([34,32]))}}),B.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return Z(()=>import(`./ntriples-CgD4YZZC.js`).then(e=>Q(e.ntriples)),[])}}),B.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return Z(()=>import(`./clike-B8uP_5i6.js`).then(e=>Q(e.objectiveC)),[])}}),B.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return Z(()=>import(`./clike-B8uP_5i6.js`).then(e=>Q(e.objectiveCpp)),[])}}),B.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return Z(()=>import(`./mllike-BmhQglqS.js`).then(e=>Q(e.oCaml)),[])}}),B.of({name:`Octave`,extensions:[`m`],load(){return Z(()=>import(`./octave-BQk-bCrp.js`).then(e=>Q(e.octave)),[])}}),B.of({name:`Oz`,extensions:[`oz`],load(){return Z(()=>import(`./oz-DPCSPrx5.js`).then(e=>Q(e.oz)),[])}}),B.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return Z(()=>import(`./pascal-C1iGzZ53.js`).then(e=>Q(e.pascal)),[])}}),B.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return Z(()=>import(`./perl-DQ3L8ffg.js`).then(e=>Q(e.perl)),[])}}),B.of({name:`Pig`,extensions:[`pig`],load(){return Z(()=>import(`./pig-B4S8acys.js`).then(e=>Q(e.pig)),[])}}),B.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return Z(()=>import(`./powershell-BhSVdaeY.js`).then(e=>Q(e.powerShell)),[])}}),B.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return Z(()=>import(`./properties-B2nfdtxE.js`).then(e=>Q(e.properties)),[])}}),B.of({name:`ProtoBuf`,extensions:[`proto`],load(){return Z(()=>import(`./protobuf-BFW_iwVN.js`).then(e=>Q(e.protobuf)),[])}}),B.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return Z(()=>import(`./pug-B2drGkIO.js`).then(e=>Q(e.pug)),__vite__mapDeps([35,36]))}}),B.of({name:`Puppet`,extensions:[`pp`],load(){return Z(()=>import(`./puppet-C1-CkyhQ.js`).then(e=>Q(e.puppet)),[])}}),B.of({name:`Q`,extensions:[`q`],load(){return Z(()=>import(`./q-Bub5Xmxm.js`).then(e=>Q(e.q)),[])}}),B.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return Z(()=>import(`./r-C59ONZO2.js`).then(e=>Q(e.r)),[])}}),B.of({name:`RPM Changes`,load(){return Z(()=>import(`./rpm-DiM-R-wd.js`).then(e=>Q(e.rpmChanges)),[])}}),B.of({name:`RPM Spec`,extensions:[`spec`],load(){return Z(()=>import(`./rpm-DiM-R-wd.js`).then(e=>Q(e.rpmSpec)),[])}}),B.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return Z(()=>import(`./ruby-DTqG95KX.js`).then(e=>Q(e.ruby)),[])}}),B.of({name:`SAS`,extensions:[`sas`],load(){return Z(()=>import(`./sas-BjdhmGHX.js`).then(e=>Q(e.sas)),[])}}),B.of({name:`Scala`,extensions:[`scala`],load(){return Z(()=>import(`./clike-B8uP_5i6.js`).then(e=>Q(e.scala)),[])}}),B.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return Z(()=>import(`./scheme-CWNdoI17.js`).then(e=>Q(e.scheme)),[])}}),B.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return Z(()=>import(`./shell-iaorleRB.js`).then(e=>Q(e.shell)),[])}}),B.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return Z(()=>import(`./sieve-D8m9Etmd.js`).then(e=>Q(e.sieve)),[])}}),B.of({name:`Smalltalk`,extensions:[`st`],load(){return Z(()=>import(`./smalltalk-28WS1mUj.js`).then(e=>Q(e.smalltalk)),[])}}),B.of({name:`Solr`,load(){return Z(()=>import(`./solr-x8qQ6eAP.js`).then(e=>Q(e.solr)),[])}}),B.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return Z(()=>import(`./mllike-BmhQglqS.js`).then(e=>Q(e.sml)),[])}}),B.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return Z(()=>import(`./sparql-BvLmi7B6.js`).then(e=>Q(e.sparql)),[])}}),B.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return Z(()=>import(`./spreadsheet-BuqSwScP.js`).then(e=>Q(e.spreadsheet)),[])}}),B.of({name:`Squirrel`,extensions:[`nut`],load(){return Z(()=>import(`./clike-B8uP_5i6.js`).then(e=>Q(e.squirrel)),[])}}),B.of({name:`Stylus`,extensions:[`styl`],load(){return Z(()=>import(`./stylus-CMEhEjuV.js`).then(e=>Q(e.stylus)),[])}}),B.of({name:`Swift`,extensions:[`swift`],load(){return Z(()=>import(`./swift-wY9II8hY.js`).then(e=>Q(e.swift)),[])}}),B.of({name:`sTeX`,load(){return Z(()=>import(`./stex-Bx4bLPxI.js`).then(e=>Q(e.stex)),[])}}),B.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return Z(()=>import(`./stex-Bx4bLPxI.js`).then(e=>Q(e.stex)),[])}}),B.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return Z(()=>import(`./verilog-DbEC7ose.js`).then(e=>Q(e.verilog)),[])}}),B.of({name:`Tcl`,extensions:[`tcl`],load(){return Z(()=>import(`./tcl-BGywDEsi.js`).then(e=>Q(e.tcl)),[])}}),B.of({name:`Textile`,extensions:[`textile`],load(){return Z(()=>import(`./textile-K_mvsehZ.js`).then(e=>Q(e.textile)),[])}}),B.of({name:`TiddlyWiki`,load(){return Z(()=>import(`./tiddlywiki-BrpeQ34q.js`).then(e=>Q(e.tiddlyWiki)),[])}}),B.of({name:`Tiki wiki`,load(){return Z(()=>import(`./tiki-z2eQQPgI.js`).then(e=>Q(e.tiki)),[])}}),B.of({name:`TOML`,extensions:[`toml`],load(){return Z(()=>import(`./toml-Dcu7S7XA.js`).then(e=>Q(e.toml)),[])}}),B.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return Z(()=>import(`./troff-Djlumm7T.js`).then(e=>Q(e.troff)),[])}}),B.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return Z(()=>import(`./ttcn-XqU6tthJ.js`).then(e=>Q(e.ttcn)),[])}}),B.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return Z(()=>import(`./ttcn-cfg-BzD0wr3i.js`).then(e=>Q(e.ttcnCfg)),[])}}),B.of({name:`Turtle`,extensions:[`ttl`],load(){return Z(()=>import(`./turtle-DcjXkx6M.js`).then(e=>Q(e.turtle)),[])}}),B.of({name:`Web IDL`,extensions:[`webidl`],load(){return Z(()=>import(`./webidl-CnE8KY-y.js`).then(e=>Q(e.webIDL)),[])}}),B.of({name:`VB.NET`,extensions:[`vb`],load(){return Z(()=>import(`./vb-DV4y2QrD.js`).then(e=>Q(e.vb)),[])}}),B.of({name:`VBScript`,extensions:[`vbs`],load(){return Z(()=>import(`./vbscript-BS8DsYJ_.js`).then(e=>Q(e.vbScript)),[])}}),B.of({name:`Velocity`,extensions:[`vtl`],load(){return Z(()=>import(`./velocity-CS6Ly2yV.js`).then(e=>Q(e.velocity)),[])}}),B.of({name:`Verilog`,extensions:[`v`],load(){return Z(()=>import(`./verilog-DbEC7ose.js`).then(e=>Q(e.verilog)),[])}}),B.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return Z(()=>import(`./vhdl-DBLrW9bF.js`).then(e=>Q(e.vhdl)),[])}}),B.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return Z(()=>import(`./xquery--K5Za5EW.js`).then(e=>Q(e.xQuery)),[])}}),B.of({name:`Yacas`,extensions:[`ys`],load(){return Z(()=>import(`./yacas-ClQfYBmX.js`).then(e=>Q(e.yacas)),[])}}),B.of({name:`Z80`,extensions:[`z80`],load(){return Z(()=>import(`./z80-Dr2oR3X2.js`).then(e=>Q(e.z80)),[])}}),B.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return Z(()=>import(`./mscgen-f-YxHPr0.js`).then(e=>Q(e.mscgen)),[])}}),B.of({name:`Xù`,extensions:[`xu`],load(){return Z(()=>import(`./mscgen-f-YxHPr0.js`).then(e=>Q(e.xu)),[])}}),B.of({name:`MsGenny`,extensions:[`msgenny`],load(){return Z(()=>import(`./mscgen-f-YxHPr0.js`).then(e=>Q(e.msgenny)),[])}}),B.of({name:`Vue`,extensions:[`vue`],load(){return Z(()=>import(`./dist-D64HT2KR.js`).then(e=>e.vue()),__vite__mapDeps([37,17,2,11,12]))}}),B.of({name:`Angular Template`,load(){return Z(()=>import(`./dist-BKobWYD3.js`).then(e=>e.angular()),__vite__mapDeps([38,17,2,11,12]))}})],mV={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},lke={borderLeftWidth:`2px`},hV={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},gV={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},_V={border:`none`,borderRadius:`4px`,padding:`2px 10px`},uke={borderRadius:`2px`},vV={borderRadius:`2px`},yV={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},bV={width:`12px`,height:`12px`,borderRadius:`6px`},xV={borderRadius:`4px`,padding:`2px 6px`},SV={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},CV=`#0d1117`,wV=`#c9d1d9`,TV=`#264F78`,EV=`#8b949e`,DV=`#ffffff`,OV=`#7ee787`,kV=`#d2a8ff`,AV=`#79c0ff`,jV=`#ff7b72`,MV=`#a5d6ff`,dke=`#2c333a`,fke=`#3c444d`,NV=`#ffab70`,PV=`#161b22`,FV=`#30363d`,pke=`#21262d`,IV=`#f97583`,mke=`#2d333b1a`,LV=`#21262d`,RV=DV,zV=TV,hke=`#3a587a75`,BV=`#4d90fe`,VV=`#d29922`,gke=`#3a587a55`,HV=`#58a6ff`,_ke=`#bc8cff`,UV=`#2ea04350`,WV=`#f8514940`,GV=`#7ee787`,KV=`#ff7b72`,qV=[Ut.theme({"&":{color:wV,backgroundColor:CV,fontSize:mV.fontSize,fontFamily:mV.fontFamily},".cm-content":{caretColor:RV,lineHeight:mV.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:RV,borderLeftWidth:lke.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${RV}99`,color:CV},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:zV},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#3a587a`,outline:`1px solid ${AV}`,color:wV,borderRadius:xV.borderRadius,"& span":{color:wV}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:BV,color:DV,padding:xV.padding,"& span":{color:DV}},".cm-search.cm-panel.cm-textfield":{color:wV,borderRadius:xV.borderRadius,padding:xV.padding},".cm-panels":{backgroundColor:LV,color:wV,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${FV}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${FV}`},".cm-panel button":{backgroundColor:LV,color:wV,border:_V.border,borderRadius:_V.borderRadius,padding:_V.padding},".cm-panel button:hover":{backgroundColor:dke},".cm-activeLine":{backgroundColor:mke,borderRadius:uke.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:PV,color:EV,border:gV.border,borderRight:`1px solid #30363d`,paddingRight:gV.paddingRight},".cm-activeLineGutter":{backgroundColor:pke,color:wV,fontWeight:gV.fontWeight},".cm-lineNumbers":{fontSize:gV.fontSize,lineHeight:gV.lineHeight},".cm-foldGutter":{fontSize:gV.fontSize,lineHeight:gV.lineHeight},".cm-foldGutter .cm-gutterElement":{color:EV,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:wV},".cm-insertedLine":{textDecoration:hV.insertedTextDecoration,backgroundColor:UV,color:GV,padding:hV.insertedLinePadding,borderRadius:hV.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:hV.insertedTextDecoration,backgroundColor:`${UV} !important`,color:GV,padding:hV.insertedLinePadding,borderRadius:hV.borderRadious,border:`1px solid ${GV}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:hV.deletedTextDecoration,backgroundColor:WV,color:KV,padding:hV.insertedLinePadding,borderRadius:hV.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:hV.deletedTextDecoration,backgroundColor:`${WV} !important`,color:KV,padding:hV.insertedLinePadding,borderRadius:hV.borderRadious,border:`1px solid ${KV}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:LV,border:`1px solid ${FV}`,borderRadius:SV.borderRadius,padding:SV.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:LV,border:`none`},"& > ul > li":{padding:SV.padding,lineHeight:SV.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:zV,color:DV,borderRadius:SV.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:EV,paddingRight:SV.paddingRight},"& > ul > li > span.cm-completionDetail":{color:EV,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:LV,borderBottomColor:LV},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${IV}`},"&-warning":{borderLeft:`3px solid ${VV}`},"&-info":{borderLeft:`3px solid ${HV}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${IV}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${VV}`},".cm-matchingBracket":{backgroundColor:hke,outline:`1px solid ${BV}`,borderRadius:vV.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#f9758340`,outline:`1px solid ${IV}`,borderRadius:vV.borderRadius},".cm-selectionMatch":{backgroundColor:gke,outline:`1px solid ${TV}50`,borderRadius:vV.borderRadius},".cm-foldPlaceholder":{backgroundColor:LV,color:EV,border:`1px dotted ${FV}70`,borderRadius:yV.borderRadius,padding:yV.padding,margin:yV.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${CV}, 0 0 0 3px ${HV}40`},"& .cm-scroller::-webkit-scrollbar":{width:bV.width,height:bV.height},"& .cm-scroller::-webkit-scrollbar-track":{background:PV},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:FV,borderRadius:bV.borderRadius,border:`3px solid ${PV}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:fke},".cm-ghostText":{opacity:`0.5`,color:EV}},{dark:!0}),Ft(Yt.define([{tag:z.keyword,color:jV,fontWeight:`bold`},{tag:z.controlKeyword,color:jV,fontWeight:`bold`},{tag:z.moduleKeyword,color:jV,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:AV},{tag:[z.variableName],color:AV},{tag:[z.propertyName],color:kV,fontStyle:`normal`},{tag:[z.typeName],color:jV},{tag:[z.className],color:kV,fontStyle:`italic`},{tag:[z.namespace],color:AV,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:wV},{tag:[z.bracket],color:EV},{tag:[z.brace],color:EV},{tag:[z.punctuation],color:EV},{tag:[z.function(z.variableName),z.labelName],color:OV},{tag:[z.definition(z.variableName)],color:AV},{tag:z.number,color:NV},{tag:z.changed,color:NV},{tag:z.annotation,color:IV,fontStyle:`italic`},{tag:z.modifier,color:NV,fontStyle:`italic`},{tag:z.self,color:NV},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:NV},{tag:[z.atom,z.bool,z.special(z.variableName)],color:NV},{tag:[z.processingInstruction,z.inserted],color:OV},{tag:[z.special(z.string),z.regexp],color:MV},{tag:z.string,color:MV},{tag:z.definition(z.typeName),color:jV,fontWeight:`bold`},{tag:z.meta,color:EV},{tag:z.comment,fontStyle:`italic`,color:EV},{tag:z.docComment,fontStyle:`italic`,color:EV},{tag:[z.tagName],color:OV},{tag:[z.attributeName],color:kV},{tag:[z.heading],fontWeight:`bold`,color:AV},{tag:[z.strong],fontWeight:`bold`,color:AV},{tag:[z.emphasis],fontStyle:`italic`,color:MV},{tag:[z.link],color:_ke,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:HV,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:wV,textDecoration:`underline wavy`,borderBottom:`1px wavy ${IV}`},{tag:[z.strikethrough],color:IV,textDecoration:`line-through`},{tag:z.constant(z.name),color:NV},{tag:z.deleted,color:IV},{tag:z.squareBracket,color:EV},{tag:z.angleBracket,color:EV},{tag:z.monospace,color:wV},{tag:[z.contentSeparator],color:AV},{tag:z.quote,color:EV}]))],JV={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},vke={borderLeftWidth:`2px`},YV={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},XV={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},ZV={border:`none`,borderRadius:`4px`,padding:`2px 10px`},yke={borderRadius:`2px`},QV={borderRadius:`2px`},$V={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},eH={width:`12px`,height:`12px`,borderRadius:`6px`},tH={borderRadius:`4px`,padding:`2px 6px`},nH={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},rH=`#ffffff`,iH=`#24292e`,aH=`#BBDFFF`,oH=`#6e7781`,sH=`#f6f8fa`,bke=`#116329`,cH=`#6a737d`,lH=`#6f42c1`,uH=`#005cc5`,dH=`#d73a49`,fH=`#032f62`,pH=`#22863a`,mH=`#e36209`,xke=`#f1f8ff`,hH=`#e1e4e8`,Ske=`#f8f9fa`,gH=`#cb2431`,Cke=`#BBDFFF20`,_H=Ske,vH=iH,wke=aH,Tke=`#e8f0fe`,Eke=`#0366d6`,yH=`#b08800`,bH=`#79b8ff40`,xH=`#0969da`,Dke=`#8250df`,SH=`#e6ffec80`,CH=`#ffebe980`,wH=`#0f6d31`,TH=`#cf222e`,EH=[Ut.theme({"&":{color:iH,backgroundColor:rH,fontSize:JV.fontSize,fontFamily:JV.fontFamily},".cm-content":{caretColor:vH,lineHeight:JV.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:vH,borderLeftWidth:vke.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${vH}99`,color:rH},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:wke,color:iH},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#daebff`,outline:`1px solid ${uH}`,color:iH,borderRadius:tH.borderRadius,"& span":{color:iH}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#79b8ff`,color:rH,padding:tH.padding,"& span":{color:rH}},".cm-search.cm-panel.cm-textfield":{color:iH,borderRadius:tH.borderRadius,padding:tH.padding},".cm-panels":{backgroundColor:sH,color:oH,borderRadius:`0 0 4px 4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${hH}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${hH}`},".cm-panel button":{backgroundColor:rH,color:iH,border:ZV.border,borderRadius:ZV.borderRadius,padding:ZV.padding},".cm-panel button:hover":{backgroundColor:`#f5f5f5`},".cm-activeLine":{backgroundColor:Cke,borderRadius:yke.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:sH,color:oH,border:XV.border,borderRight:`1px solid ${hH}`,paddingRight:XV.paddingRight},".cm-activeLineGutter":{backgroundColor:xke,color:iH,fontWeight:XV.fontWeight},".cm-lineNumbers":{fontSize:XV.fontSize,lineHeight:XV.lineHeight},".cm-foldGutter":{fontSize:XV.fontSize,lineHeight:XV.lineHeight},".cm-foldGutter .cm-gutterElement":{color:oH,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:iH},".cm-insertedLine":{textDecoration:YV.insertedTextDecoration,backgroundColor:SH,color:wH,padding:YV.insertedLinePadding,borderRadius:YV.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:YV.insertedTextDecoration,backgroundColor:`${SH} !important`,color:wH,padding:YV.insertedLinePadding,borderRadius:YV.borderRadious,border:`1px solid ${wH}30`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:YV.deletedTextDecoration,backgroundColor:CH,color:TH,padding:YV.insertedLinePadding,borderRadius:YV.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:YV.deletedTextDecoration,backgroundColor:`${CH} !important`,color:TH,padding:YV.insertedLinePadding,borderRadius:YV.borderRadious,border:`1px solid ${TH}30`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:_H,border:`1px solid ${hH}`,borderRadius:nH.borderRadius,padding:nH.padding,boxShadow:`0 1px 5px rgba(0, 0, 0, 0.1)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:_H,border:`none`},"& > ul > li":{padding:nH.padding,lineHeight:nH.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#0366d630`,color:iH,borderRadius:nH.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:`#0366d615`},"& > ul > li > span.cm-completionIcon":{color:oH,paddingRight:nH.paddingRight},"& > ul > li > span.cm-completionDetail":{color:oH,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:_H,borderBottomColor:_H},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${gH}`},"&-warning":{borderLeft:`3px solid ${yH}`},"&-info":{borderLeft:`3px solid ${xH}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${gH}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${yH}`},".cm-matchingBracket":{backgroundColor:Tke,outline:`1px solid ${Eke}80`,borderRadius:QV.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#ffeef080`,outline:`1px solid ${gH}`,borderRadius:QV.borderRadius},".cm-selectionMatch":{backgroundColor:bH,outline:`1px solid ${aH}50`,borderRadius:QV.borderRadius},".cm-foldPlaceholder":{backgroundColor:bH,color:oH,border:`1px dotted ${hH}70`,borderRadius:$V.borderRadius,padding:$V.padding,margin:$V.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${rH}, 0 0 0 3px ${xH}40`},"& .cm-scroller::-webkit-scrollbar":{width:eH.width,height:eH.height},"& .cm-scroller::-webkit-scrollbar-track":{background:hH},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:iH,borderRadius:eH.borderRadius,border:`3px solid ${hH}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:cH},".cm-ghostText":{opacity:`0.5`,color:`#959da5`}},{dark:!1}),Ft(Yt.define([{tag:z.keyword,color:dH,fontWeight:`bold`},{tag:z.controlKeyword,color:dH,fontWeight:`bold`},{tag:z.moduleKeyword,color:dH,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:uH},{tag:[z.variableName],color:uH},{tag:[z.propertyName],color:lH,fontStyle:`normal`},{tag:[z.typeName],color:dH},{tag:[z.className],color:lH,fontStyle:`italic`},{tag:[z.namespace],color:uH,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:iH},{tag:[z.bracket],color:cH},{tag:[z.brace],color:cH},{tag:[z.punctuation],color:cH},{tag:[z.function(z.variableName),z.labelName],color:pH},{tag:[z.definition(z.variableName)],color:uH},{tag:z.number,color:mH},{tag:z.changed,color:mH},{tag:z.annotation,color:gH,fontStyle:`italic`},{tag:z.modifier,color:mH,fontStyle:`italic`},{tag:z.self,color:mH},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:mH},{tag:[z.atom,z.bool,z.special(z.variableName)],color:mH},{tag:[z.processingInstruction,z.inserted],color:pH},{tag:[z.special(z.string),z.regexp],color:fH},{tag:z.string,color:fH},{tag:z.definition(z.typeName),color:dH,fontWeight:`bold`},{tag:z.meta,color:cH},{tag:z.comment,fontStyle:`italic`,color:cH},{tag:z.docComment,fontStyle:`italic`,color:cH},{tag:[z.tagName],color:bke},{tag:[z.attributeName],color:lH},{tag:[z.heading],fontWeight:`bold`,color:uH},{tag:[z.strong],fontWeight:`bold`,color:uH},{tag:[z.emphasis],fontStyle:`italic`,color:fH},{tag:[z.link],color:Dke,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:xH,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:iH,textDecoration:`underline wavy`,borderBottom:`1px wavy ${gH}`},{tag:[z.strikethrough],color:gH,textDecoration:`line-through`},{tag:z.constant(z.name),color:mH},{tag:z.deleted,color:gH},{tag:z.squareBracket,color:cH},{tag:z.angleBracket,color:cH},{tag:z.monospace,color:iH},{tag:[z.contentSeparator],color:uH},{tag:z.quote,color:cH}]))],DH={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},Oke={borderLeftWidth:`2px`},OH={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},kH={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},AH={border:`none`,borderRadius:`4px`,padding:`2px 10px`},kke={borderRadius:`2px`},jH={borderRadius:`2px`},MH={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},NH={width:`12px`,height:`12px`,borderRadius:`6px`},PH={borderRadius:`4px`,padding:`2px 6px`},FH={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},IH=`#282828`,LH=`#3c3836`,RH=`#504945`,zH=`#665c54`,Ake=`#7c6f64`,BH=`#928374`,VH=`#fbf1c7`,HH=`#ebdbb2`,UH=`#fb4934`,WH=`#b8bb26`,GH=`#fabd2f`,KH=`#83a598`,qH=`#d3869b`,JH=`#8ec07c`,YH=`#fe8019`,XH=UH,jke=LH,Mke=`#3c383660`,Nke=IH,ZH=LH,QH=RH,Pke=`#665c5480`,$H=YH,Fke=`#504945cc`,Ike=GH,eU=GH,tU=KH,Lke=qH,nU=`#32361a80`,rU=`#3c1f1e80`,iU=`#b8bb26`,aU=`#fb4934`,Rke=[Ut.theme({"&":{color:HH,backgroundColor:Nke,fontSize:DH.fontSize,fontFamily:DH.fontFamily},".cm-content":{caretColor:$H,lineHeight:DH.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:$H,borderLeftWidth:Oke.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${$H}99`,color:IH},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:QH},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#b57614cc`,outline:`1px solid ${GH}`,color:VH,borderRadius:PH.borderRadius,"& span":{color:VH}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:YH,color:IH,padding:PH.padding,"& span":{color:IH}},".cm-search.cm-panel.cm-textfield":{color:HH,borderRadius:PH.borderRadius,padding:PH.padding},".cm-panels":{backgroundColor:ZH,color:HH,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${zH}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${zH}`},".cm-panel button":{backgroundColor:ZH,color:HH,border:AH.border,borderRadius:AH.borderRadius,padding:AH.padding},".cm-panel button:hover":{backgroundColor:RH},".cm-activeLine":{backgroundColor:Mke,borderRadius:kke.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:LH,color:BH,border:kH.border,borderRight:`1px solid ${RH}`,paddingRight:kH.paddingRight},".cm-activeLineGutter":{backgroundColor:jke,color:HH,fontWeight:kH.fontWeight},".cm-lineNumbers":{fontSize:kH.fontSize,lineHeight:kH.lineHeight},".cm-foldGutter":{fontSize:kH.fontSize,lineHeight:kH.lineHeight},".cm-foldGutter .cm-gutterElement":{color:BH,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:HH},".cm-insertedLine":{textDecoration:OH.insertedTextDecoration,backgroundColor:nU,color:iU,padding:OH.insertedLinePadding,borderRadius:OH.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:OH.insertedTextDecoration,backgroundColor:`${nU} !important`,color:iU,padding:OH.insertedLinePadding,borderRadius:OH.borderRadious,border:`1px solid ${iU}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:OH.deletedTextDecoration,backgroundColor:rU,color:aU,padding:OH.insertedLinePadding,borderRadius:OH.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:OH.deletedTextDecoration,backgroundColor:`${rU} !important`,color:aU,padding:OH.insertedLinePadding,borderRadius:OH.borderRadious,border:`1px solid ${aU}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:ZH,border:`1px solid ${zH}`,borderRadius:FH.borderRadius,padding:FH.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:ZH,border:`none`},"& > ul > li":{padding:FH.padding,lineHeight:FH.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:QH,color:VH,borderRadius:FH.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:BH,paddingRight:FH.paddingRight},"& > ul > li > span.cm-completionDetail":{color:BH,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:ZH,borderBottomColor:ZH},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${XH}`},"&-warning":{borderLeft:`3px solid ${eU}`},"&-info":{borderLeft:`3px solid ${tU}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${XH}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${eU}`},".cm-matchingBracket":{backgroundColor:Fke,outline:`1px solid ${Ike}`,borderRadius:jH.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#cc241d55`,outline:`1px solid ${XH}`,borderRadius:jH.borderRadius},".cm-selectionMatch":{backgroundColor:Pke,outline:`1px solid ${zH}`,borderRadius:jH.borderRadius},".cm-foldPlaceholder":{backgroundColor:ZH,color:BH,border:`1px dotted ${zH}`,borderRadius:MH.borderRadius,padding:MH.padding,margin:MH.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${IH}, 0 0 0 3px ${YH}40`},"& .cm-scroller::-webkit-scrollbar":{width:NH.width,height:NH.height},"& .cm-scroller::-webkit-scrollbar-track":{background:LH},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:zH,borderRadius:NH.borderRadius,border:`3px solid ${LH}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:Ake},".cm-ghostText":{opacity:`0.5`,color:BH}},{dark:!0}),Ft(Yt.define([{tag:z.keyword,color:UH,fontWeight:`bold`},{tag:z.controlKeyword,color:UH,fontWeight:`bold`},{tag:z.moduleKeyword,color:UH,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:KH},{tag:[z.variableName],color:KH},{tag:[z.propertyName],color:JH,fontStyle:`normal`},{tag:[z.typeName],color:JH},{tag:[z.className],color:GH,fontStyle:`italic`},{tag:[z.namespace],color:KH,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:HH},{tag:[z.bracket],color:BH},{tag:[z.brace],color:BH},{tag:[z.punctuation],color:BH},{tag:[z.function(z.variableName),z.labelName],color:GH},{tag:[z.definition(z.variableName)],color:KH},{tag:z.number,color:qH},{tag:z.changed,color:qH},{tag:z.annotation,color:XH,fontStyle:`italic`},{tag:z.modifier,color:qH,fontStyle:`italic`},{tag:z.self,color:qH},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:YH},{tag:[z.atom,z.bool,z.special(z.variableName)],color:YH},{tag:[z.processingInstruction,z.inserted],color:WH},{tag:[z.special(z.string),z.regexp],color:WH},{tag:z.string,color:WH},{tag:z.definition(z.typeName),color:JH,fontWeight:`bold`},{tag:z.meta,color:BH},{tag:z.comment,fontStyle:`italic`,color:BH},{tag:z.docComment,fontStyle:`italic`,color:BH},{tag:[z.tagName],color:UH},{tag:[z.attributeName],color:GH},{tag:[z.heading],fontWeight:`bold`,color:GH},{tag:[z.strong],fontWeight:`bold`,color:GH},{tag:[z.emphasis],fontStyle:`italic`,color:WH},{tag:[z.link],color:Lke,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:tU,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:HH,textDecoration:`underline wavy`,borderBottom:`1px wavy ${XH}`},{tag:[z.strikethrough],color:XH,textDecoration:`line-through`},{tag:z.constant(z.name),color:YH},{tag:z.deleted,color:XH},{tag:z.squareBracket,color:BH},{tag:z.angleBracket,color:BH},{tag:z.monospace,color:HH},{tag:[z.contentSeparator],color:KH},{tag:z.quote,color:BH}]))],oU={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},zke={borderLeftWidth:`2px`},sU={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},cU={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},lU={border:`none`,borderRadius:`4px`,padding:`2px 10px`},Bke={borderRadius:`2px`},uU={borderRadius:`2px`},dU={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},fU={width:`12px`,height:`12px`,borderRadius:`6px`},pU={borderRadius:`4px`,padding:`2px 6px`},mU={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},hU=`#3c3836`,Vke=`#504945`,Hke=`#665c54`,gU=`#7c6f64`,_U=`#928374`,vU=`#fbf1c7`,yU=`#ebdbb2`,bU=`#d5c4a1`,xU=`#bdae93`,Uke=`#a89984`,SU=`#9d0006`,CU=`#79740e`,wU=`#b57614`,TU=`#076678`,EU=`#8f3f71`,DU=`#427b58`,OU=`#af3a03`,kU=SU,Wke=yU,Gke=`#ffc42e25`,Kke=vU,AU=yU,qke=Wke,Jke=`#ffc42e40`,jU=OU,Yke=`#d5c4a180`,Xke=OU,MU=wU,NU=TU,Zke=EU,PU=`#d8e5bc80`,FU=`#f7cfcf80`,IU=`#79740e`,LU=`#9d0006`,Qke=[Ut.theme({"&":{color:hU,backgroundColor:Kke,fontSize:oU.fontSize,fontFamily:oU.fontFamily},".cm-content":{caretColor:jU,lineHeight:oU.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:jU,borderLeftWidth:zke.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${jU}99`,color:vU},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:qke,color:hU},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#ffc42e80`,outline:`1px solid ${OU}`,color:hU,borderRadius:pU.borderRadius,"& span":{color:hU}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:OU,color:vU,padding:pU.padding,"& span":{color:vU}},".cm-search.cm-panel.cm-textfield":{color:hU,borderRadius:pU.borderRadius,padding:pU.padding},".cm-panels":{backgroundColor:yU,color:Vke,borderRadius:`0 0 4px 4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${xU}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${xU}`},".cm-panel button":{backgroundColor:vU,color:hU,border:lU.border,borderRadius:lU.borderRadius,padding:lU.padding},".cm-panel button:hover":{backgroundColor:bU},".cm-activeLine":{backgroundColor:Gke,borderRadius:Bke.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:yU,color:gU,border:cU.border,borderRight:`1px solid ${xU}`,paddingRight:cU.paddingRight},".cm-activeLineGutter":{backgroundColor:bU,color:hU,fontWeight:cU.fontWeight},".cm-lineNumbers":{fontSize:cU.fontSize,lineHeight:cU.lineHeight},".cm-foldGutter":{fontSize:cU.fontSize,lineHeight:cU.lineHeight},".cm-foldGutter .cm-gutterElement":{color:gU,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:hU},".cm-insertedLine":{textDecoration:sU.insertedTextDecoration,backgroundColor:PU,color:IU,padding:sU.insertedLinePadding,borderRadius:sU.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:sU.insertedTextDecoration,backgroundColor:`${PU} !important`,color:IU,padding:sU.insertedLinePadding,borderRadius:sU.borderRadious,border:`1px solid ${IU}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:sU.deletedTextDecoration,backgroundColor:FU,color:LU,padding:sU.insertedLinePadding,borderRadius:sU.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:sU.deletedTextDecoration,backgroundColor:`${FU} !important`,color:LU,padding:sU.insertedLinePadding,borderRadius:sU.borderRadious,border:`1px solid ${LU}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:AU,border:`1px solid ${xU}`,borderRadius:mU.borderRadius,padding:mU.padding,boxShadow:`0 1px 5px rgba(0, 0, 0, 0.1)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:AU,border:`none`},"& > ul > li":{padding:mU.padding,lineHeight:mU.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:OU+`30`,color:hU,borderRadius:mU.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:OU+`15`},"& > ul > li > span.cm-completionIcon":{color:gU,paddingRight:mU.paddingRight},"& > ul > li > span.cm-completionDetail":{color:gU,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:AU,borderBottomColor:AU},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${kU}`},"&-warning":{borderLeft:`3px solid ${MU}`},"&-info":{borderLeft:`3px solid ${NU}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${kU}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${MU}`},".cm-matchingBracket":{backgroundColor:Yke,outline:`1px solid ${Xke}`,borderRadius:uU.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#fb492740`,outline:`1px solid ${kU}`,borderRadius:uU.borderRadius},".cm-selectionMatch":{backgroundColor:Jke,outline:`1px solid ${xU}`,borderRadius:uU.borderRadius},".cm-foldPlaceholder":{backgroundColor:`transparent`,color:Hke,border:`1px dotted ${xU}`,borderRadius:dU.borderRadius,padding:dU.padding,margin:dU.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${vU}, 0 0 0 3px ${OU}40`},"& .cm-scroller::-webkit-scrollbar":{width:fU.width,height:fU.height},"& .cm-scroller::-webkit-scrollbar-track":{background:vU},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:xU,borderRadius:fU.borderRadius,border:`3px solid ${vU}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:Uke},".cm-ghostText":{opacity:`0.5`,color:_U}},{dark:!1}),Ft(Yt.define([{tag:z.keyword,color:SU,fontWeight:`bold`},{tag:z.controlKeyword,color:SU,fontWeight:`bold`},{tag:z.moduleKeyword,color:SU,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:TU},{tag:[z.variableName],color:TU},{tag:[z.propertyName],color:DU,fontStyle:`normal`},{tag:[z.typeName],color:DU},{tag:[z.className],color:wU,fontStyle:`italic`},{tag:[z.namespace],color:TU,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:hU},{tag:[z.bracket],color:_U},{tag:[z.brace],color:_U},{tag:[z.punctuation],color:_U},{tag:[z.function(z.variableName),z.labelName],color:wU},{tag:[z.definition(z.variableName)],color:TU},{tag:z.number,color:EU},{tag:z.changed,color:EU},{tag:z.annotation,color:kU,fontStyle:`italic`},{tag:z.modifier,color:EU,fontStyle:`italic`},{tag:z.self,color:EU},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:OU},{tag:[z.atom,z.bool,z.special(z.variableName)],color:OU},{tag:[z.processingInstruction,z.inserted],color:CU},{tag:[z.special(z.string),z.regexp],color:CU},{tag:z.string,color:CU},{tag:z.definition(z.typeName),color:DU,fontWeight:`bold`},{tag:z.meta,color:_U},{tag:z.comment,fontStyle:`italic`,color:_U},{tag:z.docComment,fontStyle:`italic`,color:_U},{tag:[z.tagName],color:SU},{tag:[z.attributeName],color:wU},{tag:[z.heading],fontWeight:`bold`,color:wU},{tag:[z.strong],fontWeight:`bold`,color:wU},{tag:[z.emphasis],fontStyle:`italic`,color:CU},{tag:[z.link],color:Zke,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:NU,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:hU,textDecoration:`underline wavy`,borderBottom:`1px wavy ${kU}`},{tag:[z.strikethrough],color:kU,textDecoration:`line-through`},{tag:z.constant(z.name),color:OU},{tag:z.deleted,color:kU},{tag:z.squareBracket,color:_U},{tag:z.angleBracket,color:_U},{tag:z.monospace,color:hU},{tag:[z.contentSeparator],color:TU},{tag:z.quote,color:_U}]))],RU={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},$ke={borderLeftWidth:`2px`},zU={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},BU={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},VU={border:`none`,borderRadius:`4px`,padding:`2px 10px`},eAe={borderRadius:`2px`},HU={borderRadius:`2px`},UU={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},WU={width:`12px`,height:`12px`,borderRadius:`6px`},GU={borderRadius:`4px`,padding:`2px 6px`},KU={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},qU=`#212121`,JU=`#505d64`,YU=`#606f7a`,XU=`#707d8b`,tAe=`#a0a4ae`,ZU=`#bdbdbd`,QU=`#e0e0e0`,nAe=`#202325`,$U=`#ff5f52`,eW=`#ff6e40`,rAe=`#fa5788`,tW=`#facf4e`,nW=`#ffad42`,rW=`#56c8d8`,iW=`#7186f0`,aW=`#cf6edf`,iAe=`#6abf69`,aAe=`#99d066`,oAe=`#4ebaaa`,oW=$U,sW=nAe,sAe=`#2d333b30`,cW=qU,lW=JU,uW=`#ffffff1f`,cAe=`#4A707A80`,dW=tAe,lAe=`#39496650`,uAe=rW,fW=nW,pW=rW,dAe=aW,mW=`#1e3d2780`,hW=`#4e282880`,gW=`#6abf69`,_W=`#ff5f52`,fAe=[Ut.theme({"&":{color:ZU,backgroundColor:cW,fontSize:RU.fontSize,fontFamily:RU.fontFamily},".cm-content":{caretColor:dW,lineHeight:RU.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:dW,borderLeftWidth:$ke.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${dW}99`,color:cW},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:uW},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#394966cc`,outline:`1px solid ${rW}`,color:QU,borderRadius:GU.borderRadius,"& span":{color:QU}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:rW,color:cW,padding:GU.padding,"& span":{color:cW}},".cm-search.cm-panel.cm-textfield":{color:ZU,borderRadius:GU.borderRadius,padding:GU.padding},".cm-panels":{backgroundColor:qU,color:ZU,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${XU}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${XU}`},".cm-panel button":{backgroundColor:lW,color:ZU,border:VU.border,borderRadius:VU.borderRadius,padding:VU.padding},".cm-panel button:hover":{backgroundColor:YU},".cm-activeLine":{backgroundColor:sAe,borderRadius:eAe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:sW,color:XU,border:BU.border,borderRight:`1px solid ${JU}`,paddingRight:BU.paddingRight},".cm-activeLineGutter":{backgroundColor:`#252a2c`,color:ZU,fontWeight:BU.fontWeight},".cm-lineNumbers":{fontSize:BU.fontSize,lineHeight:BU.lineHeight},".cm-foldGutter":{fontSize:BU.fontSize,lineHeight:BU.lineHeight},".cm-foldGutter .cm-gutterElement":{color:XU,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:ZU},".cm-insertedLine":{textDecoration:zU.insertedTextDecoration,backgroundColor:mW,color:gW,padding:zU.insertedLinePadding,borderRadius:zU.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:zU.insertedTextDecoration,backgroundColor:`${mW} !important`,color:gW,padding:zU.insertedLinePadding,borderRadius:zU.borderRadious,border:`1px solid ${gW}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:zU.deletedTextDecoration,backgroundColor:hW,color:_W,padding:zU.insertedLinePadding,borderRadius:zU.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:zU.deletedTextDecoration,backgroundColor:`${hW} !important`,color:_W,padding:zU.insertedLinePadding,borderRadius:zU.borderRadious,border:`1px solid ${_W}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:lW,border:`1px solid ${XU}`,borderRadius:KU.borderRadius,padding:KU.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:lW,border:`none`},"& > ul > li":{padding:KU.padding,lineHeight:KU.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:uW,color:QU,borderRadius:KU.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:XU,paddingRight:KU.paddingRight},"& > ul > li > span.cm-completionDetail":{color:XU,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:lW,borderBottomColor:lW},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${oW}`},"&-warning":{borderLeft:`3px solid ${fW}`},"&-info":{borderLeft:`3px solid ${pW}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${oW}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${fW}`},".cm-matchingBracket":{backgroundColor:lAe,outline:`1px solid ${uAe}`,borderRadius:HU.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#ff5f5240`,outline:`1px solid ${oW}`,borderRadius:HU.borderRadius},".cm-selectionMatch":{backgroundColor:cAe,outline:`1px solid ${YU}50`,borderRadius:HU.borderRadius},".cm-foldPlaceholder":{backgroundColor:lW,color:XU,border:`1px dotted ${XU}70`,borderRadius:UU.borderRadius,padding:UU.padding,margin:UU.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${cW}, 0 0 0 3px ${rW}40`},"& .cm-scroller::-webkit-scrollbar":{width:WU.width,height:WU.height},"& .cm-scroller::-webkit-scrollbar-track":{background:sW},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:YU,borderRadius:WU.borderRadius,border:`3px solid ${sW}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:XU},".cm-ghostText":{opacity:`0.5`,color:XU}},{dark:!0}),Ft(Yt.define([{tag:z.keyword,color:$U,fontWeight:`bold`},{tag:z.controlKeyword,color:$U,fontWeight:`bold`},{tag:z.moduleKeyword,color:$U,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:iW},{tag:[z.variableName],color:aAe},{tag:[z.propertyName],color:aW,fontStyle:`normal`},{tag:[z.typeName],color:$U},{tag:[z.className],color:tW,fontStyle:`italic`},{tag:[z.namespace],color:iW,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:ZU},{tag:[z.bracket],color:XU},{tag:[z.brace],color:XU},{tag:[z.punctuation],color:XU},{tag:[z.function(z.variableName)],color:rW},{tag:[z.labelName],color:rW,fontStyle:`italic`},{tag:[z.definition(z.function(z.variableName))],color:rW},{tag:[z.definition(z.variableName)],color:iW},{tag:z.number,color:tW},{tag:z.changed,color:tW},{tag:z.annotation,color:oW,fontStyle:`italic`},{tag:z.modifier,color:eW,fontStyle:`italic`},{tag:z.self,color:eW},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:eW},{tag:[z.atom,z.bool,z.special(z.variableName)],color:eW},{tag:[z.processingInstruction,z.inserted],color:iAe},{tag:[z.special(z.string),z.regexp],color:rAe},{tag:z.string,color:nW},{tag:z.definition(z.typeName),color:$U,fontWeight:`bold`},{tag:z.meta,color:XU},{tag:z.comment,fontStyle:`italic`,color:XU},{tag:z.docComment,fontStyle:`italic`,color:XU},{tag:[z.tagName],color:aW},{tag:[z.attributeName],color:tW},{tag:[z.heading],fontWeight:`bold`,color:oAe},{tag:z.heading1,color:tW},{tag:z.heading2,color:nW},{tag:z.heading3,color:rW},{tag:z.heading4,color:iW},{tag:z.heading5,color:aW},{tag:z.heading6,color:$U},{tag:[z.strong],fontWeight:`bold`,color:iW},{tag:[z.emphasis],fontStyle:`italic`,color:nW},{tag:[z.link],color:dAe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:pW,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:ZU,textDecoration:`underline wavy`,borderBottom:`1px wavy ${oW}`},{tag:[z.strikethrough],color:oW,textDecoration:`line-through`},{tag:z.constant(z.name),color:eW},{tag:z.deleted,color:oW},{tag:z.squareBracket,color:XU},{tag:z.angleBracket,color:XU},{tag:z.monospace,color:ZU},{tag:[z.contentSeparator],color:iW},{tag:z.quote,color:XU}]))],vW={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},pAe={borderLeftWidth:`2px`},yW={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},bW={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},xW={border:`none`,borderRadius:`4px`,padding:`2px 10px`},mAe={borderRadius:`2px`},SW={borderRadius:`2px`},CW={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},wW={width:`12px`,height:`12px`,borderRadius:`6px`},TW={borderRadius:`4px`,padding:`2px 6px`},EW={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},hAe=`#ffffff`,DW=`#f5f5f5`,OW=`#212121`,kW=`#757575`,AW=`#9e9e9e`,jW=`#424242`,gAe=`#eeeeee`,MW=`#fafafa`,NW=`#f44336`,PW=`#ff3e00`,FW=`#FF00E9FF`,_Ae=`#ffc107`,IW=`#ff9800`,LW=`#00acc1`,RW=`#3949ab`,zW=`#8e24aa`,BW=`#43a047`,VW=`#00897b`,HW=`#1e88e5`,UW=NW,vAe=`#00000008`,WW=hAe,GW=DW,yAe=`#DDEEFF`,bAe=`#90a4ae26`,KW=AW,xAe=`#DDEEFF80`,SAe=LW,qW=IW,JW=LW,CAe=zW,YW=`#ECEFF180`,XW=`#e6ffed80`,ZW=`#ffebe980`,QW=`#28a745`,$W=`#d73a49`,wAe=[Ut.theme({"&":{color:OW,backgroundColor:WW,fontSize:vW.fontSize,fontFamily:vW.fontFamily},".cm-content":{caretColor:KW,lineHeight:vW.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:KW,borderLeftWidth:pAe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${OW}99`,color:WW},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:yAe},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#FFA72680`,outline:`1px solid ${_Ae}`,color:OW,borderRadius:TW.borderRadius,"& span":{color:OW}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:LW,color:WW,padding:TW.padding,"& span":{color:WW}},".cm-search.cm-panel.cm-textfield":{color:OW,borderRadius:TW.borderRadius,padding:TW.padding},".cm-panels":{backgroundColor:gAe,color:OW,borderRadius:`4px`,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${AW}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${AW}`},".cm-panel button":{backgroundColor:GW,color:OW,border:xW.border,borderRadius:xW.borderRadius,padding:xW.padding},".cm-panel button:hover":{backgroundColor:`#CFD8DC`},".cm-activeLine":{backgroundColor:vAe,borderRadius:mAe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:MW,color:kW,border:bW.border,borderRight:`1px solid ${AW}`,paddingRight:bW.paddingRight},".cm-activeLineGutter":{backgroundColor:`#E0E0E0`,color:OW,fontWeight:bW.fontWeight},".cm-lineNumbers":{fontSize:bW.fontSize,lineHeight:bW.lineHeight},".cm-foldGutter":{fontSize:bW.fontSize,lineHeight:bW.lineHeight},".cm-foldGutter .cm-gutterElement":{color:kW,cursor:`pointer`,transition:`color 0.15s ease`},".cm-foldGutter .cm-gutterElement:hover":{color:OW},".cm-insertedLine":{textDecoration:yW.insertedTextDecoration,backgroundColor:XW,color:QW,padding:yW.insertedLinePadding,borderRadius:yW.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:yW.insertedTextDecoration,backgroundColor:`${XW} !important`,color:QW,padding:yW.insertedLinePadding,borderRadius:yW.borderRadious,border:`1px solid ${QW}30`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:yW.deletedTextDecoration,backgroundColor:ZW,color:$W,padding:yW.insertedLinePadding,borderRadius:yW.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:yW.deletedTextDecoration,backgroundColor:`${ZW} !important`,color:$W,padding:yW.insertedLinePadding,borderRadius:yW.borderRadious,border:`1px solid ${$W}30`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:GW,border:`1px solid ${AW}`,borderRadius:EW.borderRadius,padding:EW.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:GW,border:`none`},"& > ul > li":{padding:EW.padding,lineHeight:EW.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:YW,color:OW,borderRadius:EW.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:YW},"& > ul > li > span.cm-completionIcon":{color:kW,paddingRight:EW.paddingRight},"& > ul > li > span.cm-completionDetail":{color:kW,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:GW,borderBottomColor:GW},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${UW}`},"&-warning":{borderLeft:`3px solid ${qW}`},"&-info":{borderLeft:`3px solid ${JW}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${UW}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${qW}`},".cm-matchingBracket":{backgroundColor:xAe,outline:`1px solid ${SAe}`,borderRadius:SW.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${UW}20`,outline:`1px solid ${UW}`,borderRadius:SW.borderRadius},".cm-selectionMatch":{backgroundColor:bAe,outline:`1px solid ${kW}30`,borderRadius:SW.borderRadius},".cm-foldPlaceholder":{backgroundColor:DW,color:kW,border:`1px dotted ${kW}70`,borderRadius:CW.borderRadius,padding:CW.padding,margin:CW.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${WW}, 0 0 0 3px ${LW}40`},"& .cm-scroller::-webkit-scrollbar":{width:wW.width,height:wW.height},"& .cm-scroller::-webkit-scrollbar-track":{background:MW},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:kW,borderRadius:wW.borderRadius,border:`3px solid ${MW}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:OW},".cm-ghostText":{opacity:`0.5`,color:kW}},{dark:!1}),Ft(Yt.define([{tag:z.keyword,color:LW,fontWeight:`bold`},{tag:z.controlKeyword,color:LW,fontWeight:`bold`},{tag:z.moduleKeyword,color:LW,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:jW},{tag:[z.variableName],color:jW},{tag:[z.propertyName],color:VW,fontStyle:`normal`},{tag:[z.typeName],color:IW},{tag:[z.className],color:IW,fontStyle:`italic`},{tag:[z.namespace],color:RW,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:RW},{tag:[z.bracket],color:zW},{tag:[z.brace],color:zW},{tag:[z.punctuation],color:kW},{tag:[z.function(z.variableName)],color:PW},{tag:[z.labelName],color:HW,fontStyle:`italic`},{tag:[z.definition(z.function(z.variableName))],color:PW},{tag:[z.definition(z.variableName)],color:FW},{tag:z.number,color:IW},{tag:z.changed,color:IW},{tag:z.annotation,color:UW,fontStyle:`italic`},{tag:z.modifier,color:IW,fontStyle:`italic`},{tag:z.self,color:IW},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:IW},{tag:[z.atom,z.bool],color:zW},{tag:[z.processingInstruction,z.inserted],color:BW},{tag:z.string,color:BW},{tag:[z.special(z.string),z.regexp],color:FW},{tag:z.definition(z.typeName),color:FW,fontWeight:`bold`},{tag:[z.definition(z.name),z.separator],color:FW},{tag:z.meta,color:kW},{tag:z.comment,fontStyle:`italic`,color:kW},{tag:z.docComment,fontStyle:`italic`,color:kW},{tag:[z.tagName],color:PW},{tag:[z.attributeName],color:jW},{tag:[z.heading],fontWeight:`bold`,color:VW},{tag:z.heading1,color:HW},{tag:z.heading2,color:IW},{tag:z.heading3,color:LW},{tag:z.heading4,color:RW},{tag:z.heading5,color:zW},{tag:z.heading6,color:BW},{tag:[z.strong],fontWeight:`bold`,color:RW},{tag:[z.emphasis],fontStyle:`italic`,color:IW},{tag:[z.link],color:CAe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:JW,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:OW,textDecoration:`underline wavy`,borderBottom:`1px dotted ${NW}`},{tag:[z.strikethrough],color:UW,textDecoration:`line-through`},{tag:z.constant(z.name),color:PW},{tag:z.deleted,color:UW},{tag:z.squareBracket,color:NW},{tag:z.angleBracket,color:OW},{tag:z.monospace,color:OW},{tag:[z.contentSeparator],color:LW},{tag:z.quote,color:BW}]))],eG={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},TAe={borderLeftWidth:`2px`},tG={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},nG={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},rG={border:`none`,borderRadius:`4px`,padding:`2px 10px`},EAe={borderRadius:`2px`},iG={borderRadius:`2px`},aG={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},oG={width:`12px`,height:`12px`,borderRadius:`6px`},sG={borderRadius:`4px`,padding:`2px 6px`},cG={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},lG=`#272822`,uG=`#f8f8f2`,dG=`#88846f`,DAe=`#f8f8f0`,fG=`#F92672`,pG=`#FD971F`,mG=`#66D9EF`,hG=`#E6DB74`,gG=`#AE81FF`,_G=`#A6E22E`,vG=`#F44747`,yG=`#414339`,OAe=`#3e3d3257`,bG=`#34352f`,xG=`#49483E`,kAe=`#75715e70`,SG=DAe,AAe=`#75715E55`,jAe=mG,CG=pG,wG=mG,MAe=gG,TG=`#3d4d3880`,EG=`#4d393980`,DG=`#A6E22E`,OG=`#F92672`,NAe=[Ut.theme({"&":{color:uG,backgroundColor:lG,fontSize:eG.fontSize,fontFamily:eG.fontFamily},".cm-content":{caretColor:SG,lineHeight:eG.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:SG,borderLeftWidth:TAe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${SG}99`,color:lG},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:xG},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#49483E99`,outline:`1px solid ${hG}`,color:uG,borderRadius:sG.borderRadius,"& span":{color:uG}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:fG,color:lG,padding:sG.padding,"& span":{color:lG}},".cm-search.cm-panel.cm-textfield":{color:uG,borderRadius:sG.borderRadius,padding:sG.padding},".cm-panels":{backgroundColor:yG,color:uG,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${dG}80`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${dG}80`},".cm-panel button":{backgroundColor:bG,color:uG,border:rG.border,borderRadius:rG.borderRadius,padding:rG.padding},".cm-panel button:hover":{backgroundColor:`#49483E`},".cm-activeLine":{backgroundColor:OAe,borderRadius:EAe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:yG,color:dG,border:nG.border,borderRight:`1px solid #3e3d32`,paddingRight:nG.paddingRight},".cm-activeLineGutter":{backgroundColor:`#35352c`,color:uG,fontWeight:nG.fontWeight},".cm-lineNumbers":{fontSize:nG.fontSize,lineHeight:nG.lineHeight},".cm-foldGutter":{fontSize:nG.fontSize,lineHeight:nG.lineHeight},".cm-foldGutter .cm-gutterElement":{color:dG,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:uG},".cm-insertedLine":{textDecoration:tG.insertedTextDecoration,backgroundColor:TG,color:DG,padding:tG.insertedLinePadding,borderRadius:tG.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:tG.insertedTextDecoration,backgroundColor:`${TG} !important`,color:DG,padding:tG.insertedLinePadding,borderRadius:tG.borderRadious,border:`1px solid ${DG}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:tG.deletedTextDecoration,backgroundColor:EG,color:OG,padding:tG.insertedLinePadding,borderRadius:tG.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:tG.deletedTextDecoration,backgroundColor:`${EG} !important`,color:OG,padding:tG.insertedLinePadding,borderRadius:tG.borderRadious,border:`1px solid ${OG}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:bG,border:`1px solid #49483E`,borderRadius:cG.borderRadius,padding:cG.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.4)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:bG,border:`none`},"& > ul > li":{padding:cG.padding,lineHeight:cG.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:xG,color:uG,borderRadius:cG.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:dG,paddingRight:cG.paddingRight},"& > ul > li > span.cm-completionDetail":{color:dG,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:bG,borderBottomColor:bG},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${vG}`},"&-warning":{borderLeft:`3px solid ${CG}`},"&-info":{borderLeft:`3px solid ${wG}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${vG}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${CG}`},".cm-matchingBracket":{backgroundColor:AAe,outline:`1px solid ${jAe}`,borderRadius:iG.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#f9267240`,outline:`1px solid ${vG}`,borderRadius:iG.borderRadius},".cm-selectionMatch":{backgroundColor:kAe,outline:`1px solid ${dG}50`,borderRadius:iG.borderRadius},".cm-foldPlaceholder":{backgroundColor:bG,color:dG,border:`1px dotted ${dG}70`,borderRadius:aG.borderRadius,padding:aG.padding,margin:aG.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${lG}, 0 0 0 3px ${mG}40`},"& .cm-scroller::-webkit-scrollbar":{width:oG.width,height:oG.height},"& .cm-scroller::-webkit-scrollbar-track":{background:yG},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#49483E`,borderRadius:oG.borderRadius,border:`3px solid ${yG}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#5a594d`},".cm-ghostText":{opacity:`0.5`,color:dG}},{dark:!0}),Ft(Yt.define([{tag:z.keyword,color:fG,fontWeight:`bold`},{tag:z.controlKeyword,color:fG,fontWeight:`bold`},{tag:z.moduleKeyword,color:fG,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:pG},{tag:[z.variableName],color:pG},{tag:[z.propertyName],color:_G,fontStyle:`normal`},{tag:[z.typeName],color:mG,fontStyle:`italic`},{tag:[z.className],color:_G,fontStyle:`italic`},{tag:[z.namespace],color:pG,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:fG},{tag:[z.bracket],color:uG},{tag:[z.brace],color:uG},{tag:[z.punctuation],color:uG},{tag:[z.function(z.variableName),z.labelName],color:mG},{tag:[z.definition(z.function(z.variableName))],color:mG},{tag:[z.definition(z.variableName)],color:pG},{tag:z.number,color:gG},{tag:z.changed,color:gG},{tag:z.annotation,color:vG,fontStyle:`italic`},{tag:z.modifier,color:gG,fontStyle:`italic`},{tag:z.self,color:gG},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:gG},{tag:[z.atom,z.bool,z.special(z.variableName)],color:gG},{tag:[z.processingInstruction,z.inserted],color:_G},{tag:[z.special(z.string),z.regexp],color:hG},{tag:z.string,color:hG},{tag:z.definition(z.typeName),color:mG,fontWeight:`bold`},{tag:z.meta,color:dG},{tag:z.comment,fontStyle:`italic`,color:dG},{tag:z.docComment,fontStyle:`italic`,color:dG},{tag:[z.tagName],color:fG},{tag:[z.attributeName],color:_G},{tag:[z.heading],fontWeight:`bold`,color:_G},{tag:[z.strong],fontWeight:`bold`,color:pG},{tag:[z.emphasis],fontStyle:`italic`,color:pG},{tag:[z.link],color:MAe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:wG,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:uG,textDecoration:`underline wavy`,borderBottom:`1px wavy ${vG}`},{tag:[z.strikethrough],color:vG,textDecoration:`line-through`},{tag:z.constant(z.name),color:gG},{tag:z.deleted,color:vG},{tag:z.squareBracket,color:uG},{tag:z.angleBracket,color:uG},{tag:z.monospace,color:uG},{tag:[z.contentSeparator],color:pG},{tag:z.quote,color:dG}]))],kG={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},PAe={borderLeftWidth:`2px`},AG={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},jG={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},MG={border:`none`,borderRadius:`4px`,padding:`2px 10px`},FAe={borderRadius:`2px`},NG={borderRadius:`2px`},PG={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},FG={width:`12px`,height:`12px`,borderRadius:`6px`},IG={borderRadius:`4px`,padding:`2px 6px`},LG={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},IAe=`#2e3440`,RG=`#3b4252`,zG=`#434c5e`,BG=`#4c566a`,VG=`#d8dee9`,HG=`#eceff4`,UG=`#8fbcbb`,WG=`#88c0d0`,GG=`#81a1c1`,KG=`#5e81ac`,qG=`#bf616a`,JG=`#d08770`,YG=`#ebcb8b`,XG=`#a3be8c`,ZG=`#b48ead`,LAe=`#d30102`,QG=`#252a33`,RAe=`#3b425277`,$G=IAe,eK=RG,zAe=zG,BAe=`#4c566a80`,tK=VG,VAe=`#4c566a55`,HAe=WG,nK=YG,rK=GG,UAe=ZG,iK=`#3b4a3880`,aK=`#4a393a80`,oK=`#a3be8c`,sK=`#bf616a`,WAe=[Ut.theme({"&":{color:VG,backgroundColor:$G,fontSize:kG.fontSize,fontFamily:kG.fontFamily},".cm-content":{caretColor:tK,lineHeight:kG.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:tK,borderLeftWidth:PAe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${tK}99`,color:$G},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:zAe},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#5e81ac80`,outline:`1px solid ${UG}`,color:VG,borderRadius:IG.borderRadius,"& span":{color:VG}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:GG,color:HG,padding:IG.padding,"& span":{color:HG}},".cm-search.cm-panel.cm-textfield":{color:VG,borderRadius:IG.borderRadius,padding:IG.padding},".cm-panels":{backgroundColor:QG,color:VG,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${BG}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${BG}`},".cm-panel button":{backgroundColor:eK,color:VG,border:MG.border,borderRadius:MG.borderRadius,padding:MG.padding},".cm-panel button:hover":{backgroundColor:zG},".cm-activeLine":{backgroundColor:RAe,borderRadius:FAe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:QG,color:BG,border:jG.border,borderRight:`1px solid ${zG}`,paddingRight:jG.paddingRight},".cm-activeLineGutter":{backgroundColor:RG,color:VG,fontWeight:jG.fontWeight},".cm-lineNumbers":{fontSize:jG.fontSize,lineHeight:jG.lineHeight},".cm-foldGutter":{fontSize:jG.fontSize,lineHeight:jG.lineHeight},".cm-foldGutter .cm-gutterElement":{color:BG,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:VG},".cm-insertedLine":{textDecoration:AG.insertedTextDecoration,backgroundColor:iK,color:oK,padding:AG.insertedLinePadding,borderRadius:AG.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:AG.insertedTextDecoration,backgroundColor:`${iK} !important`,color:oK,padding:AG.insertedLinePadding,borderRadius:AG.borderRadious,border:`1px solid ${oK}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:AG.deletedTextDecoration,backgroundColor:aK,color:sK,padding:AG.insertedLinePadding,borderRadius:AG.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:AG.deletedTextDecoration,backgroundColor:`${aK} !important`,color:sK,padding:AG.insertedLinePadding,borderRadius:AG.borderRadious,border:`1px solid ${sK}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:eK,border:`1px solid ${BG}`,borderRadius:LG.borderRadius,padding:LG.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:eK,border:`none`},"& > ul > li":{padding:LG.padding,lineHeight:LG.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:zG,color:HG,borderRadius:LG.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:BG,paddingRight:LG.paddingRight},"& > ul > li > span.cm-completionDetail":{color:BG,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:eK,borderBottomColor:eK},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${qG}`},"&-warning":{borderLeft:`3px solid ${nK}`},"&-info":{borderLeft:`3px solid ${rK}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${qG}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${nK}`},".cm-matchingBracket":{backgroundColor:VAe,outline:`1px solid ${HAe}`,borderRadius:NG.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${qG}40`,outline:`1px solid ${LAe}`,borderRadius:NG.borderRadius},".cm-selectionMatch":{backgroundColor:BAe,outline:`1px solid ${zG}50`,borderRadius:NG.borderRadius},".cm-foldPlaceholder":{backgroundColor:eK,color:BG,border:`1px dotted ${BG}70`,borderRadius:PG.borderRadius,padding:PG.padding,margin:PG.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${$G}, 0 0 0 3px ${WG}40`},"& .cm-scroller::-webkit-scrollbar":{width:FG.width,height:FG.height},"& .cm-scroller::-webkit-scrollbar-track":{background:QG},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:zG,borderRadius:FG.borderRadius,border:`3px solid ${QG}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:BG},".cm-ghostText":{opacity:`0.5`,color:BG}},{dark:!0}),Ft(Yt.define([{tag:z.keyword,color:KG,fontWeight:`bold`},{tag:z.controlKeyword,color:KG,fontWeight:`bold`},{tag:z.moduleKeyword,color:KG,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:WG},{tag:[z.variableName],color:VG},{tag:[z.propertyName],color:WG,fontStyle:`normal`},{tag:[z.typeName],color:YG},{tag:[z.className],color:YG,fontStyle:`italic`},{tag:[z.namespace],color:GG,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:ZG},{tag:[z.bracket],color:VG},{tag:[z.brace],color:UG},{tag:[z.punctuation],color:VG},{tag:[z.function(z.variableName),z.labelName],color:UG},{tag:[z.definition(z.function(z.variableName))],color:UG},{tag:[z.definition(z.variableName)],color:JG},{tag:z.number,color:JG},{tag:z.changed,color:ZG},{tag:z.annotation,color:qG,fontStyle:`italic`},{tag:z.modifier,color:ZG,fontStyle:`italic`},{tag:z.self,color:ZG},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:JG},{tag:[z.atom,z.bool,z.special(z.variableName)],color:ZG},{tag:[z.processingInstruction,z.inserted],color:UG},{tag:[z.special(z.string),z.regexp],color:ZG},{tag:z.string,color:XG},{tag:z.definition(z.typeName),color:YG,fontWeight:`bold`},{tag:[z.definition(z.name),z.separator],color:XG},{tag:z.meta,color:BG},{tag:z.comment,fontStyle:`italic`,color:BG},{tag:z.docComment,fontStyle:`italic`,color:BG},{tag:[z.tagName],color:qG},{tag:[z.attributeName],color:YG},{tag:[z.heading],fontWeight:`bold`,color:GG},{tag:[z.strong],fontWeight:`bold`,color:WG},{tag:[z.emphasis],fontStyle:`italic`,color:YG},{tag:[z.link],color:UAe,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:rK,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:VG,textDecoration:`underline wavy`,borderBottom:`1px wavy ${qG}`},{tag:[z.strikethrough],color:qG,textDecoration:`line-through`},{tag:z.constant(z.name),color:JG},{tag:z.deleted,color:qG},{tag:z.squareBracket,color:qG},{tag:z.angleBracket,color:JG},{tag:z.monospace,color:VG,fontStyle:`italic`},{tag:[z.contentSeparator],color:GG},{tag:z.quote,color:ZG}]))],cK={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},GAe={borderLeftWidth:`2px`},lK={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},uK={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},dK={border:`none`,borderRadius:`4px`,padding:`2px 10px`},KAe={borderRadius:`2px`},fK={borderRadius:`2px`},pK={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},mK={width:`12px`,height:`12px`,borderRadius:`6px`},hK={borderRadius:`4px`,padding:`2px 6px`},gK={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},qAe=`#e1e2e7`,_K=`#3760bf`,vK=`#99a7df`,yK=`#848cb5`,JAe=`#8c91a8`,bK=`#3760bf`,xK=`#e9e9ec`,SK=`#d5d6db`,CK=`#f52a65`,wK=`#b15c00`,TK=`#8c6c3e`,EK=`#587539`,DK=`#007197`,OK=`#2e7de9`,kK=`#7847bd`,YAe=`#9854f1`,AK=CK,jK=SK,XAe=`#5F5FAF5A`,MK=qAe,NK=xK,PK=`#99a7df40`,ZAe=`#99a7df60`,FK=_K,QAe=`#0e639c20`,$Ae=DK,IK=wK,LK=DK,eje=kK,RK=`#58753920`,zK=`#f52a6520`,BK=`#587539`,VK=`#f52a65`,tje=[Ut.theme({"&":{color:bK,backgroundColor:MK,fontSize:cK.fontSize,fontFamily:cK.fontFamily},".cm-content":{caretColor:FK,lineHeight:cK.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:FK,borderLeftWidth:GAe.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${FK}99`,color:MK},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:PK},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#0e639c40`,outline:`1px solid ${DK}`,color:bK,borderRadius:hK.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:DK,color:MK,padding:hK.padding,"& span":{color:MK}},".cm-search.cm-panel.cm-textfield":{color:bK,borderRadius:hK.borderRadius,padding:hK.padding},".cm-panels":{backgroundColor:xK,color:bK,borderRadius:`4px`,boxShadow:`0 1px 3px rgba(0, 0, 0, 0.1)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${yK}30`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${yK}30`},".cm-panel button":{backgroundColor:NK,color:bK,border:dK.border,borderRadius:dK.borderRadius,padding:dK.padding},".cm-panel button:hover":{backgroundColor:SK,border:`1px solid ${vK}`},".cm-activeLine":{backgroundColor:XAe,borderRadius:KAe.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:jK,color:yK,border:uK.border,borderRight:`1px solid ${SK}`,paddingRight:uK.paddingRight},".cm-activeLineGutter":{color:_K,fontWeight:uK.fontWeight},".cm-lineNumbers":{fontSize:uK.fontSize,lineHeight:uK.lineHeight},".cm-foldGutter":{fontSize:uK.fontSize,lineHeight:uK.lineHeight},".cm-foldGutter .cm-gutterElement":{color:yK,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:_K},".cm-insertedLine":{textDecoration:lK.insertedTextDecoration,backgroundColor:RK,color:BK,padding:lK.insertedLinePadding,borderRadius:lK.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:lK.insertedTextDecoration,backgroundColor:`${RK} !important`,color:BK,padding:lK.insertedLinePadding,borderRadius:lK.borderRadious,border:`1px solid ${BK}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:lK.deletedTextDecoration,backgroundColor:zK,color:VK,padding:lK.insertedLinePadding,borderRadius:lK.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:lK.deletedTextDecoration,backgroundColor:`${zK} !important`,color:VK,padding:lK.insertedLinePadding,borderRadius:lK.borderRadious,border:`1px solid ${VK}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:NK,border:`1px solid ${JAe}40`,borderRadius:gK.borderRadius,padding:gK.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:NK,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:gK.padding,lineHeight:gK.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:PK,color:_K,borderRadius:gK.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:yK,paddingRight:gK.paddingRight},"& > ul > li > span.cm-completionDetail":{color:yK,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 ${AK}`},"&-warning":{borderLeft:`3px solid ${IK}`},"&-info":{borderLeft:`3px solid ${LK}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${AK}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${IK}`},".cm-matchingBracket":{backgroundColor:QAe,outline:`1px solid ${$Ae}`,borderRadius:fK.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${CK}20`,outline:`1px solid ${AK}`,borderRadius:fK.borderRadius},".cm-selectionMatch":{backgroundColor:ZAe,outline:`1px solid ${vK}50`,borderRadius:fK.borderRadius},".cm-foldPlaceholder":{backgroundColor:NK,color:yK,border:`1px dotted ${yK}70`,borderRadius:pK.borderRadius,padding:pK.padding,margin:pK.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${MK}, 0 0 0 3px ${DK}40`},"& .cm-scroller::-webkit-scrollbar":{width:mK.width,height:mK.height},"& .cm-scroller::-webkit-scrollbar-track":{background:jK},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:yK,borderRadius:mK.borderRadius,border:`3px solid ${jK}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:vK},".cm-ghostText":{opacity:`0.5`,color:yK}},{dark:!1}),Ft(Yt.define([{tag:z.keyword,color:DK,fontWeight:`bold`},{tag:z.controlKeyword,color:DK,fontWeight:`bold`},{tag:z.moduleKeyword,color:DK,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:OK},{tag:[z.variableName],color:_K},{tag:[z.propertyName],color:OK,fontStyle:`normal`},{tag:[z.typeName],color:DK},{tag:[z.className],color:TK,fontStyle:`italic`},{tag:[z.namespace],color:kK,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:kK},{tag:[z.bracket],color:yK},{tag:[z.brace],color:yK},{tag:[z.punctuation],color:yK},{tag:[z.function(z.variableName)],color:DK},{tag:[z.labelName],color:kK,fontStyle:`italic`},{tag:[z.definition(z.function(z.variableName))],color:DK},{tag:[z.definition(z.variableName)],color:OK},{tag:z.number,color:wK},{tag:z.changed,color:wK},{tag:z.annotation,color:AK,fontStyle:`italic`},{tag:z.modifier,color:wK,fontStyle:`italic`},{tag:z.self,color:wK},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:wK},{tag:[z.atom,z.bool,z.special(z.variableName)],color:wK},{tag:[z.processingInstruction,z.inserted],color:EK},{tag:[z.special(z.string),z.regexp],color:YAe},{tag:z.string,color:EK},{tag:z.definition(z.typeName),color:DK,fontWeight:`bold`},{tag:[z.definition(z.name),z.separator],color:OK},{tag:z.meta,color:yK},{tag:z.comment,fontStyle:`italic`,color:yK},{tag:z.docComment,fontStyle:`italic`,color:yK},{tag:[z.tagName],color:kK},{tag:[z.attributeName],color:TK},{tag:[z.heading],fontWeight:`bold`,color:wK},{tag:z.heading1,color:wK,fontWeight:`bold`},{tag:z.heading2,color:wK},{tag:z.heading3,color:wK},{tag:z.heading4,color:DK},{tag:z.heading5,color:DK},{tag:z.heading6,color:DK},{tag:[z.strong],fontWeight:`bold`,color:_K},{tag:[z.emphasis],fontStyle:`italic`,color:EK},{tag:[z.link],color:eje,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:LK,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:_K,textDecoration:`underline wavy`,borderBottom:`1px wavy ${AK}`},{tag:[z.strikethrough],color:AK,textDecoration:`line-through`},{tag:z.constant(z.name),color:wK},{tag:z.deleted,color:AK},{tag:z.squareBracket,color:yK},{tag:z.angleBracket,color:yK},{tag:z.monospace,color:_K},{tag:[z.contentSeparator],color:OK},{tag:z.quote,color:yK}]))],HK={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},nje={borderLeftWidth:`2px`},UK={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},WK={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},GK={border:`none`,borderRadius:`4px`,padding:`2px 10px`},rje={borderRadius:`2px`},KK={borderRadius:`2px`},qK={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},JK={width:`12px`,height:`12px`,borderRadius:`6px`},YK={borderRadius:`4px`,padding:`2px 6px`},XK={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},ije=`#24283b`,ZK=`#414868`,QK=`#565f89`,$K=`#c0caf5`,eq=`#282e44`,tq=`#1f2335`,aje=`#f7768e`,nq=`#ff9e64`,rq=`#e0af68`,iq=`#9ece6a`,aq=`#2ac3de`,oq=`#7aa2f7`,sq=`#bb9af7`,cq=`#f7768e`,lq=tq,oje=`#292e427a`,uq=ije,dq=eq,fq=`#6f7bb630`,sje=`#6f7bb650`,pq=$K,cje=`#3d59a150`,lje=oq,mq=nq,hq=aq,uje=sq,gq=`#3b4a3880`,_q=`#4a393a80`,vq=`#9ece6a`,yq=`#f7768e`,dje=[Ut.theme({"&":{color:$K,backgroundColor:uq,fontSize:HK.fontSize,fontFamily:HK.fontFamily},".cm-content":{caretColor:pq,lineHeight:HK.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:pq,borderLeftWidth:nje.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${pq}99`,color:uq},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:fq},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#7aa2f740`,outline:`1px solid ${oq}`,color:$K,borderRadius:YK.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:oq,color:uq,padding:YK.padding,"& span":{color:uq}},".cm-search.cm-panel.cm-textfield":{color:$K,borderRadius:YK.borderRadius,padding:YK.padding},".cm-panels":{backgroundColor:eq,color:$K,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${QK}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${QK}`},".cm-panel button":{backgroundColor:dq,color:$K,border:GK.border,borderRadius:GK.borderRadius,padding:GK.padding},".cm-panel button:hover":{backgroundColor:tq},".cm-activeLine":{backgroundColor:oje,borderRadius:rje.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:lq,color:QK,border:WK.border,borderRight:`1px solid ${tq}`,paddingRight:WK.paddingRight},".cm-activeLineGutter":{backgroundColor:tq,color:$K,fontWeight:WK.fontWeight},".cm-lineNumbers":{fontSize:WK.fontSize,lineHeight:WK.lineHeight},".cm-foldGutter":{fontSize:WK.fontSize,lineHeight:WK.lineHeight},".cm-foldGutter .cm-gutterElement":{color:QK,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:$K},".cm-insertedLine":{textDecoration:UK.insertedTextDecoration,backgroundColor:gq,color:vq,padding:UK.insertedLinePadding,borderRadius:UK.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:UK.insertedTextDecoration,backgroundColor:`${gq} !important`,color:vq,padding:UK.insertedLinePadding,borderRadius:UK.borderRadious,border:`1px solid ${vq}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:UK.deletedTextDecoration,backgroundColor:_q,color:yq,padding:UK.insertedLinePadding,borderRadius:UK.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:UK.deletedTextDecoration,backgroundColor:`${_q} !important`,color:yq,padding:UK.insertedLinePadding,borderRadius:UK.borderRadious,border:`1px solid ${yq}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:dq,border:`1px solid ${QK}`,borderRadius:XK.borderRadius,padding:XK.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:dq,border:`none`},"& > ul > li":{padding:XK.padding,lineHeight:XK.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:fq,color:$K,borderRadius:XK.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:QK,paddingRight:XK.paddingRight},"& > ul > li > span.cm-completionDetail":{color:QK,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:dq,borderBottomColor:dq},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${cq}`},"&-warning":{borderLeft:`3px solid ${mq}`},"&-info":{borderLeft:`3px solid ${hq}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${cq}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${mq}`},".cm-matchingBracket":{backgroundColor:cje,outline:`1px solid ${lje}`,borderRadius:KK.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${aje}20`,outline:`1px solid ${cq}`,borderRadius:KK.borderRadius},".cm-selectionMatch":{backgroundColor:sje,outline:`1px solid ${ZK}50`,borderRadius:KK.borderRadius},".cm-foldPlaceholder":{backgroundColor:dq,color:QK,border:`1px dotted ${QK}70`,borderRadius:qK.borderRadius,padding:qK.padding,margin:qK.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${uq}, 0 0 0 3px ${oq}40`},"& .cm-scroller::-webkit-scrollbar":{width:JK.width,height:JK.height},"& .cm-scroller::-webkit-scrollbar-track":{background:lq},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:ZK,borderRadius:JK.borderRadius,border:`3px solid ${lq}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:QK},".cm-ghostText":{opacity:`0.5`,color:QK}},{dark:!0}),Ft(Yt.define([{tag:z.keyword,color:sq,fontWeight:`bold`},{tag:z.controlKeyword,color:sq,fontWeight:`bold`},{tag:z.moduleKeyword,color:sq,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:$K},{tag:[z.variableName],color:$K},{tag:[z.propertyName],color:oq,fontStyle:`normal`},{tag:[z.typeName],color:aq},{tag:[z.className],color:rq,fontStyle:`italic`},{tag:[z.namespace],color:oq,fontStyle:`italic`},{tag:[z.operator,z.operatorKeyword],color:sq},{tag:[z.bracket],color:QK},{tag:[z.brace],color:QK},{tag:[z.punctuation],color:QK},{tag:[z.function(z.variableName)],color:oq},{tag:[z.labelName],color:oq,fontStyle:`italic`},{tag:[z.definition(z.function(z.variableName))],color:oq},{tag:[z.definition(z.variableName)],color:$K},{tag:z.number,color:nq},{tag:z.changed,color:nq},{tag:z.annotation,color:cq,fontStyle:`italic`},{tag:z.modifier,color:nq,fontStyle:`italic`},{tag:z.self,color:nq},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:sq},{tag:[z.atom,z.bool,z.special(z.variableName)],color:nq},{tag:[z.processingInstruction,z.inserted],color:iq},{tag:[z.special(z.string),z.regexp],color:`#b4f9f8`},{tag:z.string,color:iq},{tag:z.definition(z.typeName),color:aq,fontWeight:`bold`},{tag:[z.definition(z.name),z.separator],color:$K},{tag:z.meta,color:QK},{tag:z.comment,fontStyle:`italic`,color:QK},{tag:z.docComment,fontStyle:`italic`,color:QK},{tag:[z.tagName],color:sq},{tag:[z.attributeName],color:rq},{tag:[z.heading],fontWeight:`bold`,color:`#89ddff`},{tag:z.heading1,color:`#89ddff`,fontWeight:`bold`},{tag:z.heading2,color:`#89ddff`},{tag:z.heading3,color:`#89ddff`},{tag:z.heading4,color:`#89ddff`},{tag:z.heading5,color:`#89ddff`},{tag:z.heading6,color:`#89ddff`},{tag:[z.strong],fontWeight:`bold`,color:$K},{tag:[z.emphasis],fontStyle:`italic`,color:aq},{tag:[z.link],color:uje,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:hq,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:$K,textDecoration:`underline wavy`,borderBottom:`1px wavy ${cq}`},{tag:[z.strikethrough],color:cq,textDecoration:`line-through`},{tag:z.constant(z.name),color:nq},{tag:z.deleted,color:cq},{tag:z.squareBracket,color:QK},{tag:z.angleBracket,color:QK},{tag:z.monospace,color:$K},{tag:[z.contentSeparator],color:oq},{tag:z.quote,color:QK}]))],bq={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},fje={borderLeftWidth:`2px`},xq={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},Sq={paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},Cq={borderRadius:`4px`,padding:`2px 10px`},pje={borderRadius:`2px`},wq={borderRadius:`2px`},Tq={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},Eq={width:`12px`,height:`12px`,borderRadius:`6px`},Dq={borderRadius:`4px`,padding:`2px 6px`},Oq={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},mje=`#1e1e1e`,kq=`#252526`,Aq=`#2d2d30`,jq=`#838383`,hje=`#c6c6c6`,Mq=`#d4d4d4`,Nq=`#e9e9e9`,gje=`#1c1c1c`,Pq=`#569cd6`,_je=`#c586c0`,Fq=`#9cdcfe`,Iq=`#4ec9b0`,Lq=`#dcdcaa`,vje=`#b5cea8`,Rq=`#ce9178`,zq=`#f44747`,Bq=`#d7ba7d`,Vq=`#6a9955`,Hq=zq,Uq=`#FFFFFF08`,Wq=mje,Gq=kq,yje=`#264F7899`,bje=`#72a1ff59`,Kq=hje,xje=`#ffffff15`,Sje=Pq,qq=Bq,Jq=`#3794ff`,Cje=`#c586c0`,Yq=`#1e3f1e80`,Xq=`#4b1c1c80`,Zq=`#6cc26f`,Qq=`#f14c4c`,wje=[Ut.theme({"&":{color:Mq,backgroundColor:Wq,fontSize:bq.fontSize,fontFamily:bq.fontFamily},".cm-content":{caretColor:Kq,lineHeight:bq.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:Kq,borderLeftWidth:fje.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${Kq}99`,color:Wq},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:yje},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#72a1ff40`,outline:`1px solid ${Pq}90`,color:Nq,borderRadius:Dq.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#3794ff90`,color:Nq,padding:Dq.padding,"& span":{color:Nq}},".cm-search.cm-panel.cm-textfield":{color:Mq,borderRadius:Dq.borderRadius,padding:Dq.padding},".cm-panels":{backgroundColor:kq,color:Mq,borderRadius:`3px`,boxShadow:`0 2px 6px rgba(0, 0, 0, 0.45)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${Aq}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${Aq}`},".cm-panel button":{backgroundColor:Aq,color:Mq,border:`1px solid ${Aq}`,borderRadius:Cq.borderRadius,padding:Cq.padding},".cm-panel button:hover":{backgroundColor:`#3a3a3a`,border:`1px solid ${jq}80`},".cm-activeLine":{backgroundColor:Uq,borderRadius:pje.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:gje,color:jq,border:`none`,borderRight:`1px solid ${Aq}`,paddingRight:Sq.paddingRight},".cm-activeLineGutter":{backgroundColor:Uq,color:Nq,fontWeight:Sq.fontWeight},".cm-lineNumbers":{fontSize:Sq.fontSize,lineHeight:Sq.lineHeight},".cm-foldGutter":{fontSize:Sq.fontSize,lineHeight:Sq.lineHeight},".cm-foldGutter .cm-gutterElement":{color:jq,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:Nq},".cm-insertedLine":{textDecoration:xq.insertedTextDecoration,backgroundColor:Yq,color:Zq,padding:xq.insertedLinePadding,borderRadius:xq.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:xq.insertedTextDecoration,backgroundColor:`${Yq} !important`,color:Zq,padding:xq.insertedLinePadding,borderRadius:xq.borderRadious,border:`1px solid ${Zq}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:xq.deletedTextDecoration,backgroundColor:Xq,color:Qq,padding:xq.insertedLinePadding,borderRadius:xq.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:xq.deletedTextDecoration,backgroundColor:`${Xq} !important`,color:Qq,padding:xq.insertedLinePadding,borderRadius:xq.borderRadious,border:`1px solid ${Qq}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:Gq,border:`1px solid ${Aq}`,borderRadius:Oq.borderRadius,padding:Oq.padding,boxShadow:`0 3px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:Gq,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:Oq.padding,lineHeight:Oq.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#04395e`,color:Nq,borderRadius:Oq.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:jq,paddingRight:Oq.paddingRight},"& > ul > li > span.cm-completionDetail":{color:jq,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Gq,borderBottomColor:Gq},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${Hq}`},"&-warning":{borderLeft:`3px solid ${qq}`},"&-info":{borderLeft:`3px solid ${Jq}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${Hq}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${qq}`},".cm-matchingBracket":{backgroundColor:xje,outline:`1px solid ${Sje}80`,borderRadius:wq.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${zq}40`,outline:`1px solid ${Hq}`,borderRadius:wq.borderRadius},".cm-selectionMatch":{backgroundColor:bje,outline:`1px solid ${Aq}70`,borderRadius:wq.borderRadius},".cm-foldPlaceholder":{backgroundColor:Gq,color:jq,border:`1px dotted ${jq}70`,borderRadius:Tq.borderRadius,padding:Tq.padding,margin:Tq.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 1px ${Aq}`},"& .cm-scroller::-webkit-scrollbar":{width:Eq.width,height:Eq.height},"& .cm-scroller::-webkit-scrollbar-track":{background:Wq},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#424242`,borderRadius:Eq.borderRadius,border:`3px solid ${Wq}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#525252`},".cm-ghostText":{opacity:`0.5`,color:jq}},{dark:!0}),Ft(Yt.define([{tag:z.keyword,color:Pq,fontWeight:`bold`},{tag:z.controlKeyword,color:_je,fontWeight:`bold`},{tag:z.moduleKeyword,color:Pq,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:Mq},{tag:[z.variableName],color:Fq},{tag:[z.propertyName],color:Fq,fontStyle:`normal`},{tag:[z.typeName],color:Iq},{tag:[z.className],color:Iq,fontStyle:`normal`},{tag:[z.namespace],color:Mq,fontStyle:`normal`},{tag:[z.operator,z.operatorKeyword],color:Mq},{tag:[z.bracket],color:Mq},{tag:[z.brace],color:Mq},{tag:[z.punctuation],color:Mq},{tag:[z.function(z.variableName)],color:Lq},{tag:[z.labelName],color:Lq,fontStyle:`normal`},{tag:[z.definition(z.function(z.variableName))],color:Lq},{tag:[z.definition(z.variableName)],color:Fq},{tag:z.number,color:vje},{tag:z.changed,color:Bq},{tag:z.annotation,color:Bq,fontStyle:`italic`},{tag:z.modifier,color:Pq,fontStyle:`normal`},{tag:z.self,color:Pq},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:Fq},{tag:[z.atom,z.bool,z.special(z.variableName)],color:Pq},{tag:[z.processingInstruction,z.inserted],color:Rq},{tag:[z.special(z.string),z.regexp],color:`#d16969`},{tag:z.string,color:Rq},{tag:z.definition(z.typeName),color:Iq,fontWeight:`bold`},{tag:[z.definition(z.name),z.separator],color:Mq},{tag:z.meta,color:jq},{tag:z.comment,fontStyle:`italic`,color:Vq},{tag:z.docComment,fontStyle:`italic`,color:Vq},{tag:[z.tagName],color:Pq},{tag:[z.attributeName],color:Fq},{tag:[z.heading],fontWeight:`bold`,color:Pq},{tag:z.heading1,color:Pq,fontWeight:`bold`},{tag:z.heading2,color:Pq},{tag:z.heading3,color:Pq},{tag:z.heading4,color:Pq},{tag:z.heading5,color:Pq},{tag:z.heading6,color:Pq},{tag:[z.strong],fontWeight:`bold`,color:Pq},{tag:[z.emphasis],fontStyle:`italic`,color:Iq},{tag:[z.link],color:Cje,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:Jq,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:Mq,textDecoration:`underline wavy`,borderBottom:`1px wavy ${Hq}`},{tag:[z.strikethrough],color:Hq,textDecoration:`line-through`},{tag:z.constant(z.name),color:Fq},{tag:z.deleted,color:Hq},{tag:z.squareBracket,color:Mq},{tag:z.angleBracket,color:Mq},{tag:z.monospace,color:Mq},{tag:[z.contentSeparator],color:Mq},{tag:z.quote,color:Vq}]))],$q={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},Tje={borderLeftWidth:`2px`},eJ={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},tJ={paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},nJ={borderRadius:`4px`,padding:`2px 10px`},Eje={borderRadius:`2px`},rJ={borderRadius:`2px`},iJ={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},aJ={width:`12px`,height:`12px`,borderRadius:`6px`},oJ={borderRadius:`4px`,padding:`2px 6px`},sJ={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},Dje=`#ffffff`,cJ=`#f3f3f3`,lJ=`#d6d6d6`,uJ=`#6b6b6b`,Oje=`#000000`,dJ=`#383a42`,fJ=`#1f1f1f`,kje=`#f5f5f5`,pJ=`#0064ff`,mJ=`#af00db`,hJ=`#0070c1`,gJ=`#267f99`,_J=`#795e26`,Aje=`#098658`,vJ=`#a31515`,yJ=`#e51400`,bJ=`#795e26`,xJ=`#008000`,SJ=yJ,CJ=`#99999926`,wJ=Dje,TJ=cJ,jje=`#add6ff`,Mje=`#a8ac9480`,EJ=Oje,Nje=`#007acc20`,Pje=`#007acc`,DJ=`#bf8803`,OJ=`#006ab1`,Fje=`#9e46d0`,kJ=`#ddfbe0`,AJ=`#ffebec`,jJ=`#22863a`,MJ=`#e51400`,Ije=[Ut.theme({"&":{color:dJ,backgroundColor:wJ,fontSize:$q.fontSize,fontFamily:$q.fontFamily},".cm-content":{caretColor:EJ,lineHeight:$q.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:EJ,borderLeftWidth:Tje.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${EJ}99`,color:wJ},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:jje},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#bbdefb`,outline:`1px solid ${hJ}90`,color:fJ,borderRadius:oJ.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#90caf9`,color:fJ,padding:oJ.padding,"& span":{color:fJ}},".cm-search.cm-panel.cm-textfield":{color:dJ,borderRadius:oJ.borderRadius,padding:oJ.padding},".cm-panels":{backgroundColor:cJ,color:dJ,borderRadius:`3px`,boxShadow:`0 2px 6px rgba(0, 0, 0, 0.15)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${lJ}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${lJ}`},".cm-panel button":{backgroundColor:wJ,color:dJ,border:`1px solid ${lJ}`,borderRadius:nJ.borderRadius,padding:nJ.padding},".cm-panel button:hover":{backgroundColor:`#e8e8e8`,border:`1px solid ${uJ}80`},".cm-activeLine":{backgroundColor:CJ,borderRadius:Eje.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:kje,color:`#237893`,border:`none`,borderRight:`1px solid ${lJ}`,paddingRight:tJ.paddingRight},".cm-activeLineGutter":{backgroundColor:CJ,color:`#0b216f`,fontWeight:tJ.fontWeight},".cm-lineNumbers":{fontSize:tJ.fontSize,lineHeight:tJ.lineHeight},".cm-foldGutter":{fontSize:tJ.fontSize,lineHeight:tJ.lineHeight},".cm-foldGutter .cm-gutterElement":{color:`#237893`,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:`#0b216f`},".cm-insertedLine":{textDecoration:eJ.insertedTextDecoration,backgroundColor:kJ,color:jJ,padding:eJ.insertedLinePadding,borderRadius:eJ.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:eJ.insertedTextDecoration,backgroundColor:`${kJ} !important`,color:jJ,padding:eJ.insertedLinePadding,borderRadius:eJ.borderRadious,border:`1px solid ${jJ}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:eJ.deletedTextDecoration,backgroundColor:AJ,color:MJ,padding:eJ.insertedLinePadding,borderRadius:eJ.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:eJ.deletedTextDecoration,backgroundColor:`${AJ} !important`,color:MJ,padding:eJ.insertedLinePadding,borderRadius:eJ.borderRadious,border:`1px solid ${MJ}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:TJ,border:`1px solid ${lJ}`,borderRadius:sJ.borderRadius,padding:sJ.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:TJ,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:sJ.padding,lineHeight:sJ.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#dcebfc`,color:fJ,borderRadius:sJ.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:uJ,paddingRight:sJ.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:TJ,borderBottomColor:TJ},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${SJ}`},"&-warning":{borderLeft:`3px solid ${DJ}`},"&-info":{borderLeft:`3px solid ${OJ}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${SJ}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${DJ}`},".cm-matchingBracket":{backgroundColor:Nje,outline:`1px solid ${Pje}80`,borderRadius:rJ.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${yJ}20`,outline:`1px solid ${SJ}`,borderRadius:rJ.borderRadius},".cm-selectionMatch":{backgroundColor:Mje,outline:`1px solid ${lJ}70`,borderRadius:rJ.borderRadius},".cm-foldPlaceholder":{backgroundColor:TJ,color:uJ,border:`1px dotted ${uJ}70`,borderRadius:iJ.borderRadius,padding:iJ.padding,margin:iJ.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 1px ${lJ}`},"& .cm-scroller::-webkit-scrollbar":{width:aJ.width,height:aJ.height},"& .cm-scroller::-webkit-scrollbar-track":{background:wJ},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#dadada`,borderRadius:aJ.borderRadius,border:`3px solid ${wJ}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#cccccc`},".cm-ghostText":{opacity:`0.5`,color:uJ}},{dark:!1}),Ft(Yt.define([{tag:z.keyword,color:pJ,fontWeight:`bold`},{tag:z.controlKeyword,color:mJ,fontWeight:`bold`},{tag:z.moduleKeyword,color:pJ,fontWeight:`bold`},{tag:[z.name,z.deleted,z.character,z.macroName],color:dJ},{tag:[z.variableName],color:hJ},{tag:[z.propertyName],color:hJ,fontStyle:`normal`},{tag:[z.typeName],color:gJ},{tag:[z.className],color:gJ,fontStyle:`normal`},{tag:[z.namespace],color:dJ,fontStyle:`normal`},{tag:[z.operator,z.operatorKeyword],color:dJ},{tag:[z.bracket],color:dJ},{tag:[z.brace],color:dJ},{tag:[z.punctuation],color:dJ},{tag:[z.function(z.variableName)],color:_J},{tag:[z.labelName],color:_J,fontStyle:`normal`},{tag:[z.definition(z.function(z.variableName))],color:_J},{tag:[z.definition(z.variableName)],color:hJ},{tag:z.number,color:Aje},{tag:z.changed,color:bJ},{tag:z.annotation,color:bJ,fontStyle:`italic`},{tag:z.modifier,color:pJ,fontStyle:`normal`},{tag:z.self,color:pJ},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:hJ},{tag:[z.atom,z.bool,z.special(z.variableName)],color:pJ},{tag:[z.processingInstruction,z.inserted],color:vJ},{tag:[z.special(z.string),z.regexp],color:mJ},{tag:z.string,color:vJ},{tag:z.definition(z.typeName),color:gJ,fontWeight:`bold`},{tag:[z.definition(z.name),z.separator],color:dJ},{tag:z.meta,color:uJ},{tag:z.comment,fontStyle:`italic`,color:xJ},{tag:z.docComment,fontStyle:`italic`,color:xJ},{tag:[z.tagName],color:pJ},{tag:[z.attributeName],color:hJ},{tag:[z.heading],fontWeight:`bold`,color:pJ},{tag:z.heading1,color:pJ,fontWeight:`bold`},{tag:z.heading2,color:pJ},{tag:z.heading3,color:pJ},{tag:z.heading4,color:pJ},{tag:z.heading5,color:pJ},{tag:z.heading6,color:pJ},{tag:[z.strong],fontWeight:`bold`,color:pJ},{tag:[z.emphasis],fontStyle:`italic`,color:hJ},{tag:[z.link],color:Fje,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[z.url],color:OJ,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[z.invalid],color:dJ,textDecoration:`underline wavy`,borderBottom:`1px wavy ${SJ}`},{tag:[z.strikethrough],color:SJ,textDecoration:`line-through`},{tag:z.constant(z.name),color:hJ},{tag:z.deleted,color:SJ},{tag:z.squareBracket,color:dJ},{tag:z.angleBracket,color:dJ},{tag:z.monospace,color:dJ},{tag:[z.contentSeparator],color:dJ},{tag:z.quote,color:xJ}]))];function NJ(){return NJ=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},NJ.apply(null,arguments)}function Lje(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 PJ=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,FJ=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(PJ(e)):PJ,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 eee(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=hn(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Vt(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`&&(FJ.prototype[Symbol.iterator]=function(){return this});var IJ={from:-1,to:-1,match:/.*/.exec(``)},LJ=`gm`+(/x/.unicode==null?``:`u`),RJ=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=IJ,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new VJ(e,t,n,r,i);this.re=new RegExp(t,LJ+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=HJ(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=HJ(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}}},zJ=new WeakMap,BJ=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=zJ.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return zJ.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)),zJ.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},VJ=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=IJ,this.matchPos=HJ(e,r),this.re=new RegExp(t,LJ+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=BJ.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=HJ(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=BJ.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(RJ.prototype[Symbol.iterator]=VJ.prototype[Symbol.iterator]=function(){return this});function Rje(e){try{return new RegExp(e,LJ),!0}catch{return!1}}function HJ(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 UJ(e){let t=On(`input`,{class:`cm-textfield`,name:`line`,value:String(e.state.doc.lineAt(e.state.selection.main.head).number)}),n=On(`form`,{class:`cm-gotoLine`,onkeydown:t=>{t.keyCode==27?(t.preventDefault(),e.dispatch({effects:WJ.of(!1)}),e.focus()):t.keyCode==13&&(t.preventDefault(),r())},onsubmit:e=>{e.preventDefault(),r()}},On(`label`,e.state.phrase(`Go to line`),`: `,t),` `,On(`button`,{class:`cm-button`,type:`submit`},e.state.phrase(`go`)),On(`button`,{name:`close`,onclick:()=>{e.dispatch({effects:WJ.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=on.cursor(d.from+Math.max(0,Math.min(l,d.length)));e.dispatch({effects:[WJ.of(!1),Ut.scrollIntoView(f.from,{y:`center`})],selection:f}),e.focus()}return{dom:n}}var WJ=Qt.define(),GJ=In.define({create(){return!0},update(e,t){for(let n of t.effects)n.is(WJ)&&(e=n.value);return e},provide:e=>Xt.from(e,e=>e?UJ:null)}),zje=e=>{let t=wn(e,UJ);if(!t){let n=[WJ.of(!0)];e.state.field(GJ,!1)??n.push(Qt.appendConfig.of([GJ,Bje])),e.dispatch({effects:n}),t=wn(e,UJ)}return t&&t.dom.querySelector(`input`).select(),!0},Bje=Ut.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`}}}),Vje={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},KJ=vn.define({combine(e){return bt(e,Vje,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Hje(e){let t=[qje,Kje];return e&&t.push(KJ.of(e)),t}var Uje=Ln.mark({class:`cm-selectionMatch`}),Wje=Ln.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function qJ(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=nn.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=nn.Word)}function Gje(e,t,n,r){return e(t.sliceDoc(n,n+1))==nn.Word&&e(t.sliceDoc(r-1,r))==nn.Word}var Kje=wt.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(KJ),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Ln.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return Ln.none;let e=n.wordAt(i.head);if(!e)return Ln.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 Ln.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(qJ(o,n,i.from,i.to)&&Gje(o,n,i.from,i.to)))return Ln.none}else if(a=n.sliceDoc(i.from,i.to),!a)return Ln.none}let s=[];for(let r of e.visibleRanges){let e=new FJ(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||qJ(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(Wje.range(r,a)):(r>=i.to||a<=i.from)&&s.push(Uje.range(r,a)),s.length>t.maxMatches))return Ln.none}}return Ln.set(s)}},{decorations:e=>e.decorations}),qje=Ut.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),Jje=({state:e,dispatch:t})=>{let{selection:n}=e,r=on.create(n.ranges.map(t=>e.wordAt(t.head)||on.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Yje(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 FJ(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new FJ(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 Xje=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return Jje({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=Yje(e,r);return i?(t(e.update({selection:e.selection.addRange(on.range(i.from,i.to),!1),effects:Ut.scrollIntoView(i.to)})),!0):!1},JJ=vn.define({combine(e){return bt(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new cMe(e),scrollToMatch:e=>Ut.scrollIntoView(e)})}}),YJ=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||Rje(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`?`
|
|
1264
1264
|
`: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 eMe(this):new Qje(this)}getCursor(e,t=0,n){let r=e.doc?e:Cn.create({doc:e});return n??=r.doc.length,this.regexp?QJ(this,r,t,n):ZJ(this,r,t,n)}},XJ=class{constructor(e){this.spec=e}};function ZJ(e,t,n,r){return new FJ(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?Zje(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function Zje(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($J(i,n-a))!=nn.Word||t(eY(i,n-a))!=nn.Word)&&(t(eY(i,r-a))!=nn.Word||t($J(i,r-a))!=nn.Word))}var Qje=class extends XJ{constructor(e){super(e)}nextMatch(e,t,n){let r=ZJ(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=ZJ(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=ZJ(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=ZJ(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=ZJ(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 QJ(e,t,n,r){return new RJ(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?$je(t.charCategorizer(t.selection.main.head)):void 0},n,r)}function $J(e,t){return e.slice(Pt(e,t,!1),t)}function eY(e,t){return e.slice(t,Pt(e,t))}function $je(e){return(t,n,r)=>!r[0].length||(e($J(r.input,r.index))!=nn.Word||e(eY(r.input,r.index))!=nn.Word)&&(e(eY(r.input,r.index+r[0].length))!=nn.Word||e($J(r.input,r.index+r[0].length))!=nn.Word)}var eMe=class extends XJ{nextMatch(e,t,n){let r=QJ(this.spec,e,n,e.doc.length).next();return r.done&&(r=QJ(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=QJ(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=QJ(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=QJ(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)}},tY=Qt.define(),nY=Qt.define(),rY=In.define({create(e){return new iY(uY(e).create(),null)},update(e,t){for(let n of t.effects)n.is(tY)?e=new iY(n.value.create(),e.panel):n.is(nY)&&(e=new iY(e.query,n.value?lY:null));return e},provide:e=>Xt.from(e,e=>e.panel)}),iY=class{constructor(e,t){this.query=e,this.panel=t}},tMe=Ln.mark({class:`cm-searchMatch`}),nMe=Ln.mark({class:`cm-searchMatch cm-searchMatch-selected`}),rMe=wt.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(rY))}update(e){let t=e.state.field(rY);(t!=e.startState.field(rY)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Ln.none;let{view:n}=this,r=new Nn;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?nMe:tMe)})}return r.finish()}},{decorations:e=>e.decorations});function aY(e){return t=>{let n=t.state.field(rY,!1);return n&&n.query.spec.valid?e(t,n):pY(t)}}var oY=aY((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=on.single(r.from,r.to),a=e.state.facet(JJ);return e.dispatch({selection:i,effects:[vY(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),fY(e),!0}),sY=aY((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=on.single(i.from,i.to),o=e.state.facet(JJ);return e.dispatch({selection:a,effects:[vY(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),fY(e),!0}),iMe=aY((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:on.create(n.map(e=>on.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),aMe=({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 FJ(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(on.range(t.value.from,t.value.to))}return t(e.update({selection:on.create(a,o),userEvent:`select.search.matches`})),!0},cY=aY((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(Ut.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`)));let d=e.state.changes(s);return o&&(c=on.single(o.from,o.to).map(d),u.push(vY(e,o)),u.push(n.facet(JJ).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),oMe=aY((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:Ut.announce.of(r),userEvent:`input.replace.all`}),!0});function lY(e){return e.state.facet(JJ).createPanel(e)}function uY(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(JJ);return new YJ({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 dY(e){let t=wn(e,lY);return t&&t.dom.querySelector(`[main-field]`)}function fY(e){let t=dY(e);t&&t==e.root.activeElement&&t.select()}var pY=e=>{let t=e.state.field(rY,!1);if(t&&t.panel){let n=dY(e);if(n&&n!=e.root.activeElement){let r=uY(e.state,t.query.spec);r.valid&&e.dispatch({effects:tY.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[nY.of(!0),t?tY.of(uY(e.state,t.query.spec)):Qt.appendConfig.of(uMe)]});return!0},mY=e=>{let t=e.state.field(rY,!1);if(!t||!t.panel)return!1;let n=wn(e,lY);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:nY.of(!1)}),!0},sMe=[{key:`Mod-f`,run:pY,scope:`editor search-panel`},{key:`F3`,run:oY,shift:sY,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:oY,shift:sY,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:mY,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:aMe},{key:`Mod-Alt-g`,run:zje},{key:`Mod-d`,run:Xje,preventDefault:!0}],cMe=class{constructor(e){this.view=e;let t=this.query=e.state.field(rY).query.spec;this.commit=this.commit.bind(this),this.searchField=On(`input`,{value:t.search,placeholder:hY(e,`Find`),"aria-label":hY(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=On(`input`,{value:t.replace,placeholder:hY(e,`Replace`),"aria-label":hY(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=On(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=On(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=On(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return On(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=On(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>oY(e),[hY(e,`next`)]),n(`prev`,()=>sY(e),[hY(e,`previous`)]),n(`select`,()=>iMe(e),[hY(e,`all`)]),On(`label`,null,[this.caseField,hY(e,`match case`)]),On(`label`,null,[this.reField,hY(e,`regexp`)]),On(`label`,null,[this.wordField,hY(e,`by word`)]),...e.state.readOnly?[]:[On(`br`),this.replaceField,n(`replace`,()=>cY(e),[hY(e,`replace`)]),n(`replaceAll`,()=>oMe(e),[hY(e,`replace all`)])],On(`button`,{name:`close`,onclick:()=>mY(e),"aria-label":hY(e,`close`),type:`button`},[`×`])])}commit(){let e=new YJ({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:tY.of(e)}))}keydown(e){dn(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?sY:oY)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),cY(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(tY)&&!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(JJ).top}};function hY(e,t){return e.state.phrase(t)}var gY=30,_Y=/[\s\.,:;?!]/;function vY(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-gY),o=Math.min(i,n+gY),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<gY;e++)if(!_Y.test(s[e+1])&&_Y.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-gY;e--)if(!_Y.test(s[e-1])&&_Y.test(s[e])){s=s.slice(0,e);break}}return Ut.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var lMe=Ut.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`}}),uMe=[rY,cn.low(rMe),lMe],yY=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},bY=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(DY).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new Nn,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=SMe(s);if(i)o.add(n,n,Ln.widget({widget:new vMe(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,Ln.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,xY(f))}};function xY(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 yY(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new yY(r.from,n,r.diagnostic)}),r}function dMe(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(DY).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(SY))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function fMe(e,t){return e.field(TY,!1)?t:t.concat(Qt.appendConfig.of(CMe))}var SY=Qt.define(),CY=Qt.define(),wY=Qt.define(),TY=In.define({create(){return new bY(Ln.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=xY(n,e.selected.diagnostic,i)||xY(n,null,i)}!n.size&&i&&t.state.facet(DY).autoPanel&&(i=null),e=new bY(n,i,r)}for(let n of t.effects)if(n.is(SY)){let r=t.state.facet(DY).autoPanel?n.value.length?MY.open:null:e.panel;e=bY.init(n.value,r,t.state)}else n.is(CY)?e=new bY(e.diagnostics,n.value?MY.open:null,e.selected):n.is(wY)&&(e=new bY(e.diagnostics,e.panel,n.value));return e},provide:e=>[Xt.from(e,e=>e.panel),Ut.decorations.from(e,e=>e.diagnostics)]}),pMe=Ln.mark({class:`cm-lintRange cm-lintRange-active`});function mMe(e,t,n){let{diagnostics:r}=e.state.field(TY),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(DY).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:hMe(e,i)}}}:null}function hMe(e,t){return On(`ul`,{class:`cm-tooltip-lint`},t.map(t=>AY(e,t,!1)))}var gMe=e=>{let t=e.state.field(TY,!1);(!t||!t.panel)&&e.dispatch({effects:fMe(e.state,[CY.of(!0)])});let n=wn(e,MY.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},EY=e=>{let t=e.state.field(TY,!1);return!t||!t.panel?!1:(e.dispatch({effects:CY.of(!1)}),!0)},_Me=[{key:`Mod-Shift-m`,run:gMe,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(TY,!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)}}],DY=vn.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...bt(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:OY,tooltipFilter:OY,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 OY(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function kY(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 AY(e,t,n){let r=n?kY(t.actions):[];return On(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},On(`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=xY(e.state.field(TY).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),On(`u`,s.slice(c,c+1)),s.slice(c+1)];return On(`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&&On(`div`,{class:`cm-diagnosticSource`},t.source))}var vMe=class extends Ht{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return On(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},jY=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=AY(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},MY=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(t.keyCode==27)EY(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=kY(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=xY(this.view.state.field(TY).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=On(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=On(`div`,{class:`cm-panel-lint`},this.list,On(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>EY(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(TY).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(TY),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 jY(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 jY(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=xY(this.view.state.field(TY).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:wY.of(t)})}static open(t){return new e(t)}};function yMe(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 NY(e){return yMe(`<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 bMe=Ut.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:NY(`#d11`)},".cm-lintRange-warning":{backgroundImage:NY(`orange`)},".cm-lintRange-info":{backgroundImage:NY(`#999`)},".cm-lintRange-hint":{backgroundImage:NY(`#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 xMe(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function SMe(e){let t=`hint`,n=1;for(let r of e){let e=xMe(r.severity);e>n&&(n=e,t=r.severity)}return t}var CMe=[TY,Ut.decorations.compute([TY],e=>{let{selected:t,panel:n}=e.field(TY);return!t||!n||t.from==t.to?Ln.none:Ln.set([pMe.range(t.from,t.to)])}),Lt(mMe,{hideOn:dMe}),bMe],PY=function(e){e===void 0&&(e={});var{crosshairCursor:t=!1}=e,n=[];e.closeBracketsKeymap!==!1&&(n=n.concat(Vn)),e.defaultKeymap!==!1&&(n=n.concat(lEe)),e.searchKeymap!==!1&&(n=n.concat(sMe)),e.historyKeymap!==!1&&(n=n.concat(Fwe)),e.foldKeymap!==!1&&(n=n.concat(Rt)),e.completionKeymap!==!1&&(n=n.concat(Un)),e.lintKeymap!==!1&&(n=n.concat(_Me));var r=[];return e.lineNumbers!==!1&&r.push(rn()),e.highlightActiveLineGutter!==!1&&r.push(Gt()),e.highlightSpecialChars!==!1&&r.push(qt()),e.history!==!1&&r.push(Cwe()),e.foldGutter!==!1&&r.push(Zt()),e.drawSelection!==!1&&r.push(Ct()),e.dropCursor!==!1&&r.push(Dt()),e.allowMultipleSelections!==!1&&r.push(Cn.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&r.push(Nt()),e.syntaxHighlighting!==!1&&r.push(Ft(sn,{fallback:!0})),e.bracketMatching!==!1&&r.push(Sn()),e.closeBrackets!==!1&&r.push(Wn()),e.autocompletion!==!1&&r.push(Hn()),e.rectangularSelection!==!1&&r.push(En()),t!==!1&&r.push(Wt()),e.highlightActiveLine!==!1&&r.push(Kt()),e.highlightSelectionMatches!==!1&&r.push(Hje()),e.tabSize&&typeof e.tabSize==`number`&&r.push(ft.of(` `.repeat(e.tabSize))),r.concat([dt.of(n.flat())]).filter(Boolean)},wMe=`#e5c07b`,FY=`#e06c75`,TMe=`#56b6c2`,EMe=`#ffffff`,IY=`#abb2bf`,LY=`#7d8799`,DMe=`#61afef`,OMe=`#98c379`,RY=`#d19a66`,kMe=`#c678dd`,AMe=`#21252b`,zY=`#2c313a`,BY=`#282c34`,VY=`#353a42`,jMe=`#3E4451`,HY=`#528bff`,MMe=[Ut.theme({"&":{color:IY,backgroundColor:BY},".cm-content":{caretColor:HY},".cm-cursor, .cm-dropCursor":{borderLeftColor:HY},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:jMe},".cm-panels":{backgroundColor:AMe,color:IY},".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:BY,color:LY,border:`none`},".cm-activeLineGutter":{backgroundColor:zY},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:VY},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:VY,borderBottomColor:VY},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:zY,color:IY}}},{dark:!0}),Ft(Yt.define([{tag:z.keyword,color:kMe},{tag:[z.name,z.deleted,z.character,z.propertyName,z.macroName],color:FY},{tag:[z.function(z.variableName),z.labelName],color:DMe},{tag:[z.color,z.constant(z.name),z.standard(z.name)],color:RY},{tag:[z.definition(z.name),z.separator],color:IY},{tag:[z.typeName,z.className,z.number,z.changed,z.annotation,z.modifier,z.self,z.namespace],color:wMe},{tag:[z.operator,z.operatorKeyword,z.url,z.escape,z.regexp,z.link,z.special(z.string)],color:TMe},{tag:[z.meta,z.comment],color:LY},{tag:z.strong,fontWeight:`bold`},{tag:z.emphasis,fontStyle:`italic`},{tag:z.strikethrough,textDecoration:`line-through`},{tag:z.link,color:LY,textDecoration:`underline`},{tag:z.heading,fontWeight:`bold`,color:FY},{tag:[z.atom,z.bool,z.special(z.variableName)],color:RY},{tag:[z.processingInstruction,z.string,z.inserted],color:OMe},{tag:z.invalid,color:EMe}]))],NMe=Ut.theme({"&":{backgroundColor:`#fff`}},{dark:!1}),PMe=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(dt.of([uEe])),o&&(typeof o==`boolean`?s.unshift(PY()):s.unshift(PY(o))),a&&s.unshift(bn(a)),i){case`light`:s.push(NMe);break;case`dark`:s.push(MMe);break;case`none`:break;default:s.push(i);break}return n===!1&&s.push(Ut.editable.of(!1)),r&&s.push(Cn.readOnly.of(!0)),[...s]},FMe=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)}),IMe=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}},UY=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)}},WY=null,LMe=()=>typeof window>`u`?new UY:(WY||=new UY,WY),GY=en.define(),RMe=200,zMe=[];function BMe(e){var{value:t,selection:n,onChange:r,onStatistics:i,onCreateEditor:a,onUpdate:o,extensions:s=zMe,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,V.useState)(),[T,E]=(0,V.useState)(),[D,O]=(0,V.useState)(),k=(0,V.useState)(()=>({current:null}))[0],A=(0,V.useState)(()=>({current:null}))[0],j=Ut.theme({"&":{height:u,minHeight:d,maxHeight:f,width:p,minWidth:m,maxWidth:h},"& .cm-scroller":{height:`100% !important`}}),M=[Ut.updateListener.of(e=>{e.docChanged&&typeof r==`function`&&!e.transactions.some(e=>e.annotation(GY))&&(k.current?k.current.reset():(k.current=new IMe(()=>{if(A.current){var e=A.current;A.current=null,e()}k.current=null},RMe),LMe().add(k.current)),r(e.state.doc.toString(),e)),i&&i(FMe(e))}),j,...PMe({theme:l,editable:_,readOnly:v,placeholder:g,indentWithTab:y,basicSetup:b})];return o&&typeof o==`function`&&M.push(Ut.updateListener.of(o)),M=M.concat(s),(0,V.useLayoutEffect)(()=>{if(C&&!D){var e={doc:t,selection:n,extensions:M},r=S?Cn.fromJSON(S.json,e,S.fields):Cn.create(e);if(O(r),!T){var i=new Ut({state:r,parent:C,root:x});E(i),a&&a(i,r)}}return()=>{T&&(O(void 0),E(void 0))}},[C,D]),(0,V.useEffect)(()=>{e.container&&w(e.container)},[e.container]),(0,V.useEffect)(()=>()=>{T&&(T.destroy(),E(void 0)),k.current&&=(k.current.cancel(),null)},[T]),(0,V.useEffect)(()=>{c&&T&&T.focus()},[c,T]),(0,V.useEffect)(()=>{T&&T.dispatch({effects:Qt.reconfigure.of(M)})},[l,s,u,d,f,p,m,h,g,_,v,y,b,r,o]),(0,V.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:[GY.of(!0)]})};n?A.current=r:r()}}},[t,T]),{state:D,setState:O,view:T,setView:E,container:C,setContainer:w}}var VMe=[`className`,`value`,`selection`,`extensions`,`onChange`,`onStatistics`,`onCreateEditor`,`onUpdate`,`autoFocus`,`theme`,`height`,`minHeight`,`maxHeight`,`width`,`minWidth`,`maxWidth`,`basicSetup`,`placeholder`,`indentWithTab`,`editable`,`readOnly`,`root`,`initialState`],KY=(0,V.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=Lje(e,VMe),E=(0,V.useRef)(null),{state:D,view:O,container:k,setContainer:A}=BMe({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,V.useImperativeHandle)(t,()=>({editor:E.current,state:D,view:O}),[E,k,D,O]);var j=(0,V.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,H.jsx)(`div`,NJ({ref:j,className:(typeof d==`string`?`cm-theme-`+d:`cm-theme`)+(n?` `+n:``)},T))});KY.displayName=`CodeMirror`;function HMe(e){if(!e)return!1;let t=e.toLowerCase();return t.endsWith(`.md`)||t.endsWith(`.markdown`)||t.endsWith(`.mdown`)||t.endsWith(`.mkd`)}function UMe(e){if(!e)return`plain`;let t=e.toLowerCase();return HMe(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 qY(e,t){switch(e){case`markdown`:return[IB({base:CB,codeLanguages:pV}),uwe()];case`typescript`:return[Rn({typescript:!0,jsx:t?.endsWith(`.tsx`)})];case`javascript`:return[Rn({jsx:t?.endsWith(`.jsx`)})];case`json`:return[mEe()];case`yaml`:return[dV()];default:return[]}}function WMe(e){return e?B.matchFilename(pV,e):null}function GMe(e,t){switch(e){case`github`:return t?qV:EH;case`material`:return t?fAe:wAe;case`vscode`:return t?wje:Ije;case`tokyo`:return t?dje:tje;case`gruvbox`:return t?Rke:Qke;case`monokai`:return NAe;case`nord`:return WAe;default:return t?qV:EH}}function JY({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=Ub(),{data:m}=qy(),h=m?.codeEditor?.theme??`github`,[g,_]=(0,V.useState)([]);(0,V.useEffect)(()=>{let e=!1;if(i){_([]);return}let t=UMe(a);if(t!==`plain`){_(qY(t,a));return}let n=WMe(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,V.useMemo)(()=>i?qY(i,a):g,[i,a,g]),y=(0,V.useMemo)(()=>{let e=[Cn.readOnly.of(r),...v];return e.push(GMe(h,p)),e.push(Ut.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(dt.of([{key:`Mod-a`,run:kTe},{key:`Mod-s`,preventDefault:!0,run:()=>r||!n?!1:(n(),!0)}])),s&&e.push(Ut.lineWrapping),e},[v,r,s,h,p,n]);return(0,H.jsx)(KY,{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 KMe(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 qMe(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 JMe(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 YY(e){try{return e.matches(`:popover-open`)}catch{return!1}}function XY({open:e,items:t,anchor:n,wrapperElement:r,boundaryElement:i,position:a,onClose:o}){let s=(0,V.useRef)(null),c=(0,V.useMemo)(()=>a?{type:`point`,x:a.x,y:a.y}:null,[a]),l=n??c,u=r??i??null,d=(0,V.useMemo)(()=>KMe(l),[l]),[f,p]=(0,V.useState)(null),m=`context-menu-${(0,V.useId)().replace(/[^a-zA-Z0-9_-]/g,``)}`,h=(0,V.useMemo)(()=>t.filter(e=>e.label.length>0),[t]),g=e&&!!d&&h.length>0;(0,V.useLayoutEffect)(()=>{let e=s.current;e&&(g?YY(e)||e.showPopover?.():YY(e)&&e.hidePopover?.())},[g]),(0,V.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(qMe(JMe(l,d,r),r,n))},[l,d,u,e]),(0,V.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,V.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,V.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,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`style`,{children:y`
|
|
1265
1265
|
.context-menu-popover[data-context-menu-id='${m}'] {
|
|
1266
1266
|
position: absolute;
|
|
@@ -1638,12 +1638,12 @@ function handleMessage(payload) {
|
|
|
1638
1638
|
${_}px !important;
|
|
1639
1639
|
${v}px !important;
|
|
1640
1640
|
}
|
|
1641
|
-
`),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,H.jsx)(t1e,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:V.cloneElement(e,{ref:u})})}var r1e=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=r8(i1e),d=(0,V.useId)(),f=(0,V.useRef)(n),p=(0,V.useRef)(r);i8(()=>{f.current=n,p.current=r});let m=!0,h=(0,V.useMemo)(()=>(m=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,V.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),V.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,H.jsx)(n1e,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,H.jsx)(a8.Provider,{value:h,children:e})};function i1e(){return new Map}function a1e(e=!0){let t=(0,V.useContext)(a8);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,V.useId)();(0,V.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,V.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var H7=e=>e.key||``;function o1e(e){let t=[];return V.Children.forEach(e,e=>{(0,V.isValidElement)(e)&&t.push(e)}),t}var s1e=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=a1e(o),f=(0,V.useMemo)(()=>o1e(e),[e]),p=o&&!u?[]:f.map(H7),m=(0,V.useRef)(!0),h=(0,V.useRef)(f),g=r8(()=>new Map),_=(0,V.useRef)(new Set),[v,y]=(0,V.useState)(f),[b,x]=(0,V.useState)(f);i8(()=>{m.current=!1,h.current=f;for(let e=0;e<b.length;e++){let t=H7(b[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[b,p.length,p.join(`-`)]);let S=[];if(f!==v){let e=[...f];for(let t=0;t<b.length;t++){let n=b[t],r=H7(n);p.includes(r)||(e.splice(t,0,n),S.push(n))}return a===`wait`&&S.length&&(e=S),x(o1e(e)),y(f),null}let{forceRender:C}=(0,V.useContext)(n8);return(0,H.jsx)(H.Fragment,{children:b.map(e=>{let v=H7(e),y=o&&!u?!1:f===b||p.includes(v);return(0,H.jsx)(r1e,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(_.current.has(v))return;if(g.has(v))_.current.add(v),g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(C?.(),x(h.current),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},v)})})},c1e=(0,V.createContext)({strict:!1}),l1e={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},u1e=!1;function d1e(){if(u1e)return;let e={};for(let t in l1e)e[t]={isEnabled:e=>l1e[t].some(t=>!!e[t])};HZe(e),u1e=!0}function f1e(){return d1e(),UZe()}function p1e(e){let t=f1e();for(let n in e)t[n]={...t[n],...e[n]};HZe(t)}var m1e=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function U7(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||m1e.has(e)}var h1e=r({default:()=>g1e}),g1e,_1e=n((()=>{throw g1e={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),v1e=e=>!U7(e);function y1e(e){typeof e==`function`&&(v1e=t=>t.startsWith(`on`)?!U7(t):e(t))}try{y1e((_1e(),t(h1e)).default)}catch{}function b1e(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||z5(e[i])||(v1e(i)||n===!0&&U7(i)||!t&&!U7(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var W7=(0,V.createContext)({});function x1e(e,t){if(f7(e)){let{initial:t,animate:n}=e;return{initial:t===!1||l7(t)?t:void 0,animate:l7(n)?n:void 0}}return e.inherit===!1?{}:t}function S1e(e){let{initial:t,animate:n}=x1e(e,(0,V.useContext)(W7));return(0,V.useMemo)(()=>({initial:t,animate:n}),[C1e(t),C1e(n)])}function C1e(e){return Array.isArray(e)?e.join(` `):e}var G7=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function w1e(e,t,n){for(let r in t)!z5(t[r])&&!fQe(r,n)&&(e[r]=t[r])}function T1e({transformTemplate:e},t){return(0,V.useMemo)(()=>{let n=G7();return C7(n,t,e),Object.assign({},n.vars,n.style)},[t])}function E1e(e,t){let n=e.style||{},r={};return w1e(r,n,e),Object.assign(r,T1e(e,t)),r}function D1e(e,t){let n={},r=E1e(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var O1e=()=>({...G7(),attrs:{}});function k1e(e,t,n,r){let i=(0,V.useMemo)(()=>{let n=O1e();return yQe(n,t,xQe(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};w1e(t,e.style,e),i.style={...t,...i.style}}return i}var A1e=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function K7(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(A1e.indexOf(e)>-1||/[A-Z]/u.test(e))}function j1e(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??K7(e)?k1e:D1e)(t,r,i,e),c=b1e(t,typeof e==`string`,a),l=e===V.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,V.useMemo)(()=>z5(u)?u.get():u,[u]);return(0,V.createElement)(e,{...l,children:d})}function M1e({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:N1e(n,r,i,e),renderState:t()}}function N1e(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=F7(a[e]);let{initial:o,animate:s}=e,c=f7(e),l=IZe(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!c7(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=I5(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var P1e=e=>(t,n)=>{let r=(0,V.useContext)(W7),i=(0,V.useContext)(a8),a=()=>M1e(e,t,r,i);return n?a():r8(a)},F1e=P1e({scrapeMotionValuesFromProps:E7,createRenderState:G7}),I1e=P1e({scrapeMotionValuesFromProps:CQe,createRenderState:O1e}),L1e=Symbol.for(`motionComponentSymbol`);function R1e(e,t,n){let r=(0,V.useRef)(n);(0,V.useInsertionEffect)(()=>{r.current=n});let i=(0,V.useRef)(null);return(0,V.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n)},[t])}var z1e=(0,V.createContext)({});function q7(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function B1e(e,t,n,r,i,a){let{visualElement:o}=(0,V.useContext)(W7),s=(0,V.useContext)(c1e),c=(0,V.useContext)(a8),l=(0,V.useContext)(V7),u=l.reducedMotion,d=l.skipAnimations,f=(0,V.useRef)(null),p=(0,V.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,V.useContext)(z1e);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&V1e(f.current,n,i,h);let g=(0,V.useRef)(!1);(0,V.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[FXe],v=(0,V.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return i8(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,V.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function V1e(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:H1e(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&q7(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function H1e(e){if(e)return e.options.allowProjection===!1?H1e(e.parent):e.projection}function J7(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&p1e(r);let a=n?n===`svg`:K7(e),o=a?I1e:F1e;function s(n,s){let c,l={...(0,V.useContext)(V7),...n,layoutId:U1e(n)},{isStatic:u}=l,d=S1e(n),f=o(n,u);if(!u&&typeof window<`u`){W1e(l,r);let t=G1e(l);c=t.MeasureLayout,d.visualElement=B1e(e,f,l,i,t.ProjectionNode,a)}return(0,H.jsxs)(W7.Provider,{value:d,children:[c&&d.visualElement?(0,H.jsx)(c,{visualElement:d.visualElement,...l}):null,j1e(e,n,R1e(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,V.forwardRef)(s);return c[L1e]=e,c}function U1e({layoutId:e}){let t=(0,V.useContext)(n8).id;return t&&e!==void 0?t+`-`+e:e}function W1e(e,t){(0,V.useContext)(c1e).strict}function G1e(e){let{drag:t,layout:n}=f1e();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function K1e(e,t){if(typeof Proxy>`u`)return J7;let n=new Map,r=(n,r)=>J7(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,J7(a,void 0,e,t)),n.get(a))})}K1e();var q1e=(e,t)=>t.isSVG??K7(e)?new wQe(t):new mQe(t,{allowProjection:e!==V.Fragment}),J1e=class extends h7{constructor(e){super(e),e.animationState||=jQe(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();c7(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Y1e=0,X1e={animation:{Feature:J1e},exit:{Feature:class extends h7{constructor(){super(...arguments),this.id=Y1e++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=L5(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Y7(e){return{point:{x:e.pageX,y:e.pageY}}}var Z1e=e=>t=>Z5(t)&&e(t,Y7(t));function X7(e,t,n,r){return P7(e,t,Z1e(n),r)}var Q1e=({current:e})=>e?e.ownerDocument.defaultView:null,$1e=(e,t)=>Math.abs(e-t);function e0e(e,t){let n=$1e(e.x,t.x),r=$1e(e.y,t.y);return Math.sqrt(n**2+r**2)}var t0e=new Set([`auto`,`scroll`]),n0e=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Z7(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Q7(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=e0e(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=N8;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Z7(t,this.transformPagePoint),j8.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Q7(e.type===`pointercancel`?this.lastMoveEventInfo:Z7(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Z5(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Z7(Y7(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=N8;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Q7(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=h8(X7(this.contextWindow,`pointermove`,this.handlePointerMove,d),X7(this.contextWindow,`pointerup`,this.handlePointerUp,d),X7(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(t0e.has(e.overflowX)||t0e.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),j8.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),M8(this.updatePoint)}};function Z7(e,t){return t?{point:t(e.point)}:e}function r0e(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Q7({point:e},t){return{point:e,delta:r0e(e,a0e(t)),offset:r0e(e,i0e(t)),velocity:o0e(t,.1)}}function i0e(e){return e[0]}function a0e(e){return e[e.length-1]}function o0e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=a0e(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>v8(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>v8(t)*2&&(r=e[1]);let a=y8(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function s0e(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?r5(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?r5(n,e,r.max):Math.min(e,n)),e}function c0e(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function l0e(e,{top:t,left:n,bottom:r,right:i}){return{x:c0e(e.x,n,i),y:c0e(e.y,t,r)}}function u0e(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function d0e(e,t){return{x:u0e(e.x,t.x),y:u0e(e.y,t.y)}}function f0e(e,t){let n=.5,r=A7(e),i=A7(t);return i>r?n=g8(t.min,t.max-r,e.min):r>i&&(n=g8(e.min,e.max-i,t.min)),c8(0,1,n)}function p0e(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var $7=.35;function m0e(e=$7){return e===!1?e=0:e===!0&&(e=$7),{x:h0e(e,`left`,`right`),y:h0e(e,`top`,`bottom`)}}function h0e(e,t,n){return{min:g0e(e,t),max:g0e(e,n)}}function g0e(e,t){return typeof e==`number`?e:e[t]||0}var _0e=new WeakMap,v0e=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=s7(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(Y7(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=oZe(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),N7(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Y8.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=A7(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&j8.update(()=>i(e,t),!1,!0),B5(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=x0e(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&j8.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new n0e(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Q1e(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&j8.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!e9(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=s0e(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&q7(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=l0e(n.layoutBox,e):this.constraints=!1,this.elastic=m0e(t),r!==this.constraints&&!q7(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&N7(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=p0e(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!q7(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=aQe(n,r.root,this.visualElement.getTransformPagePoint()),a=d0e(r.layout.layoutBox,i);if(t){let e=t(qZe(a));this.hasMutatedConstraints=!!e,e&&(a=KZe(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=N7(o=>{if(!e9(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return B5(this.visualElement,e),n.start(F5(e,n,0,t,this.visualElement,!1))}stopAnimation(){N7(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){N7(t=>{let{drag:n}=this.getProps();if(!e9(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-r5(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!q7(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};N7(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=f0e({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),N7(t=>{if(!e9(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(r5(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;_0e.set(this.visualElement,this);let e=this.visualElement.current,t=X7(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&mZe(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();q7(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=b0e(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),j8.read(r);let o=P7(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(N7(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=$7,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function y0e(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function b0e(e,t,n){let r=kZe(e,y0e(n)),i=kZe(t,y0e(n));return()=>{r(),i()}}function e9(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function x0e(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var S0e=class extends h7{constructor(e){super(e),this.removeGroupControls=m8,this.removeListeners=m8,this.controls=new v0e(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||m8}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},t9=e=>(t,n)=>{e&&j8.update(()=>e(t,n),!1,!0)},C0e=class extends h7{constructor(){super(...arguments),this.removePointerDownListener=m8}onPointerDown(e){this.session=new n0e(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Q1e(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:t9(e),onStart:t9(t),onMove:t9(n),onEnd:(e,t)=>{delete this.session,r&&j8.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=X7(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},n9=!1,w0e=class extends V.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),n9&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),I7.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),n9=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||j8.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Y5.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;n9=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function T0e(e){let[t,n]=a1e(),r=(0,V.useContext)(n8);return(0,H.jsx)(w0e,{...e,layoutGroup:r,switchLayoutGroup:(0,V.useContext)(z1e),isPresent:t,safeToRemove:n})}var E0e={pan:{Feature:C0e},drag:{Feature:S0e,ProjectionNode:Z$e,MeasureLayout:T0e}};function D0e(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&j8.postRender(()=>i(t,Y7(t)))}var O0e=class extends h7{mount(){let{current:e}=this.node;e&&(this.unmount=lZe(e,(e,t)=>(D0e(this.node,t,`Start`),e=>D0e(this.node,e,`End`))))}unmount(){}},k0e=class extends h7{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=h8(P7(this.node.current,`focus`,()=>this.onFocus()),P7(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function A0e(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&j8.postRender(()=>i(t,Y7(t)))}var j0e=class extends h7{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=yZe(e,(e,t)=>(A0e(this.node,t,`Start`),(e,{success:t})=>A0e(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},r9=new WeakMap,i9=new WeakMap,M0e=e=>{let t=r9.get(e.target);t&&t(e)},N0e=e=>{e.forEach(M0e)};function P0e({root:e,...t}){let n=e||document;i9.has(n)||i9.set(n,{});let r=i9.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(N0e,{root:e,...t})),r[i]}function F0e(e,t,n){let r=P0e(t);return r9.set(e,n),r.observe(e),()=>{r9.delete(e),r.unobserve(e)}}var I0e={some:0,all:1},L0e=class extends h7{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:I0e[r]};this.stopObserver=F0e(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(R0e(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function R0e({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var z0e={inView:{Feature:L0e},tap:{Feature:j0e},focus:{Feature:k0e},hover:{Feature:O0e}},B0e={layout:{ProjectionNode:Z$e,MeasureLayout:T0e}},a9=K1e({...X1e,...z0e,...E0e,...B0e},q1e),V0e=[.5,2,6];function o9(e){return Number(e.toFixed(4)).toString()}function H0e(e,t,n){let r=n===`bottom`?`to bottom`:`to top`,i=100/t;if(e===t-1)return`linear-gradient(${r}, transparent ${o9(100-i)}%, black 100%)`;let a=e*i,o=(e+1)*i,s=(e+2)*i,c=(e+3)*i;return`linear-gradient(${r}, transparent ${o9(a)}%, black ${o9(o)}%, black ${o9(s)}%, transparent ${o9(c)}%)`}function U0e({position:e,blurLevels:t=V0e,surfaceClassName:n,className:r,...i}){return(0,H.jsxs)(`div`,{...i,"aria-hidden":`true`,"data-progressive-blur":e,"data-progressive-blur-levels":t.length,className:tE(`progressive-blur grid`,r),children:[t.map((n,r)=>{let i=H0e(r,t.length,e);return(0,H.jsx)(`div`,{"data-progressive-blur-layer":r,className:`progressive-blur__layer`,style:{zIndex:r+1,backdropFilter:`blur(${n}px)`,WebkitBackdropFilter:`blur(${n}px)`,maskImage:i,WebkitMaskImage:i}},`${n}:${r}`)}),(0,H.jsx)(`div`,{"data-progressive-blur-surface":``,className:tE(`progressive-blur__surface`,n),style:{zIndex:t.length+1}})]})}var W0e=[.5,2,6];function G0e({laneId:e,density:t,header:n,children:r,className:i,...a}){return(0,H.jsxs)(`section`,{...a,"data-kanban-lane":e,"data-kanban-lane-density":t,className:tE(`kanban-lane-viewport border-border/70 grid min-h-0 min-w-0 overflow-hidden border-t`,i),children:[(0,H.jsx)(`div`,{"data-kanban-lane-scroll":e,className:`kanban-lane-viewport__scroll scrollbar-thin scrollbar-track-transparent scrollbar-thumb-[color-mix(in_srgb,currentColor,transparent_78%)] min-h-0 overflow-y-auto overflow-x-hidden overscroll-contain pr-1`,children:r}),(0,H.jsx)(U0e,{position:`top`,blurLevels:W0e,"data-kanban-lane-veil":`top`,className:`kanban-lane-viewport__veil kanban-lane-viewport__veil--top`,surfaceClassName:`kanban-lane-viewport__veil-surface kanban-lane-viewport__veil-surface--top`}),(0,H.jsx)(`header`,{"data-kanban-lane-header":e,className:`kanban-lane-viewport__header`,children:n}),(0,H.jsx)(U0e,{position:`bottom`,blurLevels:W0e,"data-kanban-lane-veil":`bottom`,className:`kanban-lane-viewport__veil kanban-lane-viewport__veil--bottom`,surfaceClassName:`kanban-lane-viewport__veil-surface kanban-lane-viewport__veil-surface--bottom`})]})}var K0e=[{id:`no-tasks`,label:`No tracked tasks`,shortLabel:`No tasks`,accentClass:`bg-muted-foreground/55`},{id:`in-progress`,label:`Tasks remaining`,shortLabel:`Remaining`,accentClass:`bg-primary`},{id:`complete`,label:`Tasks complete`,shortLabel:`Complete`,accentClass:`bg-emerald-500`},{id:`archived`,label:`Archived`,shortLabel:`Archived`,accentClass:`bg-accent`}];function s9(e){let t={"no-tasks":[],"in-progress":[],complete:[]};for(let n of e)t[n.trackedTaskProgress.phase].push(n);return t}function q0e(e){let t=s9(e);return{"no-tasks":t[`no-tasks`].length,"in-progress":t[`in-progress`].length,complete:t.complete.length}}function J0e(e,t,n=Date.now()){return e.filter(e=>yee(e,t,n)).sort((e,t)=>Pp(t)-Pp(e)||e.id.localeCompare(t.id))}function Y0e(e){return e.archivedAt??Pp(e)}var c9=`application/x-openspecui-change-id`,X0e=[{value:`7d`,label:`Last 7 days`},{value:`30d`,label:`Last 30 days`},{value:`90d`,label:`Last 90 days`},{value:`all`,label:`All time`}];function Z0e({activeItems:e,archivedItems:t,statuses:n,range:r,onRangeChange:i,activeState:a,archiveState:o,rootReady:s,rootBlockedReason:c,applyStatusCurrent:l,applyStatusError:u,onApply:d,onArchive:f}){let[p,m]=(0,V.useState)(!1),h=(0,V.useMemo)(()=>s9(e),[e]),g=(0,V.useMemo)(()=>new Map(e.map(e=>[e.id,e])),[e]),_=(0,V.useMemo)(()=>new Map(n.map(e=>[e.changeName,e])),[n]),v=s&&a.current,y=v&&o.current,b=e=>{if(e.preventDefault(),m(!1),!y)return;let t=e.dataTransfer.getData(c9);if(!t)return;let n=g.get(t);n&&f(n)};return(0,H.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-3 overflow-hidden`,children:[(0,H.jsx)(`div`,{className:`shrink-0`,children:(0,H.jsx)(e2e,{activeError:a.error,archiveError:o.error,applyStatusError:u,rowErrors:a.rowErrors,progress:a.progress})}),(0,H.jsx)(`div`,{"data-kanban-grid":!0,className:`scrollbar-thin scrollbar-track-transparent scrollbar-thumb-[color-mix(in_srgb,currentColor,transparent_78%)] grid min-h-0 min-w-0 flex-1 auto-cols-[minmax(16rem,1fr)] grid-flow-col gap-3 overflow-x-auto overflow-y-hidden overscroll-x-contain pb-2`,children:K0e.map(e=>{let n=e.id===`archived`,s=e.id===`archived`?[]:h[e.id],u=n?t:[],g=n?u.length:s.length,x=n?o.initialLoading:a.initialLoading,S=n?o.updating:a.updating;return(0,H.jsx)(G0e,{laneId:e.id,density:`full`,"data-lane":e.id,onDragOver:n?e=>{!y||!e.dataTransfer.types.includes(c9)||(e.preventDefault(),e.dataTransfer.dropEffect=`move`,m(!0))}:void 0,onDragLeave:n?e=>{e.currentTarget.contains(e.relatedTarget)||m(!1)}:void 0,onDrop:n?b:void 0,className:tE(`transition-colors`,n&&p&&`border-primary bg-primary/5`),header:(0,H.jsxs)(`div`,{className:`flex h-full min-w-0 items-center justify-between gap-2 px-1`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`span`,{className:tE(`h-2 w-2 shrink-0 rounded-full`,e.accentClass)}),(0,H.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:e.label}),(0,H.jsx)(iE,{count:g,tone:`muted`,size:`xs`,shape:`pill`})]}),n?(0,H.jsx)(e8,{value:r,options:X0e,onValueChange:i,ariaLabel:`Archived time range`,className:`pointer-events-auto h-7 min-w-0 gap-1 px-2 text-xs`}):null]}),children:(0,H.jsx)(iL,{active:S&&g>0,children:(0,H.jsxs)(a9.div,{layout:!0,className:`min-h-24 space-y-2`,children:[x&&g===0?(0,H.jsx)(lL,{count:2}):null,(0,H.jsxs)(s1e,{initial:!1,mode:`popLayout`,children:[u.map(e=>(0,H.jsx)(a9.div,{layout:!0,layoutId:`live-kanban:${e.id}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,scale:.98},children:(0,H.jsx)($0e,{item:e})},`archived:${e.id}`)),s.map(e=>(0,H.jsx)(a9.div,{layout:!0,layoutId:`live-kanban:${e.id}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,scale:.98},children:(0,H.jsx)(Q0e,{item:e,status:_.get(e.id),canApply:v&&l,canArchive:v,canDragArchive:y,applyBlockedReason:c??(l?null:`Apply availability is not current.`),archiveBlockedReason:c,onApply:d,onArchive:f})},`active:${e.id}`))]}),!x&&g===0?(0,H.jsx)(`div`,{className:`border-border/60 text-muted-foreground flex h-20 items-center justify-center rounded-md border border-dashed`,children:e.id===`no-tasks`?(0,H.jsx)(_c,{className:`h-4 w-4`,"aria-label":`No entries`}):(0,H.jsx)(Lc,{className:`h-4 w-4`,"aria-label":`No entries`})}):null]})})},e.id)})})]})}function Q0e({item:e,status:t,canApply:n,canArchive:r,canDragArchive:i,applyBlockedReason:a,archiveBlockedReason:o,onApply:s,onArchive:c}){let l=t8(t),u=e.trackedTaskProgress,d=u.total>0?Math.round(u.completed/u.total*100):0,f={family:`changes`,entityId:e.id},p=!n||!l.available;return(0,H.jsxs)(`article`,{draggable:i,onDragStart:i?t=>{t.dataTransfer.setData(c9,e.id),t.dataTransfer.effectAllowed=`move`}:void 0,className:tE(`border-border/70 bg-card min-w-0 rounded-md border p-2.5`,i&&`cursor-grab active:cursor-grabbing`),children:[(0,H.jsxs)(Nb,{to:`/changes/$changeId`,params:{changeId:e.id},state:t=>({...t,__vtHandoff:{...f,title:e.name,subtitle:e.id}}),vt:{sharedElements:f},...rb(f,`container`),draggable:!1,className:`block min-w-0`,children:[(0,H.jsx)(`div`,{...rb(f,`title`),className:`truncate text-sm font-medium`,children:e.name}),(0,H.jsx)(`div`,{className:`text-muted-foreground truncate text-xs`,children:e.updatedAt>0?mL(e.updatedAt):e.id}),(0,H.jsx)(`div`,{className:`bg-muted mt-2 h-1.5 rounded-full`,children:(0,H.jsx)(a9.div,{className:`bg-primary h-full rounded-full`,initial:!1,animate:{width:`${d}%`}})})]}),(0,H.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-2`,children:[(0,H.jsxs)(`span`,{className:`text-muted-foreground font-mono text-[11px]`,children:[u.completed,`/`,u.total]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`button`,{type:`button`,disabled:p,onClick:()=>s(e),"aria-label":`Apply ${e.name}`,title:a??(l.missingArtifactIds.length>0?`Missing: ${l.missingArtifactIds.join(`, `)}`:`Apply`),className:`hover:bg-muted inline-flex h-7 w-7 items-center justify-center rounded-md disabled:cursor-not-allowed disabled:opacity-40`,children:(0,H.jsx)(Qc,{className:`h-3.5 w-3.5`})}),(0,H.jsx)(`button`,{type:`button`,disabled:!r,onClick:()=>c(e),"aria-label":`Archive ${e.name}`,title:o??`Archive`,className:`hover:bg-muted inline-flex h-7 w-7 items-center justify-center rounded-md disabled:cursor-not-allowed disabled:opacity-40`,children:(0,H.jsx)(Ws,{className:`h-3.5 w-3.5`})})]})]})]})}function $0e({item:e}){let t={family:`archive`,entityId:e.id};return(0,H.jsx)(Nb,{to:`/archive/$changeId`,params:{changeId:e.id},state:n=>({...n,__vtHandoff:{...t,title:e.name,subtitle:e.id}}),vt:{sharedElements:t},...rb(t,`container`),className:`border-border/70 bg-card hover:bg-muted/50 block min-w-0 rounded-md border p-2.5`,children:(0,H.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,H.jsx)(Ws,{className:`text-muted-foreground mt-0.5 h-4 w-4 shrink-0`}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{...rb(t,`title`),className:`truncate text-sm font-medium`,children:e.name}),(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:hL(Y0e(e))})]})]})})}function e2e({activeError:e,archiveError:t,applyStatusError:n,rowErrors:r,progress:i}){let a=[e?`Changes: ${e.message}`:null,t?`Archives: ${t.message}`:null,n?`Apply status: ${n.message}`:null,...r.map(e=>`${e.changeId}: ${e.message}`)].filter(e=>e!==null);return(0,H.jsxs)(H.Fragment,{children:[i?(0,H.jsxs)(`div`,{className:`text-muted-foreground font-mono text-xs`,"aria-live":`polite`,children:[i.completed,`/`,i.total]}):null,a.length>0?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-2 text-xs`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(`div`,{className:`min-w-0 space-y-1`,children:a.map(e=>(0,H.jsx)(`div`,{className:`break-words`,children:e},e))})]}):null]})}function t2e({activeItems:e,archivedItems:t,activeCounts:n,archivedCount:r,variant:i=`full`,pending:a=!1,className:o}){let s=s9(e),c=i===`compact`;return(0,H.jsx)(`div`,{"data-testid":`readonly-kanban`,"aria-busy":a,className:tE(`@container min-w-0 max-w-full overflow-x-clip`,c&&`@[32rem]:h-[32rem] @[64rem]:h-72 h-[46rem]`,o),children:(0,H.jsx)(`div`,{"data-testid":`readonly-kanban-grid`,className:tE(`@[32rem]:grid-cols-2 @[64rem]:grid-cols-4 grid w-full min-w-0 max-w-full grid-cols-1 gap-3 overflow-x-clip`,c&&`@[32rem]:grid-rows-2 @[64rem]:grid-rows-1 h-full min-h-0 grid-rows-4`),children:K0e.map(e=>{let i=e.id===`archived`?t:s[e.id],o=e.id===`archived`?r:n[e.id];return(0,H.jsx)(G0e,{laneId:e.id,density:c?`compact`:`full`,header:(0,H.jsxs)(`div`,{className:`flex h-full min-w-0 items-center justify-between gap-2 px-1`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`span`,{className:tE(`h-2 w-2 shrink-0 rounded-full`,e.accentClass)}),(0,H.jsx)(`h3`,{className:`truncate text-xs font-semibold`,children:c?e.shortLabel:e.label})]}),a?(0,H.jsx)(aL,{className:`h-5 w-8 rounded-full`}):(0,H.jsx)(iE,{count:o,tone:`muted`,size:`xs`,shape:`pill`})]}),children:a?(0,H.jsx)(`div`,{className:`space-y-2`,"aria-hidden":`true`,children:Array.from({length:3},(e,t)=>(0,H.jsxs)(`div`,{className:`border-border/70 bg-card space-y-2 rounded-md border px-2.5 py-2`,children:[(0,H.jsx)(aL,{className:`h-3 w-3/4`}),(0,H.jsx)(aL,{className:`h-2.5 w-1/2`})]},t))}):(0,H.jsxs)(a9.div,{layout:!0,className:`space-y-2`,"data-lane":e.id,children:[(0,H.jsx)(s1e,{initial:!1,mode:`popLayout`,children:i.map(t=>(0,H.jsx)(a9.div,{layout:!0,layoutId:`readonly-kanban:${t.id}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,scale:.98},transition:{duration:.16},children:(0,H.jsx)(n2e,{item:t,laneId:e.id,compact:c})},`${e.id}:${t.id}`))}),i.length===0&&o===0?(0,H.jsx)(`div`,{className:`border-border/60 text-muted-foreground flex h-16 items-center justify-center rounded-md border border-dashed`,children:e.id===`no-tasks`?(0,H.jsx)(_c,{className:`h-4 w-4`,"aria-label":`No entries`}):(0,H.jsx)(Lc,{className:`h-4 w-4`,"aria-label":`No entries`})}):null]})},e.id)})})})}function n2e({item:e,laneId:t,compact:n}){let r=t===`archived`,i={family:r?`archive`:`changes`,entityId:e.id},a=e.cliTaskSummary??null,o=a?{completed:a.completedTasks,total:a.totalTasks}:{completed:e.trackedTaskProgress.completed,total:e.trackedTaskProgress.total},s=o.total>0?Math.round(o.completed/o.total*100):0;return(0,H.jsxs)(Nb,{to:r?`/archive/$changeId`:`/changes/$changeId`,params:{changeId:e.id},state:t=>({...t,__vtHandoff:{...i,title:e.name,subtitle:e.id}}),vt:{sharedElements:i},...rb(i,`container`),className:`border-border/70 bg-card hover:bg-muted/50 block min-w-0 rounded-md border px-2.5 py-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[r?(0,H.jsx)(Ws,{className:`text-muted-foreground mt-0.5 h-3.5 w-3.5 shrink-0`}):null,(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`div`,{...rb(i,`title`),className:`truncate text-xs font-medium`,children:e.name}),(0,H.jsx)(`div`,{className:`text-muted-foreground truncate text-[11px]`,children:r?hL(Y0e(e)):e.updatedAt>0?mL(e.updatedAt):e.id})]}),r?null:(0,H.jsxs)(`span`,{className:`text-muted-foreground shrink-0 font-mono text-[10px]`,children:[o.completed,`/`,o.total]})]}),!r&&!n?(0,H.jsx)(`div`,{className:`bg-muted mt-2 h-1 rounded-full`,children:(0,H.jsx)(a9.div,{className:`bg-primary h-full rounded-full`,initial:!1,animate:{width:`${s}%`}})}):null]})}var r2e=`action`,i2e=`change`,a2e=`artifact`;function o2e(e){let t=new URLSearchParams;return t.set(r2e,e.action),t.set(i2e,e.changeId),e.artifactId&&t.set(a2e,e.artifactId),`/opsx-compose?${t.toString()}`}var s2e={state:`loading`,data:null,attempt:null,error:null,observedAt:0};function c2e(e){return!e||e.state===`loading`?null:e.state===`error`?e.data??e.attempt:e.data}function l2e(e){let t=Error(e.message);return t.name=e.name,t}function u2e(e,t){g_(e).with({state:`loading`},()=>{t.onConnectionStateChange({state:`pending`,error:null})}).with({state:`ready`},({data:e})=>t.onData(e)).with({state:`revalidating`},({data:e})=>t.onStaleData(e)).with({state:`error`},({error:e})=>t.onError(l2e(e))).with({state:`refresh-error`},({data:e,error:n})=>t.onStaleData(e,l2e(n))).exhaustive()}function d2e(e){let t=!1,n=0,r=!1,i=async()=>{let r=++n;try{let i=await Cy.rootContext.readProjection.query();if(t||r!==n)return;let a=pf.safeParse(i);if(!a.success){e.onError(Error(`Malformed Root Context projection: ${a.error.message}`));return}u2e(a.data,e)}catch(i){if(t||r!==n)return;e.onError(i instanceof Error?i:Error(String(i)))}},a=Cy.rootContext.subscribeProjection.subscribe(void 0,{onData(t){let n=tf.safeParse(t);if(!n.success){e.onError(Error(`Malformed Root Context notice: ${n.error.message}`));return}r=!0,e.onConnectionStateChange({state:`pending`,error:null}),i()},onError:e.onError,onConnectionStateChange:t=>e.onConnectionStateChange({state:t.state,error:t.error}),onStopped:e.onStopped,onComplete:e.onComplete});return r||i(),{unsubscribe(){t=!0,n+=1,a.unsubscribe()}}}function l9(){return Ly(d2e,async()=>s2e,[],`root-context.projection`)}function f2e(e,t,n){if(n){e.add(`${t} exit: ${n.exitCode??`unavailable`}`),n.contractError&&e.add(`${t} contract: ${n.contractError}`),n.stderr.trim()&&e.add(`${t} stderr: ${n.stderr.trim()}`);for(let r of n.diagnostics)e.add(`${t} ${r.code}: ${r.message}`)}}function p2e(e){let t=new Set,n=e.attempt;n.planningRoot&&t.add(`Attempted root: ${n.planningRoot.path} (${n.planningRoot.source}${n.storeId?`, Store ${n.storeId}`:``})`);for(let[e,r]of Object.entries(n.diagnostics))for(let n of r)t.add(`${e} ${n.code}: ${n.message}`);return f2e(t,`Doctor`,n.evidence.doctor),f2e(t,`Context`,n.evidence.context),[...t]}function m2e(e){if(e.staticMode)return{status:`ready`,disabled:!1,context:null,observedAt:0,title:null,message:null,evidence:[]};if(e.transportError)return{status:`blocked`,disabled:!0,context:null,observedAt:0,title:`Root Context transport failed`,message:e.transportError.message,evidence:[]};let t=e.projection;return!t||t.state===`loading`||e.isLoading||e.authorityState!==`current`?{status:`checking`,disabled:!0,context:null,observedAt:t?.observedAt??0,title:`Resolving planning root`,message:`Root-dependent actions remain locked until OpenSpec resolves the planning root.`,evidence:[]}:t.state===`refreshing`?{status:`checking`,disabled:!0,context:t.data,observedAt:t.observedAt,title:`Refreshing planning root`,message:`Root-dependent actions remain locked while OpenSpec refreshes root selection.`,evidence:[]}:t.state===`error`?{status:`blocked`,disabled:!0,context:t.data,observedAt:t.observedAt,title:`Planning root unavailable (${t.error.code})`,message:t.error.message,evidence:p2e(t)}:{status:`ready`,disabled:!1,context:t.data,observedAt:t.observedAt,title:null,message:null,evidence:[]}}function u9(){let e=l9();return m2e({projection:e.data,isLoading:e.isLoading,transportError:e.error,staticMode:Lf(),authorityState:e.authority.state})}function h2e({applyCurrent:e=!0,archiveCurrent:t=!0}={}){let n=u9(),r=(0,V.useRef)({rootAction:n,applyCurrent:e,archiveCurrent:t});r.current={rootAction:n,applyCurrent:e,archiveCurrent:t};let{openArchiveModal:i}=QSe(),a=(0,V.useCallback)(e=>{let t=r.current;return t.rootAction.status!==`ready`||!t.applyCurrent?!1:(Ib.activatePop(o2e({action:`apply`,changeId:e.changeId})),!0)},[]),o=(0,V.useCallback)(e=>{let t=r.current;return t.rootAction.status!==`ready`||!t.archiveCurrent?!1:(i(e.changeId,e.changeName),!0)},[i]);return{rootAction:n,disabled:n.disabled,launchApply:a,launchArchive:o}}var g2e=[{value:`7d`,label:`Last 7 days`},{value:`30d`,label:`Last 30 days`},{value:`90d`,label:`Last 90 days`},{value:`all`,label:`All time`}];function _2e(){let e=Lf(),t=joe(),n=Ky(),r=Zy(!e),[i,a]=(0,V.useState)(`30d`),o=t.data??[],s=(0,V.useMemo)(()=>J0e(n.data??[],i),[n.data,i]),c=t.data!==void 0&&!t.isLoading&&!t.isUpdating&&t.error===null,l=n.data!==void 0&&!n.isLoading&&!n.isUpdating&&n.error===null,u=r.data!==void 0&&r.authority.state===`current`,{rootAction:d,launchApply:f,launchArchive:p}=h2e({applyCurrent:c&&u,archiveCurrent:c}),m=(0,H.jsxs)(`div`,{className:`flex min-w-0 shrink-0 flex-wrap items-center justify-between gap-3`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(ml,{className:`h-6 w-6 shrink-0`}),`Kanban`]}),e?(0,H.jsx)(e8,{value:i,options:g2e,onValueChange:a,ariaLabel:`Archived time range`,className:`h-8`}):null]});if(e){let e=t.error??n.error,r=t.isLoading&&t.data===void 0||n.isLoading&&n.data===void 0;return(0,H.jsxs)(`div`,{className:`min-w-0 space-y-4 p-4`,children:[m,e?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{children:e.message})]}):null,r?(0,H.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,"aria-busy":`true`,children:Array.from({length:4},(e,t)=>(0,H.jsx)(lL,{count:2},t))}):(0,H.jsx)(t2e,{activeItems:o,archivedItems:s,activeCounts:q0e(o),archivedCount:s.length})]})}return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col gap-4 overflow-hidden p-4`,children:[m,(0,H.jsx)(Z0e,{activeItems:o,archivedItems:s,statuses:r.data??[],range:i,onRangeChange:a,activeState:{initialLoading:t.isLoading&&t.data===void 0,updating:t.isUpdating,current:c,error:t.error,rowErrors:t.rowErrors,progress:t.progress},archiveState:{initialLoading:n.isLoading&&n.data===void 0,updating:n.isUpdating,current:l,error:n.error},rootReady:d.status===`ready`,rootBlockedReason:d.message,applyStatusCurrent:u,applyStatusError:r.error,onApply:e=>f({changeId:e.id,changeName:e.name}),onArchive:e=>p({changeId:e.id,changeName:e.name})})]})}function v2e({ratio:e}){if(!Number.isFinite(e)||e<=0)return null;let t=Math.min(100,Math.max(0,e*100));return(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`bg-primary/50 pointer-events-none absolute inset-y-0 left-0 rounded-[inherit]`,style:{width:`${t}%`}})}function y2e({changeId:e,name:t,subtitle:n,phase:r,updatedAt:i,formatTime:a,sharedFamily:o=`changes`,className:s=``,progressRatio:c=null,containerProps:l,titleProps:u,iconProps:d}){let f={family:o,entityId:e};return(0,H.jsxs)(`div`,{...l,...rb(f,`container`),className:`grid grid-cols-[auto_minmax(0,1fr)_auto] items-stretch gap-x-3 ${s}`,children:[(0,H.jsx)(`div`,{className:`flex items-center`,children:(0,H.jsx)(Dc,{...d,...rb(f,`icon`),className:`text-muted-foreground h-5 w-5 shrink-0`})}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col justify-center gap-0.5 py-0.5`,children:[(0,H.jsx)(`div`,{...u,...rb(f,`title`),className:`truncate font-medium`,children:t}),(0,H.jsx)(`div`,{className:`text-muted-foreground truncate text-xs`,children:n})]}),(0,H.jsxs)(`div`,{className:`flex flex-col items-end justify-between gap-1 text-right`,children:[(0,H.jsx)(`div`,{className:`flex flex-1 items-center`,children:(0,H.jsxs)(rE,{tone:`custom`,size:`sm`,shape:`box`,className:`relative overflow-hidden border ${r.toneClass}`,children:[(0,H.jsx)(v2e,{ratio:c??NaN}),(0,H.jsx)(`span`,{className:`relative`,children:r.label})]})}),i>0?(0,H.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:a(i)}):null]})]})}function b2e(){return(0,H.jsx)(ec,{className:`text-muted-foreground h-4 w-4 shrink-0`,"aria-hidden":!0})}function x2e(e){if(!e.hasStatus)return{label:`Unknown`,toneClass:`border-border text-muted-foreground`};if(e.isPlanningComplete&&e.trackedTaskPhase===`complete`)return{label:`Workflow Complete`,toneClass:`border-emerald-500/40 text-emerald-700 dark:text-emerald-300`};if(e.trackedArtifactStatus===`blocked`)return{label:`Draft`,toneClass:`border-amber-500/40 text-amber-700 dark:text-amber-300`};if(e.trackedTaskPhase===`no-tasks`)return{label:`No Tracked Tasks`,toneClass:`border-border text-muted-foreground`};let t=e.cliCompletedTasks??null;return t!==null&&t>0?{label:`Applying`,toneClass:`border-primary/40 text-primary`}:e.isPlanningComplete?{label:`Planning Complete`,toneClass:`border-sky-500/40 text-sky-700 dark:text-sky-300`}:{label:`In Execution`,toneClass:`border-primary/40 text-primary`}}function d9(e){return e.includes(`blocked`)?`blocked`:e.includes(`ready`)?`ready`:e.includes(`done`)?`done`:e.includes(`skipped`)?`skipped`:null}function S2e(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id)}function C2e(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function w2e(e,t){return!!(t&&!C2e()&&typeof e.startViewTransition==`function`&&!e.activeViewTransition)}function T2e(e){if(typeof document>`u`){e.update();return}let t=e.container,n=document;if(!w2e(n,t)){e.update();return}t.style.viewTransitionName=e.transitionName;try{n.startViewTransition(()=>(0,es.flushSync)(e.update)).finished.catch(()=>{}).finally(()=>{t.style.viewTransitionName===e.transitionName&&(t.style.viewTransitionName=``)})}catch{t.style.viewTransitionName=``,e.update()}}function E2e(e,t){let[n,r]=(0,V.useState)(e),i=(0,V.useRef)(!1),a=(0,V.useRef)(e),o=(0,V.useRef)(0),s=`vt-change-list-${(0,V.useId)().replace(/[^a-zA-Z0-9_-]/g,``)}`;return(0,V.useEffect)(()=>{if(!i.current){i.current=!0,a.current=e,r(e);return}let n=a.current;a.current=e;let c=o.current+1;if(o.current=c,e===void 0||n===void 0||S2e(n,e)){r(e);return}queueMicrotask(()=>{o.current===c&&T2e({container:t.current,transitionName:s,update:()=>{o.current===c&&r(e)}})})},[t,e,s]),n}function D2e(e){return new Map((e??[]).map(e=>[e.changeName,e]))}function O2e(){let{data:e,isLoading:t,isUpdating:n,error:r,rowErrors:i=[],progress:a=null}=joe(),o=(0,V.useRef)(null),{data:s,isLoading:c,error:l}=Zy((e?.length??0)>0),u=E2e(e,o),d=D2e(s),f=e?.length===0&&!r&&!n,p=(e?.length??0)>0||f;return t&&!e&&!r?(0,H.jsxs)(`div`,{className:`space-y-6 p-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(Dc,{className:`h-6 w-6 shrink-0`}),`Changes`]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>Ib.activatePop(`/opsx-new`),className:`bg-primary text-primary-foreground inline-flex items-center gap-2 rounded-md px-4 py-2 text-sm font-medium hover:opacity-90`,title:`Create a new OPSX change`,children:[(0,H.jsx)($c,{className:`h-4 w-4`}),`New`]})]}),a&&!r?(0,H.jsx)(USe,{progress:a,className:`max-w-sm`}):null,(0,H.jsx)(lL,{count:5})]}):(0,H.jsxs)(`div`,{className:`space-y-6 p-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(Dc,{className:`h-6 w-6 shrink-0`}),`Changes`]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>Ib.activatePop(`/opsx-new`),className:`bg-primary text-primary-foreground inline-flex items-center gap-2 rounded-md px-4 py-2 text-sm font-medium hover:opacity-90`,title:`Create a new OPSX change`,children:[(0,H.jsx)($c,{className:`h-4 w-4`}),`New`]})]}),(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Active OPSX changes in the current writable Planning root. Completed changes are moved to`,` `,(0,H.jsx)(Nb,{to:`/archive`,className:`text-primary hover:underline`,children:`Archive`}),`.`]}),r?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-center gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,H.jsx)(tc,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`break-words`,children:r.message})]}):null,i.length>0?(0,H.jsx)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive rounded-md border px-3 py-2 text-sm`,children:i.map(e=>(0,H.jsxs)(`div`,{className:`break-words`,children:[e.changeId,`: `,e.message]},e.changeId))}):null,a&&!r?(0,H.jsxs)(`div`,{className:`text-muted-foreground text-sm`,"data-change-progress":!0,children:[`Loaded `,a.completed,`/`,a.total===`unknown`?`unknown`:a.total,` `,`changes`]}):null,l?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-center gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,H.jsx)(tc,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`break-words`,children:l.message})]}):null,p?(0,H.jsx)(iL,{active:n&&!!e,children:(0,H.jsxs)(`div`,{ref:o,"data-change-list-continuity":!0,className:`border-border divide-border divide-y rounded-lg border`,children:[u?.map(e=>{let t=d.get(e.id),n=t?.artifacts.filter(e=>e.status===`done`).length??0,r=t?.artifacts.length??0,i=x2e({hasStatus:!!t,isPlanningComplete:t?.isPlanningComplete??!1,trackedTaskPhase:e.trackedTaskProgress.phase,trackedArtifactStatus:d9(t?.artifacts.map(e=>e.status)??[]),cliCompletedTasks:e.cliTaskSummary?.completedTasks??null}),a={family:`changes`,entityId:e.id};return(0,H.jsx)(Nb,{to:`/changes/$changeId`,params:{changeId:e.id},state:t=>({...t,__vtHandoff:{family:`changes`,entityId:e.id,title:e.name,subtitle:e.id}}),vt:{sharedElements:a},...rb(a,`container`),className:`hover:bg-muted/50 block px-4 py-3`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(y2e,{changeId:e.id,name:e.name,phase:i,updatedAt:e.updatedAt,formatTime:mL,progressRatio:e.cliTaskSummary&&e.cliTaskSummary.totalTasks>0?e.cliTaskSummary.completedTasks/e.cliTaskSummary.totalTasks:null,className:`min-w-0 flex-1`,titleProps:{...e.id===e.name?null:{}},subtitle:!l&&t?(0,H.jsxs)(`span`,{title:`Task counts reported by the OpenSpec CLI for this Change.`,children:[n,`/`,r,` artifacts · `,t.schemaName,e.cliTaskSummary?` · Tasks ${e.cliTaskSummary.completedTasks}/${e.cliTaskSummary.totalTasks}`:``]}):!l&&s===void 0&&c?(0,H.jsx)(oL,{className:`w-28`}):`Workflow status unavailable`}),(0,H.jsx)(b2e,{})]})},e.id)}),f&&(0,H.jsxs)(`div`,{className:`text-muted-foreground p-4 text-center`,children:[(0,H.jsx)(`div`,{children:`No active changes.`}),(0,H.jsx)(`div`,{className:`mt-1 text-xs`,children:`Recommended workflow start: Quick Propose`}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>Ib.activatePop(`/opsx-propose`),className:`text-primary m-2 inline-flex items-center gap-1 hover:underline`,title:`Open Quick Propose`,children:[(0,H.jsx)(pl,{className:`h-3.5 w-3.5`}),`Start Propose`]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>Ib.activatePop(`/opsx-new`),className:`text-primary m-2 inline-flex items-center gap-1 hover:underline`,title:`Open the advanced /opsx:new form`,children:[(0,H.jsx)(pl,{className:`h-3.5 w-3.5`}),`Open advanced /opsx:new form`]})]})]})}):null]})}var k2e=V.createContext(void 0);function f9(){let e=V.useContext(k2e);if(e===void 0)throw Error(Zb(10));return e}var A2e={value:()=>null},j2e=V.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,hiddenUntilFound:a,keepMounted:o,loopFocus:s=!0,onValueChange:c,multiple:l=!1,orientation:u=`vertical`,value:d,defaultValue:f,...p}=e,m=Nde(),h=V.useMemo(()=>{if(d===void 0)return f??[]},[d,f]),g=cC(c),_=V.useRef([]),[v,y]=X3({controlled:d,default:h,name:`Accordion`,state:`value`}),b=cC((e,t)=>{let n=nC(qS);if(!l){let t=v[0]===e?[]:[e];if(g(t,n),n.isCanceled)return;y(t)}else if(t){let t=v.slice();if(t.push(e),g(t,n),n.isCanceled)return;y(t)}else{let t=v.filter(t=>t!==e);if(g(t,n),n.isCanceled)return;y(t)}}),x=V.useMemo(()=>({value:v,disabled:i,orientation:u}),[v,i,u]),S=V.useMemo(()=>({accordionItemRefs:_,direction:m,disabled:i,handleValueChange:b,hiddenUntilFound:a??!1,keepMounted:o??!1,loopFocus:s,orientation:u,state:x,value:v}),[m,i,b,a,o,s,u,x,v]),C=HC(`div`,e,{state:x,ref:t,props:[{dir:m,role:`region`},p],stateAttributesMapping:A2e});return(0,H.jsx)(k2e.Provider,{value:S,children:(0,H.jsx)(T6,{elementsRef:_,children:C})})});function M2e(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,a=t!==void 0,[o,s]=X3({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:c,setMounted:l,transitionStatus:u}=Ww(o,!0,!0),[d,f]=V.useState(o),[{height:p,width:m},h]=V.useState({height:void 0,width:void 0}),g=dT(),[_,v]=V.useState(),y=_??g,[b,x]=V.useState(!1),[S,C]=V.useState(!1),w=V.useRef(null),T=V.useRef(null),E=V.useRef(null),D=V.useRef(null),O=qw(D,!1),k=cC(e=>{let t=!o,n=nC(JS,e.nativeEvent);if(r(t,n),n.isCanceled)return;let i=D.current;T.current===`css-animation`&&i!=null&&i.style.removeProperty(`animation-name`),!b&&!S&&(T.current!=null&&T.current!==`css-animation`&&!c&&t&&l(!0),T.current===`css-animation`&&(!d&&t&&f(!0),!c&&t&&l(!0))),s(t),T.current===`none`&&c&&!t&&l(!1)});return Xb(()=>{a&&T.current===`none`&&!S&&!o&&l(!1)},[a,S,o,t,l]),V.useMemo(()=>({abortControllerRef:w,animationTypeRef:T,disabled:i,handleTrigger:k,height:p,mounted:c,open:o,panelId:y,panelRef:D,runOnceAnimationsFinish:O,setDimensions:h,setHiddenUntilFound:x,setKeepMounted:C,setMounted:l,setOpen:s,setPanelIdState:v,setVisible:f,transitionDimensionRef:E,transitionStatus:u,visible:d,width:m}),[w,T,i,k,p,c,o,y,D,O,h,x,C,l,s,f,E,u,d,m])}var N2e=V.createContext(void 0);function P2e(){let e=V.useContext(N2e);if(e===void 0)throw Error(Zb(15));return e}var F2e=V.createContext(void 0);function p9(){let e=V.useContext(F2e);if(e===void 0)throw Error(Zb(9));return e}var m9=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Gw.startingStyle]=`startingStyle`,e[e.endingStyle=Gw.endingStyle]=`endingStyle`,e}({}),I2e=function(e){return e.panelOpen=`data-panel-open`,e}({}),L2e={[m9.open]:``},R2e={[m9.closed]:``},z2e={open(e){return e?{[I2e.panelOpen]:``}:null}},B2e={open(e){return e?L2e:R2e}},V2e=function(e){return e.index=`data-index`,e.disabled=`data-disabled`,e.open=`data-open`,e}({}),h9={...B2e,index:e=>Number.isInteger(e)?{[V2e.index]:String(e)}:null,...Kw,value:()=>null},H2e=V.forwardRef(function(e,t){let{className:n,disabled:r=!1,onOpenChange:i,render:a,value:o,...s}=e,{ref:c,index:l}=J6(),u=rC(t,c),{disabled:d,handleValueChange:f,state:p,value:m}=f9(),h=dT(),g=o??h,_=r||d,v=V.useMemo(()=>{if(!m)return!1;for(let e=0;e<m.length;e+=1)if(m[e]===g)return!0;return!1},[m,g]),y=cC((e,t)=>{i?.(e,t),!t.isCanceled&&f(g,e)}),b=M2e({open:v,onOpenChange:y,disabled:_}),x=V.useMemo(()=>({open:b.open,disabled:b.disabled,hidden:!b.mounted,transitionStatus:b.transitionStatus}),[b.open,b.disabled,b.mounted,b.transitionStatus]),S=V.useMemo(()=>({...b,onOpenChange:y,state:x}),[b,x,y]),C=V.useMemo(()=>({...p,index:l,disabled:_,open:v}),[_,l,v,p]),[w,T]=V.useState(dT()),E=V.useMemo(()=>({open:v,state:C,setTriggerId:T,triggerId:w}),[v,C,T,w]),D=HC(`div`,e,{state:C,ref:u,props:s,stateAttributesMapping:h9});return(0,H.jsx)(N2e.Provider,{value:S,children:(0,H.jsx)(F2e.Provider,{value:E,children:D})})}),U2e=V.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=p9();return HC(`h3`,e,{state:a,ref:t,props:i,stateAttributesMapping:h9})});function W2e(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var G2e=new Set([I6,F6,R6,L6,z6,`End`]);function K2e(e){let{current:t}=e,n=[];for(let e=0;e<t.length;e+=1){let r=t[e];if(!W2e(r)){let e=r?.querySelector(`[type="button"], [role="button"]`);e&&!W2e(e)&&n.push(e)}}return n}var q2e=V.forwardRef(function(e,t){let{disabled:n,className:r,id:i,render:a,nativeButton:o=!0,...s}=e,{panelId:c,open:l,handleTrigger:u,disabled:d}=P2e(),{getButtonProps:f,buttonRef:p}=g6({disabled:n??d,focusableWhenDisabled:!0,native:o,composite:!0}),{accordionItemRefs:m,direction:h,loopFocus:g,orientation:_}=f9(),v=h===`rtl`,y=_===`horizontal`,{state:b,setTriggerId:x,triggerId:S}=p9();Xb(()=>(i&&x(i),()=>{x(void 0)}),[i,x]);let C=V.useMemo(()=>({"aria-controls":l?c:void 0,"aria-expanded":l,id:S,tabIndex:0,onClick:u,onKeyDown(e){if(!G2e.has(e.key))return;Hx(e);let t=K2e(m),n=t.length-1,r=-1,i=t.indexOf(e.target);function a(){r=g?i+1>n?0:i+1:Math.min(i+1,n)}function o(){r=g&&i===0?n:i-1}switch(e.key){case I6:y||a();break;case F6:y||o();break;case R6:y&&(v?o():a());break;case L6:y&&(v?a():o());break;case`Home`:r=0;break;case`End`:r=n;break;default:break}r>-1&&t[r].focus()}}),[m,u,S,y,v,g,l,c]);return HC(`button`,e,{state:b,ref:[t,p],props:[C,s,f],stateAttributesMapping:z2e})}),J2e=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e}({});function Y2e(e){let{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:i,hiddenUntilFound:a,keepMounted:o,id:s,mounted:c,onOpenChange:l,open:u,panelRef:d,runOnceAnimationsFinish:f,setDimensions:p,setMounted:m,setOpen:h,setVisible:g,transitionDimensionRef:_,visible:v,width:y}=e,b=V.useRef(!1),x=V.useRef(null),S=V.useRef(u),C=V.useRef(u),w=fC(),T=V.useMemo(()=>n.current===`css-animation`?!v:!u&&!c,[u,c,v,n]),E=rC(r,d,cC(e=>{if(!e)return;if(n.current==null||_.current==null){let t=getComputedStyle(e),r=t.animationName!==`none`&&t.animationName!==``,i=t.transitionDuration!==`0s`&&t.transitionDuration!==``;r&&i||(t.animationName===`none`&&t.transitionDuration!==`0s`?n.current=`css-transition`:t.animationName!==`none`&&t.transitionDuration===`0s`?n.current=`css-animation`:n.current=`none`),e.getAttribute(J2e.orientation)===`horizontal`||t.transitionProperty.indexOf(`width`)>-1?_.current=`width`:_.current=`height`}if(n.current!==`css-transition`)return;(i===void 0||y===void 0)&&(p({height:e.scrollHeight,width:e.scrollWidth}),C.current&&e.style.setProperty(`transition-duration`,`0s`));let t=-1,r=-1;return t=dC.request(()=>{C.current=!1,r=dC.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})}),()=>{dC.cancel(t),dC.cancel(r)}}));return Xb(()=>{if(n.current!==`css-transition`)return;let e=d.current;if(!e)return;let r=-1;if(t.current!=null&&(t.current.abort(),t.current=null),u){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)}),!C.current&&!o&&e.setAttribute(m9.startingStyle,``),p({height:e.scrollHeight,width:e.scrollWidth}),r=dC.request(()=>{Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})})}else{if(e.scrollHeight===0&&e.scrollWidth===0)return;p({height:e.scrollHeight,width:e.scrollWidth});let n=new AbortController;t.current=n;let r=n.signal,i=null,a=m9.endingStyle;return i=new MutationObserver(o=>{o.some(e=>e.type===`attributes`&&e.attributeName===a)&&(i?.disconnect(),i=null,f(()=>{p({height:0,width:0}),e.style.removeProperty(`content-visibility`),m(!1),t.current===n&&(t.current=null)},r))}),i.observe(e,{attributes:!0,attributeFilter:[a]}),()=>{i?.disconnect(),w.cancel(),t.current===n&&(n.abort(),t.current=null)}}return()=>{dC.cancel(r)}},[t,n,w,a,o,c,u,d,f,p,m]),Xb(()=>{if(n.current!==`css-animation`)return;let e=d.current;e&&(x.current=e.style.animationName||x.current,e.style.setProperty(`animation-name`,`none`),p({height:e.scrollHeight,width:e.scrollWidth}),!S.current&&!b.current&&e.style.removeProperty(`animation-name`),u?(t.current!=null&&(t.current.abort(),t.current=null),m(!0),g(!0)):(t.current=new AbortController,f(()=>{m(!1),g(!1),t.current=null},t.current.signal)))},[t,n,u,d,f,p,m,g,v]),ex(()=>{let e=dC.request(()=>{S.current=!1});return()=>dC.cancel(e)}),Xb(()=>{if(!a)return;let e=d.current;if(!e)return;let t=-1,n=-1;return u&&b.current&&(e.style.transitionDuration=`0s`,p({height:e.scrollHeight,width:e.scrollWidth}),t=dC.request(()=>{b.current=!1,n=dC.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})})),()=>{dC.cancel(t),dC.cancel(n)}},[a,u,d,p]),Xb(()=>{let e=d.current;e&&a&&T&&(e.setAttribute(`hidden`,`until-found`),n.current===`css-transition`&&e.setAttribute(m9.startingStyle,``))},[a,T,n,d]),V.useEffect(function(){let e=d.current;if(!e)return;function t(e){b.current=!0,h(!0),l(!0,nC(qS,e))}return e.addEventListener(`beforematch`,t),()=>{e.removeEventListener(`beforematch`,t)}},[l,d,h]),V.useMemo(()=>({props:{hidden:T,id:s,ref:E}}),[T,s,E])}var X2e=function(e){return e.accordionPanelHeight=`--accordion-panel-height`,e.accordionPanelWidth=`--accordion-panel-width`,e}({}),Z2e=V.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,id:a,render:o,...s}=e,{hiddenUntilFound:c,keepMounted:l}=f9(),{abortControllerRef:u,animationTypeRef:d,height:f,mounted:p,onOpenChange:m,open:h,panelId:g,panelRef:_,runOnceAnimationsFinish:v,setDimensions:y,setHiddenUntilFound:b,setKeepMounted:x,setMounted:S,setOpen:C,setVisible:w,transitionDimensionRef:T,visible:E,width:D,setPanelIdState:O,transitionStatus:k}=P2e(),A=r??c,j=i??l;Xb(()=>{if(a)return O(a),()=>{O(void 0)}},[a,O]),Xb(()=>{b(A)},[b,A]),Xb(()=>{x(j)},[x,j]),Jw({open:h&&k===`idle`,ref:_,onComplete(){h&&y({width:void 0,height:void 0})}});let{props:M}=Y2e({abortControllerRef:u,animationTypeRef:d,externalRef:t,height:f,hiddenUntilFound:A,id:a??g,keepMounted:j,mounted:p,onOpenChange:m,open:h,panelRef:_,runOnceAnimationsFinish:v,setDimensions:y,setMounted:S,setOpen:C,setVisible:w,transitionDimensionRef:T,visible:E,width:D}),{state:N,triggerId:P}=p9(),F=HC(`div`,e,{state:V.useMemo(()=>({...N,transitionStatus:k}),[N,k]),ref:[t,_],props:[M,{"aria-labelledby":P,role:`region`,style:{[X2e.accordionPanelHeight]:f===void 0?`auto`:`${f}px`,[X2e.accordionPanelWidth]:D===void 0?`auto`:`${D}px`}},s],stateAttributesMapping:h9});return j||A||!j&&p?F:null});function g9({ariaLabel:e,children:t,tooltip:n,className:r,tone:i=`muted`,shape:a=`box`,...o}){return(0,H.jsx)(nE,{content:n,children:(0,H.jsx)(rE,{role:`note`,tabIndex:0,"aria-label":e,tone:i,shape:a,className:tE(`focus-visible:ring-primary cursor-help outline-none focus-visible:ring-2 focus-visible:ring-offset-2`,r),...o,children:t})})}function _9({title:e,children:t,summary:n,defaultOpen:r=!1,className:i,panelClassName:a}){return(0,H.jsx)(j2e,{defaultValue:r?[`evidence`]:[],hiddenUntilFound:!0,children:(0,H.jsxs)(H2e,{value:`evidence`,className:tE(`border-border/70 rounded-md border`,i),children:[(0,H.jsx)(U2e,{className:`m-0`,children:(0,H.jsxs)(q2e,{className:tE(`hover:bg-muted/60 focus-visible:ring-primary flex min-h-9 w-full min-w-0 items-center gap-2 rounded-md px-3 py-2 text-left text-xs outline-none focus-visible:ring-2 focus-visible:ring-inset`,`group/disclosure`),children:[(0,H.jsx)(`span`,{className:`min-w-0 flex-1 font-medium`,children:e}),n?(0,H.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-[11px]`,children:n}):null,(0,H.jsx)(ec,{className:`text-muted-foreground h-3.5 w-3.5 shrink-0 transition-transform duration-200 group-data-[panel-open]/disclosure:rotate-90 motion-reduce:transition-none`,"aria-hidden":!0})]})}),(0,H.jsx)(Z2e,{className:tE(`h-(--accordion-panel-height) overflow-hidden transition-[height] duration-200 ease-out data-[ending-style]:h-0 data-[starting-style]:h-0 motion-reduce:transition-none`,a),children:(0,H.jsx)(`div`,{className:`border-border/60 border-t px-3 py-3 text-xs`,children:t})})]})})}function Q2e({applyInstructionProgress:e}){let{complete:t,total:n,remaining:r}=e;return(0,H.jsxs)(g9,{ariaLabel:`Apply instructions progress ${t} of ${n}`,tooltip:`Progress reported by openspec instructions apply — ${t} of ${n} tasks applied, ${r} remaining.`,children:[`Apply `,t,`/`,n]})}function $2e({applyInstructionProgress:e}){let t=e.divergence;return t?(0,H.jsxs)(`div`,{role:`status`,"aria-label":`Task progress source divergence`,className:`flex min-w-0 items-start gap-2 border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-950 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-100`,children:[(0,H.jsx)(vl,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":`true`}),(0,H.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,H.jsx)(`div`,{className:`font-medium`,children:`Upstream task progress divergence`}),(0,H.jsx)(`p`,{children:t.message}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,H.jsxs)(g9,{ariaLabel:`Apply instructions progress ${e.complete} of ${e.total}`,tooltip:`Progress reported by openspec instructions apply.`,children:[`Apply `,e.complete,`/`,e.total]}),(0,H.jsxs)(g9,{ariaLabel:`Tracked artifact glob progress ${t.tracked.completed} of ${t.tracked.total}`,tooltip:`Progress computed from the workflow's tracked task artifact glob.`,children:[`Tracked `,t.tracked.completed,`/`,t.tracked.total]})]})]})]}):null}var e4e=[`1.8`,`1.9`];function t4e(e){if(!i4e(e))return{schemasRootSelector:!1,archivedValidation:!1};let t=v9(e,`1.9`);return{schemasRootSelector:t,archivedValidation:t}}function n4e(e){if(!e)return null;let t=e.match(/(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/);return t?{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),prerelease:t[4]??null}:null}function v9(e,t){let[n,r]=t.split(`.`).map(e=>Number(e));return e.major===n&&e.minor===r}function r4e(e){return e.prerelease===null}function i4e(e){return!e||!r4e(e)?!1:v9(e,`1.9`)||a4e(e)}function a4e(e){return e4e.filter(e=>e!==`1.9`).some(t=>v9(e,t))}function o4e(e){let t=k_.safeParse(e);return t.success?{report:t.data,schemaIssues:[]}:{report:null,schemaIssues:t.error.issues.map(e=>`${e.path.length>0?e.path.join(`.`):`<root>`}: ${e.message}`)}}function s4e({issues:e}){return e.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No CLI issue reported.`}):(0,H.jsx)(`ul`,{className:`text-muted-foreground space-y-0.5`,children:e.map((e,t)=>(0,H.jsxs)(`li`,{className:`break-words`,children:[e.level,` · `,e.path,` · `,e.message]},t))})}function y9({pending:e,label:t,onRun:n}){return(0,H.jsxs)(`button`,{type:`button`,onClick:n,disabled:e,"aria-busy":e||void 0,className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs disabled:opacity-50`,children:[e?(0,H.jsx)(Vc,{className:`h-3.5 w-3.5 animate-spin`,"aria-hidden":!0}):(0,H.jsx)(el,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),t]})}function c4e(){let[e,t]=(0,V.useState)(null),[n,r]=(0,V.useState)(null),[i,a]=(0,V.useState)(!1),o=u9().context?.cli,s=t4e(o?.available?n4e(o.version):null);if(Lf())return(0,H.jsx)(_9,{title:`Archived validation`,summary:`Unavailable in static snapshot`,children:(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`Archived-task validation is live CLI evidence and is not captured in this static snapshot.`})});if(o?.available===!0&&!s.archivedValidation)return(0,H.jsx)(_9,{title:`Archived validation`,summary:`Unavailable on this CLI line`,children:(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Archived-task validation requires the OpenSpec 1.9 line`,o.version?` (detected ${o.version.trim()})`:``,`. This session's CLI does not declare the capability, so no command is offered.`]})});let c=async()=>{a(!0),r(null),t(null);try{let e=await Cy.cli.validate.mutate({kind:`archived`}),n=Hne.safeParse(e);n.success?t({...n.data,data:n.data.data??null,payload:n.data.payload??null}):r(`The archived validation transport returned an unrecognized result shape.`)}catch(e){r(e instanceof Error?e.message:String(e))}finally{a(!1)}};if(!e&&!n)return(0,H.jsx)(_9,{title:`Archived validation`,summary:`OpenSpec 1.9 archived-task validation`,children:(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`Run the official CLI's archived-task validation and keep its typed report as evidence. OpenSpecUI never repairs or archives from here.`}),(0,H.jsx)(y9,{pending:i,label:`Validate archived tasks`,onRun:()=>void c()})]})});let l=e?o4e(e.data):{report:null,schemaIssues:[]},u=l.report;if(n||!u){let t=l.schemaIssues.length>0?l.schemaIssues.join(`; `):null;return(0,H.jsx)(_9,{title:`Archived validation`,summary:`CLI failure evidence`,children:(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`text-destructive flex items-start gap-2 break-words`,role:`alert`,children:[(0,H.jsx)(vl,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`min-w-0 break-all`,children:n??e?.contractError??t??e?.stderr.trim()??`The archived validation command failed.`})]}),(0,H.jsx)(y9,{pending:i,label:`Rerun`,onRun:()=>void c()})]})})}let d=u,f=d.summary.totals.failed;return(0,H.jsx)(_9,{title:`Archived validation`,summary:`${d.summary.totals.passed} passed · ${f} failed`,children:(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`dl`,{className:`@[32rem]:grid-cols-[auto_minmax(0,1fr)] grid min-w-0 gap-x-3 gap-y-1`,children:[(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Root`}),(0,H.jsx)(`dd`,{className:`min-w-0 break-all font-mono`,children:d.root.path}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Exit`}),(0,H.jsx)(`dd`,{children:e?.exitCode??`unknown`}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Totals`}),(0,H.jsxs)(`dd`,{children:[d.summary.totals.passed,` passed · `,f,` failed ·`,` `,d.summary.totals.items,` archived changes`]})]}),(0,H.jsx)(`div`,{className:`space-y-2`,children:d.items.map(e=>(0,H.jsxs)(`div`,{className:`border-border/60 rounded border p-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[e.valid?(0,H.jsx)(rc,{className:`h-3.5 w-3.5 shrink-0 text-emerald-600`,"aria-hidden":!0}):(0,H.jsx)(vl,{className:`h-3.5 w-3.5 shrink-0 text-amber-600`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`min-w-0 break-all font-mono text-[11px]`,children:e.id})]}),(0,H.jsx)(`div`,{className:`mt-1`,children:(0,H.jsx)(s4e,{issues:e.issues})})]},e.id))}),(0,H.jsx)(y9,{pending:i,label:`Rerun`,onRun:()=>void c()})]})})}function l4e(e){return e.reduce((e,t)=>(e.total+=t.status.length,e.errors+=t.status.filter(e=>e.severity===`error`).length,e.warnings+=t.status.filter(e=>e.severity===`warning`).length,e),{errors:0,warnings:0,total:0})}function u4e(e){return e.flatMap(e=>{let t=e.status.filter(e=>e.severity===`error`).length;return t>0?[`${e.store_id} (${t})`]:[]})}function d4e({status:e,referenceEvidence:t,applyInstructionProgress:n,statusRefreshing:r=null,rootChecking:i=null}){let a=e.provenance,o=t.state===`unavailable`?null:t.references,s=o?l4e(o):null,c=e.artifacts.filter(e=>e.status===`done`).length,l=e.artifacts.length;return(0,H.jsxs)(`div`,{"data-change-context-summary":``,"aria-label":`Change context summary`,className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,H.jsxs)(g9,{ariaLabel:`Workflow schema ${e.schemaName}`,tooltip:`OpenSpec workflow schema: ${e.schemaName}`,children:[`Schema: `,e.schemaName]}),(0,H.jsxs)(g9,{ariaLabel:`Artifact progress ${c} of ${l}`,tooltip:`${c} completed of ${l} total artifacts.`,children:[c,`/`,l,` artifacts`]}),n?(0,H.jsx)(Q2e,{applyInstructionProgress:n}):null,a.kind===`static`?(0,H.jsx)(g9,{ariaLabel:`Static Change context has no live backend provenance`,tooltip:`CLI Change context is unavailable in this static snapshot.`,children:`Static snapshot`}):(0,H.jsx)(g9,{ariaLabel:`Change Root source ${a.root.source}${a.root.store_id?`, Store ${a.root.store_id}`:``}`,className:`max-w-full truncate`,tooltip:(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`div`,{children:[`Change root: `,a.changeRoot]}),(0,H.jsxs)(`div`,{children:[`Planning home: `,a.planningHome.root]}),(0,H.jsxs)(`div`,{children:[`Root source: `,a.root.source]}),(0,H.jsxs)(`div`,{children:[`Store: `,a.root.store_id??`none`]})]}),children:a.root.store_id?`Store ${a.root.store_id}`:a.root.source}),o&&s?(0,H.jsxs)(g9,{ariaLabel:`${t.state===`retained`?`Retained `:``}${o.length} observed References, ${s.errors} errors, ${s.warnings} warnings`,tooltip:`${t.state===`retained`?`Retained · `:``}${o.length} References · ${s.errors} errors · ${s.warnings} warnings · ${s.total} diagnostics`,tone:s.errors>0?`custom`:`muted`,className:s.errors>0?`border-destructive/40 bg-destructive/10 text-destructive`:void 0,children:[t.state===`retained`?`Retained `:``,`References `,o.length]}):(0,H.jsx)(g9,{ariaLabel:`Reference evidence unavailable`,tooltip:t.state===`unavailable`&&t.reason===`static`?`Reference evidence is not published in this static snapshot.`:`Reference evidence is unavailable until Root Context is observed.`,children:`References unavailable`}),i?(0,H.jsx)(fL,{label:i.label,message:i.message}):null,r?(0,H.jsx)(fL,{label:r.label,message:r.message}):null]})}function f4e({referenceEvidence:e}){let t=e.state===`unavailable`?[]:u4e(e.references);return t.length===0?null:(0,H.jsxs)(`div`,{className:`text-destructive flex items-start gap-2 text-xs`,role:`alert`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),(0,H.jsxs)(`span`,{children:[`Reference errors: `,t.join(`, `)]})]})}function p4e({status:e,referenceEvidence:t}){let n=e.provenance;if(n.kind===`static`){let t=e.artifacts.length;return(0,H.jsx)(`section`,{"data-change-evidence-scroll-owner":``,"aria-label":`Change Evidence`,className:`scrollbar-thin scrollbar-track-transparent flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto overflow-x-hidden overscroll-contain p-4`,children:(0,H.jsxs)(`div`,{className:`min-w-0 space-y-3 p-4 text-xs`,children:[(0,H.jsx)(`div`,{className:`border-border bg-muted/20 text-muted-foreground rounded-md border p-4 text-sm`,children:`CLI Change context and Reference evidence are unavailable in this static snapshot.`}),(0,H.jsx)(_9,{title:`Artifact outputs`,summary:`${t} ${t===1?`output`:`outputs`}`,children:(0,H.jsx)(m4e,{artifacts:e.artifacts})})]})})}let r=Object.keys(n.artifactPaths).length;return(0,H.jsx)(`section`,{"data-change-evidence-scroll-owner":``,"aria-label":`Change Evidence`,className:`scrollbar-thin scrollbar-track-transparent flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto overflow-x-hidden overscroll-contain`,children:(0,H.jsxs)(`div`,{className:`@container min-w-0 space-y-3 p-4 text-xs`,children:[(0,H.jsx)(h4e,{provenance:n}),(0,H.jsx)(_9,{title:`Artifact outputs`,summary:`${r} ${r===1?`output`:`outputs`}`,children:(0,H.jsxs)(`div`,{className:`min-w-0 space-y-3`,children:[(0,H.jsx)(g4e,{artifactPaths:n.artifactPaths}),(0,H.jsx)(b9,{label:`Allowed edit roots`,values:n.actionContext.allowedEditRoots}),(0,H.jsx)(b9,{label:`Planning artifacts`,values:n.actionContext.planningArtifacts}),(0,H.jsx)(b9,{label:`Linked context`,values:n.actionContext.linkedContext.map(e=>e.name)}),(0,H.jsx)(b9,{label:`Constraints`,values:n.actionContext.constraints}),(0,H.jsx)(b9,{label:`Next steps`,values:n.nextSteps})]})}),(0,H.jsx)(_9,{title:`References`,summary:_4e(t),children:(0,H.jsx)(v4e,{evidence:t})}),(0,H.jsx)(_9,{title:`CLI result`,summary:`${n.evidence.command} · exit ${n.evidence.exitCode??`unknown`}`,children:(0,H.jsx)(b4e,{evidence:n.evidence})})]})})}function m4e({artifacts:e}){return e.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No artifact output currently published.`}):(0,H.jsx)(`dl`,{className:`min-w-0 space-y-3`,children:e.map(e=>(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`dt`,{className:`font-medium`,children:e.id}),(0,H.jsx)(`dd`,{className:`text-muted-foreground min-w-0 break-all font-mono`,children:e.outputPath})]},e.id))})}function h4e({provenance:e}){return(0,H.jsxs)(`dl`,{className:`@[32rem]:grid-cols-[auto_minmax(0,1fr)] grid min-w-0 gap-x-3 gap-y-1`,children:[(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Change root`}),(0,H.jsx)(`dd`,{className:`min-w-0 break-all font-mono`,children:e.changeRoot}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Planning home`}),(0,H.jsx)(`dd`,{className:`min-w-0 break-all font-mono`,children:e.planningHome.root}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Root source`}),(0,H.jsxs)(`dd`,{className:`min-w-0 break-words`,children:[e.root.source,e.root.store_id?` · ${e.root.store_id}`:``]}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Action context`}),(0,H.jsxs)(`dd`,{className:`min-w-0 break-words`,children:[e.actionContext.mode,` · `,e.actionContext.sourceOfTruth]})]})}function g4e({artifactPaths:e}){return(0,H.jsx)(`dl`,{className:`min-w-0 space-y-3`,children:Object.entries(e).map(([e,t])=>(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`dt`,{className:`font-medium`,children:e}),(0,H.jsxs)(`dd`,{className:`text-muted-foreground min-w-0 break-all font-mono`,children:[t.outputPath,` `,`->`,` `,t.resolvedOutputPath]}),(0,H.jsxs)(`dd`,{className:`text-muted-foreground min-w-0 break-all`,children:[`Existing:`,` `,t.existingOutputPaths.length>0?t.existingOutputPaths.join(`, `):`none observed`]})]},e))})}function _4e(e){return e.state===`unavailable`?`Unavailable`:`${e.references.length} observed · ${e.state}`}function v4e({evidence:e}){if(e.state===`unavailable`)return(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:e.reason===`static`?`Reference evidence is not published in this static snapshot.`:`Reference evidence is unavailable until Root Context is observed.`});let t=e.references;return(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`font-medium`,children:e.state===`retained`?`Retained References`:`Observed References`}),t.length===0?(0,H.jsx)(`div`,{className:`text-muted-foreground mt-1`,children:`No reference currently observed.`}):(0,H.jsx)(`div`,{className:`mt-1 space-y-2`,children:t.map(e=>(0,H.jsx)(y4e,{reference:e},e.store_id))})]})}function y4e({reference:e}){return(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`min-w-0 break-all font-mono`,children:e.store_id}),e.status.length===0?(0,H.jsx)(`div`,{className:`text-muted-foreground`,children:`No CLI diagnostic.`}):(0,H.jsx)(`ul`,{className:`text-muted-foreground space-y-0.5`,children:e.status.map(e=>(0,H.jsxs)(`li`,{className:`break-words`,children:[e.severity,` · `,e.code,` · `,e.message]},`${e.severity}:${e.code}:${e.message}`))})]})}function b4e({evidence:e}){return(0,H.jsxs)(`div`,{className:`min-w-0 space-y-3`,children:[(0,H.jsxs)(`dl`,{className:`@[32rem]:grid-cols-[auto_minmax(0,1fr)] grid min-w-0 gap-x-3 gap-y-1`,children:[(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Command`}),(0,H.jsx)(`dd`,{className:`min-w-0 break-all font-mono`,children:e.command}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Exit`}),(0,H.jsx)(`dd`,{children:e.exitCode??`unknown`}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Selector`}),(0,H.jsx)(`dd`,{className:`min-w-0 break-all`,children:e.selector.store??`none`}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Contract`}),(0,H.jsx)(`dd`,{className:`min-w-0 break-words`,children:e.contractError??`compatible`})]}),(0,H.jsx)(_9,{title:`Raw CLI payload`,summary:`stdout · stderr · diagnostics`,children:(0,H.jsx)(`pre`,{className:`bg-muted/40 max-h-48 max-w-full overflow-auto whitespace-pre-wrap break-all rounded p-2 font-mono`,children:JSON.stringify({stdout:e.stdout,stderr:e.stderr,diagnostics:e.diagnostics,payload:e.payload},null,2)})})]})}function b9({label:e,values:t}){return(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`font-medium`,children:e}),(0,H.jsx)(`div`,{className:`text-muted-foreground min-w-0 break-all`,children:t.length>0?t.join(`, `):`none observed`})]})}function x4e({status:e,selectedArtifactId:t,actionDisabled:n=!1,actionDisabledReason:r,applyInputsAction:i,onComposeAction:a,onArchive:o,onVerify:s}){let c=e.artifacts.find(e=>e.status===`ready`),l=e.artifacts.find(e=>e.id===t),u=t8(e);return(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[[{id:`continue`,label:`Continue`,icon:Qc,artifactId:t,disabled:!t||!l||[`blocked`,`skipped`].includes(l.status),hint:t?l?l.status===`blocked`?`selected artifact is blocked`:l.status===`skipped`?`selected artifact is intentionally skipped`:void 0:`selected artifact is unavailable`:`select an artifact`},{id:`ff`,label:`Fast-forward`,icon:tl,artifactId:c?.id,disabled:!c,hint:c?void 0:`no ready artifacts`},{id:`apply`,label:`Apply`,icon:nc,disabled:!u.available,hint:u.missingArtifactIds.length>0?`missing: ${u.missingArtifactIds.join(`, `)}`:void 0},{id:`update`,label:`Update`,icon:el,disabled:!1},{id:`sync`,label:`Sync`,icon:kc,disabled:!1},{id:`archive`,label:`Archive`,icon:Ws,disabled:!1}].map(e=>{let t=e.icon,s=n?r:e.disabled?e.hint:void 0;return(0,H.jsxs)(V.Fragment,{children:[(0,H.jsx)(nE,{content:s?`${e.label}: ${s}`:e.label,children:(0,H.jsxs)(`button`,{type:`button`,disabled:n||e.disabled,onClick:()=>e.id===`archive`?o():a(e.id,e.artifactId),"aria-label":e.label,className:`border-border hover:bg-muted inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,H.jsx)(t,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`@min-[40rem]:inline hidden`,children:e.label})]})}),e.id===`apply`?i:null]},e.id)}),(0,H.jsx)(nE,{content:n&&r?`Verify: ${r}`:`Verify`,children:(0,H.jsxs)(`button`,{type:`button`,onClick:s,disabled:n,"aria-label":`Verify`,className:`border-border hover:bg-muted inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,H.jsx)(ul,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`@min-[40rem]:inline hidden`,children:`Verify`})]})})]})}function S4e({context:e,operationGuidance:t}){return!!(e||t?.length)}function C4e({context:e,operationGuidance:t}){return(0,H.jsxs)(H.Fragment,{children:[e?(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`text-muted-foreground text-xs font-medium`,children:`Project context`}),(0,H.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap text-sm`,children:e})]}):null,t?.length?(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`text-muted-foreground text-xs font-medium`,children:`Operation guidance`}),(0,H.jsx)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-sm`,children:t.map(e=>(0,H.jsx)(`li`,{children:e},e))})]}):null,!e&&!t?.length?(0,H.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No project context or operation guidance configured.`}):null]})}function w4e({title:e,context:t,operationGuidance:n}){let[r,i]=(0,V.useState)(!1);return S4e({title:e,context:t,operationGuidance:n})?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`button`,{type:`button`,"aria-label":e,onClick:()=>i(!0),className:`border-border hover:bg-muted inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition`,children:[(0,H.jsx)(zc,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`@min-[40rem]:inline hidden`,children:e})]}),(0,H.jsx)(El,{open:r,title:(0,H.jsx)(`span`,{className:`text-sm font-semibold`,children:e}),onClose:()=>i(!1),maxHeight:`min(80vh, 40rem)`,bodyClassName:`space-y-3`,children:(0,H.jsx)(C4e,{context:t,operationGuidance:n})})]}):null}function T4e({state:e}){return e.status===`checking`?(0,H.jsx)(fL,{label:e.title,message:e.message}):null}function x9({state:e}){return e.status===`blocked`?(0,H.jsxs)(`div`,{role:`alert`,"aria-live":`assertive`,className:`border-destructive/40 bg-destructive/10 text-destructive rounded-md border p-3 text-sm`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 font-medium`,children:[(0,H.jsx)(tc,{className:`h-4 w-4`,"aria-hidden":!0}),e.title]}),(0,H.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words`,children:e.message}),e.evidence.length>0?(0,H.jsx)(_9,{title:`Root command evidence`,summary:`${e.evidence.length} ${e.evidence.length===1?`entry`:`entries`}`,className:`border-current/20 bg-background/35 mt-2`,children:(0,H.jsx)(`ul`,{className:`space-y-1 font-mono text-xs`,children:e.evidence.map(e=>(0,H.jsx)(`li`,{className:`whitespace-pre-wrap break-all`,children:e},e))})}):null]}):null}function E4e(){let{changeId:e}=qo({from:`/changes/$changeId`}),t=ab(zs().state),n=Foe({change:e}),r=n.authority.state===`current`,{rootAction:i,launchApply:a,launchArchive:o}=h2e({applyCurrent:r}),{data:s,isLoading:c,error:l}=n,{data:u}=zoe({change:e}),{data:d}=Moe(e),f=(0,V.useCallback)((t,n)=>{if(t===`apply`){a({changeId:e,changeName:s?.changeName??e});return}let r=o2e({action:t,changeId:e,artifactId:n});Ib.activatePop(r)},[e,a,s?.changeName]),p=(0,V.useCallback)(()=>{Ib.activatePop(`/opsx-verify?change=${encodeURIComponent(e)}`)},[e]),m=(0,V.useCallback)(()=>{o({changeId:e,changeName:s?.changeName??e})},[e,o,s?.changeName]),h=(0,V.useMemo)(()=>{if(s)return s.artifacts.find(e=>e.status===`ready`)?.id??s.artifacts[0]?.id},[s]),g=l?.message.includes(`Change '${e}' not found`)||l?.message.includes(`Change "${e}" not found`),_=i.status===`blocked`?[i.message,...i.evidence].join(`
|
|
1642
|
-
`):void 0,v=i.disabled||!r,y=r?void 0:`Change status is refreshing; actions remain read-only.`,b=i.message??y,x=(0,V.useMemo)(()=>s?.provenance.kind===`static`?{state:`unavailable`,reason:`static`}:i.context?{state:i.status===`ready`?`current`:`retained`,references:i.context.references}:{state:`unavailable`,reason:`root-context`},[i.context,i.status,s?.provenance.kind]),S=(0,V.useMemo)(()=>s?[{id:`evidence`,label:`Evidence`,icon:(0,H.jsx)(vc,{className:`h-4 w-4`}),content:(0,H.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,H.jsx)(p4e,{status:s,referenceEvidence:x}),(0,H.jsx)(c4e,{})]})}]:[],[x,s]),C=x.state!==`unavailable`&&x.references.some(e=>e.status.some(e=>e.severity===`error`)),w=!!l||i.status===`blocked`||C||!!u?.applyInstructionProgress.divergence;return(0,H.jsx)(Y3,{entityId:e,sharedFamily:`changes`,backTo:`/changes`,backTitle:`Back to Changes`,icon:Dc,title:s?.changeName,subtitle:s?(0,H.jsx)(d4e,{status:s,referenceEvidence:x,applyInstructionProgress:u?.applyInstructionProgress??null,statusRefreshing:r?null:{label:`Status refreshing`,message:y??``},rootChecking:i.status===`checking`?{label:i.title,message:i.message}:null}):void 0,headerActions:s?(0,H.jsx)(x4e,{status:s,selectedArtifactId:h,actionDisabled:v,actionDisabledReason:b,applyInputsAction:(0,H.jsx)(w4e,{title:`Apply inputs`,context:u?.context,operationGuidance:u?.operationGuidance}),onComposeAction:f,onArchive:m,onVerify:p}):void 0,handoff:t,isLoading:(c||i.status===`checking`)&&!s,loadingMessage:`Loading change status...`,errorMessage:_&&!s?_:l&&!g&&!s?`Error loading change: ${l.message}`:void 0,notFoundMessage:!i.disabled&&g&&!s?`Change not found in the current project.`:!i.disabled&&!s&&!c&&!l?`Change not found.`:void 0,notFoundBackLabel:`Back to Changes`,artifacts:s?.artifacts,contentFallback:d?{id:`content`,label:`Content`,outputPath:`openspec/changes/**/*.md`,relativePath:`changes/${e}`,files:d,emptyMessage:`No Markdown files found. Open the folder view to inspect change files.`}:void 0,folder:{changeId:e},tabsQueryKey:`artifact`,initialTab:h,supplementaryTabs:S,statusRegion:s&&w?(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[l?(0,H.jsx)(`div`,{role:`alert`,"aria-live":`assertive`,className:`border-destructive/40 bg-destructive/10 text-destructive rounded-md border p-3 text-sm`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2 font-medium`,children:[(0,H.jsx)(tc,{className:`h-4 w-4`,"aria-hidden":!0}),`Error loading change: `,l.message]})}):null,(0,H.jsx)(x9,{state:i}),(0,H.jsx)(f4e,{referenceEvidence:x}),u?(0,H.jsx)($2e,{applyInstructionProgress:u.applyInstructionProgress}):null]}):null})}var D4e=(0,V.createContext)(null);function O4e(){return(0,V.useContext)(D4e)}var k4e={"project-binding":{route:`/config/project`,anchor:`config-guide-project-binding`,label:`Project Binding`},"active-root":{route:`/config/root`,anchor:`config-guide-active-root`,label:`Active Root`},"agent-delivery":{route:`/config/agents`,anchor:`config-guide-agent-delivery`,label:`Agent Delivery`},"resolved-context":{route:`/config/context`,anchor:`config-guide-resolved-context`,label:`Resolved Context`}},A4e=(0,V.createContext)(null);(0,V.lazy)(async()=>({default:(await Z(()=>import(`./config-guide-presentation-BOR0ydhm.js`),__vite__mapDeps([136,2,1]))).ConfigGuidePresentationLayer}));function j4e(){return(0,V.useContext)(A4e)}function M4e(e,t){let n=j4e()?.register,[r,i]=(0,V.useState)(null),{detail:a,status:o,title:s}=t;return(0,V.useEffect)(()=>{if(!(!n||!r))return n(e,r,{detail:a,status:o,title:s})},[a,r,n,e,o,s]),{ref:i,id:k4e[e].anchor,"data-config-guide-stage":e}}var N4e=[{id:`overview`,label:`Overview`,href:`/config`,icon:(0,H.jsx)(Fc,{className:`h-4 w-4`,"aria-hidden":!0})},{id:`project`,label:`Project Binding`,href:`/config/project`,icon:(0,H.jsx)(Ic,{className:`h-4 w-4`,"aria-hidden":!0}),liveOnly:!0},{id:`root`,label:`Active Root`,href:`/config/root`,icon:(0,H.jsx)(bc,{className:`h-4 w-4`,"aria-hidden":!0})},{id:`environment`,label:`Environment`,href:`/config/environment`,icon:(0,H.jsx)(ol,{className:`h-4 w-4`,"aria-hidden":!0}),liveOnly:!0},{id:`agents`,label:`Agents`,href:`/config/agents`,icon:(0,H.jsx)(Js,{className:`h-4 w-4`,"aria-hidden":!0}),liveOnly:!0},{id:`schemas`,label:`Schemas`,href:`/config/schemas`,icon:(0,H.jsx)(Ys,{className:`h-4 w-4`,"aria-hidden":!0})},{id:`context`,label:`Context`,href:`/config/context`,icon:(0,H.jsx)(Sl,{className:`h-4 w-4`,"aria-hidden":!0})}];function S9({children:e,current:t,header:n}){let r=Lf(),i=r?N4e.filter(e=>e.liveOnly!==!0):N4e;return(0,H.jsxs)(`div`,{"data-testid":`config-workbench`,"data-config-section":t,className:`@container/config flex min-h-full w-full min-w-0 flex-col overflow-x-clip`,children:[(0,H.jsx)(`nav`,{"aria-label":`Config sections`,"data-config-workbench-navbar":!0,className:`bg-background/95 border-border divide-border/20 sticky top-0 z-20 grid min-w-0 shrink-0 gap-0 divide-x border-b p-0 backdrop-blur ${r?`grid-cols-4`:`grid-cols-7`}`,children:i.map(e=>{let n=t===e.id;return(0,H.jsx)(nE,{content:e.label,children:(0,H.jsxs)(Nb,{to:e.href,"aria-label":e.label,"aria-current":n?`page`:void 0,className:`focus-visible:ring-primary @[64rem]:gap-2 flex min-h-10 min-w-0 items-center justify-center gap-0 px-2 text-xs font-bold outline-none transition-colors focus-visible:ring-2 ${n?`bg-primary text-primary-foreground`:`text-muted-foreground hover:bg-muted hover:text-foreground`}`,children:[e.icon,(0,H.jsx)(`span`,{"data-testid":`config-nav-label-${e.id}`,className:`config-workbench-nav-label min-w-0 truncate`,"aria-hidden":!0,children:e.label})]})},e.id)})}),(0,H.jsxs)(`div`,{className:`vt-detail-content min-w-0`,children:[(0,H.jsx)(`div`,{className:`shrink-0 px-4 pt-4`,children:n}),(0,H.jsx)(`div`,{className:`min-w-0 p-4`,children:e})]})]})}function C9({backHref:e,backLabel:t=`Config`,description:n,icon:r,title:i,trailing:a}){return(0,H.jsxs)(`header`,{className:`space-y-3`,children:[e?(0,H.jsxs)(Nb,{to:e,"aria-label":`Back to ${t}`,className:`text-muted-foreground hover:text-foreground focus-visible:ring-primary inline-flex min-h-8 items-center gap-1.5 rounded-md px-1 text-xs outline-none focus-visible:ring-2`,children:[(0,H.jsx)(Gs,{className:`h-4 w-4`,"aria-hidden":!0}),t]}):null,(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex min-w-0 items-center gap-2 text-2xl font-bold`,children:[r,(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:i})]}),(0,H.jsx)(`p`,{className:`text-muted-foreground mt-1 max-w-3xl text-sm`,children:n})]}),a?(0,H.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:a}):null]})]})}var P4e={ready:{label:`Ready`,tooltip:`The current Root Context can authorize root-dependent operations.`,className:`border-emerald-500/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`},refreshing:{label:`Refreshing`,tooltip:`Retained facts remain readable while root-dependent operations stay locked.`,className:`border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-300`},resolving:{label:`Resolving`,tooltip:`OpenSpec is resolving the effective Root Context.`,className:`border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-300`},blocked:{label:`Blocked`,tooltip:`The current observation cannot authorize root-dependent operations.`,className:`border-destructive/40 bg-destructive/10 text-destructive`},static:{label:`Static snapshot`,tooltip:`Published facts are read-only and carry no live mutation authority.`}};function F4e(){return(0,H.jsxs)(Nb,{to:`/config/context`,"aria-label":`Open Resolved Context`,className:`border-border hover:bg-muted focus-visible:ring-primary inline-flex h-9 shrink-0 items-center gap-2 rounded-md border px-3 text-xs font-medium outline-none focus-visible:ring-2`,children:[(0,H.jsx)(Sl,{className:`h-4 w-4`,"aria-hidden":!0}),`Context`]})}function I4e({status:e,trailing:t}){let n=P4e[e];return(0,H.jsxs)(`header`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,H.jsxs)(Nb,{to:`/config`,className:`text-muted-foreground hover:text-foreground focus-visible:ring-primary inline-flex min-h-8 items-center gap-1.5 rounded-md px-1 text-xs outline-none focus-visible:ring-2`,children:[(0,H.jsx)(Gs,{className:`h-4 w-4`,"aria-hidden":!0}),`Config`]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[t,(0,H.jsx)(g9,{ariaLabel:`Resolved Context status ${n.label.toLowerCase()}`,tooltip:n.tooltip,tone:n.className?`custom`:`muted`,className:n.className,children:n.label})]})]}),(0,H.jsxs)(`h1`,{className:`font-nav flex min-w-0 items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(Sl,{className:`h-6 w-6 shrink-0`,"aria-hidden":!0}),`Resolved Context`]})]})}function w9(e){return e instanceof Error?e:Error(String(e))}function L4e(){let[e,t]=(0,V.useState)(null),[n,r]=(0,V.useState)(null),[i,a]=(0,V.useState)(!0),[o,s]=(0,V.useState)(!1),c=(0,V.useRef)(!1),l=(0,V.useRef)(null),u=(0,V.useCallback)(e=>{c.current&&(t(e),r(l.current),a(!1))},[]);return(0,V.useEffect)(()=>{c.current=!0;let e=!1;l.current=null;let n=Cy.agentIntegrations.subscribe.subscribe(void 0,{onData(t){e=!0,l.current=null,u(t)},onError(e){c.current&&(l.current=w9(e),r(l.current),a(!1))}});return Cy.agentIntegrations.get.query().then(n=>{!c.current||e||(t(n),r(l.current),a(!1))}).catch(t=>{!c.current||e||(r(w9(t)),a(!1))}),()=>{c.current=!1,n.unsubscribe()}},[u]),{data:e,error:n,isLoading:i,isRefreshing:o,refresh:(0,V.useCallback)(async()=>{s(!0);try{let e=await Cy.agentIntegrations.refresh.query();return u(e),e}catch(e){let t=w9(e);throw c.current&&r(t),t}finally{c.current&&s(!1)}},[u]),accept:u}}var T9=50*1024,E9=K().min(1),R4e=J(E9),z4e=hd(E9,R4e),D9=Y({guidance:R4e}).strict(),B4e=Y({apply:D9.optional(),archive:D9.optional()}).strict();function V4e(e){return new TextEncoder().encode(e).byteLength<=T9}var H4e=K().refine(V4e,`Context must not exceed ${T9} UTF-8 bytes.`);Y({schema:E9.nullable(),context:H4e.nullable(),rules:z4e.nullable(),operations:B4e.nullable()}).strict();var U4e=Y({schema:E9,context:H4e.nullable(),rules:z4e.nullable(),operations:Y({apply:D9.nullable(),archive:D9.nullable()}).strict().nullable()}).strict(),W4e=K().regex(/^sha256:[a-f0-9]{64}$/),G4e={ownerPath:K().min(1),filePath:K().min(1),revision:W4e};pd(`mode`,[Y({...G4e,mode:X(`structured`),update:U4e}).strict(),Y({...G4e,mode:X(`raw`),content:K()}).strict()]);var O9={schema:null,context:null,rules:null,operations:null};function k9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function K4e(e){return new TextEncoder().encode(e).byteLength}function q4e(e){let t=Fg(e);return t.errors.length===0?[]:[{code:`config-unparseable`,severity:`error`,path:`$`,message:t.errors.map(e=>e.message).join(`
|
|
1643
|
-
`)}]}function J4e(e,t){if(e===void 0)return null;if(!k9(e))return t.push({code:`rules-invalid`,severity:`error`,path:`rules`,message:`The rules field must be a mapping of artifact ids to string arrays.`}),null;let n={};for(let[r,i]of Object.entries(e)){if(!Array.isArray(i)||i.some(e=>typeof e!=`string`)){t.push({code:`rules-entry-invalid`,severity:`error`,path:`rules.${r}`,message:`Rules for '${r}' must be an array of strings.`});continue}let e=i.filter(e=>e.length>0);e.length<i.length&&t.push({code:`rules-entry-empty`,severity:`warning`,path:`rules.${r}`,message:`Empty rules for '${r}' are ignored by OpenSpec.`}),e.length>0&&(n[r]=e)}return Object.keys(n).length>0?n:null}function Y4e(e,t){if(e===void 0)return null;if(!k9(e))return t.push({code:`operations-invalid`,severity:`error`,path:`operations`,message:`The operations field must be a mapping.`}),null;let n={};for(let r of[`apply`,`archive`]){let i=e[r];if(i===void 0)continue;if(!k9(i)){t.push({code:`operation-invalid`,severity:`error`,path:`operations.${r}`,message:`Operation '${r}' must be a mapping.`});continue}if(i.guidance===void 0)continue;if(!Array.isArray(i.guidance)||i.guidance.some(e=>typeof e!=`string`)){t.push({code:`operation-guidance-invalid`,severity:`error`,path:`operations.${r}.guidance`,message:`Guidance for '${r}' must be an array of strings.`});continue}let a=i.guidance.filter(e=>e.length>0);a.length<i.guidance.length&&t.push({code:`operation-guidance-empty`,severity:`warning`,path:`operations.${r}.guidance`,message:`Empty '${r}' guidance entries are ignored by OpenSpec.`}),a.length>0&&(n[r]={guidance:a})}return Object.keys(n).length>0?n:null}function X4e(e){if(e===null||e.trim().length===0)return{official:{...O9},diagnostics:[{code:`schema-missing`,severity:`error`,path:`schema`,message:`The active OpenSpec config does not declare a schema.`}]};let t=Fg(e);if(t.errors.length>0)return{official:{...O9},diagnostics:q4e(e)};let n=t.toJS();if(!k9(n))return{official:{...O9},diagnostics:[{code:`config-not-mapping`,severity:`error`,path:`$`,message:`OpenSpec config must be a YAML mapping for Structured mode.`}]};let r=[],i=null;n.schema===void 0?r.push({code:`schema-missing`,severity:`error`,path:`schema`,message:`The active OpenSpec config does not declare a schema.`}):typeof n.schema!=`string`||n.schema.length===0?r.push({code:`schema-invalid`,severity:`error`,path:`schema`,message:`The schema field must be a non-empty string.`}):i=n.schema;let a=null;return n.context!==void 0&&(typeof n.context==`string`?K4e(n.context)>51200?r.push({code:`context-too-large`,severity:`error`,path:`context`,message:`The context field exceeds ${T9} UTF-8 bytes.`}):a=n.context:r.push({code:`context-invalid`,severity:`error`,path:`context`,message:`The context field must be a string.`})),{official:{schema:i,context:a,rules:J4e(n.rules,r),operations:Y4e(n.operations,r)},diagnostics:r}}function A9(e){return{content:e.file.content,exists:e.file.exists,filePath:e.file.path,owner:e.owner,revision:e.revision,official:e.official,diagnostics:e.diagnostics}}function Z4e(){return Wy((0,V.useCallback)(e=>Cy.planningConfig.subscribeProjectBinding.subscribe(void 0,{onData:e.onData,onError:e.onError}),[]),async()=>null,[],`planningConfig.subscribeProjectBinding`)}function j9(){return Gy((0,V.useCallback)(e=>Cy.planningConfig.subscribeActiveRoot.subscribe(void 0,{onData:t=>{if(t.type===`recompute-started`){e.onEvent(t);return}e.onEvent({type:`data`,data:A9(t.data)})},onError:e.onError}),[]),async()=>{let e=await aie(),t=X4e(e);return{content:e,exists:e!==null,filePath:null,owner:null,revision:null,...t}},[],`planningConfig.subscribeActiveRootView`)}function Q4e(){let e=(0,V.useMemo)(()=>({read:()=>Cy.planningConfig.readEnvironmentGlobalProjection.query(),refresh:()=>Cy.planningConfig.refreshEnvironmentGlobalProjection.query(),parseState:e=>woe.parse(e),subscribe(e){return Cy.planningConfig.subscribeEnvironmentGlobalProjection.subscribe(void 0,{onData(t){let n=jd.safeParse(t);if(!n.success){e.onError(Error(`Malformed Environment Global notice: ${n.error.message}`));return}e.onNotice()},onError:e.onError,onConnectionStateChange(t){if(t.error){e.onError(t.error);return}(t.state===`connecting`||t.state===`pending`)&&e.onConnectionState(t.state)},onStopped:e.onStopped,onComplete:e.onComplete})}}),[]),t=(0,V.useMemo)(()=>({read:()=>Cy.planningConfig.readEnvironmentGlobalFileProjection.query(),refresh:()=>Cy.planningConfig.refreshEnvironmentGlobalFileProjection.query(),parseState:e=>Coe.parse(e),subscribe(e){return Cy.planningConfig.subscribeEnvironmentGlobalFileProjection.subscribe(void 0,{onData(t){let n=jd.safeParse(t);if(!n.success){e.onError(Error(`Malformed Environment Global file notice: ${n.error.message}`));return}e.onNotice()},onError:e.onError,onConnectionStateChange(t){if(t.error){e.onError(t.error);return}(t.state===`connecting`||t.state===`pending`)&&e.onConnectionState(t.state)},onStopped:e.onStopped,onComplete:e.onComplete})}}),[]),n=By({source:e,sourceKey:`environment-global-cli`,selectData:e=>e,staticLoader:async()=>null,cacheKey:`planningConfig.environmentGlobalCliProjection`}),r=By({source:t,sourceKey:`environment-global-file`,selectData:e=>e,staticLoader:async()=>null,cacheKey:`planningConfig.environmentGlobalFileProjection`}),i=n.data!==void 0&&n.data!==null&&r.data!==void 0&&r.data!==null?{...n.data,kind:`environment-global`,file:r.data.file}:void 0,a=n.error??r.error;return{data:i,isLoading:n.isLoading||r.isLoading,isUpdating:n.isUpdating||r.isUpdating,refreshPending:n.refreshPending||r.refreshPending,error:a,authority:n.authority.state===`failed`?n.authority:r.authority.state===`failed`?r.authority:n.authority.state===`current`&&r.authority.state===`current`?{state:`current`}:{state:`waiting`,reason:`pending`},refresh:async()=>{await n.refresh()}}}var $4e={ready:`border-emerald-500/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`,attention:`border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-300`,blocked:`border-destructive/40 bg-destructive/10 text-destructive`,loading:`border-border bg-muted text-muted-foreground`,static:`border-border bg-muted text-muted-foreground`};function e3e(){let e=O4e(),t=j4e(),n=Lf();return(0,H.jsxs)(`header`,{className:`flex min-w-0 flex-wrap items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex min-w-0 items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(fl,{className:`h-6 w-6 shrink-0`,"aria-hidden":!0}),`Config`]}),(0,H.jsx)(`p`,{className:`text-muted-foreground mt-1 max-w-3xl text-sm`,children:`Configure declarations by owner, then verify the CLI-selected result through Resolved Context.`})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[e?.projection&&!e.projection.initialized?(0,H.jsxs)(`button`,{type:`button`,onClick:e.open,className:`border-border bg-background text-foreground hover:bg-muted inline-flex h-9 items-center gap-2 rounded-md border px-3 text-xs font-medium`,children:[(0,H.jsx)(xl,{className:`h-4 w-4`,"aria-hidden":!0}),`Init`]}):null,n?null:(0,H.jsxs)(`button`,{id:`config-guide-overview-action`,"data-config-guide-overview":`true`,type:`button`,disabled:!t?.canStart,onClick:t?.active?t.restart:t?.start,title:t?.canStart?`Guide Project Binding, Active Root, Agent Delivery, and Resolved Context.`:`Initialize the local OpenSpec project before starting the Guide.`,className:`border-border bg-background text-foreground hover:bg-muted inline-flex h-9 items-center gap-2 rounded-md border px-3 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-60`,children:[(0,H.jsx)(cc,{className:`h-4 w-4`,"aria-hidden":!0}),t?.active?`Restart Guide`:`Guide`]}),(0,H.jsx)(F4e,{})]})]})}function t3e({model:e}){let t=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground shrink-0`,children:e.icon}),(0,H.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-semibold`,children:e.title})]}),(0,H.jsx)(`span`,{className:`shrink-0 rounded border px-2 py-0.5 text-[10px] font-medium ${$4e[e.status]}`,children:e.statusLabel})]}),(0,H.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:e.description}),(0,H.jsx)(`p`,{className:`text-sm`,children:e.summary}),e.error?(0,H.jsxs)(`div`,{role:`alert`,className:`text-destructive flex items-start gap-1.5 text-xs`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{children:e.error})]}):null]}),n=`border-border bg-card flex min-h-40 min-w-0 flex-col gap-3 rounded-lg border p-4`;return e.href?(0,H.jsx)(Nb,{to:e.href,"aria-label":e.title,className:`${n} hover:border-primary/40 hover:bg-muted/30 focus-visible:ring-primary outline-none focus-visible:ring-2`,children:t}):(0,H.jsx)(`section`,{"aria-label":e.title,className:n,children:t})}function n3e({models:e}){return(0,H.jsx)(`div`,{className:`@[42rem]:grid-cols-2 @[72rem]:grid-cols-3 grid min-w-0 gap-3`,children:e.map(e=>(0,H.jsx)(t3e,{model:e},e.id))})}function r3e(){let e=Z4e(),t=j9(),n=Q4e(),r=L4e(),i=Xy(),a=u9(),o=r.data?.states.reduce((e,t)=>e+(t.issues.length>0?1:0),0)??0,s=e.data?.binding.references.entries.length??0,c=i.data?.schemas.length??0;return(0,H.jsx)(n3e,{models:[{id:`project`,title:`Project Binding`,description:`Launch-project Store and read-only Reference declarations.`,href:`/config/project`,icon:(0,H.jsx)(Ic,{className:`h-4 w-4`,"aria-hidden":!0}),status:e.error?`blocked`:e.isLoading&&!e.data?`loading`:`ready`,statusLabel:e.error?`Blocked`:e.isLoading&&!e.data?`Loading`:`Observed`,summary:e.data?`${e.data.binding.store.state} Store · ${s} References`:`Waiting for launch-project declarations.`,error:e.error?.message},{id:`root`,title:`Active Root`,description:`Physical config selected by the current Planning Root.`,href:`/config/root`,icon:(0,H.jsx)(bc,{className:`h-4 w-4`,"aria-hidden":!0}),status:t.error?`blocked`:t.isLoading&&!t.data?`loading`:t.data?.exists?`ready`:`attention`,statusLabel:t.error?`Blocked`:t.isLoading&&!t.data?`Loading`:t.data?.exists?`Available`:`Missing`,summary:t.data?.exists?t.data.filePath||`Published config document`:`No config file exists in the selected Root.`,error:t.error?.message},{id:`environment`,title:`Environment`,description:`Machine defaultStore, feature flags, and global source evidence.`,href:`/config/environment`,icon:(0,H.jsx)(ol,{className:`h-4 w-4`,"aria-hidden":!0}),status:n.error?`blocked`:n.isLoading&&!n.data?`loading`:n.authority.state===`current`?`ready`:`attention`,statusLabel:n.error?`Blocked`:n.isLoading&&!n.data?`Loading`:n.authority.state===`current`?`Current`:`Refreshing`,summary:n.data?n.data.configPath??`Global config path is unavailable.`:`Waiting for the CLI-owned environment projection.`,error:n.error?.message},{id:`agents`,title:`Agent Delivery`,description:`Official delivery policy, physical inventory, migration, and repair.`,href:`/config/agents`,icon:(0,H.jsx)(Js,{className:`h-4 w-4`,"aria-hidden":!0}),status:r.error?`blocked`:r.isLoading&&!r.data?`loading`:o>0?`attention`:`ready`,statusLabel:r.error?`Blocked`:r.isLoading&&!r.data?`Loading`:o>0?`Attention`:`Current`,summary:r.data?`${r.data.registry.length} Agents · ${o} with issues`:`Waiting for the Server-owned Agent projection.`,error:r.error?.message},{id:`schemas`,title:`Schemas`,description:`Resolved workflow Schema catalog and physical detail workspaces.`,href:`/config/schemas`,icon:(0,H.jsx)(Ys,{className:`h-4 w-4`,"aria-hidden":!0}),status:i.error?`blocked`:i.isLoading&&!i.data?`loading`:c>0?`ready`:`attention`,statusLabel:i.error?`Blocked`:i.isLoading&&!i.data?`Loading`:c>0?`Available`:`Empty`,summary:i.data?`${c} resolved Schemas`:`Waiting for the Schema catalog.`,error:i.error?.message},{id:`context`,title:`Resolved Context`,description:`Effective Root, Store, References, and current action authority.`,href:`/config/context`,icon:(0,H.jsx)(Sl,{className:`h-4 w-4`,"aria-hidden":!0}),status:a.status===`ready`?`ready`:a.status===`blocked`?`blocked`:`loading`,statusLabel:a.status===`ready`?`Ready`:a.status===`blocked`?`Blocked`:`Resolving`,summary:a.context?.planningRoot?.path??(a.status===`ready`?`Root Context is current.`:`Waiting for CLI-selected Root Context.`),error:a.status===`blocked`?a.message:void 0}]})}function i3e(){let e=j9(),t=Xy(),n=t.data?.schemas.length??0;return(0,H.jsx)(n3e,{models:[{id:`project`,title:`Project Binding`,description:`Launch-project declarations are intentionally excluded from publication.`,icon:(0,H.jsx)(Ic,{className:`h-4 w-4`,"aria-hidden":!0}),status:`static`,statusLabel:`Not published`,summary:`Open this project live to inspect or edit Project Binding.`},{id:`root`,title:`Active Root`,description:`Read-only configuration content included in this snapshot.`,href:`/config/root`,icon:(0,H.jsx)(bc,{className:`h-4 w-4`,"aria-hidden":!0}),status:e.error?`blocked`:e.isLoading&&!e.data?`loading`:`static`,statusLabel:e.error?`Blocked`:e.isLoading&&!e.data?`Loading`:`Snapshot`,summary:e.data?.exists?`Published config document is available.`:`No config document published.`,error:e.error?.message},{id:`environment`,title:`Environment`,description:`Machine paths and global configuration are private runtime facts.`,icon:(0,H.jsx)(ol,{className:`h-4 w-4`,"aria-hidden":!0}),status:`static`,statusLabel:`Not published`,summary:`Static output carries no Environment mutation or machine-path authority.`},{id:`agents`,title:`Agent Delivery`,description:`Agent inventory and mutation authority remain live-only.`,icon:(0,H.jsx)(Js,{className:`h-4 w-4`,"aria-hidden":!0}),status:`static`,statusLabel:`Not published`,summary:`Static output contains no Agent policy or physical inventory.`},{id:`schemas`,title:`Schemas`,description:`Read-only Schema catalog and published physical documents.`,href:`/config/schemas`,icon:(0,H.jsx)(Ys,{className:`h-4 w-4`,"aria-hidden":!0}),status:t.error?`blocked`:t.isLoading&&!t.data?`loading`:`static`,statusLabel:t.error?`Blocked`:t.isLoading&&!t.data?`Loading`:`Snapshot`,summary:t.data?`${n} published Schemas`:`Waiting for published Schema data.`,error:t.error?.message},{id:`context`,title:`Resolved Context`,description:`Publication-redacted Root and Reference provenance.`,href:`/config/context`,icon:(0,H.jsx)(Sl,{className:`h-4 w-4`,"aria-hidden":!0}),status:`static`,statusLabel:`Snapshot`,summary:`Inspect the publication-safe Context evidence boundary.`}]})}function a3e(){let e=Lf();return(0,H.jsx)(S9,{current:`overview`,header:(0,H.jsx)(e3e,{}),children:e?(0,H.jsx)(i3e,{}):(0,H.jsx)(r3e,{})})}function o3e(e){return e.transportError?{status:`failed`,title:`Active Root unavailable`,detail:e.transportError}:e.loading&&!e.available?{status:`blocked`,title:`Loading Active Root`,detail:`Wait for the CLI-selected Active Root projection.`}:e.available?e.mutationPending||e.editing||e.dirty||e.conflict?{status:`active-edit`,title:`Finish Active Root changes`,detail:`Save, resolve, or discard the current Structured or Raw YAML draft.`}:e.authority===`blocked`?{status:`failed`,title:e.authorityTitle??`Active Root authority failed`,detail:e.authorityMessage??`Repair Root Context authority before continuing.`}:e.refreshing||e.authority===`checking`?{status:`stale`,title:`Active Root is refreshing`,detail:e.authorityMessage??`Wait for current Root authority before continuing.`}:e.exists?e.errorDiagnostic?{status:`failed`,title:`Active Root config is invalid`,detail:e.errorDiagnostic}:e.warningDiagnostic?{status:`warning`,title:`Review Active Root diagnostics`,detail:e.warningDiagnostic}:{status:`ready`,title:`Active Root ready`,detail:`The CLI-selected Root has a current valid configuration.`}:{status:`required`,title:`Create the Active Root config`,detail:`Create and save an official or custom YAML configuration for this Root.`}:{status:`failed`,title:`Active Root unavailable`,detail:`No Active Root configuration projection is available.`}}function s3e(e){return e.transportError||e.authorityFailed?{status:`failed`,title:`Resolved Context unavailable`,detail:e.transportError??`Current Root authority failed.`}:e.loading?{status:`blocked`,title:`Resolving Context`,detail:`Wait for the current CLI-selected Root Context.`}:e.refreshing||!e.authorityCurrent?{status:`stale`,title:`Resolved Context is refreshing`,detail:`Retained Context is visible, but current Root authority has not settled.`}:!e.available||!e.hasPlanningRoot?{status:`required`,title:`Select a usable Root`,detail:`Project Binding or Environment Global must resolve a current Planning Root.`}:!e.cliAvailable||e.cliError?{status:`failed`,title:`Selected Root is not usable`,detail:e.cliError??`OpenSpec CLI is unavailable for the selected Root.`}:e.errorDiagnostic?{status:`failed`,title:`Resolved Context has errors`,detail:e.errorDiagnostic}:e.warningDiagnostic?{status:`warning`,title:`Review Resolved Context warnings`,detail:e.warningDiagnostic}:{status:`ready`,title:`Resolved Context ready`,detail:`Root authority is current and the selected Planning Root is usable.`}}function c3e({latest:e,mode:t,pending:n,retryDisabled:r,onReload:i,onRetry:a}){return(0,H.jsxs)(`div`,{role:`alert`,className:`space-y-3 rounded-md border border-amber-500/40 bg-amber-500/10 p-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,H.jsx)(ll,{className:`mt-0.5 h-4 w-4 shrink-0 text-amber-600 dark:text-amber-400`}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`p`,{className:`text-sm font-medium`,children:`Active Root changed after this draft was loaded.`}),(0,H.jsxs)(`p`,{className:`text-muted-foreground mt-1 text-xs`,children:[`The physical file was not overwritten. Review revision`,` `,e.revision?.slice(0,15)??`latest`,`before reloading or retrying.`]}),t===`raw`?(0,H.jsx)(`p`,{className:`mt-1 text-xs text-amber-800 dark:text-amber-300`,children:`Retrying Raw YAML replaces the complete latest document, including external changes.`}):null]})]}),(0,H.jsxs)(`details`,{className:`border-border bg-background/70 rounded-md border p-2`,children:[(0,H.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium`,children:`Review latest physical YAML`}),(0,H.jsx)(`pre`,{className:`text-muted-foreground mt-2 max-h-48 overflow-y-auto whitespace-pre-wrap break-words text-xs`,children:e.content??``})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,H.jsxs)(nL,{variant:`secondary`,size:`sm`,disabled:n,onClick:i,children:[(0,H.jsx)(nl,{className:`h-3.5 w-3.5`}),`Reload latest`]}),(0,H.jsx)(nL,{size:`sm`,disabled:n||r,onClick:a,children:`Retry against latest`})]})]})}function l3e({value:e,readOnly:t,onChange:n,onSaveShortcut:r}){return(0,H.jsx)(JY,{value:e,onChange:n,onSaveShortcut:r,readOnly:t,filename:`config.yaml`,className:`min-w-0`,editorMinHeight:`clamp(24rem, 60vh, 48rem)`})}function M9(e){return e?.join(`
|
|
1641
|
+
`),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,H.jsx)(t1e,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:V.cloneElement(e,{ref:u})})}var r1e=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=r8(i1e),d=(0,V.useId)(),f=(0,V.useRef)(n),p=(0,V.useRef)(r);i8(()=>{f.current=n,p.current=r});let m=!0,h=(0,V.useMemo)(()=>(m=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,V.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),V.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,H.jsx)(n1e,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,H.jsx)(a8.Provider,{value:h,children:e})};function i1e(){return new Map}function a1e(e=!0){let t=(0,V.useContext)(a8);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,V.useId)();(0,V.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,V.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var H7=e=>e.key||``;function o1e(e){let t=[];return V.Children.forEach(e,e=>{(0,V.isValidElement)(e)&&t.push(e)}),t}var s1e=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=a1e(o),f=(0,V.useMemo)(()=>o1e(e),[e]),p=o&&!u?[]:f.map(H7),m=(0,V.useRef)(!0),h=(0,V.useRef)(f),g=r8(()=>new Map),_=(0,V.useRef)(new Set),[v,y]=(0,V.useState)(f),[b,x]=(0,V.useState)(f);i8(()=>{m.current=!1,h.current=f;for(let e=0;e<b.length;e++){let t=H7(b[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[b,p.length,p.join(`-`)]);let S=[];if(f!==v){let e=[...f];for(let t=0;t<b.length;t++){let n=b[t],r=H7(n);p.includes(r)||(e.splice(t,0,n),S.push(n))}return a===`wait`&&S.length&&(e=S),x(o1e(e)),y(f),null}let{forceRender:C}=(0,V.useContext)(n8);return(0,H.jsx)(H.Fragment,{children:b.map(e=>{let v=H7(e),y=o&&!u?!1:f===b||p.includes(v);return(0,H.jsx)(r1e,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(_.current.has(v))return;if(g.has(v))_.current.add(v),g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(C?.(),x(h.current),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},v)})})},c1e=(0,V.createContext)({strict:!1}),l1e={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},u1e=!1;function d1e(){if(u1e)return;let e={};for(let t in l1e)e[t]={isEnabled:e=>l1e[t].some(t=>!!e[t])};HZe(e),u1e=!0}function f1e(){return d1e(),UZe()}function p1e(e){let t=f1e();for(let n in e)t[n]={...t[n],...e[n]};HZe(t)}var m1e=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function U7(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||m1e.has(e)}var h1e=r({default:()=>g1e}),g1e,_1e=n((()=>{throw g1e={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),v1e=e=>!U7(e);function y1e(e){typeof e==`function`&&(v1e=t=>t.startsWith(`on`)?!U7(t):e(t))}try{y1e((_1e(),t(h1e)).default)}catch{}function b1e(e,t,n){let r={};for(let i in e)i===`values`&&typeof e.values==`object`||z5(e[i])||(v1e(i)||n===!0&&U7(i)||!t&&!U7(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]);return r}var W7=(0,V.createContext)({});function x1e(e,t){if(f7(e)){let{initial:t,animate:n}=e;return{initial:t===!1||l7(t)?t:void 0,animate:l7(n)?n:void 0}}return e.inherit===!1?{}:t}function S1e(e){let{initial:t,animate:n}=x1e(e,(0,V.useContext)(W7));return(0,V.useMemo)(()=>({initial:t,animate:n}),[C1e(t),C1e(n)])}function C1e(e){return Array.isArray(e)?e.join(` `):e}var G7=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function w1e(e,t,n){for(let r in t)!z5(t[r])&&!fQe(r,n)&&(e[r]=t[r])}function T1e({transformTemplate:e},t){return(0,V.useMemo)(()=>{let n=G7();return C7(n,t,e),Object.assign({},n.vars,n.style)},[t])}function E1e(e,t){let n=e.style||{},r={};return w1e(r,n,e),Object.assign(r,T1e(e,t)),r}function D1e(e,t){let n={},r=E1e(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var O1e=()=>({...G7(),attrs:{}});function k1e(e,t,n,r){let i=(0,V.useMemo)(()=>{let n=O1e();return yQe(n,t,xQe(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};w1e(t,e.style,e),i.style={...t,...i.style}}return i}var A1e=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function K7(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(A1e.indexOf(e)>-1||/[A-Z]/u.test(e))}function j1e(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??K7(e)?k1e:D1e)(t,r,i,e),c=b1e(t,typeof e==`string`,a),l=e===V.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,V.useMemo)(()=>z5(u)?u.get():u,[u]);return(0,V.createElement)(e,{...l,children:d})}function M1e({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:N1e(n,r,i,e),renderState:t()}}function N1e(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=F7(a[e]);let{initial:o,animate:s}=e,c=f7(e),l=IZe(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!c7(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=I5(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var P1e=e=>(t,n)=>{let r=(0,V.useContext)(W7),i=(0,V.useContext)(a8),a=()=>M1e(e,t,r,i);return n?a():r8(a)},F1e=P1e({scrapeMotionValuesFromProps:E7,createRenderState:G7}),I1e=P1e({scrapeMotionValuesFromProps:CQe,createRenderState:O1e}),L1e=Symbol.for(`motionComponentSymbol`);function R1e(e,t,n){let r=(0,V.useRef)(n);(0,V.useInsertionEffect)(()=>{r.current=n});let i=(0,V.useRef)(null);return(0,V.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`)if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n);else a&&(a.current=n)},[t])}var z1e=(0,V.createContext)({});function q7(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function B1e(e,t,n,r,i,a){let{visualElement:o}=(0,V.useContext)(W7),s=(0,V.useContext)(c1e),c=(0,V.useContext)(a8),l=(0,V.useContext)(V7),u=l.reducedMotion,d=l.skipAnimations,f=(0,V.useRef)(null),p=(0,V.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,V.useContext)(z1e);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&V1e(f.current,n,i,h);let g=(0,V.useRef)(!1);(0,V.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[FXe],v=(0,V.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return i8(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,V.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function V1e(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:H1e(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&q7(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function H1e(e){if(e)return e.options.allowProjection===!1?H1e(e.parent):e.projection}function J7(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&p1e(r);let a=n?n===`svg`:K7(e),o=a?I1e:F1e;function s(n,s){let c,l={...(0,V.useContext)(V7),...n,layoutId:U1e(n)},{isStatic:u}=l,d=S1e(n),f=o(n,u);if(!u&&typeof window<`u`){W1e(l,r);let t=G1e(l);c=t.MeasureLayout,d.visualElement=B1e(e,f,l,i,t.ProjectionNode,a)}return(0,H.jsxs)(W7.Provider,{value:d,children:[c&&d.visualElement?(0,H.jsx)(c,{visualElement:d.visualElement,...l}):null,j1e(e,n,R1e(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,V.forwardRef)(s);return c[L1e]=e,c}function U1e({layoutId:e}){let t=(0,V.useContext)(n8).id;return t&&e!==void 0?t+`-`+e:e}function W1e(e,t){(0,V.useContext)(c1e).strict}function G1e(e){let{drag:t,layout:n}=f1e();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function K1e(e,t){if(typeof Proxy>`u`)return J7;let n=new Map,r=(n,r)=>J7(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,J7(a,void 0,e,t)),n.get(a))})}K1e();var q1e=(e,t)=>t.isSVG??K7(e)?new wQe(t):new mQe(t,{allowProjection:e!==V.Fragment}),J1e=class extends h7{constructor(e){super(e),e.animationState||=jQe(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();c7(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Y1e=0,X1e={animation:{Feature:J1e},exit:{Feature:class extends h7{constructor(){super(...arguments),this.id=Y1e++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=L5(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Y7(e){return{point:{x:e.pageX,y:e.pageY}}}var Z1e=e=>t=>Z5(t)&&e(t,Y7(t));function X7(e,t,n,r){return P7(e,t,Z1e(n),r)}var Q1e=({current:e})=>e?e.ownerDocument.defaultView:null,$1e=(e,t)=>Math.abs(e-t);function e0e(e,t){let n=$1e(e.x,t.x),r=$1e(e.y,t.y);return Math.sqrt(n**2+r**2)}var t0e=new Set([`auto`,`scroll`]),n0e=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Z7(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Q7(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=e0e(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=N8;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Z7(t,this.transformPagePoint),j8.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Q7(e.type===`pointercancel`?this.lastMoveEventInfo:Z7(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Z5(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Z7(Y7(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=N8;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Q7(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=h8(X7(this.contextWindow,`pointermove`,this.handlePointerMove,d),X7(this.contextWindow,`pointerup`,this.handlePointerUp,d),X7(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(t0e.has(e.overflowX)||t0e.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};i.x===0&&i.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),j8.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),M8(this.updatePoint)}};function Z7(e,t){return t?{point:t(e.point)}:e}function r0e(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Q7({point:e},t){return{point:e,delta:r0e(e,a0e(t)),offset:r0e(e,i0e(t)),velocity:o0e(t,.1)}}function i0e(e){return e[0]}function a0e(e){return e[e.length-1]}function o0e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=a0e(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>v8(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>v8(t)*2&&(r=e[1]);let a=y8(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function s0e(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?r5(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?r5(n,e,r.max):Math.min(e,n)),e}function c0e(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function l0e(e,{top:t,left:n,bottom:r,right:i}){return{x:c0e(e.x,n,i),y:c0e(e.y,t,r)}}function u0e(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function d0e(e,t){return{x:u0e(e.x,t.x),y:u0e(e.y,t.y)}}function f0e(e,t){let n=.5,r=A7(e),i=A7(t);return i>r?n=g8(t.min,t.max-r,e.min):r>i&&(n=g8(e.min,e.max-i,t.min)),c8(0,1,n)}function p0e(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var $7=.35;function m0e(e=$7){return e===!1?e=0:e===!0&&(e=$7),{x:h0e(e,`left`,`right`),y:h0e(e,`top`,`bottom`)}}function h0e(e,t,n){return{min:g0e(e,t),max:g0e(e,n)}}function g0e(e,t){return typeof e==`number`?e:e[t]||0}var _0e=new WeakMap,v0e=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=s7(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(Y7(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=oZe(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),N7(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Y8.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=A7(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&j8.update(()=>i(e,t),!1,!0),B5(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=x0e(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&j8.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new n0e(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Q1e(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&j8.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!e9(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=s0e(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&q7(e)?this.constraints||=this.resolveRefConstraints():e&&n?this.constraints=l0e(n.layoutBox,e):this.constraints=!1,this.elastic=m0e(t),r!==this.constraints&&!q7(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&N7(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=p0e(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!q7(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=aQe(n,r.root,this.visualElement.getTransformPagePoint()),a=d0e(r.layout.layoutBox,i);if(t){let e=t(qZe(a));this.hasMutatedConstraints=!!e,e&&(a=KZe(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=N7(o=>{if(!e9(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return B5(this.visualElement,e),n.start(F5(e,n,0,t,this.visualElement,!1))}stopAnimation(){N7(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){N7(t=>{let{drag:n}=this.getProps();if(!e9(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-r5(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!q7(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};N7(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=f0e({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),N7(t=>{if(!e9(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(r5(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;_0e.set(this.visualElement,this);let e=this.visualElement.current,t=X7(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&mZe(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();q7(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=b0e(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),j8.read(r);let o=P7(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(N7(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=$7,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function y0e(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function b0e(e,t,n){let r=kZe(e,y0e(n)),i=kZe(t,y0e(n));return()=>{r(),i()}}function e9(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function x0e(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var S0e=class extends h7{constructor(e){super(e),this.removeGroupControls=m8,this.removeListeners=m8,this.controls=new v0e(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||m8}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},t9=e=>(t,n)=>{e&&j8.update(()=>e(t,n),!1,!0)},C0e=class extends h7{constructor(){super(...arguments),this.removePointerDownListener=m8}onPointerDown(e){this.session=new n0e(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Q1e(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:t9(e),onStart:t9(t),onMove:t9(n),onEnd:(e,t)=>{delete this.session,r&&j8.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=X7(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},n9=!1,w0e=class extends V.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),n9&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),I7.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),n9=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||j8.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Y5.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;n9=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function T0e(e){let[t,n]=a1e(),r=(0,V.useContext)(n8);return(0,H.jsx)(w0e,{...e,layoutGroup:r,switchLayoutGroup:(0,V.useContext)(z1e),isPresent:t,safeToRemove:n})}var E0e={pan:{Feature:C0e},drag:{Feature:S0e,ProjectionNode:Z$e,MeasureLayout:T0e}};function D0e(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&j8.postRender(()=>i(t,Y7(t)))}var O0e=class extends h7{mount(){let{current:e}=this.node;e&&(this.unmount=lZe(e,(e,t)=>(D0e(this.node,t,`Start`),e=>D0e(this.node,e,`End`))))}unmount(){}},k0e=class extends h7{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=h8(P7(this.node.current,`focus`,()=>this.onFocus()),P7(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function A0e(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&j8.postRender(()=>i(t,Y7(t)))}var j0e=class extends h7{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=yZe(e,(e,t)=>(A0e(this.node,t,`Start`),(e,{success:t})=>A0e(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},r9=new WeakMap,i9=new WeakMap,M0e=e=>{let t=r9.get(e.target);t&&t(e)},N0e=e=>{e.forEach(M0e)};function P0e({root:e,...t}){let n=e||document;i9.has(n)||i9.set(n,{});let r=i9.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(N0e,{root:e,...t})),r[i]}function F0e(e,t,n){let r=P0e(t);return r9.set(e,n),r.observe(e),()=>{r9.delete(e),r.unobserve(e)}}var I0e={some:0,all:1},L0e=class extends h7{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:I0e[r]};this.stopObserver=F0e(this.node.current,a,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(R0e(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function R0e({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var z0e={inView:{Feature:L0e},tap:{Feature:j0e},focus:{Feature:k0e},hover:{Feature:O0e}},B0e={layout:{ProjectionNode:Z$e,MeasureLayout:T0e}},a9=K1e({...X1e,...z0e,...E0e,...B0e},q1e),V0e=[.5,2,6];function o9(e){return Number(e.toFixed(4)).toString()}function H0e(e,t,n){let r=n===`bottom`?`to bottom`:`to top`,i=100/t;if(e===t-1)return`linear-gradient(${r}, transparent ${o9(100-i)}%, black 100%)`;let a=e*i,o=(e+1)*i,s=(e+2)*i,c=(e+3)*i;return`linear-gradient(${r}, transparent ${o9(a)}%, black ${o9(o)}%, black ${o9(s)}%, transparent ${o9(c)}%)`}function U0e({position:e,blurLevels:t=V0e,surfaceClassName:n,className:r,...i}){return(0,H.jsxs)(`div`,{...i,"aria-hidden":`true`,"data-progressive-blur":e,"data-progressive-blur-levels":t.length,className:tE(`progressive-blur grid`,r),children:[t.map((n,r)=>{let i=H0e(r,t.length,e);return(0,H.jsx)(`div`,{"data-progressive-blur-layer":r,className:`progressive-blur__layer`,style:{zIndex:r+1,backdropFilter:`blur(${n}px)`,WebkitBackdropFilter:`blur(${n}px)`,maskImage:i,WebkitMaskImage:i}},`${n}:${r}`)}),(0,H.jsx)(`div`,{"data-progressive-blur-surface":``,className:tE(`progressive-blur__surface`,n),style:{zIndex:t.length+1}})]})}var W0e=[.5,2,6];function G0e({laneId:e,density:t,header:n,children:r,className:i,...a}){return(0,H.jsxs)(`section`,{...a,"data-kanban-lane":e,"data-kanban-lane-density":t,className:tE(`kanban-lane-viewport border-border/70 grid min-h-0 min-w-0 overflow-hidden border-t`,i),children:[(0,H.jsx)(`div`,{"data-kanban-lane-scroll":e,className:`kanban-lane-viewport__scroll scrollbar-thin scrollbar-track-transparent scrollbar-thumb-[color-mix(in_srgb,currentColor,transparent_78%)] min-h-0 overflow-y-auto overflow-x-hidden overscroll-contain pr-1`,children:r}),(0,H.jsx)(U0e,{position:`top`,blurLevels:W0e,"data-kanban-lane-veil":`top`,className:`kanban-lane-viewport__veil kanban-lane-viewport__veil--top`,surfaceClassName:`kanban-lane-viewport__veil-surface kanban-lane-viewport__veil-surface--top`}),(0,H.jsx)(`header`,{"data-kanban-lane-header":e,className:`kanban-lane-viewport__header`,children:n}),(0,H.jsx)(U0e,{position:`bottom`,blurLevels:W0e,"data-kanban-lane-veil":`bottom`,className:`kanban-lane-viewport__veil kanban-lane-viewport__veil--bottom`,surfaceClassName:`kanban-lane-viewport__veil-surface kanban-lane-viewport__veil-surface--bottom`})]})}var K0e=[{id:`no-tasks`,label:`No tracked tasks`,shortLabel:`No tasks`,accentClass:`bg-muted-foreground/55`},{id:`in-progress`,label:`Tasks remaining`,shortLabel:`Remaining`,accentClass:`bg-primary`},{id:`complete`,label:`Tasks complete`,shortLabel:`Complete`,accentClass:`bg-emerald-500`},{id:`archived`,label:`Archived`,shortLabel:`Archived`,accentClass:`bg-accent`}];function s9(e){let t={"no-tasks":[],"in-progress":[],complete:[]};for(let n of e)t[n.trackedTaskProgress.phase].push(n);return t}function q0e(e){let t=s9(e);return{"no-tasks":t[`no-tasks`].length,"in-progress":t[`in-progress`].length,complete:t.complete.length}}function J0e(e,t,n=Date.now()){return e.filter(e=>yee(e,t,n)).sort((e,t)=>Pp(t)-Pp(e)||e.id.localeCompare(t.id))}function Y0e(e){return e.archivedAt??Pp(e)}var c9=`application/x-openspecui-change-id`,X0e=[{value:`7d`,label:`Last 7 days`},{value:`30d`,label:`Last 30 days`},{value:`90d`,label:`Last 90 days`},{value:`all`,label:`All time`}];function Z0e({activeItems:e,archivedItems:t,statuses:n,range:r,onRangeChange:i,activeState:a,archiveState:o,rootReady:s,rootBlockedReason:c,applyStatusCurrent:l,applyStatusError:u,onApply:d,onArchive:f}){let[p,m]=(0,V.useState)(!1),h=(0,V.useMemo)(()=>s9(e),[e]),g=(0,V.useMemo)(()=>new Map(e.map(e=>[e.id,e])),[e]),_=(0,V.useMemo)(()=>new Map(n.map(e=>[e.changeName,e])),[n]),v=s&&a.current,y=v&&o.current,b=e=>{if(e.preventDefault(),m(!1),!y)return;let t=e.dataTransfer.getData(c9);if(!t)return;let n=g.get(t);n&&f(n)};return(0,H.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-3 overflow-hidden`,children:[(0,H.jsx)(`div`,{className:`shrink-0`,children:(0,H.jsx)(e2e,{activeError:a.error,archiveError:o.error,applyStatusError:u,rowErrors:a.rowErrors,progress:a.progress})}),(0,H.jsx)(`div`,{"data-kanban-grid":!0,className:`scrollbar-thin scrollbar-track-transparent scrollbar-thumb-[color-mix(in_srgb,currentColor,transparent_78%)] grid min-h-0 min-w-0 flex-1 auto-cols-[minmax(16rem,1fr)] grid-flow-col gap-3 overflow-x-auto overflow-y-hidden overscroll-x-contain pb-2`,children:K0e.map(e=>{let n=e.id===`archived`,s=e.id===`archived`?[]:h[e.id],u=n?t:[],g=n?u.length:s.length,x=n?o.initialLoading:a.initialLoading,S=n?o.updating:a.updating;return(0,H.jsx)(G0e,{laneId:e.id,density:`full`,"data-lane":e.id,onDragOver:n?e=>{!y||!e.dataTransfer.types.includes(c9)||(e.preventDefault(),e.dataTransfer.dropEffect=`move`,m(!0))}:void 0,onDragLeave:n?e=>{e.currentTarget.contains(e.relatedTarget)||m(!1)}:void 0,onDrop:n?b:void 0,className:tE(`transition-colors`,n&&p&&`border-primary bg-primary/5`),header:(0,H.jsxs)(`div`,{className:`flex h-full min-w-0 items-center justify-between gap-2 px-1`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`span`,{className:tE(`h-2 w-2 shrink-0 rounded-full`,e.accentClass)}),(0,H.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:e.label}),(0,H.jsx)(iE,{count:g,tone:`muted`,size:`xs`,shape:`pill`})]}),n?(0,H.jsx)(e8,{value:r,options:X0e,onValueChange:i,ariaLabel:`Archived time range`,className:`pointer-events-auto h-7 min-w-0 gap-1 px-2 text-xs`}):null]}),children:(0,H.jsx)(iL,{active:S&&g>0,children:(0,H.jsxs)(a9.div,{layout:!0,className:`min-h-24 space-y-2`,children:[x&&g===0?(0,H.jsx)(lL,{count:2}):null,(0,H.jsxs)(s1e,{initial:!1,mode:`popLayout`,children:[u.map(e=>(0,H.jsx)(a9.div,{layout:!0,layoutId:`live-kanban:${e.id}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,scale:.98},children:(0,H.jsx)($0e,{item:e})},`archived:${e.id}`)),s.map(e=>(0,H.jsx)(a9.div,{layout:!0,layoutId:`live-kanban:${e.id}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,scale:.98},children:(0,H.jsx)(Q0e,{item:e,status:_.get(e.id),canApply:v&&l,canArchive:v,canDragArchive:y,applyBlockedReason:c??(l?null:`Apply availability is not current.`),archiveBlockedReason:c,onApply:d,onArchive:f})},`active:${e.id}`))]}),!x&&g===0?(0,H.jsx)(`div`,{className:`border-border/60 text-muted-foreground flex h-20 items-center justify-center rounded-md border border-dashed`,children:e.id===`no-tasks`?(0,H.jsx)(_c,{className:`h-4 w-4`,"aria-label":`No entries`}):(0,H.jsx)(Lc,{className:`h-4 w-4`,"aria-label":`No entries`})}):null]})})},e.id)})})]})}function Q0e({item:e,status:t,canApply:n,canArchive:r,canDragArchive:i,applyBlockedReason:a,archiveBlockedReason:o,onApply:s,onArchive:c}){let l=t8(t),u=e.trackedTaskProgress,d=u.total>0?Math.round(u.completed/u.total*100):0,f={family:`changes`,entityId:e.id},p=!n||!l.available;return(0,H.jsxs)(`article`,{draggable:i,onDragStart:i?t=>{t.dataTransfer.setData(c9,e.id),t.dataTransfer.effectAllowed=`move`}:void 0,className:tE(`border-border/70 bg-card min-w-0 rounded-md border p-2.5`,i&&`cursor-grab active:cursor-grabbing`),children:[(0,H.jsxs)(Nb,{to:`/changes/$changeId`,params:{changeId:e.id},state:t=>({...t,__vtHandoff:{...f,title:e.name,subtitle:e.id}}),vt:{sharedElements:f},...rb(f,`container`),draggable:!1,className:`block min-w-0`,children:[(0,H.jsx)(`div`,{...rb(f,`title`),className:`truncate text-sm font-medium`,children:e.name}),(0,H.jsx)(`div`,{className:`text-muted-foreground truncate text-xs`,children:e.updatedAt>0?mL(e.updatedAt):e.id}),(0,H.jsx)(`div`,{className:`bg-muted mt-2 h-1.5 rounded-full`,children:(0,H.jsx)(a9.div,{className:`bg-primary h-full rounded-full`,initial:!1,animate:{width:`${d}%`}})})]}),(0,H.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-2`,children:[(0,H.jsxs)(`span`,{className:`text-muted-foreground font-mono text-[11px]`,children:[u.completed,`/`,u.total]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,H.jsx)(`button`,{type:`button`,disabled:p,onClick:()=>s(e),"aria-label":`Apply ${e.name}`,title:a??(l.missingArtifactIds.length>0?`Missing: ${l.missingArtifactIds.join(`, `)}`:`Apply`),className:`hover:bg-muted inline-flex h-7 w-7 items-center justify-center rounded-md disabled:cursor-not-allowed disabled:opacity-40`,children:(0,H.jsx)(Qc,{className:`h-3.5 w-3.5`})}),(0,H.jsx)(`button`,{type:`button`,disabled:!r,onClick:()=>c(e),"aria-label":`Archive ${e.name}`,title:o??`Archive`,className:`hover:bg-muted inline-flex h-7 w-7 items-center justify-center rounded-md disabled:cursor-not-allowed disabled:opacity-40`,children:(0,H.jsx)(Ws,{className:`h-3.5 w-3.5`})})]})]})]})}function $0e({item:e}){let t={family:`archive`,entityId:e.id};return(0,H.jsx)(Nb,{to:`/archive/$changeId`,params:{changeId:e.id},state:n=>({...n,__vtHandoff:{...t,title:e.name,subtitle:e.id}}),vt:{sharedElements:t},...rb(t,`container`),className:`border-border/70 bg-card hover:bg-muted/50 block min-w-0 rounded-md border p-2.5`,children:(0,H.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,H.jsx)(Ws,{className:`text-muted-foreground mt-0.5 h-4 w-4 shrink-0`}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{...rb(t,`title`),className:`truncate text-sm font-medium`,children:e.name}),(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:hL(Y0e(e))})]})]})})}function e2e({activeError:e,archiveError:t,applyStatusError:n,rowErrors:r,progress:i}){let a=[e?`Changes: ${e.message}`:null,t?`Archives: ${t.message}`:null,n?`Apply status: ${n.message}`:null,...r.map(e=>`${e.changeId}: ${e.message}`)].filter(e=>e!==null);return(0,H.jsxs)(H.Fragment,{children:[i?(0,H.jsxs)(`div`,{className:`text-muted-foreground font-mono text-xs`,"aria-live":`polite`,children:[i.completed,`/`,i.total]}):null,a.length>0?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-2 text-xs`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(`div`,{className:`min-w-0 space-y-1`,children:a.map(e=>(0,H.jsx)(`div`,{className:`break-words`,children:e},e))})]}):null]})}function t2e({activeItems:e,archivedItems:t,activeCounts:n,archivedCount:r,variant:i=`full`,pending:a=!1,className:o}){let s=s9(e),c=i===`compact`;return(0,H.jsx)(`div`,{"data-testid":`readonly-kanban`,"aria-busy":a,className:tE(`@container min-w-0 max-w-full overflow-x-clip`,c&&`@[32rem]:h-[32rem] @[64rem]:h-72 h-[46rem]`,o),children:(0,H.jsx)(`div`,{"data-testid":`readonly-kanban-grid`,className:tE(`@[32rem]:grid-cols-2 @[64rem]:grid-cols-4 grid w-full min-w-0 max-w-full grid-cols-1 gap-3 overflow-x-clip`,c&&`@[32rem]:grid-rows-2 @[64rem]:grid-rows-1 h-full min-h-0 grid-rows-4`),children:K0e.map(e=>{let i=e.id===`archived`?t:s[e.id],o=e.id===`archived`?r:n[e.id];return(0,H.jsx)(G0e,{laneId:e.id,density:c?`compact`:`full`,header:(0,H.jsxs)(`div`,{className:`flex h-full min-w-0 items-center justify-between gap-2 px-1`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`span`,{className:tE(`h-2 w-2 shrink-0 rounded-full`,e.accentClass)}),(0,H.jsx)(`h3`,{className:`truncate text-xs font-semibold`,children:c?e.shortLabel:e.label})]}),a?(0,H.jsx)(aL,{className:`h-5 w-8 rounded-full`}):(0,H.jsx)(iE,{count:o,tone:`muted`,size:`xs`,shape:`pill`})]}),children:a?(0,H.jsx)(`div`,{className:`space-y-2`,"aria-hidden":`true`,children:Array.from({length:3},(e,t)=>(0,H.jsxs)(`div`,{className:`border-border/70 bg-card space-y-2 rounded-md border px-2.5 py-2`,children:[(0,H.jsx)(aL,{className:`h-3 w-3/4`}),(0,H.jsx)(aL,{className:`h-2.5 w-1/2`})]},t))}):(0,H.jsxs)(a9.div,{layout:!0,className:`space-y-2`,"data-lane":e.id,children:[(0,H.jsx)(s1e,{initial:!1,mode:`popLayout`,children:i.map(t=>(0,H.jsx)(a9.div,{layout:!0,layoutId:`readonly-kanban:${t.id}`,initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,scale:.98},transition:{duration:.16},children:(0,H.jsx)(n2e,{item:t,laneId:e.id})},`${e.id}:${t.id}`))}),i.length===0&&o===0?(0,H.jsx)(`div`,{className:`border-border/60 text-muted-foreground flex h-16 items-center justify-center rounded-md border border-dashed`,children:e.id===`no-tasks`?(0,H.jsx)(_c,{className:`h-4 w-4`,"aria-label":`No entries`}):(0,H.jsx)(Lc,{className:`h-4 w-4`,"aria-label":`No entries`})}):null]})},e.id)})})})}function n2e({item:e,laneId:t}){let n=t===`archived`,r={family:n?`archive`:`changes`,entityId:e.id};return(0,H.jsx)(Nb,{to:n?`/archive/$changeId`:`/changes/$changeId`,params:{changeId:e.id},state:t=>({...t,__vtHandoff:{...r,title:e.name,subtitle:e.id}}),vt:{sharedElements:r},...rb(r,`container`),className:`border-border/70 bg-card hover:bg-muted/50 block min-w-0 rounded-md border px-2.5 py-2`,children:(0,H.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[n?(0,H.jsx)(Ws,{className:`text-muted-foreground mt-0.5 h-3.5 w-3.5 shrink-0`}):null,(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`div`,{...rb(r,`title`),className:`truncate text-xs font-medium`,children:e.name}),(0,H.jsx)(`div`,{className:`text-muted-foreground truncate text-[11px]`,children:n?hL(Y0e(e)):e.updatedAt>0?mL(e.updatedAt):e.id})]})]})})}var r2e=`action`,i2e=`change`,a2e=`artifact`;function o2e(e){let t=new URLSearchParams;return t.set(r2e,e.action),t.set(i2e,e.changeId),e.artifactId&&t.set(a2e,e.artifactId),`/opsx-compose?${t.toString()}`}var s2e={state:`loading`,data:null,attempt:null,error:null,observedAt:0};function c2e(e){return!e||e.state===`loading`?null:e.state===`error`?e.data??e.attempt:e.data}function l2e(e){let t=Error(e.message);return t.name=e.name,t}function u2e(e,t){g_(e).with({state:`loading`},()=>{t.onConnectionStateChange({state:`pending`,error:null})}).with({state:`ready`},({data:e})=>t.onData(e)).with({state:`revalidating`},({data:e})=>t.onStaleData(e)).with({state:`error`},({error:e})=>t.onError(l2e(e))).with({state:`refresh-error`},({data:e,error:n})=>t.onStaleData(e,l2e(n))).exhaustive()}function d2e(e){let t=!1,n=0,r=!1,i=async()=>{let r=++n;try{let i=await Cy.rootContext.readProjection.query();if(t||r!==n)return;let a=pf.safeParse(i);if(!a.success){e.onError(Error(`Malformed Root Context projection: ${a.error.message}`));return}u2e(a.data,e)}catch(i){if(t||r!==n)return;e.onError(i instanceof Error?i:Error(String(i)))}},a=Cy.rootContext.subscribeProjection.subscribe(void 0,{onData(t){let n=tf.safeParse(t);if(!n.success){e.onError(Error(`Malformed Root Context notice: ${n.error.message}`));return}r=!0,e.onConnectionStateChange({state:`pending`,error:null}),i()},onError:e.onError,onConnectionStateChange:t=>e.onConnectionStateChange({state:t.state,error:t.error}),onStopped:e.onStopped,onComplete:e.onComplete});return r||i(),{unsubscribe(){t=!0,n+=1,a.unsubscribe()}}}function l9(){return Ly(d2e,async()=>s2e,[],`root-context.projection`)}function f2e(e,t,n){if(n){e.add(`${t} exit: ${n.exitCode??`unavailable`}`),n.contractError&&e.add(`${t} contract: ${n.contractError}`),n.stderr.trim()&&e.add(`${t} stderr: ${n.stderr.trim()}`);for(let r of n.diagnostics)e.add(`${t} ${r.code}: ${r.message}`)}}function p2e(e){let t=new Set,n=e.attempt;n.planningRoot&&t.add(`Attempted root: ${n.planningRoot.path} (${n.planningRoot.source}${n.storeId?`, Store ${n.storeId}`:``})`);for(let[e,r]of Object.entries(n.diagnostics))for(let n of r)t.add(`${e} ${n.code}: ${n.message}`);return f2e(t,`Doctor`,n.evidence.doctor),f2e(t,`Context`,n.evidence.context),[...t]}function m2e(e){if(e.staticMode)return{status:`ready`,disabled:!1,context:null,observedAt:0,title:null,message:null,evidence:[]};if(e.transportError)return{status:`blocked`,disabled:!0,context:null,observedAt:0,title:`Root Context transport failed`,message:e.transportError.message,evidence:[]};let t=e.projection;return!t||t.state===`loading`||e.isLoading||e.authorityState!==`current`?{status:`checking`,disabled:!0,context:null,observedAt:t?.observedAt??0,title:`Resolving planning root`,message:`Root-dependent actions remain locked until OpenSpec resolves the planning root.`,evidence:[]}:t.state===`refreshing`?{status:`checking`,disabled:!0,context:t.data,observedAt:t.observedAt,title:`Refreshing planning root`,message:`Root-dependent actions remain locked while OpenSpec refreshes root selection.`,evidence:[]}:t.state===`error`?{status:`blocked`,disabled:!0,context:t.data,observedAt:t.observedAt,title:`Planning root unavailable (${t.error.code})`,message:t.error.message,evidence:p2e(t)}:{status:`ready`,disabled:!1,context:t.data,observedAt:t.observedAt,title:null,message:null,evidence:[]}}function u9(){let e=l9();return m2e({projection:e.data,isLoading:e.isLoading,transportError:e.error,staticMode:Lf(),authorityState:e.authority.state})}function h2e({applyCurrent:e=!0,archiveCurrent:t=!0}={}){let n=u9(),r=(0,V.useRef)({rootAction:n,applyCurrent:e,archiveCurrent:t});r.current={rootAction:n,applyCurrent:e,archiveCurrent:t};let{openArchiveModal:i}=QSe(),a=(0,V.useCallback)(e=>{let t=r.current;return t.rootAction.status!==`ready`||!t.applyCurrent?!1:(Ib.activatePop(o2e({action:`apply`,changeId:e.changeId})),!0)},[]),o=(0,V.useCallback)(e=>{let t=r.current;return t.rootAction.status!==`ready`||!t.archiveCurrent?!1:(i(e.changeId,e.changeName),!0)},[i]);return{rootAction:n,disabled:n.disabled,launchApply:a,launchArchive:o}}var g2e=[{value:`7d`,label:`Last 7 days`},{value:`30d`,label:`Last 30 days`},{value:`90d`,label:`Last 90 days`},{value:`all`,label:`All time`}];function _2e(){let e=Lf(),t=joe(),n=Ky(),r=Zy(!e),[i,a]=(0,V.useState)(`30d`),o=t.data??[],s=(0,V.useMemo)(()=>J0e(n.data??[],i),[n.data,i]),c=t.data!==void 0&&!t.isLoading&&!t.isUpdating&&t.error===null,l=n.data!==void 0&&!n.isLoading&&!n.isUpdating&&n.error===null,u=r.data!==void 0&&r.authority.state===`current`,{rootAction:d,launchApply:f,launchArchive:p}=h2e({applyCurrent:c&&u,archiveCurrent:c}),m=(0,H.jsxs)(`div`,{className:`flex min-w-0 shrink-0 flex-wrap items-center justify-between gap-3`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(ml,{className:`h-6 w-6 shrink-0`}),`Kanban`]}),e?(0,H.jsx)(e8,{value:i,options:g2e,onValueChange:a,ariaLabel:`Archived time range`,className:`h-8`}):null]});if(e){let e=t.error??n.error,r=t.isLoading&&t.data===void 0||n.isLoading&&n.data===void 0;return(0,H.jsxs)(`div`,{className:`min-w-0 space-y-4 p-4`,children:[m,e?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{children:e.message})]}):null,r?(0,H.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,"aria-busy":`true`,children:Array.from({length:4},(e,t)=>(0,H.jsx)(lL,{count:2},t))}):(0,H.jsx)(t2e,{activeItems:o,archivedItems:s,activeCounts:q0e(o),archivedCount:s.length})]})}return(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col gap-4 overflow-hidden p-4`,children:[m,(0,H.jsx)(Z0e,{activeItems:o,archivedItems:s,statuses:r.data??[],range:i,onRangeChange:a,activeState:{initialLoading:t.isLoading&&t.data===void 0,updating:t.isUpdating,current:c,error:t.error,rowErrors:t.rowErrors,progress:t.progress},archiveState:{initialLoading:n.isLoading&&n.data===void 0,updating:n.isUpdating,current:l,error:n.error},rootReady:d.status===`ready`,rootBlockedReason:d.message,applyStatusCurrent:u,applyStatusError:r.error,onApply:e=>f({changeId:e.id,changeName:e.name}),onArchive:e=>p({changeId:e.id,changeName:e.name})})]})}function v2e({changeId:e,name:t,subtitle:n,phase:r,updatedAt:i,formatTime:a,sharedFamily:o=`changes`,className:s=``,containerProps:c,titleProps:l,iconProps:u}){let d={family:o,entityId:e};return(0,H.jsxs)(`div`,{...c,...rb(d,`container`),className:`grid grid-cols-[auto_minmax(0,1fr)_auto] items-stretch gap-x-3 ${s}`,children:[(0,H.jsx)(`div`,{className:`flex items-center`,children:(0,H.jsx)(Dc,{...u,...rb(d,`icon`),className:`text-muted-foreground h-5 w-5 shrink-0`})}),(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col justify-center gap-0.5 py-0.5`,children:[(0,H.jsx)(`div`,{...l,...rb(d,`title`),className:`truncate font-medium`,children:t}),(0,H.jsx)(`div`,{className:`text-muted-foreground truncate text-xs`,children:n})]}),(0,H.jsxs)(`div`,{className:`flex flex-col items-end justify-between gap-1 text-right`,children:[(0,H.jsx)(`div`,{className:`flex flex-1 items-center`,children:(0,H.jsx)(rE,{tone:`custom`,size:`sm`,shape:`box`,className:`border ${r.toneClass}`,children:r.label})}),i>0?(0,H.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:a(i)}):null]})]})}function y2e(){return(0,H.jsx)(ec,{className:`text-muted-foreground h-4 w-4 shrink-0`,"aria-hidden":!0})}function b2e(e){return e.hasStatus?e.trackedArtifactStatus===`blocked`?{label:`Draft`,toneClass:`border-amber-500/40 text-amber-700 dark:text-amber-300`}:e.isPlanningComplete?{label:`Planning Complete`,toneClass:`border-sky-500/40 text-sky-700 dark:text-sky-300`}:{label:`Planning`,toneClass:`border-border text-muted-foreground`}:{label:`Unknown`,toneClass:`border-border text-muted-foreground`}}function d9(e){return e.includes(`blocked`)?`blocked`:e.includes(`ready`)?`ready`:e.includes(`done`)?`done`:e.includes(`skipped`)?`skipped`:null}function x2e(e,t){return e.length===t.length&&e.every((e,n)=>e.id===t[n]?.id)}function S2e(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function C2e(e,t){return!!(t&&!S2e()&&typeof e.startViewTransition==`function`&&!e.activeViewTransition)}function w2e(e){if(typeof document>`u`){e.update();return}let t=e.container,n=document;if(!C2e(n,t)){e.update();return}t.style.viewTransitionName=e.transitionName;try{n.startViewTransition(()=>(0,es.flushSync)(e.update)).finished.catch(()=>{}).finally(()=>{t.style.viewTransitionName===e.transitionName&&(t.style.viewTransitionName=``)})}catch{t.style.viewTransitionName=``,e.update()}}function T2e(e,t){let[n,r]=(0,V.useState)(e),i=(0,V.useRef)(!1),a=(0,V.useRef)(e),o=(0,V.useRef)(0),s=`vt-change-list-${(0,V.useId)().replace(/[^a-zA-Z0-9_-]/g,``)}`;return(0,V.useEffect)(()=>{if(!i.current){i.current=!0,a.current=e,r(e);return}let n=a.current;a.current=e;let c=o.current+1;if(o.current=c,e===void 0||n===void 0||x2e(n,e)){r(e);return}queueMicrotask(()=>{o.current===c&&w2e({container:t.current,transitionName:s,update:()=>{o.current===c&&r(e)}})})},[t,e,s]),n}function E2e(e){return new Map((e??[]).map(e=>[e.changeName,e]))}function D2e(){let{data:e,isLoading:t,isUpdating:n,error:r,rowErrors:i=[],progress:a=null}=joe(),o=(0,V.useRef)(null),{data:s,isLoading:c,error:l}=Zy((e?.length??0)>0),u=T2e(e,o),d=E2e(s),f=e?.length===0&&!r&&!n,p=(e?.length??0)>0||f;return t&&!e&&!r?(0,H.jsxs)(`div`,{className:`space-y-6 p-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(Dc,{className:`h-6 w-6 shrink-0`}),`Changes`]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>Ib.activatePop(`/opsx-new`),className:`bg-primary text-primary-foreground inline-flex items-center gap-2 rounded-md px-4 py-2 text-sm font-medium hover:opacity-90`,title:`Create a new OPSX change`,children:[(0,H.jsx)($c,{className:`h-4 w-4`}),`New`]})]}),a&&!r?(0,H.jsx)(USe,{progress:a,className:`max-w-sm`}):null,(0,H.jsx)(lL,{count:5})]}):(0,H.jsxs)(`div`,{className:`space-y-6 p-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(Dc,{className:`h-6 w-6 shrink-0`}),`Changes`]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>Ib.activatePop(`/opsx-new`),className:`bg-primary text-primary-foreground inline-flex items-center gap-2 rounded-md px-4 py-2 text-sm font-medium hover:opacity-90`,title:`Create a new OPSX change`,children:[(0,H.jsx)($c,{className:`h-4 w-4`}),`New`]})]}),(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Active OPSX changes in the current writable Planning root. Completed changes are moved to`,` `,(0,H.jsx)(Nb,{to:`/archive`,className:`text-primary hover:underline`,children:`Archive`}),`.`]}),r?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-center gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,H.jsx)(tc,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`break-words`,children:r.message})]}):null,i.length>0?(0,H.jsx)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive rounded-md border px-3 py-2 text-sm`,children:i.map(e=>(0,H.jsxs)(`div`,{className:`break-words`,children:[e.changeId,`: `,e.message]},e.changeId))}):null,a&&!r?(0,H.jsxs)(`div`,{className:`text-muted-foreground text-sm`,"data-change-progress":!0,children:[`Loaded `,a.completed,`/`,a.total===`unknown`?`unknown`:a.total,` `,`changes`]}):null,l?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-center gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,H.jsx)(tc,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`break-words`,children:l.message})]}):null,p?(0,H.jsx)(iL,{active:n&&!!e,children:(0,H.jsxs)(`div`,{ref:o,"data-change-list-continuity":!0,className:`border-border divide-border divide-y rounded-lg border`,children:[u?.map(e=>{let t=d.get(e.id),n=t?.artifacts.filter(e=>e.status===`done`).length??0,r=t?.artifacts.length??0,i=b2e({hasStatus:!!t,isPlanningComplete:t?.isPlanningComplete??!1,trackedArtifactStatus:d9(t?.artifacts.map(e=>e.status)??[])}),a={family:`changes`,entityId:e.id};return(0,H.jsx)(Nb,{to:`/changes/$changeId`,params:{changeId:e.id},state:t=>({...t,__vtHandoff:{family:`changes`,entityId:e.id,title:e.name,subtitle:e.id}}),vt:{sharedElements:a},...rb(a,`container`),className:`hover:bg-muted/50 block px-4 py-3`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,H.jsx)(v2e,{changeId:e.id,name:e.name,phase:i,updatedAt:e.updatedAt,formatTime:mL,className:`min-w-0 flex-1`,titleProps:{...e.id===e.name?null:{}},subtitle:!l&&t?(0,H.jsxs)(`span`,{children:[n,`/`,r,` artifacts · `,t.schemaName]}):!l&&s===void 0&&c?(0,H.jsx)(oL,{className:`w-28`}):`Workflow status unavailable`}),(0,H.jsx)(y2e,{})]})},e.id)}),f&&(0,H.jsxs)(`div`,{className:`text-muted-foreground p-4 text-center`,children:[(0,H.jsx)(`div`,{children:`No active changes.`}),(0,H.jsx)(`div`,{className:`mt-1 text-xs`,children:`Recommended workflow start: Quick Propose`}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>Ib.activatePop(`/opsx-propose`),className:`text-primary m-2 inline-flex items-center gap-1 hover:underline`,title:`Open Quick Propose`,children:[(0,H.jsx)(pl,{className:`h-3.5 w-3.5`}),`Start Propose`]}),(0,H.jsxs)(`button`,{type:`button`,onClick:()=>Ib.activatePop(`/opsx-new`),className:`text-primary m-2 inline-flex items-center gap-1 hover:underline`,title:`Open the advanced /opsx:new form`,children:[(0,H.jsx)(pl,{className:`h-3.5 w-3.5`}),`Open advanced /opsx:new form`]})]})]})}):null]})}var O2e=V.createContext(void 0);function f9(){let e=V.useContext(O2e);if(e===void 0)throw Error(Zb(10));return e}var k2e={value:()=>null},A2e=V.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,hiddenUntilFound:a,keepMounted:o,loopFocus:s=!0,onValueChange:c,multiple:l=!1,orientation:u=`vertical`,value:d,defaultValue:f,...p}=e,m=Nde(),h=V.useMemo(()=>{if(d===void 0)return f??[]},[d,f]),g=cC(c),_=V.useRef([]),[v,y]=X3({controlled:d,default:h,name:`Accordion`,state:`value`}),b=cC((e,t)=>{let n=nC(qS);if(!l){let t=v[0]===e?[]:[e];if(g(t,n),n.isCanceled)return;y(t)}else if(t){let t=v.slice();if(t.push(e),g(t,n),n.isCanceled)return;y(t)}else{let t=v.filter(t=>t!==e);if(g(t,n),n.isCanceled)return;y(t)}}),x=V.useMemo(()=>({value:v,disabled:i,orientation:u}),[v,i,u]),S=V.useMemo(()=>({accordionItemRefs:_,direction:m,disabled:i,handleValueChange:b,hiddenUntilFound:a??!1,keepMounted:o??!1,loopFocus:s,orientation:u,state:x,value:v}),[m,i,b,a,o,s,u,x,v]),C=HC(`div`,e,{state:x,ref:t,props:[{dir:m,role:`region`},p],stateAttributesMapping:k2e});return(0,H.jsx)(O2e.Provider,{value:S,children:(0,H.jsx)(T6,{elementsRef:_,children:C})})});function j2e(e){let{open:t,defaultOpen:n,onOpenChange:r,disabled:i}=e,a=t!==void 0,[o,s]=X3({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:c,setMounted:l,transitionStatus:u}=Ww(o,!0,!0),[d,f]=V.useState(o),[{height:p,width:m},h]=V.useState({height:void 0,width:void 0}),g=dT(),[_,v]=V.useState(),y=_??g,[b,x]=V.useState(!1),[S,C]=V.useState(!1),w=V.useRef(null),T=V.useRef(null),E=V.useRef(null),D=V.useRef(null),O=qw(D,!1),k=cC(e=>{let t=!o,n=nC(JS,e.nativeEvent);if(r(t,n),n.isCanceled)return;let i=D.current;T.current===`css-animation`&&i!=null&&i.style.removeProperty(`animation-name`),!b&&!S&&(T.current!=null&&T.current!==`css-animation`&&!c&&t&&l(!0),T.current===`css-animation`&&(!d&&t&&f(!0),!c&&t&&l(!0))),s(t),T.current===`none`&&c&&!t&&l(!1)});return Xb(()=>{a&&T.current===`none`&&!S&&!o&&l(!1)},[a,S,o,t,l]),V.useMemo(()=>({abortControllerRef:w,animationTypeRef:T,disabled:i,handleTrigger:k,height:p,mounted:c,open:o,panelId:y,panelRef:D,runOnceAnimationsFinish:O,setDimensions:h,setHiddenUntilFound:x,setKeepMounted:C,setMounted:l,setOpen:s,setPanelIdState:v,setVisible:f,transitionDimensionRef:E,transitionStatus:u,visible:d,width:m}),[w,T,i,k,p,c,o,y,D,O,h,x,C,l,s,f,E,u,d,m])}var M2e=V.createContext(void 0);function N2e(){let e=V.useContext(M2e);if(e===void 0)throw Error(Zb(15));return e}var P2e=V.createContext(void 0);function p9(){let e=V.useContext(P2e);if(e===void 0)throw Error(Zb(9));return e}var m9=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=Gw.startingStyle]=`startingStyle`,e[e.endingStyle=Gw.endingStyle]=`endingStyle`,e}({}),F2e=function(e){return e.panelOpen=`data-panel-open`,e}({}),I2e={[m9.open]:``},L2e={[m9.closed]:``},R2e={open(e){return e?{[F2e.panelOpen]:``}:null}},z2e={open(e){return e?I2e:L2e}},B2e=function(e){return e.index=`data-index`,e.disabled=`data-disabled`,e.open=`data-open`,e}({}),h9={...z2e,index:e=>Number.isInteger(e)?{[B2e.index]:String(e)}:null,...Kw,value:()=>null},V2e=V.forwardRef(function(e,t){let{className:n,disabled:r=!1,onOpenChange:i,render:a,value:o,...s}=e,{ref:c,index:l}=J6(),u=rC(t,c),{disabled:d,handleValueChange:f,state:p,value:m}=f9(),h=dT(),g=o??h,_=r||d,v=V.useMemo(()=>{if(!m)return!1;for(let e=0;e<m.length;e+=1)if(m[e]===g)return!0;return!1},[m,g]),y=cC((e,t)=>{i?.(e,t),!t.isCanceled&&f(g,e)}),b=j2e({open:v,onOpenChange:y,disabled:_}),x=V.useMemo(()=>({open:b.open,disabled:b.disabled,hidden:!b.mounted,transitionStatus:b.transitionStatus}),[b.open,b.disabled,b.mounted,b.transitionStatus]),S=V.useMemo(()=>({...b,onOpenChange:y,state:x}),[b,x,y]),C=V.useMemo(()=>({...p,index:l,disabled:_,open:v}),[_,l,v,p]),[w,T]=V.useState(dT()),E=V.useMemo(()=>({open:v,state:C,setTriggerId:T,triggerId:w}),[v,C,T,w]),D=HC(`div`,e,{state:C,ref:u,props:s,stateAttributesMapping:h9});return(0,H.jsx)(M2e.Provider,{value:S,children:(0,H.jsx)(P2e.Provider,{value:E,children:D})})}),H2e=V.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=p9();return HC(`h3`,e,{state:a,ref:t,props:i,stateAttributesMapping:h9})});function U2e(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var W2e=new Set([I6,F6,R6,L6,z6,`End`]);function G2e(e){let{current:t}=e,n=[];for(let e=0;e<t.length;e+=1){let r=t[e];if(!U2e(r)){let e=r?.querySelector(`[type="button"], [role="button"]`);e&&!U2e(e)&&n.push(e)}}return n}var K2e=V.forwardRef(function(e,t){let{disabled:n,className:r,id:i,render:a,nativeButton:o=!0,...s}=e,{panelId:c,open:l,handleTrigger:u,disabled:d}=N2e(),{getButtonProps:f,buttonRef:p}=g6({disabled:n??d,focusableWhenDisabled:!0,native:o,composite:!0}),{accordionItemRefs:m,direction:h,loopFocus:g,orientation:_}=f9(),v=h===`rtl`,y=_===`horizontal`,{state:b,setTriggerId:x,triggerId:S}=p9();Xb(()=>(i&&x(i),()=>{x(void 0)}),[i,x]);let C=V.useMemo(()=>({"aria-controls":l?c:void 0,"aria-expanded":l,id:S,tabIndex:0,onClick:u,onKeyDown(e){if(!W2e.has(e.key))return;Hx(e);let t=G2e(m),n=t.length-1,r=-1,i=t.indexOf(e.target);function a(){r=g?i+1>n?0:i+1:Math.min(i+1,n)}function o(){r=g&&i===0?n:i-1}switch(e.key){case I6:y||a();break;case F6:y||o();break;case R6:y&&(v?o():a());break;case L6:y&&(v?a():o());break;case`Home`:r=0;break;case`End`:r=n;break;default:break}r>-1&&t[r].focus()}}),[m,u,S,y,v,g,l,c]);return HC(`button`,e,{state:b,ref:[t,p],props:[C,s,f],stateAttributesMapping:R2e})}),q2e=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e}({});function J2e(e){let{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:i,hiddenUntilFound:a,keepMounted:o,id:s,mounted:c,onOpenChange:l,open:u,panelRef:d,runOnceAnimationsFinish:f,setDimensions:p,setMounted:m,setOpen:h,setVisible:g,transitionDimensionRef:_,visible:v,width:y}=e,b=V.useRef(!1),x=V.useRef(null),S=V.useRef(u),C=V.useRef(u),w=fC(),T=V.useMemo(()=>n.current===`css-animation`?!v:!u&&!c,[u,c,v,n]),E=rC(r,d,cC(e=>{if(!e)return;if(n.current==null||_.current==null){let t=getComputedStyle(e),r=t.animationName!==`none`&&t.animationName!==``,i=t.transitionDuration!==`0s`&&t.transitionDuration!==``;r&&i||(t.animationName===`none`&&t.transitionDuration!==`0s`?n.current=`css-transition`:t.animationName!==`none`&&t.transitionDuration===`0s`?n.current=`css-animation`:n.current=`none`),e.getAttribute(q2e.orientation)===`horizontal`||t.transitionProperty.indexOf(`width`)>-1?_.current=`width`:_.current=`height`}if(n.current!==`css-transition`)return;(i===void 0||y===void 0)&&(p({height:e.scrollHeight,width:e.scrollWidth}),C.current&&e.style.setProperty(`transition-duration`,`0s`));let t=-1,r=-1;return t=dC.request(()=>{C.current=!1,r=dC.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})}),()=>{dC.cancel(t),dC.cancel(r)}}));return Xb(()=>{if(n.current!==`css-transition`)return;let e=d.current;if(!e)return;let r=-1;if(t.current!=null&&(t.current.abort(),t.current=null),u){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)}),!C.current&&!o&&e.setAttribute(m9.startingStyle,``),p({height:e.scrollHeight,width:e.scrollWidth}),r=dC.request(()=>{Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})})}else{if(e.scrollHeight===0&&e.scrollWidth===0)return;p({height:e.scrollHeight,width:e.scrollWidth});let n=new AbortController;t.current=n;let r=n.signal,i=null,a=m9.endingStyle;return i=new MutationObserver(o=>{o.some(e=>e.type===`attributes`&&e.attributeName===a)&&(i?.disconnect(),i=null,f(()=>{p({height:0,width:0}),e.style.removeProperty(`content-visibility`),m(!1),t.current===n&&(t.current=null)},r))}),i.observe(e,{attributes:!0,attributeFilter:[a]}),()=>{i?.disconnect(),w.cancel(),t.current===n&&(n.abort(),t.current=null)}}return()=>{dC.cancel(r)}},[t,n,w,a,o,c,u,d,f,p,m]),Xb(()=>{if(n.current!==`css-animation`)return;let e=d.current;e&&(x.current=e.style.animationName||x.current,e.style.setProperty(`animation-name`,`none`),p({height:e.scrollHeight,width:e.scrollWidth}),!S.current&&!b.current&&e.style.removeProperty(`animation-name`),u?(t.current!=null&&(t.current.abort(),t.current=null),m(!0),g(!0)):(t.current=new AbortController,f(()=>{m(!1),g(!1),t.current=null},t.current.signal)))},[t,n,u,d,f,p,m,g,v]),ex(()=>{let e=dC.request(()=>{S.current=!1});return()=>dC.cancel(e)}),Xb(()=>{if(!a)return;let e=d.current;if(!e)return;let t=-1,n=-1;return u&&b.current&&(e.style.transitionDuration=`0s`,p({height:e.scrollHeight,width:e.scrollWidth}),t=dC.request(()=>{b.current=!1,n=dC.request(()=>{setTimeout(()=>{e.style.removeProperty(`transition-duration`)})})})),()=>{dC.cancel(t),dC.cancel(n)}},[a,u,d,p]),Xb(()=>{let e=d.current;e&&a&&T&&(e.setAttribute(`hidden`,`until-found`),n.current===`css-transition`&&e.setAttribute(m9.startingStyle,``))},[a,T,n,d]),V.useEffect(function(){let e=d.current;if(!e)return;function t(e){b.current=!0,h(!0),l(!0,nC(qS,e))}return e.addEventListener(`beforematch`,t),()=>{e.removeEventListener(`beforematch`,t)}},[l,d,h]),V.useMemo(()=>({props:{hidden:T,id:s,ref:E}}),[T,s,E])}var Y2e=function(e){return e.accordionPanelHeight=`--accordion-panel-height`,e.accordionPanelWidth=`--accordion-panel-width`,e}({}),X2e=V.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,id:a,render:o,...s}=e,{hiddenUntilFound:c,keepMounted:l}=f9(),{abortControllerRef:u,animationTypeRef:d,height:f,mounted:p,onOpenChange:m,open:h,panelId:g,panelRef:_,runOnceAnimationsFinish:v,setDimensions:y,setHiddenUntilFound:b,setKeepMounted:x,setMounted:S,setOpen:C,setVisible:w,transitionDimensionRef:T,visible:E,width:D,setPanelIdState:O,transitionStatus:k}=N2e(),A=r??c,j=i??l;Xb(()=>{if(a)return O(a),()=>{O(void 0)}},[a,O]),Xb(()=>{b(A)},[b,A]),Xb(()=>{x(j)},[x,j]),Jw({open:h&&k===`idle`,ref:_,onComplete(){h&&y({width:void 0,height:void 0})}});let{props:M}=J2e({abortControllerRef:u,animationTypeRef:d,externalRef:t,height:f,hiddenUntilFound:A,id:a??g,keepMounted:j,mounted:p,onOpenChange:m,open:h,panelRef:_,runOnceAnimationsFinish:v,setDimensions:y,setMounted:S,setOpen:C,setVisible:w,transitionDimensionRef:T,visible:E,width:D}),{state:N,triggerId:P}=p9(),F=HC(`div`,e,{state:V.useMemo(()=>({...N,transitionStatus:k}),[N,k]),ref:[t,_],props:[M,{"aria-labelledby":P,role:`region`,style:{[Y2e.accordionPanelHeight]:f===void 0?`auto`:`${f}px`,[Y2e.accordionPanelWidth]:D===void 0?`auto`:`${D}px`}},s],stateAttributesMapping:h9});return j||A||!j&&p?F:null});function g9({ariaLabel:e,children:t,tooltip:n,className:r,tone:i=`muted`,shape:a=`box`,...o}){return(0,H.jsx)(nE,{content:n,children:(0,H.jsx)(rE,{role:`note`,tabIndex:0,"aria-label":e,tone:i,shape:a,className:tE(`focus-visible:ring-primary cursor-help outline-none focus-visible:ring-2 focus-visible:ring-offset-2`,r),...o,children:t})})}function _9({title:e,children:t,summary:n,defaultOpen:r=!1,className:i,panelClassName:a}){return(0,H.jsx)(A2e,{defaultValue:r?[`evidence`]:[],hiddenUntilFound:!0,children:(0,H.jsxs)(V2e,{value:`evidence`,className:tE(`border-border/70 rounded-md border`,i),children:[(0,H.jsx)(H2e,{className:`m-0`,children:(0,H.jsxs)(K2e,{className:tE(`hover:bg-muted/60 focus-visible:ring-primary flex min-h-9 w-full min-w-0 items-center gap-2 rounded-md px-3 py-2 text-left text-xs outline-none focus-visible:ring-2 focus-visible:ring-inset`,`group/disclosure`),children:[(0,H.jsx)(`span`,{className:`min-w-0 flex-1 font-medium`,children:e}),n?(0,H.jsx)(`span`,{className:`text-muted-foreground min-w-0 truncate text-[11px]`,children:n}):null,(0,H.jsx)(ec,{className:`text-muted-foreground h-3.5 w-3.5 shrink-0 transition-transform duration-200 group-data-[panel-open]/disclosure:rotate-90 motion-reduce:transition-none`,"aria-hidden":!0})]})}),(0,H.jsx)(X2e,{className:tE(`h-(--accordion-panel-height) overflow-hidden transition-[height] duration-200 ease-out data-[ending-style]:h-0 data-[starting-style]:h-0 motion-reduce:transition-none`,a),children:(0,H.jsx)(`div`,{className:`border-border/60 border-t px-3 py-3 text-xs`,children:t})})]})})}function Z2e({applyInstructionProgress:e}){let{complete:t,total:n,remaining:r}=e;return(0,H.jsxs)(g9,{ariaLabel:`Apply instructions progress ${t} of ${n}`,tooltip:`Progress reported by openspec instructions apply — ${t} of ${n} tasks applied, ${r} remaining.`,children:[`Apply `,t,`/`,n]})}function Q2e({applyInstructionProgress:e}){let t=e.divergence;return t?(0,H.jsxs)(`div`,{role:`status`,"aria-label":`Task progress source divergence`,className:`flex min-w-0 items-start gap-2 border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-950 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-100`,children:[(0,H.jsx)(vl,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":`true`}),(0,H.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,H.jsx)(`div`,{className:`font-medium`,children:`Upstream task progress divergence`}),(0,H.jsx)(`p`,{children:t.message}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,H.jsxs)(g9,{ariaLabel:`Apply instructions progress ${e.complete} of ${e.total}`,tooltip:`Progress reported by openspec instructions apply.`,children:[`Apply `,e.complete,`/`,e.total]}),(0,H.jsxs)(g9,{ariaLabel:`Tracked artifact glob progress ${t.tracked.completed} of ${t.tracked.total}`,tooltip:`Progress computed from the workflow's tracked task artifact glob.`,children:[`Tracked `,t.tracked.completed,`/`,t.tracked.total]})]})]})]}):null}var $2e=[`1.8`,`1.9`];function e4e(e){if(!r4e(e))return{schemasRootSelector:!1,archivedValidation:!1};let t=v9(e,`1.9`);return{schemasRootSelector:t,archivedValidation:t}}function t4e(e){if(!e)return null;let t=e.match(/(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?/);return t?{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3]),prerelease:t[4]??null}:null}function v9(e,t){let[n,r]=t.split(`.`).map(e=>Number(e));return e.major===n&&e.minor===r}function n4e(e){return e.prerelease===null}function r4e(e){return!e||!n4e(e)?!1:v9(e,`1.9`)||i4e(e)}function i4e(e){return $2e.filter(e=>e!==`1.9`).some(t=>v9(e,t))}function a4e(e){let t=k_.safeParse(e);return t.success?{report:t.data,schemaIssues:[]}:{report:null,schemaIssues:t.error.issues.map(e=>`${e.path.length>0?e.path.join(`.`):`<root>`}: ${e.message}`)}}function o4e({issues:e}){return e.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No CLI issue reported.`}):(0,H.jsx)(`ul`,{className:`text-muted-foreground space-y-0.5`,children:e.map((e,t)=>(0,H.jsxs)(`li`,{className:`break-words`,children:[e.level,` · `,e.path,` · `,e.message]},t))})}function y9({pending:e,label:t,onRun:n}){return(0,H.jsxs)(`button`,{type:`button`,onClick:n,disabled:e,"aria-busy":e||void 0,className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs disabled:opacity-50`,children:[e?(0,H.jsx)(Vc,{className:`h-3.5 w-3.5 animate-spin`,"aria-hidden":!0}):(0,H.jsx)(el,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),t]})}function s4e(){let[e,t]=(0,V.useState)(null),[n,r]=(0,V.useState)(null),[i,a]=(0,V.useState)(!1),o=u9().context?.cli,s=e4e(o?.available?t4e(o.version):null);if(Lf())return(0,H.jsx)(_9,{title:`Archived validation`,summary:`Unavailable in static snapshot`,children:(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`Archived-task validation is live CLI evidence and is not captured in this static snapshot.`})});if(o?.available===!0&&!s.archivedValidation)return(0,H.jsx)(_9,{title:`Archived validation`,summary:`Unavailable on this CLI line`,children:(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Archived-task validation requires the OpenSpec 1.9 line`,o.version?` (detected ${o.version.trim()})`:``,`. This session's CLI does not declare the capability, so no command is offered.`]})});let c=async()=>{a(!0),r(null),t(null);try{let e=await Cy.cli.validate.mutate({kind:`archived`}),n=Hne.safeParse(e);n.success?t({...n.data,data:n.data.data??null,payload:n.data.payload??null}):r(`The archived validation transport returned an unrecognized result shape.`)}catch(e){r(e instanceof Error?e.message:String(e))}finally{a(!1)}};if(!e&&!n)return(0,H.jsx)(_9,{title:`Archived validation`,summary:`OpenSpec 1.9 archived-task validation`,children:(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`Run the official CLI's archived-task validation and keep its typed report as evidence. OpenSpecUI never repairs or archives from here.`}),(0,H.jsx)(y9,{pending:i,label:`Validate archived tasks`,onRun:()=>void c()})]})});let l=e?a4e(e.data):{report:null,schemaIssues:[]},u=l.report;if(n||!u){let t=l.schemaIssues.length>0?l.schemaIssues.join(`; `):null;return(0,H.jsx)(_9,{title:`Archived validation`,summary:`CLI failure evidence`,children:(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsxs)(`div`,{className:`text-destructive flex items-start gap-2 break-words`,role:`alert`,children:[(0,H.jsx)(vl,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`min-w-0 break-all`,children:n??e?.contractError??t??e?.stderr.trim()??`The archived validation command failed.`})]}),(0,H.jsx)(y9,{pending:i,label:`Rerun`,onRun:()=>void c()})]})})}let d=u,f=d.summary.totals.failed;return(0,H.jsx)(_9,{title:`Archived validation`,summary:`${d.summary.totals.passed} passed · ${f} failed`,children:(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsxs)(`dl`,{className:`@[32rem]:grid-cols-[auto_minmax(0,1fr)] grid min-w-0 gap-x-3 gap-y-1`,children:[(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Root`}),(0,H.jsx)(`dd`,{className:`min-w-0 break-all font-mono`,children:d.root.path}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Exit`}),(0,H.jsx)(`dd`,{children:e?.exitCode??`unknown`}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Totals`}),(0,H.jsxs)(`dd`,{children:[d.summary.totals.passed,` passed · `,f,` failed ·`,` `,d.summary.totals.items,` archived changes`]})]}),(0,H.jsx)(`div`,{className:`space-y-2`,children:d.items.map(e=>(0,H.jsxs)(`div`,{className:`border-border/60 rounded border p-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[e.valid?(0,H.jsx)(rc,{className:`h-3.5 w-3.5 shrink-0 text-emerald-600`,"aria-hidden":!0}):(0,H.jsx)(vl,{className:`h-3.5 w-3.5 shrink-0 text-amber-600`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`min-w-0 break-all font-mono text-[11px]`,children:e.id})]}),(0,H.jsx)(`div`,{className:`mt-1`,children:(0,H.jsx)(o4e,{issues:e.issues})})]},e.id))}),(0,H.jsx)(y9,{pending:i,label:`Rerun`,onRun:()=>void c()})]})})}function c4e(e){return e.reduce((e,t)=>(e.total+=t.status.length,e.errors+=t.status.filter(e=>e.severity===`error`).length,e.warnings+=t.status.filter(e=>e.severity===`warning`).length,e),{errors:0,warnings:0,total:0})}function l4e(e){return e.flatMap(e=>{let t=e.status.filter(e=>e.severity===`error`).length;return t>0?[`${e.store_id} (${t})`]:[]})}function u4e({status:e,referenceEvidence:t,applyInstructionProgress:n,statusRefreshing:r=null,rootChecking:i=null}){let a=e.provenance,o=t.state===`unavailable`?null:t.references,s=o?c4e(o):null,c=e.artifacts.filter(e=>e.status===`done`).length,l=e.artifacts.length;return(0,H.jsxs)(`div`,{"data-change-context-summary":``,"aria-label":`Change context summary`,className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,H.jsxs)(g9,{ariaLabel:`Workflow schema ${e.schemaName}`,tooltip:`OpenSpec workflow schema: ${e.schemaName}`,children:[`Schema: `,e.schemaName]}),(0,H.jsxs)(g9,{ariaLabel:`Artifact progress ${c} of ${l}`,tooltip:`${c} completed of ${l} total artifacts.`,children:[c,`/`,l,` artifacts`]}),n?(0,H.jsx)(Z2e,{applyInstructionProgress:n}):null,a.kind===`static`?(0,H.jsx)(g9,{ariaLabel:`Static Change context has no live backend provenance`,tooltip:`CLI Change context is unavailable in this static snapshot.`,children:`Static snapshot`}):(0,H.jsx)(g9,{ariaLabel:`Change Root source ${a.root.source}${a.root.store_id?`, Store ${a.root.store_id}`:``}`,className:`max-w-full truncate`,tooltip:(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`div`,{children:[`Change root: `,a.changeRoot]}),(0,H.jsxs)(`div`,{children:[`Planning home: `,a.planningHome.root]}),(0,H.jsxs)(`div`,{children:[`Root source: `,a.root.source]}),(0,H.jsxs)(`div`,{children:[`Store: `,a.root.store_id??`none`]})]}),children:a.root.store_id?`Store ${a.root.store_id}`:a.root.source}),o&&s?(0,H.jsxs)(g9,{ariaLabel:`${t.state===`retained`?`Retained `:``}${o.length} observed References, ${s.errors} errors, ${s.warnings} warnings`,tooltip:`${t.state===`retained`?`Retained · `:``}${o.length} References · ${s.errors} errors · ${s.warnings} warnings · ${s.total} diagnostics`,tone:s.errors>0?`custom`:`muted`,className:s.errors>0?`border-destructive/40 bg-destructive/10 text-destructive`:void 0,children:[t.state===`retained`?`Retained `:``,`References `,o.length]}):(0,H.jsx)(g9,{ariaLabel:`Reference evidence unavailable`,tooltip:t.state===`unavailable`&&t.reason===`static`?`Reference evidence is not published in this static snapshot.`:`Reference evidence is unavailable until Root Context is observed.`,children:`References unavailable`}),i?(0,H.jsx)(fL,{label:i.label,message:i.message}):null,r?(0,H.jsx)(fL,{label:r.label,message:r.message}):null]})}function d4e({referenceEvidence:e}){let t=e.state===`unavailable`?[]:l4e(e.references);return t.length===0?null:(0,H.jsxs)(`div`,{className:`text-destructive flex items-start gap-2 text-xs`,role:`alert`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),(0,H.jsxs)(`span`,{children:[`Reference errors: `,t.join(`, `)]})]})}function f4e({status:e,referenceEvidence:t}){let n=e.provenance;if(n.kind===`static`){let t=e.artifacts.length;return(0,H.jsx)(`section`,{"data-change-evidence-scroll-owner":``,"aria-label":`Change Evidence`,className:`scrollbar-thin scrollbar-track-transparent flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto overflow-x-hidden overscroll-contain p-4`,children:(0,H.jsxs)(`div`,{className:`min-w-0 space-y-3 p-4 text-xs`,children:[(0,H.jsx)(`div`,{className:`border-border bg-muted/20 text-muted-foreground rounded-md border p-4 text-sm`,children:`CLI Change context and Reference evidence are unavailable in this static snapshot.`}),(0,H.jsx)(_9,{title:`Artifact outputs`,summary:`${t} ${t===1?`output`:`outputs`}`,children:(0,H.jsx)(p4e,{artifacts:e.artifacts})})]})})}let r=Object.keys(n.artifactPaths).length;return(0,H.jsx)(`section`,{"data-change-evidence-scroll-owner":``,"aria-label":`Change Evidence`,className:`scrollbar-thin scrollbar-track-transparent flex min-h-0 min-w-0 flex-1 flex-col overflow-y-auto overflow-x-hidden overscroll-contain`,children:(0,H.jsxs)(`div`,{className:`@container min-w-0 space-y-3 p-4 text-xs`,children:[(0,H.jsx)(m4e,{provenance:n}),(0,H.jsx)(_9,{title:`Artifact outputs`,summary:`${r} ${r===1?`output`:`outputs`}`,children:(0,H.jsxs)(`div`,{className:`min-w-0 space-y-3`,children:[(0,H.jsx)(h4e,{artifactPaths:n.artifactPaths}),(0,H.jsx)(b9,{label:`Allowed edit roots`,values:n.actionContext.allowedEditRoots}),(0,H.jsx)(b9,{label:`Planning artifacts`,values:n.actionContext.planningArtifacts}),(0,H.jsx)(b9,{label:`Linked context`,values:n.actionContext.linkedContext.map(e=>e.name)}),(0,H.jsx)(b9,{label:`Constraints`,values:n.actionContext.constraints}),(0,H.jsx)(b9,{label:`Next steps`,values:n.nextSteps})]})}),(0,H.jsx)(_9,{title:`References`,summary:g4e(t),children:(0,H.jsx)(_4e,{evidence:t})}),(0,H.jsx)(_9,{title:`CLI result`,summary:`${n.evidence.command} · exit ${n.evidence.exitCode??`unknown`}`,children:(0,H.jsx)(y4e,{evidence:n.evidence})})]})})}function p4e({artifacts:e}){return e.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No artifact output currently published.`}):(0,H.jsx)(`dl`,{className:`min-w-0 space-y-3`,children:e.map(e=>(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`dt`,{className:`font-medium`,children:e.id}),(0,H.jsx)(`dd`,{className:`text-muted-foreground min-w-0 break-all font-mono`,children:e.outputPath})]},e.id))})}function m4e({provenance:e}){return(0,H.jsxs)(`dl`,{className:`@[32rem]:grid-cols-[auto_minmax(0,1fr)] grid min-w-0 gap-x-3 gap-y-1`,children:[(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Change root`}),(0,H.jsx)(`dd`,{className:`min-w-0 break-all font-mono`,children:e.changeRoot}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Planning home`}),(0,H.jsx)(`dd`,{className:`min-w-0 break-all font-mono`,children:e.planningHome.root}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Root source`}),(0,H.jsxs)(`dd`,{className:`min-w-0 break-words`,children:[e.root.source,e.root.store_id?` · ${e.root.store_id}`:``]}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Action context`}),(0,H.jsxs)(`dd`,{className:`min-w-0 break-words`,children:[e.actionContext.mode,` · `,e.actionContext.sourceOfTruth]})]})}function h4e({artifactPaths:e}){return(0,H.jsx)(`dl`,{className:`min-w-0 space-y-3`,children:Object.entries(e).map(([e,t])=>(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`dt`,{className:`font-medium`,children:e}),(0,H.jsxs)(`dd`,{className:`text-muted-foreground min-w-0 break-all font-mono`,children:[t.outputPath,` `,`->`,` `,t.resolvedOutputPath]}),(0,H.jsxs)(`dd`,{className:`text-muted-foreground min-w-0 break-all`,children:[`Existing:`,` `,t.existingOutputPaths.length>0?t.existingOutputPaths.join(`, `):`none observed`]})]},e))})}function g4e(e){return e.state===`unavailable`?`Unavailable`:`${e.references.length} observed · ${e.state}`}function _4e({evidence:e}){if(e.state===`unavailable`)return(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:e.reason===`static`?`Reference evidence is not published in this static snapshot.`:`Reference evidence is unavailable until Root Context is observed.`});let t=e.references;return(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`font-medium`,children:e.state===`retained`?`Retained References`:`Observed References`}),t.length===0?(0,H.jsx)(`div`,{className:`text-muted-foreground mt-1`,children:`No reference currently observed.`}):(0,H.jsx)(`div`,{className:`mt-1 space-y-2`,children:t.map(e=>(0,H.jsx)(v4e,{reference:e},e.store_id))})]})}function v4e({reference:e}){return(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`min-w-0 break-all font-mono`,children:e.store_id}),e.status.length===0?(0,H.jsx)(`div`,{className:`text-muted-foreground`,children:`No CLI diagnostic.`}):(0,H.jsx)(`ul`,{className:`text-muted-foreground space-y-0.5`,children:e.status.map(e=>(0,H.jsxs)(`li`,{className:`break-words`,children:[e.severity,` · `,e.code,` · `,e.message]},`${e.severity}:${e.code}:${e.message}`))})]})}function y4e({evidence:e}){return(0,H.jsxs)(`div`,{className:`min-w-0 space-y-3`,children:[(0,H.jsxs)(`dl`,{className:`@[32rem]:grid-cols-[auto_minmax(0,1fr)] grid min-w-0 gap-x-3 gap-y-1`,children:[(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Command`}),(0,H.jsx)(`dd`,{className:`min-w-0 break-all font-mono`,children:e.command}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Exit`}),(0,H.jsx)(`dd`,{children:e.exitCode??`unknown`}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Selector`}),(0,H.jsx)(`dd`,{className:`min-w-0 break-all`,children:e.selector.store??`none`}),(0,H.jsx)(`dt`,{className:`text-muted-foreground`,children:`Contract`}),(0,H.jsx)(`dd`,{className:`min-w-0 break-words`,children:e.contractError??`compatible`})]}),(0,H.jsx)(_9,{title:`Raw CLI payload`,summary:`stdout · stderr · diagnostics`,children:(0,H.jsx)(`pre`,{className:`bg-muted/40 max-h-48 max-w-full overflow-auto whitespace-pre-wrap break-all rounded p-2 font-mono`,children:JSON.stringify({stdout:e.stdout,stderr:e.stderr,diagnostics:e.diagnostics,payload:e.payload},null,2)})})]})}function b9({label:e,values:t}){return(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`font-medium`,children:e}),(0,H.jsx)(`div`,{className:`text-muted-foreground min-w-0 break-all`,children:t.length>0?t.join(`, `):`none observed`})]})}function b4e({status:e,selectedArtifactId:t,actionDisabled:n=!1,actionDisabledReason:r,applyInputsAction:i,onComposeAction:a,onArchive:o,onVerify:s}){let c=e.artifacts.find(e=>e.status===`ready`),l=e.artifacts.find(e=>e.id===t),u=t8(e);return(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[[{id:`continue`,label:`Continue`,icon:Qc,artifactId:t,disabled:!t||!l||[`blocked`,`skipped`].includes(l.status),hint:t?l?l.status===`blocked`?`selected artifact is blocked`:l.status===`skipped`?`selected artifact is intentionally skipped`:void 0:`selected artifact is unavailable`:`select an artifact`},{id:`ff`,label:`Fast-forward`,icon:tl,artifactId:c?.id,disabled:!c,hint:c?void 0:`no ready artifacts`},{id:`apply`,label:`Apply`,icon:nc,disabled:!u.available,hint:u.missingArtifactIds.length>0?`missing: ${u.missingArtifactIds.join(`, `)}`:void 0},{id:`update`,label:`Update`,icon:el,disabled:!1},{id:`sync`,label:`Sync`,icon:kc,disabled:!1},{id:`archive`,label:`Archive`,icon:Ws,disabled:!1}].map(e=>{let t=e.icon,s=n?r:e.disabled?e.hint:void 0;return(0,H.jsxs)(V.Fragment,{children:[(0,H.jsx)(nE,{content:s?`${e.label}: ${s}`:e.label,children:(0,H.jsxs)(`button`,{type:`button`,disabled:n||e.disabled,onClick:()=>e.id===`archive`?o():a(e.id,e.artifactId),"aria-label":e.label,className:`border-border hover:bg-muted inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,H.jsx)(t,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`@min-[40rem]:inline hidden`,children:e.label})]})}),e.id===`apply`?i:null]},e.id)}),(0,H.jsx)(nE,{content:n&&r?`Verify: ${r}`:`Verify`,children:(0,H.jsxs)(`button`,{type:`button`,onClick:s,disabled:n,"aria-label":`Verify`,className:`border-border hover:bg-muted inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,H.jsx)(ul,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`@min-[40rem]:inline hidden`,children:`Verify`})]})})]})}function x4e({context:e,operationGuidance:t}){return!!(e||t?.length)}function S4e({context:e,operationGuidance:t}){return(0,H.jsxs)(H.Fragment,{children:[e?(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`text-muted-foreground text-xs font-medium`,children:`Project context`}),(0,H.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap text-sm`,children:e})]}):null,t?.length?(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`text-muted-foreground text-xs font-medium`,children:`Operation guidance`}),(0,H.jsx)(`ul`,{className:`mt-1 list-disc space-y-1 pl-5 text-sm`,children:t.map(e=>(0,H.jsx)(`li`,{children:e},e))})]}):null,!e&&!t?.length?(0,H.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No project context or operation guidance configured.`}):null]})}function C4e({title:e,context:t,operationGuidance:n}){let[r,i]=(0,V.useState)(!1);return x4e({title:e,context:t,operationGuidance:n})?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`button`,{type:`button`,"aria-label":e,onClick:()=>i(!0),className:`border-border hover:bg-muted inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition`,children:[(0,H.jsx)(zc,{className:`h-3.5 w-3.5`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`@min-[40rem]:inline hidden`,children:e})]}),(0,H.jsx)(El,{open:r,title:(0,H.jsx)(`span`,{className:`text-sm font-semibold`,children:e}),onClose:()=>i(!1),maxHeight:`min(80vh, 40rem)`,bodyClassName:`space-y-3`,children:(0,H.jsx)(S4e,{context:t,operationGuidance:n})})]}):null}function w4e({state:e}){return e.status===`checking`?(0,H.jsx)(fL,{label:e.title,message:e.message}):null}function x9({state:e}){return e.status===`blocked`?(0,H.jsxs)(`div`,{role:`alert`,"aria-live":`assertive`,className:`border-destructive/40 bg-destructive/10 text-destructive rounded-md border p-3 text-sm`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 font-medium`,children:[(0,H.jsx)(tc,{className:`h-4 w-4`,"aria-hidden":!0}),e.title]}),(0,H.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words`,children:e.message}),e.evidence.length>0?(0,H.jsx)(_9,{title:`Root command evidence`,summary:`${e.evidence.length} ${e.evidence.length===1?`entry`:`entries`}`,className:`border-current/20 bg-background/35 mt-2`,children:(0,H.jsx)(`ul`,{className:`space-y-1 font-mono text-xs`,children:e.evidence.map(e=>(0,H.jsx)(`li`,{className:`whitespace-pre-wrap break-all`,children:e},e))})}):null]}):null}function T4e(){let{changeId:e}=qo({from:`/changes/$changeId`}),t=ab(zs().state),n=Foe({change:e}),r=n.authority.state===`current`,{rootAction:i,launchApply:a,launchArchive:o}=h2e({applyCurrent:r}),{data:s,isLoading:c,error:l}=n,{data:u}=zoe({change:e}),{data:d}=Moe(e),f=(0,V.useCallback)((t,n)=>{if(t===`apply`){a({changeId:e,changeName:s?.changeName??e});return}let r=o2e({action:t,changeId:e,artifactId:n});Ib.activatePop(r)},[e,a,s?.changeName]),p=(0,V.useCallback)(()=>{Ib.activatePop(`/opsx-verify?change=${encodeURIComponent(e)}`)},[e]),m=(0,V.useCallback)(()=>{o({changeId:e,changeName:s?.changeName??e})},[e,o,s?.changeName]),h=(0,V.useMemo)(()=>{if(s)return s.artifacts.find(e=>e.status===`ready`)?.id??s.artifacts[0]?.id},[s]),g=l?.message.includes(`Change '${e}' not found`)||l?.message.includes(`Change "${e}" not found`),_=i.status===`blocked`?[i.message,...i.evidence].join(`
|
|
1642
|
+
`):void 0,v=i.disabled||!r,y=r?void 0:`Change status is refreshing; actions remain read-only.`,b=i.message??y,x=(0,V.useMemo)(()=>s?.provenance.kind===`static`?{state:`unavailable`,reason:`static`}:i.context?{state:i.status===`ready`?`current`:`retained`,references:i.context.references}:{state:`unavailable`,reason:`root-context`},[i.context,i.status,s?.provenance.kind]),S=(0,V.useMemo)(()=>s?[{id:`evidence`,label:`Evidence`,icon:(0,H.jsx)(vc,{className:`h-4 w-4`}),content:(0,H.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,H.jsx)(f4e,{status:s,referenceEvidence:x}),(0,H.jsx)(s4e,{})]})}]:[],[x,s]),C=x.state!==`unavailable`&&x.references.some(e=>e.status.some(e=>e.severity===`error`)),w=!!l||i.status===`blocked`||C||!!u?.applyInstructionProgress.divergence;return(0,H.jsx)(Y3,{entityId:e,sharedFamily:`changes`,backTo:`/changes`,backTitle:`Back to Changes`,icon:Dc,title:s?.changeName,subtitle:s?(0,H.jsx)(u4e,{status:s,referenceEvidence:x,applyInstructionProgress:u?.applyInstructionProgress??null,statusRefreshing:r?null:{label:`Status refreshing`,message:y??``},rootChecking:i.status===`checking`?{label:i.title,message:i.message}:null}):void 0,headerActions:s?(0,H.jsx)(b4e,{status:s,selectedArtifactId:h,actionDisabled:v,actionDisabledReason:b,applyInputsAction:(0,H.jsx)(C4e,{title:`Apply inputs`,context:u?.context,operationGuidance:u?.operationGuidance}),onComposeAction:f,onArchive:m,onVerify:p}):void 0,handoff:t,isLoading:(c||i.status===`checking`)&&!s,loadingMessage:`Loading change status...`,errorMessage:_&&!s?_:l&&!g&&!s?`Error loading change: ${l.message}`:void 0,notFoundMessage:!i.disabled&&g&&!s?`Change not found in the current project.`:!i.disabled&&!s&&!c&&!l?`Change not found.`:void 0,notFoundBackLabel:`Back to Changes`,artifacts:s?.artifacts,contentFallback:d?{id:`content`,label:`Content`,outputPath:`openspec/changes/**/*.md`,relativePath:`changes/${e}`,files:d,emptyMessage:`No Markdown files found. Open the folder view to inspect change files.`}:void 0,folder:{changeId:e},tabsQueryKey:`artifact`,initialTab:h,supplementaryTabs:S,statusRegion:s&&w?(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[l?(0,H.jsx)(`div`,{role:`alert`,"aria-live":`assertive`,className:`border-destructive/40 bg-destructive/10 text-destructive rounded-md border p-3 text-sm`,children:(0,H.jsxs)(`div`,{className:`flex items-center gap-2 font-medium`,children:[(0,H.jsx)(tc,{className:`h-4 w-4`,"aria-hidden":!0}),`Error loading change: `,l.message]})}):null,(0,H.jsx)(x9,{state:i}),(0,H.jsx)(d4e,{referenceEvidence:x}),u?(0,H.jsx)(Q2e,{applyInstructionProgress:u.applyInstructionProgress}):null]}):null})}var E4e=(0,V.createContext)(null);function D4e(){return(0,V.useContext)(E4e)}var O4e={"project-binding":{route:`/config/project`,anchor:`config-guide-project-binding`,label:`Project Binding`},"active-root":{route:`/config/root`,anchor:`config-guide-active-root`,label:`Active Root`},"agent-delivery":{route:`/config/agents`,anchor:`config-guide-agent-delivery`,label:`Agent Delivery`},"resolved-context":{route:`/config/context`,anchor:`config-guide-resolved-context`,label:`Resolved Context`}},k4e=(0,V.createContext)(null);(0,V.lazy)(async()=>({default:(await Z(()=>import(`./config-guide-presentation-C4Z-0SFk.js`),__vite__mapDeps([136,2,1]))).ConfigGuidePresentationLayer}));function A4e(){return(0,V.useContext)(k4e)}function j4e(e,t){let n=A4e()?.register,[r,i]=(0,V.useState)(null),{detail:a,status:o,title:s}=t;return(0,V.useEffect)(()=>{if(!(!n||!r))return n(e,r,{detail:a,status:o,title:s})},[a,r,n,e,o,s]),{ref:i,id:O4e[e].anchor,"data-config-guide-stage":e}}var M4e=[{id:`overview`,label:`Overview`,href:`/config`,icon:(0,H.jsx)(Fc,{className:`h-4 w-4`,"aria-hidden":!0})},{id:`project`,label:`Project Binding`,href:`/config/project`,icon:(0,H.jsx)(Ic,{className:`h-4 w-4`,"aria-hidden":!0}),liveOnly:!0},{id:`root`,label:`Active Root`,href:`/config/root`,icon:(0,H.jsx)(bc,{className:`h-4 w-4`,"aria-hidden":!0})},{id:`environment`,label:`Environment`,href:`/config/environment`,icon:(0,H.jsx)(ol,{className:`h-4 w-4`,"aria-hidden":!0}),liveOnly:!0},{id:`agents`,label:`Agents`,href:`/config/agents`,icon:(0,H.jsx)(Js,{className:`h-4 w-4`,"aria-hidden":!0}),liveOnly:!0},{id:`schemas`,label:`Schemas`,href:`/config/schemas`,icon:(0,H.jsx)(Ys,{className:`h-4 w-4`,"aria-hidden":!0})},{id:`context`,label:`Context`,href:`/config/context`,icon:(0,H.jsx)(Sl,{className:`h-4 w-4`,"aria-hidden":!0})}];function S9({children:e,current:t,header:n}){let r=Lf(),i=r?M4e.filter(e=>e.liveOnly!==!0):M4e;return(0,H.jsxs)(`div`,{"data-testid":`config-workbench`,"data-config-section":t,className:`@container/config flex min-h-full w-full min-w-0 flex-col overflow-x-clip`,children:[(0,H.jsx)(`nav`,{"aria-label":`Config sections`,"data-config-workbench-navbar":!0,className:`bg-background/95 border-border divide-border/20 sticky top-0 z-20 grid min-w-0 shrink-0 gap-0 divide-x border-b p-0 backdrop-blur ${r?`grid-cols-4`:`grid-cols-7`}`,children:i.map(e=>{let n=t===e.id;return(0,H.jsx)(nE,{content:e.label,children:(0,H.jsxs)(Nb,{to:e.href,"aria-label":e.label,"aria-current":n?`page`:void 0,className:`focus-visible:ring-primary @[64rem]:gap-2 flex min-h-10 min-w-0 items-center justify-center gap-0 px-2 text-xs font-bold outline-none transition-colors focus-visible:ring-2 ${n?`bg-primary text-primary-foreground`:`text-muted-foreground hover:bg-muted hover:text-foreground`}`,children:[e.icon,(0,H.jsx)(`span`,{"data-testid":`config-nav-label-${e.id}`,className:`config-workbench-nav-label min-w-0 truncate`,"aria-hidden":!0,children:e.label})]})},e.id)})}),(0,H.jsxs)(`div`,{className:`vt-detail-content min-w-0`,children:[(0,H.jsx)(`div`,{className:`shrink-0 px-4 pt-4`,children:n}),(0,H.jsx)(`div`,{className:`min-w-0 p-4`,children:e})]})]})}function C9({backHref:e,backLabel:t=`Config`,description:n,icon:r,title:i,trailing:a}){return(0,H.jsxs)(`header`,{className:`space-y-3`,children:[e?(0,H.jsxs)(Nb,{to:e,"aria-label":`Back to ${t}`,className:`text-muted-foreground hover:text-foreground focus-visible:ring-primary inline-flex min-h-8 items-center gap-1.5 rounded-md px-1 text-xs outline-none focus-visible:ring-2`,children:[(0,H.jsx)(Gs,{className:`h-4 w-4`,"aria-hidden":!0}),t]}):null,(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex min-w-0 items-center gap-2 text-2xl font-bold`,children:[r,(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:i})]}),(0,H.jsx)(`p`,{className:`text-muted-foreground mt-1 max-w-3xl text-sm`,children:n})]}),a?(0,H.jsx)(`div`,{className:`flex shrink-0 items-center gap-2`,children:a}):null]})]})}var N4e={ready:{label:`Ready`,tooltip:`The current Root Context can authorize root-dependent operations.`,className:`border-emerald-500/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`},refreshing:{label:`Refreshing`,tooltip:`Retained facts remain readable while root-dependent operations stay locked.`,className:`border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-300`},resolving:{label:`Resolving`,tooltip:`OpenSpec is resolving the effective Root Context.`,className:`border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-300`},blocked:{label:`Blocked`,tooltip:`The current observation cannot authorize root-dependent operations.`,className:`border-destructive/40 bg-destructive/10 text-destructive`},static:{label:`Static snapshot`,tooltip:`Published facts are read-only and carry no live mutation authority.`}};function P4e(){return(0,H.jsxs)(Nb,{to:`/config/context`,"aria-label":`Open Resolved Context`,className:`border-border hover:bg-muted focus-visible:ring-primary inline-flex h-9 shrink-0 items-center gap-2 rounded-md border px-3 text-xs font-medium outline-none focus-visible:ring-2`,children:[(0,H.jsx)(Sl,{className:`h-4 w-4`,"aria-hidden":!0}),`Context`]})}function F4e({status:e,trailing:t}){let n=N4e[e];return(0,H.jsxs)(`header`,{className:`space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,H.jsxs)(Nb,{to:`/config`,className:`text-muted-foreground hover:text-foreground focus-visible:ring-primary inline-flex min-h-8 items-center gap-1.5 rounded-md px-1 text-xs outline-none focus-visible:ring-2`,children:[(0,H.jsx)(Gs,{className:`h-4 w-4`,"aria-hidden":!0}),`Config`]}),(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[t,(0,H.jsx)(g9,{ariaLabel:`Resolved Context status ${n.label.toLowerCase()}`,tooltip:n.tooltip,tone:n.className?`custom`:`muted`,className:n.className,children:n.label})]})]}),(0,H.jsxs)(`h1`,{className:`font-nav flex min-w-0 items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(Sl,{className:`h-6 w-6 shrink-0`,"aria-hidden":!0}),`Resolved Context`]})]})}function w9(e){return e instanceof Error?e:Error(String(e))}function I4e(){let[e,t]=(0,V.useState)(null),[n,r]=(0,V.useState)(null),[i,a]=(0,V.useState)(!0),[o,s]=(0,V.useState)(!1),c=(0,V.useRef)(!1),l=(0,V.useRef)(null),u=(0,V.useCallback)(e=>{c.current&&(t(e),r(l.current),a(!1))},[]);return(0,V.useEffect)(()=>{c.current=!0;let e=!1;l.current=null;let n=Cy.agentIntegrations.subscribe.subscribe(void 0,{onData(t){e=!0,l.current=null,u(t)},onError(e){c.current&&(l.current=w9(e),r(l.current),a(!1))}});return Cy.agentIntegrations.get.query().then(n=>{!c.current||e||(t(n),r(l.current),a(!1))}).catch(t=>{!c.current||e||(r(w9(t)),a(!1))}),()=>{c.current=!1,n.unsubscribe()}},[u]),{data:e,error:n,isLoading:i,isRefreshing:o,refresh:(0,V.useCallback)(async()=>{s(!0);try{let e=await Cy.agentIntegrations.refresh.query();return u(e),e}catch(e){let t=w9(e);throw c.current&&r(t),t}finally{c.current&&s(!1)}},[u]),accept:u}}var T9=50*1024,E9=K().min(1),L4e=J(E9),R4e=hd(E9,L4e),D9=Y({guidance:L4e}).strict(),z4e=Y({apply:D9.optional(),archive:D9.optional()}).strict();function B4e(e){return new TextEncoder().encode(e).byteLength<=T9}var V4e=K().refine(B4e,`Context must not exceed ${T9} UTF-8 bytes.`);Y({schema:E9.nullable(),context:V4e.nullable(),rules:R4e.nullable(),operations:z4e.nullable()}).strict();var H4e=Y({schema:E9,context:V4e.nullable(),rules:R4e.nullable(),operations:Y({apply:D9.nullable(),archive:D9.nullable()}).strict().nullable()}).strict(),U4e=K().regex(/^sha256:[a-f0-9]{64}$/),W4e={ownerPath:K().min(1),filePath:K().min(1),revision:U4e};pd(`mode`,[Y({...W4e,mode:X(`structured`),update:H4e}).strict(),Y({...W4e,mode:X(`raw`),content:K()}).strict()]);var O9={schema:null,context:null,rules:null,operations:null};function k9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function G4e(e){return new TextEncoder().encode(e).byteLength}function K4e(e){let t=Fg(e);return t.errors.length===0?[]:[{code:`config-unparseable`,severity:`error`,path:`$`,message:t.errors.map(e=>e.message).join(`
|
|
1643
|
+
`)}]}function q4e(e,t){if(e===void 0)return null;if(!k9(e))return t.push({code:`rules-invalid`,severity:`error`,path:`rules`,message:`The rules field must be a mapping of artifact ids to string arrays.`}),null;let n={};for(let[r,i]of Object.entries(e)){if(!Array.isArray(i)||i.some(e=>typeof e!=`string`)){t.push({code:`rules-entry-invalid`,severity:`error`,path:`rules.${r}`,message:`Rules for '${r}' must be an array of strings.`});continue}let e=i.filter(e=>e.length>0);e.length<i.length&&t.push({code:`rules-entry-empty`,severity:`warning`,path:`rules.${r}`,message:`Empty rules for '${r}' are ignored by OpenSpec.`}),e.length>0&&(n[r]=e)}return Object.keys(n).length>0?n:null}function J4e(e,t){if(e===void 0)return null;if(!k9(e))return t.push({code:`operations-invalid`,severity:`error`,path:`operations`,message:`The operations field must be a mapping.`}),null;let n={};for(let r of[`apply`,`archive`]){let i=e[r];if(i===void 0)continue;if(!k9(i)){t.push({code:`operation-invalid`,severity:`error`,path:`operations.${r}`,message:`Operation '${r}' must be a mapping.`});continue}if(i.guidance===void 0)continue;if(!Array.isArray(i.guidance)||i.guidance.some(e=>typeof e!=`string`)){t.push({code:`operation-guidance-invalid`,severity:`error`,path:`operations.${r}.guidance`,message:`Guidance for '${r}' must be an array of strings.`});continue}let a=i.guidance.filter(e=>e.length>0);a.length<i.guidance.length&&t.push({code:`operation-guidance-empty`,severity:`warning`,path:`operations.${r}.guidance`,message:`Empty '${r}' guidance entries are ignored by OpenSpec.`}),a.length>0&&(n[r]={guidance:a})}return Object.keys(n).length>0?n:null}function Y4e(e){if(e===null||e.trim().length===0)return{official:{...O9},diagnostics:[{code:`schema-missing`,severity:`error`,path:`schema`,message:`The active OpenSpec config does not declare a schema.`}]};let t=Fg(e);if(t.errors.length>0)return{official:{...O9},diagnostics:K4e(e)};let n=t.toJS();if(!k9(n))return{official:{...O9},diagnostics:[{code:`config-not-mapping`,severity:`error`,path:`$`,message:`OpenSpec config must be a YAML mapping for Structured mode.`}]};let r=[],i=null;n.schema===void 0?r.push({code:`schema-missing`,severity:`error`,path:`schema`,message:`The active OpenSpec config does not declare a schema.`}):typeof n.schema!=`string`||n.schema.length===0?r.push({code:`schema-invalid`,severity:`error`,path:`schema`,message:`The schema field must be a non-empty string.`}):i=n.schema;let a=null;return n.context!==void 0&&(typeof n.context==`string`?G4e(n.context)>51200?r.push({code:`context-too-large`,severity:`error`,path:`context`,message:`The context field exceeds ${T9} UTF-8 bytes.`}):a=n.context:r.push({code:`context-invalid`,severity:`error`,path:`context`,message:`The context field must be a string.`})),{official:{schema:i,context:a,rules:q4e(n.rules,r),operations:J4e(n.operations,r)},diagnostics:r}}function A9(e){return{content:e.file.content,exists:e.file.exists,filePath:e.file.path,owner:e.owner,revision:e.revision,official:e.official,diagnostics:e.diagnostics}}function X4e(){return Wy((0,V.useCallback)(e=>Cy.planningConfig.subscribeProjectBinding.subscribe(void 0,{onData:e.onData,onError:e.onError}),[]),async()=>null,[],`planningConfig.subscribeProjectBinding`)}function j9(){return Gy((0,V.useCallback)(e=>Cy.planningConfig.subscribeActiveRoot.subscribe(void 0,{onData:t=>{if(t.type===`recompute-started`){e.onEvent(t);return}e.onEvent({type:`data`,data:A9(t.data)})},onError:e.onError}),[]),async()=>{let e=await aie(),t=Y4e(e);return{content:e,exists:e!==null,filePath:null,owner:null,revision:null,...t}},[],`planningConfig.subscribeActiveRootView`)}function Z4e(){let e=(0,V.useMemo)(()=>({read:()=>Cy.planningConfig.readEnvironmentGlobalProjection.query(),refresh:()=>Cy.planningConfig.refreshEnvironmentGlobalProjection.query(),parseState:e=>woe.parse(e),subscribe(e){return Cy.planningConfig.subscribeEnvironmentGlobalProjection.subscribe(void 0,{onData(t){let n=jd.safeParse(t);if(!n.success){e.onError(Error(`Malformed Environment Global notice: ${n.error.message}`));return}e.onNotice()},onError:e.onError,onConnectionStateChange(t){if(t.error){e.onError(t.error);return}(t.state===`connecting`||t.state===`pending`)&&e.onConnectionState(t.state)},onStopped:e.onStopped,onComplete:e.onComplete})}}),[]),t=(0,V.useMemo)(()=>({read:()=>Cy.planningConfig.readEnvironmentGlobalFileProjection.query(),refresh:()=>Cy.planningConfig.refreshEnvironmentGlobalFileProjection.query(),parseState:e=>Coe.parse(e),subscribe(e){return Cy.planningConfig.subscribeEnvironmentGlobalFileProjection.subscribe(void 0,{onData(t){let n=jd.safeParse(t);if(!n.success){e.onError(Error(`Malformed Environment Global file notice: ${n.error.message}`));return}e.onNotice()},onError:e.onError,onConnectionStateChange(t){if(t.error){e.onError(t.error);return}(t.state===`connecting`||t.state===`pending`)&&e.onConnectionState(t.state)},onStopped:e.onStopped,onComplete:e.onComplete})}}),[]),n=By({source:e,sourceKey:`environment-global-cli`,selectData:e=>e,staticLoader:async()=>null,cacheKey:`planningConfig.environmentGlobalCliProjection`}),r=By({source:t,sourceKey:`environment-global-file`,selectData:e=>e,staticLoader:async()=>null,cacheKey:`planningConfig.environmentGlobalFileProjection`}),i=n.data!==void 0&&n.data!==null&&r.data!==void 0&&r.data!==null?{...n.data,kind:`environment-global`,file:r.data.file}:void 0,a=n.error??r.error;return{data:i,isLoading:n.isLoading||r.isLoading,isUpdating:n.isUpdating||r.isUpdating,refreshPending:n.refreshPending||r.refreshPending,error:a,authority:n.authority.state===`failed`?n.authority:r.authority.state===`failed`?r.authority:n.authority.state===`current`&&r.authority.state===`current`?{state:`current`}:{state:`waiting`,reason:`pending`},refresh:async()=>{await n.refresh()}}}var Q4e={ready:`border-emerald-500/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`,attention:`border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-300`,blocked:`border-destructive/40 bg-destructive/10 text-destructive`,loading:`border-border bg-muted text-muted-foreground`,static:`border-border bg-muted text-muted-foreground`};function $4e(){let e=D4e(),t=A4e(),n=Lf();return(0,H.jsxs)(`header`,{className:`flex min-w-0 flex-wrap items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex min-w-0 items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(fl,{className:`h-6 w-6 shrink-0`,"aria-hidden":!0}),`Config`]}),(0,H.jsx)(`p`,{className:`text-muted-foreground mt-1 max-w-3xl text-sm`,children:`Configure declarations by owner, then verify the CLI-selected result through Resolved Context.`})]}),(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[e?.projection&&!e.projection.initialized?(0,H.jsxs)(`button`,{type:`button`,onClick:e.open,className:`border-border bg-background text-foreground hover:bg-muted inline-flex h-9 items-center gap-2 rounded-md border px-3 text-xs font-medium`,children:[(0,H.jsx)(xl,{className:`h-4 w-4`,"aria-hidden":!0}),`Init`]}):null,n?null:(0,H.jsxs)(`button`,{id:`config-guide-overview-action`,"data-config-guide-overview":`true`,type:`button`,disabled:!t?.canStart,onClick:t?.active?t.restart:t?.start,title:t?.canStart?`Guide Project Binding, Active Root, Agent Delivery, and Resolved Context.`:`Initialize the local OpenSpec project before starting the Guide.`,className:`border-border bg-background text-foreground hover:bg-muted inline-flex h-9 items-center gap-2 rounded-md border px-3 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-60`,children:[(0,H.jsx)(cc,{className:`h-4 w-4`,"aria-hidden":!0}),t?.active?`Restart Guide`:`Guide`]}),(0,H.jsx)(P4e,{})]})]})}function e3e({model:e}){let t=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground shrink-0`,children:e.icon}),(0,H.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-semibold`,children:e.title})]}),(0,H.jsx)(`span`,{className:`shrink-0 rounded border px-2 py-0.5 text-[10px] font-medium ${Q4e[e.status]}`,children:e.statusLabel})]}),(0,H.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:e.description}),(0,H.jsx)(`p`,{className:`text-sm`,children:e.summary}),e.error?(0,H.jsxs)(`div`,{role:`alert`,className:`text-destructive flex items-start gap-1.5 text-xs`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{children:e.error})]}):null]}),n=`border-border bg-card flex min-h-40 min-w-0 flex-col gap-3 rounded-lg border p-4`;return e.href?(0,H.jsx)(Nb,{to:e.href,"aria-label":e.title,className:`${n} hover:border-primary/40 hover:bg-muted/30 focus-visible:ring-primary outline-none focus-visible:ring-2`,children:t}):(0,H.jsx)(`section`,{"aria-label":e.title,className:n,children:t})}function t3e({models:e}){return(0,H.jsx)(`div`,{className:`@[42rem]:grid-cols-2 @[72rem]:grid-cols-3 grid min-w-0 gap-3`,children:e.map(e=>(0,H.jsx)(e3e,{model:e},e.id))})}function n3e(){let e=X4e(),t=j9(),n=Z4e(),r=I4e(),i=Xy(),a=u9(),o=r.data?.states.reduce((e,t)=>e+(t.issues.length>0?1:0),0)??0,s=e.data?.binding.references.entries.length??0,c=i.data?.schemas.length??0;return(0,H.jsx)(t3e,{models:[{id:`project`,title:`Project Binding`,description:`Launch-project Store and read-only Reference declarations.`,href:`/config/project`,icon:(0,H.jsx)(Ic,{className:`h-4 w-4`,"aria-hidden":!0}),status:e.error?`blocked`:e.isLoading&&!e.data?`loading`:`ready`,statusLabel:e.error?`Blocked`:e.isLoading&&!e.data?`Loading`:`Observed`,summary:e.data?`${e.data.binding.store.state} Store · ${s} References`:`Waiting for launch-project declarations.`,error:e.error?.message},{id:`root`,title:`Active Root`,description:`Physical config selected by the current Planning Root.`,href:`/config/root`,icon:(0,H.jsx)(bc,{className:`h-4 w-4`,"aria-hidden":!0}),status:t.error?`blocked`:t.isLoading&&!t.data?`loading`:t.data?.exists?`ready`:`attention`,statusLabel:t.error?`Blocked`:t.isLoading&&!t.data?`Loading`:t.data?.exists?`Available`:`Missing`,summary:t.data?.exists?t.data.filePath||`Published config document`:`No config file exists in the selected Root.`,error:t.error?.message},{id:`environment`,title:`Environment`,description:`Machine defaultStore, feature flags, and global source evidence.`,href:`/config/environment`,icon:(0,H.jsx)(ol,{className:`h-4 w-4`,"aria-hidden":!0}),status:n.error?`blocked`:n.isLoading&&!n.data?`loading`:n.authority.state===`current`?`ready`:`attention`,statusLabel:n.error?`Blocked`:n.isLoading&&!n.data?`Loading`:n.authority.state===`current`?`Current`:`Refreshing`,summary:n.data?n.data.configPath??`Global config path is unavailable.`:`Waiting for the CLI-owned environment projection.`,error:n.error?.message},{id:`agents`,title:`Agent Delivery`,description:`Official delivery policy, physical inventory, migration, and repair.`,href:`/config/agents`,icon:(0,H.jsx)(Js,{className:`h-4 w-4`,"aria-hidden":!0}),status:r.error?`blocked`:r.isLoading&&!r.data?`loading`:o>0?`attention`:`ready`,statusLabel:r.error?`Blocked`:r.isLoading&&!r.data?`Loading`:o>0?`Attention`:`Current`,summary:r.data?`${r.data.registry.length} Agents · ${o} with issues`:`Waiting for the Server-owned Agent projection.`,error:r.error?.message},{id:`schemas`,title:`Schemas`,description:`Resolved workflow Schema catalog and physical detail workspaces.`,href:`/config/schemas`,icon:(0,H.jsx)(Ys,{className:`h-4 w-4`,"aria-hidden":!0}),status:i.error?`blocked`:i.isLoading&&!i.data?`loading`:c>0?`ready`:`attention`,statusLabel:i.error?`Blocked`:i.isLoading&&!i.data?`Loading`:c>0?`Available`:`Empty`,summary:i.data?`${c} resolved Schemas`:`Waiting for the Schema catalog.`,error:i.error?.message},{id:`context`,title:`Resolved Context`,description:`Effective Root, Store, References, and current action authority.`,href:`/config/context`,icon:(0,H.jsx)(Sl,{className:`h-4 w-4`,"aria-hidden":!0}),status:a.status===`ready`?`ready`:a.status===`blocked`?`blocked`:`loading`,statusLabel:a.status===`ready`?`Ready`:a.status===`blocked`?`Blocked`:`Resolving`,summary:a.context?.planningRoot?.path??(a.status===`ready`?`Root Context is current.`:`Waiting for CLI-selected Root Context.`),error:a.status===`blocked`?a.message:void 0}]})}function r3e(){let e=j9(),t=Xy(),n=t.data?.schemas.length??0;return(0,H.jsx)(t3e,{models:[{id:`project`,title:`Project Binding`,description:`Launch-project declarations are intentionally excluded from publication.`,icon:(0,H.jsx)(Ic,{className:`h-4 w-4`,"aria-hidden":!0}),status:`static`,statusLabel:`Not published`,summary:`Open this project live to inspect or edit Project Binding.`},{id:`root`,title:`Active Root`,description:`Read-only configuration content included in this snapshot.`,href:`/config/root`,icon:(0,H.jsx)(bc,{className:`h-4 w-4`,"aria-hidden":!0}),status:e.error?`blocked`:e.isLoading&&!e.data?`loading`:`static`,statusLabel:e.error?`Blocked`:e.isLoading&&!e.data?`Loading`:`Snapshot`,summary:e.data?.exists?`Published config document is available.`:`No config document published.`,error:e.error?.message},{id:`environment`,title:`Environment`,description:`Machine paths and global configuration are private runtime facts.`,icon:(0,H.jsx)(ol,{className:`h-4 w-4`,"aria-hidden":!0}),status:`static`,statusLabel:`Not published`,summary:`Static output carries no Environment mutation or machine-path authority.`},{id:`agents`,title:`Agent Delivery`,description:`Agent inventory and mutation authority remain live-only.`,icon:(0,H.jsx)(Js,{className:`h-4 w-4`,"aria-hidden":!0}),status:`static`,statusLabel:`Not published`,summary:`Static output contains no Agent policy or physical inventory.`},{id:`schemas`,title:`Schemas`,description:`Read-only Schema catalog and published physical documents.`,href:`/config/schemas`,icon:(0,H.jsx)(Ys,{className:`h-4 w-4`,"aria-hidden":!0}),status:t.error?`blocked`:t.isLoading&&!t.data?`loading`:`static`,statusLabel:t.error?`Blocked`:t.isLoading&&!t.data?`Loading`:`Snapshot`,summary:t.data?`${n} published Schemas`:`Waiting for published Schema data.`,error:t.error?.message},{id:`context`,title:`Resolved Context`,description:`Publication-redacted Root and Reference provenance.`,href:`/config/context`,icon:(0,H.jsx)(Sl,{className:`h-4 w-4`,"aria-hidden":!0}),status:`static`,statusLabel:`Snapshot`,summary:`Inspect the publication-safe Context evidence boundary.`}]})}function i3e(){let e=Lf();return(0,H.jsx)(S9,{current:`overview`,header:(0,H.jsx)($4e,{}),children:e?(0,H.jsx)(r3e,{}):(0,H.jsx)(n3e,{})})}function a3e(e){return e.transportError?{status:`failed`,title:`Active Root unavailable`,detail:e.transportError}:e.loading&&!e.available?{status:`blocked`,title:`Loading Active Root`,detail:`Wait for the CLI-selected Active Root projection.`}:e.available?e.mutationPending||e.editing||e.dirty||e.conflict?{status:`active-edit`,title:`Finish Active Root changes`,detail:`Save, resolve, or discard the current Structured or Raw YAML draft.`}:e.authority===`blocked`?{status:`failed`,title:e.authorityTitle??`Active Root authority failed`,detail:e.authorityMessage??`Repair Root Context authority before continuing.`}:e.refreshing||e.authority===`checking`?{status:`stale`,title:`Active Root is refreshing`,detail:e.authorityMessage??`Wait for current Root authority before continuing.`}:e.exists?e.errorDiagnostic?{status:`failed`,title:`Active Root config is invalid`,detail:e.errorDiagnostic}:e.warningDiagnostic?{status:`warning`,title:`Review Active Root diagnostics`,detail:e.warningDiagnostic}:{status:`ready`,title:`Active Root ready`,detail:`The CLI-selected Root has a current valid configuration.`}:{status:`required`,title:`Create the Active Root config`,detail:`Create and save an official or custom YAML configuration for this Root.`}:{status:`failed`,title:`Active Root unavailable`,detail:`No Active Root configuration projection is available.`}}function o3e(e){return e.transportError||e.authorityFailed?{status:`failed`,title:`Resolved Context unavailable`,detail:e.transportError??`Current Root authority failed.`}:e.loading?{status:`blocked`,title:`Resolving Context`,detail:`Wait for the current CLI-selected Root Context.`}:e.refreshing||!e.authorityCurrent?{status:`stale`,title:`Resolved Context is refreshing`,detail:`Retained Context is visible, but current Root authority has not settled.`}:!e.available||!e.hasPlanningRoot?{status:`required`,title:`Select a usable Root`,detail:`Project Binding or Environment Global must resolve a current Planning Root.`}:!e.cliAvailable||e.cliError?{status:`failed`,title:`Selected Root is not usable`,detail:e.cliError??`OpenSpec CLI is unavailable for the selected Root.`}:e.errorDiagnostic?{status:`failed`,title:`Resolved Context has errors`,detail:e.errorDiagnostic}:e.warningDiagnostic?{status:`warning`,title:`Review Resolved Context warnings`,detail:e.warningDiagnostic}:{status:`ready`,title:`Resolved Context ready`,detail:`Root authority is current and the selected Planning Root is usable.`}}function s3e({latest:e,mode:t,pending:n,retryDisabled:r,onReload:i,onRetry:a}){return(0,H.jsxs)(`div`,{role:`alert`,className:`space-y-3 rounded-md border border-amber-500/40 bg-amber-500/10 p-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,H.jsx)(ll,{className:`mt-0.5 h-4 w-4 shrink-0 text-amber-600 dark:text-amber-400`}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`p`,{className:`text-sm font-medium`,children:`Active Root changed after this draft was loaded.`}),(0,H.jsxs)(`p`,{className:`text-muted-foreground mt-1 text-xs`,children:[`The physical file was not overwritten. Review revision`,` `,e.revision?.slice(0,15)??`latest`,`before reloading or retrying.`]}),t===`raw`?(0,H.jsx)(`p`,{className:`mt-1 text-xs text-amber-800 dark:text-amber-300`,children:`Retrying Raw YAML replaces the complete latest document, including external changes.`}):null]})]}),(0,H.jsxs)(`details`,{className:`border-border bg-background/70 rounded-md border p-2`,children:[(0,H.jsx)(`summary`,{className:`cursor-pointer text-xs font-medium`,children:`Review latest physical YAML`}),(0,H.jsx)(`pre`,{className:`text-muted-foreground mt-2 max-h-48 overflow-y-auto whitespace-pre-wrap break-words text-xs`,children:e.content??``})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,H.jsxs)(nL,{variant:`secondary`,size:`sm`,disabled:n,onClick:i,children:[(0,H.jsx)(nl,{className:`h-3.5 w-3.5`}),`Reload latest`]}),(0,H.jsx)(nL,{size:`sm`,disabled:n||r,onClick:a,children:`Retry against latest`})]})]})}function c3e({value:e,readOnly:t,onChange:n,onSaveShortcut:r}){return(0,H.jsx)(JY,{value:e,onChange:n,onSaveShortcut:r,readOnly:t,filename:`config.yaml`,className:`min-w-0`,editorMinHeight:`clamp(24rem, 60vh, 48rem)`})}function M9(e){return e?.join(`
|
|
1644
1644
|
`)??``}function N9(e){return e.split(`
|
|
1645
|
-
`).map(e=>e.trim()).filter(e=>e.length>0)}function P9(e){return{schema:e.schema??`spec-driven`,context:e.context??``,rules:Object.entries(e.rules??{}).map(([e,t])=>({id:`source:${e}`,artifactId:e,guidance:M9(t)})),applyGuidance:M9(e.operations?.apply?.guidance),archiveGuidance:M9(e.operations?.archive?.guidance)}}function
|
|
1646
|
-
`;function I9(e,t){return e?.owner?.path===t?.owner?.path&&e?.filePath===t?.filePath&&e?.revision===t?.revision}function
|
|
1647
|
-
`));return}let n=A9(e.config);if(w.current=n.revision,d(n),x(null),C(null),t.mode===`structured`?(p(P9(n.official)),_(!1)):(h(n.content??``),y(!1)),t.mode===`structured`?k.current.raw:k.current.structured){x(n),C(`The other mode retains an unsaved draft based on the previous revision.`);return}A(n),l(!1)}}),M=a.disabled||i!==null||n||r,N=c&&u!==null&&t!==void 0&&!I9(u,t),P=M||N||b!==null,F=o===`structured`?g:v,ee=
|
|
1648
|
-
`));return}j.mutate({mode:`structured`,...h3e(e),update:t.update})},[o,m,j,f]);if(n&&!t)return(0,H.jsx)(`div`,{...ee,className:`space-y-4`,"aria-busy":`true`,children:(0,H.jsx)(YSe,{fields:4})});if(!t)return(0,H.jsx)(`div`,{...ee,role:`alert`,className:`text-destructive rounded-md border p-4 text-sm`,children:i?.message??`Active Root Config is unavailable.`});let L=i?.message??j.error?.message??S;return(0,H.jsxs)(`section`,{...ee,"data-testid":`active-root-config-surface`,className:`@container min-w-0 space-y-4`,"aria-busy":n||r||j.isPending,children:[(0,H.jsxs)(`header`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Active Root Config`}),t.owner?(0,H.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-1.5 text-xs`,children:[(0,H.jsxs)(`span`,{className:`text-muted-foreground break-all`,children:[`Planning root: `,t.owner.path]}),(0,H.jsx)(g9,{ariaLabel:`Active Root source ${t.owner.source}`,tooltip:`The CLI selected this root from source ${t.owner.source}.`,children:t.owner.source}),t.owner.storeId?(0,H.jsxs)(g9,{ariaLabel:`Active Root Store ${t.owner.storeId}`,tooltip:`Writes target Store ${t.owner.storeId}.`,children:[`Store `,t.owner.storeId]}):null,t.filePath?(0,H.jsx)(g9,{ariaLabel:`Active Root config file path`,tooltip:t.filePath,children:`Config file`}):null,t.revision?(0,H.jsxs)(g9,{ariaLabel:`Active Root config revision`,tooltip:t.revision,children:[`Revision `,t.revision.slice(7,15)]}):null]}):(0,H.jsx)(`p`,{className:`text-muted-foreground mt-1 text-xs`,children:`Static Active Root snapshot`})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(0,H.jsx)(T4e,{state:a}),(t.exists||c)&&(0,H.jsx)(`div`,{role:`tablist`,"aria-label":`Active Root editor mode`,className:`bg-muted flex rounded-md p-0.5`,children:[`structured`,`raw`].map(e=>(0,H.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":o===e,disabled:j.isPending,onClick:()=>s(e),className:`inline-flex items-center gap-1.5 rounded px-2.5 py-1 text-xs font-medium ${o===e?`bg-background text-foreground shadow-sm`:`text-muted-foreground`}`,children:[e===`structured`?(0,H.jsx)(Xs,{className:`h-3.5 w-3.5`}):(0,H.jsx)(mc,{className:`h-3.5 w-3.5`}),e===`structured`?`Structured`:`Raw YAML`]},e))}),!e&&!M&&t.exists&&!c?(0,H.jsxs)(nL,{variant:`secondary`,size:`sm`,onClick:te,children:[(0,H.jsx)(Zc,{className:`h-3.5 w-3.5`}),`Edit`]}):null,c?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(nL,{variant:`secondary`,size:`sm`,onClick:I,disabled:j.isPending,children:[(0,H.jsx)(Cl,{className:`h-3.5 w-3.5`}),`Cancel`]}),(0,H.jsxs)(HSe,{size:`sm`,pending:j.isPending,settled:!F,onClick:()=>ne(u),disabled:j.isPending||P||!F,children:[(0,H.jsx)(rl,{className:`h-3.5 w-3.5`}),`Save `,o===`structured`?`Structured`:`Raw YAML`]})]}):null]})]}),t.owner?.externalToLaunchProject&&t.owner.storeId?(0,H.jsxs)(`div`,{role:`note`,"aria-label":`Shared Store write impact`,className:`rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs`,children:[`This Active Root belongs to shared Store `,(0,H.jsx)(`strong`,{children:t.owner.storeId}),`. Saves affect every project currently resolving this Store.`]}):null,t.diagnostics.length>0?(0,H.jsx)(`div`,{role:t.diagnostics.some(({severity:e})=>e===`error`)?`alert`:`note`,className:`border-border space-y-1 rounded-md border p-3 text-xs`,children:t.diagnostics.map(e=>(0,H.jsxs)(`p`,{children:[(0,H.jsx)(`strong`,{children:e.path}),`: `,e.message]},`${e.code}:${e.path}`))}):null,L?(0,H.jsx)(`div`,{role:`alert`,className:`text-destructive whitespace-pre-wrap rounded-md border p-3 text-sm`,children:L}):null,!e&&a.disabled?(0,H.jsx)(x9,{state:a}):null,b?(0,H.jsx)(c3e,{latest:b,mode:o,pending:j.isPending,retryDisabled:M||!F,onReload:()=>{w.current=null,d(b),A(b),x(null),C(null),j.reset()},onRetry:()=>ne(b)}):null,t.exists||c?(0,H.jsx)(`div`,{role:`tabpanel`,"aria-label":o===`structured`?`Structured Active Root editor`:`Raw YAML Active Root editor`,className:`min-w-0`,children:o===`structured`?(0,H.jsx)(f3e,{draft:f,readOnly:!c||j.isPending||P,onChange:e=>{p(e),_(!0),C(null),j.reset()}}):(0,H.jsx)(l3e,{value:m,readOnly:!c||j.isPending||P,onChange:e=>{h(e),y(!0),C(null),j.reset()},onSaveShortcut:()=>{c&&v&&!j.isPending&&!P&&ne(u)}})}):(0,H.jsxs)(`div`,{className:`text-muted-foreground rounded-md border border-dashed p-4 text-sm`,children:[(0,H.jsx)(`p`,{className:`mb-3`,children:`No config file exists in the active Planning root.`}),!e&&!M?(0,H.jsx)(nL,{size:`sm`,onClick:te,children:`Create Active Root config`}):null]})]})}function _3e(){let e=Lf();return(0,H.jsx)(S9,{current:`root`,header:(0,H.jsx)(C9,{title:`Active Root`,description:`Inspect and edit the configuration owned by the CLI-selected Planning Root.`,icon:(0,H.jsx)(bc,{className:`h-6 w-6 shrink-0`,"aria-hidden":!0})}),children:(0,H.jsx)(g3e,{isStatic:e})})}function v3e(){let{data:e,isLoading:t,error:n}=Xy(),r=e?.schemas,i=r===void 0&&t&&n===null,a=r?.length===0&&n===null;return(0,H.jsx)(S9,{current:`schemas`,header:(0,H.jsx)(C9,{title:`Schemas`,description:`Browse resolved OpenSpec workflow schemas, then open one focused detail workspace.`,icon:(0,H.jsx)(Ys,{className:`h-6 w-6 shrink-0`,"aria-hidden":!0})}),children:(0,H.jsxs)(`div`,{className:`space-y-4`,"data-schema-catalog":`true`,children:[n?(0,H.jsxs)(`div`,{role:`alert`,className:`text-destructive border-destructive/40 bg-destructive/10 flex items-start gap-2 rounded-lg border p-4 text-sm`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`font-medium`,children:`Schema catalog refresh failed.`}),(0,H.jsx)(`p`,{children:n.message}),r===void 0?null:(0,H.jsx)(`p`,{className:`text-muted-foreground mt-1 text-xs`,children:`Retaining the last successful catalog while the replacement observation is unavailable.`})]})]}):null,i?(0,H.jsx)(`section`,{"aria-label":`Loading Schema catalog`,className:`border-border bg-card rounded-lg border p-4`,children:(0,H.jsx)(dL,{count:5})}):null,r&&r.length>0?(0,H.jsx)(iL,{active:t,children:(0,H.jsx)(`ul`,{className:`@[48rem]:grid-cols-2 grid gap-3`,children:r.map(e=>(0,H.jsx)(`li`,{className:`min-w-0`,children:(0,H.jsxs)(Nb,{to:`/config/schemas/${encodeURIComponent(e.name)}`,className:`border-border bg-card hover:border-primary/40 hover:bg-muted/40 focus-visible:ring-primary flex min-h-32 min-w-0 flex-col justify-between gap-4 rounded-lg border p-4 outline-none focus-visible:ring-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,H.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-semibold`,children:e.name}),(0,H.jsx)(`span`,{className:`bg-muted text-muted-foreground shrink-0 rounded px-2 py-0.5 text-[10px]`,children:e.source})]}),(0,H.jsx)(`p`,{className:`text-muted-foreground mt-2 line-clamp-2 text-xs`,children:e.description||`No schema description provided.`})]}),(0,H.jsxs)(`div`,{className:`text-muted-foreground flex items-center justify-between gap-3 text-xs`,children:[(0,H.jsxs)(`span`,{children:[e.artifacts.length,` artifacts`]}),(0,H.jsxs)(`span`,{className:`text-foreground inline-flex items-center gap-1 font-medium`,children:[`Open`,(0,H.jsx)(Ks,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})]})]})},e.name))})}):null,a?(0,H.jsxs)(`section`,{className:`border-border bg-card text-muted-foreground flex min-h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed p-6 text-center text-sm`,children:[(0,H.jsx)(Jc,{className:`h-6 w-6`,"aria-hidden":!0}),(0,H.jsx)(`p`,{children:`No schemas available.`})]}):null]})})}function y3e(e){return e===`auto`||e===`scroll`||e===`overlay`}function b3e(e,t={}){let{allowNonScrollable:n=!1}=t,r=e?.parentElement??null;for(;r;){if(y3e(window.getComputedStyle(r).overflowY)&&(n||r.scrollHeight>r.clientHeight))return r;r=r.parentElement}return null}function x3e(e){if(e){let t=e.getBoundingClientRect();return{top:t.top,bottom:t.bottom}}return{top:0,bottom:window.innerHeight}}function S3e(e,t=b3e(e,{allowNonScrollable:!0})){if(typeof window>`u`||!e)return null;let n=e.getBoundingClientRect(),r=x3e(t);return Math.max(Math.floor(r.bottom-Math.max(n.top,r.top)),0)}function C3e({target:e,enabled:t=!0}){let[n,r]=(0,V.useState)(null);return(0,V.useLayoutEffect)(()=>{if(!t||typeof window>`u`){r(null);return}if(!e){r(null);return}let n=null,i=null,a=window,o=e=>{r(t=>t===e?t:e)},s=e=>{i!==e&&(a.removeEventListener(`scroll`,c),n&&i&&n.unobserve(i),i=e,a=e??window,a.addEventListener(`scroll`,c,{passive:!0}),n&&i&&n.observe(i))},c=()=>{let t=b3e(e,{allowNonScrollable:!0});s(t),o(S3e(e,t))};return typeof ResizeObserver<`u`&&(n=new ResizeObserver(()=>{c()}),n.observe(e),e.parentElement&&n.observe(e.parentElement)),c(),window.addEventListener(`resize`,c),()=>{window.removeEventListener(`resize`,c),a.removeEventListener(`scroll`,c),n?.disconnect()}},[t,e]),n}var w3e=new Set([`generates`,`template`,`path`,`outputPath`]),T3e=new Set([`requires`,`tags`]),E3e=new Set([`id`,`generates`,`description`,`template`,`instruction`,`requires`]);function L9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function D3e(e){if(!e)return{data:null};try{let t=Ig(e);return L9(t)?{data:t}:{data:null}}catch(e){return{data:null,error:e instanceof Error?e.message:String(e)}}}function O3e(e){let t=e.split(`/`);if(t.length<=1)return null;t.pop();let n=t.join(`/`);return n.length>0?n:null}function k3e(){let[e,t]=(0,V.useState)(null);return{viewportHeight:C3e({target:e,enabled:e!==null}),setViewportNode:t}}function A3e(){let{schemaId:e}=qo({strict:!1}),t=Mb();return(0,H.jsx)(j3e,{schemaId:e,onNavigate:e=>void t({href:e})})}function j3e({onNavigate:e,schemaId:t}){let n=Lf(),{viewportHeight:r,setViewportNode:i}=k3e(),[a,o]=(0,V.useState)(`read`),[s,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(null),[d,f]=(0,V.useState)(!1),[p,m]=(0,V.useState)(!1),[h,g]=(0,V.useState)(!1),[_,v]=(0,V.useState)(!1),[y,b]=(0,V.useState)(!1),[x,S]=(0,V.useState)(`file`),[C,w]=(0,V.useState)(null),[T,E]=(0,V.useState)(``),[D,O]=(0,V.useState)(null),[k,A]=(0,V.useState)(null),[j,M]=(0,V.useState)(null),[N,P]=(0,V.useState)(null),F=(0,V.useRef)(null),[ee,te]=(0,V.useState)(!0),[I,ne]=(0,V.useState)(``),[L,re]=(0,V.useState)(`init`),[ie,ae]=(0,V.useState)(`spec-driven`),oe=u9(),se=(0,V.useRef)(oe);se.current=oe;let{data:ce,isLoading:le,error:ue,authority:de}=Xy(),R=(0,V.useRef)(de);R.current=de;let fe=ce?.schemas,pe=fe===void 0&&le&&ue===null,me=fe?.length===0&&ue===null,he=t,ge=he?ce?.schemaDetails[he]??null:null,_e=he?ce?.schemaResolutions[he]??null:null,{data:ve,isLoading:ye,error:be}=Loe(he),{data:xe}=Ioe(he),{data:Se}=Roe(he),[Ce,we]=(0,V.useState)(null),[Te,Ee]=(0,V.useState)({}),[De,Oe]=(0,V.useState)({}),ke=!n&&!oe.disabled&&de.state===`current`&&_e?.source!==void 0&&_e.source!==`package`,Ae=ke&&!n,je=(0,V.useCallback)(()=>{let e=se.current;if(e.disabled)throw Error(e.message??`Planning root is unavailable.`);if(R.current.state!==`current`)throw Error(`Schema configuration is refreshing; mutations remain read-only.`)},[]);(0,V.useEffect)(()=>{a===`edit`&&!ke&&o(`read`)},[ke,a]),(0,V.useEffect)(()=>{o(`read`),we(null),Ee({}),Oe({}),u(null),O(null),A(null),M(null),P(null)},[he]),(0,V.useEffect)(()=>{if(!ve||ve.length===0){we(null);return}let e=ve.filter(e=>e.type===`file`);if(e.length===0){we(null);return}(!Ce||!e.some(e=>e.path===Ce))&&we(e.find(e=>e.path===`schema.yaml`)?.path??e[0].path)},[ve,Ce]);let Me=(0,V.useMemo)(()=>ve??[],[ve]),Ne=ve===void 0&&ye&&be===null,Pe=!Ne&&(!be||Me.length>0),Fe=(0,V.useMemo)(()=>!Me.length||!Ce?null:Me.find(e=>e.path===Ce&&e.type===`file`)??null,[Me,Ce]),Ie=Fe?Te[Fe.path]:void 0,Le=Fe?!!De[Fe.path]:!1;(0,V.useEffect)(()=>{if(!Fe||De[Fe.path])return;let e=Fe.content??``;Ee(t=>t[Fe.path]===e?t:{...t,[Fe.path]:e})},[Fe,De]);let Re=(0,V.useMemo)(()=>fe?.find(e=>e.name===he),[fe,he]),ze=(0,V.useMemo)(()=>fe?.map(e=>({value:e.name,label:e.name}))??[],[fe]),Be=(0,V.useMemo)(()=>{let e=`schema.yaml`,t=Me.find(t=>t.path===e),n=Te[e];return De[e]&&n!==void 0?n:t?.content??``},[De,Te,Me]),Ve=(0,V.useMemo)(()=>D3e(Be),[Be]),He=Ve.data,Ue=(0,V.useMemo)(()=>{if(!He)return[];let e=He.artifacts;return Array.isArray(e)?e.filter(L9):[]},[He]),We=(0,V.useMemo)(()=>{let e=new Map;for(let t of Ue){let n=typeof t.id==`string`?t.id:void 0;n&&e.set(n,t)}return e},[Ue]),Ge=(0,V.useMemo)(()=>ge?.artifacts?.length?ge.artifacts:Ue.map((e,t)=>({id:typeof e.id==`string`?e.id:`artifact-${t+1}`,outputPath:typeof e.generates==`string`?e.generates:``,description:typeof e.description==`string`?e.description:void 0,requires:Array.isArray(e.requires)?e.requires.filter(e=>typeof e==`string`):[]})),[Ue,ge?.artifacts]),Ke=(0,V.useMemo)(()=>{let e=new Map;for(let[t,n]of Object.entries(De)){if(!n)continue;let r=Te[t];r!==void 0&&e.set(t,r)}return e},[De,Te]),qe=(0,V.useMemo)(()=>Object.values(De).some(Boolean),[De]),Je=(0,V.useMemo)(()=>{if(!D)return null;let e=D.type===`file`,t=new TextEncoder,n=e?t.encode(D.content??``).length:void 0,r=D.path===`/`,i=D.type===`directory`?r?Me.length:Me.filter(e=>e.path.startsWith(D.path+`/`)).length:void 0;return{path:r?_e?.displayPath??_e?.path??`/`:D.path,type:D.type,source:_e?.source??`unknown`,sizeBytes:n,childCount:i}},[D,Me,_e]),Ye=(0,V.useMemo)(()=>_e?.displayPath?_e.displayPath:_e?.path?rm(_e.path,{source:_e.source}):`project:openspec/schemas`,[_e]),Xe=(0,V.useMemo)(()=>({path:`/`,type:`directory`}),[]),Ze=ti({mutationFn:async e=>{je(),he&&await Cy.opsx.writeSchemaFile.mutate({schema:he,path:e.path,content:e.content})},onSuccess:(e,t)=>{Oe(e=>({...e,[t.path]:!1})),u(null)},onError:e=>{u(e instanceof Error?e.message:String(e))}}),Qe=ti({mutationFn:async e=>{je(),he&&await Cy.opsx.createSchemaFile.mutate({schema:he,path:e.path,content:e.content})},onSuccess:(e,t)=>{u(null),g(!1),E(``),we(t.path)},onError:e=>{u(e instanceof Error?e.message:String(e))}}),$e=ti({mutationFn:async e=>{je(),he&&await Cy.opsx.createSchemaDirectory.mutate({schema:he,path:e.path})},onSuccess:()=>{u(null),g(!1),E(``)},onError:e=>{u(e instanceof Error?e.message:String(e))}}),et=ti({mutationFn:async e=>{je(),he&&await Cy.opsx.deleteSchemaEntry.mutate({schema:he,path:e.path})},onSuccess:(e,t)=>{u(null),v(!1),O(null),Oe(e=>{let n={...e};return delete n[t.path],n}),Ee(e=>{let n={...e};return delete n[t.path],n})},onError:e=>{u(e instanceof Error?e.message:String(e))}}),tt=ti({mutationFn:async e=>{je();let t=e.mode===`init`?await Cy.opsx.initSchema.mutate({name:e.name}):await Cy.opsx.forkSchema.mutate({source:e.source,name:e.name});if(!t.success)throw Error(t.stderr||`Schema ${e.mode} failed.`);return t},onSuccess:()=>{c(null)},onError:e=>{c(e instanceof Error?e.message:String(e))}}),nt=ti({mutationFn:async()=>{je(),he&&await Cy.opsx.deleteSchema.mutate({name:he})},onSuccess:()=>{c(null)},onError:e=>{c(e instanceof Error?e.message:String(e))}}),rt=(0,V.useCallback)(e=>{e===`edit`&&!ke||o(e)},[ke]),it=(0,V.useCallback)(e=>{Fe&&(Ee(t=>({...t,[Fe.path]:e})),Oe(e=>({...e,[Fe.path]:!0})))},[Fe]),at=(0,V.useCallback)(()=>{Fe&&(Ee(e=>({...e,[Fe.path]:Fe.content??``})),Oe(e=>({...e,[Fe.path]:!1})))},[Fe]),ot=(0,V.useCallback)(()=>{if(!Fe||!ke)return;let e=Ie??Fe.content??``;Ze.mutate({path:Fe.path,content:e})},[Ie,Fe,Ze,ke]),st=(0,V.useCallback)((e,t)=>{let n=t.trim().replace(/^\/+/,``),r=e?e.replace(/\/+$/,``):``;return r?`${r}/${n}`:n},[]),ct=(0,V.useCallback)((e,t)=>{!ke||n||(u(null),S(e),w(t),E(``),g(!0))},[n,ke]),lt=(0,V.useCallback)(()=>{if(!Ae)return;let e=T.trim();if(!e){u(`Name is required.`);return}if(e.includes(`..`)){u(`Name cannot include "..".`);return}let t=st(C,e);if(!t){u(`Invalid path.`);return}if(x===`file`){Qe.mutate({path:t,content:``});return}$e.mutate({path:t})},[T,C,x,$e,Qe,st,Ae]),ut=(0,V.useCallback)(e=>{u(null),O(e),v(!0)},[]),dt=(0,V.useCallback)(()=>{!D||!Ae||et.mutate({path:D.path})},[D,Ae,et]),ft=(0,V.useCallback)(e=>{O(e),b(!0)},[]),pt=(0,V.useMemo)(()=>{let e=[];return Ae&&e.push({id:`new-file-root`,label:`New file`,icon:(0,H.jsx)(gc,{className:`h-3.5 w-3.5`}),onSelect:()=>ct(`file`,null)},{id:`new-folder-root`,label:`New folder`,icon:(0,H.jsx)(wc,{className:`h-3.5 w-3.5`}),onSelect:()=>ct(`directory`,null)}),e.push({id:`root-properties`,label:`Properties`,icon:(0,H.jsx)(Mc,{className:`h-3.5 w-3.5`}),onSelect:()=>ft(Xe)}),e},[Ae,ct,ft,Xe]),mt=(0,V.useMemo)(()=>[{id:`file-save`,label:`Save`,icon:(0,H.jsx)(rl,{className:`h-3.5 w-3.5`}),disabled:!ke||!Le,onSelect:()=>ot()},{id:`file-revert`,label:`Revert`,icon:(0,H.jsx)(Cl,{className:`h-3.5 w-3.5`}),disabled:!ke||!Le,onSelect:()=>at()}],[Le,at,ot,ke]),ht=(0,V.useMemo)(()=>[{id:`view-wrap`,label:ee?`Disable line wrap`:`Enable line wrap`,onSelect:()=>te(e=>!e)}],[ee]),gt=(0,V.useCallback)(()=>{ke&&(c(null),ne(``),re(`init`),ae(he??`spec-driven`),f(!0))},[ke,he]),_t=(0,V.useCallback)(()=>{!he||!ke||(c(null),m(!0))},[ke,he]),vt=(0,V.useCallback)(()=>{if(!ke)return;let t=I.trim();if(!t){c(`Schema name is required.`);return}let n=L===`fork`?{mode:`fork`,source:ie.trim()||`spec-driven`,name:t}:{mode:`init`,name:t};tt.mutate(n,{onSuccess:()=>{f(!1),e(`/config/schemas/${encodeURIComponent(t)}`)}})},[tt,L,I,ie,e,ke]),yt=(0,V.useCallback)(()=>{ke&&nt.mutate(void 0,{onSuccess:()=>{m(!1),e(`/config/schemas`)}})},[nt,e,ke]),bt=(0,V.useCallback)((e,t)=>{if(t==null)return(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});if(Array.isArray(t)){if(t.length===0)return(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let n=t.filter(e=>typeof e==`string`);return T3e.has(e)&&n.length>0||n.length===t.length?(0,H.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:n.map(e=>(0,H.jsx)(`span`,{className:`bg-muted rounded px-2 py-0.5 text-[10px]`,children:e},e))}):(0,H.jsx)(JY,{value:JSON.stringify(t,null,2),readOnly:!0,language:`json`,lineWrapping:!0})}return L9(t)?(0,H.jsx)(JY,{value:JSON.stringify(t,null,2),readOnly:!0,language:`json`,lineWrapping:!0}):typeof t==`string`?e===`instruction`?(0,H.jsx)(`div`,{className:`bg-muted/30 rounded-lg p-4 [zoom:0.92]`,children:(0,H.jsx)(j3,{markdown:t,collectToc:!1})}):t.includes(`
|
|
1649
|
-
`)?(0,H.jsx)(JY,{value:t,readOnly:!0,filename:`${e}.md`,lineWrapping:!0}):w3e.has(e)||t.includes(`/`)||t.endsWith(`.md`)||t.endsWith(`.yaml`)?(0,H.jsx)(`code`,{className:`bg-muted rounded px-1`,children:t}):(0,H.jsx)(`span`,{children:t}):(0,H.jsx)(`span`,{children:String(t)})},[]),xt=(0,H.jsx)(`section`,{"data-schema-detail-content":`true`,className:`min-w-0`,children:(0,H.jsxs)(`div`,{className:`space-y-4 pr-1`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,H.jsx)(IL,{value:a,onChange:rt,options:[{value:`read`,label:`Read`},{value:`preview`,label:`Preview`},{value:`edit`,label:`Edit`,disabled:!ke}]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(T4e,{state:oe}),(0,H.jsxs)(`button`,{type:`button`,onClick:gt,disabled:!ke||tt.isPending,className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,H.jsx)($c,{className:`h-3.5 w-3.5`}),`Add`]}),(0,H.jsxs)(`button`,{type:`button`,onClick:_t,disabled:!ke||nt.isPending,className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,H.jsx)(_l,{className:`h-3.5 w-3.5`}),`Delete`]})]})]}),!n&&oe.disabled?(0,H.jsx)(x9,{state:oe}):null,s&&(0,H.jsx)(`div`,{className:`text-destructive text-xs`,children:s}),l&&(0,H.jsx)(`div`,{className:`text-destructive text-xs`,children:l}),(0,H.jsx)(`div`,{ref:i,className:`flex min-h-0 flex-col`,style:r==null?void 0:{height:`${r}px`},children:Re?a===`preview`?(0,H.jsx)(j3,{className:`min-h-0 flex-1`,markdown:({H1:e,H2:t,H3:n,Section:r})=>{let i=`schema-${Re.name}`,a=e=>`${i}-${e}`;return(0,H.jsxs)(`div`,{className:`space-y-6`,children:[(0,H.jsxs)(r,{children:[(0,H.jsx)(e,{id:i,children:Re.name}),Re.description&&(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:Re.description})]}),_e&&(0,H.jsxs)(r,{children:[(0,H.jsx)(t,{id:a(`resolution`),children:`Resolution`}),(0,H.jsxs)(`div`,{className:`text-muted-foreground mt-2 space-y-1 pl-4 text-sm`,children:[(0,H.jsxs)(`div`,{children:[`Source: `,_e.source]}),(0,H.jsxs)(`div`,{className:`truncate`,children:[`Path: `,_e.displayPath??_e.path]}),_e.shadows.length>0&&(0,H.jsxs)(`div`,{children:[`Shadows:`,` `,_e.shadows.map(e=>`${e.source}(${e.displayPath??e.path})`).join(`, `)]})]})]}),Ve.error&&(0,H.jsxs)(r,{children:[(0,H.jsx)(t,{id:a(`schema-errors`),children:`Schema errors`}),(0,H.jsxs)(`div`,{className:`border-destructive/40 bg-destructive/10 text-destructive mt-2 rounded-md border px-3 py-2 text-sm`,children:[`schema.yaml parse error: `,Ve.error]})]}),(0,H.jsxs)(r,{children:[(0,H.jsx)(t,{id:a(`artifacts`),children:`Artifacts`}),Ge.length>0?(0,H.jsx)(`div`,{className:`mt-3 space-y-6`,children:Ge.map(e=>{let t=We.get(e.id),i=Se?.[e.id]??(xe?.[e.id]?{...xe[e.id],content:null}:null),o=i?.path??(typeof t?.template==`string`?t.template:void 0),s=i?.displayPath??o??null,c=o===void 0?void 0:Ke.get(o),l=c===void 0?i?i.content:null:c,u=[[`id`,t?.id??e.id],[`generates`,t?.generates??e.outputPath],[`description`,t?.description??e.description],[`instruction`,t?.instruction],[`requires`,t?.requires??e.requires]].filter(e=>e[1]!==void 0),d=t?Object.entries(t).filter(([e])=>!E3e.has(e)):[];return(0,H.jsxs)(r,{className:`space-y-3`,children:[(0,H.jsx)(n,{id:a(`artifact-${e.id}`),children:e.id}),(0,H.jsxs)(`div`,{className:`border-border space-y-4 rounded-lg border px-4 py-4 text-sm`,children:[(0,H.jsx)(`div`,{className:`space-y-3`,children:u.map(([e,t])=>{let n=e===`requires`,r=n&&Array.isArray(t)?t.filter(e=>typeof e==`string`):[];return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs font-semibold uppercase tracking-wide`,children:e}),(0,H.jsx)(`div`,{className:`pl-4 text-sm leading-6`,children:n?r.length>0?(0,H.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:r.map(e=>Ge.some(t=>t.id===e)?(0,H.jsx)(`a`,{href:`#${a(`artifact-${e}`)}`,className:`bg-primary hover:bg-primary/80 text-primary-foreground rounded-md px-2 py-0.5 text-xs transition-colors`,children:e},e):(0,H.jsx)(`span`,{className:`bg-muted text-muted-foreground rounded-md px-2 py-0.5 text-xs`,children:e},e))}):(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):bt(e,t)})]},e)})}),o&&(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs font-semibold uppercase tracking-wide`,children:`Template`}),(0,H.jsxs)(`div`,{className:`text-muted-foreground pl-4 text-xs`,children:[(0,H.jsx)(`span`,{className:`mr-1`,children:`Template:`}),(0,H.jsx)(`code`,{className:`bg-muted rounded px-1`,children:s}),i?.source?` (${i.source})`:null]}),l==null?(0,H.jsx)(`div`,{className:`text-muted-foreground pl-4 text-sm`,children:`Template content unavailable.`}):(0,H.jsx)(`div`,{className:`pl-4`,children:(0,H.jsx)(`div`,{className:`bg-muted/30 rounded-lg p-4 [zoom:0.86]`,children:(0,H.jsx)(j3,{markdown:l,collectToc:!1})})})]}),d.length>0&&(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs font-semibold uppercase tracking-wide`,children:`Extra fields`}),d.map(([e,t])=>(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:e}),(0,H.jsx)(`div`,{className:`pl-4 text-sm leading-6`,children:bt(e,t)})]},e))]})]})]},e.id)})}):(0,H.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:`Select a schema to view details.`}),ge?.applyRequires?.length?(0,H.jsxs)(`div`,{className:`text-muted-foreground mt-3 text-xs`,children:[`Apply requires: `,ge.applyRequires.join(`, `)]}):null]}),qe&&(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`Preview is rendering draft content. Save to persist changes.`})]})}}):(0,H.jsxs)(ZY,{ref:F,className:`flex min-h-0 flex-1 flex-col gap-4`,children:[be&&(0,H.jsxs)(`div`,{role:`alert`,className:`text-destructive text-xs`,children:[`Failed to load schema files: `,be.message]}),Ne?(0,H.jsx)(dL,{count:6}):Pe?(0,H.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,H.jsx)(tX,{entries:Me,selectedPath:Ce,onSelect:we,breadcrumbRoot:Ye,headerLabel:(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`uppercase tracking-wide`,children:`Files`}),(0,H.jsx)(`span`,{className:`text-muted-foreground/80 truncate text-[10px] normal-case`,title:Ye,children:Ye})]}),headerActions:pt.length>0?(0,H.jsx)(QY,{children:(0,H.jsx)(`button`,{type:`button`,onClick:e=>{M(null),P(null),A({type:`target`,element:e.currentTarget,placement:`bottom-end`})},className:`hover:bg-muted rounded-md p-1`,"aria-label":`Schema menu`,children:(0,H.jsx)(dc,{className:`h-4 w-4`})})}):void 0,entryActions:e=>{let t={id:`properties`,label:`Properties`,icon:(0,H.jsx)(Mc,{className:`h-3.5 w-3.5`}),onSelect:()=>ft(e)};if(a!==`edit`||!Ae)return[t];let n=e.type===`directory`?e.path:O3e(e.path),r=e.type===`directory`;return[{id:`new-file`,label:r?`New file inside`:`New sibling file`,icon:(0,H.jsx)(gc,{className:`h-3.5 w-3.5`}),onSelect:()=>ct(`file`,n)},{id:`new-folder`,label:r?`New folder inside`:`New sibling folder`,icon:(0,H.jsx)(wc,{className:`h-3.5 w-3.5`}),onSelect:()=>ct(`directory`,n)},t,{id:`delete`,label:`Delete`,icon:(0,H.jsx)(_l,{className:`h-3.5 w-3.5`}),tone:`destructive`,onSelect:()=>ut(e)}]},emptyState:(0,H.jsx)(`span`,{children:`No files found for this schema.`}),renderEditor:e=>e?(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[a===`edit`&&(0,H.jsxs)(`div`,{className:`border-border/50 flex items-center justify-between border-b px-3 py-2 text-xs`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(QY,{children:(0,H.jsx)(`button`,{type:`button`,onClick:e=>{A(null),P(null),M({type:`target`,element:e.currentTarget,placement:`bottom-start`})},className:`hover:bg-muted rounded-md px-2 py-1 text-xs font-semibold`,children:`File`})}),(0,H.jsx)(QY,{children:(0,H.jsx)(`button`,{type:`button`,onClick:e=>{A(null),M(null),P({type:`target`,element:e.currentTarget,placement:`bottom-start`})},className:`hover:bg-muted rounded-md px-2 py-1 text-xs font-semibold`,children:`View`})})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:at,className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium`,children:[(0,H.jsx)(Cl,{className:`h-3.5 w-3.5`}),`Cancel`]}),(0,H.jsxs)(nL,{size:`sm`,onClick:ot,disabled:Ze.isPending||!ke,activity:Ze.isPending,children:[(0,H.jsx)(rl,{className:`h-3.5 w-3.5`}),`Save`]})]})]}),(0,H.jsx)(nX,{file:e,value:a===`edit`?Ie??e.content??``:e.content??``,readOnly:a!==`edit`||!ke,onChange:a===`edit`?it:void 0,lineWrapping:ee,editorMinHeight:`0px`}),_e?.source===`package`&&(0,H.jsx)(`div`,{className:`text-muted-foreground border-border/50 border-t px-3 py-2 text-xs`,children:`Package-provided schemas are read-only.`})]}):(0,H.jsx)(`div`,{className:`text-muted-foreground flex h-full items-center justify-center`,children:`Select a file to view`})})}):null,(0,H.jsx)(XY,{open:!!k,items:pt,anchor:k,boundaryElement:F.current,onClose:()=>A(null)}),(0,H.jsx)(XY,{open:!!j,items:mt,anchor:j,boundaryElement:F.current,onClose:()=>M(null)}),(0,H.jsx)(XY,{open:!!N,items:ht,anchor:N,boundaryElement:F.current,onClose:()=>P(null)})]}):(0,H.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:`Select a schema to view details.`})})]})});return(0,H.jsx)(S9,{current:`schemas`,header:(0,H.jsx)(C9,{backHref:`/config/schemas`,backLabel:`Schemas`,title:he?`Schema: ${he}`:`Schema`,description:`Inspect resolved schema facts, preview artifacts, and edit writable physical files.`,icon:(0,H.jsx)(Pc,{className:`h-6 w-6 shrink-0`,"aria-hidden":!0})}),children:(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(El,{open:d,onClose:()=>f(!1),title:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Pc,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{className:`text-sm font-semibold`,children:`Add schema`})]}),footer:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>f(!1),className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium`,children:`Cancel`}),(0,H.jsxs)(`button`,{type:`button`,onClick:vt,disabled:!ke||!I.trim()||tt.isPending,"aria-busy":tt.isPending||void 0,className:`bg-primary text-primary-foreground inline-flex items-center gap-2 rounded-md px-3 py-1.5 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,H.jsx)($c,{className:`h-3.5 w-3.5`}),`Create`]})]}),children:(0,H.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[(0,H.jsxs)(`label`,{className:`space-y-1`,children:[(0,H.jsx)(`div`,{className:`text-xs font-medium`,children:`Schema name`}),(0,H.jsx)(`input`,{value:I,disabled:!ke||tt.isPending,onChange:e=>{ne(e.target.value),c(null)},placeholder:`schema-name`,className:`border-border bg-card w-full rounded-md border px-3 py-2 text-sm`})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-xs font-medium`,children:`Create mode`}),(0,H.jsx)(IL,{value:L,onChange:re,options:[{value:`init`,label:`Init`,disabled:!ke},{value:`fork`,label:`Fork`,disabled:!ke}]})]}),L===`fork`&&(0,H.jsxs)(`label`,{className:`space-y-1`,children:[(0,H.jsx)(`div`,{className:`text-xs font-medium`,children:`Fork from`}),(0,H.jsx)(e8,{value:ie,options:ze,onValueChange:ae,ariaLabel:`Fork from`,disabled:!ke,className:`w-full`})]}),s&&(0,H.jsx)(`div`,{className:`text-destructive text-xs`,children:s})]})}),(0,H.jsx)(El,{open:p,onClose:()=>m(!1),borderVariant:`error`,title:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(_l,{className:`text-destructive h-4 w-4`}),(0,H.jsx)(`span`,{className:`text-sm font-semibold`,children:`Delete schema`})]}),footer:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>m(!1),className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium`,children:`Cancel`}),(0,H.jsxs)(`button`,{type:`button`,onClick:yt,disabled:!ke||nt.isPending,"aria-busy":nt.isPending||void 0,className:`bg-destructive text-destructive-foreground inline-flex items-center gap-2 rounded-md px-3 py-1.5 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,H.jsx)(_l,{className:`h-3.5 w-3.5`}),`Delete`]})]}),children:(0,H.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[(0,H.jsxs)(`p`,{children:[`This will permanently delete`,` `,(0,H.jsx)(`code`,{className:`bg-muted rounded px-1`,children:he}),` and all of its template files.`]}),(0,H.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`This action cannot be undone.`}),s&&(0,H.jsx)(`div`,{className:`text-destructive text-xs`,children:s})]})}),(0,H.jsx)(El,{open:h,onClose:()=>{g(!1),u(null)},title:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x===`file`?(0,H.jsx)(gc,{className:`h-4 w-4`}):(0,H.jsx)(wc,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{className:`text-sm font-semibold`,children:x===`file`?`New file`:`New folder`})]}),footer:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>g(!1),className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium`,children:`Cancel`}),(0,H.jsxs)(`button`,{type:`button`,onClick:lt,disabled:!Ae||!T.trim()||Qe.isPending||$e.isPending,"aria-busy":Qe.isPending||$e.isPending||void 0,className:`bg-primary text-primary-foreground inline-flex items-center gap-2 rounded-md px-3 py-1.5 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50`,children:[x===`file`?(0,H.jsx)(gc,{className:`h-3.5 w-3.5`}):(0,H.jsx)(wc,{className:`h-3.5 w-3.5`}),`Create`]})]}),children:(0,H.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,H.jsxs)(`div`,{className:`text-muted-foreground text-xs`,children:[`Parent: `,(0,H.jsx)(`code`,{className:`bg-muted rounded px-1`,children:C??`/`})]}),(0,H.jsxs)(`label`,{className:`space-y-1`,children:[(0,H.jsx)(`div`,{className:`text-xs font-medium`,children:x===`file`?`File name`:`Folder name`}),(0,H.jsx)(`input`,{value:T,disabled:!Ae||Qe.isPending||$e.isPending,onChange:e=>{E(e.target.value),u(null)},placeholder:x===`file`?`new-file.md`:`new-folder`,className:`border-border bg-card w-full rounded-md border px-3 py-2 text-sm`})]}),l&&(0,H.jsx)(`div`,{className:`text-destructive text-xs`,children:l})]})}),(0,H.jsx)(El,{open:_,onClose:()=>{v(!1),O(null)},borderVariant:`error`,title:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(_l,{className:`text-destructive h-4 w-4`}),(0,H.jsx)(`span`,{className:`text-sm font-semibold`,children:`Delete entry`})]}),footer:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>v(!1),className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium`,children:`Cancel`}),(0,H.jsxs)(`button`,{type:`button`,onClick:dt,disabled:!Ae||!D||et.isPending,"aria-busy":et.isPending||void 0,className:`bg-destructive text-destructive-foreground inline-flex items-center gap-2 rounded-md px-3 py-1.5 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,H.jsx)(_l,{className:`h-3.5 w-3.5`}),`Delete`]})]}),children:(0,H.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[(0,H.jsxs)(`p`,{children:[`This will permanently delete`,` `,(0,H.jsx)(`code`,{className:`bg-muted rounded px-1`,children:D?.path??`selected entry`}),`.`]}),(0,H.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`This action cannot be undone.`}),l&&(0,H.jsx)(`div`,{className:`text-destructive text-xs`,children:l})]})}),(0,H.jsx)(El,{open:y,onClose:()=>{b(!1),O(null)},title:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Mc,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{className:`text-sm font-semibold`,children:`Entry properties`})]}),footer:(0,H.jsx)(`button`,{type:`button`,onClick:()=>b(!1),className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium`,children:`Close`}),children:(0,H.jsx)(`div`,{className:`space-y-2 text-sm`,children:Je?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`Path`}),(0,H.jsx)(`code`,{className:`bg-muted rounded px-1`,children:Je.path})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`Type`}),(0,H.jsx)(`span`,{children:Je.type})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`Source`}),(0,H.jsx)(`span`,{children:Je.source})]}),Je.sizeBytes!==void 0&&(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`Size`}),(0,H.jsxs)(`span`,{children:[Je.sizeBytes,` bytes`]})]}),Je.childCount!==void 0&&(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`Items`}),(0,H.jsx)(`span`,{children:Je.childCount})]})]}):(0,H.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:`No entry selected.`})})}),(0,H.jsxs)(`div`,{"data-schema-workspace-status":`true`,className:`space-y-4`,children:[ue?(0,H.jsxs)(`div`,{role:`alert`,className:`text-destructive border-destructive/40 bg-destructive/10 flex items-start gap-2 rounded-lg border p-4 text-sm`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`font-medium`,children:`Schema catalog refresh failed.`}),(0,H.jsx)(`p`,{children:ue.message})]})]}):null,pe?(0,H.jsx)(`section`,{"aria-label":`Loading Schema detail`,className:`border-border bg-card rounded-lg border p-4`,children:(0,H.jsx)(dL,{count:6})}):null,me?(0,H.jsx)(`div`,{className:`text-muted-foreground rounded-lg border border-dashed p-4 text-sm`,children:`No schemas available.`}):null,fe!==void 0&&fe.length>0&&!Re?(0,H.jsxs)(`div`,{role:`alert`,className:`text-destructive rounded-lg border p-4 text-sm`,children:[`Schema `,he||`(missing id)`,` was not found.`]}):null,Re?xt:null]})]})})}function M3e(e){let t=e.replace(/\\/g,`/`).replace(/\/{2,}/g,`/`);return t===`/`?t:t.replace(/\/$/,``)}function N3e(e){let t=e?.planningRoot?.path;if(!e||!t)return`unresolved`;let n=e.launchProject.physicalPath;return n?M3e(n)===M3e(t)?`collapsed`:`distinct`:`unresolved`}function P3e(e){if(Number.isFinite(e.observedAt)&&e.observedAt>0)return e.observedAt;let t=Date.parse(e.timestamp);return Number.isFinite(t)?t:null}function F3e(e){if(!e)return null;let t=e.meta.referencePolicy,n=t?t.kind===`include`?{kind:`include`,sources:t.referenceSources}:t.kind===`omit`?{kind:`omit`,sourceCount:t.referenceSourceCount}:{kind:`none`}:{kind:`unrecorded`};return{observedAt:P3e(e.meta),projectName:e.meta.projectName,referencePolicy:n,root:e.meta.root??null,version:e.meta.version}}var I3e=(0,V.createContext)({snapshot:null,basePath:`/`,isStatic:!1});function L3e(){return(0,V.useContext)(I3e).snapshot}function R3e(){let e=F3e(L3e()??Vf());return(0,H.jsx)(S9,{current:`context`,header:(0,H.jsx)(I4e,{status:`static`}),children:e?(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(`section`,{className:`border-border min-w-0 border-y py-3`,children:(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`Published effective root`}),(0,H.jsx)(`div`,{className:`mt-1 min-w-0 break-all font-mono text-sm font-medium`,children:e.root?.planningRootPath??`No planning root path was published.`})]}),e.root?(0,H.jsx)(g9,{ariaLabel:`Published root source ${e.root.rootSource}`,tooltip:`OpenSpec reported root source ${e.root.rootSource} at export time.`,children:e.root.rootSource}):null,e.root?.storeId?(0,H.jsxs)(g9,{ariaLabel:`Published Store ${e.root.storeId}`,tooltip:`The exported Planning root used Store ${e.root.storeId}.`,children:[`Store `,e.root.storeId]}):null,(0,H.jsx)(g9,{ariaLabel:`Static Context evidence boundary`,tooltip:`Only publication-safe facts are available; this snapshot has no live authority.`,children:`Published facts`})]})}),(0,H.jsx)(z3e,{policy:e.referencePolicy}),(0,H.jsxs)(_9,{title:`Publication details`,summary:`${e.projectName} · OpenSpecUI ${e.version}`,children:[(0,H.jsxs)(`dl`,{className:`text-muted-foreground grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs`,children:[(0,H.jsx)(`dt`,{children:`project`}),(0,H.jsx)(`dd`,{className:`break-words`,children:e.projectName}),(0,H.jsx)(`dt`,{children:`OpenSpecUI version`}),(0,H.jsx)(`dd`,{children:e.version}),(0,H.jsx)(`dt`,{children:`observed at`}),(0,H.jsx)(`dd`,{children:e.observedAt===null?`unavailable`:new Date(e.observedAt).toISOString()})]}),(0,H.jsx)(`p`,{className:`text-muted-foreground mt-3 break-words`,children:`Runtime CLI evidence, registry, and data scope are not published. This snapshot claims no live connection, mutation authority, or current Reference health.`})]})]}):(0,H.jsxs)(`section`,{className:`border-border rounded-lg border p-4`,role:`status`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Static Context unavailable`}),(0,H.jsx)(`p`,{className:`text-muted-foreground mt-1 text-sm`,children:`This export does not contain a readable snapshot.`})]})})}function z3e({policy:e}){return(0,H.jsx)(_9,{title:`Published Reference policy`,summary:e.kind===`none`?`None recorded`:e.kind===`omit`?`${e.sourceCount} omitted`:e.kind===`unrecorded`?`Legacy unrecorded`:`${e.sources.length} included`,children:e.kind===`none`?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No effective References were recorded when this snapshot was exported.`}):e.kind===`omit`?(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[e.sourceCount,` Reference sources were observed and omitted from this export. Their identities and content were not published.`]}):e.kind===`unrecorded`?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`This snapshot predates the explicit Reference export policy.`}):(0,H.jsx)(`ul`,{className:`divide-border divide-y`,children:e.sources.map(e=>(0,H.jsxs)(`li`,{className:`flex min-w-0 items-center justify-between gap-3 py-2 first:pt-0 last:pb-0`,children:[(0,H.jsx)(`span`,{className:`min-w-0 break-all font-mono text-sm`,children:e.storeId}),(0,H.jsxs)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:[e.specCount,` published Specs · export state `,e.state]})]},e.storeId))})})}function B3e(){return Lf()?(0,H.jsx)(R3e,{}):(0,H.jsx)(V3e,{})}function V3e(){let{data:e,isLoading:t,error:n,authority:r}=l9(),i=c2e(e),a=e?.state===`error`?e.error:null,o=!n&&!a&&(t||e?.state===`loading`)&&i===null,s=e?.state===`error`?e.data:null,c=e?.state===`error`?e.attempt:null,l=n||a||r.state===`failed`?`blocked`:o?`resolving`:e?.state===`refreshing`||r.state!==`current`?`refreshing`:`ready`,u=i?[...i.diagnostics.root,...i.diagnostics.doctor,...i.diagnostics.context,...i.references.flatMap(e=>e.status)]:[],d=M4e(`resolved-context`,s3e({available:i!==null,loading:o,transportError:n?.message??a?.message??null,authorityFailed:r.state===`failed`,refreshing:e?.state===`refreshing`,authorityCurrent:r.state===`current`,hasPlanningRoot:i?.planningRoot!==null&&i?.planningRoot!==void 0,cliAvailable:i?.cli.available??!1,cliError:i?.cli.error??null,errorDiagnostic:u.find(e=>e.severity===`error`)?.message??null,warningDiagnostic:u.find(e=>e.severity===`warning`)?.message??null}));return(0,H.jsx)(S9,{current:`context`,header:(0,H.jsx)(I4e,{status:l}),children:(0,H.jsxs)(`div`,{...d,className:`space-y-6`,children:[o?(0,H.jsx)(dL,{count:4}):null,n||a?(0,H.jsxs)(`div`,{role:`alert`,className:`text-destructive border-destructive/40 bg-destructive/10 flex items-start gap-2 rounded-lg border p-4 text-sm`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`font-medium`,children:`Root Context is not ready.`}),(0,H.jsx)(`p`,{children:n?.message??a?.message}),e?.state===`error`&&e.data?(0,H.jsx)(`p`,{className:`text-muted-foreground mt-1 text-xs`,children:`Showing the last successful observation while retaining the failed CLI attempt.`}):null]})]}):null,!o&&s&&c?(0,H.jsxs)(`div`,{className:`space-y-6`,children:[(0,H.jsx)(R9,{label:`Last successful Context (stale)`,context:s}),(0,H.jsx)(R9,{label:`Current failed attempt`,context:c,rootHeading:`Attempted planning root`})]}):!o&&c?(0,H.jsx)(R9,{label:`Current failed attempt`,context:c,rootHeading:`Attempted planning root`}):!o&&i?(0,H.jsx)(iL,{active:e?.state===`refreshing`,children:(0,H.jsx)(H3e,{context:i,actionStatus:e?.state===`ready`&&r.state===`current`?`ready`:r.state===`failed`?`blocked`:`checking`})}):null]})})}function R9({context:e,label:t,rootHeading:n}){return(0,H.jsxs)(`section`,{"aria-label":t,className:`space-y-3`,children:[(0,H.jsx)(`h2`,{className:`text-muted-foreground text-xs font-semibold uppercase`,children:t}),(0,H.jsx)(H3e,{context:e,rootHeading:n})]})}function H3e({actionStatus:e=`blocked`,context:t,rootHeading:n=`Active planning root`}){let r=t.planningRoot,i=[...t.diagnostics.root,...t.diagnostics.doctor,...t.diagnostics.context],a=t.references.flatMap(e=>e.status.filter(e=>e.severity===`error`).map(t=>`${e.store_id}: ${t.message}`)),o=[t.evidence.doctor?.contractError?`Doctor contract drift: ${t.evidence.doctor.contractError}`:null,t.evidence.context?.contractError?`Context contract drift: ${t.evidence.context.contractError}`:null].filter(e=>e!==null),s=t.references.reduce((e,t)=>e+t.status.length,0),c=N3e(t),l=i.filter(e=>e.severity===`warning`&&e.code===`root_pointer_ignored`),u=i.filter(e=>e.severity===`error`),d=i.filter(e=>e.severity!==`error`),f=c===`collapsed`?{label:`Single project root`,tooltip:`Launch and Planning resolve to the same physical project root.`}:c===`distinct`?{label:`Separate roots`,tooltip:`Launch and Planning resolve to different physical roots.`}:{label:`Relationship unresolved`,tooltip:`The server has not observed enough physical identity evidence to compare the roots.`};return(0,H.jsxs)(`div`,{className:`@container min-w-0 space-y-4`,children:[(0,H.jsxs)(`section`,{"aria-label":`Operational Context`,className:`border-border min-w-0 divide-y border-y`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-2 py-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:c===`collapsed`?`Project root`:n}),(0,H.jsx)(`div`,{className:`mt-1 min-w-0 break-all font-mono text-sm font-medium`,children:r?.path??`No planning root resolved.`})]}),r?(0,H.jsx)(g9,{ariaLabel:`Planning root source ${r.source}`,tooltip:`OpenSpec selected this root from source: ${r.source}.`,children:r.source}):null,t.storeId?(0,H.jsxs)(g9,{ariaLabel:`Planning Store ${t.storeId}`,tooltip:`The CLI-selected Planning root uses Store ${t.storeId}.`,children:[`Store `,t.storeId]}):null,(0,H.jsx)(g9,{ariaLabel:`Root relationship ${f.label.toLowerCase()}`,tooltip:f.tooltip,children:f.label}),l.length>0?(0,H.jsx)(g9,{ariaLabel:`Ignored Store declaration warning`,tooltip:`OpenSpec ignored the Store declaration because a real project root takes precedence. See CLI diagnostics for the reported fix.`,tone:`custom`,className:`border-amber-500/40 bg-amber-500/10 text-amber-800 dark:text-amber-200`,children:`Store declaration ignored`}):null]}),(0,H.jsxs)(`div`,{className:`grid min-w-0 gap-4 py-3 ${c===`collapsed`?``:`@[36rem]:grid-cols-2`}`,children:[c===`collapsed`?null:(0,H.jsx)(U3e,{label:`Launch project`,value:t.launchProject.path,mono:!0}),(0,H.jsx)(U3e,{label:`References`,value:`${t.references.length} observed`,detail:`${s} CLI diagnostics`})]})]}),t.cli.error?(0,H.jsxs)(`div`,{className:`text-destructive flex items-start gap-2 text-sm`,role:`alert`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),t.cli.error]}):null,a.length>0?(0,H.jsxs)(`div`,{className:`text-destructive flex items-start gap-2 text-sm`,role:`alert`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),a.join(` `)]}):null,o.length>0?(0,H.jsxs)(`div`,{className:`text-destructive flex items-start gap-2 text-sm`,role:`alert`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),o.join(` `)]}):null,u.length>0?(0,H.jsxs)(`div`,{className:`text-destructive flex items-start gap-2 text-sm`,role:`alert`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{children:u.map(e=>`${e.code}: ${e.message}`).join(` `)})]}):null,(0,H.jsx)(_9,{title:`Referenced context`,summary:`${t.references.length} References · ${t.contextMembers.length} members`,children:(0,H.jsxs)(`div`,{className:`space-y-4`,children:[t.references.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No reference currently observed.`}):(0,H.jsx)(`ul`,{className:`divide-border divide-y`,children:t.references.map(e=>(0,H.jsxs)(`li`,{className:`space-y-1 py-2 first:pt-0 last:pb-0`,children:[(0,H.jsx)(`p`,{className:`break-all font-mono`,children:e.store_id}),e.status.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No CLI diagnostic reported.`}):e.status.map(e=>(0,H.jsxs)(`p`,{className:`break-words`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e.code}),`: `,e.message]},`${e.code}:${e.message}`))]},e.store_id))}),(0,H.jsx)(z9,{label:`Context members`,value:t.contextMembers})]})}),(0,H.jsx)(W3e,{context:t,actionStatus:e}),(0,H.jsx)(_9,{title:`CLI diagnostics`,summary:d.length===0?`No supporting diagnostics`:`${d.length} supporting`,children:d.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No supporting CLI diagnostics were reported.`}):(0,H.jsx)(`ul`,{className:`space-y-3`,children:d.map(e=>(0,H.jsxs)(`li`,{className:`space-y-1 break-words`,children:[(0,H.jsxs)(`p`,{className:`font-medium`,children:[e.severity,` · `,e.code,e.target?` · ${e.target}`:``]}),(0,H.jsx)(`p`,{children:e.message}),e.fix?(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Fix: `,e.fix]}):null]},`${e.code}:${e.message}`))})}),(0,H.jsx)(_9,{title:`CLI evidence`,summary:`doctor + context · CLI ${t.cli.version??`unavailable`}`,children:(0,H.jsxs)(`div`,{className:`space-y-5`,children:[(0,H.jsx)(G3e,{label:`Doctor command`,evidence:t.evidence.doctor}),(0,H.jsx)(G3e,{label:`Context command`,evidence:t.evidence.context})]})})]})}function U3e({label:e,value:t,detail:n,mono:r=!1}){return(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:e}),(0,H.jsx)(`div`,{className:`mt-1 min-w-0 break-all text-sm ${r?`font-mono`:`font-medium`}`,children:t}),n?(0,H.jsx)(`div`,{className:`text-muted-foreground mt-0.5 text-[11px]`,children:n}):null]})}function W3e({actionStatus:e,context:t}){return(0,H.jsx)(_9,{title:`Resolution details`,summary:`Authority ${e}`,children:(0,H.jsxs)(`dl`,{className:`text-muted-foreground grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs`,children:[(0,H.jsx)(`dt`,{children:`root authority`}),(0,H.jsx)(`dd`,{children:e}),(0,H.jsx)(`dt`,{children:`observed at`}),(0,H.jsx)(`dd`,{children:new Date(t.observedAt).toISOString()}),(0,H.jsx)(`dt`,{children:`CLI available`}),(0,H.jsx)(`dd`,{children:String(t.cli.available)}),(0,H.jsx)(`dt`,{children:`CLI version`}),(0,H.jsx)(`dd`,{children:t.cli.version??`unavailable`}),(0,H.jsx)(`dt`,{children:`effective command`}),(0,H.jsx)(`dd`,{className:`break-all`,children:t.cli.effectiveCommand??`unavailable`}),(0,H.jsx)(`dt`,{children:`data scope`}),(0,H.jsx)(`dd`,{className:`break-all`,children:t.dataScope.path}),(0,H.jsx)(`dt`,{children:`data source`}),(0,H.jsxs)(`dd`,{children:[t.dataScope.source,t.dataScope.environmentVariable?` · ${t.dataScope.environmentVariable}`:``]}),(0,H.jsx)(`dt`,{children:`Store registry`}),(0,H.jsx)(`dd`,{children:`Read-only from this project workspace`})]})})}function z9({label:e,value:t}){let n=typeof t==`string`?t:JSON.stringify(t,null,2);return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`h3`,{className:`text-xs font-semibold`,children:e}),(0,H.jsx)(`pre`,{className:`bg-muted scrollbar-thin scrollbar-track-transparent max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md p-3 text-xs`,children:n})]})}function G3e({label:e,evidence:t}){return t?(0,H.jsxs)(`section`,{className:`border-border border-t pt-3`,children:[(0,H.jsx)(`h3`,{className:`text-xs font-semibold`,children:e}),(0,H.jsxs)(`dl`,{className:`text-muted-foreground mt-3 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:[(0,H.jsx)(`dt`,{children:`process success`}),(0,H.jsx)(`dd`,{children:String(t.success)}),(0,H.jsx)(`dt`,{children:`exit status`}),(0,H.jsx)(`dd`,{children:t.exitCode??`unknown`}),t.contractError?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{children:`contract drift`}),(0,H.jsx)(`dd`,{className:`text-destructive break-words`,children:t.contractError})]}):null]}),t.stderr?(0,H.jsx)(z9,{label:`stderr`,value:t.stderr}):null,(0,H.jsx)(z9,{label:`diagnostics`,value:t.diagnostics}),(0,H.jsx)(z9,{label:`stdout`,value:t.stdout})]}):(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h3`,{className:`text-xs font-semibold`,children:e}),(0,H.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`No command evidence observed.`})]})}var K3e={defaultScope:`code`,code:{scope:`code`,bindingToken:null,rootPath:``,repository:null},planningState:`settled`,planning:null};function q3e(e=!0){return Ly(t=>e?Cy.git.subscribeScopes.subscribe(void 0,{onData:t.onData,onError:t.onError,onConnectionStateChange:e=>t.onConnectionStateChange({state:e.state,error:e.error}),onStopped:t.onStopped,onComplete:t.onComplete}):{unsubscribe(){}},async()=>K3e,[e],`git.subscribeScopes`)}function J3e({staticMode:e}){return e?null:(0,H.jsx)(Y3e,{})}function Y3e(){let{data:e,isLoading:t,error:n}=l9(),r=c2e(e),i=q3e(),a=e?.state===`error`?e.error:null,o=r?X3e(r.references):null,s=r?.references.map(e=>({storeId:e.store_id,errors:e.status.filter(e=>e.severity===`error`).length})).filter(e=>e.errors>0)??[],c=i.authority.state===`failed`?i.authority.error.message:i.authority.state===`current`&&i.data?.planningState===`failed`?i.data.planningError.message:null;return e?.state===`ready`&&N3e(r)===`collapsed`&&r?.references.length===0&&!n&&!a&&i.authority.state===`current`&&i.data?.planningState===`settled`&&i.data.planning===null&&!c?null:(0,H.jsxs)(`section`,{"aria-label":`Dashboard data scopes`,className:`border-border border-y py-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,H.jsx)(`h2`,{className:`sr-only`,children:`Data scopes`}),t&&!r?(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,"aria-busy":`true`,children:(0,H.jsx)(oL,{className:`w-52`})}):r?(0,H.jsx)(iL,{active:e?.state===`refreshing`,children:(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-2`,children:[(0,H.jsx)(yc,{className:`text-muted-foreground h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`min-w-0 truncate text-sm`,title:r.planningRoot?.path,children:r.planningRoot?.path??`No planning root resolved.`}),(0,H.jsx)(g9,{ariaLabel:`Planning root source ${r.planningRoot?.source??`unresolved`}${r.storeId?`, Store ${r.storeId}`:``}`,tooltip:(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`div`,{children:[`Planning root: `,r.planningRoot?.path??`Not resolved`]}),(0,H.jsxs)(`div`,{children:[`Source: `,r.planningRoot?.source??`unresolved`]}),(0,H.jsxs)(`div`,{children:[`Store: `,r.storeId??`none`]})]}),children:r.storeId?`Store ${r.storeId}`:r.planningRoot?.source??`unresolved`}),(0,H.jsxs)(g9,{ariaLabel:`${r.references.length} direct References, ${o?.errors??0} errors, ${o?.warnings??0} warnings`,tooltip:(0,H.jsx)(Z3e,{references:r.references}),tone:o?.errors?`custom`:`muted`,className:o?.errors?`border-destructive/40 bg-destructive/10 text-destructive`:void 0,children:[`References `,r.references.length]}),i.authority.state===`current`&&i.data?(0,H.jsx)(g9,{ariaLabel:Q3e(i.data),tooltip:(0,H.jsx)($3e,{scopes:i.data}),children:i.data.planningState===`resolving`?`Git resolving`:`Git ${i.data.planning?`2 repos`:`1 repo`}`}):i.authority.state===`waiting`?(0,H.jsx)(oL,{className:`w-16`}):null]})}):null,(0,H.jsx)(Nb,{to:`/config/context`,className:`text-primary text-xs hover:underline`,children:`Resolved Context`})]}),n||a?(0,H.jsxs)(`div`,{className:`text-destructive mt-2 flex items-start gap-2 text-xs`,role:`alert`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{children:n?.message??a?.message})]}):null,s.length>0?(0,H.jsxs)(`div`,{className:`text-destructive mt-2 flex items-start gap-2 text-xs`,role:`alert`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),(0,H.jsxs)(`span`,{children:[`Reference errors:`,` `,s.map(({storeId:e,errors:t})=>`${e} (${t})`).join(`, `)]})]}):null,c?(0,H.jsxs)(`div`,{className:`text-destructive mt-2 flex items-start gap-2 text-xs`,role:`alert`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),(0,H.jsxs)(`span`,{children:[`Git scope binding failed: `,c]})]}):null]})}function X3e(e){return e.reduce((e,t)=>(e.total+=t.status.length,e.errors+=t.status.filter(e=>e.severity===`error`).length,e.warnings+=t.status.filter(e=>e.severity===`warning`).length,e),{errors:0,warnings:0,total:0})}function Z3e({references:e}){return e.length===0?(0,H.jsx)(`span`,{children:`No direct References observed.`}):(0,H.jsx)(`ul`,{className:`space-y-1`,children:e.map(e=>{let t=X3e([e]);return(0,H.jsxs)(`li`,{children:[e.store_id,`: `,t.errors,` error · `,t.warnings,` warning · `,t.total,` `,`total`]},e.store_id)})})}function Q3e(e){return e.planningState===`resolving`?`Code Git current, Planning Git resolving`:e.planning?`Code and distinct Planning Git repositories`:`Code Git repository`}function $3e({scopes:e}){return(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`div`,{children:[`Code repository: `,e.code.repository?.topLevel??e.code.rootPath]}),e.planningState===`resolving`?(0,H.jsx)(`div`,{children:`Resolving Planning Git repository.`}):e.planningState===`failed`?(0,H.jsxs)(`div`,{children:[`Planning Git repository binding failed: `,e.planningError.message]}):e.planning?(0,H.jsxs)(`div`,{children:[`Distinct Planning repository:`,` `,e.planning.repository?.topLevel??e.planning.rootPath]}):(0,H.jsx)(`div`,{children:`No distinct Planning Git repository.`})]})}var e6e=`openspecui:dashboard:git-auto-refresh`,t6e={"30s":3e4,"5min":5*6e4,"30min":30*6e4,none:null};function n6e(e){return e===`30s`||e===`5min`||e===`30min`||e===`none`}function r6e(){if(typeof window>`u`)return`none`;try{let e=window.localStorage.getItem(e6e);return n6e(e)?e:`none`}catch{return`none`}}function i6e(e){if(!(typeof window>`u`))try{window.localStorage.setItem(e6e,e)}catch{}}function B9(e){return t6e[e]}function a6e(e){return`auto-refresh:${e}`}function V9(e){return e.type===`commit`?Number.isFinite(e.committedAt)&&e.committedAt>0?e.committedAt:null:Number.isFinite(e.updatedAt)&&(e.updatedAt??0)>0?e.updatedAt:null}function o6e(e){return[...e].sort((e,t)=>e.type===t.type?(V9(t)??0)-(V9(e)??0):e.type===`uncommitted`?-1:1)}function s6e(e,t,n=Date.now()){if(!e||!t||t<=0)return 0;let r=Math.max(0,n-e);return Math.min(1,r/t)}var c6e=`border-zinc-400/50`,l6e=`bg-zinc-500/8`,u6e=`border-zinc-400/50`;function H9(e){return!(`state`in e)||e.state===`ready`}function d6e(e){return H9(e)&&(e.insertions>0||e.deletions>0)}function U9(e){return e.length===0?`linked openspec changes: none`:e.length===1?`linked openspec changes: ${e[0]}`:`linked openspec changes: ${e.join(`, `)}`}function f6e(e){return/^https?:\/\//.test(e)}async function p6e(e){if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`absolute`,t.style.left=`-9999px`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),document.body.removeChild(t)}function m6e({preset:e}){return e===`30s`?(0,H.jsx)(ac,{className:`h-3.5 w-3.5`}):e===`5min`?(0,H.jsx)(oc,{className:`h-3.5 w-3.5`}):e===`30min`?(0,H.jsx)(sc,{className:`h-3.5 w-3.5`}):(0,H.jsx)($s,{className:`h-3.5 w-3.5`})}function h6e(e){return{family:`git`,entityId:Mp(e)}}function g6e(e,t){if(t.trim().length===0)throw Error(`Git handoff requires a non-empty binding token.`);let n=Mp(e);if(n.trim().length===0)throw Error(`Git entity id must be non-empty.`);return{family:`git`,entityId:n,bindingToken:t,title:e.title,subtitle:e.type===`commit`?`${e.hash.slice(0,8)} · ${U9(e.relatedChanges)}`:`working tree · ${U9(e.relatedChanges)}`}}function _6e({entry:e,selected:t=!1,onSelect:n}){let r=e.type===`commit`,i=V9(e),a=i?mL(i):r?`unknown time`:`working tree`,o=i?eCe(i):void 0,s=h6e(e);return(0,H.jsx)(`button`,{type:`button`,onClick:t=>n?.(e,t.currentTarget),...rb(s,`container`),className:`block w-full min-w-0 rounded-md border px-2 py-1.5 text-left ${r?`bg-sky-500/7 border-sky-500/30`:`bg-amber-500/7 border-amber-500/30`} ${t?`ring-primary ring-1`:``}`,children:(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium`,children:[r?(0,H.jsx)(Oc,{...rb(s,`icon`),className:`h-3.5 w-3.5 text-sky-600 dark:text-sky-300`}):(0,H.jsx)(Vc,{...rb(s,`icon`),className:`h-3.5 w-3.5 text-amber-600 dark:text-amber-300`}),(0,H.jsx)(`span`,{...rb(s,`title`),className:`truncate`,children:e.title})]}),(0,H.jsxs)(`div`,{className:`text-muted-foreground truncate text-[11px]`,children:[r?e.hash.slice(0,8):`working tree`,` ·`,` `,U9(e.relatedChanges)]})]}),(0,H.jsxs)(`div`,{className:`shrink-0 text-right`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,H.jsx)(b6e,{files:e.diff.files}),(0,H.jsx)(y6e,{diff:e.diff,className:`justify-end`})]}),(0,H.jsx)(nE,{content:o,delay:0,children:(0,H.jsx)(`span`,{className:`text-muted-foreground hover:text-foreground mt-0.5 inline-flex min-h-5 items-center rounded-sm bg-transparent px-1 py-0 text-[10px]`,title:o,children:a})})]})]})})}function v6e({worktree:e,emphasize:t,removing:n=!1,onRemoveDetachedWorktree:r}){let i=f6e(e.path),a=!i,o=!i&&e.detached&&!e.isCurrent,[s,c]=(0,V.useState)(!1),[l,u]=(0,V.useState)(!1),d=i?e.path:s?e.relativePath:e.path,f=(0,V.useCallback)(async()=>{try{await p6e(d),u(!0),window.setTimeout(()=>u(!1),1200)}catch(e){console.error(`[Git] Failed to copy worktree path:`,e)}},[d]);return(0,H.jsx)(`div`,{className:`min-w-0 rounded-e-md rounded-t-md border px-2.5 py-2 ${t?`${c6e} ${l6e}`:`border-border/70 bg-muted/15`}`,children:(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm font-medium`,children:[(0,H.jsx)(Dc,{className:`h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.branchName})]}),(0,H.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 items-center gap-1`,children:[a?(0,H.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`text-muted-foreground hover:text-foreground inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border border-transparent`,title:s?`Show absolute path`:`Show relative path`,"aria-label":s?`Show absolute path`:`Show relative path`,children:s?(0,H.jsx)(Sc,{className:`h-3.5 w-3.5`}):(0,H.jsx)(Cc,{className:`h-3.5 w-3.5`})}):null,(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{f()},onDoubleClick:()=>{a&&c(e=>!e)},className:`text-muted-foreground hover:text-foreground inline-flex min-w-0 flex-1 items-center gap-1 truncate text-left text-xs`,title:d,"aria-label":`Copy ${s&&a?`relative`:`absolute`} path for ${e.branchName}`,children:[(0,H.jsx)(`span`,{className:`truncate`,children:d}),l?(0,H.jsx)(Qs,{className:`h-3 w-3 shrink-0`}):(0,H.jsx)(lc,{className:`h-3 w-3 shrink-0`})]})]})]}),(0,H.jsx)(`div`,{className:`shrink-0 text-right`,children:(0,H.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[o?(0,H.jsx)(`button`,{type:`button`,onClick:()=>{r?.(e)},disabled:n,className:`text-muted-foreground hover:text-destructive inline-flex h-5 w-5 items-center justify-center rounded border border-transparent disabled:cursor-not-allowed disabled:opacity-60`,title:`Remove detached worktree`,"aria-label":`Remove detached worktree`,children:n?(0,H.jsx)(Vc,{className:`h-3.5 w-3.5 animate-spin`}):(0,H.jsx)(_l,{className:`h-3.5 w-3.5`})}):null,(0,H.jsx)(x6e,{ahead:e.ahead,behind:e.behind}),(0,H.jsx)(b6e,{files:e.diff.files}),(0,H.jsx)(y6e,{diff:e.diff,className:`justify-end`})]})})]})})}function y6e({diff:e,className:t=``}){return H9(e)&&!d6e(e)?null:H9(e)?(0,H.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] ${t}`,children:[(0,H.jsxs)(`span`,{className:`bg-emerald-500/12 inline-flex items-center gap-0.5 rounded border border-emerald-500/40 px-[0.15rem] py-0 font-mono text-[10px] text-emerald-700 dark:border-emerald-300/45 dark:bg-emerald-400/20 dark:text-emerald-100`,children:[(0,H.jsx)($c,{className:`h-2.5 w-2.5`}),(0,H.jsx)(`span`,{children:e.insertions})]}),(0,H.jsxs)(`span`,{className:`bg-rose-500/12 inline-flex items-center gap-0.5 rounded border border-rose-500/40 px-[0.15rem] py-0 font-mono text-[10px] text-rose-700 dark:border-rose-300/45 dark:bg-rose-400/20 dark:text-rose-100`,children:[(0,H.jsx)(Gc,{className:`h-2.5 w-2.5`}),(0,H.jsx)(`span`,{children:e.deletions})]})]}):(0,H.jsx)(`span`,{className:`inline-flex items-center rounded border border-zinc-500/35 bg-zinc-500/10 px-[0.15rem] py-0 font-mono text-[10px] text-zinc-700 dark:border-zinc-300/40 dark:bg-zinc-300/15 dark:text-zinc-100 ${t}`,children:e.state===`loading`?`loading`:`n/a`})}function b6e({files:e}){return e<=0?null:(0,H.jsxs)(rE,{tone:`custom`,size:`xs`,shape:`box`,className:`h-auto min-w-0 border border-zinc-500/35 bg-zinc-500/10 px-[0.15rem] py-0 font-mono text-[10px] font-normal text-zinc-700 dark:border-zinc-300/40 dark:bg-zinc-300/15 dark:text-zinc-100`,children:[e,`f`]})}function x6e({ahead:e,behind:t}){return(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border border-zinc-500/35 bg-zinc-500/10 px-[0.15rem] py-0 font-mono text-[10px] text-zinc-700 dark:border-zinc-300/40 dark:bg-zinc-300/15 dark:text-zinc-100`,children:[(0,H.jsxs)(`span`,{children:[`↑`,e]}),(0,H.jsxs)(`span`,{children:[`↓`,t]})]})}function S6e({options:e,value:t,onValueChange:n,progress:r,showProgress:i,disabled:a,animated:o,onRefresh:s}){return(0,H.jsxs)(`div`,{className:`border-border bg-card inline-flex overflow-hidden rounded-md border`,children:[(0,H.jsx)(e8,{value:t,options:e,onValueChange:n,ariaLabel:`Git auto refresh`,className:`text-foreground/75 hover:text-foreground border-r-current/10 bg-muted/20 relative isolate h-7 w-9 shrink-0 justify-center rounded-none border-0 border-r px-0`,positionerClassName:`z-50`,popupClassName:`min-w-[7rem]`,renderTrigger:({selectedOption:e})=>(0,H.jsxs)(`span`,{className:`relative inline-flex h-full w-full items-center justify-center overflow-hidden`,children:[(0,H.jsx)(`span`,{className:`bg-muted/20 pointer-events-none absolute inset-0`}),i?(0,H.jsx)(`span`,{className:`bg-primary/30 dark:bg-primary/35 pointer-events-none absolute inset-y-0 left-0 transition-[width]`,style:{width:`${r*100}%`}}):null,(0,H.jsx)(`span`,{className:`relative z-10 inline-flex items-center justify-center`,children:(0,H.jsx)(m6e,{preset:e?.value??t})})]})}),(0,H.jsxs)(`button`,{type:`button`,onClick:s,disabled:a,className:`inline-flex h-7 items-center gap-1 px-2 py-1 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-70 ${o?`text-primary bg-primary/10`:`text-foreground/75 hover:text-foreground`}`,children:[(0,H.jsx)(el,{className:`h-3.5 w-3.5 ${o?`animate-spin`:``}`}),`Refresh`]})]})}var C6e=32,W9=.08,w6e=.95;function T6e(e,t){if(e.length<=t)return e;let n=[],r=e.length/t;for(let i=0;i<t;i+=1){let t=Math.floor(i*r),a=Math.floor((i+1)*r),o=e.slice(t,Math.max(a,t+1)),s=o.reduce((e,t)=>e+t,0)/o.length;n.push(s)}return n}function E6e(e,t){if(e.length===0)return[];if(t===`monotonic`){let t=Math.max(...e);return t<=0?e.map(()=>W9):e.map(e=>Math.max(0,e)/t*(w6e-W9)+W9)}let n=Math.min(...e),r=Math.max(...e);return n===r?e.map(()=>.55):e.map(e=>(e-n)/(r-n)*.8+.15)}function D6e(e){return e.length===0?[]:e.map((t,n)=>n===0?`flat`:t>e[n-1]?`up`:t<e[n-1]?`down`:`flat`)}function O6e({bars:e,directions:t,trendKind:n}){if(e.length===0)return null;let r=e.length===1?Array.from({length:12},()=>e[0]):e,i=t.length===1?Array.from({length:r.length},()=>t[0]??`flat`):t;return(0,H.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-end gap-px px-2 py-2 opacity-50`,"data-testid":`dashboard-mini-trend-bars`,children:r.map((e,t)=>{let r=i[t]??`flat`;return(0,H.jsx)(`span`,{className:`${n===`bidirectional`?r===`up`?`bg-emerald-500/30`:r===`down`?`bg-rose-500/30`:`bg-primary/25`:`bg-primary/25`} block flex-1 rounded-sm`,"data-testid":`dashboard-mini-trend-bar`,"data-direction":r,style:{height:`${Math.max(8,Math.round(e*100))}%`}},t)})})}function k6e(e,t){if(e.length<=t)return e;let n=[],r=e.length/t;for(let i=0;i<t;i+=1){let t=Math.floor(i*r),a=Math.floor((i+1)*r),o=e.slice(t,Math.max(a,t+1)),s=o[o.length-1]?.ts??e[e.length-1].ts;n.push({ts:s,add:o.reduce((e,t)=>e+t.add,0),modify:o.reduce((e,t)=>e+t.modify,0),delete:o.reduce((e,t)=>e+t.delete,0)})}return n}function A6e(e){if(e.length===0)return[];let t=e.map(e=>e.add+e.modify+e.delete),n=Math.max(...t);return n<=0?e.map(()=>({height:0,addRatio:0,modifyRatio:0,deleteRatio:0})):e.map(e=>{let t=e.add+e.modify+e.delete;return t<=0?{height:0,addRatio:0,modifyRatio:0,deleteRatio:0}:{height:t/n*(w6e-W9)+W9,addRatio:e.add/t,modifyRatio:e.modify/t,deleteRatio:e.delete/t}})}function j6e({bars:e}){if(e.length===0)return null;let t=e.length===1?Array.from({length:12},()=>e[0]):e;return(0,H.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-end gap-px px-2 py-2 opacity-55`,"data-testid":`dashboard-mini-tricolor-bars`,children:t.map((e,t)=>{let n=Math.max(0,Math.round(e.height*100));return n<=0?(0,H.jsx)(`span`,{className:`bg-border/45 block min-h-px flex-1 rounded-sm`,"data-testid":`dashboard-mini-tricolor-bar`},t):(0,H.jsxs)(`span`,{className:`flex flex-1 flex-col-reverse overflow-hidden rounded-sm`,"data-testid":`dashboard-mini-tricolor-bar`,style:{height:`${n}%`,minHeight:`1px`},children:[e.addRatio>0&&(0,H.jsx)(`span`,{className:`bg-primary/40 block w-full`,style:{flexGrow:e.addRatio}}),e.modifyRatio>0&&(0,H.jsx)(`span`,{className:`bg-secondary/55 block w-full`,style:{flexGrow:e.modifyRatio}}),e.deleteRatio>0&&(0,H.jsx)(`span`,{className:`bg-foreground/35 block w-full`,style:{flexGrow:e.deleteRatio}})]},t)})})}function M6e({label:e,value:t,icon:n,availability:r,trendKind:i,points:a,triColorPoints:o=[],pending:s=!1,className:c}){let l=k6e(o,C6e),u=A6e(l),d=l.some(e=>e.add+e.modify+e.delete>0),f=T6e(a.map(e=>e.value),C6e),p=E6e(f,i),m=D6e(f),h=r.state===`invalid`,g=d||f.length>=2,_=r.state===`invalid`&&r.reason===`objective-history-unavailable`?`No objective historical source`:`Insufficient computable data`;return(0,H.jsxs)(`div`,{className:`relative overflow-hidden rounded-lg border p-4 ${h?`border-border from-muted/35 to-muted/5 border-dashed bg-gradient-to-br`:`border-border bg-card`} ${c??``}`,"data-testid":`dashboard-metric-card`,"aria-busy":s,children:[!s&&!h&&(d?(0,H.jsx)(j6e,{bars:u}):(0,H.jsx)(O6e,{bars:p,directions:m,trendKind:i})),s?(0,H.jsxs)(`div`,{className:`relative z-10 flex h-full flex-col`,"aria-hidden":`true`,children:[(0,H.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,H.jsx)(aL,{className:`size-3.5 shrink-0 rounded-full`}),(0,H.jsx)(aL,{className:`h-4 w-2/3 max-w-56`})]}),(0,H.jsx)(aL,{className:`h-8 w-24`}),(0,H.jsx)(`div`,{className:`mt-auto flex h-1/2 items-end gap-1 pt-4`,children:Array.from({length:12},(e,t)=>(0,H.jsx)(aL,{className:`min-h-3 flex-1 rounded-sm`,style:{height:`${28+t*17%64}%`}},t))})]}):(0,H.jsxs)(`div`,{className:`relative z-10`,children:[(0,H.jsxs)(`div`,{className:`text-muted-foreground mb-1 flex items-center gap-2 text-sm`,children:[(0,H.jsx)(n,{className:`h-3.5 w-3.5`}),e]}),(0,H.jsx)(`div`,{className:`text-2xl font-bold`,children:t}),h&&(0,H.jsx)(`div`,{className:`text-muted-foreground mt-2 text-xs`,"data-testid":`dashboard-card-invalid-note`,children:_}),!h&&!g&&(0,H.jsx)(`div`,{className:`text-muted-foreground mt-2 text-xs`,"data-testid":`dashboard-card-trend-note`,children:`No trend yet`})]})]})}function G9(e){if(e instanceof Error)return e;if(typeof e==`object`&&e&&`message`in e){let t=e.message;if(typeof t==`string`)return Error(t)}return Error(String(e))}function N6e(e,t,n,r=!0){return Gy((0,V.useCallback)(t=>{if(!r)return{unsubscribe(){}};let n=!1;return e({onData(e){if(e.type===`snapshot`||e.type===`complete`){n=!0,e.snapshot.freshness===`current`?t.onEvent({type:`data`,data:e.snapshot.data}):t.onEvent({type:`display-stale`,data:e.snapshot.data});return}if(e.type===`stage`){e.phase===`start`&&n&&t.onEvent({type:`recompute-started`});return}e.type===`failed`&&t.onError(G9(e.error))},onError:t.onError})},[r,e]),t,[r],n)}function P6e(e,t){return t.identity===e.identity&&t.workGeneration===e.workGeneration}function F6e(e,t){return Gy((0,V.useCallback)((t,n)=>{let r=!0,i=0,a=n.hasCached,o=null,s=!1,c=e=>r&&o!==null&&o.identity===e.identity&&o.workGeneration===e.workGeneration&&o.snapshotGeneration===e.snapshotGeneration&&o.state===e.state,l=async e=>{let n=++i;try{let o=await Cy.dashboard.getSummary.query();if(!r||n!==i||e&&(!c(e)||!P6e(e,o)))return;o.data&&(a=!0,t.onEvent({type:o.freshness===`current`?`data`:`display-stale`,data:o.data})),o.error&&t.onError(G9(o.error))}catch(a){if(!r||n!==i||e&&!c(e))return;t.onError(G9(a))}},u=e({onData(e){s=!0;let n=a;o=e,n&&e.state!==`ready`&&t.onEvent({type:`recompute-started`}),l(e)},onError:t.onError});return s||l(),{unsubscribe(){r=!1,i+=1,u.unsubscribe()}}},[e]),t,[],`dashboard.subscribeSummary.v2`)}async function I6e(){let e=await nv();return{summary:e.summary,specifications:e.specifications,activeChanges:e.activeChanges,trackedTaskPhaseCounts:e.trackedTaskPhaseCounts,recentArchives:e.recentArchives}}async function L6e(){let e=await nv();return{trends:e.trends,triColorTrends:e.triColorTrends,trendKinds:e.trendKinds,cardAvailability:e.cardAvailability,trendMeta:e.trendMeta}}async function R6e(){return(await nv()).git}function z6e(){let e=(0,V.useCallback)(e=>Cy.dashboard.subscribeSummary.subscribe(void 0,{onData:e.onData,onError:e.onError}),[]),t=(0,V.useCallback)(e=>Cy.dashboard.subscribeTrends.subscribe(void 0,{onData:e.onData,onError:e.onError}),[]),n=(0,V.useCallback)(e=>Cy.dashboard.subscribeGit.subscribe(void 0,{onData:e.onData,onError:e.onError}),[]),r=F6e(e,I6e),i=r.data!==void 0,a=N6e(t,L6e,`dashboard.subscribeTrends`,i),o=N6e(n,R6e,`dashboard.subscribeGit`,i);return{data:(0,V.useMemo)(()=>{if(!(!r.data||!a.data||!o.data))return{...r.data,...a.data,git:o.data}},[o.data,r.data,a.data]),isLoading:r.isLoading,error:r.error,regions:{summary:r,trends:a,git:o}}}async function B6e(e,t){Lf()||await Cy.dashboard.refreshGitSnapshot.query({scope:`code`,expectedBindingToken:t,reason:e})}var V6e=[{value:`30s`,label:`30s`},{value:`5min`,label:`5min`},{value:`30min`,label:`30min`},{value:`none`,label:`none`}];function H6e(e){return e===`manual-button`||e?.startsWith(`auto-refresh:`)===!0}function U6e(e){let t=e instanceof Error?e.message:String(e);if(typeof e==`object`&&e&&`data`in e){let n=e.data;if(typeof n==`object`&&n&&`code`in n){let e=n.code;if(typeof e==`string`&&e.length>0)return`${e}: ${t}`}}return t}function W6e(e){return{specifications:{state:`ok`},requirements:{state:`ok`},activeChanges:{state:`invalid`,reason:`objective-history-unavailable`},inProgressChanges:{state:`invalid`,reason:`objective-history-unavailable`},completedChanges:{state:`ok`},taskCompletionPercent:{state:`invalid`,reason:e===null?`semantic-uncomputable`:`objective-history-unavailable`}}}function G6e(){return{specifications:`monotonic`,requirements:`monotonic`,activeChanges:`bidirectional`,inProgressChanges:`bidirectional`,completedChanges:`monotonic`,taskCompletionPercent:`bidirectional`}}function K6e(e){return e.type===`uncommitted`&&(e.diff.files>0||e.diff.insertions>0||e.diff.deletions>0)}function q6e(e){let t=o6e(e),n=t.find(e=>e.type===`uncommitted`),r=t.filter(e=>e.type===`commit`);return n&&K6e(n)?[n,...r.slice(0,4)]:r.slice(0,5)}function J6e(){let e=Lf(),t=z6e(),{data:n,isLoading:r,error:i}=t,a=t.regions?.summary,o=t.regions?.trends,s=t.regions?.git,c=a?.data??(n?{summary:n.summary,specifications:n.specifications,activeChanges:n.activeChanges,trackedTaskPhaseCounts:n.trackedTaskPhaseCounts,recentArchives:n.recentArchives}:void 0),l=o?.data??(n?{trends:n.trends,triColorTrends:n.triColorTrends,trendKinds:n.trendKinds,cardAvailability:n.cardAvailability,trendMeta:n.trendMeta}:void 0),u=s?.data??n?.git??null,d=a?.isLoading??r,f=a?.isUpdating??!1,p=a?.error??i,m=o?.isLoading??(r&&!n),h=o?.isUpdating??!1,g=o?.error??null,_=s?.isLoading??(r&&!n),v=s?.isUpdating??!1,y=s?.error??null,b=d&&c===void 0,x=b||m&&l===void 0,S=b||_&&u===null,C=c!==void 0,{data:w,authority:T}=q3e(!e&&C),{data:E}=Zy(C),{data:D}=Xy(C),[O,k]=(0,V.useState)(()=>r6e()),[A,j]=(0,V.useState)(null),[M,N]=(0,V.useState)(()=>Date.now()),[P,F]=(0,V.useState)(()=>typeof document>`u`?!0:document.visibilityState===`visible`),[ee,te]=(0,V.useState)(null),[I,ne]=(0,V.useState)(null),L=!e&&T.state===`current`&&u?.bindingToken!==null&&u?.bindingToken===w?.code.bindingToken?u?.bindingToken??null:null,re=(0,V.useCallback)(()=>{Ib.activatePop(`/opsx-propose`)},[]),ie=(0,V.useCallback)(()=>{Ib.activatePop(`/opsx-new`)},[]),ae=(0,V.useCallback)(async e=>{L&&(ne(null),await B6e(e,L))},[L]),oe=(0,V.useRef)(null),se=(0,V.useRef)(O),ce=ee?.reason??null,le=(0,V.useCallback)(()=>{oe.current!==null&&(window.clearTimeout(oe.current),oe.current=null)},[]),ue=(0,V.useCallback)(e=>{let t=Date.now(),n=B9(O);j(n===null?null:t+n),te({reason:e,requestedAt:t}),ae(e).then(()=>{te(n=>n?.reason===e&&n.requestedAt===t?null:n)}).catch(n=>{console.error(`[Dashboard] Failed to refresh git snapshot:`,n),ne(U6e(n)),te(n=>n?.reason===e&&n.requestedAt===t?null:n)})},[O,ae]),de=(0,V.useCallback)(()=>{le();let t=B9(O),n=O===`none`?null:a6e(O);if(e||L===null||t===null||n===null||ee!==null||v||!P)return;let r=Date.now(),i=A??r+t;if(A===null&&j(i),N(r),r>=i){ue(n);return}oe.current=window.setTimeout(()=>{oe.current=null,N(Date.now()),ue(n)},i-r)},[le,L,A,O,ee,v,P,ue,e]),R=(0,V.useCallback)(()=>{L!==null&&(le(),N(Date.now()),ue(`manual-button`))},[le,L,ue]);(0,V.useEffect)(()=>{if(e)return;let t=()=>{let e=document.visibilityState===`visible`;F(e),e||le()};return document.addEventListener(`visibilitychange`,t),()=>{document.removeEventListener(`visibilitychange`,t)}},[le,e]),(0,V.useEffect)(()=>{if(!e&&(i6e(O),se.current!==O)){se.current=O;let e=B9(O);j(e===null?null:Date.now()+e)}},[O,e]),(0,V.useEffect)(()=>{if(!e)return de(),()=>{le()}},[le,de,e]),(0,V.useEffect)(()=>{let t=B9(O);if(e||t===null||A===null)return;let n=()=>{N(Date.now())};n();let r=window.setInterval(n,250);return()=>{window.clearInterval(r)}},[A,O,e]);let fe=c?.activeChanges??[],pe=(0,V.useMemo)(()=>new Set(fe.map(e=>e.id)),[fe]),me=(0,V.useMemo)(()=>(E??[]).filter(e=>pe.has(e.changeName)),[E,pe]),he=(0,V.useMemo)(()=>{let e=D?.schemaDetails??{},t=new Map;for(let[n,r]of Object.entries(e)){if(!r?.applyTracks)continue;let e=r.artifacts.find(e=>e.outputPath===r.applyTracks);e?.id&&t.set(n,e.id)}return t},[D]),ge=c?.summary??{specifications:0,requirements:0,activeChanges:0,inProgressChanges:0,completedChanges:0,archivedTasksCompleted:0,tasksTotal:0,tasksCompleted:0,taskCompletionPercent:null},_e=l?.cardAvailability??W6e(ge.taskCompletionPercent),ve=l?.trendKinds??G6e(),ye=e||T.state===`current`&&w!==void 0&&u?.bindingToken!==null&&u?.bindingToken===w?.code.bindingToken,be=ye&&u?u:{bindingToken:null,defaultBranch:`main`,worktrees:[]},xe=e?be.worktrees.some(e=>e.entries.length>0):ye,Se=e?xe:!0,Ce=fe.length>0,we=be.worktrees.find(e=>e.isCurrent)??null,Te=be.worktrees.filter(e=>!e.isCurrent).filter(e=>!e.detached),Ee=we?q6e(we.entries):[],De=B9(O),Oe=A!==null&&De!==null?A-De:null,ke=ee===null?s6e(Oe,De,M):0,Ae=De!==null&&ee===null,je=ee!==null&&H6e(ce),Me=ee!==null||v||L===null,Ne=()=>(0,H.jsxs)(`div`,{className:`space-y-2`,children:[g?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-2 text-xs`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,H.jsxs)(`span`,{children:[`Dashboard trends failed: `,g.message]})]}):null,(0,H.jsx)(iL,{active:h&&!!l,children:(0,H.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[(0,H.jsx)(M6e,{label:`Specifications / Requirements`,value:`${ge.specifications} / ${ge.requirements}`,icon:bc,availability:_e.specifications,trendKind:ve.specifications,points:l?.trends.specifications??[],triColorPoints:[],pending:x,className:`h-44 sm:h-48 lg:h-52 xl:h-56`}),(0,H.jsx)(M6e,{label:`Archived Changes / Completed Tasks`,value:`${ge.completedChanges} / ${ge.archivedTasksCompleted}`,icon:Ws,availability:_e.completedChanges,trendKind:ve.completedChanges,points:l?.trends.completedChanges??[],triColorPoints:[],pending:x,className:`h-44 sm:h-48 lg:h-52 xl:h-56`})]})})]}),Pe=()=>(0,H.jsxs)(`section`,{"data-testid":`dashboard-kanban-row`,className:`border-border @container min-w-0 space-y-2 border-b`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsx)(`h2`,{className:`font-medium`,children:`Kanban`}),(0,H.jsx)(Nb,{to:`/board`,"aria-label":`Open Kanban`,title:`Open Kanban`,className:`text-muted-foreground hover:text-foreground inline-flex h-8 w-8 items-center justify-center rounded-md`,children:(0,H.jsx)(ml,{className:`h-4 w-4`})})]}),(0,H.jsx)(t2e,{variant:`compact`,pending:b,activeItems:fe,archivedItems:c?.recentArchives??[],activeCounts:c?.trackedTaskPhaseCounts??{"no-tasks":0,"in-progress":0,complete:0},archivedCount:ge.completedChanges})]}),Fe=()=>Se?(0,H.jsxs)(`section`,{"data-testid":`dashboard-git-snapshot`,className:`min-w-0 space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h2`,{className:`font-medium`,children:`Code Git Snapshot`}),(0,H.jsx)(`p`,{className:`text-muted-foreground truncate text-xs`,children:xe?`Default branch: ${be.defaultBranch}`:`Waiting for the current Code Git projection.`})]}),e?null:(0,H.jsx)(S6e,{options:V6e,value:O,onValueChange:k,progress:ke,showProgress:Ae,disabled:Me,animated:je,onRefresh:R})]}),y?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-2 text-xs`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,H.jsxs)(`span`,{children:[`Code Git snapshot failed: `,y.message]})]}):null,S?(0,H.jsxs)(`div`,{"aria-busy":`true`,className:`border-border/80 bg-card min-w-0 space-y-3 rounded-lg border p-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,"aria-hidden":`true`,children:[(0,H.jsx)(aL,{className:`size-4 shrink-0 rounded-full`}),(0,H.jsx)(aL,{className:`h-3 w-36`})]}),(0,H.jsx)(JSe,{count:3})]}):null,!xe&&u&&!S&&!y?(0,H.jsx)(`div`,{className:`text-muted-foreground rounded-md border border-dashed px-3 py-4 text-sm`,children:`Waiting for the current Code Git binding.`}):null,xe?(0,H.jsx)(iL,{active:v&&!!u,children:(0,H.jsxs)(`div`,{className:`border-border/80 bg-card min-w-0 rounded-lg border p-3`,children:[(0,H.jsxs)(`div`,{className:`mb-2 flex items-center gap-1.5`,children:[(0,H.jsx)(Dc,{className:`text-muted-foreground h-4 w-4 shrink-0`}),(0,H.jsxs)(`span`,{className:`text-muted-foreground truncate text-xs`,children:[`Default branch: `,be.defaultBranch]})]}),we?(0,H.jsxs)(`div`,{className:`space-y-0`,children:[(0,H.jsx)(v6e,{worktree:we,emphasize:!0}),(0,H.jsx)(`div`,{className:`-mt-px space-y-1 border-l pl-3 pt-2 ${u6e}`,children:Ee.map(t=>(0,H.jsx)(_6e,{entry:t,onSelect:e?void 0:(e,t)=>{be.bindingToken!==null&&Ib.push(`bottom`,gee(e),qoe(void 0,g6e(e,be.bindingToken)),{source:t,sharedElements:h6e(e)})}},t.type===`commit`?t.hash:`${t.type}:${t.updatedAt??`none`}`))})]}):(0,H.jsx)(`div`,{className:`text-muted-foreground rounded-md border border-dashed px-2.5 py-2 text-xs`,children:`No worktree snapshot available.`}),Te.length>0&&(0,H.jsxs)(`div`,{className:`border-border/70 mt-3 space-y-1 border-t pt-2`,children:[(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs uppercase tracking-wide`,children:`Other Worktrees`}),Te.map(e=>(0,H.jsx)(v6e,{worktree:e,emphasize:!1},e.path))]})]})}):null]}):null,Ie=()=>(0,H.jsxs)(`section`,{"data-testid":`dashboard-active-changes`,className:`border-border flex min-w-0 flex-col rounded-t-lg border`,children:[(0,H.jsxs)(`div`,{className:`border-border flex min-w-0 flex-wrap items-center justify-between gap-1.5 border-b px-4 py-3`,children:[(0,H.jsx)(`h2`,{className:`font-medium`,children:`Active Changes`}),b?(0,H.jsx)(aL,{className:`h-4 w-16`}):(0,H.jsxs)(`span`,{className:`text-muted-foreground text-xs sm:text-sm`,children:[ge.activeChanges,` active`]})]}),(0,H.jsxs)(`div`,{className:`bg-card divide-border flex min-w-0 flex-1 flex-col divide-y`,children:[b?(0,H.jsx)(lL,{count:3}):null,!b&&fe.map(e=>{let t=me.find(t=>t.changeName===e.id),n=t?.artifacts.filter(e=>e.status===`done`).length??0,r=t?.artifacts.length??0,i=t?he.get(t.schemaName):void 0,a=i&&t?t.artifacts.find(e=>e.id===i)?.status??d9(t.artifacts.map(e=>e.status)):d9(t?.artifacts.map(e=>e.status)??[]),o=x2e({hasStatus:!!t,isPlanningComplete:t?.isPlanningComplete??!1,trackedTaskPhase:e.trackedTaskProgress.phase,trackedArtifactStatus:a,cliCompletedTasks:e.cliTaskSummary?.completedTasks??null});return(0,H.jsx)(Nb,{to:`/changes/$changeId`,params:{changeId:e.id},state:t=>({...t,__vtHandoff:{family:`changes`,entityId:e.id,title:e.name,subtitle:e.id}}),vt:{sharedElements:{family:`changes`,entityId:e.id}},...rb({family:`changes`,entityId:e.id},`container`),className:`hover:bg-muted/50 block min-w-0 px-4 py-3`,children:(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,H.jsx)(y2e,{changeId:e.id,name:e.name,phase:o,updatedAt:e.updatedAt,formatTime:mL,progressRatio:e.cliTaskSummary&&e.cliTaskSummary.totalTasks>0?e.cliTaskSummary.completedTasks/e.cliTaskSummary.totalTasks:null,className:`min-w-0 flex-1`,subtitle:t?(0,H.jsxs)(`span`,{title:`Task counts reported by the OpenSpec CLI for this Change.`,children:[n,`/`,r,` artifacts · `,t.schemaName,e.cliTaskSummary?` · Tasks ${e.cliTaskSummary.completedTasks}/${e.cliTaskSummary.totalTasks}`:``]}):`Artifacts status unavailable`}),(0,H.jsx)(b2e,{})]})},e.id)}),!b&&!Ce&&(0,H.jsxs)(`div`,{className:`text-muted-foreground px-4 py-6 text-center text-sm`,children:[(0,H.jsx)(`div`,{children:`No active changes.`}),(0,H.jsx)(`div`,{className:`mt-1 text-xs`,children:`Recommended workflow start: Quick Propose`}),(0,H.jsxs)(`button`,{type:`button`,onClick:ie,className:`text-primary mt-2 inline-flex items-center gap-1 hover:underline`,title:`Open the advanced /opsx:new form`,children:[(0,H.jsx)(pl,{className:`h-3.5 w-3.5`}),`Open /opsx:new form`]})]})]})]});return(0,H.jsxs)(`div`,{className:`@container min-w-0 space-y-6 p-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(Fc,{className:`h-6 w-6 shrink-0`}),`Dashboard`]}),(0,H.jsxs)(`button`,{type:`button`,onClick:re,className:`bg-primary text-primary-foreground inline-flex items-center gap-2 rounded-md px-4 py-2 text-sm hover:opacity-90`,title:`Open Quick Propose.`,children:[(0,H.jsx)(pl,{className:`h-4 w-4`}),`Start Propose`]})]}),(0,H.jsx)(iL,{active:f&&!!c,children:(0,H.jsx)(J3e,{staticMode:e})}),p?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,H.jsxs)(`span`,{children:[`Error loading dashboard: `,p.message]})]}):null,I?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,H.jsxs)(`span`,{children:[`Git action failed: `,I]})]}):null,(0,H.jsxs)(`section`,{className:`space-y-2`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-medium`,children:`Historical Trends`}),Ne()]}),Pe(),(0,H.jsxs)(`div`,{"data-testid":`dashboard-secondary-grid`,className:`@[64rem]:grid-cols-2 grid min-w-0 gap-3`,children:[Ie(),Fe()]})]})}var Y6e=null,K9=null,q9=null,X6e=`This backend does not support source-scoped Search. Upgrade the OpenSpecUI backend to search Active root and Referenced Specs safely.`;function Z6e(e){return(e instanceof Error?e.message:String(e)).includes(`No "subscription"-procedure on path "search.subscribe"`)}async function Q6e(){return Y6e||K9||(K9=(async()=>{let e=new gze;try{let t=await hie();return await e.init(t),Y6e=e,e}catch(t){throw await e.dispose().catch(()=>{}),t}finally{K9=null}})(),K9)}function $6e(e,t=`active-root`,n=50){let[r,i]=(0,V.useState)({scope:t,data:[],isLoading:!1,error:null}),a=(0,V.useMemo)(()=>e.trim(),[e]);return(0,V.useEffect)(()=>{let e=!0;if(a.length===0)return i({scope:t,data:[],isLoading:!1,error:null}),()=>{e=!1};if(i({scope:t,data:[],isLoading:!0,error:null}),Lf())return Q6e().then(e=>e.search({query:a,scope:t,limit:n})).then(n=>{e&&i({scope:t,data:A$(n,t),isLoading:!1,error:null})}).catch(n=>{e&&i({scope:t,data:[],isLoading:!1,error:n instanceof Error?n:Error(String(n))})}),()=>{e=!1};if(q9===!1)return i({scope:t,data:[],isLoading:!1,error:Error(X6e)}),()=>{e=!1};let r=Cy.search.subscribe.subscribe({query:a,scope:t,limit:n},{onData:n=>{if(q9=!0,e)try{i({scope:t,data:A$(n,t),isLoading:!1,error:null})}catch(e){i({scope:t,data:[],isLoading:!1,error:e instanceof Error?e:Error(String(e))})}},onError:n=>{if(Z6e(n)){if(q9=!1,!e)return;i({scope:t,data:[],isLoading:!1,error:Error(X6e)});return}e&&i({scope:t,data:[],isLoading:!1,error:n})}});return()=>{e=!1,r.unsubscribe()}},[n,t,a]),r.scope===t?r:{scope:t,data:[],isLoading:a.length>0,error:null}}var e8e=150;function t8e(e){return e===`spec`?bc:e===`change`?Dc:Ws}function n8e(e){return new URLSearchParams(e).get(`scope`)===`referenced-specs`?`referenced-specs`:`active-root`}function J9(e,t){let n=e.trim(),r=new URLSearchParams;n.length>0&&r.set(`query`,n),t===`referenced-specs`&&r.set(`scope`,t);let i=r.toString();return i.length>0?`/search?${i}`:`/search`}function r8e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Y9(e,t){if(!e||t.length===0)return e;let n=t.map(e=>r8e(e)).join(`|`);if(!n)return e;let r=RegExp(`(${n})`,`gi`);return e.split(r).map((e,n)=>t.some(t=>t.toLowerCase()===e.toLowerCase())?(0,H.jsx)(`mark`,{className:`text-foreground rounded bg-amber-400/35 px-[1px]`,children:e},n):(0,H.jsx)(`span`,{children:e},n))}function i8e(){let e=zs(),{setConfig:t}=Bb(),{requestClose:n}=Vb(),r=(0,V.useMemo)(()=>new URLSearchParams(e.search).get(`query`)??``,[e.search]),i=(0,V.useMemo)(()=>n8e(e.search),[e.search]),[a,o]=(0,V.useState)(r),[s,c]=(0,V.useState)(r);(0,V.useEffect)(()=>{o(r),c(r)},[r]),(0,V.useEffect)(()=>{let e=setTimeout(()=>c(a),e8e);return()=>clearTimeout(e)},[a]);let{data:l,isLoading:u,error:d}=$6e(s,i),f=(0,V.useMemo)(()=>a.trim().split(/\s+/).filter(e=>e.length>0).map(e=>e.toLowerCase()).sort((e,t)=>t.length-e.length),[a]);return(0,V.useEffect)(()=>{t({layout:{alignY:`start`,width:`wide`,topGap:`comfortable`},panelClassName:`w-full`,bodyClassName:`p-0`,maxHeight:`min(88dvh,920px)`,onDismissRequest:void 0})},[t]),(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col gap-4 p-3 sm:p-4`,children:[(0,H.jsxs)(`div`,{role:`tablist`,"aria-label":`Search source`,className:`bg-muted border-border inline-grid min-h-9 w-fit shrink-0 grid-cols-2 rounded-md border p-0.5`,children:[(0,H.jsx)(a8e,{scope:`active-root`,current:i,label:`Active root`,onSelect:t=>{kp.replace(`pop`,J9(a,t),e.state)}}),(0,H.jsx)(a8e,{scope:`referenced-specs`,current:i,label:`Referenced Specs`,onSelect:t=>{kp.replace(`pop`,J9(a,t),e.state)}})]}),(0,H.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,H.jsx)(al,{className:`text-muted-foreground absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2`}),(0,H.jsx)(`input`,{autoFocus:!0,value:a,onChange:t=>{let n=t.target.value;o(n),kp.replace(`pop`,J9(n,i),e.state)},placeholder:i===`active-root`?`Search Owned Specs, Changes, and Archives...`:`Search Referenced Specs...`,className:`border-input bg-background focus:ring-ring w-full rounded-md border py-2 pl-9 pr-3 text-sm focus:outline-none focus:ring-2`})]}),u&&(0,H.jsx)(`div`,{"aria-busy":`true`,children:(0,H.jsx)(uL,{count:4})}),d&&(0,H.jsx)(`div`,{className:`rounded-md border border-red-500/40 bg-red-500/5 p-3 text-sm text-red-600`,children:d.message}),!u&&!d&&a.trim().length>0&&l.length===0&&(0,H.jsx)(`div`,{className:`text-muted-foreground rounded-md border p-6 text-center text-sm`,children:i===`active-root`?`No matching results in the active Planning root for “${a.trim()}”.`:`No matching Referenced Specs currently observed for “${a.trim()}”.`}),!u&&!d&&l.length>0&&(0,H.jsx)(`ul`,{className:`border-border divide-border min-h-0 w-full min-w-0 flex-1 divide-y overflow-y-auto rounded-md border`,children:l.map(e=>(0,H.jsx)(`li`,{className:`min-w-0`,children:(0,H.jsxs)(`button`,{type:`button`,className:`hover:bg-muted/50 flex w-full min-w-0 flex-col items-start gap-2 p-3 text-left`,onClick:()=>{let t=kp.getAreaForPath(e.href);Ib.push(t,e.href,null),n()},children:[(0,H.jsxs)(`div`,{className:`grid w-full min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(t8e(e.kind),{className:`text-muted-foreground h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{className:`line-clamp-2 break-words text-sm font-medium`,children:Y9(e.title,f)})]}),(0,H.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-[11px] uppercase`,children:e.scope===`referenced-specs`?(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,H.jsx)(Hc,{className:`h-3 w-3`,"aria-hidden":!0}),` read-only `,e.kind]}):e.kind})]}),(0,H.jsx)(`div`,{className:`text-muted-foreground w-full break-all text-xs`,children:Y9(e.path,f)}),(0,H.jsx)(`div`,{className:`text-muted-foreground line-clamp-3 w-full break-words text-xs`,children:Y9(e.snippet,f)})]})},e.documentId))})]})}function a8e({scope:e,current:t,label:n,onSelect:r}){let i=t===e;return(0,H.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":i,onClick:()=>r(e),className:`min-w-28 rounded px-3 py-1 text-sm font-medium transition-colors ${i?`bg-background text-foreground shadow-sm`:`text-muted-foreground`}`,children:n})}var o8e=`theme`;function s8e(){if(typeof window>`u`)return`system`;let e=window.localStorage.getItem(o8e);return e===`light`||e===`dark`||e===`system`?e:`system`}function c8e(e){typeof window>`u`||window.localStorage.setItem(o8e,e)}function l8e(e){if(typeof window>`u`)return;let t=document.documentElement;if(e===`system`){let e=window.matchMedia(`(prefers-color-scheme: dark)`).matches;t.classList.toggle(`dark`,e);return}t.classList.toggle(`dark`,e===`dark`)}var u8e=[{value:`light`,label:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(hl,{className:`h-3.5 w-3.5`}),`Light`]})},{value:`dark`,label:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(qc,{className:`h-3.5 w-3.5`}),`Dark`]})},{value:`system`,label:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Kc,{className:`h-3.5 w-3.5`}),`System`]})}];function d8e(){let[e,t]=(0,V.useState)(s8e);return(0,V.useEffect)(()=>{l8e(e),c8e(e)},[e]),(0,V.useEffect)(()=>{if(e!==`system`)return;let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>l8e(`system`);return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e]),(0,H.jsxs)(`div`,{className:`max-w-2xl space-y-8 p-4`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(sl,{className:`h-6 w-6 shrink-0`}),`Settings`]}),(0,H.jsxs)(`section`,{className:`space-y-4`,children:[(0,H.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Appearance`}),(0,H.jsxs)(`div`,{className:`border-border rounded-lg border p-4`,children:[(0,H.jsx)(`label`,{className:`mb-3 block text-sm font-medium`,children:`Theme`}),(0,H.jsx)(IL,{value:e,onChange:t,options:u8e})]})]})]})}function f8e(e,t){return e.length===t.length?e.every((e,n)=>{let r=t[n];return r!==void 0&&H_(e.identity)===H_(r.identity)}):!1}function p8e(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function m8e(e){if(typeof document>`u`){e.update();return}let t=document;if(!e.container||p8e()||typeof t.startViewTransition!=`function`||t.activeViewTransition){e.update();return}e.container.style.viewTransitionName=e.transitionName;try{t.startViewTransition(()=>(0,es.flushSync)(e.update)).finished.catch(()=>{}).finally(()=>{e.container?.style.viewTransitionName===e.transitionName&&(e.container.style.viewTransitionName=``)})}catch{e.container.style.viewTransitionName=``,e.update()}}function h8e(e,t,n){let[r,i]=(0,V.useState)(e),a=(0,V.useRef)(e),o=(0,V.useRef)(t),s=(0,V.useRef)(0),c=(0,V.useRef)(!1),l=`vt-spec-list-${(0,V.useId)().replace(/[^a-zA-Z0-9_-]/g,``)}`,u=o.current!==t||!c.current||e===void 0;return(0,V.useLayoutEffect)(()=>{if(!c.current){c.current=!0,o.current=t,a.current=e,i(e);return}if(o.current!==t){o.current=t,a.current=e,s.current+=1,i(e);return}let r=a.current;if(a.current=e,r===e)return;let u=s.current+1;if(s.current=u,e===void 0||r===void 0||f8e(r,e)){i(e);return}queueMicrotask(()=>{s.current===u&&m8e({container:n.current,transitionName:l,update:()=>{s.current===u&&i(e)}})})},[n,e,t,l]),u?e:r}function g8e(e){return typeof e!=`object`||!e?`owned`:e.__specListScope===`referenced`?`referenced`:`owned`}function _8e(){let e=zs(),{data:t,isLoading:n,error:r}=koe(),[i,a]=(0,V.useState)(()=>g8e(e.state)),o=(0,V.useMemo)(()=>t?.entries.filter(e=>e.identity.kind===`owned`)??[],[t]),s=(0,V.useMemo)(()=>{let e=new Map;for(let n of t?.entries??[]){if(n.identity.kind!==`referenced`)continue;let t=e.get(n.identity.storeId)??[];t.push(n),e.set(n.identity.storeId,t)}return(t?.referenceSources??[]).map(t=>({source:t,specs:e.get(t.storeId)??[]})).sort((e,t)=>e.source.storeId.localeCompare(t.source.storeId))},[t]),c=s.reduce((e,{specs:t})=>e+t.length,0),l=(0,V.useRef)(null),u=h8e((0,V.useMemo)(()=>i===`owned`?o:s.flatMap(({specs:e})=>e),[o,s,i]),i,l),d=u?.filter(e=>e.identity.kind===`owned`)??[],f=s.map(({source:e})=>({source:e,specs:u?.filter(t=>t.identity.kind===`referenced`&&t.identity.storeId===e.storeId)??[]})),p=r?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`font-medium`,children:`Spec Catalog subscription failed.`}),(0,H.jsx)(`p`,{className:`break-words`,children:r.message})]})]}):null;return n&&!t&&!r?(0,H.jsxs)(`div`,{className:`space-y-6 p-4`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(bc,{className:`h-6 w-6 shrink-0`}),`Specifications`]}),(0,H.jsx)(uL,{count:5})]}):!t&&r?(0,H.jsxs)(`div`,{className:`space-y-6 p-4`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(bc,{className:`h-6 w-6 shrink-0`}),`Specifications`]}),p]}):(0,H.jsxs)(`div`,{className:`space-y-6 p-4`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(bc,{className:`h-6 w-6 shrink-0`}),`Specifications`]}),p,(0,H.jsxs)(`div`,{role:`tablist`,"aria-label":`Spec source`,className:`bg-muted border-border inline-grid min-h-9 grid-cols-2 rounded-md border p-0.5`,children:[(0,H.jsx)(y8e,{scope:`owned`,current:i,label:`Owned`,count:o.length,onSelect:a}),(0,H.jsx)(y8e,{scope:`referenced`,current:i,label:`Referenced`,count:c,onSelect:a})]}),i===`owned`?(0,H.jsxs)(`div`,{ref:l,"data-spec-list-continuity":!0,className:`border-border divide-border divide-y rounded-lg border`,children:[d.map(e=>(0,H.jsx)(b8e,{spec:e},H_(e.identity))),d.length===0&&!r?(0,H.jsx)(`div`,{className:`text-muted-foreground p-4 text-center`,children:`No Owned Specs found in the current Planning root.`}):null]}):(0,H.jsxs)(`div`,{ref:l,"data-spec-list-continuity":!0,className:`border-border divide-border divide-y rounded-lg border`,children:[f.map(({source:e,specs:t})=>(0,H.jsxs)(`section`,{"aria-labelledby":`reference-store-${encodeURIComponent(e.storeId)}`,children:[(0,H.jsxs)(`div`,{className:`bg-muted/30 border-border flex min-w-0 flex-wrap items-center justify-between gap-2 border-b px-4 py-2`,children:[(0,H.jsx)(`h2`,{id:`reference-store-${encodeURIComponent(e.storeId)}`,className:`min-w-0 truncate font-mono text-sm font-semibold`,title:e.storeId,children:e.storeId}),(0,H.jsxs)(g9,{ariaLabel:`Reference Store ${e.storeId}: ${t.length} Specs, read-only`,tooltip:`Specs from Reference Store ${e.storeId} are read-only projections.`,children:[(0,H.jsx)(Hc,{className:`h-3 w-3`,"aria-hidden":!0}),t.length,` Specs`]})]}),e.state===`error`?(0,H.jsx)(`div`,{role:`alert`,className:`text-destructive space-y-1 px-4 py-3 text-sm`,children:e.provenance===`live`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{children:`OpenSpec could not enumerate this observed Reference Store.`}),(0,H.jsxs)(`div`,{children:[`Exit status: `,e.evidence.exitCode??`unknown`]}),e.evidence.contractError?(0,H.jsx)(`div`,{children:e.evidence.contractError}):null,e.evidence.stderr?(0,H.jsx)(`div`,{children:e.evidence.stderr}):null,[...e.diagnostics,...e.evidence.diagnostics].map((e,t)=>(0,H.jsxs)(`div`,{children:[e.code,`: `,e.message]},`${e.code}:${t}`))]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{children:`Published static snapshot records this Reference source as unavailable.`}),(0,H.jsxs)(`div`,{children:[e.snapshot.specCount,` published Specs.`]})]})}):(0,H.jsxs)(`div`,{className:`divide-border divide-y`,children:[t.map(e=>(0,H.jsx)(b8e,{spec:e},H_(e.identity))),t.length===0&&!r?(0,H.jsx)(`div`,{className:`text-muted-foreground px-4 py-3 text-sm`,children:`OpenSpec reported no Specs for this Store.`}):null]})]},e.storeId)),s.length===0&&!r?(0,H.jsx)(v8e,{referenceProjection:t?.referenceProjection??{provenance:`live`}}):null]})]})}function v8e({referenceProjection:e}){return(0,H.jsx)(`div`,{className:`text-muted-foreground p-4 text-center`,children:g_(e).with({provenance:`live`},()=>`No Referenced Specs currently observed.`).with({provenance:`static`,policy:`include`},()=>`Published static snapshot includes no Reference sources.`).with({provenance:`static`,policy:`omit`},({referenceSourceCount:e})=>`Published static snapshot omitted Referenced Spec content from ${e} sources.`).with({provenance:`static`,policy:`none`},()=>`Published static snapshot records no effective Reference sources.`).with({provenance:`static`,policy:`unavailable`},()=>`Published static snapshot does not include a Reference inventory.`).exhaustive()})}function y8e({scope:e,current:t,label:n,count:r,onSelect:i}){let a=t===e;return(0,H.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":a,onClick:()=>i(e),className:`min-w-28 rounded px-3 py-1 text-sm font-medium transition-colors ${a?`bg-background text-foreground shadow-sm`:`text-muted-foreground`}`,children:[n,` `,(0,H.jsx)(`span`,{className:`tabular-nums`,children:r})]})}function b8e({spec:e}){let t=H_(e.identity),n={family:`specs`,entityId:t},r=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,H.jsx)(bc,{...rb(n,`icon`),className:`text-muted-foreground h-5 w-5 shrink-0`}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{...rb(n,`title`),className:`truncate font-medium`,children:e.name}),(0,H.jsxs)(`div`,{className:`text-muted-foreground truncate text-sm`,children:[e.identity.kind===`referenced`&&(0,H.jsxs)(H.Fragment,{children:[e.identity.storeId,` · `]}),e.identity.specId,e.updatedAt>0&&(0,H.jsxs)(H.Fragment,{children:[` · `,mL(e.updatedAt)]})]}),e.summary&&(0,H.jsx)(`div`,{className:`text-muted-foreground truncate text-sm`,children:e.summary}),e.readOnly?(0,H.jsx)(`span`,{className:`sr-only`,children:`Read-only Reference`}):null]})]}),(0,H.jsx)(ec,{className:`text-muted-foreground h-4 w-4 shrink-0`})]}),i={family:`specs`,entityId:t,title:e.name,subtitle:e.identity.kind===`owned`?e.identity.specId:`${e.identity.storeId} / ${e.identity.specId}`},a={vt:{sharedElements:n},...rb(n,`container`),className:`hover:bg-muted/50 flex items-center justify-between gap-3 p-4`};return e.identity.kind===`owned`?(0,H.jsx)(Nb,{to:`/specs/owned/$specId`,params:{specId:e.identity.specId},state:e=>({...e,__vtHandoff:i}),...a,children:r}):(0,H.jsx)(Nb,{to:`/specs/referenced/$storeId/$specId`,params:{storeId:e.identity.storeId,specId:e.identity.specId},state:e=>({...e,__vtHandoff:i}),...a,children:r})}function x8e(){let{specId:e,storeId:t}=qo({strict:!1}),n=(0,V.useMemo)(()=>U_({specId:e,...t?{storeId:t}:{}}),[e,t]),r=ab(zs().state),{data:i,isLoading:a,error:o}=Aoe(n),{data:s}=qy(),{data:c}=Jy(),l=(0,V.useMemo)(()=>y1(s?.translation,c),[s?.translation,c]);return a&&!i?(0,H.jsx)(S8e,{identity:n,title:r?.title,subtitle:r?.subtitle}):o&&(!i||i.state===`not-found`)?(0,H.jsx)(X9,{message:o.message}):!i||i.state===`not-found`?(0,H.jsx)(`div`,{className:`text-destructive p-4`,children:`Spec not found`}):i.source===`owned`?(0,H.jsx)(C8e,{identity:n,spec:i.spec,rawMarkdown:i.rawMarkdown??``,translationConfig:l,errorMessage:o?.message}):(0,H.jsx)(w8e,{document:i,errorMessage:o?.message})}function X9({message:e}){return(0,H.jsx)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border p-4`,children:(0,H.jsxs)(`span`,{children:[`Error loading spec: `,e]})})}function S8e({identity:e,title:t,subtitle:n}){let r={family:`specs`,entityId:H_(e)};return(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 p-4`,children:[(0,H.jsx)(Z9,{identity:e,title:t??e.specId,subtitle:n,sharedDescriptor:r}),(0,H.jsx)(`div`,{className:`vt-detail-content rounded-lg border p-4`,"aria-busy":`true`,children:(0,H.jsx)(dL,{count:6})})]})}function Z9({identity:e,title:t,subtitle:n,sourceRef:r,sharedDescriptor:i}){let a=n??(e.kind===`owned`?`Owned · ${e.specId}`:`Referenced from ${e.storeId} · ${e.specId}`);return(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,H.jsx)(Nb,{to:`/specs`,state:t=>({...t,__specListScope:e.kind}),vt:{source:r,sharedElements:i},className:`hover:bg-muted shrink-0 rounded-md p-2`,"aria-label":`Back to specifications`,children:(0,H.jsx)(Gs,{className:`h-5 w-5`})}),(0,H.jsxs)(`div`,{ref:r,...rb(i,`container`),className:`min-w-0`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex min-w-0 items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(bc,{...rb(i,`icon`),className:`h-6 w-6 shrink-0`}),(0,H.jsx)(`span`,{...rb(i,`title`),className:`truncate`,children:t})]}),(0,H.jsx)(`p`,{className:`text-muted-foreground truncate`,children:a})]})]})}function C8e({identity:e,spec:t,rawMarkdown:n,translationConfig:r,errorMessage:i}){let a=(0,V.useRef)(null),o={family:`specs`,entityId:H_(e)};return t?(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 p-4`,children:[i?(0,H.jsx)(X9,{message:i}):null,(0,H.jsx)(Z9,{identity:e,title:t.name,sourceRef:a,sharedDescriptor:o}),(0,H.jsx)(j3,{markdown:n,path:`specs/${t.id}/spec.md`,className:`vt-detail-content min-h-0 flex-1`,translationConfig:r})]}):(0,H.jsx)(`div`,{className:`text-destructive p-4`,children:`Spec not found`})}function w8e({document:e,errorMessage:t}){let n=(0,V.useRef)(null),r={family:`specs`,entityId:H_(e.identity)},i=A8e(e);return(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 p-4`,children:[t?(0,H.jsx)(X9,{message:t}):null,(0,H.jsx)(Z9,{identity:e.identity,title:e.upstream?.title??e.spec?.name??e.identity.specId,subtitle:i.subtitle,sourceRef:n,sharedDescriptor:r}),(0,H.jsxs)(`div`,{className:`border-border bg-muted/30 flex items-center gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,H.jsx)(Hc,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{children:i.readOnlyLabel})]}),e.state===`ready`&&e.provenance.kind===`live`&&e.upstream?(0,H.jsx)(T8e,{document:e.upstream}):e.state===`ready`&&D8e(e)&&e.spec&&e.rawMarkdown?(0,H.jsx)(j3,{markdown:e.rawMarkdown,path:`referenced:${e.identity.storeId}:specs/${e.identity.specId}/spec.md`,className:`vt-detail-content min-h-0 flex-1`}):(0,H.jsx)(E8e,{document:e})]})}function T8e({document:e}){return(0,H.jsxs)(`article`,{className:`vt-detail-content min-h-0 flex-1 space-y-8 overflow-y-auto`,children:[e.overview&&(0,H.jsxs)(`section`,{className:`space-y-2`,children:[(0,H.jsx)(`h2`,{className:`font-nav text-xl font-semibold`,children:`Overview`}),(0,H.jsx)(`p`,{className:`whitespace-pre-wrap leading-7`,children:e.overview})]}),(0,H.jsxs)(`section`,{className:`space-y-5`,children:[(0,H.jsx)(`h2`,{className:`font-nav text-xl font-semibold`,children:`Requirements`}),e.requirements.map((e,t)=>(0,H.jsxs)(`div`,{className:`border-border space-y-4 border-l-2 pl-4`,children:[(0,H.jsx)(`p`,{className:`whitespace-pre-wrap leading-7`,children:e.text}),e.scenarios.map((e,t)=>(0,H.jsx)(`pre`,{className:`bg-muted overflow-x-auto whitespace-pre-wrap rounded-md p-3 text-sm`,children:e.rawText},`${t}:${e.rawText}`))]},`${t}:${e.text}`))]})]})}function E8e({document:e}){if(D8e(e))return(0,H.jsxs)(`div`,{className:`border-destructive/40 bg-destructive/5 space-y-3 rounded-md border p-4`,children:[(0,H.jsx)(`h2`,{className:`font-medium`,children:k8e(e.provenance)}),(0,H.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:O8e(e.provenance)})]});let t=e.evidence;return(0,H.jsxs)(`div`,{className:`border-destructive/40 bg-destructive/5 space-y-3 rounded-md border p-4`,children:[(0,H.jsx)(`h2`,{className:`font-medium`,children:`OpenSpec could not project this Reference Spec.`}),(0,H.jsxs)(`div`,{className:`text-muted-foreground text-sm`,children:[`Exit status: `,t.exitCode??`unknown`]}),t.contractError&&(0,H.jsx)(`pre`,{className:`whitespace-pre-wrap`,children:t.contractError}),t.stderr&&(0,H.jsx)(`pre`,{className:`whitespace-pre-wrap`,children:t.stderr}),t.diagnostics.map((e,t)=>(0,H.jsxs)(`div`,{className:`text-sm`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e.code}),`: `,e.message]},`${e.code}:${t}`))]})}function D8e(e){return e.provenance.kind===`static`}function O8e(e){return g_(e).with({state:`omitted`},({referenceSourceCount:e})=>`Referenced content was omitted by the published snapshot policy (${e} observed sources).`).with({state:`none`},()=>`The published snapshot records no effective Reference sources.`).with({state:`snapshot-unavailable`},()=>`Static Reference inventory is unavailable for this Referenced Spec request.`).with({state:m_.union(`missing`,`included`),source:m_.not(m_.nullish)},({source:e})=>`The published snapshot does not contain this Spec from ${e.storeId}.`).with({state:m_.union(`missing`,`included`),source:null},()=>`The published snapshot does not contain this Reference Spec.`).exhaustive()}function k8e(e){return g_(e).with({state:`snapshot-unavailable`},()=>`Static Reference inventory cannot render this Referenced Spec request.`).with({state:m_.union(`included`,`missing`,`omitted`,`none`)},()=>`Published static snapshot cannot render this Reference Spec.`).exhaustive()}function A8e(e){return g_(e).with({provenance:{kind:`live`}},({identity:e})=>({subtitle:`Referenced from ${e.storeId} · ${e.specId}`,readOnlyLabel:`Read-only Reference projected from OpenSpec Store ${e.storeId}.`})).with({provenance:{kind:`static`,state:m_.union(`included`,`missing`),source:m_.not(m_.nullish)}},({identity:e,provenance:{source:t}})=>({subtitle:`Referenced from ${t.storeId} · ${e.specId}`,readOnlyLabel:`Read-only Reference projected from OpenSpec Store ${t.storeId}.`})).with({provenance:{kind:`static`,state:m_.union(`included`,`missing`),source:null}},({identity:e})=>Q9(e.specId)).with({provenance:{kind:`static`,state:`omitted`}},({identity:e})=>Q9(e.specId)).with({provenance:{kind:`static`,state:`none`}},({identity:e})=>Q9(e.specId)).with({provenance:{kind:`static`,state:`snapshot-unavailable`}},({identity:e})=>j8e(e.specId)).exhaustive()}function Q9(e){return{subtitle:`Referenced Spec request · ${e}`,readOnlyLabel:`Read-only Referenced Spec request from published static snapshot.`}}function j8e(e){return{subtitle:`Referenced Spec request · ${e}`,readOnlyLabel:`Read-only Referenced Spec request. Static Reference inventory is unavailable.`}}function M8e(e){return e.addChildren([hs({getParentRoute:()=>e,path:`/`,component:()=>null}),hs({getParentRoute:()=>e,path:`/dashboard`,component:J6e}),hs({getParentRoute:()=>e,path:`/config`,component:a3e}),hs({getParentRoute:()=>e,path:`/config/root`,component:_3e}),hs({getParentRoute:()=>e,path:`/config/schemas`,component:v3e}),hs({getParentRoute:()=>e,path:`/config/schemas/$schemaId`,component:A3e}),hs({getParentRoute:()=>e,path:`/specs`,component:_8e}),hs({getParentRoute:()=>e,path:`/specs/owned/$specId`,component:x8e}),hs({getParentRoute:()=>e,path:`/specs/referenced/$storeId/$specId`,component:x8e}),hs({getParentRoute:()=>e,path:`/changes`,component:O2e}),hs({getParentRoute:()=>e,path:`/changes/$changeId`,component:E4e}),hs({getParentRoute:()=>e,path:`/board`,component:_2e}),hs({getParentRoute:()=>e,path:`/archive`,component:oCe}),hs({getParentRoute:()=>e,path:`/archive/$changeId`,component:KKe}),hs({getParentRoute:()=>e,path:`/config/context`,component:B3e}),hs({getParentRoute:()=>e,path:`/settings`,component:d8e})])}function N8e(e){return e.addChildren([hs({getParentRoute:()=>e,path:`/`,component:()=>null}),hs({getParentRoute:()=>e,path:`/search`,component:i8e})])}function P8e(){return(0,V.useEffect)(()=>{yse()},[]),null}var $9=Bf(),F8e=Fs({routeTree:M8e(_s({component:RSe,pendingComponent:KSe})),basepath:$9});Tse(Fs({routeTree:N8e(_s({component:Cse})),history:$Se(`pop`,kp),basepath:$9}));function I8e(){return(0,H.jsx)(Qr,{client:vy,children:(0,H.jsxs)(ZSe,{children:[(0,H.jsx)(P8e,{}),(0,H.jsx)(Rs,{router:F8e})]})})}function L8e(){let e=document.getElementById(`root`);return!!e&&e.innerHTML.trim().length>0}function R8e(){let e=document.getElementById(`root`);e&&(Rf(!0),L8e()&&(e.innerHTML=``),(0,wl.createRoot)(e).render((0,H.jsx)(I8e,{})))}R8e();export{qw as $,Eye as A,Sy as At,gT as B,Uz as C,nx as Ct,nL as D,Yb as Dt,pEe as E,Xb as Et,p_e as F,Jn as Ft,Zue as G,dT as H,f_e as I,Vue as J,Wue as K,tE as L,lN as M,Cy as Mt,Dve as N,Z as Nt,Gbe as O,Gb as Ot,sN as P,Cl as Pt,Jw as Q,yT as R,Hz as S,ux as St,mEe as T,Zb as Tt,uT as U,pT as V,$w as W,Lue as X,Yw as Y,Rue as Z,mB as _,YS as _t,h6 as a,_le as at,pB as b,GS as bt,SB as c,XC as ct,kB as d,jC as dt,Kw as et,IB as f,cC as ft,gB as g,tC as gt,RB as h,QS as ht,C6 as i,iw as it,dN as j,vy as jt,wbe as k,yy as kt,NB as l,KC as lt,CB as m,$S as mt,P6 as n,Rw as nt,dV as o,vle as ot,PB as p,nC as pt,Bue as q,O6 as r,ow as rt,uV as s,gle as st,B6 as t,Hw as tt,AB as u,HC as ut,cB as v,JS as vt,Vz as w,ex as wt,Wz as x,Bx as xt,lB as y,KS as yt,vT as z};
|
|
1645
|
+
`).map(e=>e.trim()).filter(e=>e.length>0)}function P9(e){return{schema:e.schema??`spec-driven`,context:e.context??``,rules:Object.entries(e.rules??{}).map(([e,t])=>({id:`source:${e}`,artifactId:e,guidance:M9(t)})),applyGuidance:M9(e.operations?.apply?.guidance),archiveGuidance:M9(e.operations?.archive?.guidance)}}function l3e(e){let t=[],n=e.schema.trim();n.length===0&&t.push(`Schema is required.`),new TextEncoder().encode(e.context).byteLength>51200&&t.push(`Context must not exceed ${T9} UTF-8 bytes.`);let r={};for(let n of e.rules){let e=n.artifactId.trim(),i=N9(n.guidance);if(e.length===0){t.push(`Every rule group requires an artifact id.`);continue}if(Object.hasOwn(r,e)){t.push(`Artifact rule '${e}' is duplicated.`);continue}if(i.length===0){t.push(`Artifact rule '${e}' requires at least one rule.`);continue}r[e]=i}if(t.length>0)return{valid:!1,update:null,errors:t};let i=N9(e.applyGuidance),a=N9(e.archiveGuidance);return{valid:!0,errors:[],update:{schema:n,context:e.context.length>0?e.context:null,rules:Object.keys(r).length>0?r:null,operations:i.length>0||a.length>0?{apply:i.length>0?{guidance:i}:null,archive:a.length>0?{guidance:a}:null}:null}}}var F9=`border-input bg-background text-foreground placeholder:text-muted-foreground w-full min-w-0 rounded-md border px-3 py-2 text-sm outline-none focus-visible:ring-1 focus-visible:ring-primary read-only:cursor-default read-only:bg-muted/30`;function u3e(e,t,n){return e.map((e,r)=>r===t?{...e,...n}:e)}function d3e({draft:e,readOnly:t,onChange:n}){let r=(0,V.useRef)(1);return(0,H.jsxs)(`div`,{"aria-label":`Structured Active Root fields`,className:`@container min-w-0 space-y-5`,children:[(0,H.jsxs)(`div`,{className:`@2xl:grid-cols-2 grid min-w-0 grid-cols-1 gap-4`,children:[(0,H.jsxs)(`label`,{className:`min-w-0 space-y-1.5 text-sm`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:`Schema`}),(0,H.jsx)(`input`,{"aria-label":`Schema`,value:e.schema,readOnly:t,onChange:t=>n({...e,schema:t.target.value}),className:F9}),(0,H.jsx)(`span`,{className:`text-muted-foreground block text-xs`,children:`Workflow schema selected by OpenSpec for new Changes.`})]}),(0,H.jsxs)(`label`,{className:`@2xl:row-span-2 min-w-0 space-y-1.5 text-sm`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:`Project context`}),(0,H.jsx)(`textarea`,{"aria-label":`Project context`,value:e.context,readOnly:t,rows:7,onChange:t=>n({...e,context:t.target.value}),className:`${F9} resize-y`}),(0,H.jsx)(`span`,{className:`text-muted-foreground block text-xs`,children:`Injected into artifact and operation instructions; maximum 50 KiB UTF-8.`})]})]}),(0,H.jsxs)(`section`,{"aria-labelledby":`active-root-rules-title`,className:`min-w-0 space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h3`,{id:`active-root-rules-title`,className:`text-sm font-medium`,children:`Artifact rules`}),(0,H.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-xs`,children:`Additional rules keyed by artifact id; one rule per line.`})]}),t?null:(0,H.jsxs)(nL,{variant:`secondary`,size:`sm`,onClick:()=>{let t=`draft:${r.current}`;r.current+=1,n({...e,rules:[...e.rules,{id:t,artifactId:``,guidance:``}]})},children:[(0,H.jsx)($c,{className:`h-3.5 w-3.5`}),`Add artifact rules`]})]}),e.rules.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground rounded-md border border-dashed p-3 text-xs`,children:`No artifact-specific rules.`}):(0,H.jsx)(`div`,{className:`@2xl:grid-cols-2 grid min-w-0 grid-cols-1 gap-3`,children:e.rules.map((r,i)=>(0,H.jsxs)(`article`,{className:`border-border min-w-0 space-y-2 rounded-md border p-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsxs)(`label`,{className:`min-w-0 flex-1 space-y-1 text-xs`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:`Artifact id`}),(0,H.jsx)(`input`,{"aria-label":`Artifact id ${i+1}`,value:r.artifactId,readOnly:t,onChange:t=>n({...e,rules:u3e(e.rules,i,{artifactId:t.target.value})}),className:F9})]}),t?null:(0,H.jsx)(nL,{"aria-label":`Remove artifact rules ${i+1}`,variant:`ghost`,size:`icon-sm`,className:`mt-5`,onClick:()=>n({...e,rules:e.rules.filter(e=>e.id!==r.id)}),children:(0,H.jsx)(_l,{className:`h-3.5 w-3.5`})})]}),(0,H.jsxs)(`label`,{className:`block min-w-0 space-y-1 text-xs`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:`Rules`}),(0,H.jsx)(`textarea`,{"aria-label":`Rules for ${r.artifactId||`group ${i+1}`}`,value:r.guidance,readOnly:t,rows:4,onChange:t=>n({...e,rules:u3e(e.rules,i,{guidance:t.target.value})}),className:`${F9} resize-y`})]})]},r.id))})]}),(0,H.jsxs)(`section`,{"aria-labelledby":`active-root-operations-title`,className:`min-w-0 space-y-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h3`,{id:`active-root-operations-title`,className:`text-sm font-medium`,children:`Operation guidance`}),(0,H.jsx)(`p`,{className:`text-muted-foreground mt-0.5 text-xs`,children:`Advisory guidance is separate from artifact rules; one instruction per line.`})]}),(0,H.jsxs)(`div`,{className:`@2xl:grid-cols-2 grid min-w-0 grid-cols-1 gap-3`,children:[(0,H.jsxs)(`label`,{className:`min-w-0 space-y-1 text-xs`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:`Apply guidance`}),(0,H.jsx)(`textarea`,{"aria-label":`Apply guidance`,value:e.applyGuidance,readOnly:t,rows:5,onChange:t=>n({...e,applyGuidance:t.target.value}),className:`${F9} resize-y`})]}),(0,H.jsxs)(`label`,{className:`min-w-0 space-y-1 text-xs`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:`Archive guidance`}),(0,H.jsx)(`textarea`,{"aria-label":`Archive guidance`,value:e.archiveGuidance,readOnly:t,rows:5,onChange:t=>n({...e,archiveGuidance:t.target.value}),className:`${F9} resize-y`})]})]})]})]})}var f3e=`schema: spec-driven
|
|
1646
|
+
`;function I9(e,t){return e?.owner?.path===t?.owner?.path&&e?.filePath===t?.filePath&&e?.revision===t?.revision}function p3e(e){return e!==null&&e.owner!==null&&e.filePath!==null&&e.revision!==null}function m3e(e){return{ownerPath:e.owner.path,filePath:e.filePath,revision:e.revision}}function h3e({isStatic:e}){let{data:t,isLoading:n,isUpdating:r,error:i}=j9(),a=u9(),[o,s]=(0,V.useState)(`structured`),[c,l]=(0,V.useState)(!1),[u,d]=(0,V.useState)(null),[f,p]=(0,V.useState)(()=>P9({schema:null,context:null,rules:null,operations:null})),[m,h]=(0,V.useState)(``),[g,_]=(0,V.useState)(!1),[v,y]=(0,V.useState)(!1),[b,x]=(0,V.useState)(null),[S,C]=(0,V.useState)(null),w=(0,V.useRef)(null),T=(0,V.useRef)(a);T.current=a;let E=(0,V.useRef)(i);E.current=i;let D=(0,V.useRef)(n);D.current=n;let O=(0,V.useRef)(r);O.current=r;let k=(0,V.useRef)({structured:g,raw:v});k.current={structured:g,raw:v};let A=(0,V.useCallback)(e=>{p(P9(e.official)),h(e.exists?e.content??``:f3e),_(!1),y(!1)},[]);(0,V.useEffect)(()=>{if(!t)return;let e=w.current;if(!(e&&t.revision!==e)){if(e===t.revision&&(w.current=null),!c){if(I9(u,t))return;d(t),A(t),x(null),C(null);return}if(!u){d(t),A(t);return}I9(u,t)||x(t)}},[u,t,c,A]);let j=ti({mutationFn:e=>{let t=T.current,n=E.current;if(t.disabled||n!==null||D.current||O.current)throw Error(t.message??n?.message??`Active Root is stale.`);return Cy.planningConfig.writeActiveRoot.mutate(e)},onSuccess:(e,t)=>{if(e.state===`conflict`){x(A9(e.latest)),C(`The physical Active Root changed before this save could commit.`);return}if(e.state===`invalid`){C(e.diagnostics.map(({message:e})=>e).join(`
|
|
1647
|
+
`));return}let n=A9(e.config);if(w.current=n.revision,d(n),x(null),C(null),t.mode===`structured`?(p(P9(n.official)),_(!1)):(h(n.content??``),y(!1)),t.mode===`structured`?k.current.raw:k.current.structured){x(n),C(`The other mode retains an unsaved draft based on the previous revision.`);return}A(n),l(!1)}}),M=a.disabled||i!==null||n||r,N=c&&u!==null&&t!==void 0&&!I9(u,t),P=M||N||b!==null,F=o===`structured`?g:v,ee=j4e(`active-root`,a3e({available:t!=null,loading:n,transportError:i?.message??null,mutationPending:j.isPending,editing:c,dirty:F,conflict:b!==null,authority:a.status,authorityTitle:a.title,authorityMessage:a.message,refreshing:r,exists:t?.exists??!1,errorDiagnostic:t?.diagnostics.find(e=>e.severity===`error`)?.message??null,warningDiagnostic:t?.diagnostics.find(e=>e.severity===`warning`)?.message??null})),te=(0,V.useCallback)(()=>{!t||M||e||(d(t),A(t),t.exists||(o===`structured`?_(!0):y(!0)),x(null),C(null),j.reset(),l(!0))},[t,e,o,A,j,M]),I=(0,V.useCallback)(()=>{t&&(d(t),A(t)),x(null),C(null),j.reset(),l(!1)},[t,A,j]),ne=(0,V.useCallback)(e=>{if(!p3e(e)){C(`Active Root owner, file, or revision evidence is unavailable.`);return}if(C(null),o===`raw`){j.mutate({mode:`raw`,...m3e(e),content:m});return}let t=l3e(f);if(!t.valid){C(t.errors.join(`
|
|
1648
|
+
`));return}j.mutate({mode:`structured`,...m3e(e),update:t.update})},[o,m,j,f]);if(n&&!t)return(0,H.jsx)(`div`,{...ee,className:`space-y-4`,"aria-busy":`true`,children:(0,H.jsx)(YSe,{fields:4})});if(!t)return(0,H.jsx)(`div`,{...ee,role:`alert`,className:`text-destructive rounded-md border p-4 text-sm`,children:i?.message??`Active Root Config is unavailable.`});let L=i?.message??j.error?.message??S;return(0,H.jsxs)(`section`,{...ee,"data-testid":`active-root-config-surface`,className:`@container min-w-0 space-y-4`,"aria-busy":n||r||j.isPending,children:[(0,H.jsxs)(`header`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Active Root Config`}),t.owner?(0,H.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-1.5 text-xs`,children:[(0,H.jsxs)(`span`,{className:`text-muted-foreground break-all`,children:[`Planning root: `,t.owner.path]}),(0,H.jsx)(g9,{ariaLabel:`Active Root source ${t.owner.source}`,tooltip:`The CLI selected this root from source ${t.owner.source}.`,children:t.owner.source}),t.owner.storeId?(0,H.jsxs)(g9,{ariaLabel:`Active Root Store ${t.owner.storeId}`,tooltip:`Writes target Store ${t.owner.storeId}.`,children:[`Store `,t.owner.storeId]}):null,t.filePath?(0,H.jsx)(g9,{ariaLabel:`Active Root config file path`,tooltip:t.filePath,children:`Config file`}):null,t.revision?(0,H.jsxs)(g9,{ariaLabel:`Active Root config revision`,tooltip:t.revision,children:[`Revision `,t.revision.slice(7,15)]}):null]}):(0,H.jsx)(`p`,{className:`text-muted-foreground mt-1 text-xs`,children:`Static Active Root snapshot`})]}),(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(0,H.jsx)(w4e,{state:a}),(t.exists||c)&&(0,H.jsx)(`div`,{role:`tablist`,"aria-label":`Active Root editor mode`,className:`bg-muted flex rounded-md p-0.5`,children:[`structured`,`raw`].map(e=>(0,H.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":o===e,disabled:j.isPending,onClick:()=>s(e),className:`inline-flex items-center gap-1.5 rounded px-2.5 py-1 text-xs font-medium ${o===e?`bg-background text-foreground shadow-sm`:`text-muted-foreground`}`,children:[e===`structured`?(0,H.jsx)(Xs,{className:`h-3.5 w-3.5`}):(0,H.jsx)(mc,{className:`h-3.5 w-3.5`}),e===`structured`?`Structured`:`Raw YAML`]},e))}),!e&&!M&&t.exists&&!c?(0,H.jsxs)(nL,{variant:`secondary`,size:`sm`,onClick:te,children:[(0,H.jsx)(Zc,{className:`h-3.5 w-3.5`}),`Edit`]}):null,c?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(nL,{variant:`secondary`,size:`sm`,onClick:I,disabled:j.isPending,children:[(0,H.jsx)(Cl,{className:`h-3.5 w-3.5`}),`Cancel`]}),(0,H.jsxs)(HSe,{size:`sm`,pending:j.isPending,settled:!F,onClick:()=>ne(u),disabled:j.isPending||P||!F,children:[(0,H.jsx)(rl,{className:`h-3.5 w-3.5`}),`Save `,o===`structured`?`Structured`:`Raw YAML`]})]}):null]})]}),t.owner?.externalToLaunchProject&&t.owner.storeId?(0,H.jsxs)(`div`,{role:`note`,"aria-label":`Shared Store write impact`,className:`rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs`,children:[`This Active Root belongs to shared Store `,(0,H.jsx)(`strong`,{children:t.owner.storeId}),`. Saves affect every project currently resolving this Store.`]}):null,t.diagnostics.length>0?(0,H.jsx)(`div`,{role:t.diagnostics.some(({severity:e})=>e===`error`)?`alert`:`note`,className:`border-border space-y-1 rounded-md border p-3 text-xs`,children:t.diagnostics.map(e=>(0,H.jsxs)(`p`,{children:[(0,H.jsx)(`strong`,{children:e.path}),`: `,e.message]},`${e.code}:${e.path}`))}):null,L?(0,H.jsx)(`div`,{role:`alert`,className:`text-destructive whitespace-pre-wrap rounded-md border p-3 text-sm`,children:L}):null,!e&&a.disabled?(0,H.jsx)(x9,{state:a}):null,b?(0,H.jsx)(s3e,{latest:b,mode:o,pending:j.isPending,retryDisabled:M||!F,onReload:()=>{w.current=null,d(b),A(b),x(null),C(null),j.reset()},onRetry:()=>ne(b)}):null,t.exists||c?(0,H.jsx)(`div`,{role:`tabpanel`,"aria-label":o===`structured`?`Structured Active Root editor`:`Raw YAML Active Root editor`,className:`min-w-0`,children:o===`structured`?(0,H.jsx)(d3e,{draft:f,readOnly:!c||j.isPending||P,onChange:e=>{p(e),_(!0),C(null),j.reset()}}):(0,H.jsx)(c3e,{value:m,readOnly:!c||j.isPending||P,onChange:e=>{h(e),y(!0),C(null),j.reset()},onSaveShortcut:()=>{c&&v&&!j.isPending&&!P&&ne(u)}})}):(0,H.jsxs)(`div`,{className:`text-muted-foreground rounded-md border border-dashed p-4 text-sm`,children:[(0,H.jsx)(`p`,{className:`mb-3`,children:`No config file exists in the active Planning root.`}),!e&&!M?(0,H.jsx)(nL,{size:`sm`,onClick:te,children:`Create Active Root config`}):null]})]})}function g3e(){let e=Lf();return(0,H.jsx)(S9,{current:`root`,header:(0,H.jsx)(C9,{title:`Active Root`,description:`Inspect and edit the configuration owned by the CLI-selected Planning Root.`,icon:(0,H.jsx)(bc,{className:`h-6 w-6 shrink-0`,"aria-hidden":!0})}),children:(0,H.jsx)(h3e,{isStatic:e})})}function _3e(){let{data:e,isLoading:t,error:n}=Xy(),r=e?.schemas,i=r===void 0&&t&&n===null,a=r?.length===0&&n===null;return(0,H.jsx)(S9,{current:`schemas`,header:(0,H.jsx)(C9,{title:`Schemas`,description:`Browse resolved OpenSpec workflow schemas, then open one focused detail workspace.`,icon:(0,H.jsx)(Ys,{className:`h-6 w-6 shrink-0`,"aria-hidden":!0})}),children:(0,H.jsxs)(`div`,{className:`space-y-4`,"data-schema-catalog":`true`,children:[n?(0,H.jsxs)(`div`,{role:`alert`,className:`text-destructive border-destructive/40 bg-destructive/10 flex items-start gap-2 rounded-lg border p-4 text-sm`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`font-medium`,children:`Schema catalog refresh failed.`}),(0,H.jsx)(`p`,{children:n.message}),r===void 0?null:(0,H.jsx)(`p`,{className:`text-muted-foreground mt-1 text-xs`,children:`Retaining the last successful catalog while the replacement observation is unavailable.`})]})]}):null,i?(0,H.jsx)(`section`,{"aria-label":`Loading Schema catalog`,className:`border-border bg-card rounded-lg border p-4`,children:(0,H.jsx)(dL,{count:5})}):null,r&&r.length>0?(0,H.jsx)(iL,{active:t,children:(0,H.jsx)(`ul`,{className:`@[48rem]:grid-cols-2 grid gap-3`,children:r.map(e=>(0,H.jsx)(`li`,{className:`min-w-0`,children:(0,H.jsxs)(Nb,{to:`/config/schemas/${encodeURIComponent(e.name)}`,className:`border-border bg-card hover:border-primary/40 hover:bg-muted/40 focus-visible:ring-primary flex min-h-32 min-w-0 flex-col justify-between gap-4 rounded-lg border p-4 outline-none focus-visible:ring-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-3`,children:[(0,H.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-semibold`,children:e.name}),(0,H.jsx)(`span`,{className:`bg-muted text-muted-foreground shrink-0 rounded px-2 py-0.5 text-[10px]`,children:e.source})]}),(0,H.jsx)(`p`,{className:`text-muted-foreground mt-2 line-clamp-2 text-xs`,children:e.description||`No schema description provided.`})]}),(0,H.jsxs)(`div`,{className:`text-muted-foreground flex items-center justify-between gap-3 text-xs`,children:[(0,H.jsxs)(`span`,{children:[e.artifacts.length,` artifacts`]}),(0,H.jsxs)(`span`,{className:`text-foreground inline-flex items-center gap-1 font-medium`,children:[`Open`,(0,H.jsx)(Ks,{className:`h-3.5 w-3.5`,"aria-hidden":!0})]})]})]})},e.name))})}):null,a?(0,H.jsxs)(`section`,{className:`border-border bg-card text-muted-foreground flex min-h-40 flex-col items-center justify-center gap-2 rounded-lg border border-dashed p-6 text-center text-sm`,children:[(0,H.jsx)(Jc,{className:`h-6 w-6`,"aria-hidden":!0}),(0,H.jsx)(`p`,{children:`No schemas available.`})]}):null]})})}function v3e(e){return e===`auto`||e===`scroll`||e===`overlay`}function y3e(e,t={}){let{allowNonScrollable:n=!1}=t,r=e?.parentElement??null;for(;r;){if(v3e(window.getComputedStyle(r).overflowY)&&(n||r.scrollHeight>r.clientHeight))return r;r=r.parentElement}return null}function b3e(e){if(e){let t=e.getBoundingClientRect();return{top:t.top,bottom:t.bottom}}return{top:0,bottom:window.innerHeight}}function x3e(e,t=y3e(e,{allowNonScrollable:!0})){if(typeof window>`u`||!e)return null;let n=e.getBoundingClientRect(),r=b3e(t);return Math.max(Math.floor(r.bottom-Math.max(n.top,r.top)),0)}function S3e({target:e,enabled:t=!0}){let[n,r]=(0,V.useState)(null);return(0,V.useLayoutEffect)(()=>{if(!t||typeof window>`u`){r(null);return}if(!e){r(null);return}let n=null,i=null,a=window,o=e=>{r(t=>t===e?t:e)},s=e=>{i!==e&&(a.removeEventListener(`scroll`,c),n&&i&&n.unobserve(i),i=e,a=e??window,a.addEventListener(`scroll`,c,{passive:!0}),n&&i&&n.observe(i))},c=()=>{let t=y3e(e,{allowNonScrollable:!0});s(t),o(x3e(e,t))};return typeof ResizeObserver<`u`&&(n=new ResizeObserver(()=>{c()}),n.observe(e),e.parentElement&&n.observe(e.parentElement)),c(),window.addEventListener(`resize`,c),()=>{window.removeEventListener(`resize`,c),a.removeEventListener(`scroll`,c),n?.disconnect()}},[t,e]),n}var C3e=new Set([`generates`,`template`,`path`,`outputPath`]),w3e=new Set([`requires`,`tags`]),T3e=new Set([`id`,`generates`,`description`,`template`,`instruction`,`requires`]);function L9(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function E3e(e){if(!e)return{data:null};try{let t=Ig(e);return L9(t)?{data:t}:{data:null}}catch(e){return{data:null,error:e instanceof Error?e.message:String(e)}}}function D3e(e){let t=e.split(`/`);if(t.length<=1)return null;t.pop();let n=t.join(`/`);return n.length>0?n:null}function O3e(){let[e,t]=(0,V.useState)(null);return{viewportHeight:S3e({target:e,enabled:e!==null}),setViewportNode:t}}function k3e(){let{schemaId:e}=qo({strict:!1}),t=Mb();return(0,H.jsx)(A3e,{schemaId:e,onNavigate:e=>void t({href:e})})}function A3e({onNavigate:e,schemaId:t}){let n=Lf(),{viewportHeight:r,setViewportNode:i}=O3e(),[a,o]=(0,V.useState)(`read`),[s,c]=(0,V.useState)(null),[l,u]=(0,V.useState)(null),[d,f]=(0,V.useState)(!1),[p,m]=(0,V.useState)(!1),[h,g]=(0,V.useState)(!1),[_,v]=(0,V.useState)(!1),[y,b]=(0,V.useState)(!1),[x,S]=(0,V.useState)(`file`),[C,w]=(0,V.useState)(null),[T,E]=(0,V.useState)(``),[D,O]=(0,V.useState)(null),[k,A]=(0,V.useState)(null),[j,M]=(0,V.useState)(null),[N,P]=(0,V.useState)(null),F=(0,V.useRef)(null),[ee,te]=(0,V.useState)(!0),[I,ne]=(0,V.useState)(``),[L,re]=(0,V.useState)(`init`),[ie,ae]=(0,V.useState)(`spec-driven`),oe=u9(),se=(0,V.useRef)(oe);se.current=oe;let{data:ce,isLoading:le,error:ue,authority:de}=Xy(),R=(0,V.useRef)(de);R.current=de;let fe=ce?.schemas,pe=fe===void 0&&le&&ue===null,me=fe?.length===0&&ue===null,he=t,ge=he?ce?.schemaDetails[he]??null:null,_e=he?ce?.schemaResolutions[he]??null:null,{data:ve,isLoading:ye,error:be}=Loe(he),{data:xe}=Ioe(he),{data:Se}=Roe(he),[Ce,we]=(0,V.useState)(null),[Te,Ee]=(0,V.useState)({}),[De,Oe]=(0,V.useState)({}),ke=!n&&!oe.disabled&&de.state===`current`&&_e?.source!==void 0&&_e.source!==`package`,Ae=ke&&!n,je=(0,V.useCallback)(()=>{let e=se.current;if(e.disabled)throw Error(e.message??`Planning root is unavailable.`);if(R.current.state!==`current`)throw Error(`Schema configuration is refreshing; mutations remain read-only.`)},[]);(0,V.useEffect)(()=>{a===`edit`&&!ke&&o(`read`)},[ke,a]),(0,V.useEffect)(()=>{o(`read`),we(null),Ee({}),Oe({}),u(null),O(null),A(null),M(null),P(null)},[he]),(0,V.useEffect)(()=>{if(!ve||ve.length===0){we(null);return}let e=ve.filter(e=>e.type===`file`);if(e.length===0){we(null);return}(!Ce||!e.some(e=>e.path===Ce))&&we(e.find(e=>e.path===`schema.yaml`)?.path??e[0].path)},[ve,Ce]);let Me=(0,V.useMemo)(()=>ve??[],[ve]),Ne=ve===void 0&&ye&&be===null,Pe=!Ne&&(!be||Me.length>0),Fe=(0,V.useMemo)(()=>!Me.length||!Ce?null:Me.find(e=>e.path===Ce&&e.type===`file`)??null,[Me,Ce]),Ie=Fe?Te[Fe.path]:void 0,Le=Fe?!!De[Fe.path]:!1;(0,V.useEffect)(()=>{if(!Fe||De[Fe.path])return;let e=Fe.content??``;Ee(t=>t[Fe.path]===e?t:{...t,[Fe.path]:e})},[Fe,De]);let Re=(0,V.useMemo)(()=>fe?.find(e=>e.name===he),[fe,he]),ze=(0,V.useMemo)(()=>fe?.map(e=>({value:e.name,label:e.name}))??[],[fe]),Be=(0,V.useMemo)(()=>{let e=`schema.yaml`,t=Me.find(t=>t.path===e),n=Te[e];return De[e]&&n!==void 0?n:t?.content??``},[De,Te,Me]),Ve=(0,V.useMemo)(()=>E3e(Be),[Be]),He=Ve.data,Ue=(0,V.useMemo)(()=>{if(!He)return[];let e=He.artifacts;return Array.isArray(e)?e.filter(L9):[]},[He]),We=(0,V.useMemo)(()=>{let e=new Map;for(let t of Ue){let n=typeof t.id==`string`?t.id:void 0;n&&e.set(n,t)}return e},[Ue]),Ge=(0,V.useMemo)(()=>ge?.artifacts?.length?ge.artifacts:Ue.map((e,t)=>({id:typeof e.id==`string`?e.id:`artifact-${t+1}`,outputPath:typeof e.generates==`string`?e.generates:``,description:typeof e.description==`string`?e.description:void 0,requires:Array.isArray(e.requires)?e.requires.filter(e=>typeof e==`string`):[]})),[Ue,ge?.artifacts]),Ke=(0,V.useMemo)(()=>{let e=new Map;for(let[t,n]of Object.entries(De)){if(!n)continue;let r=Te[t];r!==void 0&&e.set(t,r)}return e},[De,Te]),qe=(0,V.useMemo)(()=>Object.values(De).some(Boolean),[De]),Je=(0,V.useMemo)(()=>{if(!D)return null;let e=D.type===`file`,t=new TextEncoder,n=e?t.encode(D.content??``).length:void 0,r=D.path===`/`,i=D.type===`directory`?r?Me.length:Me.filter(e=>e.path.startsWith(D.path+`/`)).length:void 0;return{path:r?_e?.displayPath??_e?.path??`/`:D.path,type:D.type,source:_e?.source??`unknown`,sizeBytes:n,childCount:i}},[D,Me,_e]),Ye=(0,V.useMemo)(()=>_e?.displayPath?_e.displayPath:_e?.path?rm(_e.path,{source:_e.source}):`project:openspec/schemas`,[_e]),Xe=(0,V.useMemo)(()=>({path:`/`,type:`directory`}),[]),Ze=ti({mutationFn:async e=>{je(),he&&await Cy.opsx.writeSchemaFile.mutate({schema:he,path:e.path,content:e.content})},onSuccess:(e,t)=>{Oe(e=>({...e,[t.path]:!1})),u(null)},onError:e=>{u(e instanceof Error?e.message:String(e))}}),Qe=ti({mutationFn:async e=>{je(),he&&await Cy.opsx.createSchemaFile.mutate({schema:he,path:e.path,content:e.content})},onSuccess:(e,t)=>{u(null),g(!1),E(``),we(t.path)},onError:e=>{u(e instanceof Error?e.message:String(e))}}),$e=ti({mutationFn:async e=>{je(),he&&await Cy.opsx.createSchemaDirectory.mutate({schema:he,path:e.path})},onSuccess:()=>{u(null),g(!1),E(``)},onError:e=>{u(e instanceof Error?e.message:String(e))}}),et=ti({mutationFn:async e=>{je(),he&&await Cy.opsx.deleteSchemaEntry.mutate({schema:he,path:e.path})},onSuccess:(e,t)=>{u(null),v(!1),O(null),Oe(e=>{let n={...e};return delete n[t.path],n}),Ee(e=>{let n={...e};return delete n[t.path],n})},onError:e=>{u(e instanceof Error?e.message:String(e))}}),tt=ti({mutationFn:async e=>{je();let t=e.mode===`init`?await Cy.opsx.initSchema.mutate({name:e.name}):await Cy.opsx.forkSchema.mutate({source:e.source,name:e.name});if(!t.success)throw Error(t.stderr||`Schema ${e.mode} failed.`);return t},onSuccess:()=>{c(null)},onError:e=>{c(e instanceof Error?e.message:String(e))}}),nt=ti({mutationFn:async()=>{je(),he&&await Cy.opsx.deleteSchema.mutate({name:he})},onSuccess:()=>{c(null)},onError:e=>{c(e instanceof Error?e.message:String(e))}}),rt=(0,V.useCallback)(e=>{e===`edit`&&!ke||o(e)},[ke]),it=(0,V.useCallback)(e=>{Fe&&(Ee(t=>({...t,[Fe.path]:e})),Oe(e=>({...e,[Fe.path]:!0})))},[Fe]),at=(0,V.useCallback)(()=>{Fe&&(Ee(e=>({...e,[Fe.path]:Fe.content??``})),Oe(e=>({...e,[Fe.path]:!1})))},[Fe]),ot=(0,V.useCallback)(()=>{if(!Fe||!ke)return;let e=Ie??Fe.content??``;Ze.mutate({path:Fe.path,content:e})},[Ie,Fe,Ze,ke]),st=(0,V.useCallback)((e,t)=>{let n=t.trim().replace(/^\/+/,``),r=e?e.replace(/\/+$/,``):``;return r?`${r}/${n}`:n},[]),ct=(0,V.useCallback)((e,t)=>{!ke||n||(u(null),S(e),w(t),E(``),g(!0))},[n,ke]),lt=(0,V.useCallback)(()=>{if(!Ae)return;let e=T.trim();if(!e){u(`Name is required.`);return}if(e.includes(`..`)){u(`Name cannot include "..".`);return}let t=st(C,e);if(!t){u(`Invalid path.`);return}if(x===`file`){Qe.mutate({path:t,content:``});return}$e.mutate({path:t})},[T,C,x,$e,Qe,st,Ae]),ut=(0,V.useCallback)(e=>{u(null),O(e),v(!0)},[]),dt=(0,V.useCallback)(()=>{!D||!Ae||et.mutate({path:D.path})},[D,Ae,et]),ft=(0,V.useCallback)(e=>{O(e),b(!0)},[]),pt=(0,V.useMemo)(()=>{let e=[];return Ae&&e.push({id:`new-file-root`,label:`New file`,icon:(0,H.jsx)(gc,{className:`h-3.5 w-3.5`}),onSelect:()=>ct(`file`,null)},{id:`new-folder-root`,label:`New folder`,icon:(0,H.jsx)(wc,{className:`h-3.5 w-3.5`}),onSelect:()=>ct(`directory`,null)}),e.push({id:`root-properties`,label:`Properties`,icon:(0,H.jsx)(Mc,{className:`h-3.5 w-3.5`}),onSelect:()=>ft(Xe)}),e},[Ae,ct,ft,Xe]),mt=(0,V.useMemo)(()=>[{id:`file-save`,label:`Save`,icon:(0,H.jsx)(rl,{className:`h-3.5 w-3.5`}),disabled:!ke||!Le,onSelect:()=>ot()},{id:`file-revert`,label:`Revert`,icon:(0,H.jsx)(Cl,{className:`h-3.5 w-3.5`}),disabled:!ke||!Le,onSelect:()=>at()}],[Le,at,ot,ke]),ht=(0,V.useMemo)(()=>[{id:`view-wrap`,label:ee?`Disable line wrap`:`Enable line wrap`,onSelect:()=>te(e=>!e)}],[ee]),gt=(0,V.useCallback)(()=>{ke&&(c(null),ne(``),re(`init`),ae(he??`spec-driven`),f(!0))},[ke,he]),_t=(0,V.useCallback)(()=>{!he||!ke||(c(null),m(!0))},[ke,he]),vt=(0,V.useCallback)(()=>{if(!ke)return;let t=I.trim();if(!t){c(`Schema name is required.`);return}let n=L===`fork`?{mode:`fork`,source:ie.trim()||`spec-driven`,name:t}:{mode:`init`,name:t};tt.mutate(n,{onSuccess:()=>{f(!1),e(`/config/schemas/${encodeURIComponent(t)}`)}})},[tt,L,I,ie,e,ke]),yt=(0,V.useCallback)(()=>{ke&&nt.mutate(void 0,{onSuccess:()=>{m(!1),e(`/config/schemas`)}})},[nt,e,ke]),bt=(0,V.useCallback)((e,t)=>{if(t==null)return(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});if(Array.isArray(t)){if(t.length===0)return(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let n=t.filter(e=>typeof e==`string`);return w3e.has(e)&&n.length>0||n.length===t.length?(0,H.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:n.map(e=>(0,H.jsx)(`span`,{className:`bg-muted rounded px-2 py-0.5 text-[10px]`,children:e},e))}):(0,H.jsx)(JY,{value:JSON.stringify(t,null,2),readOnly:!0,language:`json`,lineWrapping:!0})}return L9(t)?(0,H.jsx)(JY,{value:JSON.stringify(t,null,2),readOnly:!0,language:`json`,lineWrapping:!0}):typeof t==`string`?e===`instruction`?(0,H.jsx)(`div`,{className:`bg-muted/30 rounded-lg p-4 [zoom:0.92]`,children:(0,H.jsx)(j3,{markdown:t,collectToc:!1})}):t.includes(`
|
|
1649
|
+
`)?(0,H.jsx)(JY,{value:t,readOnly:!0,filename:`${e}.md`,lineWrapping:!0}):C3e.has(e)||t.includes(`/`)||t.endsWith(`.md`)||t.endsWith(`.yaml`)?(0,H.jsx)(`code`,{className:`bg-muted rounded px-1`,children:t}):(0,H.jsx)(`span`,{children:t}):(0,H.jsx)(`span`,{children:String(t)})},[]),xt=(0,H.jsx)(`section`,{"data-schema-detail-content":`true`,className:`min-w-0`,children:(0,H.jsxs)(`div`,{className:`space-y-4 pr-1`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,H.jsx)(IL,{value:a,onChange:rt,options:[{value:`read`,label:`Read`},{value:`preview`,label:`Preview`},{value:`edit`,label:`Edit`,disabled:!ke}]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(w4e,{state:oe}),(0,H.jsxs)(`button`,{type:`button`,onClick:gt,disabled:!ke||tt.isPending,className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,H.jsx)($c,{className:`h-3.5 w-3.5`}),`Add`]}),(0,H.jsxs)(`button`,{type:`button`,onClick:_t,disabled:!ke||nt.isPending,className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,H.jsx)(_l,{className:`h-3.5 w-3.5`}),`Delete`]})]})]}),!n&&oe.disabled?(0,H.jsx)(x9,{state:oe}):null,s&&(0,H.jsx)(`div`,{className:`text-destructive text-xs`,children:s}),l&&(0,H.jsx)(`div`,{className:`text-destructive text-xs`,children:l}),(0,H.jsx)(`div`,{ref:i,className:`flex min-h-0 flex-col`,style:r==null?void 0:{height:`${r}px`},children:Re?a===`preview`?(0,H.jsx)(j3,{className:`min-h-0 flex-1`,markdown:({H1:e,H2:t,H3:n,Section:r})=>{let i=`schema-${Re.name}`,a=e=>`${i}-${e}`;return(0,H.jsxs)(`div`,{className:`space-y-6`,children:[(0,H.jsxs)(r,{children:[(0,H.jsx)(e,{id:i,children:Re.name}),Re.description&&(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:Re.description})]}),_e&&(0,H.jsxs)(r,{children:[(0,H.jsx)(t,{id:a(`resolution`),children:`Resolution`}),(0,H.jsxs)(`div`,{className:`text-muted-foreground mt-2 space-y-1 pl-4 text-sm`,children:[(0,H.jsxs)(`div`,{children:[`Source: `,_e.source]}),(0,H.jsxs)(`div`,{className:`truncate`,children:[`Path: `,_e.displayPath??_e.path]}),_e.shadows.length>0&&(0,H.jsxs)(`div`,{children:[`Shadows:`,` `,_e.shadows.map(e=>`${e.source}(${e.displayPath??e.path})`).join(`, `)]})]})]}),Ve.error&&(0,H.jsxs)(r,{children:[(0,H.jsx)(t,{id:a(`schema-errors`),children:`Schema errors`}),(0,H.jsxs)(`div`,{className:`border-destructive/40 bg-destructive/10 text-destructive mt-2 rounded-md border px-3 py-2 text-sm`,children:[`schema.yaml parse error: `,Ve.error]})]}),(0,H.jsxs)(r,{children:[(0,H.jsx)(t,{id:a(`artifacts`),children:`Artifacts`}),Ge.length>0?(0,H.jsx)(`div`,{className:`mt-3 space-y-6`,children:Ge.map(e=>{let t=We.get(e.id),i=Se?.[e.id]??(xe?.[e.id]?{...xe[e.id],content:null}:null),o=i?.path??(typeof t?.template==`string`?t.template:void 0),s=i?.displayPath??o??null,c=o===void 0?void 0:Ke.get(o),l=c===void 0?i?i.content:null:c,u=[[`id`,t?.id??e.id],[`generates`,t?.generates??e.outputPath],[`description`,t?.description??e.description],[`instruction`,t?.instruction],[`requires`,t?.requires??e.requires]].filter(e=>e[1]!==void 0),d=t?Object.entries(t).filter(([e])=>!T3e.has(e)):[];return(0,H.jsxs)(r,{className:`space-y-3`,children:[(0,H.jsx)(n,{id:a(`artifact-${e.id}`),children:e.id}),(0,H.jsxs)(`div`,{className:`border-border space-y-4 rounded-lg border px-4 py-4 text-sm`,children:[(0,H.jsx)(`div`,{className:`space-y-3`,children:u.map(([e,t])=>{let n=e===`requires`,r=n&&Array.isArray(t)?t.filter(e=>typeof e==`string`):[];return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs font-semibold uppercase tracking-wide`,children:e}),(0,H.jsx)(`div`,{className:`pl-4 text-sm leading-6`,children:n?r.length>0?(0,H.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:r.map(e=>Ge.some(t=>t.id===e)?(0,H.jsx)(`a`,{href:`#${a(`artifact-${e}`)}`,className:`bg-primary hover:bg-primary/80 text-primary-foreground rounded-md px-2 py-0.5 text-xs transition-colors`,children:e},e):(0,H.jsx)(`span`,{className:`bg-muted text-muted-foreground rounded-md px-2 py-0.5 text-xs`,children:e},e))}):(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):bt(e,t)})]},e)})}),o&&(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs font-semibold uppercase tracking-wide`,children:`Template`}),(0,H.jsxs)(`div`,{className:`text-muted-foreground pl-4 text-xs`,children:[(0,H.jsx)(`span`,{className:`mr-1`,children:`Template:`}),(0,H.jsx)(`code`,{className:`bg-muted rounded px-1`,children:s}),i?.source?` (${i.source})`:null]}),l==null?(0,H.jsx)(`div`,{className:`text-muted-foreground pl-4 text-sm`,children:`Template content unavailable.`}):(0,H.jsx)(`div`,{className:`pl-4`,children:(0,H.jsx)(`div`,{className:`bg-muted/30 rounded-lg p-4 [zoom:0.86]`,children:(0,H.jsx)(j3,{markdown:l,collectToc:!1})})})]}),d.length>0&&(0,H.jsxs)(`div`,{className:`space-y-3`,children:[(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs font-semibold uppercase tracking-wide`,children:`Extra fields`}),d.map(([e,t])=>(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:e}),(0,H.jsx)(`div`,{className:`pl-4 text-sm leading-6`,children:bt(e,t)})]},e))]})]})]},e.id)})}):(0,H.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:`Select a schema to view details.`}),ge?.applyRequires?.length?(0,H.jsxs)(`div`,{className:`text-muted-foreground mt-3 text-xs`,children:[`Apply requires: `,ge.applyRequires.join(`, `)]}):null]}),qe&&(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`Preview is rendering draft content. Save to persist changes.`})]})}}):(0,H.jsxs)(ZY,{ref:F,className:`flex min-h-0 flex-1 flex-col gap-4`,children:[be&&(0,H.jsxs)(`div`,{role:`alert`,className:`text-destructive text-xs`,children:[`Failed to load schema files: `,be.message]}),Ne?(0,H.jsx)(dL,{count:6}):Pe?(0,H.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,H.jsx)(tX,{entries:Me,selectedPath:Ce,onSelect:we,breadcrumbRoot:Ye,headerLabel:(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(`span`,{className:`uppercase tracking-wide`,children:`Files`}),(0,H.jsx)(`span`,{className:`text-muted-foreground/80 truncate text-[10px] normal-case`,title:Ye,children:Ye})]}),headerActions:pt.length>0?(0,H.jsx)(QY,{children:(0,H.jsx)(`button`,{type:`button`,onClick:e=>{M(null),P(null),A({type:`target`,element:e.currentTarget,placement:`bottom-end`})},className:`hover:bg-muted rounded-md p-1`,"aria-label":`Schema menu`,children:(0,H.jsx)(dc,{className:`h-4 w-4`})})}):void 0,entryActions:e=>{let t={id:`properties`,label:`Properties`,icon:(0,H.jsx)(Mc,{className:`h-3.5 w-3.5`}),onSelect:()=>ft(e)};if(a!==`edit`||!Ae)return[t];let n=e.type===`directory`?e.path:D3e(e.path),r=e.type===`directory`;return[{id:`new-file`,label:r?`New file inside`:`New sibling file`,icon:(0,H.jsx)(gc,{className:`h-3.5 w-3.5`}),onSelect:()=>ct(`file`,n)},{id:`new-folder`,label:r?`New folder inside`:`New sibling folder`,icon:(0,H.jsx)(wc,{className:`h-3.5 w-3.5`}),onSelect:()=>ct(`directory`,n)},t,{id:`delete`,label:`Delete`,icon:(0,H.jsx)(_l,{className:`h-3.5 w-3.5`}),tone:`destructive`,onSelect:()=>ut(e)}]},emptyState:(0,H.jsx)(`span`,{children:`No files found for this schema.`}),renderEditor:e=>e?(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[a===`edit`&&(0,H.jsxs)(`div`,{className:`border-border/50 flex items-center justify-between border-b px-3 py-2 text-xs`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(QY,{children:(0,H.jsx)(`button`,{type:`button`,onClick:e=>{A(null),P(null),M({type:`target`,element:e.currentTarget,placement:`bottom-start`})},className:`hover:bg-muted rounded-md px-2 py-1 text-xs font-semibold`,children:`File`})}),(0,H.jsx)(QY,{children:(0,H.jsx)(`button`,{type:`button`,onClick:e=>{A(null),M(null),P({type:`target`,element:e.currentTarget,placement:`bottom-start`})},className:`hover:bg-muted rounded-md px-2 py-1 text-xs font-semibold`,children:`View`})})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(`button`,{type:`button`,onClick:at,className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium`,children:[(0,H.jsx)(Cl,{className:`h-3.5 w-3.5`}),`Cancel`]}),(0,H.jsxs)(nL,{size:`sm`,onClick:ot,disabled:Ze.isPending||!ke,activity:Ze.isPending,children:[(0,H.jsx)(rl,{className:`h-3.5 w-3.5`}),`Save`]})]})]}),(0,H.jsx)(nX,{file:e,value:a===`edit`?Ie??e.content??``:e.content??``,readOnly:a!==`edit`||!ke,onChange:a===`edit`?it:void 0,lineWrapping:ee,editorMinHeight:`0px`}),_e?.source===`package`&&(0,H.jsx)(`div`,{className:`text-muted-foreground border-border/50 border-t px-3 py-2 text-xs`,children:`Package-provided schemas are read-only.`})]}):(0,H.jsx)(`div`,{className:`text-muted-foreground flex h-full items-center justify-center`,children:`Select a file to view`})})}):null,(0,H.jsx)(XY,{open:!!k,items:pt,anchor:k,boundaryElement:F.current,onClose:()=>A(null)}),(0,H.jsx)(XY,{open:!!j,items:mt,anchor:j,boundaryElement:F.current,onClose:()=>M(null)}),(0,H.jsx)(XY,{open:!!N,items:ht,anchor:N,boundaryElement:F.current,onClose:()=>P(null)})]}):(0,H.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:`Select a schema to view details.`})})]})});return(0,H.jsx)(S9,{current:`schemas`,header:(0,H.jsx)(C9,{backHref:`/config/schemas`,backLabel:`Schemas`,title:he?`Schema: ${he}`:`Schema`,description:`Inspect resolved schema facts, preview artifacts, and edit writable physical files.`,icon:(0,H.jsx)(Pc,{className:`h-6 w-6 shrink-0`,"aria-hidden":!0})}),children:(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(El,{open:d,onClose:()=>f(!1),title:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Pc,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{className:`text-sm font-semibold`,children:`Add schema`})]}),footer:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>f(!1),className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium`,children:`Cancel`}),(0,H.jsxs)(`button`,{type:`button`,onClick:vt,disabled:!ke||!I.trim()||tt.isPending,"aria-busy":tt.isPending||void 0,className:`bg-primary text-primary-foreground inline-flex items-center gap-2 rounded-md px-3 py-1.5 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,H.jsx)($c,{className:`h-3.5 w-3.5`}),`Create`]})]}),children:(0,H.jsxs)(`div`,{className:`space-y-4 text-sm`,children:[(0,H.jsxs)(`label`,{className:`space-y-1`,children:[(0,H.jsx)(`div`,{className:`text-xs font-medium`,children:`Schema name`}),(0,H.jsx)(`input`,{value:I,disabled:!ke||tt.isPending,onChange:e=>{ne(e.target.value),c(null)},placeholder:`schema-name`,className:`border-border bg-card w-full rounded-md border px-3 py-2 text-sm`})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`div`,{className:`text-xs font-medium`,children:`Create mode`}),(0,H.jsx)(IL,{value:L,onChange:re,options:[{value:`init`,label:`Init`,disabled:!ke},{value:`fork`,label:`Fork`,disabled:!ke}]})]}),L===`fork`&&(0,H.jsxs)(`label`,{className:`space-y-1`,children:[(0,H.jsx)(`div`,{className:`text-xs font-medium`,children:`Fork from`}),(0,H.jsx)(e8,{value:ie,options:ze,onValueChange:ae,ariaLabel:`Fork from`,disabled:!ke,className:`w-full`})]}),s&&(0,H.jsx)(`div`,{className:`text-destructive text-xs`,children:s})]})}),(0,H.jsx)(El,{open:p,onClose:()=>m(!1),borderVariant:`error`,title:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(_l,{className:`text-destructive h-4 w-4`}),(0,H.jsx)(`span`,{className:`text-sm font-semibold`,children:`Delete schema`})]}),footer:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>m(!1),className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium`,children:`Cancel`}),(0,H.jsxs)(`button`,{type:`button`,onClick:yt,disabled:!ke||nt.isPending,"aria-busy":nt.isPending||void 0,className:`bg-destructive text-destructive-foreground inline-flex items-center gap-2 rounded-md px-3 py-1.5 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,H.jsx)(_l,{className:`h-3.5 w-3.5`}),`Delete`]})]}),children:(0,H.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[(0,H.jsxs)(`p`,{children:[`This will permanently delete`,` `,(0,H.jsx)(`code`,{className:`bg-muted rounded px-1`,children:he}),` and all of its template files.`]}),(0,H.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`This action cannot be undone.`}),s&&(0,H.jsx)(`div`,{className:`text-destructive text-xs`,children:s})]})}),(0,H.jsx)(El,{open:h,onClose:()=>{g(!1),u(null)},title:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[x===`file`?(0,H.jsx)(gc,{className:`h-4 w-4`}):(0,H.jsx)(wc,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{className:`text-sm font-semibold`,children:x===`file`?`New file`:`New folder`})]}),footer:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>g(!1),className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium`,children:`Cancel`}),(0,H.jsxs)(`button`,{type:`button`,onClick:lt,disabled:!Ae||!T.trim()||Qe.isPending||$e.isPending,"aria-busy":Qe.isPending||$e.isPending||void 0,className:`bg-primary text-primary-foreground inline-flex items-center gap-2 rounded-md px-3 py-1.5 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50`,children:[x===`file`?(0,H.jsx)(gc,{className:`h-3.5 w-3.5`}):(0,H.jsx)(wc,{className:`h-3.5 w-3.5`}),`Create`]})]}),children:(0,H.jsxs)(`div`,{className:`space-y-3 text-sm`,children:[(0,H.jsxs)(`div`,{className:`text-muted-foreground text-xs`,children:[`Parent: `,(0,H.jsx)(`code`,{className:`bg-muted rounded px-1`,children:C??`/`})]}),(0,H.jsxs)(`label`,{className:`space-y-1`,children:[(0,H.jsx)(`div`,{className:`text-xs font-medium`,children:x===`file`?`File name`:`Folder name`}),(0,H.jsx)(`input`,{value:T,disabled:!Ae||Qe.isPending||$e.isPending,onChange:e=>{E(e.target.value),u(null)},placeholder:x===`file`?`new-file.md`:`new-folder`,className:`border-border bg-card w-full rounded-md border px-3 py-2 text-sm`})]}),l&&(0,H.jsx)(`div`,{className:`text-destructive text-xs`,children:l})]})}),(0,H.jsx)(El,{open:_,onClose:()=>{v(!1),O(null)},borderVariant:`error`,title:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(_l,{className:`text-destructive h-4 w-4`}),(0,H.jsx)(`span`,{className:`text-sm font-semibold`,children:`Delete entry`})]}),footer:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`button`,{type:`button`,onClick:()=>v(!1),className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium`,children:`Cancel`}),(0,H.jsxs)(`button`,{type:`button`,onClick:dt,disabled:!Ae||!D||et.isPending,"aria-busy":et.isPending||void 0,className:`bg-destructive text-destructive-foreground inline-flex items-center gap-2 rounded-md px-3 py-1.5 text-xs font-medium disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,H.jsx)(_l,{className:`h-3.5 w-3.5`}),`Delete`]})]}),children:(0,H.jsxs)(`div`,{className:`space-y-2 text-sm`,children:[(0,H.jsxs)(`p`,{children:[`This will permanently delete`,` `,(0,H.jsx)(`code`,{className:`bg-muted rounded px-1`,children:D?.path??`selected entry`}),`.`]}),(0,H.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`This action cannot be undone.`}),l&&(0,H.jsx)(`div`,{className:`text-destructive text-xs`,children:l})]})}),(0,H.jsx)(El,{open:y,onClose:()=>{b(!1),O(null)},title:(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Mc,{className:`h-4 w-4`}),(0,H.jsx)(`span`,{className:`text-sm font-semibold`,children:`Entry properties`})]}),footer:(0,H.jsx)(`button`,{type:`button`,onClick:()=>b(!1),className:`border-border hover:bg-muted inline-flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs font-medium`,children:`Close`}),children:(0,H.jsx)(`div`,{className:`space-y-2 text-sm`,children:Je?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`Path`}),(0,H.jsx)(`code`,{className:`bg-muted rounded px-1`,children:Je.path})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`Type`}),(0,H.jsx)(`span`,{children:Je.type})]}),(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`Source`}),(0,H.jsx)(`span`,{children:Je.source})]}),Je.sizeBytes!==void 0&&(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`Size`}),(0,H.jsxs)(`span`,{children:[Je.sizeBytes,` bytes`]})]}),Je.childCount!==void 0&&(0,H.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,H.jsx)(`span`,{className:`text-muted-foreground`,children:`Items`}),(0,H.jsx)(`span`,{children:Je.childCount})]})]}):(0,H.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:`No entry selected.`})})}),(0,H.jsxs)(`div`,{"data-schema-workspace-status":`true`,className:`space-y-4`,children:[ue?(0,H.jsxs)(`div`,{role:`alert`,className:`text-destructive border-destructive/40 bg-destructive/10 flex items-start gap-2 rounded-lg border p-4 text-sm`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`font-medium`,children:`Schema catalog refresh failed.`}),(0,H.jsx)(`p`,{children:ue.message})]})]}):null,pe?(0,H.jsx)(`section`,{"aria-label":`Loading Schema detail`,className:`border-border bg-card rounded-lg border p-4`,children:(0,H.jsx)(dL,{count:6})}):null,me?(0,H.jsx)(`div`,{className:`text-muted-foreground rounded-lg border border-dashed p-4 text-sm`,children:`No schemas available.`}):null,fe!==void 0&&fe.length>0&&!Re?(0,H.jsxs)(`div`,{role:`alert`,className:`text-destructive rounded-lg border p-4 text-sm`,children:[`Schema `,he||`(missing id)`,` was not found.`]}):null,Re?xt:null]})]})})}function j3e(e){let t=e.replace(/\\/g,`/`).replace(/\/{2,}/g,`/`);return t===`/`?t:t.replace(/\/$/,``)}function M3e(e){let t=e?.planningRoot?.path;if(!e||!t)return`unresolved`;let n=e.launchProject.physicalPath;return n?j3e(n)===j3e(t)?`collapsed`:`distinct`:`unresolved`}function N3e(e){if(Number.isFinite(e.observedAt)&&e.observedAt>0)return e.observedAt;let t=Date.parse(e.timestamp);return Number.isFinite(t)?t:null}function P3e(e){if(!e)return null;let t=e.meta.referencePolicy,n=t?t.kind===`include`?{kind:`include`,sources:t.referenceSources}:t.kind===`omit`?{kind:`omit`,sourceCount:t.referenceSourceCount}:{kind:`none`}:{kind:`unrecorded`};return{observedAt:N3e(e.meta),projectName:e.meta.projectName,referencePolicy:n,root:e.meta.root??null,version:e.meta.version}}var F3e=(0,V.createContext)({snapshot:null,basePath:`/`,isStatic:!1});function I3e(){return(0,V.useContext)(F3e).snapshot}function L3e(){let e=P3e(I3e()??Vf());return(0,H.jsx)(S9,{current:`context`,header:(0,H.jsx)(F4e,{status:`static`}),children:e?(0,H.jsxs)(`div`,{className:`space-y-4`,children:[(0,H.jsx)(`section`,{className:`border-border min-w-0 border-y py-3`,children:(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`Published effective root`}),(0,H.jsx)(`div`,{className:`mt-1 min-w-0 break-all font-mono text-sm font-medium`,children:e.root?.planningRootPath??`No planning root path was published.`})]}),e.root?(0,H.jsx)(g9,{ariaLabel:`Published root source ${e.root.rootSource}`,tooltip:`OpenSpec reported root source ${e.root.rootSource} at export time.`,children:e.root.rootSource}):null,e.root?.storeId?(0,H.jsxs)(g9,{ariaLabel:`Published Store ${e.root.storeId}`,tooltip:`The exported Planning root used Store ${e.root.storeId}.`,children:[`Store `,e.root.storeId]}):null,(0,H.jsx)(g9,{ariaLabel:`Static Context evidence boundary`,tooltip:`Only publication-safe facts are available; this snapshot has no live authority.`,children:`Published facts`})]})}),(0,H.jsx)(R3e,{policy:e.referencePolicy}),(0,H.jsxs)(_9,{title:`Publication details`,summary:`${e.projectName} · OpenSpecUI ${e.version}`,children:[(0,H.jsxs)(`dl`,{className:`text-muted-foreground grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs`,children:[(0,H.jsx)(`dt`,{children:`project`}),(0,H.jsx)(`dd`,{className:`break-words`,children:e.projectName}),(0,H.jsx)(`dt`,{children:`OpenSpecUI version`}),(0,H.jsx)(`dd`,{children:e.version}),(0,H.jsx)(`dt`,{children:`observed at`}),(0,H.jsx)(`dd`,{children:e.observedAt===null?`unavailable`:new Date(e.observedAt).toISOString()})]}),(0,H.jsx)(`p`,{className:`text-muted-foreground mt-3 break-words`,children:`Runtime CLI evidence, registry, and data scope are not published. This snapshot claims no live connection, mutation authority, or current Reference health.`})]})]}):(0,H.jsxs)(`section`,{className:`border-border rounded-lg border p-4`,role:`status`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Static Context unavailable`}),(0,H.jsx)(`p`,{className:`text-muted-foreground mt-1 text-sm`,children:`This export does not contain a readable snapshot.`})]})})}function R3e({policy:e}){return(0,H.jsx)(_9,{title:`Published Reference policy`,summary:e.kind===`none`?`None recorded`:e.kind===`omit`?`${e.sourceCount} omitted`:e.kind===`unrecorded`?`Legacy unrecorded`:`${e.sources.length} included`,children:e.kind===`none`?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No effective References were recorded when this snapshot was exported.`}):e.kind===`omit`?(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[e.sourceCount,` Reference sources were observed and omitted from this export. Their identities and content were not published.`]}):e.kind===`unrecorded`?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`This snapshot predates the explicit Reference export policy.`}):(0,H.jsx)(`ul`,{className:`divide-border divide-y`,children:e.sources.map(e=>(0,H.jsxs)(`li`,{className:`flex min-w-0 items-center justify-between gap-3 py-2 first:pt-0 last:pb-0`,children:[(0,H.jsx)(`span`,{className:`min-w-0 break-all font-mono text-sm`,children:e.storeId}),(0,H.jsxs)(`span`,{className:`text-muted-foreground shrink-0 text-xs`,children:[e.specCount,` published Specs · export state `,e.state]})]},e.storeId))})})}function z3e(){return Lf()?(0,H.jsx)(L3e,{}):(0,H.jsx)(B3e,{})}function B3e(){let{data:e,isLoading:t,error:n,authority:r}=l9(),i=c2e(e),a=e?.state===`error`?e.error:null,o=!n&&!a&&(t||e?.state===`loading`)&&i===null,s=e?.state===`error`?e.data:null,c=e?.state===`error`?e.attempt:null,l=n||a||r.state===`failed`?`blocked`:o?`resolving`:e?.state===`refreshing`||r.state!==`current`?`refreshing`:`ready`,u=i?[...i.diagnostics.root,...i.diagnostics.doctor,...i.diagnostics.context,...i.references.flatMap(e=>e.status)]:[],d=j4e(`resolved-context`,o3e({available:i!==null,loading:o,transportError:n?.message??a?.message??null,authorityFailed:r.state===`failed`,refreshing:e?.state===`refreshing`,authorityCurrent:r.state===`current`,hasPlanningRoot:i?.planningRoot!==null&&i?.planningRoot!==void 0,cliAvailable:i?.cli.available??!1,cliError:i?.cli.error??null,errorDiagnostic:u.find(e=>e.severity===`error`)?.message??null,warningDiagnostic:u.find(e=>e.severity===`warning`)?.message??null}));return(0,H.jsx)(S9,{current:`context`,header:(0,H.jsx)(F4e,{status:l}),children:(0,H.jsxs)(`div`,{...d,className:`space-y-6`,children:[o?(0,H.jsx)(dL,{count:4}):null,n||a?(0,H.jsxs)(`div`,{role:`alert`,className:`text-destructive border-destructive/40 bg-destructive/10 flex items-start gap-2 rounded-lg border p-4 text-sm`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`font-medium`,children:`Root Context is not ready.`}),(0,H.jsx)(`p`,{children:n?.message??a?.message}),e?.state===`error`&&e.data?(0,H.jsx)(`p`,{className:`text-muted-foreground mt-1 text-xs`,children:`Showing the last successful observation while retaining the failed CLI attempt.`}):null]})]}):null,!o&&s&&c?(0,H.jsxs)(`div`,{className:`space-y-6`,children:[(0,H.jsx)(R9,{label:`Last successful Context (stale)`,context:s}),(0,H.jsx)(R9,{label:`Current failed attempt`,context:c,rootHeading:`Attempted planning root`})]}):!o&&c?(0,H.jsx)(R9,{label:`Current failed attempt`,context:c,rootHeading:`Attempted planning root`}):!o&&i?(0,H.jsx)(iL,{active:e?.state===`refreshing`,children:(0,H.jsx)(V3e,{context:i,actionStatus:e?.state===`ready`&&r.state===`current`?`ready`:r.state===`failed`?`blocked`:`checking`})}):null]})})}function R9({context:e,label:t,rootHeading:n}){return(0,H.jsxs)(`section`,{"aria-label":t,className:`space-y-3`,children:[(0,H.jsx)(`h2`,{className:`text-muted-foreground text-xs font-semibold uppercase`,children:t}),(0,H.jsx)(V3e,{context:e,rootHeading:n})]})}function V3e({actionStatus:e=`blocked`,context:t,rootHeading:n=`Active planning root`}){let r=t.planningRoot,i=[...t.diagnostics.root,...t.diagnostics.doctor,...t.diagnostics.context],a=t.references.flatMap(e=>e.status.filter(e=>e.severity===`error`).map(t=>`${e.store_id}: ${t.message}`)),o=[t.evidence.doctor?.contractError?`Doctor contract drift: ${t.evidence.doctor.contractError}`:null,t.evidence.context?.contractError?`Context contract drift: ${t.evidence.context.contractError}`:null].filter(e=>e!==null),s=t.references.reduce((e,t)=>e+t.status.length,0),c=M3e(t),l=i.filter(e=>e.severity===`warning`&&e.code===`root_pointer_ignored`),u=i.filter(e=>e.severity===`error`),d=i.filter(e=>e.severity!==`error`),f=c===`collapsed`?{label:`Single project root`,tooltip:`Launch and Planning resolve to the same physical project root.`}:c===`distinct`?{label:`Separate roots`,tooltip:`Launch and Planning resolve to different physical roots.`}:{label:`Relationship unresolved`,tooltip:`The server has not observed enough physical identity evidence to compare the roots.`};return(0,H.jsxs)(`div`,{className:`@container min-w-0 space-y-4`,children:[(0,H.jsxs)(`section`,{"aria-label":`Operational Context`,className:`border-border min-w-0 divide-y border-y`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-2 py-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:c===`collapsed`?`Project root`:n}),(0,H.jsx)(`div`,{className:`mt-1 min-w-0 break-all font-mono text-sm font-medium`,children:r?.path??`No planning root resolved.`})]}),r?(0,H.jsx)(g9,{ariaLabel:`Planning root source ${r.source}`,tooltip:`OpenSpec selected this root from source: ${r.source}.`,children:r.source}):null,t.storeId?(0,H.jsxs)(g9,{ariaLabel:`Planning Store ${t.storeId}`,tooltip:`The CLI-selected Planning root uses Store ${t.storeId}.`,children:[`Store `,t.storeId]}):null,(0,H.jsx)(g9,{ariaLabel:`Root relationship ${f.label.toLowerCase()}`,tooltip:f.tooltip,children:f.label}),l.length>0?(0,H.jsx)(g9,{ariaLabel:`Ignored Store declaration warning`,tooltip:`OpenSpec ignored the Store declaration because a real project root takes precedence. See CLI diagnostics for the reported fix.`,tone:`custom`,className:`border-amber-500/40 bg-amber-500/10 text-amber-800 dark:text-amber-200`,children:`Store declaration ignored`}):null]}),(0,H.jsxs)(`div`,{className:`grid min-w-0 gap-4 py-3 ${c===`collapsed`?``:`@[36rem]:grid-cols-2`}`,children:[c===`collapsed`?null:(0,H.jsx)(H3e,{label:`Launch project`,value:t.launchProject.path,mono:!0}),(0,H.jsx)(H3e,{label:`References`,value:`${t.references.length} observed`,detail:`${s} CLI diagnostics`})]})]}),t.cli.error?(0,H.jsxs)(`div`,{className:`text-destructive flex items-start gap-2 text-sm`,role:`alert`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),t.cli.error]}):null,a.length>0?(0,H.jsxs)(`div`,{className:`text-destructive flex items-start gap-2 text-sm`,role:`alert`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),a.join(` `)]}):null,o.length>0?(0,H.jsxs)(`div`,{className:`text-destructive flex items-start gap-2 text-sm`,role:`alert`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),o.join(` `)]}):null,u.length>0?(0,H.jsxs)(`div`,{className:`text-destructive flex items-start gap-2 text-sm`,role:`alert`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{children:u.map(e=>`${e.code}: ${e.message}`).join(` `)})]}):null,(0,H.jsx)(_9,{title:`Referenced context`,summary:`${t.references.length} References · ${t.contextMembers.length} members`,children:(0,H.jsxs)(`div`,{className:`space-y-4`,children:[t.references.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No reference currently observed.`}):(0,H.jsx)(`ul`,{className:`divide-border divide-y`,children:t.references.map(e=>(0,H.jsxs)(`li`,{className:`space-y-1 py-2 first:pt-0 last:pb-0`,children:[(0,H.jsx)(`p`,{className:`break-all font-mono`,children:e.store_id}),e.status.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No CLI diagnostic reported.`}):e.status.map(e=>(0,H.jsxs)(`p`,{className:`break-words`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e.code}),`: `,e.message]},`${e.code}:${e.message}`))]},e.store_id))}),(0,H.jsx)(z9,{label:`Context members`,value:t.contextMembers})]})}),(0,H.jsx)(U3e,{context:t,actionStatus:e}),(0,H.jsx)(_9,{title:`CLI diagnostics`,summary:d.length===0?`No supporting diagnostics`:`${d.length} supporting`,children:d.length===0?(0,H.jsx)(`p`,{className:`text-muted-foreground`,children:`No supporting CLI diagnostics were reported.`}):(0,H.jsx)(`ul`,{className:`space-y-3`,children:d.map(e=>(0,H.jsxs)(`li`,{className:`space-y-1 break-words`,children:[(0,H.jsxs)(`p`,{className:`font-medium`,children:[e.severity,` · `,e.code,e.target?` · ${e.target}`:``]}),(0,H.jsx)(`p`,{children:e.message}),e.fix?(0,H.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Fix: `,e.fix]}):null]},`${e.code}:${e.message}`))})}),(0,H.jsx)(_9,{title:`CLI evidence`,summary:`doctor + context · CLI ${t.cli.version??`unavailable`}`,children:(0,H.jsxs)(`div`,{className:`space-y-5`,children:[(0,H.jsx)(W3e,{label:`Doctor command`,evidence:t.evidence.doctor}),(0,H.jsx)(W3e,{label:`Context command`,evidence:t.evidence.context})]})})]})}function H3e({label:e,value:t,detail:n,mono:r=!1}){return(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:e}),(0,H.jsx)(`div`,{className:`mt-1 min-w-0 break-all text-sm ${r?`font-mono`:`font-medium`}`,children:t}),n?(0,H.jsx)(`div`,{className:`text-muted-foreground mt-0.5 text-[11px]`,children:n}):null]})}function U3e({actionStatus:e,context:t}){return(0,H.jsx)(_9,{title:`Resolution details`,summary:`Authority ${e}`,children:(0,H.jsxs)(`dl`,{className:`text-muted-foreground grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs`,children:[(0,H.jsx)(`dt`,{children:`root authority`}),(0,H.jsx)(`dd`,{children:e}),(0,H.jsx)(`dt`,{children:`observed at`}),(0,H.jsx)(`dd`,{children:new Date(t.observedAt).toISOString()}),(0,H.jsx)(`dt`,{children:`CLI available`}),(0,H.jsx)(`dd`,{children:String(t.cli.available)}),(0,H.jsx)(`dt`,{children:`CLI version`}),(0,H.jsx)(`dd`,{children:t.cli.version??`unavailable`}),(0,H.jsx)(`dt`,{children:`effective command`}),(0,H.jsx)(`dd`,{className:`break-all`,children:t.cli.effectiveCommand??`unavailable`}),(0,H.jsx)(`dt`,{children:`data scope`}),(0,H.jsx)(`dd`,{className:`break-all`,children:t.dataScope.path}),(0,H.jsx)(`dt`,{children:`data source`}),(0,H.jsxs)(`dd`,{children:[t.dataScope.source,t.dataScope.environmentVariable?` · ${t.dataScope.environmentVariable}`:``]}),(0,H.jsx)(`dt`,{children:`Store registry`}),(0,H.jsx)(`dd`,{children:`Read-only from this project workspace`})]})})}function z9({label:e,value:t}){let n=typeof t==`string`?t:JSON.stringify(t,null,2);return(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(`h3`,{className:`text-xs font-semibold`,children:e}),(0,H.jsx)(`pre`,{className:`bg-muted scrollbar-thin scrollbar-track-transparent max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md p-3 text-xs`,children:n})]})}function W3e({label:e,evidence:t}){return t?(0,H.jsxs)(`section`,{className:`border-border border-t pt-3`,children:[(0,H.jsx)(`h3`,{className:`text-xs font-semibold`,children:e}),(0,H.jsxs)(`dl`,{className:`text-muted-foreground mt-3 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:[(0,H.jsx)(`dt`,{children:`process success`}),(0,H.jsx)(`dd`,{children:String(t.success)}),(0,H.jsx)(`dt`,{children:`exit status`}),(0,H.jsx)(`dd`,{children:t.exitCode??`unknown`}),t.contractError?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`dt`,{children:`contract drift`}),(0,H.jsx)(`dd`,{className:`text-destructive break-words`,children:t.contractError})]}):null]}),t.stderr?(0,H.jsx)(z9,{label:`stderr`,value:t.stderr}):null,(0,H.jsx)(z9,{label:`diagnostics`,value:t.diagnostics}),(0,H.jsx)(z9,{label:`stdout`,value:t.stdout})]}):(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h3`,{className:`text-xs font-semibold`,children:e}),(0,H.jsx)(`p`,{className:`text-muted-foreground text-xs`,children:`No command evidence observed.`})]})}var G3e={defaultScope:`code`,code:{scope:`code`,bindingToken:null,rootPath:``,repository:null},planningState:`settled`,planning:null};function K3e(e=!0){return Ly(t=>e?Cy.git.subscribeScopes.subscribe(void 0,{onData:t.onData,onError:t.onError,onConnectionStateChange:e=>t.onConnectionStateChange({state:e.state,error:e.error}),onStopped:t.onStopped,onComplete:t.onComplete}):{unsubscribe(){}},async()=>G3e,[e],`git.subscribeScopes`)}function q3e({staticMode:e}){return e?null:(0,H.jsx)(J3e,{})}function J3e(){let{data:e,isLoading:t,error:n}=l9(),r=c2e(e),i=K3e(),a=e?.state===`error`?e.error:null,o=r?Y3e(r.references):null,s=r?.references.map(e=>({storeId:e.store_id,errors:e.status.filter(e=>e.severity===`error`).length})).filter(e=>e.errors>0)??[],c=i.authority.state===`failed`?i.authority.error.message:i.authority.state===`current`&&i.data?.planningState===`failed`?i.data.planningError.message:null;return e?.state===`ready`&&M3e(r)===`collapsed`&&r?.references.length===0&&!n&&!a&&i.authority.state===`current`&&i.data?.planningState===`settled`&&i.data.planning===null&&!c?null:(0,H.jsxs)(`section`,{"aria-label":`Dashboard data scopes`,className:`border-border border-y py-2`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-2`,children:[(0,H.jsx)(`h2`,{className:`sr-only`,children:`Data scopes`}),t&&!r?(0,H.jsx)(`div`,{className:`min-w-0 flex-1`,"aria-busy":`true`,children:(0,H.jsx)(oL,{className:`w-52`})}):r?(0,H.jsx)(iL,{active:e?.state===`refreshing`,children:(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-2`,children:[(0,H.jsx)(yc,{className:`text-muted-foreground h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{className:`min-w-0 truncate text-sm`,title:r.planningRoot?.path,children:r.planningRoot?.path??`No planning root resolved.`}),(0,H.jsx)(g9,{ariaLabel:`Planning root source ${r.planningRoot?.source??`unresolved`}${r.storeId?`, Store ${r.storeId}`:``}`,tooltip:(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`div`,{children:[`Planning root: `,r.planningRoot?.path??`Not resolved`]}),(0,H.jsxs)(`div`,{children:[`Source: `,r.planningRoot?.source??`unresolved`]}),(0,H.jsxs)(`div`,{children:[`Store: `,r.storeId??`none`]})]}),children:r.storeId?`Store ${r.storeId}`:r.planningRoot?.source??`unresolved`}),(0,H.jsxs)(g9,{ariaLabel:`${r.references.length} direct References, ${o?.errors??0} errors, ${o?.warnings??0} warnings`,tooltip:(0,H.jsx)(X3e,{references:r.references}),tone:o?.errors?`custom`:`muted`,className:o?.errors?`border-destructive/40 bg-destructive/10 text-destructive`:void 0,children:[`References `,r.references.length]}),i.authority.state===`current`&&i.data?(0,H.jsx)(g9,{ariaLabel:Z3e(i.data),tooltip:(0,H.jsx)(Q3e,{scopes:i.data}),children:i.data.planningState===`resolving`?`Git resolving`:`Git ${i.data.planning?`2 repos`:`1 repo`}`}):i.authority.state===`waiting`?(0,H.jsx)(oL,{className:`w-16`}):null]})}):null,(0,H.jsx)(Nb,{to:`/config/context`,className:`text-primary text-xs hover:underline`,children:`Resolved Context`})]}),n||a?(0,H.jsxs)(`div`,{className:`text-destructive mt-2 flex items-start gap-2 text-xs`,role:`alert`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{children:n?.message??a?.message})]}):null,s.length>0?(0,H.jsxs)(`div`,{className:`text-destructive mt-2 flex items-start gap-2 text-xs`,role:`alert`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),(0,H.jsxs)(`span`,{children:[`Reference errors:`,` `,s.map(({storeId:e,errors:t})=>`${e} (${t})`).join(`, `)]})]}):null,c?(0,H.jsxs)(`div`,{className:`text-destructive mt-2 flex items-start gap-2 text-xs`,role:`alert`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`,"aria-hidden":!0}),(0,H.jsxs)(`span`,{children:[`Git scope binding failed: `,c]})]}):null]})}function Y3e(e){return e.reduce((e,t)=>(e.total+=t.status.length,e.errors+=t.status.filter(e=>e.severity===`error`).length,e.warnings+=t.status.filter(e=>e.severity===`warning`).length,e),{errors:0,warnings:0,total:0})}function X3e({references:e}){return e.length===0?(0,H.jsx)(`span`,{children:`No direct References observed.`}):(0,H.jsx)(`ul`,{className:`space-y-1`,children:e.map(e=>{let t=Y3e([e]);return(0,H.jsxs)(`li`,{children:[e.store_id,`: `,t.errors,` error · `,t.warnings,` warning · `,t.total,` `,`total`]},e.store_id)})})}function Z3e(e){return e.planningState===`resolving`?`Code Git current, Planning Git resolving`:e.planning?`Code and distinct Planning Git repositories`:`Code Git repository`}function Q3e({scopes:e}){return(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsxs)(`div`,{children:[`Code repository: `,e.code.repository?.topLevel??e.code.rootPath]}),e.planningState===`resolving`?(0,H.jsx)(`div`,{children:`Resolving Planning Git repository.`}):e.planningState===`failed`?(0,H.jsxs)(`div`,{children:[`Planning Git repository binding failed: `,e.planningError.message]}):e.planning?(0,H.jsxs)(`div`,{children:[`Distinct Planning repository:`,` `,e.planning.repository?.topLevel??e.planning.rootPath]}):(0,H.jsx)(`div`,{children:`No distinct Planning Git repository.`})]})}var $3e=`openspecui:dashboard:git-auto-refresh`,e6e={"30s":3e4,"5min":5*6e4,"30min":30*6e4,none:null};function t6e(e){return e===`30s`||e===`5min`||e===`30min`||e===`none`}function n6e(){if(typeof window>`u`)return`none`;try{let e=window.localStorage.getItem($3e);return t6e(e)?e:`none`}catch{return`none`}}function r6e(e){if(!(typeof window>`u`))try{window.localStorage.setItem($3e,e)}catch{}}function B9(e){return e6e[e]}function i6e(e){return`auto-refresh:${e}`}function V9(e){return e.type===`commit`?Number.isFinite(e.committedAt)&&e.committedAt>0?e.committedAt:null:Number.isFinite(e.updatedAt)&&(e.updatedAt??0)>0?e.updatedAt:null}function a6e(e){return[...e].sort((e,t)=>e.type===t.type?(V9(t)??0)-(V9(e)??0):e.type===`uncommitted`?-1:1)}function o6e(e,t,n=Date.now()){if(!e||!t||t<=0)return 0;let r=Math.max(0,n-e);return Math.min(1,r/t)}var s6e=`border-zinc-400/50`,c6e=`bg-zinc-500/8`,l6e=`border-zinc-400/50`;function H9(e){return!(`state`in e)||e.state===`ready`}function u6e(e){return H9(e)&&(e.insertions>0||e.deletions>0)}function U9(e){return e.length===0?`linked openspec changes: none`:e.length===1?`linked openspec changes: ${e[0]}`:`linked openspec changes: ${e.join(`, `)}`}function d6e(e){return/^https?:\/\//.test(e)}async function f6e(e){if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`absolute`,t.style.left=`-9999px`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),document.body.removeChild(t)}function p6e({preset:e}){return e===`30s`?(0,H.jsx)(ac,{className:`h-3.5 w-3.5`}):e===`5min`?(0,H.jsx)(oc,{className:`h-3.5 w-3.5`}):e===`30min`?(0,H.jsx)(sc,{className:`h-3.5 w-3.5`}):(0,H.jsx)($s,{className:`h-3.5 w-3.5`})}function m6e(e){return{family:`git`,entityId:Mp(e)}}function h6e(e,t){if(t.trim().length===0)throw Error(`Git handoff requires a non-empty binding token.`);let n=Mp(e);if(n.trim().length===0)throw Error(`Git entity id must be non-empty.`);return{family:`git`,entityId:n,bindingToken:t,title:e.title,subtitle:e.type===`commit`?`${e.hash.slice(0,8)} · ${U9(e.relatedChanges)}`:`working tree · ${U9(e.relatedChanges)}`}}function g6e({entry:e,selected:t=!1,onSelect:n}){let r=e.type===`commit`,i=V9(e),a=i?mL(i):r?`unknown time`:`working tree`,o=i?eCe(i):void 0,s=m6e(e);return(0,H.jsx)(`button`,{type:`button`,onClick:t=>n?.(e,t.currentTarget),...rb(s,`container`),className:`block w-full min-w-0 rounded-md border px-2 py-1.5 text-left ${r?`bg-sky-500/7 border-sky-500/30`:`bg-amber-500/7 border-amber-500/30`} ${t?`ring-primary ring-1`:``}`,children:(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs font-medium`,children:[r?(0,H.jsx)(Oc,{...rb(s,`icon`),className:`h-3.5 w-3.5 text-sky-600 dark:text-sky-300`}):(0,H.jsx)(Vc,{...rb(s,`icon`),className:`h-3.5 w-3.5 text-amber-600 dark:text-amber-300`}),(0,H.jsx)(`span`,{...rb(s,`title`),className:`truncate`,children:e.title})]}),(0,H.jsxs)(`div`,{className:`text-muted-foreground truncate text-[11px]`,children:[r?e.hash.slice(0,8):`working tree`,` ·`,` `,U9(e.relatedChanges)]})]}),(0,H.jsxs)(`div`,{className:`shrink-0 text-right`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,H.jsx)(y6e,{files:e.diff.files}),(0,H.jsx)(v6e,{diff:e.diff,className:`justify-end`})]}),(0,H.jsx)(nE,{content:o,delay:0,children:(0,H.jsx)(`span`,{className:`text-muted-foreground hover:text-foreground mt-0.5 inline-flex min-h-5 items-center rounded-sm bg-transparent px-1 py-0 text-[10px]`,title:o,children:a})})]})]})})}function _6e({worktree:e,emphasize:t,removing:n=!1,onRemoveDetachedWorktree:r}){let i=d6e(e.path),a=!i,o=!i&&e.detached&&!e.isCurrent,[s,c]=(0,V.useState)(!1),[l,u]=(0,V.useState)(!1),d=i?e.path:s?e.relativePath:e.path,f=(0,V.useCallback)(async()=>{try{await f6e(d),u(!0),window.setTimeout(()=>u(!1),1200)}catch(e){console.error(`[Git] Failed to copy worktree path:`,e)}},[d]);return(0,H.jsx)(`div`,{className:`min-w-0 rounded-e-md rounded-t-md border px-2.5 py-2 ${t?`${s6e} ${c6e}`:`border-border/70 bg-muted/15`}`,children:(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm font-medium`,children:[(0,H.jsx)(Dc,{className:`h-3.5 w-3.5 shrink-0`}),(0,H.jsx)(`span`,{className:`truncate`,children:e.branchName})]}),(0,H.jsxs)(`div`,{className:`mt-0.5 flex min-w-0 items-center gap-1`,children:[a?(0,H.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`text-muted-foreground hover:text-foreground inline-flex h-5 w-5 shrink-0 items-center justify-center rounded border border-transparent`,title:s?`Show absolute path`:`Show relative path`,"aria-label":s?`Show absolute path`:`Show relative path`,children:s?(0,H.jsx)(Sc,{className:`h-3.5 w-3.5`}):(0,H.jsx)(Cc,{className:`h-3.5 w-3.5`})}):null,(0,H.jsxs)(`button`,{type:`button`,onClick:()=>{f()},onDoubleClick:()=>{a&&c(e=>!e)},className:`text-muted-foreground hover:text-foreground inline-flex min-w-0 flex-1 items-center gap-1 truncate text-left text-xs`,title:d,"aria-label":`Copy ${s&&a?`relative`:`absolute`} path for ${e.branchName}`,children:[(0,H.jsx)(`span`,{className:`truncate`,children:d}),l?(0,H.jsx)(Qs,{className:`h-3 w-3 shrink-0`}):(0,H.jsx)(lc,{className:`h-3 w-3 shrink-0`})]})]})]}),(0,H.jsx)(`div`,{className:`shrink-0 text-right`,children:(0,H.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[o?(0,H.jsx)(`button`,{type:`button`,onClick:()=>{r?.(e)},disabled:n,className:`text-muted-foreground hover:text-destructive inline-flex h-5 w-5 items-center justify-center rounded border border-transparent disabled:cursor-not-allowed disabled:opacity-60`,title:`Remove detached worktree`,"aria-label":`Remove detached worktree`,children:n?(0,H.jsx)(Vc,{className:`h-3.5 w-3.5 animate-spin`}):(0,H.jsx)(_l,{className:`h-3.5 w-3.5`})}):null,(0,H.jsx)(b6e,{ahead:e.ahead,behind:e.behind}),(0,H.jsx)(y6e,{files:e.diff.files}),(0,H.jsx)(v6e,{diff:e.diff,className:`justify-end`})]})})]})})}function v6e({diff:e,className:t=``}){return H9(e)&&!u6e(e)?null:H9(e)?(0,H.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] ${t}`,children:[(0,H.jsxs)(`span`,{className:`bg-emerald-500/12 inline-flex items-center gap-0.5 rounded border border-emerald-500/40 px-[0.15rem] py-0 font-mono text-[10px] text-emerald-700 dark:border-emerald-300/45 dark:bg-emerald-400/20 dark:text-emerald-100`,children:[(0,H.jsx)($c,{className:`h-2.5 w-2.5`}),(0,H.jsx)(`span`,{children:e.insertions})]}),(0,H.jsxs)(`span`,{className:`bg-rose-500/12 inline-flex items-center gap-0.5 rounded border border-rose-500/40 px-[0.15rem] py-0 font-mono text-[10px] text-rose-700 dark:border-rose-300/45 dark:bg-rose-400/20 dark:text-rose-100`,children:[(0,H.jsx)(Gc,{className:`h-2.5 w-2.5`}),(0,H.jsx)(`span`,{children:e.deletions})]})]}):(0,H.jsx)(`span`,{className:`inline-flex items-center rounded border border-zinc-500/35 bg-zinc-500/10 px-[0.15rem] py-0 font-mono text-[10px] text-zinc-700 dark:border-zinc-300/40 dark:bg-zinc-300/15 dark:text-zinc-100 ${t}`,children:e.state===`loading`?`loading`:`n/a`})}function y6e({files:e}){return e<=0?null:(0,H.jsxs)(rE,{tone:`custom`,size:`xs`,shape:`box`,className:`h-auto min-w-0 border border-zinc-500/35 bg-zinc-500/10 px-[0.15rem] py-0 font-mono text-[10px] font-normal text-zinc-700 dark:border-zinc-300/40 dark:bg-zinc-300/15 dark:text-zinc-100`,children:[e,`f`]})}function b6e({ahead:e,behind:t}){return(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border border-zinc-500/35 bg-zinc-500/10 px-[0.15rem] py-0 font-mono text-[10px] text-zinc-700 dark:border-zinc-300/40 dark:bg-zinc-300/15 dark:text-zinc-100`,children:[(0,H.jsxs)(`span`,{children:[`↑`,e]}),(0,H.jsxs)(`span`,{children:[`↓`,t]})]})}function x6e({options:e,value:t,onValueChange:n,progress:r,showProgress:i,disabled:a,animated:o,onRefresh:s}){return(0,H.jsxs)(`div`,{className:`border-border bg-card inline-flex overflow-hidden rounded-md border`,children:[(0,H.jsx)(e8,{value:t,options:e,onValueChange:n,ariaLabel:`Git auto refresh`,className:`text-foreground/75 hover:text-foreground border-r-current/10 bg-muted/20 relative isolate h-7 w-9 shrink-0 justify-center rounded-none border-0 border-r px-0`,positionerClassName:`z-50`,popupClassName:`min-w-[7rem]`,renderTrigger:({selectedOption:e})=>(0,H.jsxs)(`span`,{className:`relative inline-flex h-full w-full items-center justify-center overflow-hidden`,children:[(0,H.jsx)(`span`,{className:`bg-muted/20 pointer-events-none absolute inset-0`}),i?(0,H.jsx)(`span`,{className:`bg-primary/30 dark:bg-primary/35 pointer-events-none absolute inset-y-0 left-0 transition-[width]`,style:{width:`${r*100}%`}}):null,(0,H.jsx)(`span`,{className:`relative z-10 inline-flex items-center justify-center`,children:(0,H.jsx)(p6e,{preset:e?.value??t})})]})}),(0,H.jsxs)(`button`,{type:`button`,onClick:s,disabled:a,className:`inline-flex h-7 items-center gap-1 px-2 py-1 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-70 ${o?`text-primary bg-primary/10`:`text-foreground/75 hover:text-foreground`}`,children:[(0,H.jsx)(el,{className:`h-3.5 w-3.5 ${o?`animate-spin`:``}`}),`Refresh`]})]})}var S6e=32,W9=.08,C6e=.95;function w6e(e,t){if(e.length<=t)return e;let n=[],r=e.length/t;for(let i=0;i<t;i+=1){let t=Math.floor(i*r),a=Math.floor((i+1)*r),o=e.slice(t,Math.max(a,t+1)),s=o.reduce((e,t)=>e+t,0)/o.length;n.push(s)}return n}function T6e(e,t){if(e.length===0)return[];if(t===`monotonic`){let t=Math.max(...e);return t<=0?e.map(()=>W9):e.map(e=>Math.max(0,e)/t*(C6e-W9)+W9)}let n=Math.min(...e),r=Math.max(...e);return n===r?e.map(()=>.55):e.map(e=>(e-n)/(r-n)*.8+.15)}function E6e(e){return e.length===0?[]:e.map((t,n)=>n===0?`flat`:t>e[n-1]?`up`:t<e[n-1]?`down`:`flat`)}function D6e({bars:e,directions:t,trendKind:n}){if(e.length===0)return null;let r=e.length===1?Array.from({length:12},()=>e[0]):e,i=t.length===1?Array.from({length:r.length},()=>t[0]??`flat`):t;return(0,H.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-end gap-px px-2 py-2 opacity-50`,"data-testid":`dashboard-mini-trend-bars`,children:r.map((e,t)=>{let r=i[t]??`flat`;return(0,H.jsx)(`span`,{className:`${n===`bidirectional`?r===`up`?`bg-emerald-500/30`:r===`down`?`bg-rose-500/30`:`bg-primary/25`:`bg-primary/25`} block flex-1 rounded-sm`,"data-testid":`dashboard-mini-trend-bar`,"data-direction":r,style:{height:`${Math.max(8,Math.round(e*100))}%`}},t)})})}function O6e(e,t){if(e.length<=t)return e;let n=[],r=e.length/t;for(let i=0;i<t;i+=1){let t=Math.floor(i*r),a=Math.floor((i+1)*r),o=e.slice(t,Math.max(a,t+1)),s=o[o.length-1]?.ts??e[e.length-1].ts;n.push({ts:s,add:o.reduce((e,t)=>e+t.add,0),modify:o.reduce((e,t)=>e+t.modify,0),delete:o.reduce((e,t)=>e+t.delete,0)})}return n}function k6e(e){if(e.length===0)return[];let t=e.map(e=>e.add+e.modify+e.delete),n=Math.max(...t);return n<=0?e.map(()=>({height:0,addRatio:0,modifyRatio:0,deleteRatio:0})):e.map(e=>{let t=e.add+e.modify+e.delete;return t<=0?{height:0,addRatio:0,modifyRatio:0,deleteRatio:0}:{height:t/n*(C6e-W9)+W9,addRatio:e.add/t,modifyRatio:e.modify/t,deleteRatio:e.delete/t}})}function A6e({bars:e}){if(e.length===0)return null;let t=e.length===1?Array.from({length:12},()=>e[0]):e;return(0,H.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-end gap-px px-2 py-2 opacity-55`,"data-testid":`dashboard-mini-tricolor-bars`,children:t.map((e,t)=>{let n=Math.max(0,Math.round(e.height*100));return n<=0?(0,H.jsx)(`span`,{className:`bg-border/45 block min-h-px flex-1 rounded-sm`,"data-testid":`dashboard-mini-tricolor-bar`},t):(0,H.jsxs)(`span`,{className:`flex flex-1 flex-col-reverse overflow-hidden rounded-sm`,"data-testid":`dashboard-mini-tricolor-bar`,style:{height:`${n}%`,minHeight:`1px`},children:[e.addRatio>0&&(0,H.jsx)(`span`,{className:`bg-primary/40 block w-full`,style:{flexGrow:e.addRatio}}),e.modifyRatio>0&&(0,H.jsx)(`span`,{className:`bg-secondary/55 block w-full`,style:{flexGrow:e.modifyRatio}}),e.deleteRatio>0&&(0,H.jsx)(`span`,{className:`bg-foreground/35 block w-full`,style:{flexGrow:e.deleteRatio}})]},t)})})}function j6e({label:e,value:t,icon:n,availability:r,trendKind:i,points:a,triColorPoints:o=[],pending:s=!1,className:c}){let l=O6e(o,S6e),u=k6e(l),d=l.some(e=>e.add+e.modify+e.delete>0),f=w6e(a.map(e=>e.value),S6e),p=T6e(f,i),m=E6e(f),h=r.state===`invalid`,g=d||f.length>=2,_=r.state===`invalid`&&r.reason===`objective-history-unavailable`?`No objective historical source`:`Insufficient computable data`;return(0,H.jsxs)(`div`,{className:`relative overflow-hidden rounded-lg border p-4 ${h?`border-border from-muted/35 to-muted/5 border-dashed bg-gradient-to-br`:`border-border bg-card`} ${c??``}`,"data-testid":`dashboard-metric-card`,"aria-busy":s,children:[!s&&!h&&(d?(0,H.jsx)(A6e,{bars:u}):(0,H.jsx)(D6e,{bars:p,directions:m,trendKind:i})),s?(0,H.jsxs)(`div`,{className:`relative z-10 flex h-full flex-col`,"aria-hidden":`true`,children:[(0,H.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,H.jsx)(aL,{className:`size-3.5 shrink-0 rounded-full`}),(0,H.jsx)(aL,{className:`h-4 w-2/3 max-w-56`})]}),(0,H.jsx)(aL,{className:`h-8 w-24`}),(0,H.jsx)(`div`,{className:`mt-auto flex h-1/2 items-end gap-1 pt-4`,children:Array.from({length:12},(e,t)=>(0,H.jsx)(aL,{className:`min-h-3 flex-1 rounded-sm`,style:{height:`${28+t*17%64}%`}},t))})]}):(0,H.jsxs)(`div`,{className:`relative z-10`,children:[(0,H.jsxs)(`div`,{className:`text-muted-foreground mb-1 flex items-center gap-2 text-sm`,children:[(0,H.jsx)(n,{className:`h-3.5 w-3.5`}),e]}),(0,H.jsx)(`div`,{className:`text-2xl font-bold`,children:t}),h&&(0,H.jsx)(`div`,{className:`text-muted-foreground mt-2 text-xs`,"data-testid":`dashboard-card-invalid-note`,children:_}),!h&&!g&&(0,H.jsx)(`div`,{className:`text-muted-foreground mt-2 text-xs`,"data-testid":`dashboard-card-trend-note`,children:`No trend yet`})]})]})}function G9(e){if(e instanceof Error)return e;if(typeof e==`object`&&e&&`message`in e){let t=e.message;if(typeof t==`string`)return Error(t)}return Error(String(e))}function M6e(e,t,n,r=!0){return Gy((0,V.useCallback)(t=>{if(!r)return{unsubscribe(){}};let n=!1;return e({onData(e){if(e.type===`snapshot`||e.type===`complete`){n=!0,e.snapshot.freshness===`current`?t.onEvent({type:`data`,data:e.snapshot.data}):t.onEvent({type:`display-stale`,data:e.snapshot.data});return}if(e.type===`stage`){e.phase===`start`&&n&&t.onEvent({type:`recompute-started`});return}e.type===`failed`&&t.onError(G9(e.error))},onError:t.onError})},[r,e]),t,[r],n)}function N6e(e,t){return t.identity===e.identity&&t.workGeneration===e.workGeneration}function P6e(e,t){return Gy((0,V.useCallback)((t,n)=>{let r=!0,i=0,a=n.hasCached,o=null,s=!1,c=e=>r&&o!==null&&o.identity===e.identity&&o.workGeneration===e.workGeneration&&o.snapshotGeneration===e.snapshotGeneration&&o.state===e.state,l=async e=>{let n=++i;try{let o=await Cy.dashboard.getSummary.query();if(!r||n!==i||e&&(!c(e)||!N6e(e,o)))return;o.data&&(a=!0,t.onEvent({type:o.freshness===`current`?`data`:`display-stale`,data:o.data})),o.error&&t.onError(G9(o.error))}catch(a){if(!r||n!==i||e&&!c(e))return;t.onError(G9(a))}},u=e({onData(e){s=!0;let n=a;o=e,n&&e.state!==`ready`&&t.onEvent({type:`recompute-started`}),l(e)},onError:t.onError});return s||l(),{unsubscribe(){r=!1,i+=1,u.unsubscribe()}}},[e]),t,[],`dashboard.subscribeSummary.v2`)}async function F6e(){let e=await nv();return{summary:e.summary,specifications:e.specifications,activeChanges:e.activeChanges,trackedTaskPhaseCounts:e.trackedTaskPhaseCounts,recentArchives:e.recentArchives}}async function I6e(){let e=await nv();return{trends:e.trends,triColorTrends:e.triColorTrends,trendKinds:e.trendKinds,cardAvailability:e.cardAvailability,trendMeta:e.trendMeta}}async function L6e(){return(await nv()).git}function R6e(){let e=(0,V.useCallback)(e=>Cy.dashboard.subscribeSummary.subscribe(void 0,{onData:e.onData,onError:e.onError}),[]),t=(0,V.useCallback)(e=>Cy.dashboard.subscribeTrends.subscribe(void 0,{onData:e.onData,onError:e.onError}),[]),n=(0,V.useCallback)(e=>Cy.dashboard.subscribeGit.subscribe(void 0,{onData:e.onData,onError:e.onError}),[]),r=P6e(e,F6e),i=r.data!==void 0,a=M6e(t,I6e,`dashboard.subscribeTrends`,i),o=M6e(n,L6e,`dashboard.subscribeGit`,i);return{data:(0,V.useMemo)(()=>{if(!(!r.data||!a.data||!o.data))return{...r.data,...a.data,git:o.data}},[o.data,r.data,a.data]),isLoading:r.isLoading,error:r.error,regions:{summary:r,trends:a,git:o}}}async function z6e(e,t){Lf()||await Cy.dashboard.refreshGitSnapshot.query({scope:`code`,expectedBindingToken:t,reason:e})}var B6e=[{value:`30s`,label:`30s`},{value:`5min`,label:`5min`},{value:`30min`,label:`30min`},{value:`none`,label:`none`}];function V6e(e){return e===`manual-button`||e?.startsWith(`auto-refresh:`)===!0}function H6e(e){let t=e instanceof Error?e.message:String(e);if(typeof e==`object`&&e&&`data`in e){let n=e.data;if(typeof n==`object`&&n&&`code`in n){let e=n.code;if(typeof e==`string`&&e.length>0)return`${e}: ${t}`}}return t}function U6e(e){return{specifications:{state:`ok`},requirements:{state:`ok`},activeChanges:{state:`invalid`,reason:`objective-history-unavailable`},inProgressChanges:{state:`invalid`,reason:`objective-history-unavailable`},completedChanges:{state:`ok`},taskCompletionPercent:{state:`invalid`,reason:e===null?`semantic-uncomputable`:`objective-history-unavailable`}}}function W6e(){return{specifications:`monotonic`,requirements:`monotonic`,activeChanges:`bidirectional`,inProgressChanges:`bidirectional`,completedChanges:`monotonic`,taskCompletionPercent:`bidirectional`}}function G6e(e){return e.type===`uncommitted`&&(e.diff.files>0||e.diff.insertions>0||e.diff.deletions>0)}function K6e(e){let t=a6e(e),n=t.find(e=>e.type===`uncommitted`),r=t.filter(e=>e.type===`commit`);return n&&G6e(n)?[n,...r.slice(0,4)]:r.slice(0,5)}function q6e(){let e=Lf(),t=R6e(),{data:n,isLoading:r,error:i}=t,a=t.regions?.summary,o=t.regions?.trends,s=t.regions?.git,c=a?.data??(n?{summary:n.summary,specifications:n.specifications,activeChanges:n.activeChanges,trackedTaskPhaseCounts:n.trackedTaskPhaseCounts,recentArchives:n.recentArchives}:void 0),l=o?.data??(n?{trends:n.trends,triColorTrends:n.triColorTrends,trendKinds:n.trendKinds,cardAvailability:n.cardAvailability,trendMeta:n.trendMeta}:void 0),u=s?.data??n?.git??null,d=a?.isLoading??r,f=a?.isUpdating??!1,p=a?.error??i,m=o?.isLoading??(r&&!n),h=o?.isUpdating??!1,g=o?.error??null,_=s?.isLoading??(r&&!n),v=s?.isUpdating??!1,y=s?.error??null,b=d&&c===void 0,x=b||m&&l===void 0,S=b||_&&u===null,C=c!==void 0,{data:w,authority:T}=K3e(!e&&C),{data:E}=Zy(C),{data:D}=Xy(C),[O,k]=(0,V.useState)(()=>n6e()),[A,j]=(0,V.useState)(null),[M,N]=(0,V.useState)(()=>Date.now()),[P,F]=(0,V.useState)(()=>typeof document>`u`?!0:document.visibilityState===`visible`),[ee,te]=(0,V.useState)(null),[I,ne]=(0,V.useState)(null),L=!e&&T.state===`current`&&u?.bindingToken!==null&&u?.bindingToken===w?.code.bindingToken?u?.bindingToken??null:null,re=(0,V.useCallback)(()=>{Ib.activatePop(`/opsx-propose`)},[]),ie=(0,V.useCallback)(()=>{Ib.activatePop(`/opsx-new`)},[]),ae=(0,V.useCallback)(async e=>{L&&(ne(null),await z6e(e,L))},[L]),oe=(0,V.useRef)(null),se=(0,V.useRef)(O),ce=ee?.reason??null,le=(0,V.useCallback)(()=>{oe.current!==null&&(window.clearTimeout(oe.current),oe.current=null)},[]),ue=(0,V.useCallback)(e=>{let t=Date.now(),n=B9(O);j(n===null?null:t+n),te({reason:e,requestedAt:t}),ae(e).then(()=>{te(n=>n?.reason===e&&n.requestedAt===t?null:n)}).catch(n=>{console.error(`[Dashboard] Failed to refresh git snapshot:`,n),ne(H6e(n)),te(n=>n?.reason===e&&n.requestedAt===t?null:n)})},[O,ae]),de=(0,V.useCallback)(()=>{le();let t=B9(O),n=O===`none`?null:i6e(O);if(e||L===null||t===null||n===null||ee!==null||v||!P)return;let r=Date.now(),i=A??r+t;if(A===null&&j(i),N(r),r>=i){ue(n);return}oe.current=window.setTimeout(()=>{oe.current=null,N(Date.now()),ue(n)},i-r)},[le,L,A,O,ee,v,P,ue,e]),R=(0,V.useCallback)(()=>{L!==null&&(le(),N(Date.now()),ue(`manual-button`))},[le,L,ue]);(0,V.useEffect)(()=>{if(e)return;let t=()=>{let e=document.visibilityState===`visible`;F(e),e||le()};return document.addEventListener(`visibilitychange`,t),()=>{document.removeEventListener(`visibilitychange`,t)}},[le,e]),(0,V.useEffect)(()=>{if(!e&&(r6e(O),se.current!==O)){se.current=O;let e=B9(O);j(e===null?null:Date.now()+e)}},[O,e]),(0,V.useEffect)(()=>{if(!e)return de(),()=>{le()}},[le,de,e]),(0,V.useEffect)(()=>{let t=B9(O);if(e||t===null||A===null)return;let n=()=>{N(Date.now())};n();let r=window.setInterval(n,250);return()=>{window.clearInterval(r)}},[A,O,e]);let fe=c?.activeChanges??[],pe=(0,V.useMemo)(()=>new Set(fe.map(e=>e.id)),[fe]),me=(0,V.useMemo)(()=>(E??[]).filter(e=>pe.has(e.changeName)),[E,pe]),he=(0,V.useMemo)(()=>{let e=D?.schemaDetails??{},t=new Map;for(let[n,r]of Object.entries(e)){if(!r?.applyTracks)continue;let e=r.artifacts.find(e=>e.outputPath===r.applyTracks);e?.id&&t.set(n,e.id)}return t},[D]),ge=c?.summary??{specifications:0,requirements:0,activeChanges:0,inProgressChanges:0,completedChanges:0,archivedTasksCompleted:0,tasksTotal:0,tasksCompleted:0,taskCompletionPercent:null},_e=l?.cardAvailability??U6e(ge.taskCompletionPercent),ve=l?.trendKinds??W6e(),ye=e||T.state===`current`&&w!==void 0&&u?.bindingToken!==null&&u?.bindingToken===w?.code.bindingToken,be=ye&&u?u:{bindingToken:null,defaultBranch:`main`,worktrees:[]},xe=e?be.worktrees.some(e=>e.entries.length>0):ye,Se=e?xe:!0,Ce=fe.length>0,we=be.worktrees.find(e=>e.isCurrent)??null,Te=be.worktrees.filter(e=>!e.isCurrent).filter(e=>!e.detached),Ee=we?K6e(we.entries):[],De=B9(O),Oe=A!==null&&De!==null?A-De:null,ke=ee===null?o6e(Oe,De,M):0,Ae=De!==null&&ee===null,je=ee!==null&&V6e(ce),Me=ee!==null||v||L===null,Ne=()=>(0,H.jsxs)(`div`,{className:`space-y-2`,children:[g?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-2 text-xs`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,H.jsxs)(`span`,{children:[`Dashboard trends failed: `,g.message]})]}):null,(0,H.jsx)(iL,{active:h&&!!l,children:(0,H.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[(0,H.jsx)(j6e,{label:`Specifications / Requirements`,value:`${ge.specifications} / ${ge.requirements}`,icon:bc,availability:_e.specifications,trendKind:ve.specifications,points:l?.trends.specifications??[],triColorPoints:[],pending:x,className:`h-44 sm:h-48 lg:h-52 xl:h-56`}),(0,H.jsx)(j6e,{label:`Archived Changes / Completed Tasks`,value:`${ge.completedChanges} / ${ge.archivedTasksCompleted}`,icon:Ws,availability:_e.completedChanges,trendKind:ve.completedChanges,points:l?.trends.completedChanges??[],triColorPoints:[],pending:x,className:`h-44 sm:h-48 lg:h-52 xl:h-56`})]})})]}),Pe=()=>(0,H.jsxs)(`section`,{"data-testid":`dashboard-kanban-row`,className:`border-border @container min-w-0 space-y-2 border-b`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsx)(`h2`,{className:`font-medium`,children:`Kanban`}),(0,H.jsx)(Nb,{to:`/board`,"aria-label":`Open Kanban`,title:`Open Kanban`,className:`text-muted-foreground hover:text-foreground inline-flex h-8 w-8 items-center justify-center rounded-md`,children:(0,H.jsx)(ml,{className:`h-4 w-4`})})]}),(0,H.jsx)(t2e,{variant:`compact`,pending:b,activeItems:fe,archivedItems:c?.recentArchives??[],activeCounts:c?.trackedTaskPhaseCounts??{"no-tasks":0,"in-progress":0,complete:0},archivedCount:ge.completedChanges})]}),Fe=()=>Se?(0,H.jsxs)(`section`,{"data-testid":`dashboard-git-snapshot`,className:`min-w-0 space-y-2`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h2`,{className:`font-medium`,children:`Code Git Snapshot`}),(0,H.jsx)(`p`,{className:`text-muted-foreground truncate text-xs`,children:xe?`Default branch: ${be.defaultBranch}`:`Waiting for the current Code Git projection.`})]}),e?null:(0,H.jsx)(x6e,{options:B6e,value:O,onValueChange:k,progress:ke,showProgress:Ae,disabled:Me,animated:je,onRefresh:R})]}),y?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-2 text-xs`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-3.5 w-3.5 shrink-0`}),(0,H.jsxs)(`span`,{children:[`Code Git snapshot failed: `,y.message]})]}):null,S?(0,H.jsxs)(`div`,{"aria-busy":`true`,className:`border-border/80 bg-card min-w-0 space-y-3 rounded-lg border p-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5`,"aria-hidden":`true`,children:[(0,H.jsx)(aL,{className:`size-4 shrink-0 rounded-full`}),(0,H.jsx)(aL,{className:`h-3 w-36`})]}),(0,H.jsx)(JSe,{count:3})]}):null,!xe&&u&&!S&&!y?(0,H.jsx)(`div`,{className:`text-muted-foreground rounded-md border border-dashed px-3 py-4 text-sm`,children:`Waiting for the current Code Git binding.`}):null,xe?(0,H.jsx)(iL,{active:v&&!!u,children:(0,H.jsxs)(`div`,{className:`border-border/80 bg-card min-w-0 rounded-lg border p-3`,children:[(0,H.jsxs)(`div`,{className:`mb-2 flex items-center gap-1.5`,children:[(0,H.jsx)(Dc,{className:`text-muted-foreground h-4 w-4 shrink-0`}),(0,H.jsxs)(`span`,{className:`text-muted-foreground truncate text-xs`,children:[`Default branch: `,be.defaultBranch]})]}),we?(0,H.jsxs)(`div`,{className:`space-y-0`,children:[(0,H.jsx)(_6e,{worktree:we,emphasize:!0}),(0,H.jsx)(`div`,{className:`-mt-px space-y-1 border-l pl-3 pt-2 ${l6e}`,children:Ee.map(t=>(0,H.jsx)(g6e,{entry:t,onSelect:e?void 0:(e,t)=>{be.bindingToken!==null&&Ib.push(`bottom`,gee(e),qoe(void 0,h6e(e,be.bindingToken)),{source:t,sharedElements:m6e(e)})}},t.type===`commit`?t.hash:`${t.type}:${t.updatedAt??`none`}`))})]}):(0,H.jsx)(`div`,{className:`text-muted-foreground rounded-md border border-dashed px-2.5 py-2 text-xs`,children:`No worktree snapshot available.`}),Te.length>0&&(0,H.jsxs)(`div`,{className:`border-border/70 mt-3 space-y-1 border-t pt-2`,children:[(0,H.jsx)(`div`,{className:`text-muted-foreground text-xs uppercase tracking-wide`,children:`Other Worktrees`}),Te.map(e=>(0,H.jsx)(_6e,{worktree:e,emphasize:!1},e.path))]})]})}):null]}):null,Ie=()=>(0,H.jsxs)(`section`,{"data-testid":`dashboard-active-changes`,className:`border-border flex min-w-0 flex-col rounded-t-lg border`,children:[(0,H.jsxs)(`div`,{className:`border-border flex min-w-0 flex-wrap items-center justify-between gap-1.5 border-b px-4 py-3`,children:[(0,H.jsx)(`h2`,{className:`font-medium`,children:`Active Changes`}),b?(0,H.jsx)(aL,{className:`h-4 w-16`}):(0,H.jsxs)(`span`,{className:`text-muted-foreground text-xs sm:text-sm`,children:[ge.activeChanges,` active`]})]}),(0,H.jsxs)(`div`,{className:`bg-card divide-border flex min-w-0 flex-1 flex-col divide-y`,children:[b?(0,H.jsx)(lL,{count:3}):null,!b&&fe.map(e=>{let t=me.find(t=>t.changeName===e.id),n=t?.artifacts.filter(e=>e.status===`done`).length??0,r=t?.artifacts.length??0,i=t?he.get(t.schemaName):void 0,a=i&&t?t.artifacts.find(e=>e.id===i)?.status??d9(t.artifacts.map(e=>e.status)):d9(t?.artifacts.map(e=>e.status)??[]),o=b2e({hasStatus:!!t,isPlanningComplete:t?.isPlanningComplete??!1,trackedArtifactStatus:a});return(0,H.jsx)(Nb,{to:`/changes/$changeId`,params:{changeId:e.id},state:t=>({...t,__vtHandoff:{family:`changes`,entityId:e.id,title:e.name,subtitle:e.id}}),vt:{sharedElements:{family:`changes`,entityId:e.id}},...rb({family:`changes`,entityId:e.id},`container`),className:`hover:bg-muted/50 block min-w-0 px-4 py-3`,children:(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,H.jsx)(v2e,{changeId:e.id,name:e.name,phase:o,updatedAt:e.updatedAt,formatTime:mL,className:`min-w-0 flex-1`,subtitle:t?(0,H.jsxs)(`span`,{children:[n,`/`,r,` artifacts · `,t.schemaName]}):`Artifacts status unavailable`}),(0,H.jsx)(y2e,{})]})},e.id)}),!b&&!Ce&&(0,H.jsxs)(`div`,{className:`text-muted-foreground px-4 py-6 text-center text-sm`,children:[(0,H.jsx)(`div`,{children:`No active changes.`}),(0,H.jsx)(`div`,{className:`mt-1 text-xs`,children:`Recommended workflow start: Quick Propose`}),(0,H.jsxs)(`button`,{type:`button`,onClick:ie,className:`text-primary mt-2 inline-flex items-center gap-1 hover:underline`,title:`Open the advanced /opsx:new form`,children:[(0,H.jsx)(pl,{className:`h-3.5 w-3.5`}),`Open /opsx:new form`]})]})]})]});return(0,H.jsxs)(`div`,{className:`@container min-w-0 space-y-6 p-4`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(Fc,{className:`h-6 w-6 shrink-0`}),`Dashboard`]}),(0,H.jsxs)(`button`,{type:`button`,onClick:re,className:`bg-primary text-primary-foreground inline-flex items-center gap-2 rounded-md px-4 py-2 text-sm hover:opacity-90`,title:`Open Quick Propose.`,children:[(0,H.jsx)(pl,{className:`h-4 w-4`}),`Start Propose`]})]}),(0,H.jsx)(iL,{active:f&&!!c,children:(0,H.jsx)(q3e,{staticMode:e})}),p?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,H.jsxs)(`span`,{children:[`Error loading dashboard: `,p.message]})]}):null,I?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,H.jsxs)(`span`,{children:[`Git action failed: `,I]})]}):null,(0,H.jsxs)(`section`,{className:`space-y-2`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-medium`,children:`Historical Trends`}),Ne()]}),Pe(),(0,H.jsxs)(`div`,{"data-testid":`dashboard-secondary-grid`,className:`@[64rem]:grid-cols-2 grid min-w-0 gap-3`,children:[Ie(),Fe()]})]})}var J6e=null,K9=null,q9=null,Y6e=`This backend does not support source-scoped Search. Upgrade the OpenSpecUI backend to search Active root and Referenced Specs safely.`;function X6e(e){return(e instanceof Error?e.message:String(e)).includes(`No "subscription"-procedure on path "search.subscribe"`)}async function Z6e(){return J6e||K9||(K9=(async()=>{let e=new gze;try{let t=await hie();return await e.init(t),J6e=e,e}catch(t){throw await e.dispose().catch(()=>{}),t}finally{K9=null}})(),K9)}function Q6e(e,t=`active-root`,n=50){let[r,i]=(0,V.useState)({scope:t,data:[],isLoading:!1,error:null}),a=(0,V.useMemo)(()=>e.trim(),[e]);return(0,V.useEffect)(()=>{let e=!0;if(a.length===0)return i({scope:t,data:[],isLoading:!1,error:null}),()=>{e=!1};if(i({scope:t,data:[],isLoading:!0,error:null}),Lf())return Z6e().then(e=>e.search({query:a,scope:t,limit:n})).then(n=>{e&&i({scope:t,data:A$(n,t),isLoading:!1,error:null})}).catch(n=>{e&&i({scope:t,data:[],isLoading:!1,error:n instanceof Error?n:Error(String(n))})}),()=>{e=!1};if(q9===!1)return i({scope:t,data:[],isLoading:!1,error:Error(Y6e)}),()=>{e=!1};let r=Cy.search.subscribe.subscribe({query:a,scope:t,limit:n},{onData:n=>{if(q9=!0,e)try{i({scope:t,data:A$(n,t),isLoading:!1,error:null})}catch(e){i({scope:t,data:[],isLoading:!1,error:e instanceof Error?e:Error(String(e))})}},onError:n=>{if(X6e(n)){if(q9=!1,!e)return;i({scope:t,data:[],isLoading:!1,error:Error(Y6e)});return}e&&i({scope:t,data:[],isLoading:!1,error:n})}});return()=>{e=!1,r.unsubscribe()}},[n,t,a]),r.scope===t?r:{scope:t,data:[],isLoading:a.length>0,error:null}}var $6e=150;function e8e(e){return e===`spec`?bc:e===`change`?Dc:Ws}function t8e(e){return new URLSearchParams(e).get(`scope`)===`referenced-specs`?`referenced-specs`:`active-root`}function J9(e,t){let n=e.trim(),r=new URLSearchParams;n.length>0&&r.set(`query`,n),t===`referenced-specs`&&r.set(`scope`,t);let i=r.toString();return i.length>0?`/search?${i}`:`/search`}function n8e(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Y9(e,t){if(!e||t.length===0)return e;let n=t.map(e=>n8e(e)).join(`|`);if(!n)return e;let r=RegExp(`(${n})`,`gi`);return e.split(r).map((e,n)=>t.some(t=>t.toLowerCase()===e.toLowerCase())?(0,H.jsx)(`mark`,{className:`text-foreground rounded bg-amber-400/35 px-[1px]`,children:e},n):(0,H.jsx)(`span`,{children:e},n))}function r8e(){let e=zs(),{setConfig:t}=Bb(),{requestClose:n}=Vb(),r=(0,V.useMemo)(()=>new URLSearchParams(e.search).get(`query`)??``,[e.search]),i=(0,V.useMemo)(()=>t8e(e.search),[e.search]),[a,o]=(0,V.useState)(r),[s,c]=(0,V.useState)(r);(0,V.useEffect)(()=>{o(r),c(r)},[r]),(0,V.useEffect)(()=>{let e=setTimeout(()=>c(a),$6e);return()=>clearTimeout(e)},[a]);let{data:l,isLoading:u,error:d}=Q6e(s,i),f=(0,V.useMemo)(()=>a.trim().split(/\s+/).filter(e=>e.length>0).map(e=>e.toLowerCase()).sort((e,t)=>t.length-e.length),[a]);return(0,V.useEffect)(()=>{t({layout:{alignY:`start`,width:`wide`,topGap:`comfortable`},panelClassName:`w-full`,bodyClassName:`p-0`,maxHeight:`min(88dvh,920px)`,onDismissRequest:void 0})},[t]),(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col gap-4 p-3 sm:p-4`,children:[(0,H.jsxs)(`div`,{role:`tablist`,"aria-label":`Search source`,className:`bg-muted border-border inline-grid min-h-9 w-fit shrink-0 grid-cols-2 rounded-md border p-0.5`,children:[(0,H.jsx)(i8e,{scope:`active-root`,current:i,label:`Active root`,onSelect:t=>{kp.replace(`pop`,J9(a,t),e.state)}}),(0,H.jsx)(i8e,{scope:`referenced-specs`,current:i,label:`Referenced Specs`,onSelect:t=>{kp.replace(`pop`,J9(a,t),e.state)}})]}),(0,H.jsxs)(`div`,{className:`relative shrink-0`,children:[(0,H.jsx)(al,{className:`text-muted-foreground absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2`}),(0,H.jsx)(`input`,{autoFocus:!0,value:a,onChange:t=>{let n=t.target.value;o(n),kp.replace(`pop`,J9(n,i),e.state)},placeholder:i===`active-root`?`Search Owned Specs, Changes, and Archives...`:`Search Referenced Specs...`,className:`border-input bg-background focus:ring-ring w-full rounded-md border py-2 pl-9 pr-3 text-sm focus:outline-none focus:ring-2`})]}),u&&(0,H.jsx)(`div`,{"aria-busy":`true`,children:(0,H.jsx)(uL,{count:4})}),d&&(0,H.jsx)(`div`,{className:`rounded-md border border-red-500/40 bg-red-500/5 p-3 text-sm text-red-600`,children:d.message}),!u&&!d&&a.trim().length>0&&l.length===0&&(0,H.jsx)(`div`,{className:`text-muted-foreground rounded-md border p-6 text-center text-sm`,children:i===`active-root`?`No matching results in the active Planning root for “${a.trim()}”.`:`No matching Referenced Specs currently observed for “${a.trim()}”.`}),!u&&!d&&l.length>0&&(0,H.jsx)(`ul`,{className:`border-border divide-border min-h-0 w-full min-w-0 flex-1 divide-y overflow-y-auto rounded-md border`,children:l.map(e=>(0,H.jsx)(`li`,{className:`min-w-0`,children:(0,H.jsxs)(`button`,{type:`button`,className:`hover:bg-muted/50 flex w-full min-w-0 flex-col items-start gap-2 p-3 text-left`,onClick:()=>{let t=kp.getAreaForPath(e.href);Ib.push(t,e.href,null),n()},children:[(0,H.jsxs)(`div`,{className:`grid w-full min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-3`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,H.jsx)(e8e(e.kind),{className:`text-muted-foreground h-4 w-4 shrink-0`}),(0,H.jsx)(`span`,{className:`line-clamp-2 break-words text-sm font-medium`,children:Y9(e.title,f)})]}),(0,H.jsx)(`span`,{className:`text-muted-foreground shrink-0 text-[11px] uppercase`,children:e.scope===`referenced-specs`?(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,H.jsx)(Hc,{className:`h-3 w-3`,"aria-hidden":!0}),` read-only `,e.kind]}):e.kind})]}),(0,H.jsx)(`div`,{className:`text-muted-foreground w-full break-all text-xs`,children:Y9(e.path,f)}),(0,H.jsx)(`div`,{className:`text-muted-foreground line-clamp-3 w-full break-words text-xs`,children:Y9(e.snippet,f)})]})},e.documentId))})]})}function i8e({scope:e,current:t,label:n,onSelect:r}){let i=t===e;return(0,H.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":i,onClick:()=>r(e),className:`min-w-28 rounded px-3 py-1 text-sm font-medium transition-colors ${i?`bg-background text-foreground shadow-sm`:`text-muted-foreground`}`,children:n})}var a8e=`theme`;function o8e(){if(typeof window>`u`)return`system`;let e=window.localStorage.getItem(a8e);return e===`light`||e===`dark`||e===`system`?e:`system`}function s8e(e){typeof window>`u`||window.localStorage.setItem(a8e,e)}function c8e(e){if(typeof window>`u`)return;let t=document.documentElement;if(e===`system`){let e=window.matchMedia(`(prefers-color-scheme: dark)`).matches;t.classList.toggle(`dark`,e);return}t.classList.toggle(`dark`,e===`dark`)}var l8e=[{value:`light`,label:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(hl,{className:`h-3.5 w-3.5`}),`Light`]})},{value:`dark`,label:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(qc,{className:`h-3.5 w-3.5`}),`Dark`]})},{value:`system`,label:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Kc,{className:`h-3.5 w-3.5`}),`System`]})}];function u8e(){let[e,t]=(0,V.useState)(o8e);return(0,V.useEffect)(()=>{c8e(e),s8e(e)},[e]),(0,V.useEffect)(()=>{if(e!==`system`)return;let t=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>c8e(`system`);return t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)},[e]),(0,H.jsxs)(`div`,{className:`max-w-2xl space-y-8 p-4`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(sl,{className:`h-6 w-6 shrink-0`}),`Settings`]}),(0,H.jsxs)(`section`,{className:`space-y-4`,children:[(0,H.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Appearance`}),(0,H.jsxs)(`div`,{className:`border-border rounded-lg border p-4`,children:[(0,H.jsx)(`label`,{className:`mb-3 block text-sm font-medium`,children:`Theme`}),(0,H.jsx)(IL,{value:e,onChange:t,options:l8e})]})]})]})}function d8e(e,t){return e.length===t.length?e.every((e,n)=>{let r=t[n];return r!==void 0&&H_(e.identity)===H_(r.identity)}):!1}function f8e(){return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function p8e(e){if(typeof document>`u`){e.update();return}let t=document;if(!e.container||f8e()||typeof t.startViewTransition!=`function`||t.activeViewTransition){e.update();return}e.container.style.viewTransitionName=e.transitionName;try{t.startViewTransition(()=>(0,es.flushSync)(e.update)).finished.catch(()=>{}).finally(()=>{e.container?.style.viewTransitionName===e.transitionName&&(e.container.style.viewTransitionName=``)})}catch{e.container.style.viewTransitionName=``,e.update()}}function m8e(e,t,n){let[r,i]=(0,V.useState)(e),a=(0,V.useRef)(e),o=(0,V.useRef)(t),s=(0,V.useRef)(0),c=(0,V.useRef)(!1),l=`vt-spec-list-${(0,V.useId)().replace(/[^a-zA-Z0-9_-]/g,``)}`,u=o.current!==t||!c.current||e===void 0;return(0,V.useLayoutEffect)(()=>{if(!c.current){c.current=!0,o.current=t,a.current=e,i(e);return}if(o.current!==t){o.current=t,a.current=e,s.current+=1,i(e);return}let r=a.current;if(a.current=e,r===e)return;let u=s.current+1;if(s.current=u,e===void 0||r===void 0||d8e(r,e)){i(e);return}queueMicrotask(()=>{s.current===u&&p8e({container:n.current,transitionName:l,update:()=>{s.current===u&&i(e)}})})},[n,e,t,l]),u?e:r}function h8e(e){return typeof e!=`object`||!e?`owned`:e.__specListScope===`referenced`?`referenced`:`owned`}function g8e(){let e=zs(),{data:t,isLoading:n,error:r}=koe(),[i,a]=(0,V.useState)(()=>h8e(e.state)),o=(0,V.useMemo)(()=>t?.entries.filter(e=>e.identity.kind===`owned`)??[],[t]),s=(0,V.useMemo)(()=>{let e=new Map;for(let n of t?.entries??[]){if(n.identity.kind!==`referenced`)continue;let t=e.get(n.identity.storeId)??[];t.push(n),e.set(n.identity.storeId,t)}return(t?.referenceSources??[]).map(t=>({source:t,specs:e.get(t.storeId)??[]})).sort((e,t)=>e.source.storeId.localeCompare(t.source.storeId))},[t]),c=s.reduce((e,{specs:t})=>e+t.length,0),l=(0,V.useRef)(null),u=m8e((0,V.useMemo)(()=>i===`owned`?o:s.flatMap(({specs:e})=>e),[o,s,i]),i,l),d=u?.filter(e=>e.identity.kind===`owned`)??[],f=s.map(({source:e})=>({source:e,specs:u?.filter(t=>t.identity.kind===`referenced`&&t.identity.storeId===e.storeId)??[]})),p=r?(0,H.jsxs)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,H.jsx)(tc,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`p`,{className:`font-medium`,children:`Spec Catalog subscription failed.`}),(0,H.jsx)(`p`,{className:`break-words`,children:r.message})]})]}):null;return n&&!t&&!r?(0,H.jsxs)(`div`,{className:`space-y-6 p-4`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(bc,{className:`h-6 w-6 shrink-0`}),`Specifications`]}),(0,H.jsx)(uL,{count:5})]}):!t&&r?(0,H.jsxs)(`div`,{className:`space-y-6 p-4`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(bc,{className:`h-6 w-6 shrink-0`}),`Specifications`]}),p]}):(0,H.jsxs)(`div`,{className:`space-y-6 p-4`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(bc,{className:`h-6 w-6 shrink-0`}),`Specifications`]}),p,(0,H.jsxs)(`div`,{role:`tablist`,"aria-label":`Spec source`,className:`bg-muted border-border inline-grid min-h-9 grid-cols-2 rounded-md border p-0.5`,children:[(0,H.jsx)(v8e,{scope:`owned`,current:i,label:`Owned`,count:o.length,onSelect:a}),(0,H.jsx)(v8e,{scope:`referenced`,current:i,label:`Referenced`,count:c,onSelect:a})]}),i===`owned`?(0,H.jsxs)(`div`,{ref:l,"data-spec-list-continuity":!0,className:`border-border divide-border divide-y rounded-lg border`,children:[d.map(e=>(0,H.jsx)(y8e,{spec:e},H_(e.identity))),d.length===0&&!r?(0,H.jsx)(`div`,{className:`text-muted-foreground p-4 text-center`,children:`No Owned Specs found in the current Planning root.`}):null]}):(0,H.jsxs)(`div`,{ref:l,"data-spec-list-continuity":!0,className:`border-border divide-border divide-y rounded-lg border`,children:[f.map(({source:e,specs:t})=>(0,H.jsxs)(`section`,{"aria-labelledby":`reference-store-${encodeURIComponent(e.storeId)}`,children:[(0,H.jsxs)(`div`,{className:`bg-muted/30 border-border flex min-w-0 flex-wrap items-center justify-between gap-2 border-b px-4 py-2`,children:[(0,H.jsx)(`h2`,{id:`reference-store-${encodeURIComponent(e.storeId)}`,className:`min-w-0 truncate font-mono text-sm font-semibold`,title:e.storeId,children:e.storeId}),(0,H.jsxs)(g9,{ariaLabel:`Reference Store ${e.storeId}: ${t.length} Specs, read-only`,tooltip:`Specs from Reference Store ${e.storeId} are read-only projections.`,children:[(0,H.jsx)(Hc,{className:`h-3 w-3`,"aria-hidden":!0}),t.length,` Specs`]})]}),e.state===`error`?(0,H.jsx)(`div`,{role:`alert`,className:`text-destructive space-y-1 px-4 py-3 text-sm`,children:e.provenance===`live`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{children:`OpenSpec could not enumerate this observed Reference Store.`}),(0,H.jsxs)(`div`,{children:[`Exit status: `,e.evidence.exitCode??`unknown`]}),e.evidence.contractError?(0,H.jsx)(`div`,{children:e.evidence.contractError}):null,e.evidence.stderr?(0,H.jsx)(`div`,{children:e.evidence.stderr}):null,[...e.diagnostics,...e.evidence.diagnostics].map((e,t)=>(0,H.jsxs)(`div`,{children:[e.code,`: `,e.message]},`${e.code}:${t}`))]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`div`,{children:`Published static snapshot records this Reference source as unavailable.`}),(0,H.jsxs)(`div`,{children:[e.snapshot.specCount,` published Specs.`]})]})}):(0,H.jsxs)(`div`,{className:`divide-border divide-y`,children:[t.map(e=>(0,H.jsx)(y8e,{spec:e},H_(e.identity))),t.length===0&&!r?(0,H.jsx)(`div`,{className:`text-muted-foreground px-4 py-3 text-sm`,children:`OpenSpec reported no Specs for this Store.`}):null]})]},e.storeId)),s.length===0&&!r?(0,H.jsx)(_8e,{referenceProjection:t?.referenceProjection??{provenance:`live`}}):null]})]})}function _8e({referenceProjection:e}){return(0,H.jsx)(`div`,{className:`text-muted-foreground p-4 text-center`,children:g_(e).with({provenance:`live`},()=>`No Referenced Specs currently observed.`).with({provenance:`static`,policy:`include`},()=>`Published static snapshot includes no Reference sources.`).with({provenance:`static`,policy:`omit`},({referenceSourceCount:e})=>`Published static snapshot omitted Referenced Spec content from ${e} sources.`).with({provenance:`static`,policy:`none`},()=>`Published static snapshot records no effective Reference sources.`).with({provenance:`static`,policy:`unavailable`},()=>`Published static snapshot does not include a Reference inventory.`).exhaustive()})}function v8e({scope:e,current:t,label:n,count:r,onSelect:i}){let a=t===e;return(0,H.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":a,onClick:()=>i(e),className:`min-w-28 rounded px-3 py-1 text-sm font-medium transition-colors ${a?`bg-background text-foreground shadow-sm`:`text-muted-foreground`}`,children:[n,` `,(0,H.jsx)(`span`,{className:`tabular-nums`,children:r})]})}function y8e({spec:e}){let t=H_(e.identity),n={family:`specs`,entityId:t},r=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,H.jsx)(bc,{...rb(n,`icon`),className:`text-muted-foreground h-5 w-5 shrink-0`}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{...rb(n,`title`),className:`truncate font-medium`,children:e.name}),(0,H.jsxs)(`div`,{className:`text-muted-foreground truncate text-sm`,children:[e.identity.kind===`referenced`&&(0,H.jsxs)(H.Fragment,{children:[e.identity.storeId,` · `]}),e.identity.specId,e.updatedAt>0&&(0,H.jsxs)(H.Fragment,{children:[` · `,mL(e.updatedAt)]})]}),e.summary&&(0,H.jsx)(`div`,{className:`text-muted-foreground truncate text-sm`,children:e.summary}),e.readOnly?(0,H.jsx)(`span`,{className:`sr-only`,children:`Read-only Reference`}):null]})]}),(0,H.jsx)(ec,{className:`text-muted-foreground h-4 w-4 shrink-0`})]}),i={family:`specs`,entityId:t,title:e.name,subtitle:e.identity.kind===`owned`?e.identity.specId:`${e.identity.storeId} / ${e.identity.specId}`},a={vt:{sharedElements:n},...rb(n,`container`),className:`hover:bg-muted/50 flex items-center justify-between gap-3 p-4`};return e.identity.kind===`owned`?(0,H.jsx)(Nb,{to:`/specs/owned/$specId`,params:{specId:e.identity.specId},state:e=>({...e,__vtHandoff:i}),...a,children:r}):(0,H.jsx)(Nb,{to:`/specs/referenced/$storeId/$specId`,params:{storeId:e.identity.storeId,specId:e.identity.specId},state:e=>({...e,__vtHandoff:i}),...a,children:r})}function b8e(){let{specId:e,storeId:t}=qo({strict:!1}),n=(0,V.useMemo)(()=>U_({specId:e,...t?{storeId:t}:{}}),[e,t]),r=ab(zs().state),{data:i,isLoading:a,error:o}=Aoe(n),{data:s}=qy(),{data:c}=Jy(),l=(0,V.useMemo)(()=>y1(s?.translation,c),[s?.translation,c]);return a&&!i?(0,H.jsx)(x8e,{identity:n,title:r?.title,subtitle:r?.subtitle}):o&&(!i||i.state===`not-found`)?(0,H.jsx)(X9,{message:o.message}):!i||i.state===`not-found`?(0,H.jsx)(`div`,{className:`text-destructive p-4`,children:`Spec not found`}):i.source===`owned`?(0,H.jsx)(S8e,{identity:n,spec:i.spec,rawMarkdown:i.rawMarkdown??``,translationConfig:l,errorMessage:o?.message}):(0,H.jsx)(C8e,{document:i,errorMessage:o?.message})}function X9({message:e}){return(0,H.jsx)(`div`,{role:`alert`,className:`border-destructive/40 bg-destructive/10 text-destructive flex items-start gap-2 rounded-md border p-4`,children:(0,H.jsxs)(`span`,{children:[`Error loading spec: `,e]})})}function x8e({identity:e,title:t,subtitle:n}){let r={family:`specs`,entityId:H_(e)};return(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 p-4`,children:[(0,H.jsx)(Z9,{identity:e,title:t??e.specId,subtitle:n,sharedDescriptor:r}),(0,H.jsx)(`div`,{className:`vt-detail-content rounded-lg border p-4`,"aria-busy":`true`,children:(0,H.jsx)(dL,{count:6})})]})}function Z9({identity:e,title:t,subtitle:n,sourceRef:r,sharedDescriptor:i}){let a=n??(e.kind===`owned`?`Owned · ${e.specId}`:`Referenced from ${e.storeId} · ${e.specId}`);return(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-4`,children:[(0,H.jsx)(Nb,{to:`/specs`,state:t=>({...t,__specListScope:e.kind}),vt:{source:r,sharedElements:i},className:`hover:bg-muted shrink-0 rounded-md p-2`,"aria-label":`Back to specifications`,children:(0,H.jsx)(Gs,{className:`h-5 w-5`})}),(0,H.jsxs)(`div`,{ref:r,...rb(i,`container`),className:`min-w-0`,children:[(0,H.jsxs)(`h1`,{className:`font-nav flex min-w-0 items-center gap-2 text-2xl font-bold`,children:[(0,H.jsx)(bc,{...rb(i,`icon`),className:`h-6 w-6 shrink-0`}),(0,H.jsx)(`span`,{...rb(i,`title`),className:`truncate`,children:t})]}),(0,H.jsx)(`p`,{className:`text-muted-foreground truncate`,children:a})]})]})}function S8e({identity:e,spec:t,rawMarkdown:n,translationConfig:r,errorMessage:i}){let a=(0,V.useRef)(null),o={family:`specs`,entityId:H_(e)};return t?(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 p-4`,children:[i?(0,H.jsx)(X9,{message:i}):null,(0,H.jsx)(Z9,{identity:e,title:t.name,sourceRef:a,sharedDescriptor:o}),(0,H.jsx)(j3,{markdown:n,path:`specs/${t.id}/spec.md`,className:`vt-detail-content min-h-0 flex-1`,translationConfig:r})]}):(0,H.jsx)(`div`,{className:`text-destructive p-4`,children:`Spec not found`})}function C8e({document:e,errorMessage:t}){let n=(0,V.useRef)(null),r={family:`specs`,entityId:H_(e.identity)},i=k8e(e);return(0,H.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 p-4`,children:[t?(0,H.jsx)(X9,{message:t}):null,(0,H.jsx)(Z9,{identity:e.identity,title:e.upstream?.title??e.spec?.name??e.identity.specId,subtitle:i.subtitle,sourceRef:n,sharedDescriptor:r}),(0,H.jsxs)(`div`,{className:`border-border bg-muted/30 flex items-center gap-2 rounded-md border px-3 py-2 text-sm`,children:[(0,H.jsx)(Hc,{className:`h-4 w-4 shrink-0`,"aria-hidden":!0}),(0,H.jsx)(`span`,{children:i.readOnlyLabel})]}),e.state===`ready`&&e.provenance.kind===`live`&&e.upstream?(0,H.jsx)(w8e,{document:e.upstream}):e.state===`ready`&&E8e(e)&&e.spec&&e.rawMarkdown?(0,H.jsx)(j3,{markdown:e.rawMarkdown,path:`referenced:${e.identity.storeId}:specs/${e.identity.specId}/spec.md`,className:`vt-detail-content min-h-0 flex-1`}):(0,H.jsx)(T8e,{document:e})]})}function w8e({document:e}){return(0,H.jsxs)(`article`,{className:`vt-detail-content min-h-0 flex-1 space-y-8 overflow-y-auto`,children:[e.overview&&(0,H.jsxs)(`section`,{className:`space-y-2`,children:[(0,H.jsx)(`h2`,{className:`font-nav text-xl font-semibold`,children:`Overview`}),(0,H.jsx)(`p`,{className:`whitespace-pre-wrap leading-7`,children:e.overview})]}),(0,H.jsxs)(`section`,{className:`space-y-5`,children:[(0,H.jsx)(`h2`,{className:`font-nav text-xl font-semibold`,children:`Requirements`}),e.requirements.map((e,t)=>(0,H.jsxs)(`div`,{className:`border-border space-y-4 border-l-2 pl-4`,children:[(0,H.jsx)(`p`,{className:`whitespace-pre-wrap leading-7`,children:e.text}),e.scenarios.map((e,t)=>(0,H.jsx)(`pre`,{className:`bg-muted overflow-x-auto whitespace-pre-wrap rounded-md p-3 text-sm`,children:e.rawText},`${t}:${e.rawText}`))]},`${t}:${e.text}`))]})]})}function T8e({document:e}){if(E8e(e))return(0,H.jsxs)(`div`,{className:`border-destructive/40 bg-destructive/5 space-y-3 rounded-md border p-4`,children:[(0,H.jsx)(`h2`,{className:`font-medium`,children:O8e(e.provenance)}),(0,H.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:D8e(e.provenance)})]});let t=e.evidence;return(0,H.jsxs)(`div`,{className:`border-destructive/40 bg-destructive/5 space-y-3 rounded-md border p-4`,children:[(0,H.jsx)(`h2`,{className:`font-medium`,children:`OpenSpec could not project this Reference Spec.`}),(0,H.jsxs)(`div`,{className:`text-muted-foreground text-sm`,children:[`Exit status: `,t.exitCode??`unknown`]}),t.contractError&&(0,H.jsx)(`pre`,{className:`whitespace-pre-wrap`,children:t.contractError}),t.stderr&&(0,H.jsx)(`pre`,{className:`whitespace-pre-wrap`,children:t.stderr}),t.diagnostics.map((e,t)=>(0,H.jsxs)(`div`,{className:`text-sm`,children:[(0,H.jsx)(`span`,{className:`font-medium`,children:e.code}),`: `,e.message]},`${e.code}:${t}`))]})}function E8e(e){return e.provenance.kind===`static`}function D8e(e){return g_(e).with({state:`omitted`},({referenceSourceCount:e})=>`Referenced content was omitted by the published snapshot policy (${e} observed sources).`).with({state:`none`},()=>`The published snapshot records no effective Reference sources.`).with({state:`snapshot-unavailable`},()=>`Static Reference inventory is unavailable for this Referenced Spec request.`).with({state:m_.union(`missing`,`included`),source:m_.not(m_.nullish)},({source:e})=>`The published snapshot does not contain this Spec from ${e.storeId}.`).with({state:m_.union(`missing`,`included`),source:null},()=>`The published snapshot does not contain this Reference Spec.`).exhaustive()}function O8e(e){return g_(e).with({state:`snapshot-unavailable`},()=>`Static Reference inventory cannot render this Referenced Spec request.`).with({state:m_.union(`included`,`missing`,`omitted`,`none`)},()=>`Published static snapshot cannot render this Reference Spec.`).exhaustive()}function k8e(e){return g_(e).with({provenance:{kind:`live`}},({identity:e})=>({subtitle:`Referenced from ${e.storeId} · ${e.specId}`,readOnlyLabel:`Read-only Reference projected from OpenSpec Store ${e.storeId}.`})).with({provenance:{kind:`static`,state:m_.union(`included`,`missing`),source:m_.not(m_.nullish)}},({identity:e,provenance:{source:t}})=>({subtitle:`Referenced from ${t.storeId} · ${e.specId}`,readOnlyLabel:`Read-only Reference projected from OpenSpec Store ${t.storeId}.`})).with({provenance:{kind:`static`,state:m_.union(`included`,`missing`),source:null}},({identity:e})=>Q9(e.specId)).with({provenance:{kind:`static`,state:`omitted`}},({identity:e})=>Q9(e.specId)).with({provenance:{kind:`static`,state:`none`}},({identity:e})=>Q9(e.specId)).with({provenance:{kind:`static`,state:`snapshot-unavailable`}},({identity:e})=>A8e(e.specId)).exhaustive()}function Q9(e){return{subtitle:`Referenced Spec request · ${e}`,readOnlyLabel:`Read-only Referenced Spec request from published static snapshot.`}}function A8e(e){return{subtitle:`Referenced Spec request · ${e}`,readOnlyLabel:`Read-only Referenced Spec request. Static Reference inventory is unavailable.`}}function j8e(e){return e.addChildren([hs({getParentRoute:()=>e,path:`/`,component:()=>null}),hs({getParentRoute:()=>e,path:`/dashboard`,component:q6e}),hs({getParentRoute:()=>e,path:`/config`,component:i3e}),hs({getParentRoute:()=>e,path:`/config/root`,component:g3e}),hs({getParentRoute:()=>e,path:`/config/schemas`,component:_3e}),hs({getParentRoute:()=>e,path:`/config/schemas/$schemaId`,component:k3e}),hs({getParentRoute:()=>e,path:`/specs`,component:g8e}),hs({getParentRoute:()=>e,path:`/specs/owned/$specId`,component:b8e}),hs({getParentRoute:()=>e,path:`/specs/referenced/$storeId/$specId`,component:b8e}),hs({getParentRoute:()=>e,path:`/changes`,component:D2e}),hs({getParentRoute:()=>e,path:`/changes/$changeId`,component:T4e}),hs({getParentRoute:()=>e,path:`/board`,component:_2e}),hs({getParentRoute:()=>e,path:`/archive`,component:oCe}),hs({getParentRoute:()=>e,path:`/archive/$changeId`,component:KKe}),hs({getParentRoute:()=>e,path:`/config/context`,component:z3e}),hs({getParentRoute:()=>e,path:`/settings`,component:u8e})])}function M8e(e){return e.addChildren([hs({getParentRoute:()=>e,path:`/`,component:()=>null}),hs({getParentRoute:()=>e,path:`/search`,component:r8e})])}function N8e(){return(0,V.useEffect)(()=>{yse()},[]),null}var $9=Bf(),P8e=Fs({routeTree:j8e(_s({component:RSe,pendingComponent:KSe})),basepath:$9});Tse(Fs({routeTree:M8e(_s({component:Cse})),history:$Se(`pop`,kp),basepath:$9}));function F8e(){return(0,H.jsx)(Qr,{client:vy,children:(0,H.jsxs)(ZSe,{children:[(0,H.jsx)(N8e,{}),(0,H.jsx)(Rs,{router:P8e})]})})}function I8e(){let e=document.getElementById(`root`);return!!e&&e.innerHTML.trim().length>0}function L8e(){let e=document.getElementById(`root`);e&&(Rf(!0),I8e()&&(e.innerHTML=``),(0,wl.createRoot)(e).render((0,H.jsx)(F8e,{})))}L8e();export{qw as $,Eye as A,Sy as At,gT as B,Uz as C,nx as Ct,nL as D,Yb as Dt,pEe as E,Xb as Et,p_e as F,Jn as Ft,Zue as G,dT as H,f_e as I,Vue as J,Wue as K,tE as L,lN as M,Cy as Mt,Dve as N,Z as Nt,Gbe as O,Gb as Ot,sN as P,Cl as Pt,Jw as Q,yT as R,Hz as S,ux as St,mEe as T,Zb as Tt,uT as U,pT as V,$w as W,Lue as X,Yw as Y,Rue as Z,mB as _,YS as _t,h6 as a,_le as at,pB as b,GS as bt,SB as c,XC as ct,kB as d,jC as dt,Kw as et,IB as f,cC as ft,gB as g,tC as gt,RB as h,QS as ht,C6 as i,iw as it,dN as j,vy as jt,wbe as k,yy as kt,NB as l,KC as lt,CB as m,$S as mt,P6 as n,Rw as nt,dV as o,vle as ot,PB as p,nC as pt,Bue as q,O6 as r,ow as rt,uV as s,gle as st,B6 as t,Hw as tt,AB as u,HC as ut,cB as v,JS as vt,Vz as w,ex as wt,Wz as x,Bx as xt,lB as y,KS as yt,vT as z};
|